@sebastianwessel/isostate 0.3.0 → 0.5.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/animation/animation-engine.d.ts +1 -0
- package/dist/animation/animation-engine.d.ts.map +1 -1
- package/dist/animation/controller.d.ts +34 -2
- package/dist/animation/controller.d.ts.map +1 -1
- package/dist/browser/isostate.runtime.js +4 -4
- package/dist/browser/isostate.runtime.js.map +12 -11
- package/dist/chunks/{index-B6HlPnov.js → index-CB6XEsbY.js} +257 -43
- package/dist/chunks/index-CB6XEsbY.js.map +1 -0
- package/dist/chunks/{rendering-engine-BgHel7yX.js → rendering-engine-nkqYx0qc.js} +224 -38
- package/dist/chunks/rendering-engine-nkqYx0qc.js.map +1 -0
- package/dist/chunks/{scene-parser-xgVJh2FU.js → scene-parser-F69XGE0l.js} +100 -33
- package/dist/chunks/scene-parser-F69XGE0l.js.map +1 -0
- package/dist/dsl/browser.js +1 -1
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/scene-parser.d.ts.map +1 -1
- package/dist/dsl/scene-validator.d.ts.map +1 -1
- package/dist/editor-support/adapter.d.ts +1 -0
- package/dist/editor-support/adapter.d.ts.map +1 -1
- package/dist/editor-support/index.js +6 -3
- package/dist/editor-support/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +470 -4
- package/dist/index.js.map +1 -1
- package/dist/rendering/animation-css.d.ts.map +1 -1
- package/dist/rendering/asset-node.d.ts.map +1 -1
- package/dist/rendering/rendering-engine.d.ts +9 -0
- package/dist/rendering/rendering-engine.d.ts.map +1 -1
- package/dist/rendering/theme.d.ts +4 -0
- package/dist/rendering/theme.d.ts.map +1 -1
- package/dist/runtime/diagnostics-overlay.d.ts +29 -0
- package/dist/runtime/diagnostics-overlay.d.ts.map +1 -0
- package/dist/runtime/export.d.ts +27 -0
- package/dist/runtime/export.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/interactivity.d.ts +56 -0
- package/dist/runtime/interactivity.d.ts.map +1 -0
- package/dist/runtime/mount-scene.d.ts +11 -10
- package/dist/runtime/mount-scene.d.ts.map +1 -1
- package/dist/types/asset-registry.d.ts +1 -0
- package/dist/types/asset-registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/node.d.ts +18 -0
- package/dist/types/node.d.ts.map +1 -1
- package/dist/types/runtime-bundle.d.ts +35 -0
- package/dist/types/runtime-bundle.d.ts.map +1 -1
- package/dist/types/scene.d.ts +2 -0
- package/dist/types/scene.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-B6HlPnov.js.map +0 -1
- package/dist/chunks/rendering-engine-BgHel7yX.js.map +0 -1
- package/dist/chunks/scene-parser-xgVJh2FU.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { A as AnimationController, a as AnimationEngine, e as easeInCubic, b as easeInOutCubic, c as easeOutCubic, l as linear, m as mountScene, r as resolveEasing } from './chunks/index-
|
|
2
|
-
|
|
3
|
-
export { A as
|
|
1
|
+
export { A as AnimationController, a as AnimationEngine, e as easeInCubic, b as easeInOutCubic, c as easeOutCubic, l as linear, m as mountScene, r as resolveEasing } from './chunks/index-CB6XEsbY.js';
|
|
2
|
+
import { g as getResolvedProjectionLayout, a as getResolvedViewBox, f as projectToScreen, e as updateElementTransforms, c as getElementState, h as hideElementAfterExit, u as unhideElementOnReadd, d as getConnectorState } from './chunks/rendering-engine-nkqYx0qc.js';
|
|
3
|
+
export { A as AssetRegistryImpl, D as DEFAULT_CELL_SIZE, i as applyThemeToElement, j as buildSceneDOM, k as calculateTransform, l as calculateVisualSize, m as composeTheme, n as createAssetRegistry, o as createDefaultRegistry, r as resolveTheme } from './chunks/rendering-engine-nkqYx0qc.js';
|
|
4
|
+
import { R as RenderError } from './chunks/errors-DyqEkrm5.js';
|
|
5
|
+
export { A as AnimationError, C as ControllerError, P as ParseError, V as ValidationErrorClass } from './chunks/errors-DyqEkrm5.js';
|
|
4
6
|
import './chunks/sha256-4JuurR-b.js';
|
|
5
7
|
|
|
6
8
|
/** Runtime set of valid entry animation strings */
|
|
@@ -47,5 +49,469 @@ function guardLifecycleStatus(v) {
|
|
|
47
49
|
return LIFECYCLE_STATUSES.has(v) ? v : undefined;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
53
|
+
const DIAGNOSTICS_ATTR = "data-iso-diagnostics";
|
|
54
|
+
const GRID_STROKE = "var(--iso-diag-grid, rgba(37, 99, 235, 0.35))";
|
|
55
|
+
const TEXT_FILL = "var(--iso-diag-text, #1e3a8a)";
|
|
56
|
+
const ANCHOR_FILL = "var(--iso-diag-anchor, #dc2626)";
|
|
57
|
+
const ROUTE_FILL = "var(--iso-diag-route, #059669)";
|
|
58
|
+
const registryBySvg = new WeakMap();
|
|
59
|
+
/**
|
|
60
|
+
* Attach a development-time diagnostics overlay (grid, coordinates, element
|
|
61
|
+
* anchors, connector route points, and a scene/progress readout) to a mounted
|
|
62
|
+
* scene. See `specs/02-capabilities/diagnostics-overlay.md` for the full
|
|
63
|
+
* normative behavior.
|
|
64
|
+
*/
|
|
65
|
+
function attachDiagnosticsOverlay(mounted, options = {}) {
|
|
66
|
+
assertMounted(mounted);
|
|
67
|
+
const registry = registryBySvg.get(mounted.svg) ?? {};
|
|
68
|
+
registryBySvg.set(mounted.svg, registry);
|
|
69
|
+
// Replace any previously attached overlay: retire its token so its
|
|
70
|
+
// `update()`/`destroy()` become no-ops, then remove its DOM group.
|
|
71
|
+
registry.current?.handle.destroy();
|
|
72
|
+
const token = Symbol("diagnostics-overlay");
|
|
73
|
+
const group = document.createElementNS(SVG_NS, "g");
|
|
74
|
+
group.setAttribute(DIAGNOSTICS_ATTR, "");
|
|
75
|
+
mounted.svg.appendChild(group);
|
|
76
|
+
const render = () => renderOverlay(group, mounted, options);
|
|
77
|
+
render();
|
|
78
|
+
const unsubscribe = subscribeToLiveUpdates(mounted, render);
|
|
79
|
+
const isCurrent = () => registry.current?.token === token;
|
|
80
|
+
const handle = {
|
|
81
|
+
update() {
|
|
82
|
+
if (!isCurrent())
|
|
83
|
+
return;
|
|
84
|
+
render();
|
|
85
|
+
},
|
|
86
|
+
destroy() {
|
|
87
|
+
if (!isCurrent())
|
|
88
|
+
return;
|
|
89
|
+
unsubscribe();
|
|
90
|
+
group.parentNode?.removeChild(group);
|
|
91
|
+
registry.current = undefined;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
registry.current = { token, handle };
|
|
95
|
+
return handle;
|
|
96
|
+
}
|
|
97
|
+
function assertMounted(mounted) {
|
|
98
|
+
if (!mounted.svg.isConnected) {
|
|
99
|
+
throw new RenderError("MOUNT_DESTROYED", "Cannot attach a diagnostics overlay to a destroyed mount");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* When the mount has a controller, re-render on `progress-change` and
|
|
104
|
+
* `camera-change` so the overlay tracks live scroll/camera state. Without a
|
|
105
|
+
* controller, consumers call `update()` manually — returns a no-op teardown.
|
|
106
|
+
*/
|
|
107
|
+
function subscribeToLiveUpdates(mounted, render) {
|
|
108
|
+
const controller = mounted.controller;
|
|
109
|
+
if (!controller)
|
|
110
|
+
return () => undefined;
|
|
111
|
+
const onProgressChange = () => render();
|
|
112
|
+
const onCameraChange = () => render();
|
|
113
|
+
controller.on("progress-change", onProgressChange);
|
|
114
|
+
controller.on("camera-change", onCameraChange);
|
|
115
|
+
return () => {
|
|
116
|
+
controller.off("progress-change", onProgressChange);
|
|
117
|
+
controller.off("camera-change", onCameraChange);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
// ── Rendering ────────────────────────────────────────────────────────────────
|
|
121
|
+
function renderOverlay(group, mounted, options) {
|
|
122
|
+
clearChildren(group);
|
|
123
|
+
const bundle = mounted.engine.bundle;
|
|
124
|
+
if (!bundle)
|
|
125
|
+
return;
|
|
126
|
+
const layout = getResolvedProjectionLayout(bundle);
|
|
127
|
+
const project = (x, y) => {
|
|
128
|
+
const screen = projectToScreen(x, y, layout.cellSize, layout.selectedBounds.minX, layout.selectedBounds.minY, layout.padding.x, layout.padding.y);
|
|
129
|
+
return { x: screen.screenX, y: screen.screenY };
|
|
130
|
+
};
|
|
131
|
+
const showGrid = options.grid ?? true;
|
|
132
|
+
const showCoordinates = options.coordinates ?? false;
|
|
133
|
+
const showAnchors = options.anchors ?? true;
|
|
134
|
+
const showRoutes = options.routes ?? true;
|
|
135
|
+
const showReadout = options.readout ?? true;
|
|
136
|
+
if (showGrid)
|
|
137
|
+
appendGrid(group, bundle, project);
|
|
138
|
+
if (showCoordinates)
|
|
139
|
+
appendCoordinates(group, bundle, project);
|
|
140
|
+
if (showAnchors)
|
|
141
|
+
appendAnchors(group, mounted, project);
|
|
142
|
+
if (showRoutes)
|
|
143
|
+
appendRoutes(group, mounted, project);
|
|
144
|
+
if (showReadout)
|
|
145
|
+
appendReadout(group, mounted, bundle);
|
|
146
|
+
}
|
|
147
|
+
function appendGrid(group, bundle, project) {
|
|
148
|
+
const [originX, originY] = bundle.floor.origin;
|
|
149
|
+
const [columns, rows] = bundle.floor.size;
|
|
150
|
+
for (let x = 0; x <= columns; x++) {
|
|
151
|
+
appendGridLine(group, project(originX + x, originY), project(originX + x, originY + rows));
|
|
152
|
+
}
|
|
153
|
+
for (let y = 0; y <= rows; y++) {
|
|
154
|
+
appendGridLine(group, project(originX, originY + y), project(originX + columns, originY + y));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function appendGridLine(group, start, end) {
|
|
158
|
+
const path = document.createElementNS(SVG_NS, "path");
|
|
159
|
+
path.setAttribute("d", `M ${start.x} ${start.y} L ${end.x} ${end.y}`);
|
|
160
|
+
path.setAttribute("stroke", GRID_STROKE);
|
|
161
|
+
path.setAttribute("stroke-width", "1");
|
|
162
|
+
path.setAttribute("fill", "none");
|
|
163
|
+
path.setAttribute("vector-effect", "non-scaling-stroke");
|
|
164
|
+
group.appendChild(path);
|
|
165
|
+
}
|
|
166
|
+
function appendCoordinates(group, bundle, project) {
|
|
167
|
+
const [originX, originY] = bundle.floor.origin;
|
|
168
|
+
const [columns, rows] = bundle.floor.size;
|
|
169
|
+
for (let x = 0; x <= columns; x++) {
|
|
170
|
+
for (let y = 0; y <= rows; y++) {
|
|
171
|
+
const gridX = originX + x;
|
|
172
|
+
const gridY = originY + y;
|
|
173
|
+
const point = project(gridX, gridY);
|
|
174
|
+
const text = document.createElementNS(SVG_NS, "text");
|
|
175
|
+
text.setAttribute("x", String(point.x));
|
|
176
|
+
text.setAttribute("y", String(point.y));
|
|
177
|
+
text.setAttribute("font-size", "8");
|
|
178
|
+
text.setAttribute("fill", TEXT_FILL);
|
|
179
|
+
text.textContent = `${gridX},${gridY}`;
|
|
180
|
+
group.appendChild(text);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function appendAnchors(group, mounted, project) {
|
|
185
|
+
for (const element of mounted.engine.getFrameUpdates()) {
|
|
186
|
+
if (element.lifecycle === "removed")
|
|
187
|
+
continue;
|
|
188
|
+
// The element's anchor is the node's local transform origin, which the
|
|
189
|
+
// renderer always places at `projectToScreen(pos + size, ...)` — see
|
|
190
|
+
// `applyElementTransform()` in rendering-engine.ts. No separate anchor
|
|
191
|
+
// ratio math is needed here to locate the point itself.
|
|
192
|
+
const point = project(element.pos[0] + element.size, element.pos[1] + element.size);
|
|
193
|
+
const circle = document.createElementNS(SVG_NS, "circle");
|
|
194
|
+
circle.setAttribute("cx", String(point.x));
|
|
195
|
+
circle.setAttribute("cy", String(point.y));
|
|
196
|
+
circle.setAttribute("r", "3");
|
|
197
|
+
circle.setAttribute("fill", ANCHOR_FILL);
|
|
198
|
+
group.appendChild(circle);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function appendRoutes(group, mounted, project) {
|
|
202
|
+
for (const connector of mounted.engine.getConnectorFrameUpdates()) {
|
|
203
|
+
if (connector.lifecycle === "removed")
|
|
204
|
+
continue;
|
|
205
|
+
for (const [x, y] of connector.route) {
|
|
206
|
+
const point = project(x, y);
|
|
207
|
+
const rect = document.createElementNS(SVG_NS, "rect");
|
|
208
|
+
rect.setAttribute("x", String(point.x - 2));
|
|
209
|
+
rect.setAttribute("y", String(point.y - 2));
|
|
210
|
+
rect.setAttribute("width", "4");
|
|
211
|
+
rect.setAttribute("height", "4");
|
|
212
|
+
rect.setAttribute("fill", ROUTE_FILL);
|
|
213
|
+
group.appendChild(rect);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function appendReadout(group, mounted, bundle) {
|
|
218
|
+
const viewBox = mounted.controller ? mounted.controller.getCameraState().viewBox : getResolvedViewBox(bundle);
|
|
219
|
+
const progress = mounted.controller ? mounted.controller.getProgress() : mounted.engine.getProgress();
|
|
220
|
+
// Resolved from the engine's own progress-to-stop mapping (not
|
|
221
|
+
// `controller.currentScene`, which only advances on explicit scene
|
|
222
|
+
// navigation and would go stale under scroll-driven progress changes).
|
|
223
|
+
const sceneId = mounted.controller ? mounted.engine.getCurrentState()?.id : undefined;
|
|
224
|
+
const text = document.createElementNS(SVG_NS, "text");
|
|
225
|
+
text.setAttribute("x", String(viewBox.minX + 4));
|
|
226
|
+
text.setAttribute("y", String(viewBox.minY + 10));
|
|
227
|
+
text.setAttribute("font-size", "10");
|
|
228
|
+
text.setAttribute("fill", TEXT_FILL);
|
|
229
|
+
text.textContent = sceneId
|
|
230
|
+
? `scene ${sceneId} · progress ${roundProgress(progress)}`
|
|
231
|
+
: `progress ${roundProgress(progress)}`;
|
|
232
|
+
group.appendChild(text);
|
|
233
|
+
}
|
|
234
|
+
function roundProgress(progress) {
|
|
235
|
+
return Math.round(progress * 1000) / 1000;
|
|
236
|
+
}
|
|
237
|
+
function clearChildren(node) {
|
|
238
|
+
while (node.firstChild)
|
|
239
|
+
node.removeChild(node.firstChild);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
243
|
+
const XLINK_NAMESPACE = "http://www.w3.org/1999/xlink";
|
|
244
|
+
const DIAGNOSTICS_OVERLAY_SELECTOR = "[data-iso-diagnostics]";
|
|
245
|
+
/**
|
|
246
|
+
* Serialize a mounted scene to a standalone SVG document string.
|
|
247
|
+
*
|
|
248
|
+
* The exported SVG carries the runtime stylesheet and current visual state
|
|
249
|
+
* as-is. Ambient/entry/exit CSS animations are not restarted or awaited by
|
|
250
|
+
* the export; the snapshot reflects the un-animated base state at the
|
|
251
|
+
* resolved progress.
|
|
252
|
+
*/
|
|
253
|
+
async function exportSceneSvg(mounted, options = {}) {
|
|
254
|
+
assertNotDestroyed(mounted);
|
|
255
|
+
assertValidSnapshotOptions(options);
|
|
256
|
+
return withRestoredProgress(mounted, options.progress, async () => {
|
|
257
|
+
const clone = prepareClone(mounted.svg, options);
|
|
258
|
+
if (options.inlineAssets ?? true) {
|
|
259
|
+
await inlineImageAssets(clone);
|
|
260
|
+
}
|
|
261
|
+
return serializeSvg(clone);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/** Rasterize a mounted scene to a PNG blob. */
|
|
265
|
+
async function exportScenePng(mounted, options = {}) {
|
|
266
|
+
assertNotDestroyed(mounted);
|
|
267
|
+
assertValidPngSnapshotOptions(options);
|
|
268
|
+
const scale = options.scale ?? 2;
|
|
269
|
+
return withRestoredProgress(mounted, options.progress, async () => {
|
|
270
|
+
const clone = prepareClone(mounted.svg, options);
|
|
271
|
+
// PNG export always inlines assets: external hrefs taint or fail canvas rasterization.
|
|
272
|
+
await inlineImageAssets(clone);
|
|
273
|
+
const svgString = serializeSvg(clone);
|
|
274
|
+
const viewBox = readViewBox(clone);
|
|
275
|
+
return rasterize(svgString, viewBox, scale);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
// ── Shared step 1-3: destroyed check, option validation, progress restore ──
|
|
279
|
+
function assertNotDestroyed(mounted) {
|
|
280
|
+
if (!mounted.svg.isConnected) {
|
|
281
|
+
throw new RenderError("EXPORT_TARGET_DESTROYED", "Cannot export a scene whose mount was destroyed");
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function assertValidSnapshotOptions(options) {
|
|
285
|
+
if (options.progress !== undefined && !isValidProgress(options.progress)) {
|
|
286
|
+
throw new RenderError("EXPORT_INVALID_OPTIONS", "progress must be a finite number within [0, 1]", {
|
|
287
|
+
progress: options.progress,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function assertValidPngSnapshotOptions(options) {
|
|
292
|
+
assertValidSnapshotOptions(options);
|
|
293
|
+
if (options.scale !== undefined && !isValidScale(options.scale)) {
|
|
294
|
+
throw new RenderError("EXPORT_INVALID_OPTIONS", "scale must be a finite number greater than 0", {
|
|
295
|
+
scale: options.scale,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
if (options.inlineAssets === false) {
|
|
299
|
+
throw new RenderError("EXPORT_INVALID_OPTIONS", "exportScenePng() always inlines assets; inlineAssets: false is unsupported for PNG export");
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function isValidProgress(progress) {
|
|
303
|
+
return Number.isFinite(progress) && progress >= 0 && progress <= 1;
|
|
304
|
+
}
|
|
305
|
+
function isValidScale(scale) {
|
|
306
|
+
return Number.isFinite(scale) && scale > 0;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Runs `run` at the requested `progress`, restoring the engine's prior
|
|
310
|
+
* progress afterwards on every code path (success or rejection). When
|
|
311
|
+
* `progress` is omitted, `run` executes at the scene's current progress and
|
|
312
|
+
* no restoration is needed.
|
|
313
|
+
*/
|
|
314
|
+
async function withRestoredProgress(mounted, progress, run) {
|
|
315
|
+
if (progress === undefined) {
|
|
316
|
+
return run();
|
|
317
|
+
}
|
|
318
|
+
const previousProgress = mounted.engine.getProgress();
|
|
319
|
+
try {
|
|
320
|
+
mounted.engine.setProgress(progress);
|
|
321
|
+
applyControllerFrame(mounted);
|
|
322
|
+
return await run();
|
|
323
|
+
}
|
|
324
|
+
finally {
|
|
325
|
+
mounted.engine.setProgress(previousProgress);
|
|
326
|
+
applyControllerFrame(mounted);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Applies the engine's current frame to the live SVG so DOM state (element
|
|
331
|
+
* transforms, generated content, connector routes, and lifecycle visibility)
|
|
332
|
+
* matches the engine's resolved progress. Mirrors the non-animated portion of
|
|
333
|
+
* `AnimationController`'s frame-apply path: transforms/content via
|
|
334
|
+
* `updateElementTransforms()`, plus visibility driven by the resolved
|
|
335
|
+
* lifecycle state. CSS entry/exit animation classes are intentionally not
|
|
336
|
+
* (re)triggered here, matching the spec's requirement that ambient/entry
|
|
337
|
+
* animations are irrelevant to export output.
|
|
338
|
+
*/
|
|
339
|
+
function applyControllerFrame(mounted) {
|
|
340
|
+
const svg = mounted.svg;
|
|
341
|
+
const elementUpdates = mounted.engine.getFrameUpdates().map((update) => ({
|
|
342
|
+
id: update.id,
|
|
343
|
+
asset: update.asset,
|
|
344
|
+
pos: update.pos,
|
|
345
|
+
size: update.size,
|
|
346
|
+
layer: update.layer,
|
|
347
|
+
presence: update.lifecycle,
|
|
348
|
+
enter: update.entry,
|
|
349
|
+
exit: update.exit,
|
|
350
|
+
ambient: update.ambient,
|
|
351
|
+
text: update.text,
|
|
352
|
+
primitive: update.primitive,
|
|
353
|
+
}));
|
|
354
|
+
const connectorUpdates = mounted.engine.getConnectorFrameUpdates().map((update) => ({
|
|
355
|
+
id: update.id,
|
|
356
|
+
route: update.route,
|
|
357
|
+
layer: update.layer,
|
|
358
|
+
presence: update.lifecycle,
|
|
359
|
+
style: update.style,
|
|
360
|
+
start: update.start,
|
|
361
|
+
end: update.end,
|
|
362
|
+
direction: update.direction,
|
|
363
|
+
enter: update.entry,
|
|
364
|
+
exit: update.exit,
|
|
365
|
+
ambient: update.ambient,
|
|
366
|
+
}));
|
|
367
|
+
updateElementTransforms(svg, elementUpdates, connectorUpdates);
|
|
368
|
+
applyElementVisibility(svg, elementUpdates);
|
|
369
|
+
applyConnectorVisibility(svg, connectorUpdates);
|
|
370
|
+
}
|
|
371
|
+
function applyElementVisibility(svg, elements) {
|
|
372
|
+
for (const element of elements) {
|
|
373
|
+
const state = getElementState(svg, element.id);
|
|
374
|
+
if (!state)
|
|
375
|
+
continue;
|
|
376
|
+
if (element.presence === "removed") {
|
|
377
|
+
state.isHidden = true;
|
|
378
|
+
hideElementAfterExit(state.node);
|
|
379
|
+
}
|
|
380
|
+
else if (state.isHidden) {
|
|
381
|
+
state.isHidden = false;
|
|
382
|
+
unhideElementOnReadd(state.node);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function applyConnectorVisibility(svg, connectors) {
|
|
387
|
+
for (const connector of connectors) {
|
|
388
|
+
const state = getConnectorState(svg, connector.id);
|
|
389
|
+
if (!state)
|
|
390
|
+
continue;
|
|
391
|
+
if (connector.presence === "removed") {
|
|
392
|
+
state.isHidden = true;
|
|
393
|
+
hideElementAfterExit(state.node);
|
|
394
|
+
}
|
|
395
|
+
else if (state.isHidden) {
|
|
396
|
+
state.isHidden = false;
|
|
397
|
+
unhideElementOnReadd(state.node);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
// ── Step 4-5: clone and prepare ────────────────────────────────────────────
|
|
402
|
+
function prepareClone(svg, options) {
|
|
403
|
+
const clone = svg.cloneNode(true);
|
|
404
|
+
const viewBox = readViewBox(clone);
|
|
405
|
+
clone.setAttribute("width", String(viewBox.width));
|
|
406
|
+
clone.setAttribute("height", String(viewBox.height));
|
|
407
|
+
clone.setAttribute("xmlns", SVG_NAMESPACE);
|
|
408
|
+
clone.setAttribute("xmlns:xlink", XLINK_NAMESPACE);
|
|
409
|
+
if (options.background) {
|
|
410
|
+
const rect = document.createElementNS(SVG_NAMESPACE, "rect");
|
|
411
|
+
rect.setAttribute("x", String(viewBox.minX));
|
|
412
|
+
rect.setAttribute("y", String(viewBox.minY));
|
|
413
|
+
rect.setAttribute("width", String(viewBox.width));
|
|
414
|
+
rect.setAttribute("height", String(viewBox.height));
|
|
415
|
+
rect.setAttribute("fill", options.background);
|
|
416
|
+
insertAsFirstChild(clone, rect);
|
|
417
|
+
}
|
|
418
|
+
const diagnosticsOverlay = clone.querySelector(DIAGNOSTICS_OVERLAY_SELECTOR);
|
|
419
|
+
diagnosticsOverlay?.parentNode?.removeChild(diagnosticsOverlay);
|
|
420
|
+
return clone;
|
|
421
|
+
}
|
|
422
|
+
function insertAsFirstChild(parent, child) {
|
|
423
|
+
if (parent.firstChild) {
|
|
424
|
+
parent.insertBefore(child, parent.firstChild);
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
parent.appendChild(child);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function readViewBox(svg) {
|
|
431
|
+
const raw = svg.getAttribute("viewBox");
|
|
432
|
+
const parts = (raw ?? "").trim().split(/\s+/).map(Number);
|
|
433
|
+
if (parts.length !== 4 || parts.some((part) => !Number.isFinite(part))) {
|
|
434
|
+
return { minX: 0, minY: 0, width: 0, height: 0 };
|
|
435
|
+
}
|
|
436
|
+
const [minX, minY, width, height] = parts;
|
|
437
|
+
return { minX, minY, width, height };
|
|
438
|
+
}
|
|
439
|
+
// ── Step 6: asset inlining ──────────────────────────────────────────────────
|
|
440
|
+
async function inlineImageAssets(clone) {
|
|
441
|
+
const images = [...clone.querySelectorAll("image")];
|
|
442
|
+
await Promise.all(images.map((image) => inlineImageHref(image)));
|
|
443
|
+
}
|
|
444
|
+
async function inlineImageHref(image) {
|
|
445
|
+
const href = image.getAttribute("href") ?? image.getAttributeNS(XLINK_NAMESPACE, "href");
|
|
446
|
+
if (!href || href.startsWith("data:"))
|
|
447
|
+
return;
|
|
448
|
+
const dataUri = await fetchAsDataUri(href);
|
|
449
|
+
image.setAttribute("href", dataUri);
|
|
450
|
+
image.setAttributeNS(XLINK_NAMESPACE, "href", dataUri);
|
|
451
|
+
}
|
|
452
|
+
async function fetchAsDataUri(url) {
|
|
453
|
+
let response;
|
|
454
|
+
try {
|
|
455
|
+
response = await fetch(url);
|
|
456
|
+
}
|
|
457
|
+
catch {
|
|
458
|
+
throw new RenderError("EXPORT_ASSET_FETCH_FAILED", `Failed to fetch asset for inlining: ${url}`, { url });
|
|
459
|
+
}
|
|
460
|
+
if (!response.ok) {
|
|
461
|
+
throw new RenderError("EXPORT_ASSET_FETCH_FAILED", `Failed to fetch asset for inlining: ${url}`, { url });
|
|
462
|
+
}
|
|
463
|
+
const contentType = response.headers.get("content-type") ?? "application/octet-stream";
|
|
464
|
+
const buffer = await response.arrayBuffer();
|
|
465
|
+
return `data:${contentType};base64,${arrayBufferToBase64(buffer)}`;
|
|
466
|
+
}
|
|
467
|
+
function arrayBufferToBase64(buffer) {
|
|
468
|
+
let binary = "";
|
|
469
|
+
const bytes = new Uint8Array(buffer);
|
|
470
|
+
for (const byte of bytes)
|
|
471
|
+
binary += String.fromCharCode(byte);
|
|
472
|
+
return btoa(binary);
|
|
473
|
+
}
|
|
474
|
+
// ── Step 7: SVG serialization ───────────────────────────────────────────────
|
|
475
|
+
function serializeSvg(clone) {
|
|
476
|
+
const serializer = new XMLSerializer();
|
|
477
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n${serializer.serializeToString(clone)}`;
|
|
478
|
+
}
|
|
479
|
+
// ── Step 8: PNG rasterization ────────────────────────────────────────────────
|
|
480
|
+
async function rasterize(svgString, viewBox, scale) {
|
|
481
|
+
const width = Math.ceil(viewBox.width * scale);
|
|
482
|
+
const height = Math.ceil(viewBox.height * scale);
|
|
483
|
+
const svgBlob = new Blob([svgString], { type: "image/svg+xml" });
|
|
484
|
+
const objectUrl = URL.createObjectURL(svgBlob);
|
|
485
|
+
try {
|
|
486
|
+
const image = await loadImage(objectUrl);
|
|
487
|
+
const canvas = document.createElement("canvas");
|
|
488
|
+
canvas.width = width;
|
|
489
|
+
canvas.height = height;
|
|
490
|
+
const context = canvas.getContext("2d");
|
|
491
|
+
if (!context) {
|
|
492
|
+
throw new RenderError("EXPORT_RASTERIZE_FAILED", "Canvas 2D context is unavailable");
|
|
493
|
+
}
|
|
494
|
+
context.drawImage(image, 0, 0, width, height);
|
|
495
|
+
const blob = await new Promise((resolve) => {
|
|
496
|
+
canvas.toBlob(resolve, "image/png");
|
|
497
|
+
});
|
|
498
|
+
if (!blob) {
|
|
499
|
+
throw new RenderError("EXPORT_RASTERIZE_FAILED", "Canvas failed to encode PNG output");
|
|
500
|
+
}
|
|
501
|
+
return blob;
|
|
502
|
+
}
|
|
503
|
+
finally {
|
|
504
|
+
URL.revokeObjectURL(objectUrl);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
function loadImage(src) {
|
|
508
|
+
return new Promise((resolve, reject) => {
|
|
509
|
+
const image = new Image();
|
|
510
|
+
image.onload = () => resolve(image);
|
|
511
|
+
image.onerror = () => reject(new RenderError("EXPORT_RASTERIZE_FAILED", "Failed to load rasterization source image"));
|
|
512
|
+
image.src = src;
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export { RenderError, attachDiagnosticsOverlay, exportScenePng, exportSceneSvg, guardEntryAnimation, guardExitAnimation, guardLifecycleStatus, projectToScreen };
|
|
51
517
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/types/node.ts"],"sourcesContent":["/** Entry animation types */\nexport type EntryAnimation =\n\t| \"fade-in\"\n\t| \"fade-in-grow\"\n\t| \"fall-in\"\n\t| \"rise-from-ground\"\n\t| \"slide-in-left\"\n\t| \"slide-in-right\"\n\t| \"flip-in\"\n\t| \"none\";\n\n/** Exit animation types */\nexport type ExitAnimation =\n\t| \"fade-out\"\n\t| \"fade-out-shrink\"\n\t| \"fall-through-ground\"\n\t| \"rise-away\"\n\t| \"slide-out-left\"\n\t| \"slide-out-right\"\n\t| \"flip-out\"\n\t| \"none\";\n\n/** Runtime/compiler-derived lifecycle status. Not authored in YAML. */\nexport type LifecycleStatus = \"entering\" | \"present\" | \"exiting\" | \"removed\";\n\n/** Runtime set of valid entry animation strings */\nexport const ENTRY_ANIMATIONS: ReadonlySet<EntryAnimation> = new Set([\n\t\"fade-in\",\n\t\"fade-in-grow\",\n\t\"fall-in\",\n\t\"rise-from-ground\",\n\t\"slide-in-left\",\n\t\"slide-in-right\",\n\t\"flip-in\",\n\t\"none\",\n]);\n\n/** Runtime set of valid exit animation strings */\nexport const EXIT_ANIMATIONS: ReadonlySet<ExitAnimation> = new Set([\n\t\"fade-out\",\n\t\"fade-out-shrink\",\n\t\"fall-through-ground\",\n\t\"rise-away\",\n\t\"slide-out-left\",\n\t\"slide-out-right\",\n\t\"flip-out\",\n\t\"none\",\n]);\n\n/** Runtime set of valid lifecycle status strings */\nexport const LIFECYCLE_STATUSES: ReadonlySet<LifecycleStatus> = new Set([\"entering\", \"present\", \"exiting\", \"removed\"]);\n\n/** Ambient animation configuration */\nexport interface AmbientAnimation {\n\t/** Animation class name */\n\tname: string;\n\t/** Whether the animation runs infinitely (default: true) */\n\tinfinite?: boolean;\n\t/** Number of times to play (only relevant when infinite: false) */\n\titerations?: number;\n}\n\nexport type CameraEasing = \"linear\" | \"ease-in-out\" | \"ease-out\";\n\nexport interface CameraGridArea {\n\tat: [number, number];\n\tsize: [number, number];\n}\n\nexport type CameraTarget = { element: string } | { area: CameraGridArea } | { reset: true };\n\nexport interface CameraFocus {\n\ttarget: CameraTarget;\n\tpadding?: number;\n\tduration?: number;\n\teasing?: CameraEasing;\n}\n\nexport interface CameraZoomOptions {\n\tpadding?: number;\n\tduration?: number;\n\teasing?: CameraEasing;\n}\n\nexport type RuntimeCameraTarget =\n\t| { type: \"element\"; id: string }\n\t| { type: \"area\"; at: [number, number]; size: [number, number] }\n\t| { type: \"reset\" };\n\nexport interface RuntimeCameraFocus {\n\ttarget: RuntimeCameraTarget;\n\tpadding?: number;\n\tduration?: number;\n\teasing?: CameraEasing;\n}\n\n/** Horizontal anchor used by built-in text elements. */\nexport type TextAlign = \"start\" | \"middle\" | \"end\";\n\n/** Content and safe SVG text styling for the built-in `asset: text` element. */\nexport interface TextContent {\n\t/** Text content. Use newline characters for explicit line breaks. */\n\tvalue: string;\n\t/** Horizontal text anchor within the element cell. Defaults to `middle`. */\n\talign?: TextAlign;\n\t/** SVG font-size in CSS pixels before element scaling. Defaults to `12`. */\n\tfontSize?: number;\n\t/** SVG font-weight. Defaults to `700`. */\n\tfontWeight?: number | \"normal\" | \"bold\";\n\t/** Multiplier applied to `fontSize` for multiline spacing. Defaults to `1.2`. */\n\tlineHeight?: number;\n\t/** SVG fill color. Defaults to `currentColor`. */\n\tfill?: string;\n}\n\n/** Sparse update payload for built-in text content. */\nexport type TextContentPatch = Partial<TextContent>;\n\n/** Built-in generated primitive asset ids. These are not declared in header assets. */\nexport type PrimitiveAssetId = \"rectangle\" | \"circle\" | \"polygon\" | \"line\";\n\n/** Shared safe SVG style fields for generated primitive assets. */\nexport interface PrimitiveStyle {\n\t/** SVG fill color or safe CSS color token. Defaults to `currentColor`. */\n\tfill?: string;\n\t/** SVG stroke color or safe CSS color token. Defaults to `none`. */\n\tstroke?: string;\n\t/** SVG stroke width in CSS pixels before element scaling. Defaults to `0`. */\n\tstrokeWidth?: number;\n\t/** Element opacity from `0` to `1`. Defaults to `1`. */\n\topacity?: number;\n\t/** Optional dash/gap pair for stroked primitives. */\n\tdash?: [number, number];\n}\n\n/** Generated projected rectangle/diamond primitive content. */\nexport interface RectanglePrimitive extends PrimitiveStyle {\n\t/** Optional corner radius for screen-space rectangles. Defaults to `0`. */\n\trx?: number;\n}\n\n/** Generated circle primitive content. */\nexport interface CirclePrimitive extends PrimitiveStyle {}\n\n/** Generated polygon primitive content using normalized local grid coordinates. */\nexport interface PolygonPrimitive extends PrimitiveStyle {\n\t/** Polygon points in local normalized grid coordinates from `0` to `1`. */\n\tpoints: [number, number][];\n}\n\n/** Generated line/polyline primitive content using normalized local grid coordinates. */\nexport interface LinePrimitive extends Omit<PrimitiveStyle, \"fill\"> {\n\t/** Line points in local normalized grid coordinates from `0` to `1`. */\n\tpoints: [number, number][];\n\t/** SVG line cap. Defaults to `round`. */\n\tlineCap?: \"butt\" | \"round\" | \"square\";\n\t/** SVG line join. Defaults to `round`. */\n\tlineJoin?: \"miter\" | \"round\" | \"bevel\";\n}\n\n/** Element-level payload for generated primitive assets. */\nexport interface PrimitiveContent {\n\trectangle?: RectanglePrimitive;\n\tcircle?: CirclePrimitive;\n\tpolygon?: PolygonPrimitive;\n\tline?: LinePrimitive;\n}\n\n/** Sparse update payload for built-in primitive content. */\nexport interface PrimitiveContentPatch {\n\trectangle?: Partial<RectanglePrimitive>;\n\tcircle?: Partial<CirclePrimitive>;\n\tpolygon?: Partial<PolygonPrimitive>;\n\tline?: Partial<LinePrimitive>;\n}\n\n/** Element placement used in first-scene elements and later add operations. */\nexport interface ElementPlacement {\n\tid: string;\n\tasset: string;\n\tat: [number, number];\n\tsize?: number;\n\tlayer?: string;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n\ttext?: TextContent;\n\tprimitive?: PrimitiveContent;\n}\n\n/** Element patch used by scene update operations. */\nexport interface ElementPatch {\n\tid: string;\n\tat?: [number, number];\n\tsize?: number;\n\tlayer?: string;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n\ttext?: TextContentPatch;\n\tprimitive?: PrimitiveContentPatch;\n}\n\n/** Element removal used by scene remove operations. */\nexport interface ElementRemoval {\n\tid: string;\n\texit?: ExitAnimation;\n}\n\n/** Visual connector line pattern for authored connections and runtime connectors. */\nexport type ConnectorPattern = \"solid\" | \"dashed\" | \"dotted\";\n\n/** Visual connector geometry variant. */\nexport type ConnectorVariant = \"line\" | \"road\";\n\n/** Generated endpoint indicator placed at the start or end of a connector. */\nexport type ConnectorEndpoint = \"none\" | \"arrow\" | \"dot\" | \"circle\" | \"diamond\" | \"bar\";\n\n/** Direction used for connector endpoint orientation and flow animation. */\nexport type ConnectorDirection = \"route\" | \"reverse\";\n\n/** Authored connector style overrides for a visual connection. */\nexport interface ConnectorStyle {\n\t/** Geometry variant. Defaults to `line`. */\n\tvariant?: ConnectorVariant;\n\t/** Stroke pattern. Defaults to `solid`. */\n\tpattern?: ConnectorPattern;\n\t/** SVG stroke color or safe CSS color token. */\n\tstroke?: string;\n\t/** Stroke width in SVG user units. */\n\tstrokeWidth?: number;\n\t/** Connector opacity from `0` to `1`. */\n\topacity?: number;\n\t/** Explicit dash/gap pair in SVG user units. */\n\tdash?: [number, number];\n\t/** Optional outline stroke color for road connectors. */\n\toutline?: string;\n\t/** Optional outline width in SVG user units. */\n\toutlineWidth?: number;\n\t/** Optional road lane treatment. */\n\tlane?: \"none\" | \"center-dashed\";\n}\n\n/** Authored endpoint reference for compiler-routed visual connections. */\nexport interface ConnectorEndpointRef {\n\t/** Element id to attach to. Mutually exclusive with `at`. */\n\telement?: string;\n\t/** Explicit grid point to attach to. Mutually exclusive with `element`. */\n\tat?: [number, number];\n\t/** Element side or automatic side selection. Defaults to `auto`. */\n\tside?: \"auto\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"front\" | \"back\";\n\t/** Normalized side offset from `-0.5` to `0.5`. Defaults to `0`. */\n\toffset?: number;\n}\n\n/** Authored routing options used only by dev-time compiler tooling. */\nexport interface ConnectorRouting {\n\t/** Routing mode. Defaults to `orthogonal` for endpoint-routed connections. */\n\tmode?: \"straight\" | \"orthogonal\" | \"manual\";\n\t/** Obstacle avoidance selection. Defaults to `objects`. */\n\tavoid?: \"objects\" | \"none\" | string[];\n\t/** Obstacle clearance in grid cells. Defaults to `0.5`. */\n\tclearance?: number;\n\t/** Router grid step in grid cells. */\n\tgridStep?: number;\n\t/** Maximum allowed bends for advanced routers. */\n\tmaxBends?: number;\n\t/** Route scoring preference for advanced routers. */\n\tprefer?: \"direct\" | \"fewest-bends\" | \"shortest\";\n}\n\n/** Connection placement used in first-scene connections and later add operations. */\nexport interface ConnectionPlacement {\n\tid: string;\n\troute?: [number, number][];\n\tfrom?: ConnectorEndpointRef;\n\tto?: ConnectorEndpointRef;\n\trouting?: ConnectorRouting;\n\tlayer?: string;\n\tstyle?: ConnectorStyle;\n\tstart?: ConnectorEndpoint;\n\tend?: ConnectorEndpoint;\n\tdirection?: ConnectorDirection;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n}\n\n/** Connection patch used by scene update operations. */\nexport interface ConnectionPatch {\n\tid: string;\n\troute?: [number, number][];\n\tfrom?: ConnectorEndpointRef;\n\tto?: ConnectorEndpointRef;\n\trouting?: ConnectorRouting;\n\tlayer?: string;\n\tstyle?: ConnectorStyle;\n\tstart?: ConnectorEndpoint;\n\tend?: ConnectorEndpoint;\n\tdirection?: ConnectorDirection;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n}\n\n/** Connection removal used by scene remove operations. */\nexport interface ConnectionRemoval {\n\tid: string;\n\texit?: ExitAnimation;\n}\n\n/** Fully defaulted connector style emitted to browser runtime snapshots. */\nexport interface RuntimeConnectorStyle {\n\tvariant: ConnectorVariant;\n\tpattern: ConnectorPattern;\n\tstroke: string;\n\tstrokeWidth: number;\n\topacity: number;\n\tdash?: [number, number];\n\toutline?: string;\n\toutlineWidth: number;\n\tlane: \"none\" | \"center-dashed\";\n}\n\n/** Runtime-resolved connector state in a compiled scene stop. */\nexport interface RuntimeConnectorState {\n\tid: string;\n\troute: [number, number][];\n\tlayer: string;\n\tpresence: LifecycleStatus;\n\tstyle: RuntimeConnectorStyle;\n\tstart: ConnectorEndpoint;\n\tend: ConnectorEndpoint;\n\tdirection: ConnectorDirection;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n}\n\n/** Runtime-resolved element state in a compiled scene stop. */\nexport interface RuntimeElementState {\n\tid: string;\n\tasset: string;\n\tpos: [number, number];\n\tsize: number;\n\tlayer: string;\n\tpresence: LifecycleStatus;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n\ttext?: TextContent;\n\tprimitive?: PrimitiveContent;\n}\n\n// ── Type guards ──────────────────────────────────────────────────────────────\n\n/** Narrow a raw string to EntryAnimation. Returns undefined if invalid. */\nexport function guardEntryAnimation(v: unknown): EntryAnimation | undefined {\n\tif (typeof v !== \"string\") return undefined;\n\treturn ENTRY_ANIMATIONS.has(v as EntryAnimation) ? (v as EntryAnimation) : undefined;\n}\n\n/** Narrow a raw string to ExitAnimation. Returns undefined if invalid. */\nexport function guardExitAnimation(v: unknown): ExitAnimation | undefined {\n\tif (typeof v !== \"string\") return undefined;\n\treturn EXIT_ANIMATIONS.has(v as ExitAnimation) ? (v as ExitAnimation) : undefined;\n}\n\n/** Narrow a raw string to LifecycleStatus. Returns undefined if invalid. */\nexport function guardLifecycleStatus(v: unknown): LifecycleStatus | undefined {\n\tif (typeof v !== \"string\") return undefined;\n\treturn LIFECYCLE_STATUSES.has(v as LifecycleStatus) ? (v as LifecycleStatus) : undefined;\n}\n"],"names":[],"mappings":";;;;;AAyBA;AACO,MAAM,gBAAgB,GAAgC,IAAI,GAAG,CAAC;IACpE,SAAS;IACT,cAAc;IACd,SAAS;IACT,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,SAAS;IACT,MAAM;AACN,CAAA,CAAC;AAEF;AACO,MAAM,eAAe,GAA+B,IAAI,GAAG,CAAC;IAClE,UAAU;IACV,iBAAiB;IACjB,qBAAqB;IACrB,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,UAAU;IACV,MAAM;AACN,CAAA,CAAC;AAEF;AACO,MAAM,kBAAkB,GAAiC,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAgTtH;AAEA;AACM,SAAU,mBAAmB,CAAC,CAAU,EAAA;IAC7C,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,SAAS;AAC3C,IAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAmB,CAAC,GAAI,CAAoB,GAAG,SAAS;AACrF;AAEA;AACM,SAAU,kBAAkB,CAAC,CAAU,EAAA;IAC5C,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,SAAS;AAC3C,IAAA,OAAO,eAAe,CAAC,GAAG,CAAC,CAAkB,CAAC,GAAI,CAAmB,GAAG,SAAS;AAClF;AAEA;AACM,SAAU,oBAAoB,CAAC,CAAU,EAAA;IAC9C,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,SAAS;AAC3C,IAAA,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAoB,CAAC,GAAI,CAAqB,GAAG,SAAS;AACzF;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/types/node.ts","../src/runtime/diagnostics-overlay.ts","../src/runtime/export.ts"],"sourcesContent":["/** Entry animation types */\nexport type EntryAnimation =\n\t| \"fade-in\"\n\t| \"fade-in-grow\"\n\t| \"fall-in\"\n\t| \"rise-from-ground\"\n\t| \"slide-in-left\"\n\t| \"slide-in-right\"\n\t| \"flip-in\"\n\t| \"none\";\n\n/** Exit animation types */\nexport type ExitAnimation =\n\t| \"fade-out\"\n\t| \"fade-out-shrink\"\n\t| \"fall-through-ground\"\n\t| \"rise-away\"\n\t| \"slide-out-left\"\n\t| \"slide-out-right\"\n\t| \"flip-out\"\n\t| \"none\";\n\n/** Runtime/compiler-derived lifecycle status. Not authored in YAML. */\nexport type LifecycleStatus = \"entering\" | \"present\" | \"exiting\" | \"removed\";\n\n/** Runtime set of valid entry animation strings */\nexport const ENTRY_ANIMATIONS: ReadonlySet<EntryAnimation> = new Set([\n\t\"fade-in\",\n\t\"fade-in-grow\",\n\t\"fall-in\",\n\t\"rise-from-ground\",\n\t\"slide-in-left\",\n\t\"slide-in-right\",\n\t\"flip-in\",\n\t\"none\",\n]);\n\n/** Runtime set of valid exit animation strings */\nexport const EXIT_ANIMATIONS: ReadonlySet<ExitAnimation> = new Set([\n\t\"fade-out\",\n\t\"fade-out-shrink\",\n\t\"fall-through-ground\",\n\t\"rise-away\",\n\t\"slide-out-left\",\n\t\"slide-out-right\",\n\t\"flip-out\",\n\t\"none\",\n]);\n\n/** Runtime set of valid lifecycle status strings */\nexport const LIFECYCLE_STATUSES: ReadonlySet<LifecycleStatus> = new Set([\"entering\", \"present\", \"exiting\", \"removed\"]);\n\n/** Ambient animation configuration */\nexport interface AmbientAnimation {\n\t/** Animation class name */\n\tname: string;\n\t/** Whether the animation runs infinitely (default: true) */\n\tinfinite?: boolean;\n\t/** Number of times to play (only relevant when infinite: false) */\n\titerations?: number;\n}\n\n/** Camera transition easing curve. */\nexport type CameraEasing = \"linear\" | \"ease-in-out\" | \"ease-out\";\n\n/** Grid-space rectangle used as a camera zoom target. */\nexport interface CameraGridArea {\n\t/** Top-left grid cell of the area. */\n\tat: [number, number];\n\t/** Area size in whole grid cells. */\n\tsize: [number, number];\n}\n\n/** Authored camera focus target: a named element, a grid area, or a reset to the full scene view. */\nexport type CameraTarget = { element: string } | { area: CameraGridArea } | { reset: true };\n\n/** Authored camera focus metadata attached to a scene stop. */\nexport interface CameraFocus {\n\t/** Focus target: an element, a grid area, or a reset to the full scene view. */\n\ttarget: CameraTarget;\n\t/** Extra viewBox padding in grid cells around the target. */\n\tpadding?: number;\n\t/** Camera transition duration in milliseconds. */\n\tduration?: number;\n\t/** Camera transition easing curve. */\n\teasing?: CameraEasing;\n}\n\n/** Options accepted by controller camera zoom methods (`zoomToElement`, `zoomToArea`). */\nexport interface CameraZoomOptions {\n\t/** Extra viewBox padding in grid cells around the target. */\n\tpadding?: number;\n\t/** Camera transition duration in milliseconds. */\n\tduration?: number;\n\t/** Camera transition easing curve. */\n\teasing?: CameraEasing;\n}\n\nexport type RuntimeCameraTarget =\n\t| { type: \"element\"; id: string }\n\t| { type: \"area\"; at: [number, number]; size: [number, number] }\n\t| { type: \"reset\" };\n\nexport interface RuntimeCameraFocus {\n\ttarget: RuntimeCameraTarget;\n\tpadding?: number;\n\tduration?: number;\n\teasing?: CameraEasing;\n}\n\n/** Horizontal anchor used by built-in text elements. */\nexport type TextAlign = \"start\" | \"middle\" | \"end\";\n\n/** Vertical placement model used by built-in text elements. */\nexport type TextPlacement = \"cell\" | \"caption\";\n\n/** Content and safe SVG text styling for the built-in `asset: text` element. */\nexport interface TextContent {\n\t/** Text content. Use newline characters for explicit line breaks. */\n\tvalue: string;\n\t/** Horizontal text anchor within the element cell. Defaults to `middle`. */\n\talign?: TextAlign;\n\t/** Vertical placement within the grid cell. Defaults to `cell`; `caption` preserves the legacy floating label. */\n\tplacement?: TextPlacement;\n\t/** SVG font-size in CSS pixels before element scaling. Defaults to `12`. */\n\tfontSize?: number;\n\t/** SVG font-weight. Defaults to `700`. */\n\tfontWeight?: number | \"normal\" | \"bold\";\n\t/** Multiplier applied to `fontSize` for multiline spacing. Defaults to `1.2`. */\n\tlineHeight?: number;\n\t/** SVG fill color. Defaults to `currentColor`. */\n\tfill?: string;\n}\n\n/** Sparse update payload for built-in text content. */\nexport type TextContentPatch = Partial<TextContent>;\n\n/** Built-in generated primitive asset ids. These are not declared in header assets. */\nexport type PrimitiveAssetId = \"rectangle\" | \"circle\" | \"polygon\" | \"line\";\n\n/** Shared safe SVG style fields for generated primitive assets. */\nexport interface PrimitiveStyle {\n\t/** SVG fill color or safe CSS color token. Defaults to `currentColor`. */\n\tfill?: string;\n\t/** SVG stroke color or safe CSS color token. Defaults to `none`. */\n\tstroke?: string;\n\t/** SVG stroke width in CSS pixels before element scaling. Defaults to `0`. */\n\tstrokeWidth?: number;\n\t/** Element opacity from `0` to `1`. Defaults to `1`. */\n\topacity?: number;\n\t/** Optional dash/gap pair for stroked primitives. */\n\tdash?: [number, number];\n}\n\n/** Generated projected rectangle/diamond primitive content. */\nexport interface RectanglePrimitive extends PrimitiveStyle {\n\t/** Optional corner radius for screen-space rectangles. Defaults to `0`. */\n\trx?: number;\n}\n\n/** Generated circle primitive content. */\nexport interface CirclePrimitive extends PrimitiveStyle {}\n\n/** Generated polygon primitive content using normalized local grid coordinates. */\nexport interface PolygonPrimitive extends PrimitiveStyle {\n\t/** Polygon points in local normalized grid coordinates from `0` to `1`. */\n\tpoints: [number, number][];\n}\n\n/** Generated line/polyline primitive content using normalized local grid coordinates. */\nexport interface LinePrimitive extends Omit<PrimitiveStyle, \"fill\"> {\n\t/** Line points in local normalized grid coordinates from `0` to `1`. */\n\tpoints: [number, number][];\n\t/** SVG line cap. Defaults to `round`. */\n\tlineCap?: \"butt\" | \"round\" | \"square\";\n\t/** SVG line join. Defaults to `round`. */\n\tlineJoin?: \"miter\" | \"round\" | \"bevel\";\n}\n\n/** Element-level payload for generated primitive assets. */\nexport interface PrimitiveContent {\n\trectangle?: RectanglePrimitive;\n\tcircle?: CirclePrimitive;\n\tpolygon?: PolygonPrimitive;\n\tline?: LinePrimitive;\n}\n\n/** Sparse update payload for built-in primitive content. */\nexport interface PrimitiveContentPatch {\n\trectangle?: Partial<RectanglePrimitive>;\n\tcircle?: Partial<CirclePrimitive>;\n\tpolygon?: Partial<PolygonPrimitive>;\n\tline?: Partial<LinePrimitive>;\n}\n\n/** Element placement used in first-scene elements and later add operations. */\nexport interface ElementPlacement {\n\tid: string;\n\tasset: string;\n\tat: [number, number];\n\tsize?: number;\n\tlayer?: string;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n\ttext?: TextContent;\n\tprimitive?: PrimitiveContent;\n}\n\n/** Element patch used by scene update operations. */\nexport interface ElementPatch {\n\tid: string;\n\tat?: [number, number];\n\tsize?: number;\n\tlayer?: string;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n\ttext?: TextContentPatch;\n\tprimitive?: PrimitiveContentPatch;\n}\n\n/** Element removal used by scene remove operations. */\nexport interface ElementRemoval {\n\tid: string;\n\texit?: ExitAnimation;\n}\n\n/** Visual connector line pattern for authored connections and runtime connectors. */\nexport type ConnectorPattern = \"solid\" | \"dashed\" | \"dotted\";\n\n/** Visual connector geometry variant. */\nexport type ConnectorVariant = \"line\" | \"road\";\n\n/** Generated endpoint indicator placed at the start or end of a connector. */\nexport type ConnectorEndpoint = \"none\" | \"arrow\" | \"dot\" | \"circle\" | \"diamond\" | \"bar\";\n\n/** Direction used for connector endpoint orientation and flow animation. */\nexport type ConnectorDirection = \"route\" | \"reverse\";\n\n/** Authored connector style overrides for a visual connection. */\nexport interface ConnectorStyle {\n\t/** Geometry variant. Defaults to `line`. */\n\tvariant?: ConnectorVariant;\n\t/** Stroke pattern. Defaults to `solid`. */\n\tpattern?: ConnectorPattern;\n\t/** SVG stroke color or safe CSS color token. */\n\tstroke?: string;\n\t/** Stroke width in SVG user units. */\n\tstrokeWidth?: number;\n\t/** Connector opacity from `0` to `1`. */\n\topacity?: number;\n\t/** Explicit dash/gap pair in SVG user units. */\n\tdash?: [number, number];\n\t/** Optional outline stroke color for road connectors. */\n\toutline?: string;\n\t/** Optional outline width in SVG user units. */\n\toutlineWidth?: number;\n\t/** Optional road lane treatment. */\n\tlane?: \"none\" | \"center-dashed\";\n}\n\n/** Authored endpoint reference for compiler-routed visual connections. */\nexport interface ConnectorEndpointRef {\n\t/** Element id to attach to. Mutually exclusive with `at`. */\n\telement?: string;\n\t/** Explicit grid point to attach to. Mutually exclusive with `element`. */\n\tat?: [number, number];\n\t/** Element side or automatic side selection. Defaults to `auto`. */\n\tside?: \"auto\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"front\" | \"back\";\n\t/** Normalized side offset from `-0.5` to `0.5`. Defaults to `0`. */\n\toffset?: number;\n}\n\n/** Authored routing options used only by dev-time compiler tooling. */\nexport interface ConnectorRouting {\n\t/** Routing mode. Defaults to `orthogonal` for endpoint-routed connections. */\n\tmode?: \"straight\" | \"orthogonal\" | \"manual\";\n\t/** Obstacle avoidance selection. Defaults to `objects`. */\n\tavoid?: \"objects\" | \"none\" | string[];\n\t/** Obstacle clearance in grid cells. Defaults to `0.5`. */\n\tclearance?: number;\n\t/** Router grid step in grid cells. */\n\tgridStep?: number;\n\t/** Maximum allowed bends for advanced routers. */\n\tmaxBends?: number;\n\t/** Route scoring preference for advanced routers. */\n\tprefer?: \"direct\" | \"fewest-bends\" | \"shortest\";\n}\n\n/** Connection placement used in first-scene connections and later add operations. */\nexport interface ConnectionPlacement {\n\tid: string;\n\troute?: [number, number][];\n\tfrom?: ConnectorEndpointRef;\n\tto?: ConnectorEndpointRef;\n\trouting?: ConnectorRouting;\n\tlayer?: string;\n\tstyle?: ConnectorStyle;\n\tstart?: ConnectorEndpoint;\n\tend?: ConnectorEndpoint;\n\tdirection?: ConnectorDirection;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n}\n\n/** Connection patch used by scene update operations. */\nexport interface ConnectionPatch {\n\tid: string;\n\troute?: [number, number][];\n\tfrom?: ConnectorEndpointRef;\n\tto?: ConnectorEndpointRef;\n\trouting?: ConnectorRouting;\n\tlayer?: string;\n\tstyle?: ConnectorStyle;\n\tstart?: ConnectorEndpoint;\n\tend?: ConnectorEndpoint;\n\tdirection?: ConnectorDirection;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n}\n\n/** Connection removal used by scene remove operations. */\nexport interface ConnectionRemoval {\n\tid: string;\n\texit?: ExitAnimation;\n}\n\n/** Fully defaulted connector style emitted to browser runtime snapshots. */\nexport interface RuntimeConnectorStyle {\n\tvariant: ConnectorVariant;\n\tpattern: ConnectorPattern;\n\tstroke: string;\n\tstrokeWidth: number;\n\topacity: number;\n\tdash?: [number, number];\n\toutline?: string;\n\toutlineWidth: number;\n\tlane: \"none\" | \"center-dashed\";\n}\n\n/** Runtime-resolved connector state in a compiled scene stop. */\nexport interface RuntimeConnectorState {\n\tid: string;\n\troute: [number, number][];\n\tlayer: string;\n\tpresence: LifecycleStatus;\n\tstyle: RuntimeConnectorStyle;\n\tstart: ConnectorEndpoint;\n\tend: ConnectorEndpoint;\n\tdirection: ConnectorDirection;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n}\n\n/** Runtime-resolved element state in a compiled scene stop. */\nexport interface RuntimeElementState {\n\tid: string;\n\tasset: string;\n\tpos: [number, number];\n\tsize: number;\n\tlayer: string;\n\tpresence: LifecycleStatus;\n\tenter?: EntryAnimation;\n\texit?: ExitAnimation;\n\tambient?: AmbientAnimation[];\n\ttext?: TextContent;\n\tprimitive?: PrimitiveContent;\n}\n\n// ── Type guards ──────────────────────────────────────────────────────────────\n\n/** Narrow a raw string to EntryAnimation. Returns undefined if invalid. */\nexport function guardEntryAnimation(v: unknown): EntryAnimation | undefined {\n\tif (typeof v !== \"string\") return undefined;\n\treturn ENTRY_ANIMATIONS.has(v as EntryAnimation) ? (v as EntryAnimation) : undefined;\n}\n\n/** Narrow a raw string to ExitAnimation. Returns undefined if invalid. */\nexport function guardExitAnimation(v: unknown): ExitAnimation | undefined {\n\tif (typeof v !== \"string\") return undefined;\n\treturn EXIT_ANIMATIONS.has(v as ExitAnimation) ? (v as ExitAnimation) : undefined;\n}\n\n/** Narrow a raw string to LifecycleStatus. Returns undefined if invalid. */\nexport function guardLifecycleStatus(v: unknown): LifecycleStatus | undefined {\n\tif (typeof v !== \"string\") return undefined;\n\treturn LIFECYCLE_STATUSES.has(v as LifecycleStatus) ? (v as LifecycleStatus) : undefined;\n}\n","import { getResolvedProjectionLayout, getResolvedViewBox } from \"../rendering/rendering-engine.ts\";\nimport { RenderError } from \"../types/errors.ts\";\nimport type { RuntimeBundle } from \"../types/runtime-bundle.ts\";\nimport { projectToScreen } from \"../utils/projection.ts\";\nimport type { MountedScene } from \"./mount-scene.ts\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\nconst DIAGNOSTICS_ATTR = \"data-iso-diagnostics\";\n\nconst GRID_STROKE = \"var(--iso-diag-grid, rgba(37, 99, 235, 0.35))\";\nconst TEXT_FILL = \"var(--iso-diag-text, #1e3a8a)\";\nconst ANCHOR_FILL = \"var(--iso-diag-anchor, #dc2626)\";\nconst ROUTE_FILL = \"var(--iso-diag-route, #059669)\";\n\n/** Options accepted by {@link attachDiagnosticsOverlay}. */\nexport interface DiagnosticsOverlayOptions {\n\t/** Draw grid lines across the floor extent. Default: true. */\n\tgrid?: boolean;\n\t/** Draw cell coordinate labels at whole-cell intersections. Default: false. */\n\tcoordinates?: boolean;\n\t/** Mark element anchor points. Default: true. */\n\tanchors?: boolean;\n\t/** Mark connector route points. Default: true. */\n\troutes?: boolean;\n\t/** Show the scene id / progress readout panel. Default: true. */\n\treadout?: boolean;\n}\n\n/** Handle returned by {@link attachDiagnosticsOverlay} to refresh or remove the overlay. */\nexport interface DiagnosticsOverlayHandle {\n\t/** Re-render the overlay from current scene state. */\n\tupdate(): void;\n\t/** Remove the overlay and its subscriptions. Safe to call twice. */\n\tdestroy(): void;\n}\n\n/** Tracks the single live overlay per mounted SVG so a second attach can retire the first. */\ninterface OverlayRegistry {\n\tcurrent?: { token: symbol; handle: DiagnosticsOverlayHandle };\n}\n\nconst registryBySvg = new WeakMap<SVGSVGElement, OverlayRegistry>();\n\n/**\n * Attach a development-time diagnostics overlay (grid, coordinates, element\n * anchors, connector route points, and a scene/progress readout) to a mounted\n * scene. See `specs/02-capabilities/diagnostics-overlay.md` for the full\n * normative behavior.\n */\nexport function attachDiagnosticsOverlay(\n\tmounted: MountedScene,\n\toptions: DiagnosticsOverlayOptions = {},\n): DiagnosticsOverlayHandle {\n\tassertMounted(mounted);\n\n\tconst registry = registryBySvg.get(mounted.svg) ?? {};\n\tregistryBySvg.set(mounted.svg, registry);\n\n\t// Replace any previously attached overlay: retire its token so its\n\t// `update()`/`destroy()` become no-ops, then remove its DOM group.\n\tregistry.current?.handle.destroy();\n\n\tconst token = Symbol(\"diagnostics-overlay\");\n\tconst group = document.createElementNS(SVG_NS, \"g\") as SVGGElement;\n\tgroup.setAttribute(DIAGNOSTICS_ATTR, \"\");\n\tmounted.svg.appendChild(group);\n\n\tconst render = (): void => renderOverlay(group, mounted, options);\n\trender();\n\n\tconst unsubscribe = subscribeToLiveUpdates(mounted, render);\n\tconst isCurrent = (): boolean => registry.current?.token === token;\n\n\tconst handle: DiagnosticsOverlayHandle = {\n\t\tupdate(): void {\n\t\t\tif (!isCurrent()) return;\n\t\t\trender();\n\t\t},\n\t\tdestroy(): void {\n\t\t\tif (!isCurrent()) return;\n\t\t\tunsubscribe();\n\t\t\tgroup.parentNode?.removeChild(group);\n\t\t\tregistry.current = undefined;\n\t\t},\n\t};\n\n\tregistry.current = { token, handle };\n\treturn handle;\n}\n\nfunction assertMounted(mounted: MountedScene): void {\n\tif (!mounted.svg.isConnected) {\n\t\tthrow new RenderError(\"MOUNT_DESTROYED\", \"Cannot attach a diagnostics overlay to a destroyed mount\");\n\t}\n}\n\n/**\n * When the mount has a controller, re-render on `progress-change` and\n * `camera-change` so the overlay tracks live scroll/camera state. Without a\n * controller, consumers call `update()` manually — returns a no-op teardown.\n */\nfunction subscribeToLiveUpdates(mounted: MountedScene, render: () => void): () => void {\n\tconst controller = mounted.controller;\n\tif (!controller) return () => undefined;\n\n\tconst onProgressChange = (): void => render();\n\tconst onCameraChange = (): void => render();\n\tcontroller.on(\"progress-change\", onProgressChange);\n\tcontroller.on(\"camera-change\", onCameraChange);\n\n\treturn () => {\n\t\tcontroller.off(\"progress-change\", onProgressChange);\n\t\tcontroller.off(\"camera-change\", onCameraChange);\n\t};\n}\n\n// ── Rendering ────────────────────────────────────────────────────────────────\n\nfunction renderOverlay(group: SVGGElement, mounted: MountedScene, options: DiagnosticsOverlayOptions): void {\n\tclearChildren(group);\n\n\tconst bundle = mounted.engine.bundle;\n\tif (!bundle) return;\n\n\tconst layout = getResolvedProjectionLayout(bundle);\n\tconst project = (x: number, y: number): { x: number; y: number } => {\n\t\tconst screen = projectToScreen(\n\t\t\tx,\n\t\t\ty,\n\t\t\tlayout.cellSize,\n\t\t\tlayout.selectedBounds.minX,\n\t\t\tlayout.selectedBounds.minY,\n\t\t\tlayout.padding.x,\n\t\t\tlayout.padding.y,\n\t\t);\n\t\treturn { x: screen.screenX, y: screen.screenY };\n\t};\n\n\tconst showGrid = options.grid ?? true;\n\tconst showCoordinates = options.coordinates ?? false;\n\tconst showAnchors = options.anchors ?? true;\n\tconst showRoutes = options.routes ?? true;\n\tconst showReadout = options.readout ?? true;\n\n\tif (showGrid) appendGrid(group, bundle, project);\n\tif (showCoordinates) appendCoordinates(group, bundle, project);\n\tif (showAnchors) appendAnchors(group, mounted, project);\n\tif (showRoutes) appendRoutes(group, mounted, project);\n\tif (showReadout) appendReadout(group, mounted, bundle);\n}\n\nfunction appendGrid(\n\tgroup: SVGGElement,\n\tbundle: RuntimeBundle,\n\tproject: (x: number, y: number) => { x: number; y: number },\n): void {\n\tconst [originX, originY] = bundle.floor.origin;\n\tconst [columns, rows] = bundle.floor.size;\n\n\tfor (let x = 0; x <= columns; x++) {\n\t\tappendGridLine(group, project(originX + x, originY), project(originX + x, originY + rows));\n\t}\n\tfor (let y = 0; y <= rows; y++) {\n\t\tappendGridLine(group, project(originX, originY + y), project(originX + columns, originY + y));\n\t}\n}\n\nfunction appendGridLine(group: SVGGElement, start: { x: number; y: number }, end: { x: number; y: number }): void {\n\tconst path = document.createElementNS(SVG_NS, \"path\") as SVGPathElement;\n\tpath.setAttribute(\"d\", `M ${start.x} ${start.y} L ${end.x} ${end.y}`);\n\tpath.setAttribute(\"stroke\", GRID_STROKE);\n\tpath.setAttribute(\"stroke-width\", \"1\");\n\tpath.setAttribute(\"fill\", \"none\");\n\tpath.setAttribute(\"vector-effect\", \"non-scaling-stroke\");\n\tgroup.appendChild(path);\n}\n\nfunction appendCoordinates(\n\tgroup: SVGGElement,\n\tbundle: RuntimeBundle,\n\tproject: (x: number, y: number) => { x: number; y: number },\n): void {\n\tconst [originX, originY] = bundle.floor.origin;\n\tconst [columns, rows] = bundle.floor.size;\n\n\tfor (let x = 0; x <= columns; x++) {\n\t\tfor (let y = 0; y <= rows; y++) {\n\t\t\tconst gridX = originX + x;\n\t\t\tconst gridY = originY + y;\n\t\t\tconst point = project(gridX, gridY);\n\t\t\tconst text = document.createElementNS(SVG_NS, \"text\") as SVGTextElement;\n\t\t\ttext.setAttribute(\"x\", String(point.x));\n\t\t\ttext.setAttribute(\"y\", String(point.y));\n\t\t\ttext.setAttribute(\"font-size\", \"8\");\n\t\t\ttext.setAttribute(\"fill\", TEXT_FILL);\n\t\t\ttext.textContent = `${gridX},${gridY}`;\n\t\t\tgroup.appendChild(text);\n\t\t}\n\t}\n}\n\nfunction appendAnchors(\n\tgroup: SVGGElement,\n\tmounted: MountedScene,\n\tproject: (x: number, y: number) => { x: number; y: number },\n): void {\n\tfor (const element of mounted.engine.getFrameUpdates()) {\n\t\tif (element.lifecycle === \"removed\") continue;\n\t\t// The element's anchor is the node's local transform origin, which the\n\t\t// renderer always places at `projectToScreen(pos + size, ...)` — see\n\t\t// `applyElementTransform()` in rendering-engine.ts. No separate anchor\n\t\t// ratio math is needed here to locate the point itself.\n\t\tconst point = project(element.pos[0] + element.size, element.pos[1] + element.size);\n\t\tconst circle = document.createElementNS(SVG_NS, \"circle\") as SVGCircleElement;\n\t\tcircle.setAttribute(\"cx\", String(point.x));\n\t\tcircle.setAttribute(\"cy\", String(point.y));\n\t\tcircle.setAttribute(\"r\", \"3\");\n\t\tcircle.setAttribute(\"fill\", ANCHOR_FILL);\n\t\tgroup.appendChild(circle);\n\t}\n}\n\nfunction appendRoutes(\n\tgroup: SVGGElement,\n\tmounted: MountedScene,\n\tproject: (x: number, y: number) => { x: number; y: number },\n): void {\n\tfor (const connector of mounted.engine.getConnectorFrameUpdates()) {\n\t\tif (connector.lifecycle === \"removed\") continue;\n\t\tfor (const [x, y] of connector.route) {\n\t\t\tconst point = project(x, y);\n\t\t\tconst rect = document.createElementNS(SVG_NS, \"rect\") as SVGRectElement;\n\t\t\trect.setAttribute(\"x\", String(point.x - 2));\n\t\t\trect.setAttribute(\"y\", String(point.y - 2));\n\t\t\trect.setAttribute(\"width\", \"4\");\n\t\t\trect.setAttribute(\"height\", \"4\");\n\t\t\trect.setAttribute(\"fill\", ROUTE_FILL);\n\t\t\tgroup.appendChild(rect);\n\t\t}\n\t}\n}\n\nfunction appendReadout(group: SVGGElement, mounted: MountedScene, bundle: RuntimeBundle): void {\n\tconst viewBox = mounted.controller ? mounted.controller.getCameraState().viewBox : getResolvedViewBox(bundle);\n\tconst progress = mounted.controller ? mounted.controller.getProgress() : mounted.engine.getProgress();\n\t// Resolved from the engine's own progress-to-stop mapping (not\n\t// `controller.currentScene`, which only advances on explicit scene\n\t// navigation and would go stale under scroll-driven progress changes).\n\tconst sceneId = mounted.controller ? mounted.engine.getCurrentState()?.id : undefined;\n\n\tconst text = document.createElementNS(SVG_NS, \"text\") as SVGTextElement;\n\ttext.setAttribute(\"x\", String(viewBox.minX + 4));\n\ttext.setAttribute(\"y\", String(viewBox.minY + 10));\n\ttext.setAttribute(\"font-size\", \"10\");\n\ttext.setAttribute(\"fill\", TEXT_FILL);\n\ttext.textContent = sceneId\n\t\t? `scene ${sceneId} · progress ${roundProgress(progress)}`\n\t\t: `progress ${roundProgress(progress)}`;\n\tgroup.appendChild(text);\n}\n\nfunction roundProgress(progress: number): number {\n\treturn Math.round(progress * 1000) / 1000;\n}\n\nfunction clearChildren(node: SVGElement): void {\n\twhile (node.firstChild) node.removeChild(node.firstChild);\n}\n","import {\n\tgetConnectorState,\n\tgetElementState,\n\thideElementAfterExit,\n\tunhideElementOnReadd,\n\tupdateElementTransforms,\n} from \"../rendering/rendering-engine.ts\";\nimport { RenderError } from \"../types/errors.ts\";\nimport type { RuntimeConnectorState, RuntimeElementState } from \"../types/node.ts\";\nimport type { MountedScene } from \"./mount-scene.ts\";\n\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nconst XLINK_NAMESPACE = \"http://www.w3.org/1999/xlink\";\nconst DIAGNOSTICS_OVERLAY_SELECTOR = \"[data-iso-diagnostics]\";\n\n/** Options accepted by {@link exportSceneSvg} and, via extension, {@link exportScenePng}. */\nexport interface SnapshotOptions {\n\t/** Progress to render before serializing. Omitted = current progress. */\n\tprogress?: number;\n\t/** Inline external `<image>` hrefs as `data:` URIs. Default: `true`. */\n\tinlineAssets?: boolean;\n\t/** Solid background color (any CSS color). Default: none (transparent). */\n\tbackground?: string;\n}\n\n/** Options accepted by {@link exportScenePng}. */\nexport interface PngSnapshotOptions extends SnapshotOptions {\n\t/** Device-pixel multiplier applied to the viewBox size. Default: `2`. */\n\tscale?: number;\n}\n\n/**\n * Serialize a mounted scene to a standalone SVG document string.\n *\n * The exported SVG carries the runtime stylesheet and current visual state\n * as-is. Ambient/entry/exit CSS animations are not restarted or awaited by\n * the export; the snapshot reflects the un-animated base state at the\n * resolved progress.\n */\nexport async function exportSceneSvg(mounted: MountedScene, options: SnapshotOptions = {}): Promise<string> {\n\tassertNotDestroyed(mounted);\n\tassertValidSnapshotOptions(options);\n\n\treturn withRestoredProgress(mounted, options.progress, async () => {\n\t\tconst clone = prepareClone(mounted.svg, options);\n\t\tif (options.inlineAssets ?? true) {\n\t\t\tawait inlineImageAssets(clone);\n\t\t}\n\t\treturn serializeSvg(clone);\n\t});\n}\n\n/** Rasterize a mounted scene to a PNG blob. */\nexport async function exportScenePng(mounted: MountedScene, options: PngSnapshotOptions = {}): Promise<Blob> {\n\tassertNotDestroyed(mounted);\n\tassertValidPngSnapshotOptions(options);\n\tconst scale = options.scale ?? 2;\n\n\treturn withRestoredProgress(mounted, options.progress, async () => {\n\t\tconst clone = prepareClone(mounted.svg, options);\n\t\t// PNG export always inlines assets: external hrefs taint or fail canvas rasterization.\n\t\tawait inlineImageAssets(clone);\n\t\tconst svgString = serializeSvg(clone);\n\t\tconst viewBox = readViewBox(clone);\n\t\treturn rasterize(svgString, viewBox, scale);\n\t});\n}\n\n// ── Shared step 1-3: destroyed check, option validation, progress restore ──\n\nfunction assertNotDestroyed(mounted: MountedScene): void {\n\tif (!mounted.svg.isConnected) {\n\t\tthrow new RenderError(\"EXPORT_TARGET_DESTROYED\", \"Cannot export a scene whose mount was destroyed\");\n\t}\n}\n\nfunction assertValidSnapshotOptions(options: SnapshotOptions): void {\n\tif (options.progress !== undefined && !isValidProgress(options.progress)) {\n\t\tthrow new RenderError(\"EXPORT_INVALID_OPTIONS\", \"progress must be a finite number within [0, 1]\", {\n\t\t\tprogress: options.progress,\n\t\t});\n\t}\n}\n\nfunction assertValidPngSnapshotOptions(options: PngSnapshotOptions): void {\n\tassertValidSnapshotOptions(options);\n\tif (options.scale !== undefined && !isValidScale(options.scale)) {\n\t\tthrow new RenderError(\"EXPORT_INVALID_OPTIONS\", \"scale must be a finite number greater than 0\", {\n\t\t\tscale: options.scale,\n\t\t});\n\t}\n\tif (options.inlineAssets === false) {\n\t\tthrow new RenderError(\n\t\t\t\"EXPORT_INVALID_OPTIONS\",\n\t\t\t\"exportScenePng() always inlines assets; inlineAssets: false is unsupported for PNG export\",\n\t\t);\n\t}\n}\n\nfunction isValidProgress(progress: number): boolean {\n\treturn Number.isFinite(progress) && progress >= 0 && progress <= 1;\n}\n\nfunction isValidScale(scale: number): boolean {\n\treturn Number.isFinite(scale) && scale > 0;\n}\n\n/**\n * Runs `run` at the requested `progress`, restoring the engine's prior\n * progress afterwards on every code path (success or rejection). When\n * `progress` is omitted, `run` executes at the scene's current progress and\n * no restoration is needed.\n */\nasync function withRestoredProgress<T>(\n\tmounted: MountedScene,\n\tprogress: number | undefined,\n\trun: () => Promise<T>,\n): Promise<T> {\n\tif (progress === undefined) {\n\t\treturn run();\n\t}\n\n\tconst previousProgress = mounted.engine.getProgress();\n\ttry {\n\t\tmounted.engine.setProgress(progress);\n\t\tapplyControllerFrame(mounted);\n\t\treturn await run();\n\t} finally {\n\t\tmounted.engine.setProgress(previousProgress);\n\t\tapplyControllerFrame(mounted);\n\t}\n}\n\n/**\n * Applies the engine's current frame to the live SVG so DOM state (element\n * transforms, generated content, connector routes, and lifecycle visibility)\n * matches the engine's resolved progress. Mirrors the non-animated portion of\n * `AnimationController`'s frame-apply path: transforms/content via\n * `updateElementTransforms()`, plus visibility driven by the resolved\n * lifecycle state. CSS entry/exit animation classes are intentionally not\n * (re)triggered here, matching the spec's requirement that ambient/entry\n * animations are irrelevant to export output.\n */\nfunction applyControllerFrame(mounted: MountedScene): void {\n\tconst svg = mounted.svg;\n\tconst elementUpdates = mounted.engine.getFrameUpdates().map(\n\t\t(update): RuntimeElementState => ({\n\t\t\tid: update.id,\n\t\t\tasset: update.asset,\n\t\t\tpos: update.pos,\n\t\t\tsize: update.size,\n\t\t\tlayer: update.layer,\n\t\t\tpresence: update.lifecycle,\n\t\t\tenter: update.entry as RuntimeElementState[\"enter\"],\n\t\t\texit: update.exit as RuntimeElementState[\"exit\"],\n\t\t\tambient: update.ambient,\n\t\t\ttext: update.text,\n\t\t\tprimitive: update.primitive,\n\t\t}),\n\t);\n\tconst connectorUpdates = mounted.engine.getConnectorFrameUpdates().map(\n\t\t(update): RuntimeConnectorState => ({\n\t\t\tid: update.id,\n\t\t\troute: update.route,\n\t\t\tlayer: update.layer,\n\t\t\tpresence: update.lifecycle,\n\t\t\tstyle: update.style,\n\t\t\tstart: update.start,\n\t\t\tend: update.end,\n\t\t\tdirection: update.direction,\n\t\t\tenter: update.entry as RuntimeConnectorState[\"enter\"],\n\t\t\texit: update.exit as RuntimeConnectorState[\"exit\"],\n\t\t\tambient: update.ambient,\n\t\t}),\n\t);\n\n\tupdateElementTransforms(svg, elementUpdates, connectorUpdates);\n\tapplyElementVisibility(svg, elementUpdates);\n\tapplyConnectorVisibility(svg, connectorUpdates);\n}\n\nfunction applyElementVisibility(svg: SVGSVGElement, elements: RuntimeElementState[]): void {\n\tfor (const element of elements) {\n\t\tconst state = getElementState(svg, element.id);\n\t\tif (!state) continue;\n\t\tif (element.presence === \"removed\") {\n\t\t\tstate.isHidden = true;\n\t\t\thideElementAfterExit(state.node);\n\t\t} else if (state.isHidden) {\n\t\t\tstate.isHidden = false;\n\t\t\tunhideElementOnReadd(state.node);\n\t\t}\n\t}\n}\n\nfunction applyConnectorVisibility(svg: SVGSVGElement, connectors: RuntimeConnectorState[]): void {\n\tfor (const connector of connectors) {\n\t\tconst state = getConnectorState(svg, connector.id);\n\t\tif (!state) continue;\n\t\tif (connector.presence === \"removed\") {\n\t\t\tstate.isHidden = true;\n\t\t\thideElementAfterExit(state.node);\n\t\t} else if (state.isHidden) {\n\t\t\tstate.isHidden = false;\n\t\t\tunhideElementOnReadd(state.node);\n\t\t}\n\t}\n}\n\n// ── Step 4-5: clone and prepare ────────────────────────────────────────────\n\nfunction prepareClone(svg: SVGSVGElement, options: SnapshotOptions): SVGSVGElement {\n\tconst clone = svg.cloneNode(true) as SVGSVGElement;\n\tconst viewBox = readViewBox(clone);\n\n\tclone.setAttribute(\"width\", String(viewBox.width));\n\tclone.setAttribute(\"height\", String(viewBox.height));\n\tclone.setAttribute(\"xmlns\", SVG_NAMESPACE);\n\tclone.setAttribute(\"xmlns:xlink\", XLINK_NAMESPACE);\n\n\tif (options.background) {\n\t\tconst rect = document.createElementNS(SVG_NAMESPACE, \"rect\");\n\t\trect.setAttribute(\"x\", String(viewBox.minX));\n\t\trect.setAttribute(\"y\", String(viewBox.minY));\n\t\trect.setAttribute(\"width\", String(viewBox.width));\n\t\trect.setAttribute(\"height\", String(viewBox.height));\n\t\trect.setAttribute(\"fill\", options.background);\n\t\tinsertAsFirstChild(clone, rect);\n\t}\n\n\tconst diagnosticsOverlay = clone.querySelector(DIAGNOSTICS_OVERLAY_SELECTOR);\n\tdiagnosticsOverlay?.parentNode?.removeChild(diagnosticsOverlay);\n\n\treturn clone;\n}\n\nfunction insertAsFirstChild(parent: SVGSVGElement, child: SVGElement): void {\n\tif (parent.firstChild) {\n\t\tparent.insertBefore(child, parent.firstChild);\n\t} else {\n\t\tparent.appendChild(child);\n\t}\n}\n\nfunction readViewBox(svg: SVGSVGElement): { minX: number; minY: number; width: number; height: number } {\n\tconst raw = svg.getAttribute(\"viewBox\");\n\tconst parts = (raw ?? \"\").trim().split(/\\s+/).map(Number);\n\tif (parts.length !== 4 || parts.some((part) => !Number.isFinite(part))) {\n\t\treturn { minX: 0, minY: 0, width: 0, height: 0 };\n\t}\n\tconst [minX, minY, width, height] = parts as [number, number, number, number];\n\treturn { minX, minY, width, height };\n}\n\n// ── Step 6: asset inlining ──────────────────────────────────────────────────\n\nasync function inlineImageAssets(clone: SVGSVGElement): Promise<void> {\n\tconst images = [...clone.querySelectorAll(\"image\")] as SVGImageElement[];\n\tawait Promise.all(images.map((image) => inlineImageHref(image)));\n}\n\nasync function inlineImageHref(image: SVGImageElement): Promise<void> {\n\tconst href = image.getAttribute(\"href\") ?? image.getAttributeNS(XLINK_NAMESPACE, \"href\");\n\tif (!href || href.startsWith(\"data:\")) return;\n\n\tconst dataUri = await fetchAsDataUri(href);\n\timage.setAttribute(\"href\", dataUri);\n\timage.setAttributeNS(XLINK_NAMESPACE, \"href\", dataUri);\n}\n\nasync function fetchAsDataUri(url: string): Promise<string> {\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(url);\n\t} catch {\n\t\tthrow new RenderError(\"EXPORT_ASSET_FETCH_FAILED\", `Failed to fetch asset for inlining: ${url}`, { url });\n\t}\n\tif (!response.ok) {\n\t\tthrow new RenderError(\"EXPORT_ASSET_FETCH_FAILED\", `Failed to fetch asset for inlining: ${url}`, { url });\n\t}\n\n\tconst contentType = response.headers.get(\"content-type\") ?? \"application/octet-stream\";\n\tconst buffer = await response.arrayBuffer();\n\treturn `data:${contentType};base64,${arrayBufferToBase64(buffer)}`;\n}\n\nfunction arrayBufferToBase64(buffer: ArrayBuffer): string {\n\tlet binary = \"\";\n\tconst bytes = new Uint8Array(buffer);\n\tfor (const byte of bytes) binary += String.fromCharCode(byte);\n\treturn btoa(binary);\n}\n\n// ── Step 7: SVG serialization ───────────────────────────────────────────────\n\nfunction serializeSvg(clone: SVGSVGElement): string {\n\tconst serializer = new XMLSerializer();\n\treturn `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n${serializer.serializeToString(clone)}`;\n}\n\n// ── Step 8: PNG rasterization ────────────────────────────────────────────────\n\nasync function rasterize(svgString: string, viewBox: { width: number; height: number }, scale: number): Promise<Blob> {\n\tconst width = Math.ceil(viewBox.width * scale);\n\tconst height = Math.ceil(viewBox.height * scale);\n\n\tconst svgBlob = new Blob([svgString], { type: \"image/svg+xml\" });\n\tconst objectUrl = URL.createObjectURL(svgBlob);\n\ttry {\n\t\tconst image = await loadImage(objectUrl);\n\n\t\tconst canvas = document.createElement(\"canvas\") as HTMLCanvasElement;\n\t\tcanvas.width = width;\n\t\tcanvas.height = height;\n\t\tconst context = canvas.getContext(\"2d\");\n\t\tif (!context) {\n\t\t\tthrow new RenderError(\"EXPORT_RASTERIZE_FAILED\", \"Canvas 2D context is unavailable\");\n\t\t}\n\t\tcontext.drawImage(image, 0, 0, width, height);\n\n\t\tconst blob = await new Promise<Blob | null>((resolve) => {\n\t\t\tcanvas.toBlob(resolve, \"image/png\");\n\t\t});\n\t\tif (!blob) {\n\t\t\tthrow new RenderError(\"EXPORT_RASTERIZE_FAILED\", \"Canvas failed to encode PNG output\");\n\t\t}\n\t\treturn blob;\n\t} finally {\n\t\tURL.revokeObjectURL(objectUrl);\n\t}\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst image = new Image();\n\t\timage.onload = () => resolve(image);\n\t\timage.onerror = () =>\n\t\t\treject(new RenderError(\"EXPORT_RASTERIZE_FAILED\", \"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-
{"version":3,"file":"animation-css.d.ts","sourceRoot":"","sources":["../../src/rendering/animation-css.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,wBAAgB,gBAAgB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"animation-css.d.ts","sourceRoot":"","sources":["../../src/rendering/animation-css.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,wBAAgB,gBAAgB,IAAI,MAAM,CAoCzC"}
|