pixifact-cli 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/editor/assets/browserAll-D2RthxQz.js +1 -0
- package/editor/assets/capture-BGSCjpR1.js +1 -0
- package/editor/assets/{captureCompilerScenePreview-CksQqv9T.js → captureCompilerScenePreview-BYHGr0JS.js} +84 -84
- package/editor/assets/editor-BQk2SioZ.css +1 -0
- package/editor/assets/editor-D1nNN1_e.js +5 -0
- package/editor/assets/init-BOfNyIRQ.js +1 -0
- package/editor/assets/webworkerAll-C87VP9vG.js +1 -0
- package/editor/capture.html +2 -2
- package/editor/index.html +3 -3
- package/package.json +2 -2
- package/src/editorServer.ts +9 -3
- package/editor/assets/browserAll-DDpbpxbk.js +0 -1
- package/editor/assets/capture--KpnplUn.js +0 -1
- package/editor/assets/editor-CdMzlphb.js +0 -5
- package/editor/assets/editor-rwswALuA.css +0 -1
- package/editor/assets/init-Cun-jBBV.js +0 -1
- package/editor/assets/webworkerAll-CpwJPQ3Y.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,l as t,u as n,y as r}from"./captureCompilerScenePreview-BYHGr0JS.js";r.add(e,n),r.add(t);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./captureCompilerScenePreview-BYHGr0JS.js";import"./init-BOfNyIRQ.js";
|
package/editor/capture.html
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<title>Pixifact Scene Capture</title>
|
|
6
|
-
<script type="module" crossorigin src="/assets/capture
|
|
7
|
-
<link rel="modulepreload" crossorigin href="/assets/captureCompilerScenePreview-
|
|
6
|
+
<script type="module" crossorigin src="/assets/capture-BGSCjpR1.js"></script>
|
|
7
|
+
<link rel="modulepreload" crossorigin href="/assets/captureCompilerScenePreview-BYHGr0JS.js">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
</body>
|
package/editor/index.html
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Pixifact Editor</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/editor-
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/assets/captureCompilerScenePreview-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/editor-
|
|
7
|
+
<script type="module" crossorigin src="/assets/editor-D1nNN1_e.js"></script>
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/captureCompilerScenePreview-BYHGr0JS.js">
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/editor-BQk2SioZ.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixifact-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Pixifact Scene 自动化 CLI。",
|
|
5
5
|
"packageManager": "bun@1.3.13",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"start": "bun src/pixifact-cli.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"pixifact": "^0.
|
|
35
|
+
"pixifact": "^0.15.0",
|
|
36
36
|
"playwright": "1.58.2",
|
|
37
37
|
"vite": "^8.0.10"
|
|
38
38
|
}
|
package/src/editorServer.ts
CHANGED
|
@@ -39,6 +39,7 @@ interface EditorProjectFile {
|
|
|
39
39
|
interface EditorUiState {
|
|
40
40
|
assetTreeExpandedDirectories?: string[];
|
|
41
41
|
autoSave: boolean;
|
|
42
|
+
theme: 'system' | 'light' | 'dark';
|
|
42
43
|
openScenePaths?: string[];
|
|
43
44
|
activeScenePath?: string;
|
|
44
45
|
}
|
|
@@ -180,6 +181,7 @@ function parseEditorUiState(value: unknown): EditorUiState {
|
|
|
180
181
|
}
|
|
181
182
|
const directories = (value as Record<string, unknown>).assetTreeExpandedDirectories;
|
|
182
183
|
const autoSave = (value as Record<string, unknown>).autoSave;
|
|
184
|
+
const theme = (value as Record<string, unknown>).theme;
|
|
183
185
|
const openScenePaths = (value as Record<string, unknown>).openScenePaths;
|
|
184
186
|
const activeScenePath = (value as Record<string, unknown>).activeScenePath;
|
|
185
187
|
if (directories !== undefined && (!Array.isArray(directories) || directories.some((directory) => typeof directory !== 'string'))) {
|
|
@@ -188,6 +190,9 @@ function parseEditorUiState(value: unknown): EditorUiState {
|
|
|
188
190
|
if (autoSave !== undefined && typeof autoSave !== 'boolean') {
|
|
189
191
|
throw new Error('Editor UI state autoSave must be a boolean.');
|
|
190
192
|
}
|
|
193
|
+
if (theme !== undefined && theme !== 'system' && theme !== 'light' && theme !== 'dark') {
|
|
194
|
+
throw new EditorRequestError(400, 'Editor UI state theme must be system, light, or dark.');
|
|
195
|
+
}
|
|
191
196
|
if (openScenePaths !== undefined && (!Array.isArray(openScenePaths) || openScenePaths.some((scenePath) => typeof scenePath !== 'string'))) {
|
|
192
197
|
throw new Error('Editor UI state openScenePaths must be a string array.');
|
|
193
198
|
}
|
|
@@ -197,6 +202,7 @@ function parseEditorUiState(value: unknown): EditorUiState {
|
|
|
197
202
|
return {
|
|
198
203
|
...(directories === undefined ? {} : { assetTreeExpandedDirectories: directories }),
|
|
199
204
|
autoSave: autoSave ?? false,
|
|
205
|
+
theme: theme ?? 'dark',
|
|
200
206
|
...(openScenePaths === undefined ? {} : { openScenePaths }),
|
|
201
207
|
...(activeScenePath === undefined ? {} : { activeScenePath }),
|
|
202
208
|
};
|
|
@@ -204,7 +210,7 @@ function parseEditorUiState(value: unknown): EditorUiState {
|
|
|
204
210
|
|
|
205
211
|
function readEditorUiState(projectRoot: string): EditorUiState {
|
|
206
212
|
const statePath = editorUiStatePath(projectRoot);
|
|
207
|
-
if (!fs.existsSync(statePath)) return { autoSave: false };
|
|
213
|
+
if (!fs.existsSync(statePath)) return { autoSave: false, theme: 'dark' };
|
|
208
214
|
return parseEditorUiState(JSON.parse(fs.readFileSync(statePath, 'utf8')));
|
|
209
215
|
}
|
|
210
216
|
|
|
@@ -263,8 +269,8 @@ export function createEditorProjectService(options: EditorProjectServiceOptions)
|
|
|
263
269
|
if (url.pathname === '/api/editor-ui-state' && request.method === 'PUT') {
|
|
264
270
|
const body = await readJsonBody(request);
|
|
265
271
|
const state = parseEditorUiState(body);
|
|
266
|
-
if (!state.assetTreeExpandedDirectories || typeof body.autoSave !== 'boolean') {
|
|
267
|
-
throw new EditorRequestError(400, 'Editor UI state requires assetTreeExpandedDirectories and
|
|
272
|
+
if (!state.assetTreeExpandedDirectories || typeof body.autoSave !== 'boolean' || body.theme === undefined) {
|
|
273
|
+
throw new EditorRequestError(400, 'Editor UI state requires assetTreeExpandedDirectories, autoSave, and theme.');
|
|
268
274
|
}
|
|
269
275
|
return jsonResponse(writeEditorUiState(projectRoot, state));
|
|
270
276
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,E as t,T as n,b as r,w as i,x as a,y as o}from"./captureCompilerScenePreview-CksQqv9T.js";import"./init-Cun-jBBV.js";t.add(i),t.mixin(n,e),t.add(a),t.add(r),t.mixin(n,o);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as e,S as t,a as n,c as r,n as i,r as a,s as o,t as s}from"./captureCompilerScenePreview-CksQqv9T.js";window.capturePixifactScene=async c=>{let[l,u]=await Promise.all([o(),r(c)]),d=await i({document:{template:e(u.source),sceneInterfaces:{}},projectTree:n(l),scenePath:c}),f=new t,p=!1;try{return await f.init({width:d.width,height:d.height,backgroundAlpha:0,antialias:!0,autoStart:!1,resolution:1}),p=!0,f.stage.addChild(d.root),{scenePath:u.path,revision:u.version,width:d.width,height:d.height,dataUrl:await s(f,d)}}finally{p&&(f.stage.removeChild(d.root),f.destroy({removeView:!0},{children:!1})),a(d)}};
|