@energy8platform/golem 0.1.0 → 0.2.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/dist/editor.js +899 -1
- package/dist/lib/cli.js +9 -2
- package/dist/lib/cli.js.map +2 -2
- package/dist/lib/editor/stage.d.ts +11 -0
- package/dist/lib/editor/store.d.ts +2 -0
- package/dist/lib/editor-entry.js +7 -1
- package/dist/lib/editor-entry.js.map +2 -2
- package/package.json +1 -1
|
@@ -57,6 +57,17 @@ export declare class Stage {
|
|
|
57
57
|
private applyReference;
|
|
58
58
|
private startPlayback;
|
|
59
59
|
private tick;
|
|
60
|
+
/** one export at a time: two runs would interleave their seeks into the same player and produce a mixed file */
|
|
61
|
+
private exporting;
|
|
62
|
+
/**
|
|
63
|
+
* The current animation as GIF bytes — the top bar hands them to a download link, and the tests read them.
|
|
64
|
+
*
|
|
65
|
+
* Each frame is the DOCUMENT rectangle rendered on its own: `extract` REPLACES the target's transform with the
|
|
66
|
+
* frame's, so the file ignores the camera's zoom and pan and comes out at `meta.width` × `meta.height` whatever
|
|
67
|
+
* is on screen. The overlay (bones, labels, gizmos) is switched off for the duration, so nothing of the editor
|
|
68
|
+
* ends up in it; the paper stays, which is what makes every pixel opaque — GIF has no partial transparency.
|
|
69
|
+
*/
|
|
70
|
+
exportGif(fps?: number): Promise<Uint8Array<ArrayBuffer> | undefined>;
|
|
60
71
|
/** doc px → screen px (canvas client coords); the camera never rotates, so this is exact without a render */
|
|
61
72
|
toScreen(x: number, y: number): [number, number];
|
|
62
73
|
toDoc(sx: number, sy: number): [number, number];
|
|
@@ -1001,6 +1001,8 @@ export declare function setBoneTool(on: boolean): void;
|
|
|
1001
1001
|
export declare function placeBone(from: [number, number], to: [number, number]): Promise<void>;
|
|
1002
1002
|
/** clicks on images select their slot's bone instead — the images are "locked", as Spine puts it */
|
|
1003
1003
|
export declare const lockImages: import("@preact/signals-core").Signal<boolean>;
|
|
1004
|
+
/** draw the bone overlay — lines, joints and labels. Off is for looking at the art alone; the GIF export forces it off anyway */
|
|
1005
|
+
export declare const showBones: import("@preact/signals-core").Signal<boolean>;
|
|
1004
1006
|
/** collapsed panel sections by id */
|
|
1005
1007
|
export declare const sections: import("@preact/signals-core").Signal<Record<string, boolean>>;
|
|
1006
1008
|
export declare function toggleSection(id: string): void;
|
package/dist/lib/editor-entry.js
CHANGED
|
@@ -5372,6 +5372,11 @@ data: ${JSON.stringify({ version: v })}
|
|
|
5372
5372
|
res.end("not found");
|
|
5373
5373
|
}
|
|
5374
5374
|
} catch (e) {
|
|
5375
|
+
if (res.headersSent) {
|
|
5376
|
+
console.error(`editor: ${req.method} ${req.url}: ${e.message}`);
|
|
5377
|
+
res.end();
|
|
5378
|
+
return;
|
|
5379
|
+
}
|
|
5375
5380
|
json(res, 500, { isError: true, text: `ERROR: ${e.message}` });
|
|
5376
5381
|
}
|
|
5377
5382
|
});
|
|
@@ -5391,11 +5396,12 @@ data: ${JSON.stringify({ version: v })}
|
|
|
5391
5396
|
res.writeHead(403);
|
|
5392
5397
|
return res.end();
|
|
5393
5398
|
}
|
|
5399
|
+
if (!await stat3(abs).then(() => true, () => false)) return json(res, 404, { isError: true, text: `ERROR: ${url.searchParams.get("rig")} does not exist under ${root2}` });
|
|
5400
|
+
ensureWatch(abs);
|
|
5394
5401
|
res.writeHead(200, { "content-type": "text/event-stream", "cache-control": "no-cache", connection: "keep-alive" });
|
|
5395
5402
|
res.write(`: connected
|
|
5396
5403
|
|
|
5397
5404
|
`);
|
|
5398
|
-
ensureWatch(abs);
|
|
5399
5405
|
(clients.get(abs) ?? clients.set(abs, /* @__PURE__ */ new Set()).get(abs)).add(res);
|
|
5400
5406
|
const hb = setInterval(() => res.write(": hb\n\n"), 15e3);
|
|
5401
5407
|
req.on("close", () => {
|