mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2025-04-12 10:11:04 +00:00
Compare commits
20 Commits
v0.0.2-bet
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
0d90c0b6dd | ||
|
de9596375e | ||
|
963a48256a | ||
|
12975ba1a8 | ||
|
34615d4b6e | ||
|
f4a7801d33 | ||
|
dbef180d51 | ||
|
ad27fa6bae | ||
|
037e598d81 | ||
|
3af92fff66 | ||
|
67501640fc | ||
|
49100d1c57 | ||
|
81f10c1625 | ||
|
8d35d76c7a | ||
|
6e294f7a19 | ||
|
40ee90491e | ||
|
9174aea6e1 | ||
|
38357d6d80 | ||
|
7bdc043e10 | ||
|
1840eab0d3 |
89
README.md
89
README.md
@ -31,6 +31,17 @@
|
||||
### Mac 用户请注意!!!!
|
||||
Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `canvas` 所需要的依赖,如果安装错误 请根据 `https://github.com/Automattic/node-canvas` 手动安装
|
||||
|
||||
如果出现 `Bad CPU type in executable canvas` 的报错,按照下面步骤进行处理。
|
||||
|
||||
1. 卸载 canvas ,在这个插件目录下执行 `npm uninstall canvas`
|
||||
2. 重新安装 canvas,`npm i canvas`
|
||||
|
||||
如果你 NodeJS 是 16.14.0 版本 ,执行完上面命令之后重新打开插件应该就可以了。
|
||||
如果 NodeJS 不是16.14.0 版本,可以使用 nvm 安装一下 16.14.0。
|
||||
或者你可以在执行完上面的命令之后,修改一下 libs/psd2ui/command.sh
|
||||
里面 `$(dirname $(dirname $cur_dir))/bin/node` 删除前面的 `$(dirname $(dirname $cur_dir))/bin/` 只保留 node
|
||||
|
||||
|
||||
|
||||
#### 界面说明
|
||||
|
||||
@ -39,8 +50,9 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
1. 缓存资源按钮: 手动缓存资源MD5,当你不确定资源是否完全缓存的时候可以执行
|
||||
2. 强制导出图片选项: 勾选后,即使已经进行缓存的资源同样会导出图片
|
||||
3. 只导出图片选项: 可以把此工具只当做是切图工具,同时会将文本图层的字号及颜色输出到文件
|
||||
4. 输出路径输入框: 可以直接导出到指定路径,如果没有填写,默认为 psd 同级目录
|
||||
5. 红框区域:拖入 psd 文件夹或 psd 文件,也可以点击红框区域使用选择文件功能
|
||||
4. 中文转拼音:最终导出无论是图片名还是节点名如果包含中文,都会转成拼音。
|
||||
5. 输出路径输入框: 可以直接导出到指定路径,如果没有填写,默认为 psd 同级目录
|
||||
6. 红框区域:拖入 psd 文件夹或 psd 文件,也可以点击红框区域使用选择文件功能
|
||||
|
||||
### 属性
|
||||
|
||||
@ -54,12 +66,8 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
|
||||
<a href="#ar"> @ar 锚点</a>
|
||||
|
||||
<a href="#size"> @size 尺寸</a>
|
||||
|
||||
<a href="#full"> @full 全屏</a>
|
||||
|
||||
<a href="#scale"> @scale 缩放</a>
|
||||
|
||||
<a href="#ignore"> @ignore | @ig 忽略导出图片和节点</a>
|
||||
|
||||
<a href="#ignorenode"> @ignorenode | @ignode 忽略导出节点</a>
|
||||
@ -74,6 +82,11 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
|
||||
<a href="#flipY"> @flipY 翻转图像 (flip 变种)</a>
|
||||
|
||||
### 移除
|
||||
~~<a href="#size"> @size 尺寸</a>~~
|
||||
|
||||
~~<a href="#scale"> @scale 缩放</a>~~
|
||||
|
||||
|
||||
|
||||
### 组件
|
||||
@ -142,20 +155,7 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
```
|
||||
|
||||
<a id="size"></a>
|
||||
```
|
||||
@size{w:100,h:100}
|
||||
|
||||
节点尺寸 非图片尺寸
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
w?: 宽
|
||||
h?: 高
|
||||
只对填写的参数生效,未填写的则为计算到的值
|
||||
无参数不生效
|
||||
|
||||
```
|
||||
|
||||
<a id="full"></a>
|
||||
```
|
||||
@ -166,20 +166,6 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
```
|
||||
|
||||
<a id="scale"></a>
|
||||
```
|
||||
@scale{x:1,y:1}
|
||||
|
||||
节点缩放
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
x?: x 方向
|
||||
y?: y 方向
|
||||
只对填写的参数生效,未填写的则为 1
|
||||
|
||||
```
|
||||
|
||||
<a id="ignore"></a>
|
||||
```
|
||||
@ignore
|
||||
@ -209,7 +195,7 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
<a id="img"></a>
|
||||
```
|
||||
@img{name: string,id: 0,bind: 0}
|
||||
@img{name:string,id:number,bind:number}
|
||||
|
||||
定制图片
|
||||
作用图层:图像图层
|
||||
@ -265,10 +251,45 @@ flip 的变种 y 方向镜像图像vv
|
||||
@flipY 的图层不会导出图像
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
### 移除
|
||||
<a id="size"></a>
|
||||
```
|
||||
@size{w:100,h:100}
|
||||
|
||||
节点尺寸 非图片尺寸
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
w?: 宽
|
||||
h?: 高
|
||||
只对填写的参数生效,未填写的则为计算到的值
|
||||
无参数不生效
|
||||
|
||||
```
|
||||
|
||||
<a id="scale"></a>
|
||||
```
|
||||
@scale{x:1,y:1}
|
||||
|
||||
节点缩放
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
x?: x 方向
|
||||
y?: y 方向
|
||||
只对填写的参数生效,未填写的则为 1
|
||||
|
||||
```
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
### 说明
|
||||
多个字段可作用在同一个图层上,按需使用
|
||||
为做到所见所得,移除手动设置 @size 和 @scale,修改为自动计算,使用方式为 `@img{bind:目标id}` `@flipX{bind:目标id}` `@flipY{bind:目标id}`
|
||||
|
||||
|
||||
|
||||
|
@ -39,8 +39,9 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
1. 缓存资源按钮: 手动缓存资源MD5,当你不确定资源是否完全缓存的时候可以执行
|
||||
2. 强制导出图片选项: 勾选后,即使已经进行缓存的资源同样会导出图片
|
||||
3. 只导出图片选项: 可以把此工具只当做是切图工具,同时会将文本图层的字号及颜色输出到文件
|
||||
4. 输出路径输入框: 可以直接导出到指定路径,如果没有填写,默认为 psd 同级目录
|
||||
5. 红框区域:拖入 psd 文件夹或 psd 文件,也可以点击红框区域使用选择文件功能
|
||||
4. 中文转拼音:最终导出无论是图片名还是节点名如果包含中文,都会转成拼音。
|
||||
5. 输出路径输入框: 可以直接导出到指定路径,如果没有填写,默认为 psd 同级目录
|
||||
6. 红框区域:拖入 psd 文件夹或 psd 文件,也可以点击红框区域使用选择文件功能
|
||||
|
||||
### 属性
|
||||
|
||||
@ -54,12 +55,8 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
|
||||
<a href="#ar"> @ar 锚点</a>
|
||||
|
||||
<a href="#size"> @size 尺寸</a>
|
||||
|
||||
<a href="#full"> @full 全屏</a>
|
||||
|
||||
<a href="#scale"> @scale 缩放</a>
|
||||
|
||||
<a href="#ignore"> @ignore | @ig 忽略导出图片和节点</a>
|
||||
|
||||
<a href="#ignorenode"> @ignorenode | @ignode 忽略导出节点</a>
|
||||
@ -74,6 +71,11 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
|
||||
<a href="#flipY"> @flipY 翻转图像 (flip 变种)</a>
|
||||
|
||||
### 移除
|
||||
~~<a href="#size"> @size 尺寸</a>~~
|
||||
|
||||
~~<a href="#scale"> @scale 缩放</a>~~
|
||||
|
||||
|
||||
|
||||
### 组件
|
||||
@ -142,20 +144,7 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
```
|
||||
|
||||
<a id="size"></a>
|
||||
```
|
||||
@size{w:100,h:100}
|
||||
|
||||
节点尺寸 非图片尺寸
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
w?: 宽
|
||||
h?: 高
|
||||
只对填写的参数生效,未填写的则为计算到的值
|
||||
无参数不生效
|
||||
|
||||
```
|
||||
|
||||
<a id="full"></a>
|
||||
```
|
||||
@ -166,20 +155,6 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
```
|
||||
|
||||
<a id="scale"></a>
|
||||
```
|
||||
@scale{x:1,y:1}
|
||||
|
||||
节点缩放
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
x?: x 方向
|
||||
y?: y 方向
|
||||
只对填写的参数生效,未填写的则为 1
|
||||
|
||||
```
|
||||
|
||||
<a id="ignore"></a>
|
||||
```
|
||||
@ignore
|
||||
@ -209,7 +184,7 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
<a id="img"></a>
|
||||
```
|
||||
@img{name: string,id: 0,bind: 0}
|
||||
@img{name:string,id:number,bind:number}
|
||||
|
||||
定制图片
|
||||
作用图层:图像图层
|
||||
@ -265,10 +240,45 @@ flip 的变种 y 方向镜像图像vv
|
||||
@flipY 的图层不会导出图像
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
### 移除
|
||||
<a id="size"></a>
|
||||
```
|
||||
@size{w:100,h:100}
|
||||
|
||||
节点尺寸 非图片尺寸
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
w?: 宽
|
||||
h?: 高
|
||||
只对填写的参数生效,未填写的则为计算到的值
|
||||
无参数不生效
|
||||
|
||||
```
|
||||
|
||||
<a id="scale"></a>
|
||||
```
|
||||
@scale{x:1,y:1}
|
||||
|
||||
节点缩放
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
x?: x 方向
|
||||
y?: y 方向
|
||||
只对填写的参数生效,未填写的则为 1
|
||||
|
||||
```
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
### 说明
|
||||
多个字段可作用在同一个图层上,按需使用
|
||||
为做到所见所得,移除手动设置 @size 和 @scale,修改为自动计算,使用方式为 `@img{bind:目标id}` `@flipX{bind:目标id}` `@flipY{bind:目标id}`
|
||||
|
||||
|
||||
|
||||
|
11
ccc-tnt-psd2ui-v2.4.x/libs/psd2ui/command.bat
Normal file
11
ccc-tnt-psd2ui-v2.4.x/libs/psd2ui/command.bat
Normal file
@ -0,0 +1,11 @@
|
||||
@echo off
|
||||
|
||||
set input1=%1%
|
||||
set input2=%2%
|
||||
|
||||
cd /d %~dp0
|
||||
|
||||
%~dp0../../bin/node.exe ./index.js %input1% %input2%
|
||||
|
||||
pause
|
||||
exit
|
10
ccc-tnt-psd2ui-v2.4.x/libs/psd2ui/command.sh
Executable file
10
ccc-tnt-psd2ui-v2.4.x/libs/psd2ui/command.sh
Executable file
@ -0,0 +1,10 @@
|
||||
# exec /bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# node_dir=$(dirname $(dirname $(dirname $(realpath $0))))
|
||||
|
||||
cur_dir=$(dirname $0)
|
||||
$(dirname $(dirname $cur_dir))/bin/node $cur_dir/index.js $1 $2
|
||||
|
||||
# echo 请按任意键继续..
|
||||
# read -n 1
|
File diff suppressed because one or more lines are too long
21
ccc-tnt-psd2ui-v2.4.x/package-lock.json
generated
21
ccc-tnt-psd2ui-v2.4.x/package-lock.json
generated
@ -1,17 +1,18 @@
|
||||
{
|
||||
"name": "ccc-tnt-psd2ui",
|
||||
"version": "0.0.1",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ccc-tnt-psd2ui",
|
||||
"version": "0.0.1",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"ag-psd": "^15.0.0",
|
||||
"canvas": "^2.10.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"minimist": "^1.2.7",
|
||||
"node-fetch": "^2.7.0",
|
||||
"pinyin-pro": "^3.16.0"
|
||||
}
|
||||
},
|
||||
@ -399,8 +400,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"license": "MIT",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
@ -466,8 +468,7 @@
|
||||
},
|
||||
"node_modules/pinyin-pro": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmmirror.com/pinyin-pro/-/pinyin-pro-3.16.0.tgz",
|
||||
"integrity": "sha512-U4pMQ/KSMM5JmSb+ZcReCIbgzGl/JaglaHqWjCli0hpA0rDdjRbAO67e6fOa3ZFcJzbqfe6bJkaMMmpiWmkXgQ=="
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.0",
|
||||
@ -880,7 +881,9 @@
|
||||
"version": "2.17.0"
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
@ -916,9 +919,7 @@
|
||||
"version": "1.0.1"
|
||||
},
|
||||
"pinyin-pro": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmmirror.com/pinyin-pro/-/pinyin-pro-3.16.0.tgz",
|
||||
"integrity": "sha512-U4pMQ/KSMM5JmSb+ZcReCIbgzGl/JaglaHqWjCli0hpA0rDdjRbAO67e6fOa3ZFcJzbqfe6bJkaMMmpiWmkXgQ=="
|
||||
"version": "3.16.0"
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
|
@ -1,9 +1,13 @@
|
||||
{
|
||||
"name": "ccc-tnt-psd2ui",
|
||||
"version": "0.0.1",
|
||||
"description": "The package template for getting started.",
|
||||
"author": "Cocos Creator",
|
||||
"main": "main.js",
|
||||
"version": "1.0.0",
|
||||
"description": "PSD转预制体工具",
|
||||
"author": "onvia",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitee.com/onvia/ccc-tnt-psd2ui"
|
||||
},
|
||||
"main": "src/main.js",
|
||||
"main-menu": {
|
||||
"i18n:MAIN_MENU.package.title/ccc-tnt-psd2ui/open": {
|
||||
"message": "ccc-tnt-psd2ui:open"
|
||||
@ -23,6 +27,7 @@
|
||||
"canvas": "^2.10.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"minimist": "^1.2.7",
|
||||
"node-fetch": "^2.7.0",
|
||||
"pinyin-pro": "^3.16.0"
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ Editor.Panel.extend({
|
||||
let outputInput = root.getElementById("output");
|
||||
outputInput.value = str;
|
||||
}
|
||||
|
||||
Editor.Ipc.sendToMain('ccc-tnt-psd2ui:check-update');
|
||||
},
|
||||
onDragEnter(event) {
|
||||
event.stopPropagation()
|
||||
@ -98,14 +98,15 @@ Editor.Panel.extend({
|
||||
// Editor.
|
||||
return;
|
||||
}
|
||||
|
||||
// 参数参考
|
||||
// https://www.electronjs.org/docs/latest/api/dialog/#dialogshowopendialogbrowserwindow-options
|
||||
let result = Editor.Dialog.openFile({
|
||||
'multi': true,
|
||||
'type': "file",
|
||||
'filters': [
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
type: "file",
|
||||
filters: [
|
||||
{
|
||||
'extensions': ["psd"],
|
||||
'name': "请选择 PSD"
|
||||
extensions: ["psd"],
|
||||
name: "请选择 PSD"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 16 KiB |
@ -1,24 +1,25 @@
|
||||
'use strict';
|
||||
const Electron = require('electron');
|
||||
const packageJSON = require('./package.json');
|
||||
let fs = require('fs');
|
||||
const packageJSON = require('../package.json');
|
||||
const fs = require('fs-extra');
|
||||
const path = require("path")
|
||||
const Os = require('os');
|
||||
let child_process = require('child_process');
|
||||
let exec = child_process.exec;
|
||||
let spawn = child_process.spawn;
|
||||
const updater = require('./updater');
|
||||
const exec = child_process.exec;
|
||||
|
||||
|
||||
|
||||
const ENGINE_VER = "v249";
|
||||
const packagePath = path.join(Editor.Project.path, "packages", packageJSON.name);
|
||||
const pluginPath = path.join(Editor.Project.path, "packages", packageJSON.name);
|
||||
const projectAssets = path.join(Editor.Project.path, "assets");
|
||||
const cacheFile = path.join(Editor.Project.path, "local", "psd-to-prefab-cache.json");
|
||||
const configFile = path.join(`${packagePath}/config/psd.config.json`);
|
||||
const configFile = path.join(`${pluginPath}/config/psd.config.json`);
|
||||
|
||||
|
||||
const nodejsFile = path.join(packagePath, "bin", `node${Os.platform() == 'darwin' ? "" : ".exe"}`);
|
||||
const psd = path.join(packagePath, "libs", "psd2ui", "index.js");
|
||||
const nodejsFile = path.join(pluginPath, "bin", `node${Os.platform() == 'darwin' ? "" : ".exe"}`);
|
||||
const commandFile = path.join(pluginPath, "libs", "psd2ui", `command.${Os.platform() == 'darwin' ? "sh" : "bat"}`);
|
||||
const psdCore = path.join(pluginPath, "libs", "psd2ui", "index.js");
|
||||
const packagePath = path.join(pluginPath, "package.json");
|
||||
|
||||
let uuid2md5 = new Map();
|
||||
let cacheFileJson = {};
|
||||
@ -35,24 +36,35 @@ function _exec(options, tasks) {
|
||||
// 处理权限问题
|
||||
if (Os.platform() === 'darwin') {
|
||||
if (fs.statSync(nodejsFile).mode != 33261) {
|
||||
Editor.log(`[ccc-tnt-psd2ui] 设置权限`);
|
||||
Editor.log(`[ccc-tnt-psd2ui] nodejsFile 设置权限`);
|
||||
fs.chmodSync(nodejsFile, 33261);
|
||||
}
|
||||
if (fs.statSync(commandFile).mode != 33261) {
|
||||
Editor.log(`[ccc-tnt-psd2ui] commandFile 设置权限`);
|
||||
fs.chmodSync(commandFile, 33261);
|
||||
}
|
||||
}
|
||||
|
||||
Editor.log("[ccc-tnt-psd2ui] 命令参数:" + jsonContent);
|
||||
Editor.log("[ccc-tnt-psd2ui] 命令执行中");
|
||||
Editor.log("[ccc-tnt-psd2ui] 命令执行中,执行完后请手动关闭终端窗口");
|
||||
|
||||
let base64 = Buffer.from(jsonContent).toString("base64");
|
||||
tasks.push(new Promise((rs) => {
|
||||
// Editor.log(`[ccc-tnt-psd2ui] `, `${nodejsFile} ${psd}` + ' ' + `--json ${base64}`);
|
||||
exec(`${nodejsFile} ${psd}` + ' ' + `--json ${base64}`, { windowsHide: false }, (err, stdout, stderr) => {
|
||||
|
||||
let shellScript = commandFile; // 你的脚本路径
|
||||
let scriptArgs = `--json ${base64}`; // 你的脚本参数
|
||||
|
||||
let command =
|
||||
Os.platform() == 'darwin' ? `osascript -e 'tell app "Terminal" to do script "cd ${process.cwd()}; ${shellScript} ${scriptArgs}"'`
|
||||
: `start ${commandFile} ${scriptArgs}`;
|
||||
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
Editor.log("[ccc-tnt-psd2ui]:\n", stdout);
|
||||
if (stderr) {
|
||||
Editor.log(stderr);
|
||||
}
|
||||
rs();
|
||||
})
|
||||
});
|
||||
}));
|
||||
return tasks;
|
||||
}
|
||||
@ -108,6 +120,60 @@ function genUUID2MD5Mapping() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function checkUpdate() {
|
||||
|
||||
const result = await updater.checkUpdate();
|
||||
const remoteVersion = await updater.getRemoteVersion();
|
||||
if (result === -10 || result === -100) {
|
||||
Editor.info(`[ccc-tnt-psd2ui]:发现新版本:${remoteVersion}`);
|
||||
Editor.info(`[ccc-tnt-psd2ui]:下载地址:${packageJSON.repository.url}/releases`);
|
||||
} else if (result === -1) {
|
||||
Editor.log(`[ccc-tnt-psd2ui]:更新 psd2ui 运行库`);
|
||||
updateCore(remoteVersion);
|
||||
}
|
||||
}
|
||||
|
||||
async function updateCore(remoteVersion) {
|
||||
|
||||
// 备份当前版本
|
||||
Editor.log(`[ccc-tnt-psd2ui]:备份 ${psdCore}`);
|
||||
|
||||
let localVersion = updater.getLocalVersion();
|
||||
|
||||
try {
|
||||
let psdCoreFile = await fs.readFile(psdCore);
|
||||
await fs.writeFile(`${psdCore}.${localVersion}`, psdCoreFile, "binary");
|
||||
} catch (error) {
|
||||
Editor.log(`[ccc-tnt-psd2ui]:备份失败,停止更新`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
Editor.log(`[ccc-tnt-psd2ui]:备份完成,开始下载新版本`);
|
||||
try {
|
||||
let fileBuffer = await updater.downloadCoreAsBuffer("psd2ui-tools/dist/index.js");
|
||||
await fs.writeFile(psdCore, fileBuffer, "binary");
|
||||
} catch (error) {
|
||||
Editor.log(`[ccc-tnt-psd2ui]:更新失败`, error);
|
||||
return;
|
||||
}
|
||||
|
||||
Editor.log(`[ccc-tnt-psd2ui]:更新版本号`);
|
||||
|
||||
try {
|
||||
let packageJSON = await fs.readJson(packagePath);
|
||||
packageJSON.version = remoteVersion;
|
||||
await fs.writeJson(packagePath, packageJSON, {
|
||||
spaces: 4,
|
||||
encoding: 'utf-8'
|
||||
});
|
||||
} catch (error) {
|
||||
Editor.log(`[ccc-tnt-psd2ui]:更新版本号失败,下次启动会重新进行更新`, error);
|
||||
}
|
||||
|
||||
Editor.log(`[ccc-tnt-psd2ui]:更新完成`);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
load() {
|
||||
genUUID2MD5Mapping();
|
||||
@ -166,8 +232,10 @@ module.exports = {
|
||||
}
|
||||
|
||||
Promise.all(tasks).then(() => {
|
||||
genUUID2MD5Mapping();
|
||||
Editor.log("[ccc-tnt-psd2ui] psd 导出完成,输出位置为:", output ? output : "psd 同级目录");
|
||||
if (tasks.length) {
|
||||
genUUID2MD5Mapping();
|
||||
Editor.log("[ccc-tnt-psd2ui] 任务执行完成\nTips: 预制体输出位置为:", output ? output : "psd 同级目录");
|
||||
}
|
||||
}).catch((reason) => {
|
||||
Editor.log("[ccc-tnt-psd2ui] 导出失败", reason);
|
||||
}).finally(() => {
|
||||
@ -201,6 +269,9 @@ module.exports = {
|
||||
"read-cache"(event, config) {
|
||||
|
||||
},
|
||||
"asset-db:assets-deleted": onAssetDeletedListener
|
||||
"asset-db:assets-deleted": onAssetDeletedListener,
|
||||
"check-update": () => {
|
||||
checkUpdate();
|
||||
}
|
||||
},
|
||||
};
|
71
ccc-tnt-psd2ui-v2.4.x/src/updater.js
Normal file
71
ccc-tnt-psd2ui-v2.4.x/src/updater.js
Normal file
@ -0,0 +1,71 @@
|
||||
|
||||
const packageJSON = require('../package.json');
|
||||
let fetch = require('node-fetch');
|
||||
|
||||
const updater = {
|
||||
|
||||
branch: "master",
|
||||
|
||||
async getRemotePackageJson() {
|
||||
const packageJsonUrl = `${packageJSON.repository.url}/raw/${this.branch}/package.json`;
|
||||
let res = await fetch(packageJsonUrl, {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
// 请求结果
|
||||
if (res.status !== 200) {
|
||||
return null;
|
||||
}
|
||||
const json = await res.json()
|
||||
return json;
|
||||
},
|
||||
|
||||
async getRemoteVersion() {
|
||||
let json = await this.getRemotePackageJson();
|
||||
return json?.version || null;
|
||||
},
|
||||
|
||||
getLocalVersion() {
|
||||
return packageJSON.version;
|
||||
},
|
||||
|
||||
compareVersion(localVersion, remoteVersion) {
|
||||
const parts1 = localVersion.split('.');
|
||||
const parts2 = remoteVersion.split('.');
|
||||
|
||||
if (parts1.length != parts2.length) {
|
||||
// 版本号格式不正确,返回 -100
|
||||
return -100;
|
||||
}
|
||||
for (let i = 0; i < 2; i++) {
|
||||
if (parts1[i] != parts2[i]) {
|
||||
return parts1[i] < parts2[i] ? -10 : 10;
|
||||
}
|
||||
}
|
||||
|
||||
if (parts1[2] !== parts2[2]) {
|
||||
// 最后一位不一致,返回 -1 或 1
|
||||
return parts1[2] < parts2[2] ? -1 : 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
},
|
||||
|
||||
async checkUpdate() {
|
||||
let remoteVersion = await this.getRemoteVersion();
|
||||
let localVersion = this.getLocalVersion();
|
||||
let compareResult = this.compareVersion(localVersion, remoteVersion);
|
||||
return compareResult;
|
||||
},
|
||||
|
||||
async downloadCoreAsBuffer(file) {
|
||||
const targetUrl = `${packageJSON.repository.url}/raw/${this.branch}/${file}`;
|
||||
let res = await fetch(targetUrl, {
|
||||
method: 'GET',
|
||||
});
|
||||
let buffer = await res.buffer();
|
||||
return buffer;
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = updater;
|
Binary file not shown.
1191
ccc-tnt-psd2ui-v3.4.+/@types/editor.d.ts
vendored
1191
ccc-tnt-psd2ui-v3.4.+/@types/editor.d.ts
vendored
File diff suppressed because it is too large
Load Diff
16092
ccc-tnt-psd2ui-v3.4.+/@types/electron.d.ts
vendored
16092
ccc-tnt-psd2ui-v3.4.+/@types/electron.d.ts
vendored
File diff suppressed because it is too large
Load Diff
57
ccc-tnt-psd2ui-v3.4.+/@types/extension.d.ts
vendored
57
ccc-tnt-psd2ui-v3.4.+/@types/extension.d.ts
vendored
@ -1,57 +0,0 @@
|
||||
declare namespace Editor {
|
||||
|
||||
namespace Interface {
|
||||
// ---- Package ---- start
|
||||
interface PackageInfo {
|
||||
debug: boolean;
|
||||
enable: boolean;
|
||||
info: PackageJson;
|
||||
invalid: boolean;
|
||||
name: string;
|
||||
path: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
interface PackageJson {
|
||||
name: string;
|
||||
version: string;
|
||||
|
||||
title?: string;
|
||||
author?: string;
|
||||
debug?: boolean;
|
||||
description?: string;
|
||||
main?: string;
|
||||
editor?: string;
|
||||
panel?: any;
|
||||
contributions?: { [key: string]: any };
|
||||
}
|
||||
// ---- Package ---- end
|
||||
|
||||
// ---- UI ---- start
|
||||
interface PanelInfo {
|
||||
template?: string;
|
||||
style?: string;
|
||||
listeners?: { [key: string]: () => {} };
|
||||
methods?: { [key: string]: Function };
|
||||
$?: { [key: string]: string };
|
||||
ready?(): void;
|
||||
update?(...args: any[]): void;
|
||||
beforeClose?(): void;
|
||||
close?(): void;
|
||||
}
|
||||
|
||||
namespace UIKit {
|
||||
interface UIPanelInfo extends PanelInfo {
|
||||
// 向上触发事件
|
||||
dispath(eventName: string, ...arg: any): void;
|
||||
}
|
||||
|
||||
interface EditorElementBase extends HTMLElement {
|
||||
value: any;
|
||||
dispath: (name: string, event: any) => void;
|
||||
}
|
||||
|
||||
}
|
||||
// ---- UI ---- end
|
||||
}
|
||||
}
|
2
ccc-tnt-psd2ui-v3.4.+/@types/index.d.ts
vendored
2
ccc-tnt-psd2ui-v3.4.+/@types/index.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
/// <reference path="./editor.d.ts"/>
|
||||
/// <reference path="./message.d.ts"/>
|
27
ccc-tnt-psd2ui-v3.4.+/@types/message.d.ts
vendored
27
ccc-tnt-psd2ui-v3.4.+/@types/message.d.ts
vendored
@ -1,27 +0,0 @@
|
||||
import * as AssetDB from './packages/asset-db/@types/message';
|
||||
import * as Scene from './packages/scene/@types/message';
|
||||
import * as Engine from './packages/engine/@types/message';
|
||||
import * as Builder from './packages/builder/@types/public/message';
|
||||
import * as Programming from './packages/programming/@types/message';
|
||||
// import * as Extension from './packages/extension/@types/message';
|
||||
|
||||
declare global {
|
||||
interface EditorMessageContent {
|
||||
params: any[],
|
||||
result: any;
|
||||
}
|
||||
|
||||
interface EditorMessageMap {
|
||||
[x: string]: EditorMessageContent;
|
||||
}
|
||||
|
||||
interface EditorMessageMaps {
|
||||
[x: string]: EditorMessageMap;
|
||||
'asset-db': AssetDB.message;
|
||||
'scene': Scene.message;
|
||||
'engine': Engine.message;
|
||||
'builder': Builder.message;
|
||||
'programming': Programming.message,
|
||||
// 'extension': Extension.message;
|
||||
}
|
||||
}
|
@ -1,179 +0,0 @@
|
||||
import { AssetInfo, QueryAssetsOption, AssetOperationOption, AssetDBOptions, IAssetMeta } from './public';
|
||||
|
||||
export interface message extends EditorMessageMap {
|
||||
'query-ready': {
|
||||
params: [],
|
||||
result: boolean,
|
||||
},
|
||||
'create-asset': {
|
||||
params: [
|
||||
string,
|
||||
string | Buffer | null,
|
||||
] | [
|
||||
string,
|
||||
string | Buffer | null,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'import-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'copy-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'move-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
AssetOperationOption,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'delete-asset': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'open-asset': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: void,
|
||||
},
|
||||
'save-asset': {
|
||||
params: [
|
||||
string,
|
||||
string | Buffer,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'save-asset-meta': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'reimport-asset': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'refresh-asset': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'query-asset-info': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'query-asset-meta': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: IAssetMeta | null,
|
||||
},
|
||||
'query-path': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'query-url': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'query-uuid': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'query-assets': {
|
||||
params: [] | [
|
||||
QueryAssetsOption,
|
||||
],
|
||||
result: AssetInfo[],
|
||||
},
|
||||
'generate-available-url': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: string,
|
||||
},
|
||||
|
||||
// private
|
||||
|
||||
'query-asset-mtime': {
|
||||
params: [
|
||||
string
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'refresh': {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
'open-devtools': {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
'query-db-info': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: AssetDBOptions,
|
||||
},
|
||||
'create-asset-dialog': {
|
||||
params: [
|
||||
string,
|
||||
] | [
|
||||
string,
|
||||
string,
|
||||
],
|
||||
result: string | null,
|
||||
},
|
||||
'init-asset': {
|
||||
params: [
|
||||
string,
|
||||
string,
|
||||
],
|
||||
result: AssetInfo | null,
|
||||
},
|
||||
'query-all-importer': {
|
||||
params: [],
|
||||
result: string[],
|
||||
},
|
||||
'query-all-asset-types': {
|
||||
params: [],
|
||||
result: string[],
|
||||
},
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
// Basic information about the resource
|
||||
// 资源的基础信息
|
||||
export interface AssetInfo {
|
||||
// Asset name
|
||||
// 资源名字
|
||||
name: string;
|
||||
// Asset display name
|
||||
// 资源用于显示的名字
|
||||
displayName: string;
|
||||
// URL
|
||||
source: string;
|
||||
// loader 加载的层级地址
|
||||
path: string;
|
||||
// loader 加载地址会去掉扩展名,这个参数不去掉
|
||||
url: string;
|
||||
// 绝对路径
|
||||
file: string;
|
||||
// 资源的唯一 ID
|
||||
uuid: string;
|
||||
// 使用的导入器名字
|
||||
importer: string;
|
||||
// 类型
|
||||
type: string;
|
||||
// 是否是文件夹
|
||||
isDirectory: boolean;
|
||||
// 导入资源的 map
|
||||
library: { [key: string]: string };
|
||||
// 子资源 map
|
||||
subAssets: { [key: string]: AssetInfo };
|
||||
// 是否显示
|
||||
visible: boolean;
|
||||
// 是否只读
|
||||
readonly: boolean;
|
||||
|
||||
// 虚拟资源可以实例化成实体的话,会带上这个扩展名
|
||||
instantiation?: string;
|
||||
// 跳转指向资源
|
||||
redirect?: IRedirectInfo;
|
||||
// 继承类型
|
||||
extends?: string[];
|
||||
// 是否导入完成
|
||||
imported: boolean;
|
||||
// 是否导入失败
|
||||
invalid: boolean;
|
||||
}
|
||||
|
||||
export interface IRedirectInfo {
|
||||
// 跳转资源的类型
|
||||
type: string;
|
||||
// 跳转资源的 uuid
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface QueryAssetsOption {
|
||||
type?: string;
|
||||
pattern?: string;
|
||||
ccType?: string;
|
||||
extname?: string;
|
||||
importer?: string;
|
||||
isBundle?: boolean;
|
||||
}
|
||||
|
||||
export interface AssetOperationOption {
|
||||
// 是否强制覆盖已经存在的文件,默认 false
|
||||
overwrite?: boolean;
|
||||
// 是否自动重命名冲突文件,默认 false
|
||||
rename?: boolean;
|
||||
}
|
||||
|
||||
export interface AssetDBOptions {
|
||||
name: string;
|
||||
target: string;
|
||||
library: string;
|
||||
temp: string;
|
||||
/**
|
||||
* 0: 忽略错误
|
||||
* 1: 仅仅打印错误
|
||||
* 2: 打印错误、警告
|
||||
* 3: 打印错误、警告、日志
|
||||
* 4: 打印错误、警告、日志、调试信息
|
||||
*/
|
||||
level: number;
|
||||
ignoreFiles: string[];
|
||||
readonly: boolean;
|
||||
}
|
||||
|
||||
export interface ContributionInfo {
|
||||
mount?: {
|
||||
path: string;
|
||||
readonly?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ExecuteAssetDBScriptMethodOptions {
|
||||
name: string;
|
||||
method: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface IAssetMeta {
|
||||
ver: string;
|
||||
importer: string;
|
||||
imported: boolean;
|
||||
uuid: string;
|
||||
files: string[];
|
||||
subMetas: {
|
||||
[index: string]: IAssetMeta;
|
||||
};
|
||||
userData: {
|
||||
[index: string]: any;
|
||||
};
|
||||
displayName: string;
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
|
||||
export * from './public';
|
@ -1,119 +0,0 @@
|
||||
import { AssetInfo } from "../../../asset-db/@types/public";
|
||||
import { UUID } from "../public";
|
||||
import { IInternalBuildOptions } from "./options";
|
||||
export interface IBuildStatiscInfo {
|
||||
packageName: string;
|
||||
gameName: string;
|
||||
platform: string;
|
||||
scenesNum: number;
|
||||
assetsNum: number;
|
||||
scriptNum: number;
|
||||
|
||||
includeModules: string[];
|
||||
orientation: string;
|
||||
remoteServerAddress: string;
|
||||
appid: string;
|
||||
|
||||
size: number;
|
||||
time: number;
|
||||
err: string;
|
||||
// 2 为 3D 工程,1 为 2D 工程
|
||||
dimension?: 1 | 2;
|
||||
}
|
||||
|
||||
// ********************************* asset-manager *********************************
|
||||
|
||||
export class BuilderAssetCache {
|
||||
// 场景资源的 assets 信息缓存
|
||||
public readonly sceneUuids: Array<string>;
|
||||
|
||||
// 脚本资源的 assets 信息缓存
|
||||
public readonly scriptUuids: Array<string>;
|
||||
|
||||
// 除场景、脚本资源外的资源 assets uuid 缓存
|
||||
public readonly assetUuids: Array<string>;
|
||||
|
||||
init: () => Promise<void>;
|
||||
addAsset: (asset: IAssetInfo) => void;
|
||||
addInstance: (instance: any) => void;
|
||||
clearAsset: (uuid: string) => void;
|
||||
getMeta: (uuid: string) => Promise<any>;
|
||||
getAssetInfo: (uuid: string) => IAssetInfo;
|
||||
getDependUuids: (uuid: string) => Promise<readonly string[]>;
|
||||
getDependUuidsDeep: (uuid: string) => Promise<readonly string[]>;
|
||||
/**
|
||||
* 获取序列化文件
|
||||
*/
|
||||
getLibraryJSON: (uuid: string) => Promise<any>;
|
||||
getSerializedJSON: (uuid: string, options: IInternalBuildOptions) => Promise<any>;
|
||||
forEach: (type: string, handle: Function) => Promise<void>;
|
||||
getInstance: (uuid: string) => Promise<any>;
|
||||
__addStaticsInfo: (info: any) => void;
|
||||
}
|
||||
|
||||
export interface IAssetInfo extends AssetInfo {
|
||||
meta?: any;
|
||||
temp?: string; // 资源的构建缓存目录
|
||||
fatherInfo?: any;
|
||||
// fatherUuid?: string | undefined;
|
||||
userData?: any;
|
||||
subAssets: Record<string, IAssetInfo>;
|
||||
dirty?: boolean;
|
||||
// 内置资源没有 mtime
|
||||
mtime?: number;
|
||||
}
|
||||
export type IUrl = string; // 需要的是符合 url 标准的字符串,例如 asset/script/text.ts
|
||||
export type IAssetInfoMap = Record<UUID, IAssetInfo>;
|
||||
export type IUuidDependMap = Record<UUID, UUID[]>;
|
||||
export type IJsonGroupMap = Record<UUID, IJSONGroupItem>;
|
||||
export type IAssetGroupMap = Record<UUID, IAssetGroupItem>;
|
||||
|
||||
// TODO meta 的类型定义
|
||||
export type IMetaMap = Record<UUID, any>;
|
||||
export type IJsonMap = Record<UUID, any>;
|
||||
export type IInstanceMap = Record<UUID, any>;
|
||||
|
||||
export type ICompressOptions = Record<string, number>;
|
||||
export interface IAssetGroupItem {
|
||||
// 分组名字
|
||||
// name: string;
|
||||
// 分组的根 url
|
||||
baseUrls: string[];
|
||||
// 脚本编译后的实际地址
|
||||
scriptDest: string;
|
||||
// 脚本 uuid 列表
|
||||
scriptUuids: UUID[];
|
||||
// raw 资源 uuid 列表
|
||||
assetUuids: UUID[];
|
||||
}
|
||||
|
||||
export interface IJSONGroupItem {
|
||||
// 分组名字
|
||||
name?: string;
|
||||
// 分组名字
|
||||
type: string;
|
||||
// json 资源 uuid 列表
|
||||
uuids: UUID[];
|
||||
}
|
||||
|
||||
export interface IAssetGroupOptions {
|
||||
// 脚本打包后的输出路径
|
||||
scriptUrl: string;
|
||||
baseUrl: string;
|
||||
}
|
||||
|
||||
export type IGroupType = 'json' | 'script' | 'asset';
|
||||
export interface PacInfo {
|
||||
meta: any;
|
||||
asset: IAssetInfo;
|
||||
spriteFrames: any[];
|
||||
relativePath: string;
|
||||
relativeDir: string;
|
||||
}
|
||||
|
||||
export type IUpdateType = 'asset-change' | 'asset-add' | 'asset-delete';
|
||||
export interface IUpdateInfo {
|
||||
type: IUpdateType;
|
||||
uuid: string;
|
||||
}
|
||||
|
@ -1,152 +0,0 @@
|
||||
// ********************************* plugin ****************************************
|
||||
|
||||
import { BundleCompressionType, IBuildPluginConfig, IBuildTaskOption, IDisplayOptions, ISettings, IVerificationRuleMap } from '../public';
|
||||
import { BuilderAssetCache } from './asset-manager';
|
||||
import { InternalBuildResult } from './build-result';
|
||||
import { IInternalBuildOptions } from './options';
|
||||
import { ITextureCompressPlatform, ITextureCompressType } from '../public/texture-compress';
|
||||
|
||||
export interface IBuildWorkerPluginInfo {
|
||||
assetHandlers?: string;
|
||||
// 注册到各个平台的钩子函数
|
||||
hooks?: Record<string, string>;
|
||||
pkgName: string;
|
||||
internal: boolean; // 是否为内置插件
|
||||
priority: number; // 优先级
|
||||
}
|
||||
|
||||
export type IPluginHookName =
|
||||
| 'onBeforeBuild'
|
||||
| 'onAfterInit'
|
||||
| 'onBeforeInit'
|
||||
| 'onAfterInit'
|
||||
| 'onBeforeBuildAssets'
|
||||
| 'onAfterBuildAssets'
|
||||
| 'onBeforeCompressSettings'
|
||||
| 'onAfterCompressSettings'
|
||||
| 'onAfterBuild';
|
||||
// | 'onBeforeCompile'
|
||||
// | 'compile'
|
||||
// | 'onAfterCompile'
|
||||
// | 'run';
|
||||
|
||||
export type IPluginHook = Record<IPluginHookName, IInternalBaseHooks>;
|
||||
export interface IInternalHook {
|
||||
throwError?: boolean; // 插件注入的钩子函数,在执行失败时是否直接退出构建流程
|
||||
title?: string; // 插件任务整体 title,支持 i18n 写法
|
||||
// ------------------ 钩子函数 --------------------------
|
||||
onBeforeBuild?: IInternalBaseHooks;
|
||||
onBeforeInit?: IInternalBaseHooks;
|
||||
onAfterInit?: IInternalBaseHooks;
|
||||
onBeforeBuildAssets?: IInternalBaseHooks;
|
||||
onAfterBuildAssets?: IInternalBaseHooks;
|
||||
onBeforeCompressSettings?: IInternalBaseHooks;
|
||||
onAfterCompressSettings?: IInternalBaseHooks;
|
||||
onAfterBuild?: IInternalBaseHooks;
|
||||
// ------------------ 其他操作函数 ---------------------
|
||||
// 内置插件才有可能触发这个函数
|
||||
run?: (dest: string, options: IBuildTaskOption) => Promise<boolean>;
|
||||
// 内置插件才有可能触发这个函数
|
||||
compile?: (dest: string, options: IBuildTaskOption) => boolean;
|
||||
}
|
||||
|
||||
export type IInternalBaseHooks = (options: IInternalBuildOptions, result: InternalBuildResult, cache: BuilderAssetCache, ...args: any[]) => void;
|
||||
export interface IBuildTask {
|
||||
handle: (options: IInternalBuildOptions, result: InternalBuildResult, cache: BuilderAssetCache, settings?: ISettings) => {};
|
||||
title: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface IBuildHooksInfo {
|
||||
pkgNameOrder: string[];
|
||||
infos: Record<string, { path: string; internal: boolean }>;
|
||||
}
|
||||
export interface IBuildAssetHandlerInfo {
|
||||
pkgNameOrder: string[];
|
||||
handles: {[pkgName: string]: Function};
|
||||
}
|
||||
export interface IInternalBuildPluginConfig extends IBuildPluginConfig {
|
||||
platformName?: string; // 平台名,可以指定为 i18n 写法, 只有官方构建插件的该字段有效
|
||||
hooks?: string; // 钩子函数的存储路径
|
||||
panel?: string; // 存储导出 vue 组件、button 配置的脚本路径
|
||||
textureCompressConfig?: {
|
||||
// 仅对内部插件开放
|
||||
platformType: ITextureCompressPlatform; // 注册的纹理压缩平台类型
|
||||
support: {
|
||||
rgba: ITextureCompressType[];
|
||||
rgb: ITextureCompressType[];
|
||||
}; // 该平台支持的纹理压缩格式,按照推荐优先级排列
|
||||
};
|
||||
assetBundleConfig?: {
|
||||
// asset bundle 的配置
|
||||
supportedCompressionTypes: BundleCompressionType[];
|
||||
};
|
||||
priority?: number;
|
||||
wrapWithFold?: boolean; // 是否将选项显示在折叠框内(默认 true )
|
||||
options?: IDisplayOptions; // 需要注入的平台参数配置
|
||||
verifyRuleMap?: IVerificationRuleMap; // 注入的需要更改原有参数校验规则的函数
|
||||
commonOptions?: Record<string, boolean>;
|
||||
// TODO 之前为 ios-app-clip HACK 出来的接口,之后需要重新设计
|
||||
realInFileExplorer?: (options: IInternalBuildOptions | any) => void; // 根据构建配置计算输出地址(界面中的在文件夹中显示)
|
||||
debugConfig?: IDebugConfig;
|
||||
internal?: boolean;
|
||||
}
|
||||
|
||||
export interface BuildCheckResult {
|
||||
error: string;
|
||||
newValue: any;
|
||||
}
|
||||
|
||||
export type IBuildVerificationFunc = (value: any, options: IBuildTaskOption) => boolean | Promise<boolean>;
|
||||
|
||||
export interface IButtonConfigItem {
|
||||
label: string; // 按钮名称
|
||||
click?: (event: Event, options: IBuildTaskOption) => void; // 点击事件响应函数
|
||||
hookHandle?: string; // 点击后执行的方法,与 click 二选一
|
||||
tooltip?: string; // 鼠标上移到按钮上的文本提示
|
||||
// 只有指定 hookHandle 配置的按钮,才可以影响进度条,构建将会自动为每个按钮创建一个构建内置任务,并提供对应的进度 log 更新等等。
|
||||
// attributes?: any; // 想要添加在按钮上的一些属性值(class, style, title)
|
||||
}
|
||||
|
||||
export interface IDebugConfig {
|
||||
options?: IDisplayOptions; // 显示在构建平台编译运行调试工具上的配置选项
|
||||
custom?: string; // 显示在构建平台编译运行调试工具上的配置 vue 组件
|
||||
}
|
||||
|
||||
// ui-panel 注册数据
|
||||
export interface PanelInfo {
|
||||
$?: { [name: string]: string | HTMLElement | null };
|
||||
template?: string; // TODO 暂时设置为可选
|
||||
style?: string;
|
||||
methods?: { [name: string]: Function };
|
||||
ready?: Function;
|
||||
close?: Function;
|
||||
update?: (options: IBuildTaskOption, path: string, value: any) => void | Promise<void>;
|
||||
}
|
||||
|
||||
export interface IPanelThis {
|
||||
$: Record<string, HTMLElement>;
|
||||
dispatch: (name: string, ...args: any[]) => void;
|
||||
}
|
||||
|
||||
export interface IPanelInfo extends PanelInfo {
|
||||
component?: any; // 注入面板的 vue 组件,可与与 options 共存,options 会优先显示
|
||||
buttonConfig?: IButtonConfig; // 要注入的构建选项脚本
|
||||
}
|
||||
|
||||
export interface IButtonConfig {
|
||||
configs?: Record<string, IButtonConfigItem>;
|
||||
custom?: any;
|
||||
}
|
||||
|
||||
export interface ICompInfo {
|
||||
custom?: any;
|
||||
options?: IDisplayOptions;
|
||||
panelInfo?: PanelInfo;
|
||||
displayName?: string;
|
||||
wrapWithFold: boolean;
|
||||
|
||||
// ..... 初始化时未存在的字段 .....
|
||||
panel?: any; // 实例化后的 panel 对象
|
||||
pkgName?: string; // 插件名称
|
||||
}
|
@ -1,142 +0,0 @@
|
||||
import { BundleCompressionType, IAssetPathInfo, IBuildPaths, IBuildTaskOption, IBundleConfig, IJsonPathInfo, ISettings, UUID } from "../public";
|
||||
import { IAssetInfo } from "./asset-manager";
|
||||
import { ImportMapWithImports } from "./import-map";
|
||||
|
||||
export class InternalBuildResult {
|
||||
settings: ISettings;
|
||||
readonly bundles: IBundle[];
|
||||
readonly bundleMap: Record<string, IBundle>;
|
||||
// 构建实际使用到的插件脚本 uuid 列表
|
||||
plugins: UUID[];
|
||||
// 脚本资源包分组(子包/分包)
|
||||
scriptPackages: string[];
|
||||
// MD5 后缀 map
|
||||
pluginVers: Record<UUID, string>;
|
||||
// 纹理压缩任务
|
||||
imageTaskMap: Record<UUID, IImageTask>;
|
||||
compressImageResult: ICompressImageResult;
|
||||
importMap: ImportMapWithImports;
|
||||
// 传入构建的 options
|
||||
rawOptions: IBuildTaskOption;
|
||||
// 输出路径集合
|
||||
paths: IBuildPaths;
|
||||
// 允许自定义编译选项
|
||||
compileOptions?: any;
|
||||
addBundle: (bundle: IBundle) => void;
|
||||
addPlugin: (plugin: IAssetInfo) => void;
|
||||
}
|
||||
|
||||
export interface IImageTask {
|
||||
src: string;
|
||||
// TODO 这个名称已和意义有冲突需要整理调整
|
||||
dest: string[];
|
||||
presetId: string;
|
||||
hasAlpha: boolean;
|
||||
mtime?: any;
|
||||
// 生成阶段将会重新获取 bundle 的输出地址
|
||||
bundleNames: string[];
|
||||
}
|
||||
|
||||
export interface IVersionMap {
|
||||
import: Record<UUID, string>;
|
||||
native: Record<UUID, string>;
|
||||
}
|
||||
|
||||
export interface IMD5Map {
|
||||
'raw-assets': Record<UUID, string>;
|
||||
import: Record<UUID, string>;
|
||||
plugin?: Record<UUID, string>;
|
||||
}
|
||||
export interface IAtlasResult {
|
||||
assetsToImage: Record<string, string>;
|
||||
imageToAtlas: Record<string, string>;
|
||||
atlasToImages: Record<string, string[]>;
|
||||
}
|
||||
|
||||
export class IBundle {
|
||||
readonly scenes: UUID[]; // 该 bundle 中的所有场景,包含重定向的
|
||||
readonly assets: UUID[]; // 该 bundle 中的所有资源,包含重定向的
|
||||
readonly assetsWithoutRedirect: UUID[]; // 该 bundle 中的未重定向的资源
|
||||
readonly scripts: UUID[]; // 该 bundle 中的所有脚本
|
||||
readonly rootAssets: UUID[]; // 该 bundle 中的根资源,即直接放在 bundle 目录下的资源,包含重定向的资源
|
||||
readonly isSubpackage: boolean; // 该 bundle 是否是子包
|
||||
root: string; // bundle 的根目录, 开发者勾选的目录,如果是 main 包,这个字段为 ''
|
||||
dest: string; // bundle 的输出目录
|
||||
importBase: string;
|
||||
nativeBase: string;
|
||||
scriptDest: string; // 脚本的输出目录
|
||||
name: string; // bundle 的名称
|
||||
priority: number; // bundle 的优先级
|
||||
compressionType: BundleCompressionType; // bundle 的压缩类型
|
||||
assetVer: IVersionMap; // bundle 内的资源版本
|
||||
version: string; // bundle 本身的版本信息
|
||||
readonly isRemote: boolean; // bundle 是否是远程包
|
||||
redirect: Record<UUID, string>; // bundle 中的重定向资源
|
||||
deps: Set<string>; // bundle 的依赖 bundle
|
||||
groups: IGroup[]; // 该 bundle 中的资源分组
|
||||
cache: any;
|
||||
configOutPutName: string;
|
||||
config: IBundleConfig; // 该 bundle 的资源清单
|
||||
readonly isZip: boolean; // 该 bundle 是否是 zip 模式
|
||||
zipVer: string; // Zip 压缩模式,压缩包的版本
|
||||
atlasRes: IAtlasResult;
|
||||
compressRes: Record<string, string[]>;
|
||||
_rootAssets: Set<UUID>; // 该 bundle 直接包含的资源
|
||||
_scenes: Set<UUID>;
|
||||
_scripts: Set<UUID>;
|
||||
_assets: Set<UUID>;
|
||||
|
||||
addScene(scene: IAssetInfo): void;
|
||||
addScript(script: IAssetInfo): void;
|
||||
addRootAsset(asset: IAssetInfo): void;
|
||||
addAsset(asset: IAssetInfo): void;
|
||||
removeAsset(asset: UUID): void;
|
||||
addRedirectWithUuid(asset: UUID, redirect: string): void;
|
||||
addRedirect(asset: IAssetInfo, redirect: string): void;
|
||||
addAssetWithUuid(asset: UUID): void;
|
||||
getRedirect(uuid: UUID): string | undefined;
|
||||
addGroup(type: IJSONGroupType, uuids: UUID[]): void;
|
||||
addToGroup(type: IJSONGroupType, uuid: UUID): void;
|
||||
removeFromGroups(uuid: UUID): void;
|
||||
getJsonPath(uuid: string): string;
|
||||
getAssetPathInfo(uuid: string): IAssetPathInfo | null;
|
||||
containsAsset(uuid: string): boolean;
|
||||
getRawAssetPaths(uuid: string): string[];
|
||||
getJsonPathInfo(uuid: string): IJsonPathInfo | null;
|
||||
|
||||
_resolveImportPath: (name: string) => string;
|
||||
_resolveNativePath: (libraryPath: string, extName: string) => string;
|
||||
}
|
||||
|
||||
export type ICompressImageResult = Record<UUID, {
|
||||
formats: string[],
|
||||
files: string[],
|
||||
}>;
|
||||
|
||||
export interface IGroup {
|
||||
// 分组名字
|
||||
name?: string;
|
||||
// 分组类型
|
||||
type: IJSONGroupType;
|
||||
// 该组中的资源 uuid 列表
|
||||
uuids: UUID[];
|
||||
}
|
||||
|
||||
export type IJSONGroupType = 'NORMAL' | 'TEXTURE' | 'IMAGE';
|
||||
|
||||
export interface IDefaultGroup {
|
||||
assetUuids: UUID[];
|
||||
scriptUuids: UUID[];
|
||||
jsonUuids: UUID[];
|
||||
}
|
||||
|
||||
export interface IBundleOptions {
|
||||
root: string, // bundle 的根目录, 开发者勾选的目录,如果是 main 包,这个字段为''
|
||||
dest: string, // bundle 的输出目录
|
||||
scriptDest: string, // 脚本的输出目录
|
||||
name: string, // bundle 的名称
|
||||
priority: number, // bundle 的优先级
|
||||
compressionType: BundleCompressionType, // bundle 的压缩类型
|
||||
isRemote: boolean // bundle 是否是远程包
|
||||
// isEncrypted: boolean // bundle 中的代码是否加密,原生平台使用
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import { IBuildPanel, IInternalBuild } from ".";
|
||||
|
||||
// 定义 builder 进程内的全局变量
|
||||
declare global {
|
||||
// 构建进程可用
|
||||
// @ts-ignore
|
||||
const Build: IInternalBuild;
|
||||
|
||||
const __manager: {
|
||||
taskManager: any;
|
||||
currentCompileTask: any;
|
||||
currentBuildTask: any;
|
||||
__taskId: string;
|
||||
};
|
||||
|
||||
// 渲染进程可用
|
||||
const BuildPanel: IBuildPanel;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
|
||||
export interface ImportMap {
|
||||
imports?: Record<string, string>;
|
||||
scopes?: Record<string, Record<string, string>>;
|
||||
}
|
||||
|
||||
export type ImportMapWithImports = ImportMap & { imports: NonNullable<ImportMap['imports']> };
|
@ -1,89 +0,0 @@
|
||||
import { IBuild, IBuildUtils, ITaskState } from '../public';
|
||||
import { InternalBuildResult } from './build-result';
|
||||
|
||||
export * from './asset-manager';
|
||||
export * from './import-map';
|
||||
export * from './options';
|
||||
export * from './build-result';
|
||||
export * from './build-plugin';
|
||||
export * from '../public';
|
||||
|
||||
export type Physics = 'cannon' | 'ammo' | 'builtin';
|
||||
export type Url = string; // 需要的是符合 url 标准的字符串
|
||||
export type AssetInfoArr = Array<string | number>; // 固定两位或三位数组 [url,ccType,isSubAsset]
|
||||
export type IProcessingFunc = (process: number, message: string, state?: ITaskState) => void;
|
||||
export interface IBuildManager {
|
||||
taskManager: any;
|
||||
currentCompileTask: any;
|
||||
currentBuildTask: any;
|
||||
__taskId: string;
|
||||
}
|
||||
|
||||
export interface IQuickSpawnOption {
|
||||
cwd?: string;
|
||||
env?: any;
|
||||
downGradeWaring?: boolean; // 将会转为 log 打印,默认为 false
|
||||
downGradeLog?: boolean; // 将会转为 debug 打印,默认为 true
|
||||
downGradeError?: boolean; // 将会转为警告,默认为 false
|
||||
ignoreLog?: boolean; // 忽略 log 信息
|
||||
}
|
||||
export interface IInternalBuildUtils extends IBuildUtils {
|
||||
/**
|
||||
* 获取构建出的所有模块或者模块包文件。
|
||||
*/
|
||||
getModuleFiles(result: InternalBuildResult): Promise<string[]>;
|
||||
|
||||
/**
|
||||
* 快速开启子进程
|
||||
* @param command
|
||||
* @param cmdParams
|
||||
* @param options
|
||||
*/
|
||||
quickSpawn(command: string, cmdParams: string[], options?: IQuickSpawnOption): Promise<number | boolean>;
|
||||
|
||||
/**
|
||||
* 将某个 hash 值添加到某个路径上
|
||||
* @param targetPath
|
||||
* @param hash
|
||||
* @returns
|
||||
*/
|
||||
patchMd5ToPath(targetPath: string, hash: string): string;
|
||||
}
|
||||
|
||||
export interface IInternalBuild extends IBuild {
|
||||
Utils: IInternalBuildUtils;
|
||||
}
|
||||
|
||||
export interface IBuildProcessInfo {
|
||||
state: ITaskState; // 任务状态
|
||||
progress: number; // 任务进度
|
||||
message: string; // 最后一次更新的进度消息
|
||||
id: string; // 任务唯一标识符
|
||||
options: any; // 构建参数
|
||||
}
|
||||
|
||||
export interface fileMap {
|
||||
src: string;
|
||||
dest: string;
|
||||
}
|
||||
|
||||
export interface IScriptInfo {
|
||||
file: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
type ICheckRule = 'pathExist' | 'valid' | 'required' | 'normalName' | 'noChinese' | 'array' | 'string' | 'number' | 'http';
|
||||
|
||||
export interface IBuildPanel {
|
||||
// 内部使用的 Vue
|
||||
Vue: any;
|
||||
// 内置 vue 组件
|
||||
vueComps: {
|
||||
buildProp: any;
|
||||
templateComp: any;
|
||||
},
|
||||
validator: {
|
||||
has: (ruleName: string) => boolean;
|
||||
check: (ruleName: ICheckRule, val: any) => boolean;
|
||||
},
|
||||
}
|
@ -1,145 +0,0 @@
|
||||
import { IBuildTimeConstantValue } from "@cocos/build-engine/dist/build-time-constants";
|
||||
import { IBuildDesignResolution, IBuildTaskOption } from "../public";
|
||||
|
||||
export interface ScriptAssetuserData {
|
||||
isPlugin?: boolean;
|
||||
isNative?: boolean;
|
||||
loadPluginInNative?: boolean;
|
||||
loadPluginInWeb?: boolean;
|
||||
}
|
||||
|
||||
export interface IBuildScriptParam {
|
||||
/**
|
||||
* 若存在,表示将 import map 转换为指定的模块格式。
|
||||
*/
|
||||
importMapFormat?: 'commonjs' | 'esm';
|
||||
|
||||
polyfills?: IPolyFills;
|
||||
|
||||
/**
|
||||
* 擦除模块结构。当选择后会获得更快的脚本导入速度,但无法再使用模块特性,如 `import.meta`、`import()` 等。
|
||||
* @experimental
|
||||
*/
|
||||
experimentalEraseModules?: boolean;
|
||||
outputName: string; // 输出文件夹名称(带后缀)
|
||||
targets?: ITransformTarget;
|
||||
|
||||
system?: {
|
||||
preset?: 'web' | 'commonjs-like',
|
||||
},
|
||||
|
||||
flags: Record<string, IBuildTimeConstantValue>,
|
||||
}
|
||||
|
||||
export interface IPolyFills {
|
||||
/**
|
||||
* True if async functions polyfills(i.e. regeneratorRuntime) needs to be included.
|
||||
* You need to turn on this field if you want to use async functions in language.
|
||||
*/
|
||||
asyncFunctions?: boolean;
|
||||
|
||||
/**
|
||||
* If true, [core-js](https://github.com/zloirock/core-js) polyfills are included.
|
||||
* The default options of [core-js-builder](https://github.com/zloirock/core-js/tree/master/packages/core-js-builder)
|
||||
* will be used to build the core-js.
|
||||
*/
|
||||
coreJs?: boolean;
|
||||
|
||||
targets?: string;
|
||||
}
|
||||
/**
|
||||
* 模块保留选项。
|
||||
* - 'erase' 擦除模块信息。生成的代码中将不会保留模块信息。
|
||||
* - 'preserve' 保留原始模块信息。生成的文件将和原始模块文件结构一致。
|
||||
* - 'facade' 保留原始模块信息,将所有模块转化为一个 SystemJS 模块,但这些模块都打包在一个单独的 IIFE bundle 模块中。
|
||||
* 当这个 bundle 模块执行时,所有模块都会被注册。
|
||||
* 当你希望代码中仍旧使用模块化的特性(如动态导入、import.meta.url),但又不希望模块零散在多个文件时可以使用这个选项。
|
||||
*/
|
||||
export type ModulePreservation = 'erase' | 'preserve' | 'facade';
|
||||
|
||||
export type INewConsoleType = 'log' | 'warn' | 'error' | 'debug';
|
||||
|
||||
export interface IInternalBuildOptions extends IBuildTaskOption {
|
||||
dest: string;
|
||||
// 编译 application.js 参数配置
|
||||
appTemplateData: appTemplateData;
|
||||
// 编译引擎参数配置
|
||||
buildEngineParam: IBuildEngineParam;
|
||||
// 编译脚本配置选项
|
||||
buildScriptParam: IBuildScriptParam;
|
||||
// 序列化打包资源时的特殊处理
|
||||
assetSerializeOptions: {
|
||||
'cc.EffectAsset': {
|
||||
glsl1: boolean;
|
||||
glsl3: boolean;
|
||||
glsl4: boolean;
|
||||
};
|
||||
// 是否输出 ccon 格式
|
||||
exportCCON?: boolean;
|
||||
|
||||
allowCCONExtension?: boolean;
|
||||
};
|
||||
updateOnly: boolean;
|
||||
nextTasks?: string[];
|
||||
generateCompileConfig?: boolean;
|
||||
recompileConfig?: IRecompileConfig;
|
||||
logDest?: string; // log 输出地址
|
||||
|
||||
// 项目设置,重复定义为必选参数
|
||||
includeModules: string[];
|
||||
renderPipeline: string;
|
||||
designResolution: IBuildDesignResolution;
|
||||
physicsConfig: any;
|
||||
flags: Record<string, boolean>;
|
||||
}
|
||||
|
||||
|
||||
export interface appTemplateData {
|
||||
debugMode: boolean;
|
||||
renderMode: boolean; // !!options.renderMode,
|
||||
// ImportMapSupported: boolean;
|
||||
// NonconformingCommonJs: boolean;
|
||||
showFPS: boolean;
|
||||
importMapFile?: string;
|
||||
resolution: {
|
||||
policy: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
// hasPhysicsAmmo: boolean;
|
||||
md5Cache: boolean;
|
||||
server: string; // 服务器地址
|
||||
|
||||
cocosTemplate?: string; // 注入的子模板路径
|
||||
}
|
||||
|
||||
export interface IBuildEngineParam {
|
||||
entry?: string; // 引擎入口文件
|
||||
debug: boolean;
|
||||
sourceMaps: boolean;
|
||||
platform: string;
|
||||
includeModules: string[];
|
||||
engineVersion: string;
|
||||
md5Map: string[];
|
||||
engineName: string;
|
||||
useCache: boolean;
|
||||
split?: boolean;
|
||||
targets?: ITransformTarget;
|
||||
skip?: boolean;
|
||||
ammoJsWasm?: boolean | 'fallback';
|
||||
assetURLFormat?:
|
||||
| 'relative-from-out'
|
||||
| 'relative-from-chunk'
|
||||
| 'runtime-resolved';
|
||||
baseUrl?: string;
|
||||
}
|
||||
|
||||
export type ITransformTarget = string | string[] | Record<string, string>;
|
||||
|
||||
export interface IRecompileConfig {
|
||||
enable: boolean;
|
||||
generateAssets: boolean;
|
||||
generateScripts: boolean;
|
||||
generateEngine: boolean; // 是否生成引擎
|
||||
generateEngineByCache: boolean; // 是否使用缓存引擎
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
import { ITextureCompressType, IPVRQuality, IASTCQuality, IETCQuality } from './texture-compress';
|
||||
import { IBuildTaskOption } from './options';
|
||||
import { IBuildResult } from './build-result';
|
||||
|
||||
export interface IBuildPluginConfig {
|
||||
hooks?: string; // relate url about IHook
|
||||
options?: IDisplayOptions; // config of options
|
||||
verifyRuleMap?: IVerificationRuleMap;
|
||||
}
|
||||
|
||||
export type IVerificationFunc = (val: any, ...arg: any[]) => boolean | Promise<boolean>;
|
||||
|
||||
export type IVerificationRuleMap = Record<
|
||||
string,
|
||||
{
|
||||
func?: IVerificationFunc;
|
||||
message?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
export type IDisplayOptions = Record<string, IConfigItem>;
|
||||
|
||||
export type ArrayItem = {
|
||||
label: string;
|
||||
value: string;
|
||||
};
|
||||
export interface IConfigItem {
|
||||
// 配置显示的名字,如果需要翻译,则传入 i18n:${key}
|
||||
label?: string;
|
||||
// 设置的简单说明
|
||||
description?: string;
|
||||
// 默认值
|
||||
default?: any;
|
||||
// 配置的类型
|
||||
type?: 'array' | 'object';
|
||||
itemConfigs?: IConfigItem[] | Record<string, IConfigItem>;
|
||||
verifyRules?: string[];
|
||||
attributes?: any;
|
||||
render?: {
|
||||
ui: string;
|
||||
attributes?: any;
|
||||
items?: ArrayItem[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IBuildPlugin {
|
||||
configs?: BuildPlugin.Configs;
|
||||
assetHandlers?: BuildPlugin.AssetHandlers;
|
||||
load?: BuildPlugin.load;
|
||||
unload?: BuildPlugin.Unload;
|
||||
}
|
||||
export type IBaseHooks = (options: IBuildTaskOption, result: IBuildResult) => Promise<void> | void;
|
||||
|
||||
export namespace BuildPlugin {
|
||||
export type Configs = Record<string, IBuildPluginConfig>;
|
||||
export type AssetHandlers = string;
|
||||
export type load = () => Promise<void> | void;
|
||||
export type Unload = () => Promise<void> | void;
|
||||
}
|
||||
|
||||
export namespace BuildHook {
|
||||
export type throwError = boolean; // 插件注入的钩子函数,在执行失败时是否直接退出构建流程
|
||||
export type title = string; // 插件任务整体 title,支持 i18n 写法
|
||||
export type onBeforeBuild = IBaseHooks;
|
||||
export type onBeforeCompressSettings = IBaseHooks;
|
||||
export type onAfterCompressSettings = IBaseHooks;
|
||||
export type onAfterBuild = IBaseHooks;
|
||||
export type load = () => Promise<void> | void;
|
||||
export type unload = () => Promise<void> | void;
|
||||
}
|
||||
|
||||
export namespace AssetHandlers {
|
||||
export type compressTextures = (
|
||||
tasks: { src: string; dest: string; quality: number | IPVRQuality | IASTCQuality | IETCQuality; format: ITextureCompressType }[],
|
||||
) => Promise<void>;
|
||||
}
|
@ -1,189 +0,0 @@
|
||||
/**
|
||||
* settings.js 里定义的数据
|
||||
*/
|
||||
|
||||
import { ISplashSetting, ICustomJointTextureLayout, UUID } from "./options";
|
||||
|
||||
// ****************************** settings ************************************************
|
||||
|
||||
// debug: true
|
||||
// designResolution: {width: "960", height: "640", policy: 4}
|
||||
// jsList: ["assets/resources/b.js", "assets/resources/a.js"]
|
||||
// launchScene: "db://assets/New Scene-001.scene"
|
||||
// platform: "web-desktop"
|
||||
// rawAssets: {
|
||||
// assets: {
|
||||
// "0e95a9f8-d4e7-4849-875a-7a11dd692b34": ["mesh/env/gltf/textures/birch_yellow_mat_baseColor.png", "cc.ImageAsset"]
|
||||
// }
|
||||
// internal: {
|
||||
// "1baf0fc9-befa-459c-8bdd-af1a450a0319": ["effects/builtin-standard.effect", "cc.EffectAsset"]
|
||||
// }
|
||||
// }
|
||||
// scenes: [{url: "db://assets/New Scene-001.scene", uuid: "69dc4a42-cc6c-49fb-9a57-7de0c212f83d"},…]
|
||||
// startScene: "current_scene"
|
||||
export interface ISettings {
|
||||
CocosEngine: string;
|
||||
debug: boolean;
|
||||
designResolution: ISettingsDesignResolution;
|
||||
jsList: string[];
|
||||
launchScene: string;
|
||||
moduleIds: string[];
|
||||
platform: string;
|
||||
renderPipeline: string;
|
||||
physics?: IPhysicsConfig;
|
||||
exactFitScreen: boolean;
|
||||
|
||||
bundleVers: Record<string, string>;
|
||||
subpackages: string[];
|
||||
remoteBundles: string[];
|
||||
server: string;
|
||||
hasResourcesBundle: boolean;
|
||||
hasStartSceneBundle: boolean;
|
||||
|
||||
scriptPackages?: string[];
|
||||
splashScreen?: ISplashSetting;
|
||||
|
||||
customJointTextureLayouts?: ICustomJointTextureLayout[];
|
||||
|
||||
importMaps?: Array<{
|
||||
url: string;
|
||||
map: any;
|
||||
}>;
|
||||
|
||||
macros?: Record<string, any>;
|
||||
collisionMatrix?: any;
|
||||
groupList?: any;
|
||||
// preview
|
||||
engineModules: string[];
|
||||
customLayers: {name: string, bit: number}[];
|
||||
}
|
||||
|
||||
// 物理配置
|
||||
export interface IVec3Like {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
export interface ICollisionMatrix {
|
||||
[x: string]: number;
|
||||
}
|
||||
|
||||
export interface IPhysicsMaterial {
|
||||
friction: number; // 0.5
|
||||
rollingFriction: number; // 0.1
|
||||
spinningFriction: number; // 0.1
|
||||
restitution: number; // 0.1
|
||||
}
|
||||
|
||||
export interface IPhysicsConfig {
|
||||
gravity: IVec3Like; // (0,-10, 0)
|
||||
allowSleep: boolean; // true
|
||||
sleepThreshold: number; // 0.1,最小 0
|
||||
autoSimulation: boolean; // true
|
||||
fixedTimeStep: number; // 1 / 60 ,最小 0
|
||||
maxSubSteps: number; // 1,最小 0
|
||||
defaultMaterial: IPhysicsMaterial;
|
||||
useNodeChains: boolean; // true
|
||||
collisionMatrix: ICollisionMatrix;
|
||||
physicsEngine: string;
|
||||
}
|
||||
|
||||
export interface IPackageInfo {
|
||||
name: string;
|
||||
path: string;
|
||||
uuids: UUID[];
|
||||
}
|
||||
|
||||
export interface ISettingsDesignResolution {
|
||||
width: number;
|
||||
height: number;
|
||||
policy: number;
|
||||
}
|
||||
|
||||
interface IAssetPathBase {
|
||||
bundleName?: string;
|
||||
redirect?: string; // 重定向的 bundle 包名
|
||||
}
|
||||
|
||||
export interface IRawAssetPathInfo extends IAssetPathBase {
|
||||
raw: string[];
|
||||
}
|
||||
export declare interface IAssetPathInfo extends IAssetPathBase {
|
||||
raw?: string[];
|
||||
json?: string;
|
||||
groupIndex?: number;
|
||||
}
|
||||
|
||||
export interface IJsonPathInfo extends IAssetPathBase {
|
||||
json?: string;
|
||||
groupIndex?: number;
|
||||
}
|
||||
|
||||
export interface IBuildPaths {
|
||||
dir: string; // 构建资源输出地址( assets 所在的目录,并不一定与构建目录对应)
|
||||
settings: string; // settings.json 输出地址
|
||||
systemJs?: string; // system.js 生成地址
|
||||
engineDir?: string; // 引擎生成地址
|
||||
polyfillsJs?: string; // polyfill.js 生成地址
|
||||
assets: string; // assets 目录
|
||||
subpackages: string; // subpackages 目录
|
||||
remote: string; // remote 目录
|
||||
bundleScripts: string // bundle 的脚本,某些平台无法下载脚本,则将远程包中的脚本移到本地
|
||||
applicationJS: string; // application.js 的生成地址
|
||||
compileConfig?: string; // cocos.compile.config.json
|
||||
importMap: string; // import-map 文件地址
|
||||
}
|
||||
|
||||
export declare class IBuildResult {
|
||||
dest: string; // options 指定的构建目录
|
||||
|
||||
paths: IBuildPaths; // 构建后资源相关地址集合
|
||||
|
||||
settings?: ISettings;
|
||||
|
||||
/**
|
||||
* 指定的 uuid 资源是否包含在构建资源中
|
||||
*/
|
||||
containsAsset: (uuid: string) => boolean;
|
||||
|
||||
/**
|
||||
* 获取指定 uuid 原始资源的存放路径(不包括序列化 json)
|
||||
* 自动图集的小图 uuid 和自动图集的 uuid 都将会查询到合图大图的生成路径
|
||||
* 实际返回多个路径的情况:查询 uuid 为自动图集资源,且对应图集生成多张大图,纹理压缩会有多个图片格式路径
|
||||
*/
|
||||
getRawAssetPaths: (uuid: string) => IRawAssetPathInfo[];
|
||||
|
||||
/**
|
||||
* 获取指定 uuid 资源的序列化 json 路径
|
||||
*/
|
||||
getJsonPathInfo: (uuid: string) => IJsonPathInfo[];
|
||||
|
||||
/**
|
||||
* 获取指定 uuid 资源的路径相关信息
|
||||
* @return {raw?: string[]; json?: string; groupIndex?: number;}
|
||||
* @return.raw: 该资源源文件的实际存储位置
|
||||
* @return.json: 该资源序列化 json 的实际存储位置,不存在为空
|
||||
* @return.groupIndex: 若该资源的序列化 json 在某个 json 分组内,这里标识在分组内的 index,不存在为空
|
||||
*/
|
||||
getAssetPathInfo: (uuid: string) => IAssetPathInfo[];
|
||||
}
|
||||
|
||||
export interface IBundleConfig {
|
||||
importBase: string; // bundle 中 import 目录的名称,通常是 'import'
|
||||
nativeBase: string; // native 中 native 目录的名称,通常是 'native'
|
||||
name: string; // bundle 的名称,可以通过 bundle 名称加载 bundle
|
||||
deps: string[]; // 该 bundle 依赖的其他 bundle 名称
|
||||
uuids: UUID[]; // 该 bundle 中的所有资源的 uuid
|
||||
paths: Record<string, any[]>; // 该 bundle 中可以通过路径加载的资源,参考以前 settings 中 rawAssets 的定义
|
||||
scenes: Record<string, UUID|number>; // 该 bundle 中所有场景,场景名为 key, uuid 为 value
|
||||
packs: Record<UUID, UUID[]>; // 该 bundle 中所有合并的 json, 参考以前 settings 中 packedAssets 的定义
|
||||
versions: { import: Array<string|number>, native: Array<string|number> }; // 该 bundle 中所有资源的版本号,参考以前 settings 中 md5AssetsMap 的定义
|
||||
redirect: Array<string|number>; // 该 bundle 中重定向到其他 bundle 的资源
|
||||
debug: boolean; // 是否是 debug 模式,debug 模式会对 config.json 的数据进行压缩,所以运行时得解压
|
||||
types?: string[]; // paths 中的类型数组,参考以前 settings 中 assetTypes 的定义
|
||||
encrypted?: boolean; // 原生上使用,标记该 bundle 中的脚本是否加密
|
||||
isZip?: boolean; // 是否是 zip 模式
|
||||
zipVersion?: string;
|
||||
extensionMap: Record<string, UUID[]>
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import { IBuild } from ".";
|
||||
|
||||
// 定义 builder 进程内的全局变量
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
const Build: IBuild;
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
import { ITransformOptions } from './options';
|
||||
|
||||
export * from './build-result';
|
||||
export * from './build-plugin';
|
||||
export * from './texture-compress';
|
||||
export * from './options';
|
||||
|
||||
interface IAppendRes {
|
||||
hash: string;
|
||||
paths: string[];
|
||||
}
|
||||
|
||||
interface ICreateBundleOptions {
|
||||
excludes?: string[];
|
||||
debug?: boolean;
|
||||
sourceMap?: boolean;
|
||||
}
|
||||
export interface IBuildUtils {
|
||||
/**
|
||||
* 压缩 uuid
|
||||
* 'fc991dd7-0033-4b80-9d41-c8a86a702e59' -> 'fc9913XADNLgJ1ByKhqcC5Z'
|
||||
*/
|
||||
compressUuid: (uuid: string, min: boolean) => string;
|
||||
|
||||
/**
|
||||
* 解压缩 uuid
|
||||
* 'fc9913XADNLgJ1ByKhqcC5Z' -> 'fc991dd7-0033-4b80-9d41-c8a86a702e59'
|
||||
*/
|
||||
decompressUuid: (uuid: string) => string;
|
||||
|
||||
/**
|
||||
* 翻译带有 i18n 开头的名称(i18n:test)(待定)
|
||||
* 'i18n:test' -> '测试'
|
||||
*/
|
||||
transI18nName: (name: string) => string;
|
||||
|
||||
/**
|
||||
* 移除 db 前缀
|
||||
* 'db://assets/test.jpg' -> 'assets/test.jpg'
|
||||
*/
|
||||
removeDbHeader: (url: string) => string;
|
||||
|
||||
/**
|
||||
* 将 db 开头的 url 转为项目里的实际 url
|
||||
* 'db://assets/test.jpg' -> 'c:/project/assets/test.jpg'
|
||||
*/
|
||||
dbUrlToRawPath: (url: string) => string;
|
||||
|
||||
/**
|
||||
* 从路径里获取存在的 uuid
|
||||
* 'E:\test3d\library\oc\0c0c1f5742-89b0-4a1e-b5eb-914d84f48c1c.json' -> '0c0c1f5742-89b0-4a1e-b5eb-914d84f48c1c'
|
||||
*/
|
||||
getUuidFromPath: (path: string) => string;
|
||||
|
||||
/**
|
||||
* 检查是否全局安装了 nodejs
|
||||
*/
|
||||
isInstallNodeJs: () => Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 逐文件拷贝
|
||||
*/
|
||||
copyDirSync: (src: string, dest: string) => void;
|
||||
|
||||
/**
|
||||
* 获取相对路径接口
|
||||
* 返回 / 拼接的相对路径
|
||||
*/
|
||||
relativeUrl: (from: string, to: string) => string;
|
||||
|
||||
transformCode: (code: string, options: ITransformOptions) => Promise<string>;
|
||||
|
||||
/**
|
||||
* 给指定路径添加 md5
|
||||
*/
|
||||
appendMd5ToPaths: (paths: string[]) => Promise<IAppendRes | null>;
|
||||
|
||||
calcMd5: (data: Buffer | string) => string;
|
||||
|
||||
copyPaths: (paths: { src: string; dest: string }[]) => Promise<void[]>;
|
||||
|
||||
createBundle: (src: string, dest: string, options?: ICreateBundleOptions) => Promise<unknown>;
|
||||
}
|
||||
export interface IBuild {
|
||||
Utils: IBuildUtils;
|
||||
|
||||
LIBRARY_NAME: string;
|
||||
IMPORT_HEADER: string;
|
||||
NATIVE_HEADER: string;
|
||||
ASSETS_HEADER: string;
|
||||
SUBPACKAGES_HEADER: string;
|
||||
REMOTE_HEADER: string;
|
||||
BUNDLE_SCRIPTS_HEADER: string;
|
||||
SCRIPT_NAME: string;
|
||||
CONFIG_NAME: string;
|
||||
BUNDLE_ZIP_NAME: string;
|
||||
projectTempDir: string;
|
||||
globalTempDir: string;
|
||||
buildTemplateDir: string; // 构建模板地址 build-templates
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
import { IBundleConfig, ISettings } from "./build-result";
|
||||
import { ITaskItemJSON } from "./options";
|
||||
export interface message extends EditorMessageMap {
|
||||
'open-devtools': {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
open: {
|
||||
params: [],
|
||||
result: void,
|
||||
},
|
||||
'generate-preview-setting': {
|
||||
params: any[],
|
||||
result: Promise<{
|
||||
settings: ISettings;
|
||||
script2library: Record<string, string>;
|
||||
bundleConfigs: IBundleConfig[];
|
||||
}>,
|
||||
},
|
||||
'query-tasks-info': {
|
||||
params: [],
|
||||
result: {
|
||||
queue: Record<string, ITaskItemJSON>,
|
||||
free: Promise<boolean>,
|
||||
},
|
||||
},
|
||||
'query-task': {
|
||||
params: string[],
|
||||
result: Promise<ITaskItemJSON>,
|
||||
},
|
||||
/**
|
||||
* 预览合图
|
||||
* @param {object} pacUuid
|
||||
*/
|
||||
'preview-pac': {
|
||||
params: string[],
|
||||
result: Promise<ITaskItemJSON>,
|
||||
},
|
||||
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
/**
|
||||
* 构建所需的完整参数
|
||||
*/
|
||||
export interface IBuildTaskOption {
|
||||
// 构建后的游戏文件夹生成的路径
|
||||
buildPath: string;
|
||||
debug: boolean;
|
||||
inlineSpriteFrames: boolean;
|
||||
md5Cache: boolean;
|
||||
// bundle 设置
|
||||
mainBundleCompressionType: BundleCompressionType;
|
||||
mainBundleIsRemote: boolean;
|
||||
moveRemoteBundleScript: boolean;
|
||||
mergeJson: boolean;
|
||||
name: string;
|
||||
packAutoAtlas: boolean;
|
||||
platform: Platform;
|
||||
scenes: IBuildSceneItem[];
|
||||
compressTexture: boolean;
|
||||
sourceMaps: boolean;
|
||||
startScene: string;
|
||||
outputName: string;
|
||||
experimentalEraseModules: boolean;
|
||||
|
||||
/**
|
||||
* 是否是预览进程发送的构建请求。
|
||||
* @default false
|
||||
*/
|
||||
preview?: boolean;
|
||||
|
||||
// 项目设置
|
||||
includeModules?: string[];
|
||||
renderPipeline?: string;
|
||||
designResolution?: IBuildDesignResolution;
|
||||
physicsConfig?: any;
|
||||
flags?: Record<string, boolean>;
|
||||
|
||||
|
||||
// 是否使用自定义插屏选项
|
||||
replaceSplashScreen?: boolean;
|
||||
splashScreen: ISplashSetting;
|
||||
|
||||
packages?: Record<string, any>;
|
||||
id?: string; // 手动配置构建任务 id
|
||||
// recompileConfig?: IRecompileConfig;
|
||||
|
||||
customLayers: {name: string, value: number}[];
|
||||
}
|
||||
|
||||
export type UUID = string;
|
||||
|
||||
export interface ISplashSetting {
|
||||
base64src: string;
|
||||
displayRatio: number;
|
||||
totalTime: number;
|
||||
effect: string;
|
||||
clearColor: { x: number; y: number; z: number; w: number };
|
||||
displayWatermark: boolean;
|
||||
}
|
||||
|
||||
export interface ICustomJointTextureLayout {
|
||||
textureLength: number;
|
||||
contents: IChunkContent[];
|
||||
}
|
||||
|
||||
export interface IChunkContent {
|
||||
skeleton: null | string;
|
||||
clips: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建使用的设计分辨率数据
|
||||
*/
|
||||
export interface IBuildDesignResolution {
|
||||
height: number;
|
||||
width: number;
|
||||
fitWidth?: boolean;
|
||||
fitHeight?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建使用的场景的数据
|
||||
*/
|
||||
export interface IBuildSceneItem {
|
||||
url: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
// **************************** options *******************************************
|
||||
export type Platform =
|
||||
| 'web-desktop'
|
||||
| 'web-mobile'
|
||||
| 'wechatgame'
|
||||
| 'oppo-mini-game'
|
||||
| 'vivo-mini-game'
|
||||
| 'huawei-quick-game'
|
||||
| 'alipay-mini-game'
|
||||
| 'mac'
|
||||
| 'ios'
|
||||
// | 'ios-app-clip'
|
||||
| 'android'
|
||||
| 'ohos'
|
||||
| 'windows'
|
||||
| 'xiaomi-quick-game'
|
||||
| 'baidu-mini-game'
|
||||
| 'bytedance-mini-game'
|
||||
| 'cocos-play'
|
||||
| 'huawei-agc'
|
||||
| 'link-sure'
|
||||
| 'qtt'
|
||||
| 'cocos-runtime'
|
||||
;
|
||||
|
||||
export type BundleCompressionType = 'none' | 'merge_dep' | 'merge_all_json' | 'subpackage' | 'zip';
|
||||
export type IModules = 'esm' | 'commonjs' | 'systemjs';
|
||||
|
||||
export interface ITransformOptions {
|
||||
importMapFormat: IModules;
|
||||
}
|
||||
|
||||
export type ITaskState = 'waiting' | 'success' | 'failure' | 'cancel' | 'processing';
|
||||
|
||||
export interface ITaskItemJSON {
|
||||
id: string;
|
||||
progress: number;
|
||||
state: ITaskState;
|
||||
message: string;
|
||||
options: IBuildTaskOption;
|
||||
time: string;
|
||||
dirty: boolean;
|
||||
rawOptions: IBuildTaskOption;
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
export type ITextureCompressType =
|
||||
| 'jpg'
|
||||
| 'png'
|
||||
| 'webp'
|
||||
| 'pvrtc_4bits_rgb'
|
||||
| 'pvrtc_4bits_rgba'
|
||||
| 'pvrtc_4bits_rgb_a'
|
||||
| 'pvrtc_2bits_rgb'
|
||||
| 'pvrtc_2bits_rgba'
|
||||
| 'pvrtc_2bits_rgb_a'
|
||||
| 'etc1_rgb'
|
||||
| 'etc1_rgb_a'
|
||||
| 'etc2_rgb'
|
||||
| 'etc2_rgba'
|
||||
| 'astc_4x4'
|
||||
| 'astc_5x5'
|
||||
| 'astc_6x6'
|
||||
| 'astc_8x8'
|
||||
| 'astc_10x5'
|
||||
| 'astc_10x10'
|
||||
| 'astc_12x12';
|
||||
export type ITextureCompressPlatform = 'miniGame' | 'web' | 'ios' | 'android';
|
||||
export type IQualityType = 'etc' | 'pvr' | 'number' | 'astc';
|
||||
export interface ITextureFormatInfo {
|
||||
displayName: string;
|
||||
qualityType: IQualityType;
|
||||
alpha?: boolean;
|
||||
}
|
||||
export interface ISupportFormat {
|
||||
rgb: ITextureCompressType[];
|
||||
rgba: ITextureCompressType[];
|
||||
}
|
||||
export interface IConfigGroupsInfo {
|
||||
defaultSupport?: ISupportFormat,
|
||||
support: ISupportFormat,
|
||||
displayName: string;
|
||||
icon: string;
|
||||
}
|
||||
export type IConfigGroups = Record<ITextureCompressPlatform, IConfigGroupsInfo>;
|
||||
|
||||
export type IPVRQuality = 'fastest' | 'fast' | 'normal' | 'high' | 'best';
|
||||
export type IETCQuality = 'slow' | 'fast';
|
||||
export type IASTCQuality = 'veryfast' | 'fast' | 'medium' | 'thorough' | 'exhaustive';
|
@ -1,16 +0,0 @@
|
||||
export interface IMessageItem {
|
||||
rows: number;
|
||||
translateY: number;
|
||||
show: boolean;
|
||||
title: string;
|
||||
content: string[];
|
||||
count: number;
|
||||
fold: boolean;
|
||||
type: string;
|
||||
message: any;
|
||||
texture: string;
|
||||
date?: number;
|
||||
time?: number;
|
||||
process?: string;
|
||||
stack: string[];
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
export interface message extends EditorMessageMap {
|
||||
'query-info': {
|
||||
params: [] | [
|
||||
string,
|
||||
],
|
||||
result: {
|
||||
type: string;
|
||||
version: string;
|
||||
path: string;
|
||||
nativeVersion: string; // 原生引擎类型 'custom' 'builtin'
|
||||
nativePath: string;
|
||||
editor: string;
|
||||
renderPipeline: string;
|
||||
},
|
||||
},
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from './protect/';
|
@ -1,33 +0,0 @@
|
||||
import { Platform } from "../../../builder/@types/public";
|
||||
|
||||
export type IPreviewType = 'game-view' | 'simulator' | 'browser';
|
||||
|
||||
export type ISupportDataType = 'settings' | 'renderData';
|
||||
|
||||
export interface IHookConfig {
|
||||
methods: string;
|
||||
hook: string;
|
||||
}
|
||||
export interface IGenerateSettingsOptions {
|
||||
type: IPreviewType;
|
||||
startScene?: string;
|
||||
platform?: Platform;
|
||||
}
|
||||
|
||||
export interface IPreviewPluginConfig {
|
||||
methods?: string;
|
||||
hooks?: Record<string, string>;
|
||||
}
|
||||
|
||||
// 界面渲染配置
|
||||
export interface IRenderData {
|
||||
title: string; // 预览页面 title
|
||||
enableDebugger: boolean; // 是否开启 vConsole
|
||||
config: { // 预览页面菜单栏配置
|
||||
device: string; // 设备名称
|
||||
// https://github.com/cocos-creator/engine/blob/3d/cocos/core/platform/debug.ts
|
||||
debugMode: string; // cc.DebugMode 枚举名称
|
||||
showFps: boolean;
|
||||
fps: number;
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
export interface message extends EditorMessageMap {
|
||||
'query-shared-settings': {
|
||||
params: [],
|
||||
result: {
|
||||
useDefineForClassFields: boolean;
|
||||
allowDeclareFields: boolean;
|
||||
loose: boolean;
|
||||
guessCommonJsExports: boolean;
|
||||
exportsConditions: string[];
|
||||
importMap?: {
|
||||
json: {
|
||||
imports?: Record<string, string>;
|
||||
scopes?: Record<string, Record<string, string>>;
|
||||
};
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
import {
|
||||
SetPropertyOptions,
|
||||
} from './public';
|
||||
|
||||
export interface message extends EditorMessageMap {
|
||||
'update-create-node-template': {
|
||||
params: [],
|
||||
result: any,
|
||||
},
|
||||
'open': {
|
||||
params: [],
|
||||
result: any,
|
||||
},
|
||||
'open-devtools': {
|
||||
params: [],
|
||||
result: any,
|
||||
},
|
||||
'graphical-tools': {
|
||||
params: [
|
||||
boolean,
|
||||
],
|
||||
result: void,
|
||||
},
|
||||
'open-scene': {
|
||||
params: [
|
||||
string,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'save-scene': {
|
||||
params: [] | [
|
||||
boolean,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'save-as-scene': {
|
||||
params: [
|
||||
boolean,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'close-scene': {
|
||||
params: [],
|
||||
result: boolean,
|
||||
},
|
||||
'set-property': {
|
||||
params: [
|
||||
SetPropertyOptions,
|
||||
],
|
||||
result: boolean,
|
||||
},
|
||||
'query-node-tree': {
|
||||
params: [] | [
|
||||
string,
|
||||
],
|
||||
result: any,
|
||||
},
|
||||
'execute-scene-script': {
|
||||
params: [] | [
|
||||
{
|
||||
name: string;
|
||||
method: string;
|
||||
args: any[];
|
||||
}
|
||||
],
|
||||
result: any,
|
||||
},
|
||||
}
|
@ -1,407 +0,0 @@
|
||||
// ---- 一些 engine 基础数据 ---- start
|
||||
interface Vec2 {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface Vec3 {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
interface Vec4 {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
}
|
||||
|
||||
interface Quat {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
}
|
||||
|
||||
interface Color3 {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
}
|
||||
|
||||
interface Color4 {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
a: number;
|
||||
}
|
||||
|
||||
interface Mat3 {
|
||||
m00: number;
|
||||
m01: number;
|
||||
m02: number;
|
||||
|
||||
m03: number;
|
||||
m04: number;
|
||||
m05: number;
|
||||
|
||||
m06: number;
|
||||
m07: number;
|
||||
m08: number;
|
||||
}
|
||||
|
||||
interface Mat4 {
|
||||
m00: number;
|
||||
m01: number;
|
||||
m02: number;
|
||||
m03: number;
|
||||
|
||||
m04: number;
|
||||
m05: number;
|
||||
m06: number;
|
||||
m07: number;
|
||||
|
||||
m08: number;
|
||||
m09: number;
|
||||
m10: number;
|
||||
m11: number;
|
||||
|
||||
m12: number;
|
||||
m13: number;
|
||||
m14: number;
|
||||
m15: number;
|
||||
}
|
||||
// ---- 一些 engine 基础数据 ---- end
|
||||
|
||||
// ---- 操作消息的参数定义 --- strart
|
||||
|
||||
// set-property 消息的 options 定义
|
||||
export interface SetPropertyOptions {
|
||||
uuid: string; // 修改属性的对象的 uuid
|
||||
path: string; // 属性挂载对象的搜索路径
|
||||
// key: string; // 属性的 key
|
||||
dump: IProperty; // 属性 dump 出来的数据
|
||||
}
|
||||
|
||||
// move-array-element 消息的 options 定义
|
||||
export interface MoveArrayOptions {
|
||||
uuid: string;
|
||||
path: string;
|
||||
target: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
// remove-array-element 消息的 options 定义
|
||||
export interface RemoveArrayOptions {
|
||||
uuid: string;
|
||||
path: string;
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface PasteNodeOptions {
|
||||
target: string; // 目标节点
|
||||
uuids: string | string[]; // 被复制的节点 uuids
|
||||
keepWorldTransform?: boolean; // 是否保持新节点的世界坐标不变
|
||||
}
|
||||
|
||||
export interface CutNodeOptions {
|
||||
parent: string; // 父节点
|
||||
uuids: string | string[]; // 被移入的节点 uuids
|
||||
keepWorldTransform?: boolean; // 是否保持新节点的世界坐标不变
|
||||
}
|
||||
|
||||
// create-node 消息的 options 定义
|
||||
export interface CreateNodeOptions {
|
||||
parent?: string;
|
||||
components?: string[];
|
||||
|
||||
name?: string;
|
||||
dump?: INode | IScene; // node 初始化应用的数据
|
||||
keepWorldTransform?: boolean; // 是否保持新节点的世界坐标不变
|
||||
type?: string; // 资源类型
|
||||
assetUuid?: string; // asset uuid , type value 格式保持兼容拖动的数据格式,有资源 id,则从资源内创建对应的节点
|
||||
canvasRequired?: boolean; // 是否需要有 Canvas
|
||||
unlinkPrefab?: boolean; // 创建后取消 prefab 状态
|
||||
position?: Vec3; // 指定生成的位置
|
||||
}
|
||||
|
||||
export interface ResetNodeOptions {
|
||||
uuid: string | string[];
|
||||
}
|
||||
|
||||
export interface RemoveNodeOptions {
|
||||
uuid: string | string[];
|
||||
keepWorldTransform?: boolean;
|
||||
}
|
||||
|
||||
export interface CreateComponentOptions {
|
||||
uuid: string;
|
||||
component: string;
|
||||
}
|
||||
|
||||
export interface ResetComponentOptions {
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface RemoveComponentOptions {
|
||||
uuid: string;
|
||||
component: string;
|
||||
}
|
||||
|
||||
export interface ExecuteComponentMethodOptions {
|
||||
uuid: string;
|
||||
name: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface IAnimOperation {
|
||||
funcName: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export interface ExecuteSceneScriptMethodOptions {
|
||||
name: string;
|
||||
method: string;
|
||||
args: any[];
|
||||
}
|
||||
|
||||
export type IPropertyValueType = IProperty | IProperty[] | null | undefined | number | boolean | string | Vec3 | Vec2;
|
||||
|
||||
export interface IPropertyGroupOptions {
|
||||
id: string // 默认 'default'
|
||||
name: string,
|
||||
displayOrder: number, // 默认 Infinity, 排在最后面
|
||||
style: string // 默认为 'tab'
|
||||
}
|
||||
|
||||
export interface IProperty {
|
||||
value: { [key: string]: IPropertyValueType } | IPropertyValueType;
|
||||
default?: any; // 默认值
|
||||
|
||||
// 多选节点之后,这里存储多个数据,用于自行判断多选后的显示效果,无需更新该数据
|
||||
values?: ({ [key: string]: IPropertyValueType } | IPropertyValueType)[];
|
||||
|
||||
cid?: string;
|
||||
type?: string;
|
||||
readonly?: boolean;
|
||||
visible?: boolean;
|
||||
name?: string;
|
||||
|
||||
elementTypeData?: IProperty; // 数组里的数据的默认值 dump
|
||||
|
||||
path?: string; // 数据的搜索路径,这个是由使用方填充的
|
||||
|
||||
isArray?: boolean;
|
||||
invalid?: boolean;
|
||||
extends?: string[]; // 继承链
|
||||
displayName?: string; // 显示到界面上的名字
|
||||
displayOrder?: number; // 显示排序
|
||||
group?: IPropertyGroupOptions; // tab
|
||||
tooltip?: string; // 提示文本
|
||||
editor?: any; // 组件上定义的编辑器数据
|
||||
animatable?: boolean; // 是否可以在动画中编辑
|
||||
|
||||
// Enum
|
||||
enumList?: any[]; // enum 类型的 list 选项数组
|
||||
|
||||
bitmaskList?: any[];
|
||||
|
||||
// Number
|
||||
min?: number; // 数值类型的最小值
|
||||
max?: number; // 数值类型的最大值
|
||||
step?: number; // 数值类型的步进值
|
||||
slide?: boolean; // 数组是否显示为滑块
|
||||
unit?: string; // 显示的单位
|
||||
radian?: boolean; // 标识是否为角度
|
||||
|
||||
// Label
|
||||
multiline?: boolean; // 字符串是否允许换行
|
||||
// nullable?: boolean; 属性是否允许为空
|
||||
}
|
||||
|
||||
export interface IRemovedComponentInfo {
|
||||
name: string;
|
||||
fileID: string;
|
||||
}
|
||||
|
||||
export interface INode {
|
||||
active: IProperty;
|
||||
locked: IProperty;
|
||||
name: IProperty;
|
||||
position: IProperty;
|
||||
|
||||
/**
|
||||
* 此为 dump 数据,非 node.rotation
|
||||
* 实际指向 node.eulerAngles
|
||||
* rotation 为了给用户更友好的文案
|
||||
*/
|
||||
rotation: IProperty;
|
||||
|
||||
scale: IProperty;
|
||||
layer: IProperty;
|
||||
uuid: IProperty;
|
||||
|
||||
children: any[];
|
||||
parent: any;
|
||||
|
||||
__comps__: IProperty[];
|
||||
__type__: string;
|
||||
__prefab__?: any;
|
||||
_prefabInstance?: any;
|
||||
removedComponents?: IRemovedComponentInfo[];
|
||||
mountedRoot?: string;
|
||||
}
|
||||
|
||||
export interface IComponent extends IProperty {
|
||||
value: {
|
||||
enabled: IPropertyValueType;
|
||||
uuid: IPropertyValueType;
|
||||
name: IPropertyValueType;
|
||||
} & Record<string, IPropertyValueType>;
|
||||
mountedRoot?: string;
|
||||
}
|
||||
|
||||
export interface IScene {
|
||||
name: IProperty;
|
||||
active: IProperty;
|
||||
locked: IProperty;
|
||||
_globals: any;
|
||||
isScene: boolean;
|
||||
autoReleaseAssets: IProperty;
|
||||
|
||||
uuid: IProperty;
|
||||
children: any[];
|
||||
parent: any;
|
||||
__type__: string;
|
||||
targetOverrides?: any;
|
||||
}
|
||||
|
||||
export interface ITargetOverrideInfo {
|
||||
source: string;
|
||||
sourceInfo?: string[];
|
||||
propertyPath: string[];
|
||||
target: string;
|
||||
targetInfo?: string[];
|
||||
}
|
||||
// ---- 操作消息的参数定义 --- end
|
||||
|
||||
// ---- 场景插件返回的 info 信息 ---- start
|
||||
interface ScenePluginNodeInfo {
|
||||
uuid: string;
|
||||
components: ScenePluginComponentInfo[];
|
||||
}
|
||||
|
||||
// 场景插件传回的场景信息
|
||||
export interface ScenePluginInfo {
|
||||
// 选中节点列表
|
||||
nodes: ScenePluginNodeInfo[];
|
||||
|
||||
// gizmo 的一些信息
|
||||
gizmo: {
|
||||
is2D: boolean;
|
||||
};
|
||||
// 当前编辑模式数组
|
||||
modes: string[];
|
||||
}
|
||||
|
||||
// 场景插件传回的组件信息
|
||||
export interface ScenePluginComponentInfo {
|
||||
uuid: string;
|
||||
enabled: boolean;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface QueryClassesOptions {
|
||||
extends?: string | string[];
|
||||
excludeSelf?: boolean;
|
||||
}
|
||||
|
||||
// ---- 场景插件返回的 info 信息 ---- end
|
||||
|
||||
// ---- 动画数据 ---- start
|
||||
|
||||
export interface IKeyDumpData {
|
||||
frame: number;
|
||||
dump: any; // value的dump数据
|
||||
inTangent?: number;
|
||||
inTangentWeight?: number;
|
||||
outTangent?: number;
|
||||
outTangentWeight?: number;
|
||||
interpMode?: number;
|
||||
broken?: boolean;
|
||||
tangentWeightMode?: number;
|
||||
imgUrl?: string;
|
||||
easingMethod?: number;
|
||||
}
|
||||
|
||||
export interface IDumpType {
|
||||
value: string;
|
||||
extends?: string[];
|
||||
}
|
||||
|
||||
export interface IPropCurveDumpData {
|
||||
nodePath: string;
|
||||
keyframes: IKeyDumpData[];
|
||||
displayName: string;
|
||||
key: string;
|
||||
type?: IDumpType;
|
||||
preExtrap: number;
|
||||
postExtrap: number;
|
||||
isCurveSupport: boolean; // 是否支持贝塞尔曲线编辑
|
||||
}
|
||||
|
||||
export interface IAnimCopyKeySrcInfo {
|
||||
curvesDump: IPropCurveDumpData[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyNodeSrcInfo {
|
||||
curvesDump: IPropCurveDumpData[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyNodeDstInfo {
|
||||
nodePath: string;
|
||||
}
|
||||
|
||||
interface IEventDump {
|
||||
frame: number;
|
||||
func: string;
|
||||
params: string[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyEventSrcInfo {
|
||||
eventsDump: IEventDump[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyPropSrcInfo {
|
||||
curvesDump: IPropCurveDumpData[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyPropDstInfo {
|
||||
nodePath: string;
|
||||
propKeys?: string[];
|
||||
}
|
||||
|
||||
export interface IAnimCopyKeyDstInfo {
|
||||
nodePath: string;
|
||||
propKeys?: string[];
|
||||
startFrame: number;
|
||||
}
|
||||
|
||||
export interface IAnimCopyEventDstInfo {
|
||||
startFrame: number;
|
||||
}
|
||||
// ---- 动画数据 ---- end
|
||||
|
||||
// ---- Contributions ---- start
|
||||
|
||||
export interface ContributionDropItem {
|
||||
type: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
// ---- Contributions ---- end
|
||||
|
||||
export interface UnitTestInfo {
|
||||
name: string;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
// 消息定义
|
||||
interface MessageInterface {
|
||||
params: any[],
|
||||
result: any;
|
||||
}
|
||||
|
||||
// host
|
||||
export interface HostInfo {
|
||||
host: string;
|
||||
ip: string;
|
||||
port: number;
|
||||
}
|
||||
|
||||
// 消息定义
|
||||
export interface main {
|
||||
scene: {
|
||||
[x: string]: MessageInterface;
|
||||
'query-port': {
|
||||
params: [],
|
||||
result: number,
|
||||
};
|
||||
'scan-lan': {
|
||||
params: [],
|
||||
result: HostInfo[],
|
||||
};
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
export interface ShortcutItem {
|
||||
when: string;
|
||||
message: string;
|
||||
shortcut: string;
|
||||
pkgName: string;
|
||||
rawShortcut?: string;
|
||||
key: string;
|
||||
missing?: boolean;
|
||||
}
|
||||
|
||||
export type IShortcutItemMap = Record<string, ShortcutItem>;
|
||||
|
||||
export interface IShortcutEditInfo {
|
||||
key: string;
|
||||
shortcut: string;
|
||||
searches: ShortcutItem[];
|
||||
conflict: boolean;
|
||||
when: string;
|
||||
}
|
@ -39,8 +39,9 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
1. 缓存资源按钮: 手动缓存资源MD5,当你不确定资源是否完全缓存的时候可以执行
|
||||
2. 强制导出图片选项: 勾选后,即使已经进行缓存的资源同样会导出图片
|
||||
3. 只导出图片选项: 可以把此工具只当做是切图工具,同时会将文本图层的字号及颜色输出到文件
|
||||
4. 输出路径输入框: 可以直接导出到指定路径,如果没有填写,默认为 psd 同级目录
|
||||
5. 红框区域:拖入 psd 文件夹或 psd 文件,也可以点击红框区域使用选择文件功能
|
||||
4. 中文转拼音:最终导出无论是图片名还是节点名如果包含中文,都会转成拼音。
|
||||
5. 输出路径输入框: 可以直接导出到指定路径,如果没有填写,默认为 psd 同级目录
|
||||
6. 红框区域:拖入 psd 文件夹或 psd 文件,也可以点击红框区域使用选择文件功能
|
||||
|
||||
### 属性
|
||||
|
||||
@ -54,12 +55,8 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
|
||||
<a href="#ar"> @ar 锚点</a>
|
||||
|
||||
<a href="#size"> @size 尺寸</a>
|
||||
|
||||
<a href="#full"> @full 全屏</a>
|
||||
|
||||
<a href="#scale"> @scale 缩放</a>
|
||||
|
||||
<a href="#ignore"> @ignore | @ig 忽略导出图片和节点</a>
|
||||
|
||||
<a href="#ignorenode"> @ignorenode | @ignode 忽略导出节点</a>
|
||||
@ -74,6 +71,11 @@ Mac 下首次使用需要先执行根目录下的 `install_depends.sh` 安装 `c
|
||||
|
||||
<a href="#flipY"> @flipY 翻转图像 (flip 变种)</a>
|
||||
|
||||
### 移除
|
||||
~~<a href="#size"> @size 尺寸</a>~~
|
||||
|
||||
~~<a href="#scale"> @scale 缩放</a>~~
|
||||
|
||||
|
||||
|
||||
### 组件
|
||||
@ -142,20 +144,7 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
```
|
||||
|
||||
<a id="size"></a>
|
||||
```
|
||||
@size{w:100,h:100}
|
||||
|
||||
节点尺寸 非图片尺寸
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
w?: 宽
|
||||
h?: 高
|
||||
只对填写的参数生效,未填写的则为计算到的值
|
||||
无参数不生效
|
||||
|
||||
```
|
||||
|
||||
<a id="full"></a>
|
||||
```
|
||||
@ -166,20 +155,6 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
```
|
||||
|
||||
<a id="scale"></a>
|
||||
```
|
||||
@scale{x:1,y:1}
|
||||
|
||||
节点缩放
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
x?: x 方向
|
||||
y?: y 方向
|
||||
只对填写的参数生效,未填写的则为 1
|
||||
|
||||
```
|
||||
|
||||
<a id="ignore"></a>
|
||||
```
|
||||
@ignore
|
||||
@ -209,7 +184,7 @@ check 为 Toggle 的属性,类型为 Sprite
|
||||
|
||||
<a id="img"></a>
|
||||
```
|
||||
@img{name: string,id: 0,bind: 0}
|
||||
@img{name:string,id:number,bind:number}
|
||||
|
||||
定制图片
|
||||
作用图层:图像图层
|
||||
@ -265,10 +240,45 @@ flip 的变种 y 方向镜像图像vv
|
||||
@flipY 的图层不会导出图像
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
---
|
||||
### 移除
|
||||
<a id="size"></a>
|
||||
```
|
||||
@size{w:100,h:100}
|
||||
|
||||
节点尺寸 非图片尺寸
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
w?: 宽
|
||||
h?: 高
|
||||
只对填写的参数生效,未填写的则为计算到的值
|
||||
无参数不生效
|
||||
|
||||
```
|
||||
|
||||
<a id="scale"></a>
|
||||
```
|
||||
@scale{x:1,y:1}
|
||||
|
||||
节点缩放
|
||||
作用图层: 所有图层
|
||||
|
||||
参数:
|
||||
x?: x 方向
|
||||
y?: y 方向
|
||||
只对填写的参数生效,未填写的则为 1
|
||||
|
||||
```
|
||||
---
|
||||
---
|
||||
---
|
||||
|
||||
### 说明
|
||||
多个字段可作用在同一个图层上,按需使用
|
||||
为做到所见所得,移除手动设置 @size 和 @scale,修改为自动计算,使用方式为 `@img{bind:目标id}` `@flipX{bind:目标id}` `@flipY{bind:目标id}`
|
||||
|
||||
|
||||
|
||||
|
399
ccc-tnt-psd2ui-v3.4.+/dist/main.js
vendored
399
ccc-tnt-psd2ui-v3.4.+/dist/main.js
vendored
@ -1,169 +1,230 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unload = exports.load = exports.methods = void 0;
|
||||
//@ts-ignore
|
||||
const package_json_1 = __importDefault(require("../package.json"));
|
||||
const fs_extra_1 = __importDefault(require("fs-extra"));
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const os_1 = __importDefault(require("os"));
|
||||
const child_process_1 = __importDefault(require("child_process"));
|
||||
let exec = child_process_1.default.exec;
|
||||
const ENGINE_VER = "v342"; //
|
||||
const packagePath = path_1.default.join(Editor.Project.path, "extensions", package_json_1.default.name);
|
||||
const projectAssets = path_1.default.join(Editor.Project.path, "assets");
|
||||
const cacheFile = path_1.default.join(Editor.Project.path, "local", "psd-to-prefab-cache.json");
|
||||
const configFile = path_1.default.join(`${packagePath}/config/psd.config.json`);
|
||||
const nodejsFile = path_1.default.join(packagePath, "bin", `node${os_1.default.platform() == 'darwin' ? "" : ".exe"}`);
|
||||
const psd = path_1.default.join(packagePath, "libs", "psd2ui", "index.js");
|
||||
let uuid2md5 = new Map();
|
||||
let cacheFileJson = {};
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
exports.methods = {
|
||||
openPanel() {
|
||||
Editor.Panel.open(package_json_1.default.name);
|
||||
},
|
||||
onClickPsd2UICache() {
|
||||
console.log(`main-> onClickPsd2UICache111 `);
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(`main-> onClickPsd2UICache`);
|
||||
let options = {
|
||||
"project-assets": projectAssets,
|
||||
"cache": cacheFile,
|
||||
"init": true,
|
||||
"engine-version": ENGINE_VER
|
||||
};
|
||||
Promise.all(_exec(options, [])).then(() => {
|
||||
console.log("[psd2prefab] 执行缓存结束");
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
async onPsd2UIDropFiles(param) {
|
||||
let files = param.files;
|
||||
let isForceImg = param.isForceImg;
|
||||
let isImgOnly = param.isImgOnly;
|
||||
let output = param.output;
|
||||
let isPinyin = param.isPinyin;
|
||||
let options = {
|
||||
"project-assets": projectAssets,
|
||||
"cache": cacheFile,
|
||||
"engine-version": ENGINE_VER,
|
||||
"pinyin": isPinyin,
|
||||
};
|
||||
let tasks = [];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
let stat = fs_extra_1.default.statSync(file);
|
||||
if (stat.isFile()) {
|
||||
let ext = path_1.default.extname(file);
|
||||
if (ext != '.psd') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let args = JSON.parse(JSON.stringify(options));
|
||||
args["input"] = file;
|
||||
if (output) {
|
||||
args["output"] = output;
|
||||
}
|
||||
if (isImgOnly) {
|
||||
// 只导出图片
|
||||
args["img-only"] = true;
|
||||
}
|
||||
else {
|
||||
// 强制导出图片
|
||||
if (isForceImg) {
|
||||
args["force-img"] = true;
|
||||
}
|
||||
args["config"] = configFile;
|
||||
}
|
||||
_exec(args, tasks);
|
||||
}
|
||||
Promise.all(tasks).then(() => {
|
||||
genUUID2MD5Mapping();
|
||||
console.log("[ccc-tnt-psd2ui] psd 导出完成,输出位置为:", output ? output : "psd 同级目录");
|
||||
}).catch((reason) => {
|
||||
console.log("[ccc-tnt-psd2ui] 导出失败", reason);
|
||||
}).finally(() => {
|
||||
});
|
||||
},
|
||||
};
|
||||
function _exec(options, tasks) {
|
||||
let jsonContent = JSON.stringify(options);
|
||||
if (!fs_extra_1.default.existsSync(nodejsFile)) {
|
||||
console.log(`[ccc-tnt-psd2ui] 没有内置 nodejs`, nodejsFile);
|
||||
return tasks;
|
||||
}
|
||||
// 处理权限问题
|
||||
if (os_1.default.platform() === 'darwin') {
|
||||
if (fs_extra_1.default.statSync(nodejsFile).mode != 33261) {
|
||||
console.log(`[ccc-tnt-psd2ui] 设置权限`);
|
||||
fs_extra_1.default.chmodSync(nodejsFile, 33261);
|
||||
}
|
||||
}
|
||||
console.log("[ccc-tnt-psd2ui] 命令参数:" + jsonContent);
|
||||
console.log("[ccc-tnt-psd2ui] 命令执行中");
|
||||
let base64 = Buffer.from(jsonContent).toString("base64");
|
||||
tasks.push(new Promise((rs) => {
|
||||
// console.log(`[ccc-tnt-psd2ui] `, `${nodejsFile} ${psd}` + ' ' + `--json ${base64}`);
|
||||
exec(`${nodejsFile} ${psd}` + ' ' + `--json ${base64}`, { windowsHide: false }, (err, stdout, stderr) => {
|
||||
console.log("[ccc-tnt-psd2ui]:\n", stdout);
|
||||
if (stderr) {
|
||||
console.log(stderr);
|
||||
}
|
||||
rs();
|
||||
});
|
||||
}));
|
||||
return tasks;
|
||||
}
|
||||
/**
|
||||
* 资源删除的监听
|
||||
*
|
||||
* @param {*} event
|
||||
*/
|
||||
function onAssetDeletedListener(event) {
|
||||
if (uuid2md5.has(event)) {
|
||||
let md5 = uuid2md5.get(event);
|
||||
console.log(`[ccc-tnt-psd2ui] 删除资源 md5: ${md5}, uuid: ${event}`);
|
||||
delete cacheFileJson[`${md5}`];
|
||||
fs_extra_1.default.writeFileSync(cacheFile, JSON.stringify(cacheFileJson, null, 2));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 生成 uuid 转 MD5 的映射
|
||||
*
|
||||
*/
|
||||
function genUUID2MD5Mapping() {
|
||||
if (!fs_extra_1.default.existsSync(cacheFile)) {
|
||||
return;
|
||||
}
|
||||
let content = fs_extra_1.default.readFileSync(cacheFile, 'utf-8');
|
||||
let obj = JSON.parse(content);
|
||||
cacheFileJson = obj;
|
||||
for (const key in obj) {
|
||||
const element = obj[key];
|
||||
uuid2md5.set(element.textureUuid, key);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
const load = function () {
|
||||
genUUID2MD5Mapping();
|
||||
Editor.Message.addBroadcastListener("asset-db:asset-delete", onAssetDeletedListener);
|
||||
};
|
||||
exports.load = load;
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
const unload = function () {
|
||||
Editor.Message.removeBroadcastListener("asset-db:asset-delete", onAssetDeletedListener);
|
||||
};
|
||||
exports.unload = unload;
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unload = exports.load = exports.methods = void 0;
|
||||
// @ts-ignore
|
||||
const package_json_1 = __importDefault(require("../package.json"));
|
||||
const fs_extra_1 = __importDefault(require("fs-extra"));
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const os_1 = __importDefault(require("os"));
|
||||
const child_process_1 = __importDefault(require("child_process"));
|
||||
const updater_1 = require("./updater");
|
||||
let exec = child_process_1.default.exec;
|
||||
const ENGINE_VER = "v342"; //
|
||||
const pluginPath = path_1.default.join(Editor.Project.path, "extensions", package_json_1.default.name);
|
||||
const projectAssets = path_1.default.join(Editor.Project.path, "assets");
|
||||
const cacheFile = path_1.default.join(Editor.Project.path, "local", "psd-to-prefab-cache.json");
|
||||
const configFile = path_1.default.join(`${pluginPath}/config/psd.config.json`);
|
||||
const nodejsFile = path_1.default.join(pluginPath, "bin", `node${os_1.default.platform() == 'darwin' ? "" : ".exe"}`);
|
||||
const commandFile = path_1.default.join(pluginPath, "libs", "psd2ui", `command.${os_1.default.platform() == 'darwin' ? "sh" : "bat"}`);
|
||||
const psdCore = path_1.default.join(pluginPath, "libs", "psd2ui", "index.js");
|
||||
const packagePath = path_1.default.join(pluginPath, "package.json");
|
||||
let uuid2md5 = new Map();
|
||||
let cacheFileJson = {};
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
exports.methods = {
|
||||
openPanel() {
|
||||
Editor.Panel.open(package_json_1.default.name);
|
||||
},
|
||||
onClickPsd2UICache() {
|
||||
console.log(`main-> onClickPsd2UICache111 `);
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(`main-> onClickPsd2UICache`);
|
||||
let options = {
|
||||
"project-assets": projectAssets,
|
||||
"cache": cacheFile,
|
||||
"init": true,
|
||||
"engine-version": ENGINE_VER
|
||||
};
|
||||
Promise.all(_exec(options, [])).then(() => {
|
||||
console.log("[psd2prefab] 执行缓存结束");
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
async onPsd2UIDropFiles(param) {
|
||||
let files = param.files;
|
||||
let isForceImg = param.isForceImg;
|
||||
let isImgOnly = param.isImgOnly;
|
||||
let output = param.output;
|
||||
let isPinyin = param.isPinyin;
|
||||
let options = {
|
||||
"project-assets": projectAssets,
|
||||
"cache": cacheFile,
|
||||
"engine-version": ENGINE_VER,
|
||||
"pinyin": isPinyin,
|
||||
};
|
||||
let tasks = [];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
let stat = fs_extra_1.default.statSync(file);
|
||||
if (stat.isFile()) {
|
||||
let ext = path_1.default.extname(file);
|
||||
if (ext != '.psd') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let args = JSON.parse(JSON.stringify(options));
|
||||
args["input"] = file;
|
||||
if (output) {
|
||||
args["output"] = output;
|
||||
}
|
||||
if (isImgOnly) {
|
||||
// 只导出图片
|
||||
args["img-only"] = true;
|
||||
}
|
||||
else {
|
||||
// 强制导出图片
|
||||
if (isForceImg) {
|
||||
args["force-img"] = true;
|
||||
}
|
||||
args["config"] = configFile;
|
||||
}
|
||||
_exec(args, tasks);
|
||||
}
|
||||
Promise.all(tasks).then(() => {
|
||||
if (tasks.length) {
|
||||
genUUID2MD5Mapping();
|
||||
console.log("[ccc-tnt-psd2ui] psd 导出完成,输出位置为:", output ? output : "psd 同级目录");
|
||||
}
|
||||
}).catch((reason) => {
|
||||
console.log("[ccc-tnt-psd2ui] 导出失败", reason);
|
||||
}).finally(() => {
|
||||
});
|
||||
},
|
||||
};
|
||||
function _exec(options, tasks) {
|
||||
let jsonContent = JSON.stringify(options);
|
||||
if (!fs_extra_1.default.existsSync(nodejsFile)) {
|
||||
console.log(`[ccc-tnt-psd2ui] 没有内置 nodejs`, nodejsFile);
|
||||
return tasks;
|
||||
}
|
||||
// 处理权限问题
|
||||
if (os_1.default.platform() === 'darwin') {
|
||||
if (fs_extra_1.default.statSync(nodejsFile).mode != 33261) {
|
||||
console.log(`[ccc-tnt-psd2ui] 设置权限`);
|
||||
fs_extra_1.default.chmodSync(nodejsFile, 33261);
|
||||
}
|
||||
if (fs_extra_1.default.statSync(commandFile).mode != 33261) {
|
||||
console.log(`[ccc-tnt-psd2ui] commandFile 设置权限`);
|
||||
fs_extra_1.default.chmodSync(commandFile, 33261);
|
||||
}
|
||||
}
|
||||
console.log("[ccc-tnt-psd2ui] 命令参数:" + jsonContent);
|
||||
console.log("[ccc-tnt-psd2ui] 命令执行中,执行完后请手动关闭终端窗口");
|
||||
let base64 = Buffer.from(jsonContent).toString("base64");
|
||||
tasks.push(new Promise((rs) => {
|
||||
let shellScript = commandFile; // 你的脚本路径
|
||||
let scriptArgs = `--json ${base64}`; // 你的脚本参数
|
||||
let command = os_1.default.platform() == 'darwin' ? `osascript -e 'tell app "Terminal" to do script "cd ${process.cwd()}; ${shellScript} ${scriptArgs}"'`
|
||||
: `start ${commandFile} ${scriptArgs}`;
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
console.log("[ccc-tnt-psd2ui]:\n", stdout);
|
||||
if (stderr) {
|
||||
console.log(stderr);
|
||||
}
|
||||
rs();
|
||||
});
|
||||
}));
|
||||
return tasks;
|
||||
}
|
||||
/**
|
||||
* 资源删除的监听
|
||||
*
|
||||
* @param {*} event
|
||||
*/
|
||||
function onAssetDeletedListener(event) {
|
||||
if (uuid2md5.has(event)) {
|
||||
let md5 = uuid2md5.get(event);
|
||||
console.log(`[ccc-tnt-psd2ui] 删除资源 md5: ${md5}, uuid: ${event}`);
|
||||
delete cacheFileJson[`${md5}`];
|
||||
fs_extra_1.default.writeFileSync(cacheFile, JSON.stringify(cacheFileJson, null, 2));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 生成 uuid 转 MD5 的映射
|
||||
*
|
||||
*/
|
||||
function genUUID2MD5Mapping() {
|
||||
if (!fs_extra_1.default.existsSync(cacheFile)) {
|
||||
return;
|
||||
}
|
||||
let content = fs_extra_1.default.readFileSync(cacheFile, 'utf-8');
|
||||
let obj = JSON.parse(content);
|
||||
cacheFileJson = obj;
|
||||
for (const key in obj) {
|
||||
const element = obj[key];
|
||||
uuid2md5.set(element.textureUuid, key);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
const load = function () {
|
||||
genUUID2MD5Mapping();
|
||||
Editor.Message.addBroadcastListener("asset-db:asset-delete", onAssetDeletedListener);
|
||||
Editor.Message.addBroadcastListener("ccc-tnt-psd2ui:check-update", checkUpdate);
|
||||
};
|
||||
exports.load = load;
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
const unload = function () {
|
||||
Editor.Message.removeBroadcastListener("asset-db:asset-delete", onAssetDeletedListener);
|
||||
Editor.Message.removeBroadcastListener("ccc-tnt-psd2ui:check-update", checkUpdate);
|
||||
};
|
||||
exports.unload = unload;
|
||||
async function checkUpdate() {
|
||||
const result = await updater_1.updater.checkUpdate();
|
||||
const remoteVersion = await updater_1.updater.getRemoteVersion();
|
||||
if (result === -10 || result === -100) {
|
||||
console.info(`[ccc-tnt-psd2ui]:插件发现新版本:${remoteVersion}`);
|
||||
console.info(`[ccc-tnt-psd2ui]:下载地址:${package_json_1.default.repository.url}/releases`);
|
||||
}
|
||||
else if (result === -1) {
|
||||
console.log(`[ccc-tnt-psd2ui]:更新 psd2ui 运行库`);
|
||||
updateCore(remoteVersion);
|
||||
}
|
||||
}
|
||||
async function updateCore(remoteVersion) {
|
||||
// 备份当前版本
|
||||
console.log(`[ccc-tnt-psd2ui]:备份 ${psdCore}`);
|
||||
let localVersion = updater_1.updater.getLocalVersion();
|
||||
try {
|
||||
let psdCoreFile = await fs_extra_1.default.readFile(psdCore);
|
||||
await fs_extra_1.default.writeFile(`${psdCore}.${localVersion}`, psdCoreFile, "binary");
|
||||
}
|
||||
catch (error) {
|
||||
console.log(`[ccc-tnt-psd2ui]:备份失败,停止更新`, error);
|
||||
return;
|
||||
}
|
||||
console.log(`[ccc-tnt-psd2ui]:备份完成,开始下载新版本`);
|
||||
try {
|
||||
let fileBuffer = await updater_1.updater.downloadCoreAsBuffer("psd2ui-tools/dist/index.js");
|
||||
await fs_extra_1.default.writeFile(psdCore, fileBuffer, "binary");
|
||||
}
|
||||
catch (error) {
|
||||
console.log(`[ccc-tnt-psd2ui]:更新失败`, error);
|
||||
return;
|
||||
}
|
||||
console.log(`[ccc-tnt-psd2ui]:更新版本号`);
|
||||
try {
|
||||
let packageJSON = await fs_extra_1.default.readJson(packagePath);
|
||||
packageJSON.version = remoteVersion;
|
||||
await fs_extra_1.default.writeJson(packagePath, packageJSON, {
|
||||
spaces: 4,
|
||||
encoding: 'utf-8'
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
console.log(`[ccc-tnt-psd2ui]:更新版本号失败,下次启动会重新进行更新`);
|
||||
}
|
||||
console.log(`[ccc-tnt-psd2ui]:更新完成`);
|
||||
}
|
||||
|
251
ccc-tnt-psd2ui-v3.4.+/dist/panels/default/index.js
vendored
251
ccc-tnt-psd2ui-v3.4.+/dist/panels/default/index.js
vendored
@ -1,125 +1,126 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const vue_1 = require("vue");
|
||||
const weakMap = new WeakMap();
|
||||
const AssetDir = `${Editor.Project.path}/assets`;
|
||||
/**
|
||||
* @zh 如果希望兼容 3.3 之前的版本可以使用下方的代码
|
||||
* @en You can add the code below if you want compatibility with versions prior to 3.3
|
||||
*/
|
||||
// Editor.Panel.define = Editor.Panel.define || function(options: any) { return options }
|
||||
module.exports = Editor.Panel.define({
|
||||
listeners: {
|
||||
show() { },
|
||||
hide() { },
|
||||
},
|
||||
template: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../../static/template/default/index.html'), 'utf-8'),
|
||||
style: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../../static/style/default/index.css'), 'utf-8'),
|
||||
$: {
|
||||
app: '#app',
|
||||
},
|
||||
methods: {},
|
||||
ready() {
|
||||
if (this.$.app) {
|
||||
const app = (0, vue_1.createApp)({});
|
||||
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('ui-');
|
||||
app.component('psd2ui', {
|
||||
template: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../../static/template/vue/psd2ui.html'), 'utf-8'),
|
||||
data() {
|
||||
return {
|
||||
isImgOnly: false,
|
||||
isForceImg: false,
|
||||
isProcessing: false,
|
||||
isPinyin: true,
|
||||
outputPath: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let str = localStorage.getItem(`${Editor.Project.name}_psd2ui_output`);
|
||||
if (str) {
|
||||
this.outputPath = str;
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
localStorage.setItem(`${Editor.Project.name}_psd2ui_output`, this.outputPath);
|
||||
},
|
||||
methods: {
|
||||
async onClickCache() {
|
||||
if (this.isProcessing)
|
||||
return;
|
||||
this.isProcessing = true;
|
||||
await Editor.Message.request("ccc-tnt-psd2ui", "on-click-cache");
|
||||
this.isProcessing = false;
|
||||
},
|
||||
onForceChanged(e) {
|
||||
this.isForceImg = !this.isForceImg;
|
||||
},
|
||||
onImgOnlyChanged() {
|
||||
this.isImgOnly = !this.isImgOnly;
|
||||
},
|
||||
onPinyinChanged() {
|
||||
this.isPinyin = !this.isPinyin;
|
||||
},
|
||||
async onClickDropArea(event) {
|
||||
if (this.isProcessing) {
|
||||
Editor.Dialog.warn("当前有正在处理的文件,请等待完成。\n如果已完成,请关闭 DOS 窗口。");
|
||||
return;
|
||||
}
|
||||
let result = await Editor.Dialog.select({
|
||||
'multi': true,
|
||||
'type': "file",
|
||||
'filters': [
|
||||
{
|
||||
'extensions': ["psd"],
|
||||
'name': "请选择 PSD"
|
||||
}
|
||||
]
|
||||
});
|
||||
let files = result.filePaths;
|
||||
this.processPsd(files);
|
||||
},
|
||||
onDragEnter(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
// event.target.add("drag-hovering")
|
||||
},
|
||||
onDragLeave(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
// event.target.remove("drag-hovering")
|
||||
},
|
||||
async onDropFiles(event) {
|
||||
let files = [];
|
||||
[].forEach.call(event.dataTransfer.files, function (file) {
|
||||
files.push(file.path);
|
||||
}, false);
|
||||
this.processPsd(files);
|
||||
},
|
||||
async processPsd(files) {
|
||||
if (!files.length) {
|
||||
return;
|
||||
}
|
||||
if (this.isProcessing) {
|
||||
Editor.Dialog.warn("当前有正在处理的文件,请等待完成。\n如果已完成,请关闭 DOS 窗口。");
|
||||
return;
|
||||
}
|
||||
this.isProcessing = true;
|
||||
await Editor.Message.request("ccc-tnt-psd2ui", "on-drop-file", { output: this.outputPath, files, isForceImg: this.isForceImg, isImgOnly: this.isImgOnly, isPinyin: this.isPinyin });
|
||||
this.isProcessing = false;
|
||||
}
|
||||
},
|
||||
});
|
||||
app.mount(this.$.app);
|
||||
weakMap.set(this, app);
|
||||
}
|
||||
},
|
||||
beforeClose() { },
|
||||
close() {
|
||||
const app = weakMap.get(this);
|
||||
if (app) {
|
||||
app.unmount();
|
||||
}
|
||||
},
|
||||
});
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const vue_1 = require("vue");
|
||||
const weakMap = new WeakMap();
|
||||
const AssetDir = `${Editor.Project.path}/assets`;
|
||||
/**
|
||||
* @zh 如果希望兼容 3.3 之前的版本可以使用下方的代码
|
||||
* @en You can add the code below if you want compatibility with versions prior to 3.3
|
||||
*/
|
||||
// Editor.Panel.define = Editor.Panel.define || function(options: any) { return options }
|
||||
module.exports = Editor.Panel.define({
|
||||
listeners: {
|
||||
show() { },
|
||||
hide() { },
|
||||
},
|
||||
template: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../../static/template/default/index.html'), 'utf-8'),
|
||||
style: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../../static/style/default/index.css'), 'utf-8'),
|
||||
$: {
|
||||
app: '#app',
|
||||
},
|
||||
methods: {},
|
||||
ready() {
|
||||
if (this.$.app) {
|
||||
const app = (0, vue_1.createApp)({});
|
||||
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('ui-');
|
||||
app.component('psd2ui', {
|
||||
template: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../../static/template/vue/psd2ui.html'), 'utf-8'),
|
||||
data() {
|
||||
return {
|
||||
isImgOnly: false,
|
||||
isForceImg: false,
|
||||
isProcessing: false,
|
||||
isPinyin: true,
|
||||
outputPath: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let str = localStorage.getItem(`${Editor.Project.name}_psd2ui_output`);
|
||||
if (str) {
|
||||
this.outputPath = str;
|
||||
}
|
||||
Editor.Message.broadcast("ccc-tnt-psd2ui:check-update");
|
||||
},
|
||||
beforeUnmount() {
|
||||
localStorage.setItem(`${Editor.Project.name}_psd2ui_output`, this.outputPath);
|
||||
},
|
||||
methods: {
|
||||
async onClickCache() {
|
||||
if (this.isProcessing)
|
||||
return;
|
||||
this.isProcessing = true;
|
||||
await Editor.Message.request("ccc-tnt-psd2ui", "on-click-cache");
|
||||
this.isProcessing = false;
|
||||
},
|
||||
onForceChanged(e) {
|
||||
this.isForceImg = !this.isForceImg;
|
||||
},
|
||||
onImgOnlyChanged() {
|
||||
this.isImgOnly = !this.isImgOnly;
|
||||
},
|
||||
onPinyinChanged() {
|
||||
this.isPinyin = !this.isPinyin;
|
||||
},
|
||||
async onClickDropArea(event) {
|
||||
if (this.isProcessing) {
|
||||
Editor.Dialog.warn("当前有正在处理的文件,请等待完成。\n如果已完成,请关闭 DOS 窗口。");
|
||||
return;
|
||||
}
|
||||
let result = await Editor.Dialog.select({
|
||||
'multi': true,
|
||||
'type': "file",
|
||||
'filters': [
|
||||
{
|
||||
'extensions': ["psd"],
|
||||
'name': "请选择 PSD"
|
||||
}
|
||||
]
|
||||
});
|
||||
let files = result.filePaths;
|
||||
this.processPsd(files);
|
||||
},
|
||||
onDragEnter(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
// event.target.add("drag-hovering")
|
||||
},
|
||||
onDragLeave(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
// event.target.remove("drag-hovering")
|
||||
},
|
||||
async onDropFiles(event) {
|
||||
let files = [];
|
||||
[].forEach.call(event.dataTransfer.files, function (file) {
|
||||
files.push(file.path);
|
||||
}, false);
|
||||
this.processPsd(files);
|
||||
},
|
||||
async processPsd(files) {
|
||||
if (!files.length) {
|
||||
return;
|
||||
}
|
||||
if (this.isProcessing) {
|
||||
Editor.Dialog.warn("当前有正在处理的文件,请等待完成。\n如果已完成,请关闭 DOS 窗口。");
|
||||
return;
|
||||
}
|
||||
this.isProcessing = true;
|
||||
await Editor.Message.request("ccc-tnt-psd2ui", "on-drop-file", { output: this.outputPath, files, isForceImg: this.isForceImg, isImgOnly: this.isImgOnly, isPinyin: this.isPinyin });
|
||||
this.isProcessing = false;
|
||||
}
|
||||
},
|
||||
});
|
||||
app.mount(this.$.app);
|
||||
weakMap.set(this, app);
|
||||
}
|
||||
},
|
||||
beforeClose() { },
|
||||
close() {
|
||||
const app = weakMap.get(this);
|
||||
if (app) {
|
||||
app.unmount();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
72
ccc-tnt-psd2ui-v3.4.+/dist/updater.js
vendored
Normal file
72
ccc-tnt-psd2ui-v3.4.+/dist/updater.js
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updater = void 0;
|
||||
const node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
const package_json_1 = __importDefault(require("../package.json"));
|
||||
class Updater {
|
||||
constructor() {
|
||||
this.branch = "master";
|
||||
}
|
||||
async getRemotePackageJson() {
|
||||
const packageJsonUrl = `${package_json_1.default.repository.url}/raw/${this.branch}/package.json`;
|
||||
let res = await (0, node_fetch_1.default)(packageJsonUrl, {
|
||||
method: 'GET',
|
||||
});
|
||||
// 请求结果
|
||||
if (res.status !== 200) {
|
||||
return null;
|
||||
}
|
||||
const json = await res.json();
|
||||
return json;
|
||||
}
|
||||
async getRemoteVersion() {
|
||||
let json = await this.getRemotePackageJson();
|
||||
return (json === null || json === void 0 ? void 0 : json.version) || null;
|
||||
}
|
||||
getLocalVersion() {
|
||||
return package_json_1.default.version;
|
||||
}
|
||||
compareVersion(localVersion, remoteVersion) {
|
||||
const parts1 = localVersion.split('.');
|
||||
const parts2 = remoteVersion.split('.');
|
||||
if (parts1.length != parts2.length) {
|
||||
// 版本号格式不正确,返回 -100
|
||||
return -100;
|
||||
}
|
||||
for (let i = 0; i < 2; i++) {
|
||||
if (parts1[i] != parts2[i]) {
|
||||
return parts1[i] < parts2[i] ? -10 : 10;
|
||||
}
|
||||
}
|
||||
if (parts1[2] !== parts2[2]) {
|
||||
// 最后一位不一致,返回 -1 或 1
|
||||
return parts1[2] < parts2[2] ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
async checkUpdate() {
|
||||
let remoteVersion = await this.getRemoteVersion();
|
||||
let localVersion = this.getLocalVersion();
|
||||
let compareResult = this.compareVersion(localVersion, remoteVersion);
|
||||
return compareResult;
|
||||
}
|
||||
async downloadCoreAsBuffer(file) {
|
||||
const targetUrl = `${package_json_1.default.repository.url}/raw/${this.branch}/${file}`;
|
||||
let res = await (0, node_fetch_1.default)(targetUrl, {
|
||||
method: 'GET',
|
||||
});
|
||||
let buffer = await res.buffer();
|
||||
return buffer;
|
||||
}
|
||||
static getInstance() {
|
||||
if (!this._instance) {
|
||||
this._instance = new Updater();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Updater._instance = null;
|
||||
exports.updater = Updater.getInstance();
|
@ -3,5 +3,5 @@ module.exports = {
|
||||
menu: "psd2ui",
|
||||
open_panel: "主面板",
|
||||
send_to_panel: "发送消息给面板",
|
||||
description: "含有一个基于Vue3.x开发的面板的扩展"
|
||||
description: "PSD转预制体工具"
|
||||
};
|
11
ccc-tnt-psd2ui-v3.4.+/libs/psd2ui/command.bat
Normal file
11
ccc-tnt-psd2ui-v3.4.+/libs/psd2ui/command.bat
Normal file
@ -0,0 +1,11 @@
|
||||
@echo off
|
||||
|
||||
set input1=%1%
|
||||
set input2=%2%
|
||||
|
||||
cd /d %~dp0
|
||||
|
||||
%~dp0../../bin/node.exe ./index.js %input1% %input2%
|
||||
|
||||
pause
|
||||
exit
|
10
ccc-tnt-psd2ui-v3.4.+/libs/psd2ui/command.sh
Executable file
10
ccc-tnt-psd2ui-v3.4.+/libs/psd2ui/command.sh
Executable file
@ -0,0 +1,10 @@
|
||||
# exec /bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# node_dir=$(dirname $(dirname $(dirname $(realpath $0))))
|
||||
|
||||
cur_dir=$(dirname $0)
|
||||
$(dirname $(dirname $cur_dir))/bin/node $cur_dir/index.js $1 $2
|
||||
|
||||
# echo 请按任意键继续..
|
||||
# read -n 1
|
File diff suppressed because one or more lines are too long
592
ccc-tnt-psd2ui-v3.4.+/package-lock.json
generated
592
ccc-tnt-psd2ui-v3.4.+/package-lock.json
generated
@ -12,19 +12,15 @@
|
||||
"canvas": "^2.11.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"minimist": "^1.2.7",
|
||||
"node-fetch": "^2.7.0",
|
||||
"pinyin-pro": "^3.16.0",
|
||||
"vue": "^3.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.5",
|
||||
"@types/node": "^16.0.1",
|
||||
"typescript": "^4.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.20.7",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.20.7.tgz",
|
||||
"integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==",
|
||||
"version": "7.22.15",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.15.tgz",
|
||||
"integrity": "sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA==",
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
@ -32,10 +28,15 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.15",
|
||||
"resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
||||
},
|
||||
"node_modules/@mapbox/node-pre-gyp": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz",
|
||||
"integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==",
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
|
||||
"integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==",
|
||||
"dependencies": {
|
||||
"detect-libc": "^2.0.0",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
@ -56,127 +57,112 @@
|
||||
"resolved": "https://registry.npmmirror.com/@types/base64-js/-/base64-js-1.3.0.tgz",
|
||||
"integrity": "sha512-ZmI0sZGAUNXUfMWboWwi4LcfpoVUYldyN6Oe0oJ5cCsHDU/LlRq8nQKPXhYLOx36QYSW9bNIb1vvRrD6K7Llgw=="
|
||||
},
|
||||
"node_modules/@types/fs-extra": {
|
||||
"version": "9.0.13",
|
||||
"resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz",
|
||||
"integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.18.11",
|
||||
"resolved": "https://registry.npmmirror.com/@types/node/-/node-16.18.11.tgz",
|
||||
"integrity": "sha512-3oJbGBUWuS6ahSnEq1eN2XrCyf4YsWI8OyCvo7c64zQJNplk3mO84t53o8lfTk+2ji59g5ycfc6qQ3fdHliHuA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/pako": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/@types/pako/-/pako-2.0.0.tgz",
|
||||
"integrity": "sha512-10+iaz93qR5WYxTo+PMifD5TSxiOtdRaxBf7INGGXMQgTCu8Z/7GYWYFUOS3q/G0nE5boj1r4FEB+WSy7s5gbA=="
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.2.45.tgz",
|
||||
"integrity": "sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz",
|
||||
"integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@vue/shared": "3.2.45",
|
||||
"@babel/parser": "^7.21.3",
|
||||
"@vue/shared": "3.3.4",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map": "^0.6.1"
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-dom": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz",
|
||||
"integrity": "sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz",
|
||||
"integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-sfc": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.2.45.tgz",
|
||||
"integrity": "sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz",
|
||||
"integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@vue/compiler-core": "3.2.45",
|
||||
"@vue/compiler-dom": "3.2.45",
|
||||
"@vue/compiler-ssr": "3.2.45",
|
||||
"@vue/reactivity-transform": "3.2.45",
|
||||
"@vue/shared": "3.2.45",
|
||||
"@babel/parser": "^7.20.15",
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/compiler-ssr": "3.3.4",
|
||||
"@vue/reactivity-transform": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.25.7",
|
||||
"magic-string": "^0.30.0",
|
||||
"postcss": "^8.1.10",
|
||||
"source-map": "^0.6.1"
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-ssr": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.2.45.tgz",
|
||||
"integrity": "sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz",
|
||||
"integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/reactivity": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.2.45.tgz",
|
||||
"integrity": "sha512-PRvhCcQcyEVohW0P8iQ7HDcIOXRjZfAsOds3N99X/Dzewy8TVhTCT4uXpAHfoKjVTJRA0O0K+6QNkDIZAxNi3A==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.4.tgz",
|
||||
"integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/reactivity-transform": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz",
|
||||
"integrity": "sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz",
|
||||
"integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@vue/compiler-core": "3.2.45",
|
||||
"@vue/shared": "3.2.45",
|
||||
"@babel/parser": "^7.20.15",
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.25.7"
|
||||
"magic-string": "^0.30.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-core": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.2.45.tgz",
|
||||
"integrity": "sha512-gzJiTA3f74cgARptqzYswmoQx0fIA+gGYBfokYVhF8YSXjWTUA2SngRzZRku2HbGbjzB6LBYSbKGIaK8IW+s0A==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz",
|
||||
"integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/reactivity": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-dom": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.2.45.tgz",
|
||||
"integrity": "sha512-cy88YpfP5Ue2bDBbj75Cb4bIEZUMM/mAkDMfqDTpUYVgTf/kuQ2VQ8LebuZ8k6EudgH8pYhsGWHlY0lcxlvTwA==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz",
|
||||
"integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==",
|
||||
"dependencies": {
|
||||
"@vue/runtime-core": "3.2.45",
|
||||
"@vue/shared": "3.2.45",
|
||||
"csstype": "^2.6.8"
|
||||
"@vue/runtime-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"csstype": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/server-renderer": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.2.45.tgz",
|
||||
"integrity": "sha512-ebiMq7q24WBU1D6uhPK//2OTR1iRIyxjF5iVq/1a5I1SDMDyDu4Ts6fJaMnjrvD3MqnaiFkKQj+LKAgz5WIK3g==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz",
|
||||
"integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-ssr": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-ssr": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "3.2.45"
|
||||
"vue": "3.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.45.tgz",
|
||||
"integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg=="
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz",
|
||||
"integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ=="
|
||||
},
|
||||
"node_modules/abbrev": {
|
||||
"version": "1.1.1",
|
||||
@ -184,14 +170,14 @@
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"node_modules/ag-psd": {
|
||||
"version": "15.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/ag-psd/-/ag-psd-15.0.1.tgz",
|
||||
"integrity": "sha512-uKogYrQz6Tv/9mfSUlJPIZFySWU/KuCdmM6VAUpOdLmM98yQPkEtLz5R4W7aq/DHbumxASrkznJwrX2Tp+KMrA==",
|
||||
"version": "15.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/ag-psd/-/ag-psd-15.3.1.tgz",
|
||||
"integrity": "sha512-woH/Yb5OduYCvwH2OPLeqSPaWTmgT3n8WYU1/csuUX/BAUSphqH0B/QdRnBvlW7C+53VIH8c3Mm4GErjQx+L3A==",
|
||||
"dependencies": {
|
||||
"@types/base64-js": "^1.3.0",
|
||||
"@types/pako": "^2.0.0",
|
||||
"base64-js": "^1.5.1",
|
||||
"pako": "^2.0.4"
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
@ -250,9 +236,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/canvas": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmmirror.com/canvas/-/canvas-2.11.0.tgz",
|
||||
"integrity": "sha512-bdTjFexjKJEwtIo0oRx8eD4G2yWoUOXP9lj279jmQ2zMnTQhT8C3512OKz3s+ZOaQlLbE7TuVvRDYDB3Llyy5g==",
|
||||
"version": "2.11.2",
|
||||
"resolved": "https://registry.npmmirror.com/canvas/-/canvas-2.11.2.tgz",
|
||||
"integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.0",
|
||||
@ -290,9 +276,9 @@
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="
|
||||
},
|
||||
"node_modules/csstype": {
|
||||
"version": "2.6.21",
|
||||
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-2.6.21.tgz",
|
||||
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
@ -327,9 +313,9 @@
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.0.1.tgz",
|
||||
"integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==",
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.0.2.tgz",
|
||||
"integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
@ -420,9 +406,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||
},
|
||||
"node_modules/has-unicode": {
|
||||
"version": "2.0.1",
|
||||
@ -486,11 +472,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/magic-string": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz",
|
||||
"integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
|
||||
"version": "0.30.3",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.3.tgz",
|
||||
"integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==",
|
||||
"dependencies": {
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
@ -505,9 +494,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
@ -532,17 +521,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.7.tgz",
|
||||
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
|
||||
},
|
||||
"node_modules/minipass": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/minipass/-/minipass-4.0.0.tgz",
|
||||
"integrity": "sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/minipass/-/minipass-5.0.0.tgz",
|
||||
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
@ -592,9 +578,9 @@
|
||||
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ=="
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.4.tgz",
|
||||
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz",
|
||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
@ -603,9 +589,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
@ -681,16 +667,16 @@
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||
},
|
||||
"node_modules/pinyin-pro": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmmirror.com/pinyin-pro/-/pinyin-pro-3.16.0.tgz",
|
||||
"integrity": "sha512-U4pMQ/KSMM5JmSb+ZcReCIbgzGl/JaglaHqWjCli0hpA0rDdjRbAO67e6fOa3ZFcJzbqfe6bJkaMMmpiWmkXgQ=="
|
||||
"version": "3.16.4",
|
||||
"resolved": "https://registry.npmmirror.com/pinyin-pro/-/pinyin-pro-3.16.4.tgz",
|
||||
"integrity": "sha512-NP1x+Z9OajEIjJzIs5gzp3DHiUln8SLIytoYspPFQ8Xd6NMBO2HHZuki1XgYzGS7qat4oRZlwnZ+hvCZwuldbg=="
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.20",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.20.tgz",
|
||||
"integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==",
|
||||
"version": "8.4.29",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.29.tgz",
|
||||
"integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==",
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.4",
|
||||
"nanoid": "^3.3.6",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
@ -699,9 +685,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
@ -728,9 +714,9 @@
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.8",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.3.8.tgz",
|
||||
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
@ -766,14 +752,6 @@
|
||||
"simple-concat": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
@ -782,12 +760,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sourcemap-codec": {
|
||||
"version": "1.4.8",
|
||||
"resolved": "https://registry.npmmirror.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
||||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
|
||||
"deprecated": "Please use @jridgewell/sourcemap-codec instead"
|
||||
},
|
||||
"node_modules/string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
@ -821,13 +793,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tar": {
|
||||
"version": "6.1.13",
|
||||
"resolved": "https://registry.npmmirror.com/tar/-/tar-6.1.13.tgz",
|
||||
"integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/tar/-/tar-6.2.0.tgz",
|
||||
"integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==",
|
||||
"dependencies": {
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^4.0.0",
|
||||
"minipass": "^5.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
@ -841,19 +813,6 @@
|
||||
"resolved": "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.9.4",
|
||||
"resolved": "https://registry.npmmirror.com/typescript/-/typescript-4.9.4.tgz",
|
||||
"integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.0.tgz",
|
||||
@ -868,15 +827,15 @@
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.2.45.tgz",
|
||||
"integrity": "sha512-9Nx/Mg2b2xWlXykmCwiTUCWHbWIj53bnkizBxKai1g61f2Xit700A1ljowpTIM11e3uipOeiPcSqnmBg6gyiaA==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.4.tgz",
|
||||
"integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.2.45",
|
||||
"@vue/compiler-sfc": "3.2.45",
|
||||
"@vue/runtime-dom": "3.2.45",
|
||||
"@vue/server-renderer": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/compiler-sfc": "3.3.4",
|
||||
"@vue/runtime-dom": "3.3.4",
|
||||
"@vue/server-renderer": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
@ -914,14 +873,19 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/parser": {
|
||||
"version": "7.20.7",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.20.7.tgz",
|
||||
"integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg=="
|
||||
"version": "7.22.15",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.15.tgz",
|
||||
"integrity": "sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA=="
|
||||
},
|
||||
"@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.15",
|
||||
"resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
||||
},
|
||||
"@mapbox/node-pre-gyp": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz",
|
||||
"integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==",
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
|
||||
"integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==",
|
||||
"requires": {
|
||||
"detect-libc": "^2.0.0",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
@ -939,124 +903,109 @@
|
||||
"resolved": "https://registry.npmmirror.com/@types/base64-js/-/base64-js-1.3.0.tgz",
|
||||
"integrity": "sha512-ZmI0sZGAUNXUfMWboWwi4LcfpoVUYldyN6Oe0oJ5cCsHDU/LlRq8nQKPXhYLOx36QYSW9bNIb1vvRrD6K7Llgw=="
|
||||
},
|
||||
"@types/fs-extra": {
|
||||
"version": "9.0.13",
|
||||
"resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz",
|
||||
"integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.18.11",
|
||||
"resolved": "https://registry.npmmirror.com/@types/node/-/node-16.18.11.tgz",
|
||||
"integrity": "sha512-3oJbGBUWuS6ahSnEq1eN2XrCyf4YsWI8OyCvo7c64zQJNplk3mO84t53o8lfTk+2ji59g5ycfc6qQ3fdHliHuA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/pako": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/@types/pako/-/pako-2.0.0.tgz",
|
||||
"integrity": "sha512-10+iaz93qR5WYxTo+PMifD5TSxiOtdRaxBf7INGGXMQgTCu8Z/7GYWYFUOS3q/G0nE5boj1r4FEB+WSy7s5gbA=="
|
||||
},
|
||||
"@vue/compiler-core": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.2.45.tgz",
|
||||
"integrity": "sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz",
|
||||
"integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==",
|
||||
"requires": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@vue/shared": "3.2.45",
|
||||
"@babel/parser": "^7.21.3",
|
||||
"@vue/shared": "3.3.4",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map": "^0.6.1"
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"@vue/compiler-dom": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz",
|
||||
"integrity": "sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz",
|
||||
"integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==",
|
||||
"requires": {
|
||||
"@vue/compiler-core": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"@vue/compiler-sfc": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.2.45.tgz",
|
||||
"integrity": "sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz",
|
||||
"integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==",
|
||||
"requires": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@vue/compiler-core": "3.2.45",
|
||||
"@vue/compiler-dom": "3.2.45",
|
||||
"@vue/compiler-ssr": "3.2.45",
|
||||
"@vue/reactivity-transform": "3.2.45",
|
||||
"@vue/shared": "3.2.45",
|
||||
"@babel/parser": "^7.20.15",
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/compiler-ssr": "3.3.4",
|
||||
"@vue/reactivity-transform": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.25.7",
|
||||
"magic-string": "^0.30.0",
|
||||
"postcss": "^8.1.10",
|
||||
"source-map": "^0.6.1"
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"@vue/compiler-ssr": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.2.45.tgz",
|
||||
"integrity": "sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz",
|
||||
"integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==",
|
||||
"requires": {
|
||||
"@vue/compiler-dom": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"@vue/reactivity": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.2.45.tgz",
|
||||
"integrity": "sha512-PRvhCcQcyEVohW0P8iQ7HDcIOXRjZfAsOds3N99X/Dzewy8TVhTCT4uXpAHfoKjVTJRA0O0K+6QNkDIZAxNi3A==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.4.tgz",
|
||||
"integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==",
|
||||
"requires": {
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"@vue/reactivity-transform": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz",
|
||||
"integrity": "sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz",
|
||||
"integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==",
|
||||
"requires": {
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@vue/compiler-core": "3.2.45",
|
||||
"@vue/shared": "3.2.45",
|
||||
"@babel/parser": "^7.20.15",
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.25.7"
|
||||
"magic-string": "^0.30.0"
|
||||
}
|
||||
},
|
||||
"@vue/runtime-core": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.2.45.tgz",
|
||||
"integrity": "sha512-gzJiTA3f74cgARptqzYswmoQx0fIA+gGYBfokYVhF8YSXjWTUA2SngRzZRku2HbGbjzB6LBYSbKGIaK8IW+s0A==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz",
|
||||
"integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==",
|
||||
"requires": {
|
||||
"@vue/reactivity": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/reactivity": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"@vue/runtime-dom": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.2.45.tgz",
|
||||
"integrity": "sha512-cy88YpfP5Ue2bDBbj75Cb4bIEZUMM/mAkDMfqDTpUYVgTf/kuQ2VQ8LebuZ8k6EudgH8pYhsGWHlY0lcxlvTwA==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz",
|
||||
"integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==",
|
||||
"requires": {
|
||||
"@vue/runtime-core": "3.2.45",
|
||||
"@vue/shared": "3.2.45",
|
||||
"csstype": "^2.6.8"
|
||||
"@vue/runtime-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"csstype": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"@vue/server-renderer": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.2.45.tgz",
|
||||
"integrity": "sha512-ebiMq7q24WBU1D6uhPK//2OTR1iRIyxjF5iVq/1a5I1SDMDyDu4Ts6fJaMnjrvD3MqnaiFkKQj+LKAgz5WIK3g==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz",
|
||||
"integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==",
|
||||
"requires": {
|
||||
"@vue/compiler-ssr": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-ssr": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"@vue/shared": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.45.tgz",
|
||||
"integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg=="
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz",
|
||||
"integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ=="
|
||||
},
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
@ -1064,14 +1013,14 @@
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"ag-psd": {
|
||||
"version": "15.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/ag-psd/-/ag-psd-15.0.1.tgz",
|
||||
"integrity": "sha512-uKogYrQz6Tv/9mfSUlJPIZFySWU/KuCdmM6VAUpOdLmM98yQPkEtLz5R4W7aq/DHbumxASrkznJwrX2Tp+KMrA==",
|
||||
"version": "15.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/ag-psd/-/ag-psd-15.3.1.tgz",
|
||||
"integrity": "sha512-woH/Yb5OduYCvwH2OPLeqSPaWTmgT3n8WYU1/csuUX/BAUSphqH0B/QdRnBvlW7C+53VIH8c3Mm4GErjQx+L3A==",
|
||||
"requires": {
|
||||
"@types/base64-js": "^1.3.0",
|
||||
"@types/pako": "^2.0.0",
|
||||
"base64-js": "^1.5.1",
|
||||
"pako": "^2.0.4"
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"agent-base": {
|
||||
@ -1121,9 +1070,9 @@
|
||||
}
|
||||
},
|
||||
"canvas": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmmirror.com/canvas/-/canvas-2.11.0.tgz",
|
||||
"integrity": "sha512-bdTjFexjKJEwtIo0oRx8eD4G2yWoUOXP9lj279jmQ2zMnTQhT8C3512OKz3s+ZOaQlLbE7TuVvRDYDB3Llyy5g==",
|
||||
"version": "2.11.2",
|
||||
"resolved": "https://registry.npmmirror.com/canvas/-/canvas-2.11.2.tgz",
|
||||
"integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==",
|
||||
"requires": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.0",
|
||||
"nan": "^2.17.0",
|
||||
@ -1151,9 +1100,9 @@
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="
|
||||
},
|
||||
"csstype": {
|
||||
"version": "2.6.21",
|
||||
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-2.6.21.tgz",
|
||||
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.4",
|
||||
@ -1177,9 +1126,9 @@
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.0.1.tgz",
|
||||
"integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w=="
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.0.2.tgz",
|
||||
"integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw=="
|
||||
},
|
||||
"emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
@ -1254,9 +1203,9 @@
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||
},
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
@ -1309,11 +1258,11 @@
|
||||
}
|
||||
},
|
||||
"magic-string": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz",
|
||||
"integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
|
||||
"version": "0.30.3",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.3.tgz",
|
||||
"integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==",
|
||||
"requires": {
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
@ -1325,9 +1274,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1345,17 +1294,14 @@
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.7.tgz",
|
||||
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
|
||||
},
|
||||
"minipass": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/minipass/-/minipass-4.0.0.tgz",
|
||||
"integrity": "sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/minipass/-/minipass-5.0.0.tgz",
|
||||
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ=="
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "2.1.2",
|
||||
@ -1392,14 +1338,14 @@
|
||||
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ=="
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.4.tgz",
|
||||
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw=="
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz",
|
||||
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
@ -1452,24 +1398,24 @@
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
|
||||
},
|
||||
"pinyin-pro": {
|
||||
"version": "3.16.0",
|
||||
"resolved": "https://registry.npmmirror.com/pinyin-pro/-/pinyin-pro-3.16.0.tgz",
|
||||
"integrity": "sha512-U4pMQ/KSMM5JmSb+ZcReCIbgzGl/JaglaHqWjCli0hpA0rDdjRbAO67e6fOa3ZFcJzbqfe6bJkaMMmpiWmkXgQ=="
|
||||
"version": "3.16.4",
|
||||
"resolved": "https://registry.npmmirror.com/pinyin-pro/-/pinyin-pro-3.16.4.tgz",
|
||||
"integrity": "sha512-NP1x+Z9OajEIjJzIs5gzp3DHiUln8SLIytoYspPFQ8Xd6NMBO2HHZuki1XgYzGS7qat4oRZlwnZ+hvCZwuldbg=="
|
||||
},
|
||||
"postcss": {
|
||||
"version": "8.4.20",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.20.tgz",
|
||||
"integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==",
|
||||
"version": "8.4.29",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.29.tgz",
|
||||
"integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==",
|
||||
"requires": {
|
||||
"nanoid": "^3.3.4",
|
||||
"nanoid": "^3.3.6",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
@ -1490,9 +1436,9 @@
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.8",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.3.8.tgz",
|
||||
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
@ -1522,21 +1468,11 @@
|
||||
"simple-concat": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
},
|
||||
"source-map-js": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw=="
|
||||
},
|
||||
"sourcemap-codec": {
|
||||
"version": "1.4.8",
|
||||
"resolved": "https://registry.npmmirror.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
||||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
@ -1564,13 +1500,13 @@
|
||||
}
|
||||
},
|
||||
"tar": {
|
||||
"version": "6.1.13",
|
||||
"resolved": "https://registry.npmmirror.com/tar/-/tar-6.1.13.tgz",
|
||||
"integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/tar/-/tar-6.2.0.tgz",
|
||||
"integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==",
|
||||
"requires": {
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^4.0.0",
|
||||
"minipass": "^5.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
@ -1581,12 +1517,6 @@
|
||||
"resolved": "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.9.4",
|
||||
"resolved": "https://registry.npmmirror.com/typescript/-/typescript-4.9.4.tgz",
|
||||
"integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
|
||||
"dev": true
|
||||
},
|
||||
"universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.0.tgz",
|
||||
@ -1598,15 +1528,15 @@
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"vue": {
|
||||
"version": "3.2.45",
|
||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.2.45.tgz",
|
||||
"integrity": "sha512-9Nx/Mg2b2xWlXykmCwiTUCWHbWIj53bnkizBxKai1g61f2Xit700A1ljowpTIM11e3uipOeiPcSqnmBg6gyiaA==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.4.tgz",
|
||||
"integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==",
|
||||
"requires": {
|
||||
"@vue/compiler-dom": "3.2.45",
|
||||
"@vue/compiler-sfc": "3.2.45",
|
||||
"@vue/runtime-dom": "3.2.45",
|
||||
"@vue/server-renderer": "3.2.45",
|
||||
"@vue/shared": "3.2.45"
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/compiler-sfc": "3.3.4",
|
||||
"@vue/runtime-dom": "3.3.4",
|
||||
"@vue/server-renderer": "3.3.4",
|
||||
"@vue/shared": "3.3.4"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
|
@ -4,19 +4,19 @@
|
||||
"name": "ccc-tnt-psd2ui",
|
||||
"description": "i18n:ccc-tnt-psd2ui.description",
|
||||
"main": "./dist/main.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitee.com/onvia/ccc-tnt-psd2ui"
|
||||
},
|
||||
"dependencies": {
|
||||
"ag-psd": "^15.0.0",
|
||||
"canvas": "^2.11.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"minimist": "^1.2.7",
|
||||
"node-fetch": "^2.7.0",
|
||||
"pinyin-pro": "^3.16.0",
|
||||
"vue": "^3.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.5",
|
||||
"@types/node": "^16.0.1",
|
||||
"typescript": "^4.3.4"
|
||||
},
|
||||
"panels": {
|
||||
"default": {
|
||||
"title": "psd2ui Panel",
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
@ -1,185 +0,0 @@
|
||||
//@ts-ignore
|
||||
import packageJSON from '../package.json';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import Os from 'os';
|
||||
|
||||
import child_process from "child_process";
|
||||
let exec = child_process.exec;
|
||||
|
||||
|
||||
const ENGINE_VER = "v342"; //
|
||||
const packagePath = path.join(Editor.Project.path, "extensions", packageJSON.name);
|
||||
const projectAssets = path.join(Editor.Project.path, "assets");
|
||||
const cacheFile = path.join(Editor.Project.path, "local", "psd-to-prefab-cache.json");
|
||||
const configFile = path.join(`${packagePath}/config/psd.config.json`);
|
||||
|
||||
const nodejsFile = path.join(packagePath, "bin", `node${Os.platform() == 'darwin' ? "" : ".exe"}`);
|
||||
const psd = path.join(packagePath, "libs", "psd2ui", "index.js");
|
||||
|
||||
let uuid2md5: Map<string, string> = new Map();
|
||||
let cacheFileJson: Record<string, any> = {};
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
export const methods: { [key: string]: (...any: any) => any } = {
|
||||
openPanel() {
|
||||
Editor.Panel.open(packageJSON.name);
|
||||
},
|
||||
|
||||
onClickPsd2UICache() {
|
||||
console.log(`main-> onClickPsd2UICache111 `);
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
console.log(`main-> onClickPsd2UICache`);
|
||||
|
||||
|
||||
let options = {
|
||||
"project-assets": projectAssets,
|
||||
"cache": cacheFile,
|
||||
"init": true,
|
||||
"engine-version": ENGINE_VER
|
||||
}
|
||||
|
||||
Promise.all(_exec(options, [])).then(() => {
|
||||
console.log("[psd2prefab] 执行缓存结束");
|
||||
resolve();
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
async onPsd2UIDropFiles(param) {
|
||||
|
||||
let files = param.files;
|
||||
let isForceImg = param.isForceImg;
|
||||
let isImgOnly = param.isImgOnly;
|
||||
let output = param.output;
|
||||
let isPinyin = param.isPinyin;
|
||||
|
||||
let options = {
|
||||
"project-assets": projectAssets,
|
||||
"cache": cacheFile,
|
||||
"engine-version": ENGINE_VER,
|
||||
"pinyin": isPinyin,
|
||||
}
|
||||
|
||||
let tasks: Promise<void>[] = [];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
|
||||
let stat = fs.statSync(file);
|
||||
if (stat.isFile()) {
|
||||
let ext = path.extname(file);
|
||||
if (ext != '.psd') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let args = JSON.parse(JSON.stringify(options));
|
||||
args["input"] = file;
|
||||
if (output) {
|
||||
args["output"] = output;
|
||||
}
|
||||
if (isImgOnly) {
|
||||
|
||||
// 只导出图片
|
||||
args["img-only"] = true;
|
||||
} else {
|
||||
|
||||
// 强制导出图片
|
||||
if (isForceImg) {
|
||||
args["force-img"] = true;
|
||||
}
|
||||
args["config"] = configFile;
|
||||
}
|
||||
_exec(args, tasks)
|
||||
}
|
||||
|
||||
Promise.all(tasks).then(() => {
|
||||
genUUID2MD5Mapping();
|
||||
console.log("[ccc-tnt-psd2ui] psd 导出完成,输出位置为:", output ? output : "psd 同级目录");
|
||||
}).catch((reason) => {
|
||||
console.log("[ccc-tnt-psd2ui] 导出失败", reason);
|
||||
}).finally(() => {
|
||||
});
|
||||
},
|
||||
};
|
||||
function _exec(options: any, tasks: any) {
|
||||
let jsonContent = JSON.stringify(options);
|
||||
if (!fs.existsSync(nodejsFile)) {
|
||||
console.log(`[ccc-tnt-psd2ui] 没有内置 nodejs`, nodejsFile);
|
||||
|
||||
return tasks;
|
||||
}
|
||||
// 处理权限问题
|
||||
if (Os.platform() === 'darwin') {
|
||||
if (fs.statSync(nodejsFile).mode != 33261) {
|
||||
console.log(`[ccc-tnt-psd2ui] 设置权限`);
|
||||
fs.chmodSync(nodejsFile, 33261);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("[ccc-tnt-psd2ui] 命令参数:" + jsonContent);
|
||||
console.log("[ccc-tnt-psd2ui] 命令执行中");
|
||||
|
||||
let base64 = Buffer.from(jsonContent).toString("base64");
|
||||
tasks.push(new Promise<void>((rs) => {
|
||||
// console.log(`[ccc-tnt-psd2ui] `, `${nodejsFile} ${psd}` + ' ' + `--json ${base64}`);
|
||||
exec(`${nodejsFile} ${psd}` + ' ' + `--json ${base64}`, { windowsHide: false }, (err, stdout, stderr) => {
|
||||
console.log("[ccc-tnt-psd2ui]:\n", stdout);
|
||||
if (stderr) {
|
||||
console.log(stderr);
|
||||
}
|
||||
rs();
|
||||
})
|
||||
}));
|
||||
return tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源删除的监听
|
||||
*
|
||||
* @param {*} event
|
||||
*/
|
||||
function onAssetDeletedListener(event: any) {
|
||||
if (uuid2md5.has(event)) {
|
||||
let md5 = uuid2md5.get(event);
|
||||
console.log(`[ccc-tnt-psd2ui] 删除资源 md5: ${md5}, uuid: ${event}`);
|
||||
delete cacheFileJson[`${md5}`];
|
||||
fs.writeFileSync(cacheFile, JSON.stringify(cacheFileJson, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成 uuid 转 MD5 的映射
|
||||
*
|
||||
*/
|
||||
function genUUID2MD5Mapping() {
|
||||
if (!fs.existsSync(cacheFile)) {
|
||||
return;
|
||||
}
|
||||
let content = fs.readFileSync(cacheFile, 'utf-8');
|
||||
let obj = JSON.parse(content);
|
||||
cacheFileJson = obj;
|
||||
for (const key in obj) {
|
||||
const element = obj[key];
|
||||
uuid2md5.set(element.textureUuid, key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
export const load = function () {
|
||||
genUUID2MD5Mapping();
|
||||
Editor.Message.addBroadcastListener("asset-db:asset-delete", onAssetDeletedListener);
|
||||
};
|
||||
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
export const unload = function () {
|
||||
|
||||
Editor.Message.removeBroadcastListener("asset-db:asset-delete", onAssetDeletedListener);
|
||||
};
|
@ -1,135 +0,0 @@
|
||||
import { readFileSync } from 'fs-extra';
|
||||
import { extname, join, parse } from 'path';
|
||||
import { createApp, App } from 'vue';
|
||||
const weakMap = new WeakMap<any, App>();
|
||||
|
||||
const AssetDir = `${Editor.Project.path}/assets`;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @zh 如果希望兼容 3.3 之前的版本可以使用下方的代码
|
||||
* @en You can add the code below if you want compatibility with versions prior to 3.3
|
||||
*/
|
||||
// Editor.Panel.define = Editor.Panel.define || function(options: any) { return options }
|
||||
module.exports = Editor.Panel.define({
|
||||
listeners: {
|
||||
show() { },
|
||||
hide() { },
|
||||
},
|
||||
template: readFileSync(join(__dirname, '../../../static/template/default/index.html'), 'utf-8'),
|
||||
style: readFileSync(join(__dirname, '../../../static/style/default/index.css'), 'utf-8'),
|
||||
$: {
|
||||
app: '#app',
|
||||
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
ready() {
|
||||
if (this.$.app) {
|
||||
const app = createApp({});
|
||||
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('ui-');
|
||||
app.component('psd2ui', {
|
||||
template: readFileSync(join(__dirname, '../../../static/template/vue/psd2ui.html'), 'utf-8'),
|
||||
data() {
|
||||
return {
|
||||
isImgOnly: false,
|
||||
isForceImg: false,
|
||||
isProcessing: false,
|
||||
isPinyin: true,
|
||||
outputPath: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let str = localStorage.getItem(`${Editor.Project.name}_psd2ui_output`);
|
||||
if (str) {
|
||||
this.outputPath = str;
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
localStorage.setItem(`${Editor.Project.name}_psd2ui_output`, this.outputPath);
|
||||
},
|
||||
|
||||
methods: {
|
||||
async onClickCache() {
|
||||
if (this.isProcessing) return;
|
||||
this.isProcessing = true;
|
||||
|
||||
await Editor.Message.request("ccc-tnt-psd2ui", "on-click-cache");
|
||||
this.isProcessing = false;
|
||||
},
|
||||
onForceChanged(e: any) {
|
||||
this.isForceImg = !this.isForceImg;
|
||||
},
|
||||
onImgOnlyChanged() {
|
||||
this.isImgOnly = !this.isImgOnly;
|
||||
},
|
||||
onPinyinChanged() {
|
||||
this.isPinyin = !this.isPinyin;
|
||||
},
|
||||
async onClickDropArea(event: any) {
|
||||
if (this.isProcessing) {
|
||||
Editor.Dialog.warn("当前有正在处理的文件,请等待完成。\n如果已完成,请关闭 DOS 窗口。")
|
||||
return;
|
||||
}
|
||||
let result = await Editor.Dialog.select({
|
||||
'multi': true,
|
||||
'type': "file",
|
||||
'filters': [
|
||||
{
|
||||
'extensions': ["psd"],
|
||||
'name': "请选择 PSD"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
let files = result.filePaths;
|
||||
this.processPsd(files);
|
||||
},
|
||||
onDragEnter(event: any) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
// event.target.add("drag-hovering")
|
||||
},
|
||||
onDragLeave(event: any) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
// event.target.remove("drag-hovering")
|
||||
},
|
||||
async onDropFiles(event: any) {
|
||||
|
||||
let files: any[] = [];
|
||||
[].forEach.call(event.dataTransfer.files, function (file: any) {
|
||||
files.push(file.path);
|
||||
}, false);
|
||||
this.processPsd(files);
|
||||
},
|
||||
|
||||
async processPsd(files: any[]) {
|
||||
if (!files.length) {
|
||||
return;
|
||||
}
|
||||
if (this.isProcessing) {
|
||||
Editor.Dialog.warn("当前有正在处理的文件,请等待完成。\n如果已完成,请关闭 DOS 窗口。")
|
||||
return;
|
||||
}
|
||||
this.isProcessing = true;
|
||||
await Editor.Message.request("ccc-tnt-psd2ui", "on-drop-file", { output: this.outputPath, files, isForceImg: this.isForceImg, isImgOnly: this.isImgOnly,isPinyin: this.isPinyin });
|
||||
this.isProcessing = false;
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
app.mount(this.$.app);
|
||||
weakMap.set(this, app);
|
||||
}
|
||||
},
|
||||
beforeClose() { },
|
||||
close() {
|
||||
const app = weakMap.get(this);
|
||||
if (app) {
|
||||
app.unmount();
|
||||
}
|
||||
},
|
||||
});
|
1299
npm-packages/mac-v2.4.x/.package-lock.json
generated
1299
npm-packages/mac-v2.4.x/.package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,5 @@
|
||||
# node-pre-gyp changelog
|
||||
|
||||
## 1.0.11
|
||||
- Fixes dependabot alert [CVE-2021-44906](https://nvd.nist.gov/vuln/detail/CVE-2021-44906)
|
||||
|
||||
## 1.0.10
|
||||
- Upgraded minimist to 1.2.6 to address dependabot alert [CVE-2021-44906](https://nvd.nist.gov/vuln/detail/CVE-2021-44906)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@mapbox/node-pre-gyp",
|
||||
"description": "Node.js native addon binary install tool",
|
||||
"version": "1.0.11",
|
||||
"version": "1.0.10",
|
||||
"keywords": [
|
||||
"native",
|
||||
"addon",
|
||||
|
@ -1,18 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## v15.3.0
|
||||
- Added support for smart layer puppet filter (`placedLayer.filter`)
|
||||
|
||||
## v15.2.0
|
||||
- Added handling missing `font` in text layer style by assuming first font on the list
|
||||
|
||||
## v15.1.0
|
||||
- Added support for float color in effects, new color type was added
|
||||
```ts
|
||||
export type FRGB = { fr: number; fg: number; fb: number; }; // values from 0 to 1 (can be above 1)
|
||||
```
|
||||
- Changed `time` field on `LinkedFile` from `Date` to `string` type
|
||||
|
||||
## v15.0.0
|
||||
- Added support for frame and timeline animations
|
||||
|
||||
|
@ -686,12 +686,11 @@ Many fields in PSD file support passing color in different color formats (RGBA,
|
||||
```ts
|
||||
type RGBA = { r: number; g: number; b: number; a: number; }; // values from 0 to 255
|
||||
type RGB = { r: number; g: number; b: number; }; // values from 0 to 255
|
||||
type FRGB = { fr: number; fg: number; fb: number; }; // values from 0 to 1 (can be above 1)
|
||||
type HSB = { h: number; s: number; b: number; }; // values from 0 to 1
|
||||
type CMYK = { c: number; m: number; y: number; k: number; }; // values from 0 to 255
|
||||
type LAB = { l: number; a: number; b: number; }; // values `l` from 0 to 1; `a` and `b` from -1 to 1
|
||||
type Grayscale = { k: number }; // values from 0 to 255
|
||||
type Color = RGBA | RGB | FRGB | HSB | CMYK | LAB | Grayscale;
|
||||
type Color = RGBA | RGB | HSB | CMYK | LAB | Grayscale;
|
||||
```
|
||||
|
||||
When you want to set field with a `Color` type, it's pretty straightforward, you can just choose any of the formats you like and set it on the field:
|
||||
@ -713,8 +712,6 @@ if ('l' in color) {
|
||||
// color is Grayscale
|
||||
} else if ('a' in color) {
|
||||
// color is RGBA
|
||||
} else if ('rf' in color) {
|
||||
// color is FRGB
|
||||
} else {
|
||||
// color is RGB
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
- remove gulp
|
||||
|
||||
- can we remove sectionDivider property ?
|
||||
- can we remove nameSource property ?
|
||||
|
||||
|
264
npm-packages/mac-v2.4.x/ag-psd/dist-es/abr.d.ts
vendored
264
npm-packages/mac-v2.4.x/ag-psd/dist-es/abr.d.ts
vendored
@ -1,132 +1,132 @@
|
||||
import { BlendMode, PatternInfo } from './psd';
|
||||
export interface Abr {
|
||||
brushes: Brush[];
|
||||
samples: SampleInfo[];
|
||||
patterns: PatternInfo[];
|
||||
}
|
||||
export interface SampleInfo {
|
||||
id: string;
|
||||
bounds: {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
};
|
||||
alpha: Uint8Array;
|
||||
}
|
||||
export interface BrushDynamics {
|
||||
control: 'off' | 'fade' | 'pen pressure' | 'pen tilt' | 'stylus wheel' | 'initial direction' | 'direction' | 'initial rotation' | 'rotation';
|
||||
steps: number;
|
||||
jitter: number;
|
||||
minimum: number;
|
||||
}
|
||||
export interface BrushShape {
|
||||
name?: string;
|
||||
size: number;
|
||||
angle: number;
|
||||
roundness: number;
|
||||
hardness?: number;
|
||||
spacingOn: boolean;
|
||||
spacing: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
sampledData?: string;
|
||||
}
|
||||
export interface Brush {
|
||||
name: string;
|
||||
shape: BrushShape;
|
||||
shapeDynamics?: {
|
||||
sizeDynamics: BrushDynamics;
|
||||
minimumDiameter: number;
|
||||
tiltScale: number;
|
||||
angleDynamics: BrushDynamics;
|
||||
roundnessDynamics: BrushDynamics;
|
||||
minimumRoundness: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
brushProjection: boolean;
|
||||
};
|
||||
scatter?: {
|
||||
bothAxes: boolean;
|
||||
scatterDynamics: BrushDynamics;
|
||||
countDynamics: BrushDynamics;
|
||||
count: number;
|
||||
};
|
||||
texture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
invert: boolean;
|
||||
scale: number;
|
||||
brightness: number;
|
||||
contrast: number;
|
||||
blendMode: BlendMode;
|
||||
depth: number;
|
||||
depthMinimum: number;
|
||||
depthDynamics: BrushDynamics;
|
||||
};
|
||||
dualBrush?: {
|
||||
flip: boolean;
|
||||
shape: BrushShape;
|
||||
blendMode: BlendMode;
|
||||
useScatter: boolean;
|
||||
spacing: number;
|
||||
count: number;
|
||||
bothAxes: boolean;
|
||||
countDynamics: BrushDynamics;
|
||||
scatterDynamics: BrushDynamics;
|
||||
};
|
||||
colorDynamics?: {
|
||||
foregroundBackground: BrushDynamics;
|
||||
hue: number;
|
||||
saturation: number;
|
||||
brightness: number;
|
||||
purity: number;
|
||||
perTip: boolean;
|
||||
};
|
||||
transfer?: {
|
||||
flowDynamics: BrushDynamics;
|
||||
opacityDynamics: BrushDynamics;
|
||||
wetnessDynamics: BrushDynamics;
|
||||
mixDynamics: BrushDynamics;
|
||||
};
|
||||
brushPose?: {
|
||||
overrideAngle: boolean;
|
||||
overrideTiltX: boolean;
|
||||
overrideTiltY: boolean;
|
||||
overridePressure: boolean;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
angle: number;
|
||||
};
|
||||
noise: boolean;
|
||||
wetEdges: boolean;
|
||||
protectTexture?: boolean;
|
||||
spacing: number;
|
||||
brushGroup?: undefined;
|
||||
interpretation?: boolean;
|
||||
useBrushSize: boolean;
|
||||
toolOptions?: {
|
||||
brushPreset: boolean;
|
||||
flow: number;
|
||||
smooth: number;
|
||||
mode: BlendMode;
|
||||
opacity: number;
|
||||
smoothing: boolean;
|
||||
smoothingValue: number;
|
||||
smoothingRadiusMode: boolean;
|
||||
smoothingCatchup: boolean;
|
||||
smoothingCatchupAtEnd: boolean;
|
||||
smoothingZoomCompensation: boolean;
|
||||
pressureSmoothing: boolean;
|
||||
usePressureOverridesSize: boolean;
|
||||
usePressureOverridesOpacity: boolean;
|
||||
useLegacy: boolean;
|
||||
flowDynamics?: BrushDynamics;
|
||||
opacityDynamics?: BrushDynamics;
|
||||
sizeDynamics?: BrushDynamics;
|
||||
};
|
||||
}
|
||||
export declare function readAbr(buffer: ArrayBufferView, options?: {
|
||||
logMissingFeatures?: boolean;
|
||||
}): Abr;
|
||||
import { BlendMode, PatternInfo } from './psd';
|
||||
export interface Abr {
|
||||
brushes: Brush[];
|
||||
samples: SampleInfo[];
|
||||
patterns: PatternInfo[];
|
||||
}
|
||||
export interface SampleInfo {
|
||||
id: string;
|
||||
bounds: {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
};
|
||||
alpha: Uint8Array;
|
||||
}
|
||||
export interface BrushDynamics {
|
||||
control: 'off' | 'fade' | 'pen pressure' | 'pen tilt' | 'stylus wheel' | 'initial direction' | 'direction' | 'initial rotation' | 'rotation';
|
||||
steps: number;
|
||||
jitter: number;
|
||||
minimum: number;
|
||||
}
|
||||
export interface BrushShape {
|
||||
name?: string;
|
||||
size: number;
|
||||
angle: number;
|
||||
roundness: number;
|
||||
hardness?: number;
|
||||
spacingOn: boolean;
|
||||
spacing: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
sampledData?: string;
|
||||
}
|
||||
export interface Brush {
|
||||
name: string;
|
||||
shape: BrushShape;
|
||||
shapeDynamics?: {
|
||||
sizeDynamics: BrushDynamics;
|
||||
minimumDiameter: number;
|
||||
tiltScale: number;
|
||||
angleDynamics: BrushDynamics;
|
||||
roundnessDynamics: BrushDynamics;
|
||||
minimumRoundness: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
brushProjection: boolean;
|
||||
};
|
||||
scatter?: {
|
||||
bothAxes: boolean;
|
||||
scatterDynamics: BrushDynamics;
|
||||
countDynamics: BrushDynamics;
|
||||
count: number;
|
||||
};
|
||||
texture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
invert: boolean;
|
||||
scale: number;
|
||||
brightness: number;
|
||||
contrast: number;
|
||||
blendMode: BlendMode;
|
||||
depth: number;
|
||||
depthMinimum: number;
|
||||
depthDynamics: BrushDynamics;
|
||||
};
|
||||
dualBrush?: {
|
||||
flip: boolean;
|
||||
shape: BrushShape;
|
||||
blendMode: BlendMode;
|
||||
useScatter: boolean;
|
||||
spacing: number;
|
||||
count: number;
|
||||
bothAxes: boolean;
|
||||
countDynamics: BrushDynamics;
|
||||
scatterDynamics: BrushDynamics;
|
||||
};
|
||||
colorDynamics?: {
|
||||
foregroundBackground: BrushDynamics;
|
||||
hue: number;
|
||||
saturation: number;
|
||||
brightness: number;
|
||||
purity: number;
|
||||
perTip: boolean;
|
||||
};
|
||||
transfer?: {
|
||||
flowDynamics: BrushDynamics;
|
||||
opacityDynamics: BrushDynamics;
|
||||
wetnessDynamics: BrushDynamics;
|
||||
mixDynamics: BrushDynamics;
|
||||
};
|
||||
brushPose?: {
|
||||
overrideAngle: boolean;
|
||||
overrideTiltX: boolean;
|
||||
overrideTiltY: boolean;
|
||||
overridePressure: boolean;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
angle: number;
|
||||
};
|
||||
noise: boolean;
|
||||
wetEdges: boolean;
|
||||
protectTexture?: boolean;
|
||||
spacing: number;
|
||||
brushGroup?: undefined;
|
||||
interpretation?: boolean;
|
||||
useBrushSize: boolean;
|
||||
toolOptions?: {
|
||||
brushPreset: boolean;
|
||||
flow: number;
|
||||
smooth: number;
|
||||
mode: BlendMode;
|
||||
opacity: number;
|
||||
smoothing: boolean;
|
||||
smoothingValue: number;
|
||||
smoothingRadiusMode: boolean;
|
||||
smoothingCatchup: boolean;
|
||||
smoothingCatchupAtEnd: boolean;
|
||||
smoothingZoomCompensation: boolean;
|
||||
pressureSmoothing: boolean;
|
||||
usePressureOverridesSize: boolean;
|
||||
usePressureOverridesOpacity: boolean;
|
||||
useLegacy: boolean;
|
||||
flowDynamics?: BrushDynamics;
|
||||
opacityDynamics?: BrushDynamics;
|
||||
sizeDynamics?: BrushDynamics;
|
||||
};
|
||||
}
|
||||
export declare function readAbr(buffer: ArrayBufferView, options?: {
|
||||
logMissingFeatures?: boolean;
|
||||
}): Abr;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,25 +1,25 @@
|
||||
import { LayerAdditionalInfo, BezierPath, Psd, ReadOptions, WriteOptions, BooleanOperation, LayerEffectsInfo, LayerVectorMask } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ExtendedWriteOptions extends WriteOptions {
|
||||
layerIds: Set<number>;
|
||||
layerToId: Map<any, number>;
|
||||
}
|
||||
type HasMethod = (target: LayerAdditionalInfo) => boolean;
|
||||
type ReadMethod = (reader: PsdReader, target: LayerAdditionalInfo, left: () => number, psd: Psd, options: ReadOptions) => void;
|
||||
type WriteMethod = (writer: PsdWriter, target: LayerAdditionalInfo, psd: Psd, options: ExtendedWriteOptions) => void;
|
||||
export interface InfoHandler {
|
||||
key: string;
|
||||
has: HasMethod;
|
||||
read: ReadMethod;
|
||||
write: WriteMethod;
|
||||
}
|
||||
export declare const infoHandlers: InfoHandler[];
|
||||
export declare const infoHandlersMap: {
|
||||
[key: string]: InfoHandler;
|
||||
};
|
||||
export declare function readBezierKnot(reader: PsdReader, width: number, height: number): number[];
|
||||
export declare const booleanOperations: BooleanOperation[];
|
||||
export declare function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, width: number, height: number, size: number): BezierPath[];
|
||||
export declare function hasMultiEffects(effects: LayerEffectsInfo): boolean;
|
||||
export {};
|
||||
import { LayerAdditionalInfo, BezierPath, Psd, ReadOptions, WriteOptions, BooleanOperation, LayerEffectsInfo, LayerVectorMask } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ExtendedWriteOptions extends WriteOptions {
|
||||
layerIds: Set<number>;
|
||||
layerToId: Map<any, number>;
|
||||
}
|
||||
declare type HasMethod = (target: LayerAdditionalInfo) => boolean;
|
||||
declare type ReadMethod = (reader: PsdReader, target: LayerAdditionalInfo, left: () => number, psd: Psd, options: ReadOptions) => void;
|
||||
declare type WriteMethod = (writer: PsdWriter, target: LayerAdditionalInfo, psd: Psd, options: ExtendedWriteOptions) => void;
|
||||
export interface InfoHandler {
|
||||
key: string;
|
||||
has: HasMethod;
|
||||
read: ReadMethod;
|
||||
write: WriteMethod;
|
||||
}
|
||||
export declare const infoHandlers: InfoHandler[];
|
||||
export declare const infoHandlersMap: {
|
||||
[key: string]: InfoHandler;
|
||||
};
|
||||
export declare function readBezierKnot(reader: PsdReader, width: number, height: number): number[];
|
||||
export declare const booleanOperations: BooleanOperation[];
|
||||
export declare function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, width: number, height: number, size: number): BezierPath[];
|
||||
export declare function hasMultiEffects(effects: LayerEffectsInfo): boolean;
|
||||
export {};
|
||||
|
File diff suppressed because one or more lines are too long
20
npm-packages/mac-v2.4.x/ag-psd/dist-es/csh.d.ts
vendored
20
npm-packages/mac-v2.4.x/ag-psd/dist-es/csh.d.ts
vendored
@ -1,10 +1,10 @@
|
||||
import { LayerVectorMask } from './psd';
|
||||
export interface Csh {
|
||||
shapes: (LayerVectorMask & {
|
||||
name: string;
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
})[];
|
||||
}
|
||||
export declare function readCsh(buffer: ArrayBufferView): Csh;
|
||||
import { LayerVectorMask } from './psd';
|
||||
export interface Csh {
|
||||
shapes: (LayerVectorMask & {
|
||||
name: string;
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
})[];
|
||||
}
|
||||
export declare function readCsh(buffer: ArrayBufferView): Csh;
|
||||
|
@ -1,44 +1,45 @@
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
import { readVectorMask } from './additionalInfo';
|
||||
import { readUint32, checkSignature, createReader, readPascalString, readUnicodeString } from './psdReader';
|
||||
export function readCsh(buffer) {
|
||||
var reader = createReader(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||
var csh = { shapes: [] };
|
||||
checkSignature(reader, 'cush');
|
||||
if (readUint32(reader) !== 2)
|
||||
throw new Error('Invalid version');
|
||||
var count = readUint32(reader);
|
||||
for (var i = 0; i < count; i++) {
|
||||
var name_1 = readUnicodeString(reader);
|
||||
while (reader.offset % 4)
|
||||
reader.offset++; // pad to 4byte bounds
|
||||
if (readUint32(reader) !== 1)
|
||||
throw new Error('Invalid shape version');
|
||||
var size = readUint32(reader);
|
||||
var end = reader.offset + size;
|
||||
var id = readPascalString(reader, 1);
|
||||
// this might not be correct ???
|
||||
var y1 = readUint32(reader);
|
||||
var x1 = readUint32(reader);
|
||||
var y2 = readUint32(reader);
|
||||
var x2 = readUint32(reader);
|
||||
var width = x2 - x1;
|
||||
var height = y2 - y1;
|
||||
var mask = { paths: [] };
|
||||
readVectorMask(reader, mask, width, height, end - reader.offset);
|
||||
csh.shapes.push(__assign({ name: name_1, id: id, width: width, height: height }, mask));
|
||||
reader.offset = end;
|
||||
}
|
||||
return csh;
|
||||
}
|
||||
//# sourceMappingURL=csh.js.map
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
import { readVectorMask } from './additionalInfo';
|
||||
import { readUint32, checkSignature, createReader, readPascalString, readUnicodeString } from './psdReader';
|
||||
export function readCsh(buffer) {
|
||||
var reader = createReader(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||
var csh = { shapes: [] };
|
||||
checkSignature(reader, 'cush');
|
||||
if (readUint32(reader) !== 2)
|
||||
throw new Error('Invalid version');
|
||||
var count = readUint32(reader);
|
||||
for (var i = 0; i < count; i++) {
|
||||
var name_1 = readUnicodeString(reader);
|
||||
while (reader.offset % 4)
|
||||
reader.offset++; // pad to 4byte bounds
|
||||
if (readUint32(reader) !== 1)
|
||||
throw new Error('Invalid shape version');
|
||||
var size = readUint32(reader);
|
||||
var end = reader.offset + size;
|
||||
var id = readPascalString(reader, 1);
|
||||
// this might not be correct ???
|
||||
var y1 = readUint32(reader);
|
||||
var x1 = readUint32(reader);
|
||||
var y2 = readUint32(reader);
|
||||
var x2 = readUint32(reader);
|
||||
var width = x2 - x1;
|
||||
var height = y2 - y1;
|
||||
var mask = { paths: [] };
|
||||
readVectorMask(reader, mask, width, height, end - reader.offset);
|
||||
csh.shapes.push(__assign({ name: name_1, id: id, width: width, height: height }, mask));
|
||||
reader.offset = end;
|
||||
}
|
||||
return csh;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUVsRCxPQUFPLEVBQUUsVUFBVSxFQUFFLGNBQWMsRUFBRSxZQUFZLEVBQUUsZ0JBQWdCLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFXNUcsTUFBTSxVQUFVLE9BQU8sQ0FBQyxNQUF1QjtJQUM5QyxJQUFNLE1BQU0sR0FBRyxZQUFZLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRSxNQUFNLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUNqRixJQUFNLEdBQUcsR0FBUSxFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsQ0FBQztJQUVoQyxjQUFjLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxDQUFDO0lBQy9CLElBQUksVUFBVSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUM7UUFBRSxNQUFNLElBQUksS0FBSyxDQUFDLGlCQUFpQixDQUFDLENBQUM7SUFDakUsSUFBTSxLQUFLLEdBQUcsVUFBVSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBRWpDLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxLQUFLLEVBQUUsQ0FBQyxFQUFFLEVBQUU7UUFDL0IsSUFBTSxNQUFJLEdBQUcsaUJBQWlCLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDdkMsT0FBTyxNQUFNLENBQUMsTUFBTSxHQUFHLENBQUM7WUFBRSxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQyxzQkFBc0I7UUFDakUsSUFBSSxVQUFVLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQztZQUFFLE1BQU0sSUFBSSxLQUFLLENBQUMsdUJBQXVCLENBQUMsQ0FBQztRQUN2RSxJQUFNLElBQUksR0FBRyxVQUFVLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDaEMsSUFBTSxHQUFHLEdBQUcsTUFBTSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUM7UUFDakMsSUFBTSxFQUFFLEdBQUcsZ0JBQWdCLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQyxDQUFDO1FBQ3ZDLGdDQUFnQztRQUNoQyxJQUFNLEVBQUUsR0FBRyxVQUFVLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDOUIsSUFBTSxFQUFFLEdBQUcsVUFBVSxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQzlCLElBQU0sRUFBRSxHQUFHLFVBQVUsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUM5QixJQUFNLEVBQUUsR0FBRyxVQUFVLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDOUIsSUFBTSxLQUFLLEdBQUcsRUFBRSxHQUFHLEVBQUUsQ0FBQztRQUN0QixJQUFNLE1BQU0sR0FBRyxFQUFFLEdBQUcsRUFBRSxDQUFDO1FBQ3ZCLElBQU0sSUFBSSxHQUFvQixFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsQ0FBQztRQUM1QyxjQUFjLENBQUMsTUFBTSxFQUFFLElBQUksRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDakUsR0FBRyxDQUFDLE1BQU0sQ0FBQyxJQUFJLFlBQUcsSUFBSSxRQUFBLEVBQUUsRUFBRSxJQUFBLEVBQUUsS0FBSyxPQUFBLEVBQUUsTUFBTSxRQUFBLElBQUssSUFBSSxFQUFHLENBQUM7UUFFdEQsTUFBTSxDQUFDLE1BQU0sR0FBRyxHQUFHLENBQUM7S0FDcEI7SUFFRCxPQUFPLEdBQUcsQ0FBQztBQUNaLENBQUMiLCJmaWxlIjoiY3NoLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcmVhZFZlY3Rvck1hc2sgfSBmcm9tICcuL2FkZGl0aW9uYWxJbmZvJztcclxuaW1wb3J0IHsgTGF5ZXJWZWN0b3JNYXNrIH0gZnJvbSAnLi9wc2QnO1xyXG5pbXBvcnQgeyByZWFkVWludDMyLCBjaGVja1NpZ25hdHVyZSwgY3JlYXRlUmVhZGVyLCByZWFkUGFzY2FsU3RyaW5nLCByZWFkVW5pY29kZVN0cmluZyB9IGZyb20gJy4vcHNkUmVhZGVyJztcclxuXHJcbmV4cG9ydCBpbnRlcmZhY2UgQ3NoIHtcclxuXHRzaGFwZXM6IChMYXllclZlY3Rvck1hc2sgJiB7XHJcblx0XHRuYW1lOiBzdHJpbmc7XHJcblx0XHRpZDogc3RyaW5nO1xyXG5cdFx0d2lkdGg6IG51bWJlcjtcclxuXHRcdGhlaWdodDogbnVtYmVyO1xyXG5cdH0pW107XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiByZWFkQ3NoKGJ1ZmZlcjogQXJyYXlCdWZmZXJWaWV3KTogQ3NoIHtcclxuXHRjb25zdCByZWFkZXIgPSBjcmVhdGVSZWFkZXIoYnVmZmVyLmJ1ZmZlciwgYnVmZmVyLmJ5dGVPZmZzZXQsIGJ1ZmZlci5ieXRlTGVuZ3RoKTtcclxuXHRjb25zdCBjc2g6IENzaCA9IHsgc2hhcGVzOiBbXSB9O1xyXG5cclxuXHRjaGVja1NpZ25hdHVyZShyZWFkZXIsICdjdXNoJyk7XHJcblx0aWYgKHJlYWRVaW50MzIocmVhZGVyKSAhPT0gMikgdGhyb3cgbmV3IEVycm9yKCdJbnZhbGlkIHZlcnNpb24nKTtcclxuXHRjb25zdCBjb3VudCA9IHJlYWRVaW50MzIocmVhZGVyKTtcclxuXHJcblx0Zm9yIChsZXQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XHJcblx0XHRjb25zdCBuYW1lID0gcmVhZFVuaWNvZGVTdHJpbmcocmVhZGVyKTtcclxuXHRcdHdoaWxlIChyZWFkZXIub2Zmc2V0ICUgNCkgcmVhZGVyLm9mZnNldCsrOyAvLyBwYWQgdG8gNGJ5dGUgYm91bmRzXHJcblx0XHRpZiAocmVhZFVpbnQzMihyZWFkZXIpICE9PSAxKSB0aHJvdyBuZXcgRXJyb3IoJ0ludmFsaWQgc2hhcGUgdmVyc2lvbicpO1xyXG5cdFx0Y29uc3Qgc2l6ZSA9IHJlYWRVaW50MzIocmVhZGVyKTtcclxuXHRcdGNvbnN0IGVuZCA9IHJlYWRlci5vZmZzZXQgKyBzaXplO1xyXG5cdFx0Y29uc3QgaWQgPSByZWFkUGFzY2FsU3RyaW5nKHJlYWRlciwgMSk7XHJcblx0XHQvLyB0aGlzIG1pZ2h0IG5vdCBiZSBjb3JyZWN0ID8/P1xyXG5cdFx0Y29uc3QgeTEgPSByZWFkVWludDMyKHJlYWRlcik7XHJcblx0XHRjb25zdCB4MSA9IHJlYWRVaW50MzIocmVhZGVyKTtcclxuXHRcdGNvbnN0IHkyID0gcmVhZFVpbnQzMihyZWFkZXIpO1xyXG5cdFx0Y29uc3QgeDIgPSByZWFkVWludDMyKHJlYWRlcik7XHJcblx0XHRjb25zdCB3aWR0aCA9IHgyIC0geDE7XHJcblx0XHRjb25zdCBoZWlnaHQgPSB5MiAtIHkxO1xyXG5cdFx0Y29uc3QgbWFzazogTGF5ZXJWZWN0b3JNYXNrID0geyBwYXRoczogW10gfTtcclxuXHRcdHJlYWRWZWN0b3JNYXNrKHJlYWRlciwgbWFzaywgd2lkdGgsIGhlaWdodCwgZW5kIC0gcmVhZGVyLm9mZnNldCk7XHJcblx0XHRjc2guc2hhcGVzLnB1c2goeyBuYW1lLCBpZCwgd2lkdGgsIGhlaWdodCwgLi4ubWFzayB9KTtcclxuXHJcblx0XHRyZWFkZXIub2Zmc2V0ID0gZW5kO1xyXG5cdH1cclxuXHJcblx0cmV0dXJuIGNzaDtcclxufVxyXG4iXSwic291cmNlUm9vdCI6IkM6XFxQcm9qZWN0c1xcZ2l0aHViXFxhZy1wc2RcXHNyYyJ9
|
||||
|
@ -1,415 +1,390 @@
|
||||
import { AntiAlias, BevelDirection, BevelStyle, BevelTechnique, BlendMode, Color, GlowSource, GlowTechnique, GradientStyle, InterpolationMethod, LayerEffectsInfo, LineAlignment, LineCapType, LineJoinType, Orientation, TextGridding, TimelineKeyInterpolation, TimelineTrack, TimelineTrackType, Units, UnitsValue, VectorContent, WarpStyle } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function setLogErrors(value: boolean): void;
|
||||
export declare function readAsciiStringOrClassId(reader: PsdReader): string;
|
||||
export declare function readDescriptorStructure(reader: PsdReader): any;
|
||||
export declare function writeDescriptorStructure(writer: PsdWriter, name: string, classId: string, value: any, root: string): void;
|
||||
export declare function readVersionAndDescriptor(reader: PsdReader): any;
|
||||
export declare function writeVersionAndDescriptor(writer: PsdWriter, name: string, classID: string, descriptor: any, root?: string): void;
|
||||
export type DescriptorUnits = 'Angle' | 'Density' | 'Distance' | 'None' | 'Percent' | 'Pixels' | 'Millimeters' | 'Points' | 'Picas' | 'Inches' | 'Centimeters';
|
||||
export interface DescriptorUnitsValue {
|
||||
units: DescriptorUnits;
|
||||
value: number;
|
||||
}
|
||||
export type DescriptorColor = {
|
||||
'Rd ': number;
|
||||
'Grn ': number;
|
||||
'Bl ': number;
|
||||
} | {
|
||||
'H ': DescriptorUnitsValue;
|
||||
Strt: number;
|
||||
Brgh: number;
|
||||
} | {
|
||||
'Cyn ': number;
|
||||
Mgnt: number;
|
||||
'Ylw ': number;
|
||||
Blck: number;
|
||||
} | {
|
||||
'Gry ': number;
|
||||
} | {
|
||||
Lmnc: number;
|
||||
'A ': number;
|
||||
'B ': number;
|
||||
} | {
|
||||
redFloat: number;
|
||||
greenFloat: number;
|
||||
blueFloat: number;
|
||||
};
|
||||
export interface DesciptorPattern {
|
||||
'Nm ': string;
|
||||
Idnt: string;
|
||||
}
|
||||
export type DesciptorGradient = {
|
||||
'Nm ': string;
|
||||
GrdF: 'GrdF.CstS';
|
||||
Intr: number;
|
||||
Clrs: {
|
||||
'Clr ': DescriptorColor;
|
||||
Type: 'Clry.UsrS';
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
Trns: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
} | {
|
||||
GrdF: 'GrdF.ClNs';
|
||||
Smth: number;
|
||||
'Nm ': string;
|
||||
ClrS: string;
|
||||
RndS: number;
|
||||
VctC?: boolean;
|
||||
ShTr?: boolean;
|
||||
'Mnm ': number[];
|
||||
'Mxm ': number[];
|
||||
};
|
||||
export interface DescriptorColorContent {
|
||||
'Clr ': DescriptorColor;
|
||||
}
|
||||
export interface DescriptorGradientContent {
|
||||
Grad: DesciptorGradient;
|
||||
Type: string;
|
||||
Dthr?: boolean;
|
||||
Rvrs?: boolean;
|
||||
Angl?: DescriptorUnitsValue;
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
Algn?: boolean;
|
||||
Ofst?: {
|
||||
Hrzn: DescriptorUnitsValue;
|
||||
Vrtc: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface DescriptorPatternContent {
|
||||
Ptrn: DesciptorPattern;
|
||||
Lnkd?: boolean;
|
||||
phase?: {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
};
|
||||
}
|
||||
export type DescriptorVectorContent = DescriptorColorContent | DescriptorGradientContent | DescriptorPatternContent;
|
||||
export interface StrokeDescriptor {
|
||||
strokeStyleVersion: number;
|
||||
strokeEnabled: boolean;
|
||||
fillEnabled: boolean;
|
||||
strokeStyleLineWidth: DescriptorUnitsValue;
|
||||
strokeStyleLineDashOffset: DescriptorUnitsValue;
|
||||
strokeStyleMiterLimit: number;
|
||||
strokeStyleLineCapType: string;
|
||||
strokeStyleLineJoinType: string;
|
||||
strokeStyleLineAlignment: string;
|
||||
strokeStyleScaleLock: boolean;
|
||||
strokeStyleStrokeAdjust: boolean;
|
||||
strokeStyleLineDashSet: DescriptorUnitsValue[];
|
||||
strokeStyleBlendMode: string;
|
||||
strokeStyleOpacity: DescriptorUnitsValue;
|
||||
strokeStyleContent: DescriptorVectorContent;
|
||||
strokeStyleResolution: number;
|
||||
}
|
||||
export interface TextDescriptor {
|
||||
'Txt ': string;
|
||||
textGridding: string;
|
||||
Ornt: string;
|
||||
AntA: string;
|
||||
TextIndex: number;
|
||||
EngineData?: Uint8Array;
|
||||
}
|
||||
export interface WarpDescriptor {
|
||||
warpStyle: string;
|
||||
warpValue?: number;
|
||||
warpValues?: number[];
|
||||
warpPerspective: number;
|
||||
warpPerspectiveOther: number;
|
||||
warpRotate: string;
|
||||
bounds?: {
|
||||
'Top ': DescriptorUnitsValue;
|
||||
Left: DescriptorUnitsValue;
|
||||
Btom: DescriptorUnitsValue;
|
||||
Rght: DescriptorUnitsValue;
|
||||
};
|
||||
uOrder: number;
|
||||
vOrder: number;
|
||||
customEnvelopeWarp?: {
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface QuiltWarpDescriptor extends WarpDescriptor {
|
||||
deformNumRows: number;
|
||||
deformNumCols: number;
|
||||
customEnvelopeWarp: {
|
||||
quiltSliceX: {
|
||||
type: 'quiltSliceX';
|
||||
values: number[];
|
||||
}[];
|
||||
quiltSliceY: {
|
||||
type: 'quiltSliceY';
|
||||
values: number[];
|
||||
}[];
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface FractionDescriptor {
|
||||
numerator: number;
|
||||
denominator: number;
|
||||
}
|
||||
export interface HrznVrtcDescriptor {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
}
|
||||
export interface FrameDescriptor {
|
||||
FrLs: number[];
|
||||
enab?: boolean;
|
||||
IMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
VMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
Ofst?: HrznVrtcDescriptor;
|
||||
FXRf?: HrznVrtcDescriptor;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions?: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface FrameListDescriptor {
|
||||
LaID: number;
|
||||
LaSt: FrameDescriptor[];
|
||||
}
|
||||
export declare function horzVrtcToXY(hv: HrznVrtcDescriptor): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare function xyToHorzVrtc(xy: {
|
||||
x: number;
|
||||
y: number;
|
||||
}): HrznVrtcDescriptor;
|
||||
export type TimelineAnimKeyDescriptor = {
|
||||
Type: 'keyType.Opct';
|
||||
Opct: DescriptorUnitsValue;
|
||||
} | {
|
||||
Type: 'keyType.Trnf';
|
||||
'Scl ': HrznVrtcDescriptor;
|
||||
Skew: HrznVrtcDescriptor;
|
||||
rotation: number;
|
||||
translation: HrznVrtcDescriptor;
|
||||
} | {
|
||||
Type: 'keyType.Pstn';
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
} | {
|
||||
Type: 'keyType.sheetStyle';
|
||||
sheetStyle: {
|
||||
Vrsn: number;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions: {};
|
||||
};
|
||||
} | {
|
||||
Type: 'keyType.globalLighting';
|
||||
gblA: number;
|
||||
globalAltitude: number;
|
||||
};
|
||||
export interface TimelineKeyDescriptor {
|
||||
Vrsn: 1;
|
||||
animInterpStyle: 'animInterpStyle.Lnr ' | 'animInterpStyle.hold';
|
||||
time: FractionDescriptor;
|
||||
animKey: TimelineAnimKeyDescriptor;
|
||||
selected: boolean;
|
||||
}
|
||||
export interface TimelineTrackDescriptor {
|
||||
trackID: 'stdTrackID.globalLightingTrack' | 'stdTrackID.opacityTrack' | 'stdTrackID.styleTrack' | 'stdTrackID.sheetTransformTrack' | 'stdTrackID.sheetPositionTrack';
|
||||
Vrsn: 1;
|
||||
enab: boolean;
|
||||
Effc: boolean;
|
||||
effectParams?: {
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
fillCanvas: boolean;
|
||||
zoomOrigin: number;
|
||||
};
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
}
|
||||
export interface TimeScopeDescriptor {
|
||||
Vrsn: 1;
|
||||
Strt: FractionDescriptor;
|
||||
duration: FractionDescriptor;
|
||||
inTime: FractionDescriptor;
|
||||
outTime: FractionDescriptor;
|
||||
}
|
||||
export interface TimelineDescriptor {
|
||||
Vrsn: 1;
|
||||
timeScope: TimeScopeDescriptor;
|
||||
autoScope: boolean;
|
||||
audioLevel: number;
|
||||
LyrI: number;
|
||||
trackList?: TimelineTrackDescriptor[];
|
||||
}
|
||||
export interface EffectDescriptor extends Partial<DescriptorGradientContent>, Partial<DescriptorPatternContent> {
|
||||
enab?: boolean;
|
||||
Styl: string;
|
||||
PntT?: string;
|
||||
'Md '?: string;
|
||||
Opct?: DescriptorUnitsValue;
|
||||
'Sz '?: DescriptorUnitsValue;
|
||||
'Clr '?: DescriptorColor;
|
||||
present?: boolean;
|
||||
showInDialog?: boolean;
|
||||
overprint?: boolean;
|
||||
}
|
||||
export interface Lfx2Descriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
DrSh?: EffectDescriptor;
|
||||
IrSh?: EffectDescriptor;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
SoFi?: EffectDescriptor;
|
||||
patternFill?: EffectDescriptor;
|
||||
GrFl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
FrFX?: EffectDescriptor;
|
||||
}
|
||||
export interface LmfxDescriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
numModifyingFX?: number;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
dropShadowMulti?: EffectDescriptor[];
|
||||
innerShadowMulti?: EffectDescriptor[];
|
||||
solidFillMulti?: EffectDescriptor[];
|
||||
gradientFillMulti?: EffectDescriptor[];
|
||||
frameFXMulti?: EffectDescriptor[];
|
||||
patternFill?: EffectDescriptor;
|
||||
}
|
||||
export declare function serializeEffects(e: LayerEffectsInfo, log: boolean, multi: boolean): Lfx2Descriptor & LmfxDescriptor;
|
||||
export declare function parseEffects(info: Lfx2Descriptor & LmfxDescriptor, log: boolean): LayerEffectsInfo;
|
||||
export declare function parseTrackList(trackList: TimelineTrackDescriptor[], logMissingFeatures: boolean): TimelineTrack[];
|
||||
export declare function serializeTrackList(tracks: TimelineTrack[]): TimelineTrackDescriptor[];
|
||||
export declare function parseVectorContent(descriptor: DescriptorVectorContent): VectorContent;
|
||||
export declare function serializeVectorContent(content: VectorContent): {
|
||||
descriptor: DescriptorVectorContent;
|
||||
key: string;
|
||||
};
|
||||
export declare function parseColor(color: DescriptorColor): Color;
|
||||
export declare function serializeColor(color: Color | undefined): DescriptorColor;
|
||||
export declare function parseAngle(x: DescriptorUnitsValue): number;
|
||||
export declare function parsePercent(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parsePercentOrAngle(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parseUnits({ units, value }: DescriptorUnitsValue): UnitsValue;
|
||||
export declare function parseUnitsOrNumber(value: DescriptorUnitsValue | number, units?: Units): UnitsValue;
|
||||
export declare function parseUnitsToNumber({ units, value }: DescriptorUnitsValue, expectedUnits: string): number;
|
||||
export declare function unitsAngle(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsPercent(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsValue(x: UnitsValue | undefined, key: string): DescriptorUnitsValue;
|
||||
export declare const textGridding: {
|
||||
decode: (val: string) => TextGridding;
|
||||
encode: (val: TextGridding | undefined) => string;
|
||||
};
|
||||
export declare const Ornt: {
|
||||
decode: (val: string) => Orientation;
|
||||
encode: (val: Orientation | undefined) => string;
|
||||
};
|
||||
export declare const Annt: {
|
||||
decode: (val: string) => AntiAlias;
|
||||
encode: (val: AntiAlias | undefined) => string;
|
||||
};
|
||||
export declare const warpStyle: {
|
||||
decode: (val: string) => WarpStyle;
|
||||
encode: (val: WarpStyle | undefined) => string;
|
||||
};
|
||||
export declare const BlnM: {
|
||||
decode: (val: string) => BlendMode;
|
||||
encode: (val: BlendMode | undefined) => string;
|
||||
};
|
||||
export declare const BESl: {
|
||||
decode: (val: string) => BevelStyle;
|
||||
encode: (val: BevelStyle | undefined) => string;
|
||||
};
|
||||
export declare const bvlT: {
|
||||
decode: (val: string) => BevelTechnique;
|
||||
encode: (val: BevelTechnique | undefined) => string;
|
||||
};
|
||||
export declare const BESs: {
|
||||
decode: (val: string) => BevelDirection;
|
||||
encode: (val: BevelDirection | undefined) => string;
|
||||
};
|
||||
export declare const BETE: {
|
||||
decode: (val: string) => GlowTechnique;
|
||||
encode: (val: GlowTechnique | undefined) => string;
|
||||
};
|
||||
export declare const IGSr: {
|
||||
decode: (val: string) => GlowSource;
|
||||
encode: (val: GlowSource | undefined) => string;
|
||||
};
|
||||
export declare const GrdT: {
|
||||
decode: (val: string) => GradientStyle;
|
||||
encode: (val: GradientStyle | undefined) => string;
|
||||
};
|
||||
export declare const animInterpStyleEnum: {
|
||||
decode: (val: string) => TimelineKeyInterpolation;
|
||||
encode: (val: TimelineKeyInterpolation | undefined) => string;
|
||||
};
|
||||
export declare const stdTrackID: {
|
||||
decode: (val: string) => TimelineTrackType;
|
||||
encode: (val: TimelineTrackType | undefined) => string;
|
||||
};
|
||||
export declare const gradientInterpolationMethodType: {
|
||||
decode: (val: string) => InterpolationMethod;
|
||||
encode: (val: InterpolationMethod | undefined) => string;
|
||||
};
|
||||
export declare const ClrS: {
|
||||
decode: (val: string) => "rgb" | "hsb" | "lab";
|
||||
encode: (val: "rgb" | "hsb" | "lab" | undefined) => string;
|
||||
};
|
||||
export declare const FStl: {
|
||||
decode: (val: string) => "center" | "inside" | "outside";
|
||||
encode: (val: "center" | "inside" | "outside" | undefined) => string;
|
||||
};
|
||||
export declare const FrFl: {
|
||||
decode: (val: string) => "color" | "pattern" | "gradient";
|
||||
encode: (val: "color" | "pattern" | "gradient" | undefined) => string;
|
||||
};
|
||||
export declare const ESliceType: {
|
||||
decode: (val: string) => "image" | "noImage";
|
||||
encode: (val: "image" | "noImage" | undefined) => string;
|
||||
};
|
||||
export declare const ESliceHorzAlign: {
|
||||
decode: (val: string) => "default";
|
||||
encode: (val: "default" | undefined) => string;
|
||||
};
|
||||
export declare const ESliceVertAlign: {
|
||||
decode: (val: string) => "default";
|
||||
encode: (val: "default" | undefined) => string;
|
||||
};
|
||||
export declare const ESliceOrigin: {
|
||||
decode: (val: string) => "userGenerated" | "autoGenerated" | "layer";
|
||||
encode: (val: "userGenerated" | "autoGenerated" | "layer" | undefined) => string;
|
||||
};
|
||||
export declare const ESliceBGColorType: {
|
||||
decode: (val: string) => "none" | "color" | "matte";
|
||||
encode: (val: "none" | "color" | "matte" | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineCapType: {
|
||||
decode: (val: string) => LineCapType;
|
||||
encode: (val: LineCapType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineJoinType: {
|
||||
decode: (val: string) => LineJoinType;
|
||||
encode: (val: LineJoinType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineAlignment: {
|
||||
decode: (val: string) => LineAlignment;
|
||||
encode: (val: LineAlignment | undefined) => string;
|
||||
};
|
||||
import { AntiAlias, BevelDirection, BevelStyle, BevelTechnique, BlendMode, Color, GlowSource, GlowTechnique, GradientStyle, InterpolationMethod, LayerEffectsInfo, LineAlignment, LineCapType, LineJoinType, Orientation, TextGridding, TimelineKeyInterpolation, TimelineTrack, TimelineTrackType, Units, UnitsValue, VectorContent, WarpStyle } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function setLogErrors(value: boolean): void;
|
||||
export declare function readAsciiStringOrClassId(reader: PsdReader): string;
|
||||
export declare function readDescriptorStructure(reader: PsdReader): any;
|
||||
export declare function writeDescriptorStructure(writer: PsdWriter, name: string, classId: string, value: any, root: string): void;
|
||||
export declare function readVersionAndDescriptor(reader: PsdReader): any;
|
||||
export declare function writeVersionAndDescriptor(writer: PsdWriter, name: string, classID: string, descriptor: any, root?: string): void;
|
||||
export declare type DescriptorUnits = 'Angle' | 'Density' | 'Distance' | 'None' | 'Percent' | 'Pixels' | 'Millimeters' | 'Points' | 'Picas' | 'Inches' | 'Centimeters';
|
||||
export interface DescriptorUnitsValue {
|
||||
units: DescriptorUnits;
|
||||
value: number;
|
||||
}
|
||||
export declare type DescriptorColor = {
|
||||
'Rd ': number;
|
||||
'Grn ': number;
|
||||
'Bl ': number;
|
||||
} | {
|
||||
'H ': DescriptorUnitsValue;
|
||||
Strt: number;
|
||||
Brgh: number;
|
||||
} | {
|
||||
'Cyn ': number;
|
||||
Mgnt: number;
|
||||
'Ylw ': number;
|
||||
Blck: number;
|
||||
} | {
|
||||
'Gry ': number;
|
||||
} | {
|
||||
Lmnc: number;
|
||||
'A ': number;
|
||||
'B ': number;
|
||||
};
|
||||
export interface DesciptorPattern {
|
||||
'Nm ': string;
|
||||
Idnt: string;
|
||||
}
|
||||
export declare type DesciptorGradient = {
|
||||
'Nm ': string;
|
||||
GrdF: 'GrdF.CstS';
|
||||
Intr: number;
|
||||
Clrs: {
|
||||
'Clr ': DescriptorColor;
|
||||
Type: 'Clry.UsrS';
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
Trns: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
} | {
|
||||
GrdF: 'GrdF.ClNs';
|
||||
Smth: number;
|
||||
'Nm ': string;
|
||||
ClrS: string;
|
||||
RndS: number;
|
||||
VctC?: boolean;
|
||||
ShTr?: boolean;
|
||||
'Mnm ': number[];
|
||||
'Mxm ': number[];
|
||||
};
|
||||
export interface DescriptorColorContent {
|
||||
'Clr ': DescriptorColor;
|
||||
}
|
||||
export interface DescriptorGradientContent {
|
||||
Grad: DesciptorGradient;
|
||||
Type: string;
|
||||
Dthr?: boolean;
|
||||
Rvrs?: boolean;
|
||||
Angl?: DescriptorUnitsValue;
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
Algn?: boolean;
|
||||
Ofst?: {
|
||||
Hrzn: DescriptorUnitsValue;
|
||||
Vrtc: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface DescriptorPatternContent {
|
||||
Ptrn: DesciptorPattern;
|
||||
Lnkd?: boolean;
|
||||
phase?: {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
};
|
||||
}
|
||||
export declare type DescriptorVectorContent = DescriptorColorContent | DescriptorGradientContent | DescriptorPatternContent;
|
||||
export interface StrokeDescriptor {
|
||||
strokeStyleVersion: number;
|
||||
strokeEnabled: boolean;
|
||||
fillEnabled: boolean;
|
||||
strokeStyleLineWidth: DescriptorUnitsValue;
|
||||
strokeStyleLineDashOffset: DescriptorUnitsValue;
|
||||
strokeStyleMiterLimit: number;
|
||||
strokeStyleLineCapType: string;
|
||||
strokeStyleLineJoinType: string;
|
||||
strokeStyleLineAlignment: string;
|
||||
strokeStyleScaleLock: boolean;
|
||||
strokeStyleStrokeAdjust: boolean;
|
||||
strokeStyleLineDashSet: DescriptorUnitsValue[];
|
||||
strokeStyleBlendMode: string;
|
||||
strokeStyleOpacity: DescriptorUnitsValue;
|
||||
strokeStyleContent: DescriptorVectorContent;
|
||||
strokeStyleResolution: number;
|
||||
}
|
||||
export interface TextDescriptor {
|
||||
'Txt ': string;
|
||||
textGridding: string;
|
||||
Ornt: string;
|
||||
AntA: string;
|
||||
TextIndex: number;
|
||||
EngineData?: Uint8Array;
|
||||
}
|
||||
export interface WarpDescriptor {
|
||||
warpStyle: string;
|
||||
warpValue: number;
|
||||
warpPerspective: number;
|
||||
warpPerspectiveOther: number;
|
||||
warpRotate: string;
|
||||
bounds?: {
|
||||
'Top ': DescriptorUnitsValue;
|
||||
Left: DescriptorUnitsValue;
|
||||
Btom: DescriptorUnitsValue;
|
||||
Rght: DescriptorUnitsValue;
|
||||
};
|
||||
uOrder: number;
|
||||
vOrder: number;
|
||||
customEnvelopeWarp?: {
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface QuiltWarpDescriptor extends WarpDescriptor {
|
||||
deformNumRows: number;
|
||||
deformNumCols: number;
|
||||
customEnvelopeWarp: {
|
||||
quiltSliceX: {
|
||||
type: 'quiltSliceX';
|
||||
values: number[];
|
||||
}[];
|
||||
quiltSliceY: {
|
||||
type: 'quiltSliceY';
|
||||
values: number[];
|
||||
}[];
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface FractionDescriptor {
|
||||
numerator: number;
|
||||
denominator: number;
|
||||
}
|
||||
export interface HrznVrtcDescriptor {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
}
|
||||
export interface FrameDescriptor {
|
||||
FrLs: number[];
|
||||
enab?: boolean;
|
||||
IMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
VMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
Ofst?: HrznVrtcDescriptor;
|
||||
FXRf?: HrznVrtcDescriptor;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions?: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface FrameListDescriptor {
|
||||
LaID: number;
|
||||
LaSt: FrameDescriptor[];
|
||||
}
|
||||
export declare function horzVrtcToXY(hv: HrznVrtcDescriptor): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare function xyToHorzVrtc(xy: {
|
||||
x: number;
|
||||
y: number;
|
||||
}): HrznVrtcDescriptor;
|
||||
export declare type TimelineAnimKeyDescriptor = {
|
||||
Type: 'keyType.Opct';
|
||||
Opct: DescriptorUnitsValue;
|
||||
} | {
|
||||
Type: 'keyType.Trnf';
|
||||
'Scl ': HrznVrtcDescriptor;
|
||||
Skew: HrznVrtcDescriptor;
|
||||
rotation: number;
|
||||
translation: HrznVrtcDescriptor;
|
||||
} | {
|
||||
Type: 'keyType.Pstn';
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
} | {
|
||||
Type: 'keyType.sheetStyle';
|
||||
sheetStyle: {
|
||||
Vrsn: number;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions: {};
|
||||
};
|
||||
} | {
|
||||
Type: 'keyType.globalLighting';
|
||||
gblA: number;
|
||||
globalAltitude: number;
|
||||
};
|
||||
export interface TimelineKeyDescriptor {
|
||||
Vrsn: 1;
|
||||
animInterpStyle: 'animInterpStyle.Lnr ' | 'animInterpStyle.hold';
|
||||
time: FractionDescriptor;
|
||||
animKey: TimelineAnimKeyDescriptor;
|
||||
selected: boolean;
|
||||
}
|
||||
export interface TimelineTrackDescriptor {
|
||||
trackID: 'stdTrackID.globalLightingTrack' | 'stdTrackID.opacityTrack' | 'stdTrackID.styleTrack' | 'stdTrackID.sheetTransformTrack' | 'stdTrackID.sheetPositionTrack';
|
||||
Vrsn: 1;
|
||||
enab: boolean;
|
||||
Effc: boolean;
|
||||
effectParams?: {
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
fillCanvas: boolean;
|
||||
zoomOrigin: number;
|
||||
};
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
}
|
||||
export interface TimeScopeDescriptor {
|
||||
Vrsn: 1;
|
||||
Strt: FractionDescriptor;
|
||||
duration: FractionDescriptor;
|
||||
inTime: FractionDescriptor;
|
||||
outTime: FractionDescriptor;
|
||||
}
|
||||
export interface TimelineDescriptor {
|
||||
Vrsn: 1;
|
||||
timeScope: TimeScopeDescriptor;
|
||||
autoScope: boolean;
|
||||
audioLevel: number;
|
||||
LyrI: number;
|
||||
trackList?: TimelineTrackDescriptor[];
|
||||
}
|
||||
export interface EffectDescriptor extends Partial<DescriptorGradientContent>, Partial<DescriptorPatternContent> {
|
||||
enab?: boolean;
|
||||
Styl: string;
|
||||
PntT?: string;
|
||||
'Md '?: string;
|
||||
Opct?: DescriptorUnitsValue;
|
||||
'Sz '?: DescriptorUnitsValue;
|
||||
'Clr '?: DescriptorColor;
|
||||
present?: boolean;
|
||||
showInDialog?: boolean;
|
||||
overprint?: boolean;
|
||||
}
|
||||
export interface Lfx2Descriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
DrSh?: EffectDescriptor;
|
||||
IrSh?: EffectDescriptor;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
SoFi?: EffectDescriptor;
|
||||
patternFill?: EffectDescriptor;
|
||||
GrFl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
FrFX?: EffectDescriptor;
|
||||
}
|
||||
export interface LmfxDescriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
numModifyingFX?: number;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
dropShadowMulti?: EffectDescriptor[];
|
||||
innerShadowMulti?: EffectDescriptor[];
|
||||
solidFillMulti?: EffectDescriptor[];
|
||||
gradientFillMulti?: EffectDescriptor[];
|
||||
frameFXMulti?: EffectDescriptor[];
|
||||
patternFill?: EffectDescriptor;
|
||||
}
|
||||
export declare function serializeEffects(e: LayerEffectsInfo, log: boolean, multi: boolean): Lfx2Descriptor & LmfxDescriptor;
|
||||
export declare function parseEffects(info: Lfx2Descriptor & LmfxDescriptor, log: boolean): LayerEffectsInfo;
|
||||
export declare function parseTrackList(trackList: TimelineTrackDescriptor[], logMissingFeatures: boolean): TimelineTrack[];
|
||||
export declare function serializeTrackList(tracks: TimelineTrack[]): TimelineTrackDescriptor[];
|
||||
export declare function parseVectorContent(descriptor: DescriptorVectorContent): VectorContent;
|
||||
export declare function serializeVectorContent(content: VectorContent): {
|
||||
descriptor: DescriptorVectorContent;
|
||||
key: string;
|
||||
};
|
||||
export declare function parseColor(color: DescriptorColor): Color;
|
||||
export declare function serializeColor(color: Color | undefined): DescriptorColor;
|
||||
export declare function parseAngle(x: DescriptorUnitsValue): number;
|
||||
export declare function parsePercent(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parsePercentOrAngle(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parseUnits({ units, value }: DescriptorUnitsValue): UnitsValue;
|
||||
export declare function parseUnitsOrNumber(value: DescriptorUnitsValue | number, units?: Units): UnitsValue;
|
||||
export declare function parseUnitsToNumber({ units, value }: DescriptorUnitsValue, expectedUnits: string): number;
|
||||
export declare function unitsAngle(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsPercent(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsValue(x: UnitsValue | undefined, key: string): DescriptorUnitsValue;
|
||||
export declare const textGridding: {
|
||||
decode: (val: string) => TextGridding;
|
||||
encode: (val: TextGridding | undefined) => string;
|
||||
};
|
||||
export declare const Ornt: {
|
||||
decode: (val: string) => Orientation;
|
||||
encode: (val: Orientation | undefined) => string;
|
||||
};
|
||||
export declare const Annt: {
|
||||
decode: (val: string) => AntiAlias;
|
||||
encode: (val: AntiAlias | undefined) => string;
|
||||
};
|
||||
export declare const warpStyle: {
|
||||
decode: (val: string) => WarpStyle;
|
||||
encode: (val: WarpStyle | undefined) => string;
|
||||
};
|
||||
export declare const BlnM: {
|
||||
decode: (val: string) => BlendMode;
|
||||
encode: (val: BlendMode | undefined) => string;
|
||||
};
|
||||
export declare const BESl: {
|
||||
decode: (val: string) => BevelStyle;
|
||||
encode: (val: BevelStyle | undefined) => string;
|
||||
};
|
||||
export declare const bvlT: {
|
||||
decode: (val: string) => BevelTechnique;
|
||||
encode: (val: BevelTechnique | undefined) => string;
|
||||
};
|
||||
export declare const BESs: {
|
||||
decode: (val: string) => BevelDirection;
|
||||
encode: (val: BevelDirection | undefined) => string;
|
||||
};
|
||||
export declare const BETE: {
|
||||
decode: (val: string) => GlowTechnique;
|
||||
encode: (val: GlowTechnique | undefined) => string;
|
||||
};
|
||||
export declare const IGSr: {
|
||||
decode: (val: string) => GlowSource;
|
||||
encode: (val: GlowSource | undefined) => string;
|
||||
};
|
||||
export declare const GrdT: {
|
||||
decode: (val: string) => GradientStyle;
|
||||
encode: (val: GradientStyle | undefined) => string;
|
||||
};
|
||||
export declare const animInterpStyleEnum: {
|
||||
decode: (val: string) => TimelineKeyInterpolation;
|
||||
encode: (val: TimelineKeyInterpolation | undefined) => string;
|
||||
};
|
||||
export declare const stdTrackID: {
|
||||
decode: (val: string) => TimelineTrackType;
|
||||
encode: (val: TimelineTrackType | undefined) => string;
|
||||
};
|
||||
export declare const gradientInterpolationMethodType: {
|
||||
decode: (val: string) => InterpolationMethod;
|
||||
encode: (val: InterpolationMethod | undefined) => string;
|
||||
};
|
||||
export declare const ClrS: {
|
||||
decode: (val: string) => "rgb" | "hsb" | "lab";
|
||||
encode: (val: "rgb" | "hsb" | "lab" | undefined) => string;
|
||||
};
|
||||
export declare const FStl: {
|
||||
decode: (val: string) => "center" | "inside" | "outside";
|
||||
encode: (val: "center" | "inside" | "outside" | undefined) => string;
|
||||
};
|
||||
export declare const FrFl: {
|
||||
decode: (val: string) => "color" | "pattern" | "gradient";
|
||||
encode: (val: "color" | "pattern" | "gradient" | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineCapType: {
|
||||
decode: (val: string) => LineCapType;
|
||||
encode: (val: LineCapType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineJoinType: {
|
||||
decode: (val: string) => LineJoinType;
|
||||
encode: (val: LineJoinType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineAlignment: {
|
||||
decode: (val: string) => LineAlignment;
|
||||
encode: (val: LineAlignment | undefined) => string;
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
import { LayerEffectsInfo } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function readEffects(reader: PsdReader): LayerEffectsInfo;
|
||||
export declare function writeEffects(writer: PsdWriter, effects: LayerEffectsInfo): void;
|
||||
import { LayerEffectsInfo } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function readEffects(reader: PsdReader): LayerEffectsInfo;
|
||||
export declare function writeEffects(writer: PsdWriter, effects: LayerEffectsInfo): void;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
export declare function parseEngineData(data: number[] | Uint8Array): any;
|
||||
export declare function serializeEngineData(data: any, condensed?: boolean): Uint8Array;
|
||||
export declare function parseEngineData(data: number[] | Uint8Array): any;
|
||||
export declare function serializeEngineData(data: any, condensed?: boolean): Uint8Array;
|
||||
|
File diff suppressed because one or more lines are too long
186
npm-packages/mac-v2.4.x/ag-psd/dist-es/helpers.d.ts
vendored
186
npm-packages/mac-v2.4.x/ag-psd/dist-es/helpers.d.ts
vendored
@ -1,93 +1,93 @@
|
||||
import { Layer, BlendMode, LayerColor } from './psd';
|
||||
export declare const MOCK_HANDLERS = false;
|
||||
export declare const RAW_IMAGE_DATA = false;
|
||||
export declare const fromBlendMode: {
|
||||
[key: string]: string;
|
||||
};
|
||||
export declare const toBlendMode: {
|
||||
[key: string]: BlendMode;
|
||||
};
|
||||
export declare const layerColors: LayerColor[];
|
||||
export declare const largeAdditionalInfoKeys: string[];
|
||||
export interface Dict {
|
||||
[key: string]: string;
|
||||
}
|
||||
export declare function revMap(map: Dict): Dict;
|
||||
export declare function createEnum<T>(prefix: string, def: string, map: Dict): {
|
||||
decode: (val: string) => T;
|
||||
encode: (val: T | undefined) => string;
|
||||
};
|
||||
export declare const enum ColorSpace {
|
||||
RGB = 0,
|
||||
HSB = 1,
|
||||
CMYK = 2,
|
||||
Lab = 7,
|
||||
Grayscale = 8
|
||||
}
|
||||
export declare const enum LayerMaskFlags {
|
||||
PositionRelativeToLayer = 1,
|
||||
LayerMaskDisabled = 2,
|
||||
InvertLayerMaskWhenBlending = 4,
|
||||
LayerMaskFromRenderingOtherData = 8,
|
||||
MaskHasParametersAppliedToIt = 16
|
||||
}
|
||||
export declare const enum MaskParams {
|
||||
UserMaskDensity = 1,
|
||||
UserMaskFeather = 2,
|
||||
VectorMaskDensity = 4,
|
||||
VectorMaskFeather = 8
|
||||
}
|
||||
export declare const enum ChannelID {
|
||||
Color0 = 0,
|
||||
Color1 = 1,
|
||||
Color2 = 2,
|
||||
Color3 = 3,
|
||||
Transparency = -1,
|
||||
UserMask = -2,
|
||||
RealUserMask = -3
|
||||
}
|
||||
export declare const enum Compression {
|
||||
RawData = 0,
|
||||
RleCompressed = 1,
|
||||
ZipWithoutPrediction = 2,
|
||||
ZipWithPrediction = 3
|
||||
}
|
||||
export interface ChannelData {
|
||||
channelId: ChannelID;
|
||||
compression: Compression;
|
||||
buffer: Uint8Array | undefined;
|
||||
length: number;
|
||||
}
|
||||
export interface Bounds {
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
}
|
||||
export interface LayerChannelData {
|
||||
layer: Layer;
|
||||
channels: ChannelData[];
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
mask?: Bounds;
|
||||
}
|
||||
export type PixelArray = Uint8ClampedArray | Uint8Array;
|
||||
export interface PixelData {
|
||||
data: PixelArray;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export declare function offsetForChannel(channelId: ChannelID, cmyk: boolean): number;
|
||||
export declare function clamp(value: number, min: number, max: number): number;
|
||||
export declare function hasAlpha(data: PixelData): boolean;
|
||||
export declare function resetImageData({ data }: PixelData): void;
|
||||
export declare function decodeBitmap(input: PixelArray, output: PixelArray, width: number, height: number): void;
|
||||
export declare function writeDataRaw(data: PixelData, offset: number, width: number, height: number): Uint8Array | undefined;
|
||||
export declare function writeDataRLE(buffer: Uint8Array, { data, width, height }: PixelData, offsets: number[], large: boolean): Uint8Array | undefined;
|
||||
export declare function writeDataZipWithoutPrediction({ data, width, height }: PixelData, offsets: number[]): Uint8Array;
|
||||
export declare let createCanvas: (width: number, height: number) => HTMLCanvasElement;
|
||||
export declare let createCanvasFromData: (data: Uint8Array) => HTMLCanvasElement;
|
||||
export declare let createImageData: (width: number, height: number) => ImageData;
|
||||
export declare function initializeCanvas(createCanvasMethod: (width: number, height: number) => HTMLCanvasElement, createCanvasFromDataMethod?: (data: Uint8Array) => HTMLCanvasElement, createImageDataMethod?: (width: number, height: number) => ImageData): void;
|
||||
import { Layer, BlendMode, LayerColor } from './psd';
|
||||
export declare const MOCK_HANDLERS = false;
|
||||
export declare const RAW_IMAGE_DATA = false;
|
||||
export declare const fromBlendMode: {
|
||||
[key: string]: string;
|
||||
};
|
||||
export declare const toBlendMode: {
|
||||
[key: string]: BlendMode;
|
||||
};
|
||||
export declare const layerColors: LayerColor[];
|
||||
export declare const largeAdditionalInfoKeys: string[];
|
||||
export interface Dict {
|
||||
[key: string]: string;
|
||||
}
|
||||
export declare function revMap(map: Dict): Dict;
|
||||
export declare function createEnum<T>(prefix: string, def: string, map: Dict): {
|
||||
decode: (val: string) => T;
|
||||
encode: (val: T | undefined) => string;
|
||||
};
|
||||
export declare const enum ColorSpace {
|
||||
RGB = 0,
|
||||
HSB = 1,
|
||||
CMYK = 2,
|
||||
Lab = 7,
|
||||
Grayscale = 8
|
||||
}
|
||||
export declare const enum LayerMaskFlags {
|
||||
PositionRelativeToLayer = 1,
|
||||
LayerMaskDisabled = 2,
|
||||
InvertLayerMaskWhenBlending = 4,
|
||||
LayerMaskFromRenderingOtherData = 8,
|
||||
MaskHasParametersAppliedToIt = 16
|
||||
}
|
||||
export declare const enum MaskParams {
|
||||
UserMaskDensity = 1,
|
||||
UserMaskFeather = 2,
|
||||
VectorMaskDensity = 4,
|
||||
VectorMaskFeather = 8
|
||||
}
|
||||
export declare const enum ChannelID {
|
||||
Color0 = 0,
|
||||
Color1 = 1,
|
||||
Color2 = 2,
|
||||
Color3 = 3,
|
||||
Transparency = -1,
|
||||
UserMask = -2,
|
||||
RealUserMask = -3
|
||||
}
|
||||
export declare const enum Compression {
|
||||
RawData = 0,
|
||||
RleCompressed = 1,
|
||||
ZipWithoutPrediction = 2,
|
||||
ZipWithPrediction = 3
|
||||
}
|
||||
export interface ChannelData {
|
||||
channelId: ChannelID;
|
||||
compression: Compression;
|
||||
buffer: Uint8Array | undefined;
|
||||
length: number;
|
||||
}
|
||||
export interface Bounds {
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
}
|
||||
export interface LayerChannelData {
|
||||
layer: Layer;
|
||||
channels: ChannelData[];
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
mask?: Bounds;
|
||||
}
|
||||
export declare type PixelArray = Uint8ClampedArray | Uint8Array;
|
||||
export interface PixelData {
|
||||
data: PixelArray;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export declare function offsetForChannel(channelId: ChannelID, cmyk: boolean): number;
|
||||
export declare function clamp(value: number, min: number, max: number): number;
|
||||
export declare function hasAlpha(data: PixelData): boolean;
|
||||
export declare function resetImageData({ data }: PixelData): void;
|
||||
export declare function decodeBitmap(input: PixelArray, output: PixelArray, width: number, height: number): void;
|
||||
export declare function writeDataRaw(data: PixelData, offset: number, width: number, height: number): Uint8Array | undefined;
|
||||
export declare function writeDataRLE(buffer: Uint8Array, { data, width, height }: PixelData, offsets: number[], large: boolean): Uint8Array | undefined;
|
||||
export declare function writeDataZipWithoutPrediction({ data, width, height }: PixelData, offsets: number[]): Uint8Array;
|
||||
export declare let createCanvas: (width: number, height: number) => HTMLCanvasElement;
|
||||
export declare let createCanvasFromData: (data: Uint8Array) => HTMLCanvasElement;
|
||||
export declare let createImageData: (width: number, height: number) => ImageData;
|
||||
export declare function initializeCanvas(createCanvasMethod: (width: number, height: number) => HTMLCanvasElement, createCanvasFromDataMethod?: (data: Uint8Array) => HTMLCanvasElement, createImageDataMethod?: (width: number, height: number) => ImageData): void;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,13 +1,13 @@
|
||||
import { ImageResources, ReadOptions } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ResourceHandler {
|
||||
key: number;
|
||||
has: (target: ImageResources) => boolean | number;
|
||||
read: (reader: PsdReader, target: ImageResources, left: () => number, options: ReadOptions) => void;
|
||||
write: (writer: PsdWriter, target: ImageResources, index: number) => void;
|
||||
}
|
||||
export declare const resourceHandlers: ResourceHandler[];
|
||||
export declare const resourceHandlersMap: {
|
||||
[key: number]: ResourceHandler;
|
||||
};
|
||||
import { ImageResources, ReadOptions } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ResourceHandler {
|
||||
key: number;
|
||||
has: (target: ImageResources) => boolean;
|
||||
read: (reader: PsdReader, target: ImageResources, left: () => number, options: ReadOptions) => void;
|
||||
write: (writer: PsdWriter, target: ImageResources) => void;
|
||||
}
|
||||
export declare const resourceHandlers: ResourceHandler[];
|
||||
export declare const resourceHandlersMap: {
|
||||
[key: number]: ResourceHandler;
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,20 +1,20 @@
|
||||
/// <reference types="node" />
|
||||
import { Psd, ReadOptions, WriteOptions } from './psd';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
import { PsdReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export { PsdReader, PsdWriter };
|
||||
interface BufferLike {
|
||||
buffer: ArrayBuffer;
|
||||
byteOffset: number;
|
||||
byteLength: number;
|
||||
}
|
||||
export declare const byteArrayToBase64: typeof fromByteArray;
|
||||
export declare function readPsd(buffer: ArrayBuffer | BufferLike, options?: ReadOptions): Psd;
|
||||
export declare function writePsd(psd: Psd, options?: WriteOptions): ArrayBuffer;
|
||||
export declare function writePsdUint8Array(psd: Psd, options?: WriteOptions): Uint8Array;
|
||||
export declare function writePsdBuffer(psd: Psd, options?: WriteOptions): Buffer;
|
||||
/// <reference types="node" />
|
||||
import { Psd, ReadOptions, WriteOptions } from './psd';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
import { PsdReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export { PsdReader, PsdWriter };
|
||||
interface BufferLike {
|
||||
buffer: ArrayBuffer;
|
||||
byteOffset: number;
|
||||
byteLength: number;
|
||||
}
|
||||
export declare const byteArrayToBase64: typeof fromByteArray;
|
||||
export declare function readPsd(buffer: ArrayBuffer | BufferLike, options?: ReadOptions): Psd;
|
||||
export declare function writePsd(psd: Psd, options?: WriteOptions): ArrayBuffer;
|
||||
export declare function writePsdUint8Array(psd: Psd, options?: WriteOptions): Uint8Array;
|
||||
export declare function writePsdBuffer(psd: Psd, options?: WriteOptions): Buffer;
|
||||
|
@ -1,31 +1,32 @@
|
||||
import { writePsd as writePsdInternal, getWriterBuffer, createWriter, getWriterBufferNoCopy } from './psdWriter';
|
||||
import { readPsd as readPsdInternal, createReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export var byteArrayToBase64 = fromByteArray;
|
||||
export function readPsd(buffer, options) {
|
||||
var reader = 'buffer' in buffer ?
|
||||
createReader(buffer.buffer, buffer.byteOffset, buffer.byteLength) :
|
||||
createReader(buffer);
|
||||
return readPsdInternal(reader, options);
|
||||
}
|
||||
export function writePsd(psd, options) {
|
||||
var writer = createWriter();
|
||||
writePsdInternal(writer, psd, options);
|
||||
return getWriterBuffer(writer);
|
||||
}
|
||||
export function writePsdUint8Array(psd, options) {
|
||||
var writer = createWriter();
|
||||
writePsdInternal(writer, psd, options);
|
||||
return getWriterBufferNoCopy(writer);
|
||||
}
|
||||
export function writePsdBuffer(psd, options) {
|
||||
if (typeof Buffer === 'undefined') {
|
||||
throw new Error('Buffer not supported on this platform');
|
||||
}
|
||||
return Buffer.from(writePsdUint8Array(psd, options));
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
import { writePsd as writePsdInternal, getWriterBuffer, createWriter, getWriterBufferNoCopy } from './psdWriter';
|
||||
import { readPsd as readPsdInternal, createReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export var byteArrayToBase64 = fromByteArray;
|
||||
export function readPsd(buffer, options) {
|
||||
var reader = 'buffer' in buffer ?
|
||||
createReader(buffer.buffer, buffer.byteOffset, buffer.byteLength) :
|
||||
createReader(buffer);
|
||||
return readPsdInternal(reader, options);
|
||||
}
|
||||
export function writePsd(psd, options) {
|
||||
var writer = createWriter();
|
||||
writePsdInternal(writer, psd, options);
|
||||
return getWriterBuffer(writer);
|
||||
}
|
||||
export function writePsdUint8Array(psd, options) {
|
||||
var writer = createWriter();
|
||||
writePsdInternal(writer, psd, options);
|
||||
return getWriterBufferNoCopy(writer);
|
||||
}
|
||||
export function writePsdBuffer(psd, options) {
|
||||
if (typeof Buffer === 'undefined') {
|
||||
throw new Error('Buffer not supported on this platform');
|
||||
}
|
||||
return Buffer.from(writePsdUint8Array(psd, options));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBYSxRQUFRLElBQUksZ0JBQWdCLEVBQUUsZUFBZSxFQUFFLFlBQVksRUFBRSxxQkFBcUIsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUM1SCxPQUFPLEVBQWEsT0FBTyxJQUFJLGVBQWUsRUFBRSxZQUFZLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDbEYsY0FBYyxPQUFPLENBQUM7QUFDdEIsY0FBYyxPQUFPLENBQUM7QUFDdEIsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sV0FBVyxDQUFDO0FBQzdDLGNBQWMsT0FBTyxDQUFDO0FBQ3RCLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFTMUMsTUFBTSxDQUFDLElBQU0saUJBQWlCLEdBQUcsYUFBYSxDQUFDO0FBRS9DLE1BQU0sVUFBVSxPQUFPLENBQUMsTUFBZ0MsRUFBRSxPQUFxQjtJQUM5RSxJQUFNLE1BQU0sR0FBRyxRQUFRLElBQUksTUFBTSxDQUFDLENBQUM7UUFDbEMsWUFBWSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQztRQUNuRSxZQUFZLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDdEIsT0FBTyxlQUFlLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxDQUFDO0FBQ3pDLENBQUM7QUFFRCxNQUFNLFVBQVUsUUFBUSxDQUFDLEdBQVEsRUFBRSxPQUFzQjtJQUN4RCxJQUFNLE1BQU0sR0FBRyxZQUFZLEVBQUUsQ0FBQztJQUM5QixnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQ3ZDLE9BQU8sZUFBZSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ2hDLENBQUM7QUFFRCxNQUFNLFVBQVUsa0JBQWtCLENBQUMsR0FBUSxFQUFFLE9BQXNCO0lBQ2xFLElBQU0sTUFBTSxHQUFHLFlBQVksRUFBRSxDQUFDO0lBQzlCLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDdkMsT0FBTyxxQkFBcUIsQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUN0QyxDQUFDO0FBRUQsTUFBTSxVQUFVLGNBQWMsQ0FBQyxHQUFRLEVBQUUsT0FBc0I7SUFDOUQsSUFBSSxPQUFPLE1BQU0sS0FBSyxXQUFXLEVBQUU7UUFDbEMsTUFBTSxJQUFJLEtBQUssQ0FBQyx1Q0FBdUMsQ0FBQyxDQUFDO0tBQ3pEO0lBRUQsT0FBTyxNQUFNLENBQUMsSUFBSSxDQUFDLGtCQUFrQixDQUFDLEdBQUcsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDO0FBQ3RELENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQc2QsIFJlYWRPcHRpb25zLCBXcml0ZU9wdGlvbnMgfSBmcm9tICcuL3BzZCc7XG5pbXBvcnQgeyBQc2RXcml0ZXIsIHdyaXRlUHNkIGFzIHdyaXRlUHNkSW50ZXJuYWwsIGdldFdyaXRlckJ1ZmZlciwgY3JlYXRlV3JpdGVyLCBnZXRXcml0ZXJCdWZmZXJOb0NvcHkgfSBmcm9tICcuL3BzZFdyaXRlcic7XG5pbXBvcnQgeyBQc2RSZWFkZXIsIHJlYWRQc2QgYXMgcmVhZFBzZEludGVybmFsLCBjcmVhdGVSZWFkZXIgfSBmcm9tICcuL3BzZFJlYWRlcic7XG5leHBvcnQgKiBmcm9tICcuL2Ficic7XG5leHBvcnQgKiBmcm9tICcuL2NzaCc7XG5leHBvcnQgeyBpbml0aWFsaXplQ2FudmFzIH0gZnJvbSAnLi9oZWxwZXJzJztcbmV4cG9ydCAqIGZyb20gJy4vcHNkJztcbmltcG9ydCB7IGZyb21CeXRlQXJyYXkgfSBmcm9tICdiYXNlNjQtanMnO1xuZXhwb3J0IHsgUHNkUmVhZGVyLCBQc2RXcml0ZXIgfTtcblxuaW50ZXJmYWNlIEJ1ZmZlckxpa2Uge1xuXHRidWZmZXI6IEFycmF5QnVmZmVyO1xuXHRieXRlT2Zmc2V0OiBudW1iZXI7XG5cdGJ5dGVMZW5ndGg6IG51bWJlcjtcbn1cblxuZXhwb3J0IGNvbnN0IGJ5dGVBcnJheVRvQmFzZTY0ID0gZnJvbUJ5dGVBcnJheTtcblxuZXhwb3J0IGZ1bmN0aW9uIHJlYWRQc2QoYnVmZmVyOiBBcnJheUJ1ZmZlciB8IEJ1ZmZlckxpa2UsIG9wdGlvbnM/OiBSZWFkT3B0aW9ucyk6IFBzZCB7XG5cdGNvbnN0IHJlYWRlciA9ICdidWZmZXInIGluIGJ1ZmZlciA/XG5cdFx0Y3JlYXRlUmVhZGVyKGJ1ZmZlci5idWZmZXIsIGJ1ZmZlci5ieXRlT2Zmc2V0LCBidWZmZXIuYnl0ZUxlbmd0aCkgOlxuXHRcdGNyZWF0ZVJlYWRlcihidWZmZXIpO1xuXHRyZXR1cm4gcmVhZFBzZEludGVybmFsKHJlYWRlciwgb3B0aW9ucyk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiB3cml0ZVBzZChwc2Q6IFBzZCwgb3B0aW9ucz86IFdyaXRlT3B0aW9ucyk6IEFycmF5QnVmZmVyIHtcblx0Y29uc3Qgd3JpdGVyID0gY3JlYXRlV3JpdGVyKCk7XG5cdHdyaXRlUHNkSW50ZXJuYWwod3JpdGVyLCBwc2QsIG9wdGlvbnMpO1xuXHRyZXR1cm4gZ2V0V3JpdGVyQnVmZmVyKHdyaXRlcik7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiB3cml0ZVBzZFVpbnQ4QXJyYXkocHNkOiBQc2QsIG9wdGlvbnM/OiBXcml0ZU9wdGlvbnMpOiBVaW50OEFycmF5IHtcblx0Y29uc3Qgd3JpdGVyID0gY3JlYXRlV3JpdGVyKCk7XG5cdHdyaXRlUHNkSW50ZXJuYWwod3JpdGVyLCBwc2QsIG9wdGlvbnMpO1xuXHRyZXR1cm4gZ2V0V3JpdGVyQnVmZmVyTm9Db3B5KHdyaXRlcik7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiB3cml0ZVBzZEJ1ZmZlcihwc2Q6IFBzZCwgb3B0aW9ucz86IFdyaXRlT3B0aW9ucyk6IEJ1ZmZlciB7XG5cdGlmICh0eXBlb2YgQnVmZmVyID09PSAndW5kZWZpbmVkJykge1xuXHRcdHRocm93IG5ldyBFcnJvcignQnVmZmVyIG5vdCBzdXBwb3J0ZWQgb24gdGhpcyBwbGF0Zm9ybScpO1xuXHR9XG5cblx0cmV0dXJuIEJ1ZmZlci5mcm9tKHdyaXRlUHNkVWludDhBcnJheShwc2QsIG9wdGlvbnMpKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiQzpcXFByb2plY3RzXFxnaXRodWJcXGFnLXBzZFxcc3JjIn0=
|
||||
|
@ -1 +1 @@
|
||||
export declare function initialize(): void;
|
||||
export declare function initialize(): void;
|
||||
|
@ -1,22 +1,23 @@
|
||||
import { createCanvas } from 'canvas';
|
||||
import { initializeCanvas } from './index';
|
||||
import { decodeJpeg } from './jpeg';
|
||||
function createCanvasFromData(data) {
|
||||
var canvas = createCanvas(100, 100);
|
||||
try {
|
||||
var context_1 = canvas.getContext('2d');
|
||||
var imageData = decodeJpeg(data, function (w, h) { return context_1.createImageData(w, h); });
|
||||
canvas.width = imageData.width;
|
||||
canvas.height = imageData.height;
|
||||
context_1.putImageData(imageData, 0, 0);
|
||||
}
|
||||
catch (e) {
|
||||
console.error('JPEG decompression error', e.message);
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
initializeCanvas(createCanvas, createCanvasFromData);
|
||||
export function initialize() {
|
||||
initializeCanvas(createCanvas, createCanvasFromData);
|
||||
}
|
||||
//# sourceMappingURL=initializeCanvas.js.map
|
||||
import { createCanvas } from 'canvas';
|
||||
import { initializeCanvas } from './index';
|
||||
import { decodeJpeg } from './jpeg';
|
||||
function createCanvasFromData(data) {
|
||||
var canvas = createCanvas(100, 100);
|
||||
try {
|
||||
var context_1 = canvas.getContext('2d');
|
||||
var imageData = decodeJpeg(data, function (w, h) { return context_1.createImageData(w, h); });
|
||||
canvas.width = imageData.width;
|
||||
canvas.height = imageData.height;
|
||||
context_1.putImageData(imageData, 0, 0);
|
||||
}
|
||||
catch (e) {
|
||||
console.error('JPEG decompression error', e.message);
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
initializeCanvas(createCanvas, createCanvasFromData);
|
||||
export function initialize() {
|
||||
initializeCanvas(createCanvas, createCanvasFromData);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluaXRpYWxpemVDYW52YXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUN0QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFDM0MsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUVwQyxTQUFTLG9CQUFvQixDQUFDLElBQWdCO0lBQzdDLElBQU0sTUFBTSxHQUFHLFlBQVksQ0FBQyxHQUFHLEVBQUUsR0FBRyxDQUFDLENBQUM7SUFFdEMsSUFBSTtRQUNILElBQU0sU0FBTyxHQUFHLE1BQU0sQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFFLENBQUM7UUFDekMsSUFBTSxTQUFTLEdBQUcsVUFBVSxDQUFDLElBQUksRUFBRSxVQUFDLENBQUMsRUFBRSxDQUFDLElBQUssT0FBQSxTQUFPLENBQUMsZUFBZSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBN0IsQ0FBNkIsQ0FBQyxDQUFDO1FBQzVFLE1BQU0sQ0FBQyxLQUFLLEdBQUcsU0FBUyxDQUFDLEtBQUssQ0FBQztRQUMvQixNQUFNLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxNQUFNLENBQUM7UUFDakMsU0FBTyxDQUFDLFlBQVksQ0FBQyxTQUFTLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0tBQ3RDO0lBQUMsT0FBTyxDQUFNLEVBQUU7UUFDaEIsT0FBTyxDQUFDLEtBQUssQ0FBQywwQkFBMEIsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUM7S0FDckQ7SUFFRCxPQUFPLE1BQU0sQ0FBQztBQUNmLENBQUM7QUFFRCxnQkFBZ0IsQ0FBQyxZQUFZLEVBQUUsb0JBQW9CLENBQUMsQ0FBQztBQUVyRCxNQUFNLFVBQVUsVUFBVTtJQUN6QixnQkFBZ0IsQ0FBQyxZQUFZLEVBQUUsb0JBQW9CLENBQUMsQ0FBQztBQUN0RCxDQUFDIiwiZmlsZSI6ImluaXRpYWxpemVDYW52YXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjcmVhdGVDYW52YXMgfSBmcm9tICdjYW52YXMnO1xyXG5pbXBvcnQgeyBpbml0aWFsaXplQ2FudmFzIH0gZnJvbSAnLi9pbmRleCc7XHJcbmltcG9ydCB7IGRlY29kZUpwZWcgfSBmcm9tICcuL2pwZWcnO1xyXG5cclxuZnVuY3Rpb24gY3JlYXRlQ2FudmFzRnJvbURhdGEoZGF0YTogVWludDhBcnJheSkge1xyXG5cdGNvbnN0IGNhbnZhcyA9IGNyZWF0ZUNhbnZhcygxMDAsIDEwMCk7XHJcblxyXG5cdHRyeSB7XHJcblx0XHRjb25zdCBjb250ZXh0ID0gY2FudmFzLmdldENvbnRleHQoJzJkJykhO1xyXG5cdFx0Y29uc3QgaW1hZ2VEYXRhID0gZGVjb2RlSnBlZyhkYXRhLCAodywgaCkgPT4gY29udGV4dC5jcmVhdGVJbWFnZURhdGEodywgaCkpO1xyXG5cdFx0Y2FudmFzLndpZHRoID0gaW1hZ2VEYXRhLndpZHRoO1xyXG5cdFx0Y2FudmFzLmhlaWdodCA9IGltYWdlRGF0YS5oZWlnaHQ7XHJcblx0XHRjb250ZXh0LnB1dEltYWdlRGF0YShpbWFnZURhdGEsIDAsIDApO1xyXG5cdH0gY2F0Y2ggKGU6IGFueSkge1xyXG5cdFx0Y29uc29sZS5lcnJvcignSlBFRyBkZWNvbXByZXNzaW9uIGVycm9yJywgZS5tZXNzYWdlKTtcclxuXHR9XHJcblxyXG5cdHJldHVybiBjYW52YXM7XHJcbn1cclxuXHJcbmluaXRpYWxpemVDYW52YXMoY3JlYXRlQ2FudmFzLCBjcmVhdGVDYW52YXNGcm9tRGF0YSk7XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gaW5pdGlhbGl6ZSgpIHtcclxuXHRpbml0aWFsaXplQ2FudmFzKGNyZWF0ZUNhbnZhcywgY3JlYXRlQ2FudmFzRnJvbURhdGEpO1xyXG59XHJcbiJdLCJzb3VyY2VSb290IjoiQzpcXFByb2plY3RzXFxnaXRodWJcXGFnLXBzZFxcc3JjIn0=
|
||||
|
@ -1 +1 @@
|
||||
export declare function decodeJpeg(encoded: Uint8Array, createImageData: (width: number, height: number) => ImageData): ImageData;
|
||||
export declare function decodeJpeg(encoded: Uint8Array, createImageData: (width: number, height: number) => ImageData): ImageData;
|
||||
|
File diff suppressed because one or more lines are too long
2434
npm-packages/mac-v2.4.x/ag-psd/dist-es/psd.d.ts
vendored
2434
npm-packages/mac-v2.4.x/ag-psd/dist-es/psd.d.ts
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,36 +1,36 @@
|
||||
import { Psd, ColorMode, ReadOptions, Color, PatternInfo } from './psd';
|
||||
import { PixelData } from './helpers';
|
||||
export declare const supportedColorModes: ColorMode[];
|
||||
export interface PsdReader {
|
||||
offset: number;
|
||||
view: DataView;
|
||||
strict: boolean;
|
||||
debug: boolean;
|
||||
}
|
||||
export declare function createReader(buffer: ArrayBuffer, offset?: number, length?: number): PsdReader;
|
||||
export declare function warnOrThrow(reader: PsdReader, message: string): void;
|
||||
export declare function readUint8(reader: PsdReader): number;
|
||||
export declare function peekUint8(reader: PsdReader): number;
|
||||
export declare function readInt16(reader: PsdReader): number;
|
||||
export declare function readUint16(reader: PsdReader): number;
|
||||
export declare function readInt32(reader: PsdReader): number;
|
||||
export declare function readInt32LE(reader: PsdReader): number;
|
||||
export declare function readUint32(reader: PsdReader): number;
|
||||
export declare function readFloat32(reader: PsdReader): number;
|
||||
export declare function readFloat64(reader: PsdReader): number;
|
||||
export declare function readFixedPoint32(reader: PsdReader): number;
|
||||
export declare function readFixedPointPath32(reader: PsdReader): number;
|
||||
export declare function readBytes(reader: PsdReader, length: number): Uint8Array;
|
||||
export declare function readSignature(reader: PsdReader): string;
|
||||
export declare function readPascalString(reader: PsdReader, padTo: number): string;
|
||||
export declare function readUnicodeString(reader: PsdReader): string;
|
||||
export declare function readUnicodeStringWithLength(reader: PsdReader, length: number): string;
|
||||
export declare function readAsciiString(reader: PsdReader, length: number): string;
|
||||
export declare function skipBytes(reader: PsdReader, count: number): void;
|
||||
export declare function checkSignature(reader: PsdReader, a: string, b?: string): void;
|
||||
export declare function readPsd(reader: PsdReader, options?: ReadOptions): Psd;
|
||||
export declare function readDataZipWithoutPrediction(reader: PsdReader, length: number, pixelData: PixelData | undefined, width: number, height: number, step: number, offset: number): void;
|
||||
export declare function readDataRLE(reader: PsdReader, pixelData: PixelData | undefined, _width: number, height: number, step: number, offsets: number[], large: boolean): void;
|
||||
export declare function readSection<T>(reader: PsdReader, round: number, func: (left: () => number) => T, skipEmpty?: boolean, eightBytes?: boolean): T | undefined;
|
||||
export declare function readColor(reader: PsdReader): Color;
|
||||
export declare function readPattern(reader: PsdReader): PatternInfo;
|
||||
import { Psd, ColorMode, ReadOptions, Color, PatternInfo } from './psd';
|
||||
import { PixelData } from './helpers';
|
||||
export declare const supportedColorModes: ColorMode[];
|
||||
export interface PsdReader {
|
||||
offset: number;
|
||||
view: DataView;
|
||||
strict: boolean;
|
||||
debug: boolean;
|
||||
}
|
||||
export declare function createReader(buffer: ArrayBuffer, offset?: number, length?: number): PsdReader;
|
||||
export declare function warnOrThrow(reader: PsdReader, message: string): void;
|
||||
export declare function readUint8(reader: PsdReader): number;
|
||||
export declare function peekUint8(reader: PsdReader): number;
|
||||
export declare function readInt16(reader: PsdReader): number;
|
||||
export declare function readUint16(reader: PsdReader): number;
|
||||
export declare function readInt32(reader: PsdReader): number;
|
||||
export declare function readInt32LE(reader: PsdReader): number;
|
||||
export declare function readUint32(reader: PsdReader): number;
|
||||
export declare function readFloat32(reader: PsdReader): number;
|
||||
export declare function readFloat64(reader: PsdReader): number;
|
||||
export declare function readFixedPoint32(reader: PsdReader): number;
|
||||
export declare function readFixedPointPath32(reader: PsdReader): number;
|
||||
export declare function readBytes(reader: PsdReader, length: number): Uint8Array;
|
||||
export declare function readSignature(reader: PsdReader): string;
|
||||
export declare function readPascalString(reader: PsdReader, padTo: number): string;
|
||||
export declare function readUnicodeString(reader: PsdReader): string;
|
||||
export declare function readUnicodeStringWithLength(reader: PsdReader, length: number): string;
|
||||
export declare function readAsciiString(reader: PsdReader, length: number): string;
|
||||
export declare function skipBytes(reader: PsdReader, count: number): void;
|
||||
export declare function checkSignature(reader: PsdReader, a: string, b?: string): void;
|
||||
export declare function readPsd(reader: PsdReader, options?: ReadOptions): Psd;
|
||||
export declare function readDataZipWithoutPrediction(reader: PsdReader, length: number, pixelData: PixelData | undefined, width: number, height: number, step: number, offset: number): void;
|
||||
export declare function readDataRLE(reader: PsdReader, pixelData: PixelData | undefined, _width: number, height: number, step: number, offsets: number[], large: boolean): void;
|
||||
export declare function readSection<T>(reader: PsdReader, round: number, func: (left: () => number) => T, skipEmpty?: boolean, eightBytes?: boolean): T | undefined;
|
||||
export declare function readColor(reader: PsdReader): Color;
|
||||
export declare function readPattern(reader: PsdReader): PatternInfo;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,27 +1,27 @@
|
||||
import { Psd, WriteOptions, Color } from './psd';
|
||||
export interface PsdWriter {
|
||||
offset: number;
|
||||
buffer: ArrayBuffer;
|
||||
view: DataView;
|
||||
}
|
||||
export declare function createWriter(size?: number): PsdWriter;
|
||||
export declare function getWriterBuffer(writer: PsdWriter): ArrayBuffer;
|
||||
export declare function getWriterBufferNoCopy(writer: PsdWriter): Uint8Array;
|
||||
export declare function writeUint8(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat64(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPoint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPointPath32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeBytes(writer: PsdWriter, buffer: Uint8Array | undefined): void;
|
||||
export declare function writeZeros(writer: PsdWriter, count: number): void;
|
||||
export declare function writeSignature(writer: PsdWriter, signature: string): void;
|
||||
export declare function writePascalString(writer: PsdWriter, text: string, padTo: number): void;
|
||||
export declare function writeUnicodeString(writer: PsdWriter, text: string): void;
|
||||
export declare function writeUnicodeStringWithPadding(writer: PsdWriter, text: string): void;
|
||||
export declare function writeSection(writer: PsdWriter, round: number, func: () => void, writeTotalLength?: boolean, large?: boolean): void;
|
||||
export declare function writePsd(writer: PsdWriter, psd: Psd, options?: WriteOptions): void;
|
||||
export declare function writeColor(writer: PsdWriter, color: Color | undefined): void;
|
||||
import { Psd, WriteOptions, Color } from './psd';
|
||||
export interface PsdWriter {
|
||||
offset: number;
|
||||
buffer: ArrayBuffer;
|
||||
view: DataView;
|
||||
}
|
||||
export declare function createWriter(size?: number): PsdWriter;
|
||||
export declare function getWriterBuffer(writer: PsdWriter): ArrayBuffer;
|
||||
export declare function getWriterBufferNoCopy(writer: PsdWriter): Uint8Array;
|
||||
export declare function writeUint8(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat64(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPoint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPointPath32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeBytes(writer: PsdWriter, buffer: Uint8Array | undefined): void;
|
||||
export declare function writeZeros(writer: PsdWriter, count: number): void;
|
||||
export declare function writeSignature(writer: PsdWriter, signature: string): void;
|
||||
export declare function writePascalString(writer: PsdWriter, text: string, padTo: number): void;
|
||||
export declare function writeUnicodeString(writer: PsdWriter, text: string): void;
|
||||
export declare function writeUnicodeStringWithPadding(writer: PsdWriter, text: string): void;
|
||||
export declare function writeSection(writer: PsdWriter, round: number, func: () => void, writeTotalLength?: boolean, large?: boolean): void;
|
||||
export declare function writePsd(writer: PsdWriter, psd: Psd, options?: WriteOptions): void;
|
||||
export declare function writeColor(writer: PsdWriter, color: Color | undefined): void;
|
||||
|
File diff suppressed because one or more lines are too long
336
npm-packages/mac-v2.4.x/ag-psd/dist-es/text.d.ts
vendored
336
npm-packages/mac-v2.4.x/ag-psd/dist-es/text.d.ts
vendored
@ -1,168 +1,168 @@
|
||||
import { LayerTextData } from './psd';
|
||||
interface Adjustments {
|
||||
Axis: number[];
|
||||
XY: number[];
|
||||
}
|
||||
interface TypeValues {
|
||||
Type: number;
|
||||
Values: number[];
|
||||
}
|
||||
interface ParagraphProperties {
|
||||
Justification?: number;
|
||||
FirstLineIndent?: number;
|
||||
StartIndent?: number;
|
||||
EndIndent?: number;
|
||||
SpaceBefore?: number;
|
||||
SpaceAfter?: number;
|
||||
AutoHyphenate?: boolean;
|
||||
HyphenatedWordSize?: number;
|
||||
PreHyphen?: number;
|
||||
PostHyphen?: number;
|
||||
ConsecutiveHyphens?: number;
|
||||
Zone?: number;
|
||||
WordSpacing?: number[];
|
||||
LetterSpacing?: number[];
|
||||
GlyphSpacing?: number[];
|
||||
AutoLeading?: number;
|
||||
LeadingType?: number;
|
||||
Hanging?: boolean;
|
||||
Burasagari?: boolean;
|
||||
KinsokuOrder?: number;
|
||||
EveryLineComposer?: boolean;
|
||||
}
|
||||
interface ParagraphSheet {
|
||||
Name?: string;
|
||||
DefaultStyleSheet: number;
|
||||
Properties: ParagraphProperties;
|
||||
}
|
||||
interface StyleSheetData {
|
||||
Font?: number;
|
||||
FontSize?: number;
|
||||
FauxBold?: boolean;
|
||||
FauxItalic?: boolean;
|
||||
AutoLeading?: boolean;
|
||||
Leading?: number;
|
||||
HorizontalScale?: number;
|
||||
VerticalScale?: number;
|
||||
Tracking?: number;
|
||||
AutoKerning?: boolean;
|
||||
Kerning?: number;
|
||||
BaselineShift?: number;
|
||||
FontCaps?: number;
|
||||
FontBaseline?: number;
|
||||
Underline?: boolean;
|
||||
Strikethrough?: boolean;
|
||||
Ligatures?: boolean;
|
||||
DLigatures?: boolean;
|
||||
BaselineDirection?: number;
|
||||
Tsume?: number;
|
||||
StyleRunAlignment?: number;
|
||||
Language?: number;
|
||||
NoBreak?: boolean;
|
||||
FillColor?: TypeValues;
|
||||
StrokeColor?: TypeValues;
|
||||
FillFlag?: boolean;
|
||||
StrokeFlag?: boolean;
|
||||
FillFirst?: boolean;
|
||||
YUnderline?: number;
|
||||
OutlineWidth?: number;
|
||||
CharacterDirection?: number;
|
||||
HindiNumbers?: boolean;
|
||||
Kashida?: number;
|
||||
DiacriticPos?: number;
|
||||
}
|
||||
interface FontSet {
|
||||
Name: string;
|
||||
Script: number;
|
||||
FontType: number;
|
||||
Synthetic: number;
|
||||
}
|
||||
interface ResourceDict {
|
||||
KinsokuSet: any[];
|
||||
MojiKumiSet: any[];
|
||||
TheNormalStyleSheet: number;
|
||||
TheNormalParagraphSheet: number;
|
||||
ParagraphSheetSet: ParagraphSheet[];
|
||||
StyleSheetSet: {
|
||||
Name: string;
|
||||
StyleSheetData: StyleSheetData;
|
||||
}[];
|
||||
FontSet: FontSet[];
|
||||
SuperscriptSize: number;
|
||||
SuperscriptPosition: number;
|
||||
SubscriptSize: number;
|
||||
SubscriptPosition: number;
|
||||
SmallCapSize: number;
|
||||
}
|
||||
interface ParagraphRun {
|
||||
ParagraphSheet: ParagraphSheet;
|
||||
Adjustments: Adjustments;
|
||||
}
|
||||
interface StyleRun {
|
||||
StyleSheet: {
|
||||
StyleSheetData: StyleSheetData;
|
||||
};
|
||||
}
|
||||
interface PhotoshopNode {
|
||||
ShapeType?: number;
|
||||
PointBase?: number[];
|
||||
BoxBounds?: number[];
|
||||
Base?: {
|
||||
ShapeType: number;
|
||||
TransformPoint0: number[];
|
||||
TransformPoint1: number[];
|
||||
TransformPoint2: number[];
|
||||
};
|
||||
}
|
||||
interface EngineData {
|
||||
EngineDict: {
|
||||
Editor: {
|
||||
Text: string;
|
||||
};
|
||||
ParagraphRun: {
|
||||
DefaultRunData: ParagraphRun;
|
||||
RunArray: ParagraphRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
StyleRun: {
|
||||
DefaultRunData: StyleRun;
|
||||
RunArray: StyleRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
GridInfo: {
|
||||
GridIsOn: boolean;
|
||||
ShowGrid: boolean;
|
||||
GridSize: number;
|
||||
GridLeading: number;
|
||||
GridColor: TypeValues;
|
||||
GridLeadingFillColor: TypeValues;
|
||||
AlignLineHeightToGridFlags: boolean;
|
||||
};
|
||||
AntiAlias: number;
|
||||
UseFractionalGlyphWidths: boolean;
|
||||
Rendered?: {
|
||||
Version: number;
|
||||
Shapes?: {
|
||||
WritingDirection: number;
|
||||
Children?: {
|
||||
ShapeType?: number;
|
||||
Procession: number;
|
||||
Lines: {
|
||||
WritingDirection: number;
|
||||
Children: any[];
|
||||
};
|
||||
Cookie?: {
|
||||
Photoshop?: PhotoshopNode;
|
||||
};
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
ResourceDict: ResourceDict;
|
||||
DocumentResources: ResourceDict;
|
||||
}
|
||||
export declare function decodeEngineData(engineData: EngineData): LayerTextData;
|
||||
export declare function encodeEngineData(data: LayerTextData): EngineData;
|
||||
export {};
|
||||
import { LayerTextData } from './psd';
|
||||
interface Adjustments {
|
||||
Axis: number[];
|
||||
XY: number[];
|
||||
}
|
||||
interface TypeValues {
|
||||
Type: number;
|
||||
Values: number[];
|
||||
}
|
||||
interface ParagraphProperties {
|
||||
Justification?: number;
|
||||
FirstLineIndent?: number;
|
||||
StartIndent?: number;
|
||||
EndIndent?: number;
|
||||
SpaceBefore?: number;
|
||||
SpaceAfter?: number;
|
||||
AutoHyphenate?: boolean;
|
||||
HyphenatedWordSize?: number;
|
||||
PreHyphen?: number;
|
||||
PostHyphen?: number;
|
||||
ConsecutiveHyphens?: number;
|
||||
Zone?: number;
|
||||
WordSpacing?: number[];
|
||||
LetterSpacing?: number[];
|
||||
GlyphSpacing?: number[];
|
||||
AutoLeading?: number;
|
||||
LeadingType?: number;
|
||||
Hanging?: boolean;
|
||||
Burasagari?: boolean;
|
||||
KinsokuOrder?: number;
|
||||
EveryLineComposer?: boolean;
|
||||
}
|
||||
interface ParagraphSheet {
|
||||
Name?: string;
|
||||
DefaultStyleSheet: number;
|
||||
Properties: ParagraphProperties;
|
||||
}
|
||||
interface StyleSheetData {
|
||||
Font?: number;
|
||||
FontSize?: number;
|
||||
FauxBold?: boolean;
|
||||
FauxItalic?: boolean;
|
||||
AutoLeading?: boolean;
|
||||
Leading?: number;
|
||||
HorizontalScale?: number;
|
||||
VerticalScale?: number;
|
||||
Tracking?: number;
|
||||
AutoKerning?: boolean;
|
||||
Kerning?: number;
|
||||
BaselineShift?: number;
|
||||
FontCaps?: number;
|
||||
FontBaseline?: number;
|
||||
Underline?: boolean;
|
||||
Strikethrough?: boolean;
|
||||
Ligatures?: boolean;
|
||||
DLigatures?: boolean;
|
||||
BaselineDirection?: number;
|
||||
Tsume?: number;
|
||||
StyleRunAlignment?: number;
|
||||
Language?: number;
|
||||
NoBreak?: boolean;
|
||||
FillColor?: TypeValues;
|
||||
StrokeColor?: TypeValues;
|
||||
FillFlag?: boolean;
|
||||
StrokeFlag?: boolean;
|
||||
FillFirst?: boolean;
|
||||
YUnderline?: number;
|
||||
OutlineWidth?: number;
|
||||
CharacterDirection?: number;
|
||||
HindiNumbers?: boolean;
|
||||
Kashida?: number;
|
||||
DiacriticPos?: number;
|
||||
}
|
||||
interface FontSet {
|
||||
Name: string;
|
||||
Script: number;
|
||||
FontType: number;
|
||||
Synthetic: number;
|
||||
}
|
||||
interface ResourceDict {
|
||||
KinsokuSet: any[];
|
||||
MojiKumiSet: any[];
|
||||
TheNormalStyleSheet: number;
|
||||
TheNormalParagraphSheet: number;
|
||||
ParagraphSheetSet: ParagraphSheet[];
|
||||
StyleSheetSet: {
|
||||
Name: string;
|
||||
StyleSheetData: StyleSheetData;
|
||||
}[];
|
||||
FontSet: FontSet[];
|
||||
SuperscriptSize: number;
|
||||
SuperscriptPosition: number;
|
||||
SubscriptSize: number;
|
||||
SubscriptPosition: number;
|
||||
SmallCapSize: number;
|
||||
}
|
||||
interface ParagraphRun {
|
||||
ParagraphSheet: ParagraphSheet;
|
||||
Adjustments: Adjustments;
|
||||
}
|
||||
interface StyleRun {
|
||||
StyleSheet: {
|
||||
StyleSheetData: StyleSheetData;
|
||||
};
|
||||
}
|
||||
interface PhotoshopNode {
|
||||
ShapeType?: number;
|
||||
PointBase?: number[];
|
||||
BoxBounds?: number[];
|
||||
Base?: {
|
||||
ShapeType: number;
|
||||
TransformPoint0: number[];
|
||||
TransformPoint1: number[];
|
||||
TransformPoint2: number[];
|
||||
};
|
||||
}
|
||||
interface EngineData {
|
||||
EngineDict: {
|
||||
Editor: {
|
||||
Text: string;
|
||||
};
|
||||
ParagraphRun: {
|
||||
DefaultRunData: ParagraphRun;
|
||||
RunArray: ParagraphRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
StyleRun: {
|
||||
DefaultRunData: StyleRun;
|
||||
RunArray: StyleRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
GridInfo: {
|
||||
GridIsOn: boolean;
|
||||
ShowGrid: boolean;
|
||||
GridSize: number;
|
||||
GridLeading: number;
|
||||
GridColor: TypeValues;
|
||||
GridLeadingFillColor: TypeValues;
|
||||
AlignLineHeightToGridFlags: boolean;
|
||||
};
|
||||
AntiAlias: number;
|
||||
UseFractionalGlyphWidths: boolean;
|
||||
Rendered?: {
|
||||
Version: number;
|
||||
Shapes?: {
|
||||
WritingDirection: number;
|
||||
Children?: {
|
||||
ShapeType?: number;
|
||||
Procession: number;
|
||||
Lines: {
|
||||
WritingDirection: number;
|
||||
Children: any[];
|
||||
};
|
||||
Cookie?: {
|
||||
Photoshop?: PhotoshopNode;
|
||||
};
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
ResourceDict: ResourceDict;
|
||||
DocumentResources: ResourceDict;
|
||||
}
|
||||
export declare function decodeEngineData(engineData: EngineData): LayerTextData;
|
||||
export declare function encodeEngineData(data: LayerTextData): EngineData;
|
||||
export {};
|
||||
|
File diff suppressed because one or more lines are too long
10
npm-packages/mac-v2.4.x/ag-psd/dist-es/utf8.d.ts
vendored
10
npm-packages/mac-v2.4.x/ag-psd/dist-es/utf8.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
/// <reference types="node" />
|
||||
export declare function stringLengthInBytes(value: string): number;
|
||||
export declare function encodeStringTo(buffer: Uint8Array | Buffer, offset: number, value: string): number;
|
||||
export declare function encodeString(value: string): Uint8Array;
|
||||
export declare function decodeString(value: Uint8Array): string;
|
||||
/// <reference types="node" />
|
||||
export declare function stringLengthInBytes(value: string): number;
|
||||
export declare function encodeStringTo(buffer: Uint8Array | Buffer, offset: number, value: string): number;
|
||||
export declare function encodeString(value: string): Uint8Array;
|
||||
export declare function decodeString(value: Uint8Array): string;
|
||||
|
File diff suppressed because one or more lines are too long
264
npm-packages/mac-v2.4.x/ag-psd/dist/abr.d.ts
vendored
264
npm-packages/mac-v2.4.x/ag-psd/dist/abr.d.ts
vendored
@ -1,132 +1,132 @@
|
||||
import { BlendMode, PatternInfo } from './psd';
|
||||
export interface Abr {
|
||||
brushes: Brush[];
|
||||
samples: SampleInfo[];
|
||||
patterns: PatternInfo[];
|
||||
}
|
||||
export interface SampleInfo {
|
||||
id: string;
|
||||
bounds: {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
};
|
||||
alpha: Uint8Array;
|
||||
}
|
||||
export interface BrushDynamics {
|
||||
control: 'off' | 'fade' | 'pen pressure' | 'pen tilt' | 'stylus wheel' | 'initial direction' | 'direction' | 'initial rotation' | 'rotation';
|
||||
steps: number;
|
||||
jitter: number;
|
||||
minimum: number;
|
||||
}
|
||||
export interface BrushShape {
|
||||
name?: string;
|
||||
size: number;
|
||||
angle: number;
|
||||
roundness: number;
|
||||
hardness?: number;
|
||||
spacingOn: boolean;
|
||||
spacing: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
sampledData?: string;
|
||||
}
|
||||
export interface Brush {
|
||||
name: string;
|
||||
shape: BrushShape;
|
||||
shapeDynamics?: {
|
||||
sizeDynamics: BrushDynamics;
|
||||
minimumDiameter: number;
|
||||
tiltScale: number;
|
||||
angleDynamics: BrushDynamics;
|
||||
roundnessDynamics: BrushDynamics;
|
||||
minimumRoundness: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
brushProjection: boolean;
|
||||
};
|
||||
scatter?: {
|
||||
bothAxes: boolean;
|
||||
scatterDynamics: BrushDynamics;
|
||||
countDynamics: BrushDynamics;
|
||||
count: number;
|
||||
};
|
||||
texture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
invert: boolean;
|
||||
scale: number;
|
||||
brightness: number;
|
||||
contrast: number;
|
||||
blendMode: BlendMode;
|
||||
depth: number;
|
||||
depthMinimum: number;
|
||||
depthDynamics: BrushDynamics;
|
||||
};
|
||||
dualBrush?: {
|
||||
flip: boolean;
|
||||
shape: BrushShape;
|
||||
blendMode: BlendMode;
|
||||
useScatter: boolean;
|
||||
spacing: number;
|
||||
count: number;
|
||||
bothAxes: boolean;
|
||||
countDynamics: BrushDynamics;
|
||||
scatterDynamics: BrushDynamics;
|
||||
};
|
||||
colorDynamics?: {
|
||||
foregroundBackground: BrushDynamics;
|
||||
hue: number;
|
||||
saturation: number;
|
||||
brightness: number;
|
||||
purity: number;
|
||||
perTip: boolean;
|
||||
};
|
||||
transfer?: {
|
||||
flowDynamics: BrushDynamics;
|
||||
opacityDynamics: BrushDynamics;
|
||||
wetnessDynamics: BrushDynamics;
|
||||
mixDynamics: BrushDynamics;
|
||||
};
|
||||
brushPose?: {
|
||||
overrideAngle: boolean;
|
||||
overrideTiltX: boolean;
|
||||
overrideTiltY: boolean;
|
||||
overridePressure: boolean;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
angle: number;
|
||||
};
|
||||
noise: boolean;
|
||||
wetEdges: boolean;
|
||||
protectTexture?: boolean;
|
||||
spacing: number;
|
||||
brushGroup?: undefined;
|
||||
interpretation?: boolean;
|
||||
useBrushSize: boolean;
|
||||
toolOptions?: {
|
||||
brushPreset: boolean;
|
||||
flow: number;
|
||||
smooth: number;
|
||||
mode: BlendMode;
|
||||
opacity: number;
|
||||
smoothing: boolean;
|
||||
smoothingValue: number;
|
||||
smoothingRadiusMode: boolean;
|
||||
smoothingCatchup: boolean;
|
||||
smoothingCatchupAtEnd: boolean;
|
||||
smoothingZoomCompensation: boolean;
|
||||
pressureSmoothing: boolean;
|
||||
usePressureOverridesSize: boolean;
|
||||
usePressureOverridesOpacity: boolean;
|
||||
useLegacy: boolean;
|
||||
flowDynamics?: BrushDynamics;
|
||||
opacityDynamics?: BrushDynamics;
|
||||
sizeDynamics?: BrushDynamics;
|
||||
};
|
||||
}
|
||||
export declare function readAbr(buffer: ArrayBufferView, options?: {
|
||||
logMissingFeatures?: boolean;
|
||||
}): Abr;
|
||||
import { BlendMode, PatternInfo } from './psd';
|
||||
export interface Abr {
|
||||
brushes: Brush[];
|
||||
samples: SampleInfo[];
|
||||
patterns: PatternInfo[];
|
||||
}
|
||||
export interface SampleInfo {
|
||||
id: string;
|
||||
bounds: {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
};
|
||||
alpha: Uint8Array;
|
||||
}
|
||||
export interface BrushDynamics {
|
||||
control: 'off' | 'fade' | 'pen pressure' | 'pen tilt' | 'stylus wheel' | 'initial direction' | 'direction' | 'initial rotation' | 'rotation';
|
||||
steps: number;
|
||||
jitter: number;
|
||||
minimum: number;
|
||||
}
|
||||
export interface BrushShape {
|
||||
name?: string;
|
||||
size: number;
|
||||
angle: number;
|
||||
roundness: number;
|
||||
hardness?: number;
|
||||
spacingOn: boolean;
|
||||
spacing: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
sampledData?: string;
|
||||
}
|
||||
export interface Brush {
|
||||
name: string;
|
||||
shape: BrushShape;
|
||||
shapeDynamics?: {
|
||||
sizeDynamics: BrushDynamics;
|
||||
minimumDiameter: number;
|
||||
tiltScale: number;
|
||||
angleDynamics: BrushDynamics;
|
||||
roundnessDynamics: BrushDynamics;
|
||||
minimumRoundness: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
brushProjection: boolean;
|
||||
};
|
||||
scatter?: {
|
||||
bothAxes: boolean;
|
||||
scatterDynamics: BrushDynamics;
|
||||
countDynamics: BrushDynamics;
|
||||
count: number;
|
||||
};
|
||||
texture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
invert: boolean;
|
||||
scale: number;
|
||||
brightness: number;
|
||||
contrast: number;
|
||||
blendMode: BlendMode;
|
||||
depth: number;
|
||||
depthMinimum: number;
|
||||
depthDynamics: BrushDynamics;
|
||||
};
|
||||
dualBrush?: {
|
||||
flip: boolean;
|
||||
shape: BrushShape;
|
||||
blendMode: BlendMode;
|
||||
useScatter: boolean;
|
||||
spacing: number;
|
||||
count: number;
|
||||
bothAxes: boolean;
|
||||
countDynamics: BrushDynamics;
|
||||
scatterDynamics: BrushDynamics;
|
||||
};
|
||||
colorDynamics?: {
|
||||
foregroundBackground: BrushDynamics;
|
||||
hue: number;
|
||||
saturation: number;
|
||||
brightness: number;
|
||||
purity: number;
|
||||
perTip: boolean;
|
||||
};
|
||||
transfer?: {
|
||||
flowDynamics: BrushDynamics;
|
||||
opacityDynamics: BrushDynamics;
|
||||
wetnessDynamics: BrushDynamics;
|
||||
mixDynamics: BrushDynamics;
|
||||
};
|
||||
brushPose?: {
|
||||
overrideAngle: boolean;
|
||||
overrideTiltX: boolean;
|
||||
overrideTiltY: boolean;
|
||||
overridePressure: boolean;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
angle: number;
|
||||
};
|
||||
noise: boolean;
|
||||
wetEdges: boolean;
|
||||
protectTexture?: boolean;
|
||||
spacing: number;
|
||||
brushGroup?: undefined;
|
||||
interpretation?: boolean;
|
||||
useBrushSize: boolean;
|
||||
toolOptions?: {
|
||||
brushPreset: boolean;
|
||||
flow: number;
|
||||
smooth: number;
|
||||
mode: BlendMode;
|
||||
opacity: number;
|
||||
smoothing: boolean;
|
||||
smoothingValue: number;
|
||||
smoothingRadiusMode: boolean;
|
||||
smoothingCatchup: boolean;
|
||||
smoothingCatchupAtEnd: boolean;
|
||||
smoothingZoomCompensation: boolean;
|
||||
pressureSmoothing: boolean;
|
||||
usePressureOverridesSize: boolean;
|
||||
usePressureOverridesOpacity: boolean;
|
||||
useLegacy: boolean;
|
||||
flowDynamics?: BrushDynamics;
|
||||
opacityDynamics?: BrushDynamics;
|
||||
sizeDynamics?: BrushDynamics;
|
||||
};
|
||||
}
|
||||
export declare function readAbr(buffer: ArrayBufferView, options?: {
|
||||
logMissingFeatures?: boolean;
|
||||
}): Abr;
|
||||
|
541
npm-packages/mac-v2.4.x/ag-psd/dist/abr.js
vendored
541
npm-packages/mac-v2.4.x/ag-psd/dist/abr.js
vendored
File diff suppressed because one or more lines are too long
@ -1,25 +1,25 @@
|
||||
import { LayerAdditionalInfo, BezierPath, Psd, ReadOptions, WriteOptions, BooleanOperation, LayerEffectsInfo, LayerVectorMask } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ExtendedWriteOptions extends WriteOptions {
|
||||
layerIds: Set<number>;
|
||||
layerToId: Map<any, number>;
|
||||
}
|
||||
type HasMethod = (target: LayerAdditionalInfo) => boolean;
|
||||
type ReadMethod = (reader: PsdReader, target: LayerAdditionalInfo, left: () => number, psd: Psd, options: ReadOptions) => void;
|
||||
type WriteMethod = (writer: PsdWriter, target: LayerAdditionalInfo, psd: Psd, options: ExtendedWriteOptions) => void;
|
||||
export interface InfoHandler {
|
||||
key: string;
|
||||
has: HasMethod;
|
||||
read: ReadMethod;
|
||||
write: WriteMethod;
|
||||
}
|
||||
export declare const infoHandlers: InfoHandler[];
|
||||
export declare const infoHandlersMap: {
|
||||
[key: string]: InfoHandler;
|
||||
};
|
||||
export declare function readBezierKnot(reader: PsdReader, width: number, height: number): number[];
|
||||
export declare const booleanOperations: BooleanOperation[];
|
||||
export declare function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, width: number, height: number, size: number): BezierPath[];
|
||||
export declare function hasMultiEffects(effects: LayerEffectsInfo): boolean;
|
||||
export {};
|
||||
import { LayerAdditionalInfo, BezierPath, Psd, ReadOptions, WriteOptions, BooleanOperation, LayerEffectsInfo, LayerVectorMask } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ExtendedWriteOptions extends WriteOptions {
|
||||
layerIds: Set<number>;
|
||||
layerToId: Map<any, number>;
|
||||
}
|
||||
declare type HasMethod = (target: LayerAdditionalInfo) => boolean;
|
||||
declare type ReadMethod = (reader: PsdReader, target: LayerAdditionalInfo, left: () => number, psd: Psd, options: ReadOptions) => void;
|
||||
declare type WriteMethod = (writer: PsdWriter, target: LayerAdditionalInfo, psd: Psd, options: ExtendedWriteOptions) => void;
|
||||
export interface InfoHandler {
|
||||
key: string;
|
||||
has: HasMethod;
|
||||
read: ReadMethod;
|
||||
write: WriteMethod;
|
||||
}
|
||||
export declare const infoHandlers: InfoHandler[];
|
||||
export declare const infoHandlersMap: {
|
||||
[key: string]: InfoHandler;
|
||||
};
|
||||
export declare function readBezierKnot(reader: PsdReader, width: number, height: number): number[];
|
||||
export declare const booleanOperations: BooleanOperation[];
|
||||
export declare function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, width: number, height: number, size: number): BezierPath[];
|
||||
export declare function hasMultiEffects(effects: LayerEffectsInfo): boolean;
|
||||
export {};
|
||||
|
4321
npm-packages/mac-v2.4.x/ag-psd/dist/additionalInfo.js
vendored
4321
npm-packages/mac-v2.4.x/ag-psd/dist/additionalInfo.js
vendored
File diff suppressed because one or more lines are too long
18269
npm-packages/mac-v2.4.x/ag-psd/dist/bundle.js
vendored
18269
npm-packages/mac-v2.4.x/ag-psd/dist/bundle.js
vendored
File diff suppressed because it is too large
Load Diff
20
npm-packages/mac-v2.4.x/ag-psd/dist/csh.d.ts
vendored
20
npm-packages/mac-v2.4.x/ag-psd/dist/csh.d.ts
vendored
@ -1,10 +1,10 @@
|
||||
import { LayerVectorMask } from './psd';
|
||||
export interface Csh {
|
||||
shapes: (LayerVectorMask & {
|
||||
name: string;
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
})[];
|
||||
}
|
||||
export declare function readCsh(buffer: ArrayBufferView): Csh;
|
||||
import { LayerVectorMask } from './psd';
|
||||
export interface Csh {
|
||||
shapes: (LayerVectorMask & {
|
||||
name: string;
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
})[];
|
||||
}
|
||||
export declare function readCsh(buffer: ArrayBufferView): Csh;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user