@elucim/dsl 0.5.0 → 0.7.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 +58 -3
- package/dist/index.d.ts +11 -0
- package/dist/index.js +529 -458
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
const
|
|
1
|
+
import { easeOutBounce as he, easeOutElastic as fe, easeOutBack as oe, easeInBack as ge, easeInOutExpo as me, easeOutExpo as ye, easeInExpo as be, easeInOutSine as xe, easeOutSine as ve, easeInSine as de, easeInOutQuart as we, easeOutQuart as ke, easeInQuart as Ie, easeInOutCubic as Se, easeOutCubic as $e, easeInCubic as Oe, easeInOutQuad as Ae, easeOutQuad as Ce, easeInQuad as ze, linear as pe, spring as Ee, cubicBezier as Re, Presentation as Fe, Scene as Pe, Player as Te, Slide as Me, Parallel as Ne, Stagger as _e, Morph as De, Transform as We, Write as Ve, Draw as Le, FadeOut as je, FadeIn as qe, BarChart as Be, LaTeX as Ue, Graph as He, Matrix as Ge, Text as L, VectorField as Ke, Vector as Qe, FunctionPlot as Xe, Axes as Je, Image as Ye, Polygon as Ze, Rect as et, Arrow as tt, Line as at, Circle as rt, BezierCurve as it, Group as nt, Sequence as st } from "@elucim/core";
|
|
2
|
+
import { jsx as c, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
import Q, { forwardRef as ct, useRef as lt, useImperativeHandle as ut, useSyncExternalStore as ht } from "react";
|
|
4
|
+
import { renderToStaticMarkup as ft } from "react-dom/server";
|
|
5
|
+
const B = {
|
|
6
6
|
sin: Math.sin,
|
|
7
7
|
cos: Math.cos,
|
|
8
8
|
tan: Math.tan,
|
|
@@ -22,12 +22,12 @@ const V = {
|
|
|
22
22
|
max: (...e) => Math.max(...e),
|
|
23
23
|
sign: Math.sign,
|
|
24
24
|
pow: Math.pow
|
|
25
|
-
},
|
|
25
|
+
}, X = {
|
|
26
26
|
PI: Math.PI,
|
|
27
27
|
E: Math.E,
|
|
28
28
|
TAU: Math.PI * 2
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function G(e) {
|
|
31
31
|
const a = [];
|
|
32
32
|
let t = 0;
|
|
33
33
|
for (; t < e.length; ) {
|
|
@@ -38,18 +38,18 @@ function q(e) {
|
|
|
38
38
|
}
|
|
39
39
|
if (/[0-9]/.test(r) || r === "." && t + 1 < e.length && /[0-9]/.test(e[t + 1])) {
|
|
40
40
|
let n = "";
|
|
41
|
-
const
|
|
41
|
+
const s = t;
|
|
42
42
|
for (; t < e.length && /[0-9.]/.test(e[t]); )
|
|
43
43
|
n += e[t++];
|
|
44
|
-
a.push({ type: "NUMBER", value: n, pos:
|
|
44
|
+
a.push({ type: "NUMBER", value: n, pos: s });
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
47
|
if (/[a-zA-Z_]/.test(r)) {
|
|
48
48
|
let n = "";
|
|
49
|
-
const
|
|
49
|
+
const s = t;
|
|
50
50
|
for (; t < e.length && /[a-zA-Z0-9_]/.test(e[t]); )
|
|
51
51
|
n += e[t++];
|
|
52
|
-
a.push({ type: "IDENT", value: n, pos:
|
|
52
|
+
a.push({ type: "IDENT", value: n, pos: s });
|
|
53
53
|
continue;
|
|
54
54
|
}
|
|
55
55
|
const i = t;
|
|
@@ -85,12 +85,12 @@ function q(e) {
|
|
|
85
85
|
a.push({ type: "COMMA", value: ",", pos: i });
|
|
86
86
|
break;
|
|
87
87
|
default:
|
|
88
|
-
throw new
|
|
88
|
+
throw new S(`Unexpected character '${r}'`, i);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return a.push({ type: "EOF", value: "", pos: t }), a;
|
|
92
92
|
}
|
|
93
|
-
class
|
|
93
|
+
class K {
|
|
94
94
|
constructor(a) {
|
|
95
95
|
this.pos = 0, this.tokens = a;
|
|
96
96
|
}
|
|
@@ -104,7 +104,7 @@ class B {
|
|
|
104
104
|
expect(a) {
|
|
105
105
|
const t = this.peek();
|
|
106
106
|
if (t.type !== a)
|
|
107
|
-
throw new
|
|
107
|
+
throw new S(
|
|
108
108
|
`Expected ${a} but got ${t.type} ('${t.value}')`,
|
|
109
109
|
t.pos
|
|
110
110
|
);
|
|
@@ -115,7 +115,7 @@ class B {
|
|
|
115
115
|
const a = this.parseExpression();
|
|
116
116
|
if (this.peek().type !== "EOF") {
|
|
117
117
|
const t = this.peek();
|
|
118
|
-
throw new
|
|
118
|
+
throw new S(
|
|
119
119
|
`Unexpected token '${t.value}' after expression`,
|
|
120
120
|
t.pos
|
|
121
121
|
);
|
|
@@ -168,14 +168,14 @@ class B {
|
|
|
168
168
|
if (this.peek().type !== "RPAREN")
|
|
169
169
|
for (r.push(this.parseExpression()); this.peek().type === "COMMA"; )
|
|
170
170
|
this.advance(), r.push(this.parseExpression());
|
|
171
|
-
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(
|
|
172
|
-
throw new
|
|
173
|
-
`Unknown function '${t}'. Available: ${Object.keys(
|
|
171
|
+
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(B, t))
|
|
172
|
+
throw new S(
|
|
173
|
+
`Unknown function '${t}'. Available: ${Object.keys(B).join(", ")}`,
|
|
174
174
|
a.pos
|
|
175
175
|
);
|
|
176
176
|
return { kind: "call", name: t, args: r };
|
|
177
177
|
}
|
|
178
|
-
return Object.prototype.hasOwnProperty.call(
|
|
178
|
+
return Object.prototype.hasOwnProperty.call(X, t) ? { kind: "number", value: X[t] } : { kind: "variable", name: t };
|
|
179
179
|
}
|
|
180
180
|
if (a.type === "LPAREN") {
|
|
181
181
|
this.advance();
|
|
@@ -190,7 +190,7 @@ class B {
|
|
|
190
190
|
this.advance(), t.push(this.parseExpression());
|
|
191
191
|
return this.expect("RBRACKET"), { kind: "array", elements: t };
|
|
192
192
|
}
|
|
193
|
-
throw new
|
|
193
|
+
throw new S(
|
|
194
194
|
`Unexpected token '${a.value}'`,
|
|
195
195
|
a.pos
|
|
196
196
|
);
|
|
@@ -202,7 +202,7 @@ function z(e, a) {
|
|
|
202
202
|
return e.value;
|
|
203
203
|
case "variable":
|
|
204
204
|
if (Object.prototype.hasOwnProperty.call(a, e.name)) return a[e.name];
|
|
205
|
-
throw new
|
|
205
|
+
throw new S(`Unknown variable '${e.name}'`, 0);
|
|
206
206
|
case "unary":
|
|
207
207
|
const t = z(e.operand, a);
|
|
208
208
|
return e.op === "-" ? -t : t;
|
|
@@ -223,95 +223,95 @@ function z(e, a) {
|
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
225
|
case "call": {
|
|
226
|
-
const r =
|
|
226
|
+
const r = B[e.name], i = e.args.map((n) => z(n, a));
|
|
227
227
|
return r(...i);
|
|
228
228
|
}
|
|
229
229
|
case "array":
|
|
230
230
|
return e.elements.map((r) => z(r, a));
|
|
231
231
|
}
|
|
232
|
-
throw new
|
|
232
|
+
throw new S("Invalid AST node", 0);
|
|
233
233
|
}
|
|
234
|
-
class
|
|
234
|
+
class S extends Error {
|
|
235
235
|
constructor(a, t) {
|
|
236
236
|
super(a), this.name = "ExpressionError", this.position = t;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
const a =
|
|
239
|
+
function ot(e) {
|
|
240
|
+
const a = G(e), t = new K(a).parse();
|
|
241
241
|
return (r) => z(t, r);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
const a =
|
|
243
|
+
function gt(e) {
|
|
244
|
+
const a = G(e), t = new K(a).parse();
|
|
245
245
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
246
|
-
throw new
|
|
246
|
+
throw new S(
|
|
247
247
|
'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
|
|
248
248
|
0
|
|
249
249
|
);
|
|
250
250
|
return (r) => z(t, r);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function ee(e) {
|
|
253
253
|
try {
|
|
254
|
-
const a =
|
|
255
|
-
return new
|
|
254
|
+
const a = G(e);
|
|
255
|
+
return new K(a).parse(), null;
|
|
256
256
|
} catch (a) {
|
|
257
|
-
return a instanceof
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const
|
|
261
|
-
linear:
|
|
262
|
-
easeInQuad:
|
|
263
|
-
easeOutQuad:
|
|
264
|
-
easeInOutQuad:
|
|
265
|
-
easeInCubic:
|
|
266
|
-
easeOutCubic:
|
|
267
|
-
easeInOutCubic:
|
|
268
|
-
easeInQuart:
|
|
269
|
-
easeOutQuart:
|
|
270
|
-
easeInOutQuart:
|
|
271
|
-
easeInSine:
|
|
272
|
-
easeOutSine:
|
|
273
|
-
easeInOutSine:
|
|
274
|
-
easeInExpo:
|
|
275
|
-
easeOutExpo:
|
|
276
|
-
easeInOutExpo:
|
|
277
|
-
easeInBack:
|
|
278
|
-
easeOutBack:
|
|
279
|
-
easeOutElastic:
|
|
280
|
-
easeOutBounce:
|
|
257
|
+
return a instanceof S ? `${a.message} (at position ${a.position})` : String(a);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const U = {
|
|
261
|
+
linear: pe,
|
|
262
|
+
easeInQuad: ze,
|
|
263
|
+
easeOutQuad: Ce,
|
|
264
|
+
easeInOutQuad: Ae,
|
|
265
|
+
easeInCubic: Oe,
|
|
266
|
+
easeOutCubic: $e,
|
|
267
|
+
easeInOutCubic: Se,
|
|
268
|
+
easeInQuart: Ie,
|
|
269
|
+
easeOutQuart: ke,
|
|
270
|
+
easeInOutQuart: we,
|
|
271
|
+
easeInSine: de,
|
|
272
|
+
easeOutSine: ve,
|
|
273
|
+
easeInOutSine: xe,
|
|
274
|
+
easeInExpo: be,
|
|
275
|
+
easeOutExpo: ye,
|
|
276
|
+
easeInOutExpo: me,
|
|
277
|
+
easeInBack: ge,
|
|
278
|
+
easeOutBack: oe,
|
|
279
|
+
easeOutElastic: fe,
|
|
280
|
+
easeOutBounce: he
|
|
281
281
|
};
|
|
282
|
-
function
|
|
282
|
+
function o(e) {
|
|
283
283
|
if (e !== void 0) {
|
|
284
284
|
if (typeof e == "string") {
|
|
285
|
-
const a =
|
|
285
|
+
const a = U[e];
|
|
286
286
|
if (!a) {
|
|
287
|
-
const t = Object.keys(
|
|
287
|
+
const t = Object.keys(U), r = t.find((n) => n.toLowerCase() === e.toLowerCase()), i = r ? ` Did you mean '${r}'?` : "";
|
|
288
288
|
throw new Error(`Unknown easing '${e}'.${i} Available: ${t.join(", ")}`);
|
|
289
289
|
}
|
|
290
290
|
return a;
|
|
291
291
|
}
|
|
292
292
|
if (e.type === "spring")
|
|
293
|
-
return
|
|
293
|
+
return Ee({
|
|
294
294
|
stiffness: e.stiffness,
|
|
295
295
|
damping: e.damping,
|
|
296
296
|
mass: e.mass
|
|
297
297
|
});
|
|
298
298
|
if (e.type === "cubicBezier")
|
|
299
|
-
return
|
|
299
|
+
return Re(e.x1, e.y1, e.x2, e.y2);
|
|
300
300
|
throw new Error(`Unknown easing type: ${e.type}`);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
const
|
|
304
|
-
function
|
|
303
|
+
const j = Object.keys(U);
|
|
304
|
+
function te(e) {
|
|
305
305
|
const a = [];
|
|
306
306
|
if (!e || typeof e != "object")
|
|
307
307
|
return a.push({ path: "", message: "Document must be an object", severity: "error" }), { valid: !1, errors: a };
|
|
308
308
|
const t = e;
|
|
309
|
-
return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (
|
|
309
|
+
return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (mt(t.root, "root", a), {
|
|
310
310
|
valid: a.filter((r) => r.severity === "error").length === 0,
|
|
311
311
|
errors: a
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const J = ["scene", "player", "presentation"], D = ["card", "slide", "square"], q = [
|
|
315
315
|
"sequence",
|
|
316
316
|
"group",
|
|
317
317
|
"bezierCurve",
|
|
@@ -340,219 +340,219 @@ const G = ["scene", "player", "presentation"], T = ["card", "slide", "square"],
|
|
|
340
340
|
"parallel",
|
|
341
341
|
"player",
|
|
342
342
|
"scene"
|
|
343
|
-
],
|
|
344
|
-
function
|
|
343
|
+
], Y = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
344
|
+
function mt(e, a, t) {
|
|
345
345
|
const r = e.type;
|
|
346
|
-
if (!
|
|
347
|
-
t.push({ path: `${a}.type`, message: `Root type must be one of: ${
|
|
346
|
+
if (!J.includes(r)) {
|
|
347
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${J.join(", ")}. Got "${r}"`, severity: "error" });
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
r === "scene" || r === "player" ?
|
|
350
|
+
r === "scene" || r === "player" ? ae(e, a, r, t) : r === "presentation" && yt(e, a, t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
|
|
352
|
+
function ae(e, a, t, r) {
|
|
353
|
+
Lt(e, "durationInFrames", a, r), g(e, "width", a, r), g(e, "height", a, r), g(e, "fps", a, r), A(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !D.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${D.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (N(e, "controls", a, r), N(e, "loop", a, r), N(e, "autoPlay", a, r)), C(e, a, r);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
if (
|
|
355
|
+
function yt(e, a, t) {
|
|
356
|
+
if (g(e, "width", a, t), g(e, "height", a, t), A(e, "background", a, t), g(e, "transitionDuration", a, t), N(e, "showHud", a, t), N(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !D.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${D.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (Y.includes(e.transition) || t.push({
|
|
357
357
|
path: `${a}.transition`,
|
|
358
|
-
message: `Invalid transition "${e.transition}". Must be one of: ${
|
|
358
|
+
message: `Invalid transition "${e.transition}". Must be one of: ${Y.join(", ")}`,
|
|
359
359
|
severity: "error"
|
|
360
360
|
})), !Array.isArray(e.slides)) {
|
|
361
361
|
t.push({ path: `${a}.slides`, message: 'Presentation must have a "slides" array', severity: "error" });
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
364
|
e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((r, i) => {
|
|
365
|
-
|
|
365
|
+
bt(r, `${a}.slides[${i}]`, t);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function bt(e, a, t) {
|
|
369
369
|
if (!e || typeof e != "object") {
|
|
370
370
|
t.push({ path: a, message: "Slide must be an object", severity: "error" });
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
A(e, "title", a, t), A(e, "notes", a, t), A(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
|
|
374
|
+
re(r, `${a}.children[${i}]`, t);
|
|
375
375
|
}) : t.push({ path: `${a}.children`, message: "Slide children must be an array", severity: "error" }));
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function C(e, a, t) {
|
|
378
378
|
if (!Array.isArray(e.children)) {
|
|
379
379
|
t.push({ path: `${a}.children`, message: 'Expected "children" array', severity: "error" });
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
e.children.forEach((r, i) => {
|
|
383
|
-
|
|
383
|
+
re(r, `${a}.children[${i}]`, t);
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function re(e, a, t) {
|
|
387
387
|
if (!e || typeof e != "object") {
|
|
388
388
|
t.push({ path: a, message: "Element must be an object", severity: "error" });
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
const r = e.type;
|
|
392
|
-
if (!r || !
|
|
393
|
-
const i = r ?
|
|
392
|
+
if (!r || !q.includes(r)) {
|
|
393
|
+
const i = r ? ie(r, q) : "";
|
|
394
394
|
t.push({
|
|
395
395
|
path: `${a}.type`,
|
|
396
|
-
message: `Unknown element type "${r}".${i} Valid types: ${
|
|
396
|
+
message: `Unknown element type "${r}".${i} Valid types: ${q.join(", ")}`,
|
|
397
397
|
severity: "error"
|
|
398
398
|
});
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
401
|
switch (r) {
|
|
402
402
|
case "bezierCurve":
|
|
403
|
-
|
|
403
|
+
xt(e, a, t);
|
|
404
404
|
break;
|
|
405
405
|
case "circle":
|
|
406
|
-
|
|
406
|
+
vt(e, a, t);
|
|
407
407
|
break;
|
|
408
408
|
case "line":
|
|
409
|
-
|
|
409
|
+
dt(e, a, t);
|
|
410
410
|
break;
|
|
411
411
|
case "arrow":
|
|
412
|
-
|
|
412
|
+
wt(e, a, t);
|
|
413
413
|
break;
|
|
414
414
|
case "rect":
|
|
415
|
-
|
|
415
|
+
kt(e, a, t);
|
|
416
416
|
break;
|
|
417
417
|
case "polygon":
|
|
418
|
-
|
|
418
|
+
It(e, a, t);
|
|
419
419
|
break;
|
|
420
420
|
case "text":
|
|
421
|
-
|
|
421
|
+
St(e, a, t);
|
|
422
422
|
break;
|
|
423
423
|
case "image":
|
|
424
|
-
|
|
424
|
+
Dt(e, a, t);
|
|
425
425
|
break;
|
|
426
426
|
case "axes":
|
|
427
|
-
|
|
427
|
+
$t(e, a, t);
|
|
428
428
|
break;
|
|
429
429
|
case "functionPlot":
|
|
430
|
-
|
|
430
|
+
Ot(e, a, t);
|
|
431
431
|
break;
|
|
432
432
|
case "vector":
|
|
433
|
-
|
|
433
|
+
At(e, a, t);
|
|
434
434
|
break;
|
|
435
435
|
case "vectorField":
|
|
436
|
-
|
|
436
|
+
Ct(e, a, t);
|
|
437
437
|
break;
|
|
438
438
|
case "matrix":
|
|
439
|
-
|
|
439
|
+
zt(e, a, t);
|
|
440
440
|
break;
|
|
441
441
|
case "graph":
|
|
442
|
-
|
|
442
|
+
pt(e, a, t);
|
|
443
443
|
break;
|
|
444
444
|
case "latex":
|
|
445
|
-
|
|
445
|
+
Et(e, a, t);
|
|
446
446
|
break;
|
|
447
447
|
case "barChart":
|
|
448
|
-
|
|
448
|
+
Vt(e, a, t);
|
|
449
449
|
break;
|
|
450
450
|
case "sequence":
|
|
451
|
-
|
|
451
|
+
Rt(e, a, t);
|
|
452
452
|
break;
|
|
453
453
|
case "group":
|
|
454
|
-
|
|
454
|
+
Wt(e, a, t);
|
|
455
455
|
break;
|
|
456
456
|
case "parallel":
|
|
457
|
-
|
|
457
|
+
C(e, a, t);
|
|
458
458
|
break;
|
|
459
459
|
case "fadeIn":
|
|
460
460
|
case "fadeOut":
|
|
461
461
|
case "draw":
|
|
462
462
|
case "write":
|
|
463
|
-
|
|
463
|
+
Ft(e, a, t);
|
|
464
464
|
break;
|
|
465
465
|
case "transform":
|
|
466
|
-
|
|
466
|
+
Pt(e, a, t);
|
|
467
467
|
break;
|
|
468
468
|
case "morph":
|
|
469
|
-
|
|
469
|
+
Tt(e, a, t);
|
|
470
470
|
break;
|
|
471
471
|
case "stagger":
|
|
472
|
-
|
|
472
|
+
Mt(e, a, t);
|
|
473
473
|
break;
|
|
474
474
|
case "scene":
|
|
475
475
|
case "player":
|
|
476
|
-
|
|
476
|
+
ae(e, a, r, t);
|
|
477
477
|
break;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
480
|
+
function xt(e, a, t) {
|
|
481
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 && F(e, "cx2", a, t), e.cy2 !== void 0 && F(e, "cy2", a, t), v(e, a, t);
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
483
|
+
function vt(e, a, t) {
|
|
484
|
+
h(e, "cx", a, t), h(e, "cy", a, t), p(e, "r", a, t), v(e, a, t);
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
486
|
+
function dt(e, a, t) {
|
|
487
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
|
|
489
|
+
function wt(e, a, t) {
|
|
490
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
492
|
+
function kt(e, a, t) {
|
|
493
|
+
h(e, "x", a, t), h(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), v(e, a, t);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function It(e, a, t) {
|
|
496
496
|
Array.isArray(e.points) ? e.points.length < 3 ? t.push({ path: `${a}.points`, message: "Polygon requires at least 3 points", severity: "error" }) : e.points.forEach((r, i) => {
|
|
497
497
|
(!Array.isArray(r) || r.length !== 2 || typeof r[0] != "number" || typeof r[1] != "number") && t.push({ path: `${a}.points[${i}]`, message: "Each point must be [number, number]", severity: "error" });
|
|
498
498
|
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), v(e, a, t);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
|
|
500
|
+
function St(e, a, t) {
|
|
501
|
+
h(e, "x", a, t), h(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), v(e, a, t);
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
k(e, "domain", a, t), k(e, "range", a, t), k(e, "origin", a, t),
|
|
503
|
+
function $t(e, a, t) {
|
|
504
|
+
k(e, "domain", a, t), k(e, "range", a, t), k(e, "origin", a, t), W(e, a, t);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Ot(e, a, t) {
|
|
507
507
|
if (typeof e.fn != "string")
|
|
508
508
|
t.push({ path: `${a}.fn`, message: 'FunctionPlot requires a "fn" expression string', severity: "error" });
|
|
509
509
|
else {
|
|
510
|
-
const r =
|
|
510
|
+
const r = ee(e.fn);
|
|
511
511
|
r && t.push({ path: `${a}.fn`, message: `Invalid expression: ${r}`, severity: "error" });
|
|
512
512
|
}
|
|
513
|
-
k(e, "domain", a, t),
|
|
513
|
+
k(e, "domain", a, t), W(e, a, t);
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
(!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), k(e, "from", a, t),
|
|
515
|
+
function At(e, a, t) {
|
|
516
|
+
(!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), k(e, "from", a, t), W(e, a, t);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Ct(e, a, t) {
|
|
519
519
|
if (typeof e.fn != "string")
|
|
520
520
|
t.push({ path: `${a}.fn`, message: 'VectorField requires a "fn" expression string', severity: "error" });
|
|
521
521
|
else {
|
|
522
|
-
const r =
|
|
522
|
+
const r = ee(e.fn);
|
|
523
523
|
r && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${r}`, severity: "error" });
|
|
524
524
|
}
|
|
525
|
-
k(e, "domain", a, t), k(e, "range", a, t),
|
|
525
|
+
k(e, "domain", a, t), k(e, "range", a, t), W(e, a, t);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function zt(e, a, t) {
|
|
528
528
|
Array.isArray(e.values) ? e.values.forEach((r, i) => {
|
|
529
529
|
Array.isArray(r) || t.push({ path: `${a}.values[${i}]`, message: "Each matrix row must be an array", severity: "error" });
|
|
530
530
|
}) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), v(e, a, t);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function pt(e, a, t) {
|
|
533
533
|
if (!Array.isArray(e.nodes))
|
|
534
534
|
t.push({ path: `${a}.nodes`, message: 'Graph requires a "nodes" array', severity: "error" });
|
|
535
535
|
else {
|
|
536
536
|
const r = /* @__PURE__ */ new Set();
|
|
537
537
|
e.nodes.forEach((i, n) => {
|
|
538
|
-
typeof i.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (r.has(i.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${i.id}"`, severity: "error" }), r.add(i.id)),
|
|
538
|
+
typeof i.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (r.has(i.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${i.id}"`, severity: "error" }), r.add(i.id)), h(i, "x", `${a}.nodes[${n}]`, t), h(i, "y", `${a}.nodes[${n}]`, t);
|
|
539
539
|
}), Array.isArray(e.edges) && e.edges.forEach((i, n) => {
|
|
540
540
|
(typeof i.from != "string" || !r.has(i.from)) && t.push({ path: `${a}.edges[${n}].from`, message: `Edge "from" references unknown node "${i.from}"`, severity: "error" }), (typeof i.to != "string" || !r.has(i.to)) && t.push({ path: `${a}.edges[${n}].to`, message: `Edge "to" references unknown node "${i.to}"`, severity: "error" });
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
v(e, a, t);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }),
|
|
545
|
+
function Et(e, a, t) {
|
|
546
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), v(e, a, t);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
|
|
548
|
+
function Rt(e, a, t) {
|
|
549
|
+
h(e, "from", a, t), jt(e, "durationInFrames", a, t), C(e, a, t);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
|
|
551
|
+
function Ft(e, a, t) {
|
|
552
|
+
g(e, "duration", a, t), P(e, a, t), C(e, a, t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
555
|
-
if (
|
|
554
|
+
function Pt(e, a, t) {
|
|
555
|
+
if (g(e, "duration", a, t), P(e, a, t), e.translate !== void 0) {
|
|
556
556
|
const r = e.translate;
|
|
557
557
|
(!r || typeof r != "object") && t.push({ path: `${a}.translate`, message: "translate must be { from: [x,y], to: [x,y] }", severity: "error" });
|
|
558
558
|
}
|
|
@@ -568,51 +568,51 @@ function Ct(e, a, t) {
|
|
|
568
568
|
const r = e.opacity;
|
|
569
569
|
(!r || typeof r != "object" || typeof r.from != "number" || typeof r.to != "number") && t.push({ path: `${a}.opacity`, message: "opacity must be { from: number, to: number }", severity: "error" });
|
|
570
570
|
}
|
|
571
|
-
|
|
571
|
+
C(e, a, t);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
|
|
573
|
+
function Tt(e, a, t) {
|
|
574
|
+
g(e, "duration", a, t), P(e, a, t), A(e, "fromColor", a, t), A(e, "toColor", a, t), C(e, a, t);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
576
|
+
function Mt(e, a, t) {
|
|
577
|
+
g(e, "staggerDelay", a, t), P(e, a, t), C(e, a, t);
|
|
578
578
|
}
|
|
579
579
|
function v(e, a, t) {
|
|
580
|
-
|
|
580
|
+
g(e, "fadeIn", a, t), g(e, "fadeOut", a, t), g(e, "draw", a, t), P(e, a, t), Nt(e, a, t);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
|
|
582
|
+
function W(e, a, t) {
|
|
583
|
+
g(e, "fadeIn", a, t), g(e, "fadeOut", a, t), g(e, "draw", a, t), P(e, a, t), _t(e, a, t);
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
function
|
|
587
|
-
if (
|
|
585
|
+
const Z = ["none", "circle", "ellipse"];
|
|
586
|
+
function Nt(e, a, t) {
|
|
587
|
+
if (F(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), F(e, "zIndex", a, t), e.scale !== void 0) {
|
|
588
588
|
const r = e.scale;
|
|
589
589
|
typeof r == "number" || Array.isArray(r) && r.length === 2 && typeof r[0] == "number" && typeof r[1] == "number" || t.push({ path: `${a}.scale`, message: '"scale" must be a number or [number, number]', severity: "error" });
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
592
|
+
function _t(e, a, t) {
|
|
593
|
+
F(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), F(e, "zIndex", a, t);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }),
|
|
595
|
+
function Dt(e, a, t) {
|
|
596
|
+
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), A(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (Z.includes(e.clipShape) || t.push({
|
|
597
597
|
path: `${a}.clipShape`,
|
|
598
|
-
message: `Invalid clipShape "${e.clipShape}". Must be one of: ${
|
|
598
|
+
message: `Invalid clipShape "${e.clipShape}". Must be one of: ${Z.join(", ")}`,
|
|
599
599
|
severity: "error"
|
|
600
600
|
})), v(e, a, t);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
602
|
+
function Wt(e, a, t) {
|
|
603
|
+
C(e, a, t), v(e, a, t);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
605
|
+
function Vt(e, a, t) {
|
|
606
|
+
h(e, "x", a, t), h(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), v(e, a, t);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function P(e, a, t) {
|
|
609
609
|
if (e.easing !== void 0) {
|
|
610
610
|
if (typeof e.easing == "string") {
|
|
611
|
-
if (!
|
|
612
|
-
const r =
|
|
611
|
+
if (!j.includes(e.easing)) {
|
|
612
|
+
const r = ie(e.easing, j);
|
|
613
613
|
t.push({
|
|
614
614
|
path: `${a}.easing`,
|
|
615
|
-
message: `Unknown easing "${e.easing}".${r} Available: ${
|
|
615
|
+
message: `Unknown easing "${e.easing}".${r} Available: ${j.join(", ")}`,
|
|
616
616
|
severity: "error"
|
|
617
617
|
});
|
|
618
618
|
}
|
|
@@ -632,27 +632,27 @@ function R(e, a, t) {
|
|
|
632
632
|
t.push({ path: `${a}.easing`, message: 'Easing must be a string name or { type: "spring"|"cubicBezier", ... }', severity: "error" });
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function h(e, a, t, r) {
|
|
636
636
|
typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
|
|
637
637
|
}
|
|
638
638
|
function p(e, a, t, r) {
|
|
639
639
|
(typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Lt(e, a, t, r) {
|
|
642
642
|
const i = e[a];
|
|
643
643
|
(typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function g(e, a, t, r) {
|
|
646
646
|
e[a] !== void 0 && (typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function jt(e, a, t, r) {
|
|
649
649
|
const i = e[a];
|
|
650
650
|
i !== void 0 && (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function A(e, a, t, r) {
|
|
653
653
|
e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function F(e, a, t, r) {
|
|
656
656
|
e[a] !== void 0 && typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a number`, severity: "error" });
|
|
657
657
|
}
|
|
658
658
|
function N(e, a, t, r) {
|
|
@@ -662,15 +662,17 @@ function k(e, a, t, r) {
|
|
|
662
662
|
const i = e[a];
|
|
663
663
|
i !== void 0 && (!Array.isArray(i) || i.length !== 2 || typeof i[0] != "number" || typeof i[1] != "number") && r.push({ path: `${t}.${a}`, message: `"${a}" must be [number, number]`, severity: "error" });
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function ie(e, a) {
|
|
666
666
|
const t = e.toLowerCase(), r = a.find((n) => n.toLowerCase() === t);
|
|
667
667
|
if (r) return ` Did you mean '${r}'?`;
|
|
668
668
|
const i = a.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
|
|
669
669
|
return i ? ` Did you mean '${i}'?` : "";
|
|
670
670
|
}
|
|
671
|
-
const
|
|
672
|
-
foreground: { cssVar: "--elucim-foreground", fallback: "#
|
|
673
|
-
background: { cssVar: "--elucim-background", fallback: "#
|
|
671
|
+
const ne = {
|
|
672
|
+
foreground: { cssVar: "--elucim-foreground", fallback: "#c8d6e5" },
|
|
673
|
+
background: { cssVar: "--elucim-background", fallback: "#0a0a1e" },
|
|
674
|
+
title: { cssVar: "--elucim-title", fallback: "#e0e7ff" },
|
|
675
|
+
subtitle: { cssVar: "--elucim-subtitle", fallback: "#94a3b8" },
|
|
674
676
|
accent: { cssVar: "--elucim-accent", fallback: "#4fc3f7" },
|
|
675
677
|
muted: { cssVar: "--elucim-muted", fallback: "#64748b" },
|
|
676
678
|
surface: { cssVar: "--elucim-surface", fallback: "#1e293b" },
|
|
@@ -681,31 +683,31 @@ const te = {
|
|
|
681
683
|
success: { cssVar: "--elucim-success", fallback: "#34d399" },
|
|
682
684
|
warning: { cssVar: "--elucim-warning", fallback: "#fbbf24" },
|
|
683
685
|
error: { cssVar: "--elucim-error", fallback: "#f87171" }
|
|
684
|
-
},
|
|
685
|
-
function
|
|
686
|
+
}, ca = Object.keys(ne);
|
|
687
|
+
function u(e) {
|
|
686
688
|
if (e === void 0) return;
|
|
687
689
|
if (!e.startsWith("$")) return e;
|
|
688
|
-
const a = e.slice(1), t =
|
|
690
|
+
const a = e.slice(1), t = ne[a];
|
|
689
691
|
return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
|
|
690
692
|
}
|
|
691
|
-
const
|
|
693
|
+
const qt = {
|
|
692
694
|
card: [640, 360],
|
|
693
695
|
slide: [1280, 720],
|
|
694
696
|
square: [600, 600]
|
|
695
697
|
};
|
|
696
|
-
function
|
|
698
|
+
function V(e, a, t) {
|
|
697
699
|
if (!e) return { width: a, height: t };
|
|
698
|
-
const [r, i] =
|
|
700
|
+
const [r, i] = qt[e];
|
|
699
701
|
return { width: a ?? r, height: t ?? i };
|
|
700
702
|
}
|
|
701
|
-
function
|
|
703
|
+
function se(e, a) {
|
|
702
704
|
switch (e.type) {
|
|
703
705
|
case "scene":
|
|
704
|
-
return
|
|
706
|
+
return H(e, a);
|
|
705
707
|
case "player":
|
|
706
708
|
if ((a == null ? void 0 : a.frame) !== void 0) {
|
|
707
|
-
const { width: t, height: r } =
|
|
708
|
-
return
|
|
709
|
+
const { width: t, height: r } = V(e.preset, e.width, e.height);
|
|
710
|
+
return H(
|
|
709
711
|
{
|
|
710
712
|
width: t,
|
|
711
713
|
height: r,
|
|
@@ -717,37 +719,37 @@ function ae(e, a) {
|
|
|
717
719
|
a
|
|
718
720
|
);
|
|
719
721
|
}
|
|
720
|
-
return
|
|
722
|
+
return ce(e, a);
|
|
721
723
|
case "presentation":
|
|
722
|
-
return
|
|
724
|
+
return Bt(e);
|
|
723
725
|
}
|
|
724
726
|
}
|
|
725
|
-
function
|
|
726
|
-
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } =
|
|
727
|
-
return /* @__PURE__ */
|
|
728
|
-
|
|
727
|
+
function H(e, a) {
|
|
728
|
+
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = V(e.preset, e.width, e.height);
|
|
729
|
+
return /* @__PURE__ */ c(
|
|
730
|
+
Pe,
|
|
729
731
|
{
|
|
730
732
|
width: r,
|
|
731
733
|
height: i,
|
|
732
734
|
fps: e.fps,
|
|
733
735
|
durationInFrames: e.durationInFrames,
|
|
734
|
-
background:
|
|
736
|
+
background: u(e.background),
|
|
735
737
|
...t ? { frame: a.frame, autoPlay: !1 } : {},
|
|
736
|
-
children: e.children.map((n,
|
|
738
|
+
children: e.children.map((n, s) => x(n, s))
|
|
737
739
|
}
|
|
738
740
|
);
|
|
739
741
|
}
|
|
740
|
-
function
|
|
741
|
-
const { width: t, height: r } =
|
|
742
|
-
return /* @__PURE__ */
|
|
743
|
-
|
|
742
|
+
function ce(e, a) {
|
|
743
|
+
const { width: t, height: r } = V(e.preset, e.width, e.height);
|
|
744
|
+
return /* @__PURE__ */ c(
|
|
745
|
+
Te,
|
|
744
746
|
{
|
|
745
747
|
ref: a == null ? void 0 : a.playerRef,
|
|
746
748
|
width: t,
|
|
747
749
|
height: r,
|
|
748
750
|
fps: e.fps,
|
|
749
751
|
durationInFrames: e.durationInFrames,
|
|
750
|
-
background:
|
|
752
|
+
background: u(e.background),
|
|
751
753
|
controls: e.controls,
|
|
752
754
|
loop: e.loop,
|
|
753
755
|
autoPlay: e.autoPlay,
|
|
@@ -755,49 +757,50 @@ function re(e, a) {
|
|
|
755
757
|
}
|
|
756
758
|
);
|
|
757
759
|
}
|
|
758
|
-
function
|
|
759
|
-
const { width: a, height: t } =
|
|
760
|
-
return /* @__PURE__ */
|
|
761
|
-
|
|
760
|
+
function Bt(e) {
|
|
761
|
+
const { width: a, height: t } = V(e.preset, e.width, e.height);
|
|
762
|
+
return /* @__PURE__ */ c(
|
|
763
|
+
Fe,
|
|
762
764
|
{
|
|
763
765
|
width: a,
|
|
764
766
|
height: t,
|
|
765
|
-
background:
|
|
767
|
+
background: u(e.background),
|
|
766
768
|
transition: e.transition,
|
|
767
769
|
transitionDuration: e.transitionDuration,
|
|
768
770
|
showHUD: e.showHud,
|
|
769
771
|
showNotes: e.showNotes,
|
|
770
|
-
children: e.slides.map((r, i) =>
|
|
772
|
+
children: e.slides.map((r, i) => Ut(r, i))
|
|
771
773
|
}
|
|
772
774
|
);
|
|
773
775
|
}
|
|
774
|
-
function
|
|
776
|
+
function Ut(e, a) {
|
|
775
777
|
var t;
|
|
776
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ c(Me, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => x(r, i)) }, a);
|
|
777
779
|
}
|
|
778
780
|
function x(e, a) {
|
|
781
|
+
var t, r, i, n;
|
|
779
782
|
switch (e.type) {
|
|
780
783
|
case "sequence":
|
|
781
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ c(st, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, l) => x(s, l)) }, a);
|
|
782
785
|
case "group":
|
|
783
|
-
return /* @__PURE__ */
|
|
784
|
-
|
|
786
|
+
return /* @__PURE__ */ c(
|
|
787
|
+
nt,
|
|
785
788
|
{
|
|
786
789
|
fadeIn: e.fadeIn,
|
|
787
790
|
fadeOut: e.fadeOut,
|
|
788
|
-
easing:
|
|
791
|
+
easing: o(e.easing),
|
|
789
792
|
rotation: e.rotation,
|
|
790
793
|
rotationOrigin: e.rotationOrigin,
|
|
791
794
|
scale: e.scale,
|
|
792
795
|
translate: e.translate,
|
|
793
796
|
zIndex: e.zIndex,
|
|
794
|
-
children: e.children.map((
|
|
797
|
+
children: e.children.map((s, l) => x(s, l))
|
|
795
798
|
},
|
|
796
799
|
a
|
|
797
800
|
);
|
|
798
801
|
case "bezierCurve":
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
|
|
802
|
+
return /* @__PURE__ */ c(
|
|
803
|
+
it,
|
|
801
804
|
{
|
|
802
805
|
x1: e.x1,
|
|
803
806
|
y1: e.y1,
|
|
@@ -807,15 +810,15 @@ function x(e, a) {
|
|
|
807
810
|
cy2: e.cy2,
|
|
808
811
|
x2: e.x2,
|
|
809
812
|
y2: e.y2,
|
|
810
|
-
stroke:
|
|
813
|
+
stroke: u(e.stroke),
|
|
811
814
|
strokeWidth: e.strokeWidth,
|
|
812
|
-
fill:
|
|
815
|
+
fill: u(e.fill),
|
|
813
816
|
strokeDasharray: e.strokeDasharray,
|
|
814
817
|
opacity: e.opacity,
|
|
815
818
|
fadeIn: e.fadeIn,
|
|
816
819
|
fadeOut: e.fadeOut,
|
|
817
820
|
draw: e.draw,
|
|
818
|
-
easing:
|
|
821
|
+
easing: o(e.easing),
|
|
819
822
|
rotation: e.rotation,
|
|
820
823
|
rotationOrigin: e.rotationOrigin,
|
|
821
824
|
scale: e.scale,
|
|
@@ -825,20 +828,20 @@ function x(e, a) {
|
|
|
825
828
|
a
|
|
826
829
|
);
|
|
827
830
|
case "circle":
|
|
828
|
-
return /* @__PURE__ */
|
|
829
|
-
|
|
831
|
+
return /* @__PURE__ */ c(
|
|
832
|
+
rt,
|
|
830
833
|
{
|
|
831
834
|
cx: e.cx,
|
|
832
835
|
cy: e.cy,
|
|
833
836
|
r: e.r,
|
|
834
|
-
fill:
|
|
835
|
-
stroke:
|
|
837
|
+
fill: u(e.fill),
|
|
838
|
+
stroke: u(e.stroke),
|
|
836
839
|
strokeWidth: e.strokeWidth,
|
|
837
840
|
opacity: e.opacity,
|
|
838
841
|
fadeIn: e.fadeIn,
|
|
839
842
|
fadeOut: e.fadeOut,
|
|
840
843
|
draw: e.draw,
|
|
841
|
-
easing:
|
|
844
|
+
easing: o(e.easing),
|
|
842
845
|
rotation: e.rotation,
|
|
843
846
|
rotationOrigin: e.rotationOrigin,
|
|
844
847
|
scale: e.scale,
|
|
@@ -848,21 +851,21 @@ function x(e, a) {
|
|
|
848
851
|
a
|
|
849
852
|
);
|
|
850
853
|
case "line":
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
-
|
|
854
|
+
return /* @__PURE__ */ c(
|
|
855
|
+
at,
|
|
853
856
|
{
|
|
854
857
|
x1: e.x1,
|
|
855
858
|
y1: e.y1,
|
|
856
859
|
x2: e.x2,
|
|
857
860
|
y2: e.y2,
|
|
858
|
-
stroke:
|
|
861
|
+
stroke: u(e.stroke),
|
|
859
862
|
strokeWidth: e.strokeWidth,
|
|
860
863
|
strokeDasharray: e.strokeDasharray,
|
|
861
864
|
opacity: e.opacity,
|
|
862
865
|
fadeIn: e.fadeIn,
|
|
863
866
|
fadeOut: e.fadeOut,
|
|
864
867
|
draw: e.draw,
|
|
865
|
-
easing:
|
|
868
|
+
easing: o(e.easing),
|
|
866
869
|
rotation: e.rotation,
|
|
867
870
|
rotationOrigin: e.rotationOrigin,
|
|
868
871
|
scale: e.scale,
|
|
@@ -872,14 +875,14 @@ function x(e, a) {
|
|
|
872
875
|
a
|
|
873
876
|
);
|
|
874
877
|
case "arrow":
|
|
875
|
-
return /* @__PURE__ */
|
|
876
|
-
|
|
878
|
+
return /* @__PURE__ */ c(
|
|
879
|
+
tt,
|
|
877
880
|
{
|
|
878
881
|
x1: e.x1,
|
|
879
882
|
y1: e.y1,
|
|
880
883
|
x2: e.x2,
|
|
881
884
|
y2: e.y2,
|
|
882
|
-
stroke:
|
|
885
|
+
stroke: u(e.stroke),
|
|
883
886
|
strokeWidth: e.strokeWidth,
|
|
884
887
|
headSize: e.headSize,
|
|
885
888
|
strokeDasharray: e.strokeDasharray,
|
|
@@ -887,7 +890,7 @@ function x(e, a) {
|
|
|
887
890
|
fadeIn: e.fadeIn,
|
|
888
891
|
fadeOut: e.fadeOut,
|
|
889
892
|
draw: e.draw,
|
|
890
|
-
easing:
|
|
893
|
+
easing: o(e.easing),
|
|
891
894
|
rotation: e.rotation,
|
|
892
895
|
rotationOrigin: e.rotationOrigin,
|
|
893
896
|
scale: e.scale,
|
|
@@ -897,15 +900,15 @@ function x(e, a) {
|
|
|
897
900
|
a
|
|
898
901
|
);
|
|
899
902
|
case "rect":
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
-
|
|
903
|
+
return /* @__PURE__ */ c(
|
|
904
|
+
et,
|
|
902
905
|
{
|
|
903
906
|
x: e.x,
|
|
904
907
|
y: e.y,
|
|
905
908
|
width: e.width,
|
|
906
909
|
height: e.height,
|
|
907
|
-
fill:
|
|
908
|
-
stroke:
|
|
910
|
+
fill: u(e.fill),
|
|
911
|
+
stroke: u(e.stroke),
|
|
909
912
|
strokeWidth: e.strokeWidth,
|
|
910
913
|
rx: e.rx,
|
|
911
914
|
ry: e.ry,
|
|
@@ -914,7 +917,7 @@ function x(e, a) {
|
|
|
914
917
|
fadeIn: e.fadeIn,
|
|
915
918
|
fadeOut: e.fadeOut,
|
|
916
919
|
draw: e.draw,
|
|
917
|
-
easing:
|
|
920
|
+
easing: o(e.easing),
|
|
918
921
|
rotation: e.rotation,
|
|
919
922
|
rotationOrigin: e.rotationOrigin,
|
|
920
923
|
scale: e.scale,
|
|
@@ -924,19 +927,19 @@ function x(e, a) {
|
|
|
924
927
|
a
|
|
925
928
|
);
|
|
926
929
|
case "polygon":
|
|
927
|
-
return /* @__PURE__ */
|
|
928
|
-
|
|
930
|
+
return /* @__PURE__ */ c(
|
|
931
|
+
Ze,
|
|
929
932
|
{
|
|
930
933
|
points: e.points,
|
|
931
|
-
fill:
|
|
932
|
-
stroke:
|
|
934
|
+
fill: u(e.fill),
|
|
935
|
+
stroke: u(e.stroke),
|
|
933
936
|
strokeWidth: e.strokeWidth,
|
|
934
937
|
closed: e.closed,
|
|
935
938
|
opacity: e.opacity,
|
|
936
939
|
fadeIn: e.fadeIn,
|
|
937
940
|
fadeOut: e.fadeOut,
|
|
938
941
|
draw: e.draw,
|
|
939
|
-
easing:
|
|
942
|
+
easing: o(e.easing),
|
|
940
943
|
rotation: e.rotation,
|
|
941
944
|
rotationOrigin: e.rotationOrigin,
|
|
942
945
|
scale: e.scale,
|
|
@@ -946,12 +949,12 @@ function x(e, a) {
|
|
|
946
949
|
a
|
|
947
950
|
);
|
|
948
951
|
case "text":
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
|
|
952
|
+
return /* @__PURE__ */ c(
|
|
953
|
+
L,
|
|
951
954
|
{
|
|
952
955
|
x: e.x,
|
|
953
956
|
y: e.y,
|
|
954
|
-
fill:
|
|
957
|
+
fill: u(e.fill),
|
|
955
958
|
fontSize: e.fontSize,
|
|
956
959
|
fontFamily: e.fontFamily,
|
|
957
960
|
fontWeight: e.fontWeight,
|
|
@@ -960,7 +963,7 @@ function x(e, a) {
|
|
|
960
963
|
opacity: e.opacity,
|
|
961
964
|
fadeIn: e.fadeIn,
|
|
962
965
|
fadeOut: e.fadeOut,
|
|
963
|
-
easing:
|
|
966
|
+
easing: o(e.easing),
|
|
964
967
|
rotation: e.rotation,
|
|
965
968
|
rotationOrigin: e.rotationOrigin,
|
|
966
969
|
scale: e.scale,
|
|
@@ -971,8 +974,8 @@ function x(e, a) {
|
|
|
971
974
|
a
|
|
972
975
|
);
|
|
973
976
|
case "image":
|
|
974
|
-
return /* @__PURE__ */
|
|
975
|
-
|
|
977
|
+
return /* @__PURE__ */ c(
|
|
978
|
+
Ye,
|
|
976
979
|
{
|
|
977
980
|
src: e.src,
|
|
978
981
|
x: e.x,
|
|
@@ -985,7 +988,7 @@ function x(e, a) {
|
|
|
985
988
|
opacity: e.opacity,
|
|
986
989
|
fadeIn: e.fadeIn,
|
|
987
990
|
fadeOut: e.fadeOut,
|
|
988
|
-
easing:
|
|
991
|
+
easing: o(e.easing),
|
|
989
992
|
rotation: e.rotation,
|
|
990
993
|
rotationOrigin: e.rotationOrigin,
|
|
991
994
|
scale: e.scale,
|
|
@@ -995,8 +998,8 @@ function x(e, a) {
|
|
|
995
998
|
a
|
|
996
999
|
);
|
|
997
1000
|
case "axes":
|
|
998
|
-
return /* @__PURE__ */
|
|
999
|
-
|
|
1001
|
+
return /* @__PURE__ */ c(
|
|
1002
|
+
Je,
|
|
1000
1003
|
{
|
|
1001
1004
|
domain: e.domain,
|
|
1002
1005
|
range: e.range,
|
|
@@ -1006,14 +1009,14 @@ function x(e, a) {
|
|
|
1006
1009
|
showTicks: e.showTicks,
|
|
1007
1010
|
showLabels: e.showLabels,
|
|
1008
1011
|
tickStep: e.tickStep,
|
|
1009
|
-
axisColor:
|
|
1010
|
-
gridColor:
|
|
1011
|
-
labelColor:
|
|
1012
|
+
axisColor: u(e.axisColor),
|
|
1013
|
+
gridColor: u(e.gridColor),
|
|
1014
|
+
labelColor: u(e.labelColor),
|
|
1012
1015
|
labelFontSize: e.labelFontSize,
|
|
1013
1016
|
fadeIn: e.fadeIn,
|
|
1014
1017
|
fadeOut: e.fadeOut,
|
|
1015
1018
|
draw: e.draw,
|
|
1016
|
-
easing:
|
|
1019
|
+
easing: o(e.easing),
|
|
1017
1020
|
rotation: e.rotation,
|
|
1018
1021
|
rotationOrigin: e.rotationOrigin,
|
|
1019
1022
|
translate: e.translate,
|
|
@@ -1022,20 +1025,36 @@ function x(e, a) {
|
|
|
1022
1025
|
a
|
|
1023
1026
|
);
|
|
1024
1027
|
case "functionPlot": {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
+
let s;
|
|
1029
|
+
try {
|
|
1030
|
+
s = ot(e.fn);
|
|
1031
|
+
} catch {
|
|
1032
|
+
return /* @__PURE__ */ c(
|
|
1033
|
+
L,
|
|
1034
|
+
{
|
|
1035
|
+
x: ((t = e.origin) == null ? void 0 : t[0]) ?? 400,
|
|
1036
|
+
y: (((r = e.origin) == null ? void 0 : r[1]) ?? 300) - 20,
|
|
1037
|
+
fontSize: 14,
|
|
1038
|
+
fill: "red",
|
|
1039
|
+
opacity: 0.8,
|
|
1040
|
+
children: `⚠ f(x) = ${e.fn}`
|
|
1041
|
+
},
|
|
1042
|
+
a
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
return /* @__PURE__ */ c(
|
|
1046
|
+
Xe,
|
|
1028
1047
|
{
|
|
1029
|
-
fn: (
|
|
1048
|
+
fn: (l) => s({ x: l }),
|
|
1030
1049
|
domain: e.domain,
|
|
1031
1050
|
yClamp: e.yClamp,
|
|
1032
1051
|
origin: e.origin,
|
|
1033
1052
|
scale: e.scale,
|
|
1034
|
-
color:
|
|
1053
|
+
color: u(e.color),
|
|
1035
1054
|
strokeWidth: e.strokeWidth,
|
|
1036
1055
|
samples: e.samples,
|
|
1037
1056
|
draw: e.draw,
|
|
1038
|
-
easing:
|
|
1057
|
+
easing: o(e.easing),
|
|
1039
1058
|
opacity: e.opacity,
|
|
1040
1059
|
rotation: e.rotation,
|
|
1041
1060
|
rotationOrigin: e.rotationOrigin,
|
|
@@ -1046,24 +1065,24 @@ function x(e, a) {
|
|
|
1046
1065
|
);
|
|
1047
1066
|
}
|
|
1048
1067
|
case "vector":
|
|
1049
|
-
return /* @__PURE__ */
|
|
1050
|
-
|
|
1068
|
+
return /* @__PURE__ */ c(
|
|
1069
|
+
Qe,
|
|
1051
1070
|
{
|
|
1052
1071
|
from: e.from,
|
|
1053
1072
|
to: e.to,
|
|
1054
1073
|
origin: e.origin,
|
|
1055
1074
|
scale: e.scale,
|
|
1056
|
-
color:
|
|
1075
|
+
color: u(e.color),
|
|
1057
1076
|
strokeWidth: e.strokeWidth,
|
|
1058
1077
|
headSize: e.headSize,
|
|
1059
1078
|
label: e.label,
|
|
1060
1079
|
labelOffset: e.labelOffset,
|
|
1061
|
-
labelColor:
|
|
1080
|
+
labelColor: u(e.labelColor),
|
|
1062
1081
|
labelFontSize: e.labelFontSize,
|
|
1063
1082
|
fadeIn: e.fadeIn,
|
|
1064
1083
|
fadeOut: e.fadeOut,
|
|
1065
1084
|
draw: e.draw,
|
|
1066
|
-
easing:
|
|
1085
|
+
easing: o(e.easing),
|
|
1067
1086
|
rotation: e.rotation,
|
|
1068
1087
|
rotationOrigin: e.rotationOrigin,
|
|
1069
1088
|
translate: e.translate,
|
|
@@ -1072,25 +1091,41 @@ function x(e, a) {
|
|
|
1072
1091
|
a
|
|
1073
1092
|
);
|
|
1074
1093
|
case "vectorField": {
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1094
|
+
let s;
|
|
1095
|
+
try {
|
|
1096
|
+
s = gt(e.fn);
|
|
1097
|
+
} catch {
|
|
1098
|
+
return /* @__PURE__ */ c(
|
|
1099
|
+
L,
|
|
1100
|
+
{
|
|
1101
|
+
x: ((i = e.origin) == null ? void 0 : i[0]) ?? 400,
|
|
1102
|
+
y: (((n = e.origin) == null ? void 0 : n[1]) ?? 300) - 20,
|
|
1103
|
+
fontSize: 14,
|
|
1104
|
+
fill: "red",
|
|
1105
|
+
opacity: 0.8,
|
|
1106
|
+
children: `⚠ field = ${e.fn}`
|
|
1107
|
+
},
|
|
1108
|
+
a
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
return /* @__PURE__ */ c(
|
|
1112
|
+
Ke,
|
|
1078
1113
|
{
|
|
1079
|
-
fn: (
|
|
1114
|
+
fn: (l, $) => s({ x: l, y: $ }),
|
|
1080
1115
|
domain: e.domain,
|
|
1081
1116
|
range: e.range,
|
|
1082
1117
|
step: e.step,
|
|
1083
1118
|
origin: e.origin,
|
|
1084
1119
|
scale: e.scale,
|
|
1085
1120
|
arrowScale: e.arrowScale,
|
|
1086
|
-
color:
|
|
1121
|
+
color: u(e.color),
|
|
1087
1122
|
strokeWidth: e.strokeWidth,
|
|
1088
1123
|
headSize: e.headSize,
|
|
1089
1124
|
normalize: e.normalize,
|
|
1090
1125
|
maxLength: e.maxLength,
|
|
1091
1126
|
fadeIn: e.fadeIn,
|
|
1092
1127
|
fadeOut: e.fadeOut,
|
|
1093
|
-
easing:
|
|
1128
|
+
easing: o(e.easing),
|
|
1094
1129
|
rotation: e.rotation,
|
|
1095
1130
|
rotationOrigin: e.rotationOrigin,
|
|
1096
1131
|
translate: e.translate,
|
|
@@ -1100,19 +1135,19 @@ function x(e, a) {
|
|
|
1100
1135
|
);
|
|
1101
1136
|
}
|
|
1102
1137
|
case "matrix":
|
|
1103
|
-
return /* @__PURE__ */
|
|
1104
|
-
|
|
1138
|
+
return /* @__PURE__ */ c(
|
|
1139
|
+
Ge,
|
|
1105
1140
|
{
|
|
1106
1141
|
values: e.values,
|
|
1107
1142
|
x: e.x,
|
|
1108
1143
|
y: e.y,
|
|
1109
1144
|
cellSize: e.cellSize,
|
|
1110
|
-
color:
|
|
1111
|
-
bracketColor:
|
|
1145
|
+
color: u(e.color),
|
|
1146
|
+
bracketColor: u(e.bracketColor),
|
|
1112
1147
|
fontSize: e.fontSize,
|
|
1113
1148
|
fadeIn: e.fadeIn,
|
|
1114
1149
|
fadeOut: e.fadeOut,
|
|
1115
|
-
easing:
|
|
1150
|
+
easing: o(e.easing),
|
|
1116
1151
|
rotation: e.rotation,
|
|
1117
1152
|
rotationOrigin: e.rotationOrigin,
|
|
1118
1153
|
scale: e.scale,
|
|
@@ -1122,20 +1157,20 @@ function x(e, a) {
|
|
|
1122
1157
|
a
|
|
1123
1158
|
);
|
|
1124
1159
|
case "graph":
|
|
1125
|
-
return /* @__PURE__ */
|
|
1126
|
-
|
|
1160
|
+
return /* @__PURE__ */ c(
|
|
1161
|
+
He,
|
|
1127
1162
|
{
|
|
1128
1163
|
nodes: e.nodes,
|
|
1129
1164
|
edges: e.edges,
|
|
1130
|
-
nodeColor:
|
|
1165
|
+
nodeColor: u(e.nodeColor),
|
|
1131
1166
|
nodeRadius: e.nodeRadius,
|
|
1132
|
-
edgeColor:
|
|
1167
|
+
edgeColor: u(e.edgeColor),
|
|
1133
1168
|
edgeWidth: e.edgeWidth,
|
|
1134
|
-
labelColor:
|
|
1169
|
+
labelColor: u(e.labelColor),
|
|
1135
1170
|
labelFontSize: e.labelFontSize,
|
|
1136
1171
|
fadeIn: e.fadeIn,
|
|
1137
1172
|
fadeOut: e.fadeOut,
|
|
1138
|
-
easing:
|
|
1173
|
+
easing: o(e.easing),
|
|
1139
1174
|
rotation: e.rotation,
|
|
1140
1175
|
rotationOrigin: e.rotationOrigin,
|
|
1141
1176
|
scale: e.scale,
|
|
@@ -1145,18 +1180,18 @@ function x(e, a) {
|
|
|
1145
1180
|
a
|
|
1146
1181
|
);
|
|
1147
1182
|
case "latex":
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
|
|
1183
|
+
return /* @__PURE__ */ c(
|
|
1184
|
+
Ue,
|
|
1150
1185
|
{
|
|
1151
1186
|
expression: e.expression,
|
|
1152
1187
|
x: e.x,
|
|
1153
1188
|
y: e.y,
|
|
1154
|
-
color:
|
|
1189
|
+
color: u(e.color),
|
|
1155
1190
|
fontSize: e.fontSize,
|
|
1156
1191
|
align: e.align,
|
|
1157
1192
|
fadeIn: e.fadeIn,
|
|
1158
1193
|
fadeOut: e.fadeOut,
|
|
1159
|
-
easing:
|
|
1194
|
+
easing: o(e.easing),
|
|
1160
1195
|
rotation: e.rotation,
|
|
1161
1196
|
rotationOrigin: e.rotationOrigin,
|
|
1162
1197
|
scale: e.scale,
|
|
@@ -1166,16 +1201,16 @@ function x(e, a) {
|
|
|
1166
1201
|
a
|
|
1167
1202
|
);
|
|
1168
1203
|
case "barChart":
|
|
1169
|
-
return /* @__PURE__ */
|
|
1170
|
-
|
|
1204
|
+
return /* @__PURE__ */ c(
|
|
1205
|
+
Be,
|
|
1171
1206
|
{
|
|
1172
1207
|
bars: e.bars,
|
|
1173
1208
|
x: e.x,
|
|
1174
1209
|
y: e.y,
|
|
1175
1210
|
width: e.width,
|
|
1176
1211
|
height: e.height,
|
|
1177
|
-
barColor:
|
|
1178
|
-
labelColor:
|
|
1212
|
+
barColor: u(e.barColor),
|
|
1213
|
+
labelColor: u(e.labelColor),
|
|
1179
1214
|
labelFontSize: e.labelFontSize,
|
|
1180
1215
|
showValues: e.showValues,
|
|
1181
1216
|
maxValue: e.maxValue,
|
|
@@ -1183,7 +1218,7 @@ function x(e, a) {
|
|
|
1183
1218
|
valueFormat: e.valueFormat,
|
|
1184
1219
|
fadeIn: e.fadeIn,
|
|
1185
1220
|
fadeOut: e.fadeOut,
|
|
1186
|
-
easing:
|
|
1221
|
+
easing: o(e.easing),
|
|
1187
1222
|
rotation: e.rotation,
|
|
1188
1223
|
rotationOrigin: e.rotationOrigin,
|
|
1189
1224
|
scale: e.scale,
|
|
@@ -1193,139 +1228,206 @@ function x(e, a) {
|
|
|
1193
1228
|
a
|
|
1194
1229
|
);
|
|
1195
1230
|
case "fadeIn":
|
|
1196
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ c(qe, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
|
|
1197
1232
|
case "fadeOut":
|
|
1198
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ c(je, { duration: e.duration, totalFrames: e.totalFrames, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
|
|
1199
1234
|
case "draw":
|
|
1200
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ c(Le, { duration: e.duration, pathLength: e.pathLength, easing: o(e.easing), children: x(e.children[0], 0) }, a);
|
|
1201
1236
|
case "write":
|
|
1202
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ c(Ve, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
|
|
1203
1238
|
case "transform":
|
|
1204
|
-
return /* @__PURE__ */
|
|
1205
|
-
|
|
1239
|
+
return /* @__PURE__ */ c(
|
|
1240
|
+
We,
|
|
1206
1241
|
{
|
|
1207
1242
|
duration: e.duration,
|
|
1208
|
-
easing:
|
|
1243
|
+
easing: o(e.easing),
|
|
1209
1244
|
translate: e.translate,
|
|
1210
1245
|
scale: e.scale,
|
|
1211
1246
|
rotate: e.rotate,
|
|
1212
1247
|
opacity: e.opacity,
|
|
1213
|
-
children: e.children.map((
|
|
1248
|
+
children: e.children.map((s, l) => x(s, l))
|
|
1214
1249
|
},
|
|
1215
1250
|
a
|
|
1216
1251
|
);
|
|
1217
1252
|
case "morph":
|
|
1218
|
-
return /* @__PURE__ */
|
|
1219
|
-
|
|
1253
|
+
return /* @__PURE__ */ c(
|
|
1254
|
+
De,
|
|
1220
1255
|
{
|
|
1221
1256
|
duration: e.duration,
|
|
1222
|
-
easing:
|
|
1223
|
-
fromColor:
|
|
1224
|
-
toColor:
|
|
1257
|
+
easing: o(e.easing),
|
|
1258
|
+
fromColor: u(e.fromColor),
|
|
1259
|
+
toColor: u(e.toColor),
|
|
1225
1260
|
fromOpacity: e.fromOpacity,
|
|
1226
1261
|
toOpacity: e.toOpacity,
|
|
1227
1262
|
fromScale: e.fromScale,
|
|
1228
1263
|
toScale: e.toScale,
|
|
1229
|
-
children: e.children.map((
|
|
1264
|
+
children: e.children.map((s, l) => x(s, l))
|
|
1230
1265
|
},
|
|
1231
1266
|
a
|
|
1232
1267
|
);
|
|
1233
1268
|
case "stagger":
|
|
1234
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ c(_e, { staggerDelay: e.staggerDelay, easing: o(e.easing), children: e.children.map((s, l) => x(s, l)) }, a);
|
|
1235
1270
|
case "parallel":
|
|
1236
|
-
return /* @__PURE__ */
|
|
1271
|
+
return /* @__PURE__ */ c(Ne, { children: e.children.map((s, l) => x(s, l)) }, a);
|
|
1237
1272
|
case "scene":
|
|
1238
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ c(Q.Fragment, { children: H(e) }, a);
|
|
1239
1274
|
case "player":
|
|
1240
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ c(Q.Fragment, { children: ce(e) }, a);
|
|
1241
1276
|
default:
|
|
1242
1277
|
return null;
|
|
1243
1278
|
}
|
|
1244
1279
|
}
|
|
1245
|
-
|
|
1280
|
+
const le = {
|
|
1281
|
+
background: "#0a0a1e",
|
|
1282
|
+
title: "#e0e7ff",
|
|
1283
|
+
subtitle: "#94a3b8",
|
|
1284
|
+
primary: "#4fc3f7",
|
|
1285
|
+
secondary: "#a78bfa",
|
|
1286
|
+
tertiary: "#f472b6",
|
|
1287
|
+
muted: "#64748b",
|
|
1288
|
+
text: "#c8d6e5",
|
|
1289
|
+
boxFill: "rgba(79,195,247,0.12)",
|
|
1290
|
+
boxStroke: "#4fc3f7",
|
|
1291
|
+
success: "#34d399",
|
|
1292
|
+
warning: "#fbbf24",
|
|
1293
|
+
error: "#f87171",
|
|
1294
|
+
palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
|
|
1295
|
+
}, Ht = {
|
|
1296
|
+
background: "#f8fafc",
|
|
1297
|
+
title: "#1e293b",
|
|
1298
|
+
subtitle: "#64748b",
|
|
1299
|
+
primary: "#2563eb",
|
|
1300
|
+
secondary: "#7c3aed",
|
|
1301
|
+
tertiary: "#db2777",
|
|
1302
|
+
muted: "#94a3b8",
|
|
1303
|
+
text: "#334155",
|
|
1304
|
+
boxFill: "rgba(37,99,235,0.08)",
|
|
1305
|
+
boxStroke: "#2563eb",
|
|
1306
|
+
success: "#16a34a",
|
|
1307
|
+
warning: "#d97706",
|
|
1308
|
+
error: "#dc2626",
|
|
1309
|
+
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1310
|
+
};
|
|
1311
|
+
function Gt(e) {
|
|
1246
1312
|
if (!e) return {};
|
|
1247
1313
|
const a = {};
|
|
1248
1314
|
for (const [t, r] of Object.entries(e))
|
|
1249
1315
|
r !== void 0 && (a[`--elucim-${t}`] = r);
|
|
1250
1316
|
return a;
|
|
1251
1317
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1318
|
+
function ue(e) {
|
|
1319
|
+
return {
|
|
1320
|
+
"--elucim-foreground": e.text,
|
|
1321
|
+
"--elucim-background": e.background,
|
|
1322
|
+
"--elucim-title": e.title,
|
|
1323
|
+
"--elucim-subtitle": e.subtitle,
|
|
1324
|
+
"--elucim-accent": e.primary,
|
|
1325
|
+
"--elucim-muted": e.muted,
|
|
1326
|
+
"--elucim-surface": e.background,
|
|
1327
|
+
"--elucim-primary": e.primary,
|
|
1328
|
+
"--elucim-secondary": e.secondary,
|
|
1329
|
+
"--elucim-tertiary": e.tertiary,
|
|
1330
|
+
"--elucim-success": e.success,
|
|
1331
|
+
"--elucim-warning": e.warning,
|
|
1332
|
+
"--elucim-error": e.error
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
const Kt = ue(le), Qt = ue(Ht);
|
|
1336
|
+
function Xt(e) {
|
|
1337
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {
|
|
1338
|
+
};
|
|
1339
|
+
const a = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1340
|
+
return a.addEventListener("change", e), () => a.removeEventListener("change", e);
|
|
1341
|
+
}
|
|
1342
|
+
function Jt() {
|
|
1343
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1344
|
+
}
|
|
1345
|
+
function Yt() {
|
|
1346
|
+
return !0;
|
|
1347
|
+
}
|
|
1348
|
+
function Zt() {
|
|
1349
|
+
return ht(Xt, Jt, Yt);
|
|
1350
|
+
}
|
|
1351
|
+
const la = ct(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, onError: l }, $) {
|
|
1352
|
+
const d = lt(null), E = Zt();
|
|
1353
|
+
ut($, () => ({
|
|
1255
1354
|
getSvgElement: () => {
|
|
1256
|
-
var
|
|
1257
|
-
return ((
|
|
1355
|
+
var f;
|
|
1356
|
+
return ((f = d.current) == null ? void 0 : f.getSvgElement()) ?? null;
|
|
1258
1357
|
},
|
|
1259
|
-
seekToFrame: (
|
|
1260
|
-
var
|
|
1261
|
-
return (
|
|
1358
|
+
seekToFrame: (f) => {
|
|
1359
|
+
var I;
|
|
1360
|
+
return (I = d.current) == null ? void 0 : I.seekToFrame(f);
|
|
1262
1361
|
},
|
|
1263
1362
|
getTotalFrames: () => {
|
|
1264
|
-
var
|
|
1265
|
-
return ((
|
|
1363
|
+
var f;
|
|
1364
|
+
return ((f = d.current) == null ? void 0 : f.getTotalFrames()) ?? 0;
|
|
1266
1365
|
},
|
|
1267
1366
|
play: () => {
|
|
1268
|
-
var
|
|
1269
|
-
return (
|
|
1367
|
+
var f;
|
|
1368
|
+
return (f = d.current) == null ? void 0 : f.play();
|
|
1270
1369
|
},
|
|
1271
1370
|
pause: () => {
|
|
1272
|
-
var
|
|
1273
|
-
return (
|
|
1371
|
+
var f;
|
|
1372
|
+
return (f = d.current) == null ? void 0 : f.pause();
|
|
1274
1373
|
},
|
|
1275
1374
|
isPlaying: () => {
|
|
1276
|
-
var
|
|
1277
|
-
return ((
|
|
1375
|
+
var f;
|
|
1376
|
+
return ((f = d.current) == null ? void 0 : f.isPlaying()) ?? !1;
|
|
1278
1377
|
}
|
|
1279
1378
|
}));
|
|
1280
|
-
const
|
|
1281
|
-
if (!
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
const
|
|
1285
|
-
for (const
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1379
|
+
const w = te(a);
|
|
1380
|
+
if (!w.valid) {
|
|
1381
|
+
const f = w.errors.filter((y) => y.severity === "error").map((y) => ({ path: y.path, message: y.message }));
|
|
1382
|
+
l == null || l(f);
|
|
1383
|
+
const I = /* @__PURE__ */ new Map();
|
|
1384
|
+
for (const y of f) {
|
|
1385
|
+
const T = y.path.split("."), M = T.length > 1 ? T.slice(0, -1).join(".") : y.path, _ = I.get(M) ?? [];
|
|
1386
|
+
_.push(y), I.set(M, _);
|
|
1288
1387
|
}
|
|
1289
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ R(
|
|
1290
1389
|
"div",
|
|
1291
1390
|
{
|
|
1292
1391
|
className: t,
|
|
1293
1392
|
style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...r },
|
|
1294
1393
|
"data-testid": "dsl-error",
|
|
1295
1394
|
children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1395
|
+
/* @__PURE__ */ R("strong", { children: [
|
|
1297
1396
|
"Elucim DSL Validation Errors (",
|
|
1298
|
-
|
|
1397
|
+
f.length,
|
|
1299
1398
|
"):"
|
|
1300
1399
|
] }),
|
|
1301
|
-
[...
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
|
|
1400
|
+
[...I.entries()].map(([y, T]) => /* @__PURE__ */ R("details", { open: !0, style: { marginTop: 8 }, children: [
|
|
1401
|
+
/* @__PURE__ */ R("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
|
|
1402
|
+
y,
|
|
1304
1403
|
" (",
|
|
1305
|
-
|
|
1404
|
+
T.length,
|
|
1306
1405
|
")"
|
|
1307
1406
|
] }),
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ c("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: T.map((M, _) => /* @__PURE__ */ R("li", { children: [
|
|
1408
|
+
/* @__PURE__ */ c("code", { style: { color: "#ffa07a" }, children: M.path }),
|
|
1310
1409
|
": ",
|
|
1311
|
-
|
|
1312
|
-
] },
|
|
1313
|
-
] },
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1410
|
+
M.message
|
|
1411
|
+
] }, _)) })
|
|
1412
|
+
] }, y)),
|
|
1413
|
+
/* @__PURE__ */ R("details", { style: { marginTop: 12 }, children: [
|
|
1414
|
+
/* @__PURE__ */ c("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
|
|
1415
|
+
/* @__PURE__ */ c("pre", { style: { fontSize: 11, maxHeight: 300, overflow: "auto", marginTop: 4, padding: 8, background: "rgba(0,0,0,0.3)", borderRadius: 4 }, children: JSON.stringify(a, null, 2) })
|
|
1317
1416
|
] })
|
|
1318
1417
|
]
|
|
1319
1418
|
}
|
|
1320
1419
|
);
|
|
1321
1420
|
}
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
|
|
1421
|
+
const m = Gt(i);
|
|
1422
|
+
let b = {};
|
|
1423
|
+
n && (b = (n === "auto" ? E : n === "dark") ? Kt : Qt);
|
|
1424
|
+
const O = s !== void 0 ? ea(s, a) : void 0;
|
|
1425
|
+
return /* @__PURE__ */ c("div", { className: t, style: { ...b, ...m, ...r }, "data-testid": "dsl-root", children: se(a.root, {
|
|
1426
|
+
frame: O == null ? void 0 : O.frame,
|
|
1325
1427
|
playerRef: d
|
|
1326
1428
|
}) });
|
|
1327
1429
|
});
|
|
1328
|
-
function
|
|
1430
|
+
function ea(e, a) {
|
|
1329
1431
|
if (e === "first") return { frame: 0 };
|
|
1330
1432
|
if (e === "last") {
|
|
1331
1433
|
const r = a.root.durationInFrames ?? 1;
|
|
@@ -1333,22 +1435,22 @@ function Lt(e, a) {
|
|
|
1333
1435
|
}
|
|
1334
1436
|
return { frame: e };
|
|
1335
1437
|
}
|
|
1336
|
-
function
|
|
1337
|
-
const r =
|
|
1438
|
+
function ua(e, a, t) {
|
|
1439
|
+
const r = te(e);
|
|
1338
1440
|
if (!r.valid) {
|
|
1339
|
-
const
|
|
1441
|
+
const s = r.errors.filter((l) => l.severity === "error");
|
|
1340
1442
|
throw new Error(
|
|
1341
1443
|
`DSL validation failed:
|
|
1342
|
-
${
|
|
1444
|
+
${s.map((l) => ` ${l.path}: ${l.message}`).join(`
|
|
1343
1445
|
`)}`
|
|
1344
1446
|
);
|
|
1345
1447
|
}
|
|
1346
1448
|
const i = { ...e.root };
|
|
1347
1449
|
t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
|
|
1348
|
-
const n =
|
|
1349
|
-
return
|
|
1450
|
+
const n = se(i, { frame: a });
|
|
1451
|
+
return ft(n);
|
|
1350
1452
|
}
|
|
1351
|
-
class
|
|
1453
|
+
class ta {
|
|
1352
1454
|
constructor(a, t = 30, r = 900, i = 640) {
|
|
1353
1455
|
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
|
|
1354
1456
|
}
|
|
@@ -1451,7 +1553,7 @@ class jt {
|
|
|
1451
1553
|
}
|
|
1452
1554
|
/** Add an arrow */
|
|
1453
1555
|
arrow(a, t, r, i, n) {
|
|
1454
|
-
const
|
|
1556
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12, l = {
|
|
1455
1557
|
type: "arrow",
|
|
1456
1558
|
x1: a,
|
|
1457
1559
|
y1: t,
|
|
@@ -1461,13 +1563,13 @@ class jt {
|
|
|
1461
1563
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 2,
|
|
1462
1564
|
headSize: (n == null ? void 0 : n.headSize) ?? 8,
|
|
1463
1565
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1464
|
-
fadeIn:
|
|
1566
|
+
fadeIn: s
|
|
1465
1567
|
};
|
|
1466
|
-
return this.addAtCursor(
|
|
1568
|
+
return this.addAtCursor(l, (n == null ? void 0 : n.advance) ?? 3);
|
|
1467
1569
|
}
|
|
1468
1570
|
/** Add a line */
|
|
1469
1571
|
line(a, t, r, i, n) {
|
|
1470
|
-
const
|
|
1572
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1471
1573
|
return this.addAtCursor({
|
|
1472
1574
|
type: "line",
|
|
1473
1575
|
x1: a,
|
|
@@ -1477,12 +1579,12 @@ class jt {
|
|
|
1477
1579
|
stroke: (n == null ? void 0 : n.color) ?? this.theme.muted,
|
|
1478
1580
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1,
|
|
1479
1581
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1480
|
-
fadeIn:
|
|
1582
|
+
fadeIn: s
|
|
1481
1583
|
}, (n == null ? void 0 : n.advance) ?? 3);
|
|
1482
1584
|
}
|
|
1483
1585
|
/** Add a rectangle */
|
|
1484
1586
|
rect(a, t, r, i, n) {
|
|
1485
|
-
const
|
|
1587
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1486
1588
|
return this.addAtCursor({
|
|
1487
1589
|
type: "rect",
|
|
1488
1590
|
x: a,
|
|
@@ -1494,7 +1596,7 @@ class jt {
|
|
|
1494
1596
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1.5,
|
|
1495
1597
|
rx: (n == null ? void 0 : n.rx) ?? 6,
|
|
1496
1598
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1497
|
-
fadeIn:
|
|
1599
|
+
fadeIn: s
|
|
1498
1600
|
}, (n == null ? void 0 : n.advance) ?? 5);
|
|
1499
1601
|
}
|
|
1500
1602
|
/** Add a circle */
|
|
@@ -1567,33 +1669,33 @@ class jt {
|
|
|
1567
1669
|
* Returns the box positions for follow-up arrows, etc.
|
|
1568
1670
|
*/
|
|
1569
1671
|
boxRow(a, t) {
|
|
1570
|
-
const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12,
|
|
1672
|
+
const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, s = (t == null ? void 0 : t.y) ?? 250, l = a.length * r + (a.length - 1) * n, $ = (this._width - l) / 2;
|
|
1571
1673
|
t == null || t.fadeIn;
|
|
1572
|
-
const
|
|
1573
|
-
const
|
|
1574
|
-
return { x:
|
|
1575
|
-
}), E = a.map((
|
|
1576
|
-
var
|
|
1577
|
-
const
|
|
1674
|
+
const d = a.map((w, m) => {
|
|
1675
|
+
const b = $ + m * (r + n);
|
|
1676
|
+
return { x: b, y: s, w: r, h: i, cx: b + r / 2, cy: s + i / 2 };
|
|
1677
|
+
}), E = a.map((w, m) => {
|
|
1678
|
+
var I, y;
|
|
1679
|
+
const b = d[m], O = ((I = t == null ? void 0 : t.colors) == null ? void 0 : I[m]) ?? this.theme.boxFill, f = ((y = t == null ? void 0 : t.strokeColors) == null ? void 0 : y[m]) ?? this.theme.boxStroke;
|
|
1578
1680
|
return {
|
|
1579
1681
|
type: "group",
|
|
1580
1682
|
children: [
|
|
1581
1683
|
{
|
|
1582
1684
|
type: "rect",
|
|
1583
|
-
x:
|
|
1584
|
-
y:
|
|
1685
|
+
x: b.x,
|
|
1686
|
+
y: b.y,
|
|
1585
1687
|
width: r,
|
|
1586
1688
|
height: i,
|
|
1587
|
-
fill:
|
|
1588
|
-
stroke:
|
|
1689
|
+
fill: O,
|
|
1690
|
+
stroke: f,
|
|
1589
1691
|
strokeWidth: 1.5,
|
|
1590
1692
|
rx: 6
|
|
1591
1693
|
},
|
|
1592
1694
|
{
|
|
1593
1695
|
type: "text",
|
|
1594
|
-
x:
|
|
1595
|
-
y:
|
|
1596
|
-
content:
|
|
1696
|
+
x: b.cx,
|
|
1697
|
+
y: b.cy + 5,
|
|
1698
|
+
content: w,
|
|
1597
1699
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1598
1700
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1599
1701
|
textAnchor: "middle",
|
|
@@ -1606,38 +1708,38 @@ class jt {
|
|
|
1606
1708
|
type: "stagger",
|
|
1607
1709
|
staggerDelay: 3,
|
|
1608
1710
|
children: E
|
|
1609
|
-
}, 8 + a.length * 2),
|
|
1711
|
+
}, 8 + a.length * 2), d;
|
|
1610
1712
|
}
|
|
1611
1713
|
/**
|
|
1612
1714
|
* Render a vertical stack of labeled boxes.
|
|
1613
1715
|
*/
|
|
1614
1716
|
boxColumn(a, t) {
|
|
1615
|
-
const r = (t == null ? void 0 : t.boxWidth) ?? 160, i = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8,
|
|
1717
|
+
const r = (t == null ? void 0 : t.boxWidth) ?? 160, i = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8, s = (t == null ? void 0 : t.y) ?? 150, l = (t == null ? void 0 : t.x) ?? this.cx;
|
|
1616
1718
|
t == null || t.fadeIn;
|
|
1617
|
-
const
|
|
1618
|
-
const
|
|
1619
|
-
return { x:
|
|
1620
|
-
}),
|
|
1621
|
-
var
|
|
1622
|
-
const
|
|
1719
|
+
const $ = a.map((E, w) => {
|
|
1720
|
+
const m = s + w * (i + n);
|
|
1721
|
+
return { x: l - r / 2, y: m, w: r, h: i, cx: l, cy: m + i / 2 };
|
|
1722
|
+
}), d = a.map((E, w) => {
|
|
1723
|
+
var O, f;
|
|
1724
|
+
const m = $[w], b = ((O = t == null ? void 0 : t.colors) == null ? void 0 : O[w]) ?? this.theme.boxFill;
|
|
1623
1725
|
return {
|
|
1624
1726
|
type: "group",
|
|
1625
1727
|
children: [
|
|
1626
1728
|
{
|
|
1627
1729
|
type: "rect",
|
|
1628
|
-
x:
|
|
1629
|
-
y:
|
|
1730
|
+
x: m.x,
|
|
1731
|
+
y: m.y,
|
|
1630
1732
|
width: r,
|
|
1631
1733
|
height: i,
|
|
1632
|
-
fill:
|
|
1633
|
-
stroke: (
|
|
1734
|
+
fill: b,
|
|
1735
|
+
stroke: (f = t == null ? void 0 : t.colors) != null && f[w] ? t.colors[w] : this.theme.boxStroke,
|
|
1634
1736
|
strokeWidth: 1.5,
|
|
1635
1737
|
rx: 6
|
|
1636
1738
|
},
|
|
1637
1739
|
{
|
|
1638
1740
|
type: "text",
|
|
1639
|
-
x:
|
|
1640
|
-
y:
|
|
1741
|
+
x: m.cx,
|
|
1742
|
+
y: m.cy + 5,
|
|
1641
1743
|
content: E,
|
|
1642
1744
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1643
1745
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
@@ -1649,8 +1751,8 @@ class jt {
|
|
|
1649
1751
|
return this.addAtCursor({
|
|
1650
1752
|
type: "stagger",
|
|
1651
1753
|
staggerDelay: 3,
|
|
1652
|
-
children:
|
|
1653
|
-
}, 8 + a.length * 2),
|
|
1754
|
+
children: d
|
|
1755
|
+
}, 8 + a.length * 2), $;
|
|
1654
1756
|
}
|
|
1655
1757
|
/**
|
|
1656
1758
|
* Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
|
|
@@ -1658,13 +1760,13 @@ class jt {
|
|
|
1658
1760
|
connectDown(a, t) {
|
|
1659
1761
|
const r = [];
|
|
1660
1762
|
for (let i = 0; i < a.length - 1; i++) {
|
|
1661
|
-
const n = a[i],
|
|
1763
|
+
const n = a[i], s = a[i + 1];
|
|
1662
1764
|
r.push({
|
|
1663
1765
|
type: "arrow",
|
|
1664
1766
|
x1: n.cx,
|
|
1665
1767
|
y1: n.y + n.h + 2,
|
|
1666
|
-
x2:
|
|
1667
|
-
y2:
|
|
1768
|
+
x2: s.cx,
|
|
1769
|
+
y2: s.y - 2,
|
|
1668
1770
|
stroke: (t == null ? void 0 : t.color) ?? this.theme.muted,
|
|
1669
1771
|
strokeWidth: 1.5,
|
|
1670
1772
|
headSize: (t == null ? void 0 : t.headSize) ?? 6
|
|
@@ -1733,40 +1835,9 @@ class jt {
|
|
|
1733
1835
|
return { elements: this.elements, durationInFrames: a };
|
|
1734
1836
|
}
|
|
1735
1837
|
}
|
|
1736
|
-
|
|
1737
|
-
background: "#0a0a1e",
|
|
1738
|
-
title: "#e0e7ff",
|
|
1739
|
-
subtitle: "#94a3b8",
|
|
1740
|
-
primary: "#4fc3f7",
|
|
1741
|
-
secondary: "#a78bfa",
|
|
1742
|
-
tertiary: "#f472b6",
|
|
1743
|
-
muted: "#64748b",
|
|
1744
|
-
text: "#c8d6e5",
|
|
1745
|
-
boxFill: "rgba(79,195,247,0.12)",
|
|
1746
|
-
boxStroke: "#4fc3f7",
|
|
1747
|
-
success: "#34d399",
|
|
1748
|
-
warning: "#fbbf24",
|
|
1749
|
-
error: "#f87171",
|
|
1750
|
-
palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
|
|
1751
|
-
}, Yt = {
|
|
1752
|
-
background: "#f8fafc",
|
|
1753
|
-
title: "#1e293b",
|
|
1754
|
-
subtitle: "#64748b",
|
|
1755
|
-
primary: "#2563eb",
|
|
1756
|
-
secondary: "#7c3aed",
|
|
1757
|
-
tertiary: "#db2777",
|
|
1758
|
-
muted: "#94a3b8",
|
|
1759
|
-
text: "#334155",
|
|
1760
|
-
boxFill: "rgba(37,99,235,0.08)",
|
|
1761
|
-
boxStroke: "#2563eb",
|
|
1762
|
-
success: "#16a34a",
|
|
1763
|
-
warning: "#d97706",
|
|
1764
|
-
error: "#dc2626",
|
|
1765
|
-
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1766
|
-
};
|
|
1767
|
-
class Bt {
|
|
1838
|
+
class aa {
|
|
1768
1839
|
constructor(a, t, r) {
|
|
1769
|
-
this._slides = [], this._title = a, this._theme = t ??
|
|
1840
|
+
this._slides = [], this._title = a, this._theme = t ?? le, this._opts = {
|
|
1770
1841
|
width: 900,
|
|
1771
1842
|
height: 640,
|
|
1772
1843
|
fps: 30,
|
|
@@ -1784,14 +1855,14 @@ class Bt {
|
|
|
1784
1855
|
/** Build the final ElucimDocument */
|
|
1785
1856
|
build() {
|
|
1786
1857
|
const a = this._slides.map((r) => {
|
|
1787
|
-
const i = new
|
|
1858
|
+
const i = new ta(
|
|
1788
1859
|
this._theme,
|
|
1789
1860
|
this._opts.fps,
|
|
1790
1861
|
this._opts.width,
|
|
1791
1862
|
this._opts.height
|
|
1792
1863
|
);
|
|
1793
1864
|
r.build(i);
|
|
1794
|
-
const { elements: n, durationInFrames:
|
|
1865
|
+
const { elements: n, durationInFrames: s } = i._build();
|
|
1795
1866
|
return {
|
|
1796
1867
|
type: "slide",
|
|
1797
1868
|
title: r.title,
|
|
@@ -1802,7 +1873,7 @@ class Bt {
|
|
|
1802
1873
|
width: this._opts.width,
|
|
1803
1874
|
height: this._opts.height,
|
|
1804
1875
|
fps: this._opts.fps,
|
|
1805
|
-
durationInFrames:
|
|
1876
|
+
durationInFrames: s,
|
|
1806
1877
|
controls: !1,
|
|
1807
1878
|
loop: !1,
|
|
1808
1879
|
autoPlay: !0,
|
|
@@ -1830,29 +1901,29 @@ class Bt {
|
|
|
1830
1901
|
return JSON.stringify(this.build(), null, a ? 2 : void 0);
|
|
1831
1902
|
}
|
|
1832
1903
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return new
|
|
1904
|
+
function ha(e, a, t) {
|
|
1905
|
+
return new aa(e, a, t);
|
|
1835
1906
|
}
|
|
1836
1907
|
export {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1908
|
+
la as DslRenderer,
|
|
1909
|
+
aa as PresentationBuilder,
|
|
1910
|
+
ne as SEMANTIC_TOKENS,
|
|
1911
|
+
ta as SlideBuilder,
|
|
1912
|
+
ca as TOKEN_NAMES,
|
|
1913
|
+
ot as compileExpression,
|
|
1914
|
+
gt as compileVectorExpression,
|
|
1915
|
+
le as darkTheme,
|
|
1916
|
+
Ht as lightTheme,
|
|
1917
|
+
ha as presentation,
|
|
1847
1918
|
x as renderElement,
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1919
|
+
ce as renderPlayer,
|
|
1920
|
+
Bt as renderPresentation,
|
|
1921
|
+
se as renderRoot,
|
|
1922
|
+
H as renderScene,
|
|
1923
|
+
Ut as renderSlide,
|
|
1924
|
+
ua as renderToSvgString,
|
|
1925
|
+
u as resolveColor,
|
|
1926
|
+
o as resolveEasing,
|
|
1927
|
+
te as validate,
|
|
1928
|
+
ee as validateExpression
|
|
1858
1929
|
};
|