@elucim/dsl 0.5.0 → 0.6.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/index.js +333 -300
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
1
|
+
import { easeOutBounce as ne, easeOutElastic as se, easeOutBack as ce, easeInBack as le, easeInOutExpo as ue, easeOutExpo as he, easeInExpo as fe, easeInOutSine as ge, easeOutSine as oe, easeInSine as ye, easeInOutQuart as me, easeOutQuart as be, easeInQuart as xe, easeInOutCubic as ve, easeOutCubic as de, easeInCubic as ke, easeInOutQuad as we, easeOutQuad as Ie, easeInQuad as Se, linear as $e, spring as Oe, cubicBezier as Ae, Presentation as Ce, Scene as ze, Player as pe, Slide as Ee, Parallel as Fe, Stagger as Pe, Morph as Re, Transform as Ne, Write as Te, Draw as Me, FadeOut as We, FadeIn as _e, BarChart as De, LaTeX as Ve, Graph as Le, Matrix as je, Text as _, VectorField as qe, Vector as Be, FunctionPlot as Ue, Axes as He, Image as Ge, Polygon as Ke, Rect as Qe, Arrow as Xe, Line as Je, Circle as Ye, BezierCurve as Ze, Group as et, Sequence as tt } from "@elucim/core";
|
|
2
|
+
import { jsx as c, jsxs as F } from "react/jsx-runtime";
|
|
3
|
+
import H, { forwardRef as at, useRef as rt, useImperativeHandle as it } from "react";
|
|
4
4
|
import { renderToStaticMarkup as nt } from "react-dom/server";
|
|
5
|
-
const
|
|
5
|
+
const L = {
|
|
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
|
+
}, G = {
|
|
26
26
|
PI: Math.PI,
|
|
27
27
|
E: Math.E,
|
|
28
28
|
TAU: Math.PI * 2
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function B(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;
|
|
@@ -90,7 +90,7 @@ function q(e) {
|
|
|
90
90
|
}
|
|
91
91
|
return a.push({ type: "EOF", value: "", pos: t }), a;
|
|
92
92
|
}
|
|
93
|
-
class
|
|
93
|
+
class U {
|
|
94
94
|
constructor(a) {
|
|
95
95
|
this.pos = 0, this.tokens = a;
|
|
96
96
|
}
|
|
@@ -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(
|
|
171
|
+
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(L, t))
|
|
172
172
|
throw new I(
|
|
173
|
-
`Unknown function '${t}'. Available: ${Object.keys(
|
|
173
|
+
`Unknown function '${t}'. Available: ${Object.keys(L).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(G, t) ? { kind: "number", value: G[t] } : { kind: "variable", name: t };
|
|
179
179
|
}
|
|
180
180
|
if (a.type === "LPAREN") {
|
|
181
181
|
this.advance();
|
|
@@ -223,7 +223,7 @@ function z(e, a) {
|
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
225
|
case "call": {
|
|
226
|
-
const r =
|
|
226
|
+
const r = L[e.name], i = e.args.map((n) => z(n, a));
|
|
227
227
|
return r(...i);
|
|
228
228
|
}
|
|
229
229
|
case "array":
|
|
@@ -237,11 +237,11 @@ class I extends Error {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
function st(e) {
|
|
240
|
-
const a =
|
|
240
|
+
const a = B(e), t = new U(a).parse();
|
|
241
241
|
return (r) => z(t, r);
|
|
242
242
|
}
|
|
243
243
|
function ct(e) {
|
|
244
|
-
const a =
|
|
244
|
+
const a = B(e), t = new U(a).parse();
|
|
245
245
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
246
246
|
throw new I(
|
|
247
247
|
'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
|
|
@@ -249,59 +249,59 @@ function ct(e) {
|
|
|
249
249
|
);
|
|
250
250
|
return (r) => z(t, r);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function J(e) {
|
|
253
253
|
try {
|
|
254
|
-
const a =
|
|
255
|
-
return new
|
|
254
|
+
const a = B(e);
|
|
255
|
+
return new U(a).parse(), null;
|
|
256
256
|
} catch (a) {
|
|
257
257
|
return a instanceof I ? `${a.message} (at position ${a.position})` : String(a);
|
|
258
258
|
}
|
|
259
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:
|
|
260
|
+
const j = {
|
|
261
|
+
linear: $e,
|
|
262
|
+
easeInQuad: Se,
|
|
263
|
+
easeOutQuad: Ie,
|
|
264
|
+
easeInOutQuad: we,
|
|
265
|
+
easeInCubic: ke,
|
|
266
|
+
easeOutCubic: de,
|
|
267
|
+
easeInOutCubic: ve,
|
|
268
|
+
easeInQuart: xe,
|
|
269
|
+
easeOutQuart: be,
|
|
270
|
+
easeInOutQuart: me,
|
|
271
|
+
easeInSine: ye,
|
|
272
|
+
easeOutSine: oe,
|
|
273
|
+
easeInOutSine: ge,
|
|
274
|
+
easeInExpo: fe,
|
|
275
|
+
easeOutExpo: he,
|
|
276
|
+
easeInOutExpo: ue,
|
|
277
|
+
easeInBack: le,
|
|
278
|
+
easeOutBack: ce,
|
|
279
|
+
easeOutElastic: se,
|
|
280
|
+
easeOutBounce: ne
|
|
281
281
|
};
|
|
282
|
-
function
|
|
282
|
+
function g(e) {
|
|
283
283
|
if (e !== void 0) {
|
|
284
284
|
if (typeof e == "string") {
|
|
285
|
-
const a =
|
|
285
|
+
const a = j[e];
|
|
286
286
|
if (!a) {
|
|
287
|
-
const t = Object.keys(
|
|
287
|
+
const t = Object.keys(j), 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 Oe({
|
|
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 Ae(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 D = Object.keys(j);
|
|
304
|
+
function Y(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 };
|
|
@@ -311,7 +311,7 @@ function J(e) {
|
|
|
311
311
|
errors: a
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const K = ["scene", "player", "presentation"], T = ["card", "slide", "square"], V = [
|
|
315
315
|
"sequence",
|
|
316
316
|
"group",
|
|
317
317
|
"bezierCurve",
|
|
@@ -340,22 +340,22 @@ const G = ["scene", "player", "presentation"], T = ["card", "slide", "square"],
|
|
|
340
340
|
"parallel",
|
|
341
341
|
"player",
|
|
342
342
|
"scene"
|
|
343
|
-
],
|
|
343
|
+
], Q = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
344
344
|
function lt(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 (!K.includes(r)) {
|
|
347
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${K.join(", ")}. Got "${r}"`, severity: "error" });
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
r === "scene" || r === "player" ?
|
|
350
|
+
r === "scene" || r === "player" ? Z(e, a, r, t) : r === "presentation" && ut(e, a, t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
Tt(e, "durationInFrames", a, r),
|
|
352
|
+
function Z(e, a, t, r) {
|
|
353
|
+
Tt(e, "durationInFrames", a, r), m(e, "width", a, r), m(e, "height", a, r), m(e, "fps", a, r), $(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !T.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${T.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (N(e, "controls", a, r), N(e, "loop", a, r), N(e, "autoPlay", a, r)), O(e, a, r);
|
|
354
354
|
}
|
|
355
355
|
function ut(e, a, t) {
|
|
356
|
-
if (
|
|
356
|
+
if (m(e, "width", a, t), m(e, "height", a, t), $(e, "background", a, t), m(e, "transitionDuration", a, t), N(e, "showHud", a, t), N(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !T.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${T.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (Q.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: ${Q.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" });
|
|
@@ -371,7 +371,7 @@ function ht(e, a, t) {
|
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
373
|
$(e, "title", a, t), $(e, "notes", a, t), $(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
|
|
374
|
-
|
|
374
|
+
ee(r, `${a}.children[${i}]`, t);
|
|
375
375
|
}) : t.push({ path: `${a}.children`, message: "Slide children must be an array", severity: "error" }));
|
|
376
376
|
}
|
|
377
377
|
function O(e, a, t) {
|
|
@@ -380,20 +380,20 @@ function O(e, a, t) {
|
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
e.children.forEach((r, i) => {
|
|
383
|
-
|
|
383
|
+
ee(r, `${a}.children[${i}]`, t);
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function ee(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 || !V.includes(r)) {
|
|
393
|
+
const i = r ? te(r, V) : "";
|
|
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: ${V.join(", ")}`,
|
|
397
397
|
severity: "error"
|
|
398
398
|
});
|
|
399
399
|
return;
|
|
@@ -473,32 +473,32 @@ function Z(e, a, t) {
|
|
|
473
473
|
break;
|
|
474
474
|
case "scene":
|
|
475
475
|
case "player":
|
|
476
|
-
|
|
476
|
+
Z(e, a, r, t);
|
|
477
477
|
break;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
function ft(e, a, t) {
|
|
481
|
-
|
|
481
|
+
f(e, "x1", a, t), f(e, "y1", a, t), f(e, "cx1", a, t), f(e, "cy1", a, t), f(e, "x2", a, t), f(e, "y2", a, t), e.cx2 !== void 0 && P(e, "cx2", a, t), e.cy2 !== void 0 && P(e, "cy2", a, t), d(e, a, t);
|
|
482
482
|
}
|
|
483
483
|
function gt(e, a, t) {
|
|
484
|
-
|
|
484
|
+
f(e, "cx", a, t), f(e, "cy", a, t), p(e, "r", a, t), d(e, a, t);
|
|
485
485
|
}
|
|
486
486
|
function ot(e, a, t) {
|
|
487
|
-
|
|
487
|
+
f(e, "x1", a, t), f(e, "y1", a, t), f(e, "x2", a, t), f(e, "y2", a, t), d(e, a, t);
|
|
488
488
|
}
|
|
489
489
|
function yt(e, a, t) {
|
|
490
|
-
|
|
490
|
+
f(e, "x1", a, t), f(e, "y1", a, t), f(e, "x2", a, t), f(e, "y2", a, t), d(e, a, t);
|
|
491
491
|
}
|
|
492
492
|
function mt(e, a, t) {
|
|
493
|
-
|
|
493
|
+
f(e, "x", a, t), f(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), d(e, a, t);
|
|
494
494
|
}
|
|
495
495
|
function bt(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
|
-
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }),
|
|
498
|
+
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), d(e, a, t);
|
|
499
499
|
}
|
|
500
500
|
function xt(e, a, t) {
|
|
501
|
-
|
|
501
|
+
f(e, "x", a, t), f(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), d(e, a, t);
|
|
502
502
|
}
|
|
503
503
|
function vt(e, a, t) {
|
|
504
504
|
k(e, "domain", a, t), k(e, "range", a, t), k(e, "origin", a, t), M(e, a, t);
|
|
@@ -507,7 +507,7 @@ function dt(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 = J(e.fn);
|
|
511
511
|
r && t.push({ path: `${a}.fn`, message: `Invalid expression: ${r}`, severity: "error" });
|
|
512
512
|
}
|
|
513
513
|
k(e, "domain", a, t), M(e, a, t);
|
|
@@ -519,7 +519,7 @@ function wt(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 = J(e.fn);
|
|
523
523
|
r && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${r}`, severity: "error" });
|
|
524
524
|
}
|
|
525
525
|
k(e, "domain", a, t), k(e, "range", a, t), M(e, a, t);
|
|
@@ -527,7 +527,7 @@ function wt(e, a, t) {
|
|
|
527
527
|
function It(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
|
-
}) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }),
|
|
530
|
+
}) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), d(e, a, t);
|
|
531
531
|
}
|
|
532
532
|
function St(e, a, t) {
|
|
533
533
|
if (!Array.isArray(e.nodes))
|
|
@@ -535,24 +535,24 @@ function St(e, a, t) {
|
|
|
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)), f(i, "x", `${a}.nodes[${n}]`, t), f(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
|
+
d(e, a, t);
|
|
544
544
|
}
|
|
545
545
|
function $t(e, a, t) {
|
|
546
|
-
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }),
|
|
546
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), f(e, "x", a, t), f(e, "y", a, t), d(e, a, t);
|
|
547
547
|
}
|
|
548
548
|
function Ot(e, a, t) {
|
|
549
|
-
|
|
549
|
+
f(e, "from", a, t), Mt(e, "durationInFrames", a, t), O(e, a, t);
|
|
550
550
|
}
|
|
551
551
|
function At(e, a, t) {
|
|
552
|
-
|
|
552
|
+
m(e, "duration", a, t), R(e, a, t), O(e, a, t);
|
|
553
553
|
}
|
|
554
554
|
function Ct(e, a, t) {
|
|
555
|
-
if (
|
|
555
|
+
if (m(e, "duration", a, t), R(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
|
}
|
|
@@ -571,18 +571,18 @@ function Ct(e, a, t) {
|
|
|
571
571
|
O(e, a, t);
|
|
572
572
|
}
|
|
573
573
|
function zt(e, a, t) {
|
|
574
|
-
|
|
574
|
+
m(e, "duration", a, t), R(e, a, t), $(e, "fromColor", a, t), $(e, "toColor", a, t), O(e, a, t);
|
|
575
575
|
}
|
|
576
576
|
function pt(e, a, t) {
|
|
577
|
-
|
|
577
|
+
m(e, "staggerDelay", a, t), R(e, a, t), O(e, a, t);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
|
|
579
|
+
function d(e, a, t) {
|
|
580
|
+
m(e, "fadeIn", a, t), m(e, "fadeOut", a, t), m(e, "draw", a, t), R(e, a, t), Et(e, a, t);
|
|
581
581
|
}
|
|
582
582
|
function M(e, a, t) {
|
|
583
|
-
|
|
583
|
+
m(e, "fadeIn", a, t), m(e, "fadeOut", a, t), m(e, "draw", a, t), R(e, a, t), Ft(e, a, t);
|
|
584
584
|
}
|
|
585
|
-
const
|
|
585
|
+
const X = ["none", "circle", "ellipse"];
|
|
586
586
|
function Et(e, a, t) {
|
|
587
587
|
if (P(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), P(e, "zIndex", a, t), e.scale !== void 0) {
|
|
588
588
|
const r = e.scale;
|
|
@@ -593,26 +593,26 @@ function Ft(e, a, t) {
|
|
|
593
593
|
P(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), P(e, "zIndex", a, t);
|
|
594
594
|
}
|
|
595
595
|
function Pt(e, a, t) {
|
|
596
|
-
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }),
|
|
596
|
+
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), f(e, "x", a, t), f(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), $(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 && (X.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: ${X.join(", ")}`,
|
|
599
599
|
severity: "error"
|
|
600
|
-
})),
|
|
600
|
+
})), d(e, a, t);
|
|
601
601
|
}
|
|
602
602
|
function Rt(e, a, t) {
|
|
603
|
-
O(e, a, t),
|
|
603
|
+
O(e, a, t), d(e, a, t);
|
|
604
604
|
}
|
|
605
605
|
function Nt(e, a, t) {
|
|
606
|
-
|
|
606
|
+
f(e, "x", a, t), f(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" }), d(e, a, t);
|
|
607
607
|
}
|
|
608
608
|
function R(e, a, t) {
|
|
609
609
|
if (e.easing !== void 0) {
|
|
610
610
|
if (typeof e.easing == "string") {
|
|
611
|
-
if (!
|
|
612
|
-
const r =
|
|
611
|
+
if (!D.includes(e.easing)) {
|
|
612
|
+
const r = te(e.easing, D);
|
|
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: ${D.join(", ")}`,
|
|
616
616
|
severity: "error"
|
|
617
617
|
});
|
|
618
618
|
}
|
|
@@ -632,7 +632,7 @@ 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 f(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) {
|
|
@@ -642,7 +642,7 @@ function Tt(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 m(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
648
|
function Mt(e, a, t, r) {
|
|
@@ -662,13 +662,13 @@ 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 te(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
|
|
671
|
+
const ae = {
|
|
672
672
|
foreground: { cssVar: "--elucim-foreground", fallback: "#e0e0e0" },
|
|
673
673
|
background: { cssVar: "--elucim-background", fallback: "#0f172a" },
|
|
674
674
|
accent: { cssVar: "--elucim-accent", fallback: "#4fc3f7" },
|
|
@@ -681,11 +681,11 @@ const te = {
|
|
|
681
681
|
success: { cssVar: "--elucim-success", fallback: "#34d399" },
|
|
682
682
|
warning: { cssVar: "--elucim-warning", fallback: "#fbbf24" },
|
|
683
683
|
error: { cssVar: "--elucim-error", fallback: "#f87171" }
|
|
684
|
-
}, Qt = Object.keys(
|
|
685
|
-
function
|
|
684
|
+
}, Qt = Object.keys(ae);
|
|
685
|
+
function h(e) {
|
|
686
686
|
if (e === void 0) return;
|
|
687
687
|
if (!e.startsWith("$")) return e;
|
|
688
|
-
const a = e.slice(1), t =
|
|
688
|
+
const a = e.slice(1), t = ae[a];
|
|
689
689
|
return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
|
|
690
690
|
}
|
|
691
691
|
const Wt = {
|
|
@@ -698,14 +698,14 @@ function W(e, a, t) {
|
|
|
698
698
|
const [r, i] = Wt[e];
|
|
699
699
|
return { width: a ?? r, height: t ?? i };
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function re(e, a) {
|
|
702
702
|
switch (e.type) {
|
|
703
703
|
case "scene":
|
|
704
|
-
return
|
|
704
|
+
return q(e, a);
|
|
705
705
|
case "player":
|
|
706
706
|
if ((a == null ? void 0 : a.frame) !== void 0) {
|
|
707
707
|
const { width: t, height: r } = W(e.preset, e.width, e.height);
|
|
708
|
-
return
|
|
708
|
+
return q(
|
|
709
709
|
{
|
|
710
710
|
width: t,
|
|
711
711
|
height: r,
|
|
@@ -717,52 +717,52 @@ function ae(e, a) {
|
|
|
717
717
|
a
|
|
718
718
|
);
|
|
719
719
|
}
|
|
720
|
-
return
|
|
720
|
+
return ie(e, a);
|
|
721
721
|
case "presentation":
|
|
722
722
|
return _t(e);
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function q(e, a) {
|
|
726
726
|
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = W(e.preset, e.width, e.height);
|
|
727
|
-
return /* @__PURE__ */
|
|
728
|
-
|
|
727
|
+
return /* @__PURE__ */ c(
|
|
728
|
+
ze,
|
|
729
729
|
{
|
|
730
730
|
width: r,
|
|
731
731
|
height: i,
|
|
732
732
|
fps: e.fps,
|
|
733
733
|
durationInFrames: e.durationInFrames,
|
|
734
|
-
background:
|
|
734
|
+
background: h(e.background),
|
|
735
735
|
...t ? { frame: a.frame, autoPlay: !1 } : {},
|
|
736
|
-
children: e.children.map((n,
|
|
736
|
+
children: e.children.map((n, s) => v(n, s))
|
|
737
737
|
}
|
|
738
738
|
);
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function ie(e, a) {
|
|
741
741
|
const { width: t, height: r } = W(e.preset, e.width, e.height);
|
|
742
|
-
return /* @__PURE__ */
|
|
743
|
-
|
|
742
|
+
return /* @__PURE__ */ c(
|
|
743
|
+
pe,
|
|
744
744
|
{
|
|
745
745
|
ref: a == null ? void 0 : a.playerRef,
|
|
746
746
|
width: t,
|
|
747
747
|
height: r,
|
|
748
748
|
fps: e.fps,
|
|
749
749
|
durationInFrames: e.durationInFrames,
|
|
750
|
-
background:
|
|
750
|
+
background: h(e.background),
|
|
751
751
|
controls: e.controls,
|
|
752
752
|
loop: e.loop,
|
|
753
753
|
autoPlay: e.autoPlay,
|
|
754
|
-
children: e.children.map((i, n) =>
|
|
754
|
+
children: e.children.map((i, n) => v(i, n))
|
|
755
755
|
}
|
|
756
756
|
);
|
|
757
757
|
}
|
|
758
758
|
function _t(e) {
|
|
759
759
|
const { width: a, height: t } = W(e.preset, e.width, e.height);
|
|
760
|
-
return /* @__PURE__ */
|
|
761
|
-
|
|
760
|
+
return /* @__PURE__ */ c(
|
|
761
|
+
Ce,
|
|
762
762
|
{
|
|
763
763
|
width: a,
|
|
764
764
|
height: t,
|
|
765
|
-
background:
|
|
765
|
+
background: h(e.background),
|
|
766
766
|
transition: e.transition,
|
|
767
767
|
transitionDuration: e.transitionDuration,
|
|
768
768
|
showHUD: e.showHud,
|
|
@@ -773,30 +773,31 @@ function _t(e) {
|
|
|
773
773
|
}
|
|
774
774
|
function Dt(e, a) {
|
|
775
775
|
var t;
|
|
776
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ c(Ee, { title: e.title, notes: e.notes, background: h(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => v(r, i)) }, a);
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function v(e, a) {
|
|
779
|
+
var t, r, i, n;
|
|
779
780
|
switch (e.type) {
|
|
780
781
|
case "sequence":
|
|
781
|
-
return /* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ c(tt, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, l) => v(s, l)) }, a);
|
|
782
783
|
case "group":
|
|
783
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ c(
|
|
784
785
|
et,
|
|
785
786
|
{
|
|
786
787
|
fadeIn: e.fadeIn,
|
|
787
788
|
fadeOut: e.fadeOut,
|
|
788
|
-
easing:
|
|
789
|
+
easing: g(e.easing),
|
|
789
790
|
rotation: e.rotation,
|
|
790
791
|
rotationOrigin: e.rotationOrigin,
|
|
791
792
|
scale: e.scale,
|
|
792
793
|
translate: e.translate,
|
|
793
794
|
zIndex: e.zIndex,
|
|
794
|
-
children: e.children.map((
|
|
795
|
+
children: e.children.map((s, l) => v(s, l))
|
|
795
796
|
},
|
|
796
797
|
a
|
|
797
798
|
);
|
|
798
799
|
case "bezierCurve":
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ c(
|
|
800
801
|
Ze,
|
|
801
802
|
{
|
|
802
803
|
x1: e.x1,
|
|
@@ -807,15 +808,15 @@ function x(e, a) {
|
|
|
807
808
|
cy2: e.cy2,
|
|
808
809
|
x2: e.x2,
|
|
809
810
|
y2: e.y2,
|
|
810
|
-
stroke:
|
|
811
|
+
stroke: h(e.stroke),
|
|
811
812
|
strokeWidth: e.strokeWidth,
|
|
812
|
-
fill:
|
|
813
|
+
fill: h(e.fill),
|
|
813
814
|
strokeDasharray: e.strokeDasharray,
|
|
814
815
|
opacity: e.opacity,
|
|
815
816
|
fadeIn: e.fadeIn,
|
|
816
817
|
fadeOut: e.fadeOut,
|
|
817
818
|
draw: e.draw,
|
|
818
|
-
easing:
|
|
819
|
+
easing: g(e.easing),
|
|
819
820
|
rotation: e.rotation,
|
|
820
821
|
rotationOrigin: e.rotationOrigin,
|
|
821
822
|
scale: e.scale,
|
|
@@ -825,20 +826,20 @@ function x(e, a) {
|
|
|
825
826
|
a
|
|
826
827
|
);
|
|
827
828
|
case "circle":
|
|
828
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ c(
|
|
829
830
|
Ye,
|
|
830
831
|
{
|
|
831
832
|
cx: e.cx,
|
|
832
833
|
cy: e.cy,
|
|
833
834
|
r: e.r,
|
|
834
|
-
fill:
|
|
835
|
-
stroke:
|
|
835
|
+
fill: h(e.fill),
|
|
836
|
+
stroke: h(e.stroke),
|
|
836
837
|
strokeWidth: e.strokeWidth,
|
|
837
838
|
opacity: e.opacity,
|
|
838
839
|
fadeIn: e.fadeIn,
|
|
839
840
|
fadeOut: e.fadeOut,
|
|
840
841
|
draw: e.draw,
|
|
841
|
-
easing:
|
|
842
|
+
easing: g(e.easing),
|
|
842
843
|
rotation: e.rotation,
|
|
843
844
|
rotationOrigin: e.rotationOrigin,
|
|
844
845
|
scale: e.scale,
|
|
@@ -848,21 +849,21 @@ function x(e, a) {
|
|
|
848
849
|
a
|
|
849
850
|
);
|
|
850
851
|
case "line":
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
+
return /* @__PURE__ */ c(
|
|
852
853
|
Je,
|
|
853
854
|
{
|
|
854
855
|
x1: e.x1,
|
|
855
856
|
y1: e.y1,
|
|
856
857
|
x2: e.x2,
|
|
857
858
|
y2: e.y2,
|
|
858
|
-
stroke:
|
|
859
|
+
stroke: h(e.stroke),
|
|
859
860
|
strokeWidth: e.strokeWidth,
|
|
860
861
|
strokeDasharray: e.strokeDasharray,
|
|
861
862
|
opacity: e.opacity,
|
|
862
863
|
fadeIn: e.fadeIn,
|
|
863
864
|
fadeOut: e.fadeOut,
|
|
864
865
|
draw: e.draw,
|
|
865
|
-
easing:
|
|
866
|
+
easing: g(e.easing),
|
|
866
867
|
rotation: e.rotation,
|
|
867
868
|
rotationOrigin: e.rotationOrigin,
|
|
868
869
|
scale: e.scale,
|
|
@@ -872,14 +873,14 @@ function x(e, a) {
|
|
|
872
873
|
a
|
|
873
874
|
);
|
|
874
875
|
case "arrow":
|
|
875
|
-
return /* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ c(
|
|
876
877
|
Xe,
|
|
877
878
|
{
|
|
878
879
|
x1: e.x1,
|
|
879
880
|
y1: e.y1,
|
|
880
881
|
x2: e.x2,
|
|
881
882
|
y2: e.y2,
|
|
882
|
-
stroke:
|
|
883
|
+
stroke: h(e.stroke),
|
|
883
884
|
strokeWidth: e.strokeWidth,
|
|
884
885
|
headSize: e.headSize,
|
|
885
886
|
strokeDasharray: e.strokeDasharray,
|
|
@@ -887,7 +888,7 @@ function x(e, a) {
|
|
|
887
888
|
fadeIn: e.fadeIn,
|
|
888
889
|
fadeOut: e.fadeOut,
|
|
889
890
|
draw: e.draw,
|
|
890
|
-
easing:
|
|
891
|
+
easing: g(e.easing),
|
|
891
892
|
rotation: e.rotation,
|
|
892
893
|
rotationOrigin: e.rotationOrigin,
|
|
893
894
|
scale: e.scale,
|
|
@@ -897,15 +898,15 @@ function x(e, a) {
|
|
|
897
898
|
a
|
|
898
899
|
);
|
|
899
900
|
case "rect":
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ c(
|
|
901
902
|
Qe,
|
|
902
903
|
{
|
|
903
904
|
x: e.x,
|
|
904
905
|
y: e.y,
|
|
905
906
|
width: e.width,
|
|
906
907
|
height: e.height,
|
|
907
|
-
fill:
|
|
908
|
-
stroke:
|
|
908
|
+
fill: h(e.fill),
|
|
909
|
+
stroke: h(e.stroke),
|
|
909
910
|
strokeWidth: e.strokeWidth,
|
|
910
911
|
rx: e.rx,
|
|
911
912
|
ry: e.ry,
|
|
@@ -914,7 +915,7 @@ function x(e, a) {
|
|
|
914
915
|
fadeIn: e.fadeIn,
|
|
915
916
|
fadeOut: e.fadeOut,
|
|
916
917
|
draw: e.draw,
|
|
917
|
-
easing:
|
|
918
|
+
easing: g(e.easing),
|
|
918
919
|
rotation: e.rotation,
|
|
919
920
|
rotationOrigin: e.rotationOrigin,
|
|
920
921
|
scale: e.scale,
|
|
@@ -924,19 +925,19 @@ function x(e, a) {
|
|
|
924
925
|
a
|
|
925
926
|
);
|
|
926
927
|
case "polygon":
|
|
927
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ c(
|
|
928
929
|
Ke,
|
|
929
930
|
{
|
|
930
931
|
points: e.points,
|
|
931
|
-
fill:
|
|
932
|
-
stroke:
|
|
932
|
+
fill: h(e.fill),
|
|
933
|
+
stroke: h(e.stroke),
|
|
933
934
|
strokeWidth: e.strokeWidth,
|
|
934
935
|
closed: e.closed,
|
|
935
936
|
opacity: e.opacity,
|
|
936
937
|
fadeIn: e.fadeIn,
|
|
937
938
|
fadeOut: e.fadeOut,
|
|
938
939
|
draw: e.draw,
|
|
939
|
-
easing:
|
|
940
|
+
easing: g(e.easing),
|
|
940
941
|
rotation: e.rotation,
|
|
941
942
|
rotationOrigin: e.rotationOrigin,
|
|
942
943
|
scale: e.scale,
|
|
@@ -946,12 +947,12 @@ function x(e, a) {
|
|
|
946
947
|
a
|
|
947
948
|
);
|
|
948
949
|
case "text":
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
|
|
950
|
+
return /* @__PURE__ */ c(
|
|
951
|
+
_,
|
|
951
952
|
{
|
|
952
953
|
x: e.x,
|
|
953
954
|
y: e.y,
|
|
954
|
-
fill:
|
|
955
|
+
fill: h(e.fill),
|
|
955
956
|
fontSize: e.fontSize,
|
|
956
957
|
fontFamily: e.fontFamily,
|
|
957
958
|
fontWeight: e.fontWeight,
|
|
@@ -960,7 +961,7 @@ function x(e, a) {
|
|
|
960
961
|
opacity: e.opacity,
|
|
961
962
|
fadeIn: e.fadeIn,
|
|
962
963
|
fadeOut: e.fadeOut,
|
|
963
|
-
easing:
|
|
964
|
+
easing: g(e.easing),
|
|
964
965
|
rotation: e.rotation,
|
|
965
966
|
rotationOrigin: e.rotationOrigin,
|
|
966
967
|
scale: e.scale,
|
|
@@ -971,8 +972,8 @@ function x(e, a) {
|
|
|
971
972
|
a
|
|
972
973
|
);
|
|
973
974
|
case "image":
|
|
974
|
-
return /* @__PURE__ */
|
|
975
|
-
|
|
975
|
+
return /* @__PURE__ */ c(
|
|
976
|
+
Ge,
|
|
976
977
|
{
|
|
977
978
|
src: e.src,
|
|
978
979
|
x: e.x,
|
|
@@ -985,7 +986,7 @@ function x(e, a) {
|
|
|
985
986
|
opacity: e.opacity,
|
|
986
987
|
fadeIn: e.fadeIn,
|
|
987
988
|
fadeOut: e.fadeOut,
|
|
988
|
-
easing:
|
|
989
|
+
easing: g(e.easing),
|
|
989
990
|
rotation: e.rotation,
|
|
990
991
|
rotationOrigin: e.rotationOrigin,
|
|
991
992
|
scale: e.scale,
|
|
@@ -995,8 +996,8 @@ function x(e, a) {
|
|
|
995
996
|
a
|
|
996
997
|
);
|
|
997
998
|
case "axes":
|
|
998
|
-
return /* @__PURE__ */
|
|
999
|
-
|
|
999
|
+
return /* @__PURE__ */ c(
|
|
1000
|
+
He,
|
|
1000
1001
|
{
|
|
1001
1002
|
domain: e.domain,
|
|
1002
1003
|
range: e.range,
|
|
@@ -1006,14 +1007,14 @@ function x(e, a) {
|
|
|
1006
1007
|
showTicks: e.showTicks,
|
|
1007
1008
|
showLabels: e.showLabels,
|
|
1008
1009
|
tickStep: e.tickStep,
|
|
1009
|
-
axisColor:
|
|
1010
|
-
gridColor:
|
|
1011
|
-
labelColor:
|
|
1010
|
+
axisColor: h(e.axisColor),
|
|
1011
|
+
gridColor: h(e.gridColor),
|
|
1012
|
+
labelColor: h(e.labelColor),
|
|
1012
1013
|
labelFontSize: e.labelFontSize,
|
|
1013
1014
|
fadeIn: e.fadeIn,
|
|
1014
1015
|
fadeOut: e.fadeOut,
|
|
1015
1016
|
draw: e.draw,
|
|
1016
|
-
easing:
|
|
1017
|
+
easing: g(e.easing),
|
|
1017
1018
|
rotation: e.rotation,
|
|
1018
1019
|
rotationOrigin: e.rotationOrigin,
|
|
1019
1020
|
translate: e.translate,
|
|
@@ -1022,20 +1023,36 @@ function x(e, a) {
|
|
|
1022
1023
|
a
|
|
1023
1024
|
);
|
|
1024
1025
|
case "functionPlot": {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1026
|
+
let s;
|
|
1027
|
+
try {
|
|
1028
|
+
s = st(e.fn);
|
|
1029
|
+
} catch {
|
|
1030
|
+
return /* @__PURE__ */ c(
|
|
1031
|
+
_,
|
|
1032
|
+
{
|
|
1033
|
+
x: ((t = e.origin) == null ? void 0 : t[0]) ?? 400,
|
|
1034
|
+
y: (((r = e.origin) == null ? void 0 : r[1]) ?? 300) - 20,
|
|
1035
|
+
fontSize: 14,
|
|
1036
|
+
fill: "red",
|
|
1037
|
+
opacity: 0.8,
|
|
1038
|
+
children: `⚠ f(x) = ${e.fn}`
|
|
1039
|
+
},
|
|
1040
|
+
a
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
return /* @__PURE__ */ c(
|
|
1044
|
+
Ue,
|
|
1028
1045
|
{
|
|
1029
|
-
fn: (
|
|
1046
|
+
fn: (l) => s({ x: l }),
|
|
1030
1047
|
domain: e.domain,
|
|
1031
1048
|
yClamp: e.yClamp,
|
|
1032
1049
|
origin: e.origin,
|
|
1033
1050
|
scale: e.scale,
|
|
1034
|
-
color:
|
|
1051
|
+
color: h(e.color),
|
|
1035
1052
|
strokeWidth: e.strokeWidth,
|
|
1036
1053
|
samples: e.samples,
|
|
1037
1054
|
draw: e.draw,
|
|
1038
|
-
easing:
|
|
1055
|
+
easing: g(e.easing),
|
|
1039
1056
|
opacity: e.opacity,
|
|
1040
1057
|
rotation: e.rotation,
|
|
1041
1058
|
rotationOrigin: e.rotationOrigin,
|
|
@@ -1046,24 +1063,24 @@ function x(e, a) {
|
|
|
1046
1063
|
);
|
|
1047
1064
|
}
|
|
1048
1065
|
case "vector":
|
|
1049
|
-
return /* @__PURE__ */
|
|
1050
|
-
|
|
1066
|
+
return /* @__PURE__ */ c(
|
|
1067
|
+
Be,
|
|
1051
1068
|
{
|
|
1052
1069
|
from: e.from,
|
|
1053
1070
|
to: e.to,
|
|
1054
1071
|
origin: e.origin,
|
|
1055
1072
|
scale: e.scale,
|
|
1056
|
-
color:
|
|
1073
|
+
color: h(e.color),
|
|
1057
1074
|
strokeWidth: e.strokeWidth,
|
|
1058
1075
|
headSize: e.headSize,
|
|
1059
1076
|
label: e.label,
|
|
1060
1077
|
labelOffset: e.labelOffset,
|
|
1061
|
-
labelColor:
|
|
1078
|
+
labelColor: h(e.labelColor),
|
|
1062
1079
|
labelFontSize: e.labelFontSize,
|
|
1063
1080
|
fadeIn: e.fadeIn,
|
|
1064
1081
|
fadeOut: e.fadeOut,
|
|
1065
1082
|
draw: e.draw,
|
|
1066
|
-
easing:
|
|
1083
|
+
easing: g(e.easing),
|
|
1067
1084
|
rotation: e.rotation,
|
|
1068
1085
|
rotationOrigin: e.rotationOrigin,
|
|
1069
1086
|
translate: e.translate,
|
|
@@ -1072,25 +1089,41 @@ function x(e, a) {
|
|
|
1072
1089
|
a
|
|
1073
1090
|
);
|
|
1074
1091
|
case "vectorField": {
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1092
|
+
let s;
|
|
1093
|
+
try {
|
|
1094
|
+
s = ct(e.fn);
|
|
1095
|
+
} catch {
|
|
1096
|
+
return /* @__PURE__ */ c(
|
|
1097
|
+
_,
|
|
1098
|
+
{
|
|
1099
|
+
x: ((i = e.origin) == null ? void 0 : i[0]) ?? 400,
|
|
1100
|
+
y: (((n = e.origin) == null ? void 0 : n[1]) ?? 300) - 20,
|
|
1101
|
+
fontSize: 14,
|
|
1102
|
+
fill: "red",
|
|
1103
|
+
opacity: 0.8,
|
|
1104
|
+
children: `⚠ field = ${e.fn}`
|
|
1105
|
+
},
|
|
1106
|
+
a
|
|
1107
|
+
);
|
|
1108
|
+
}
|
|
1109
|
+
return /* @__PURE__ */ c(
|
|
1110
|
+
qe,
|
|
1078
1111
|
{
|
|
1079
|
-
fn: (
|
|
1112
|
+
fn: (l, b) => s({ x: l, y: b }),
|
|
1080
1113
|
domain: e.domain,
|
|
1081
1114
|
range: e.range,
|
|
1082
1115
|
step: e.step,
|
|
1083
1116
|
origin: e.origin,
|
|
1084
1117
|
scale: e.scale,
|
|
1085
1118
|
arrowScale: e.arrowScale,
|
|
1086
|
-
color:
|
|
1119
|
+
color: h(e.color),
|
|
1087
1120
|
strokeWidth: e.strokeWidth,
|
|
1088
1121
|
headSize: e.headSize,
|
|
1089
1122
|
normalize: e.normalize,
|
|
1090
1123
|
maxLength: e.maxLength,
|
|
1091
1124
|
fadeIn: e.fadeIn,
|
|
1092
1125
|
fadeOut: e.fadeOut,
|
|
1093
|
-
easing:
|
|
1126
|
+
easing: g(e.easing),
|
|
1094
1127
|
rotation: e.rotation,
|
|
1095
1128
|
rotationOrigin: e.rotationOrigin,
|
|
1096
1129
|
translate: e.translate,
|
|
@@ -1100,19 +1133,19 @@ function x(e, a) {
|
|
|
1100
1133
|
);
|
|
1101
1134
|
}
|
|
1102
1135
|
case "matrix":
|
|
1103
|
-
return /* @__PURE__ */
|
|
1104
|
-
|
|
1136
|
+
return /* @__PURE__ */ c(
|
|
1137
|
+
je,
|
|
1105
1138
|
{
|
|
1106
1139
|
values: e.values,
|
|
1107
1140
|
x: e.x,
|
|
1108
1141
|
y: e.y,
|
|
1109
1142
|
cellSize: e.cellSize,
|
|
1110
|
-
color:
|
|
1111
|
-
bracketColor:
|
|
1143
|
+
color: h(e.color),
|
|
1144
|
+
bracketColor: h(e.bracketColor),
|
|
1112
1145
|
fontSize: e.fontSize,
|
|
1113
1146
|
fadeIn: e.fadeIn,
|
|
1114
1147
|
fadeOut: e.fadeOut,
|
|
1115
|
-
easing:
|
|
1148
|
+
easing: g(e.easing),
|
|
1116
1149
|
rotation: e.rotation,
|
|
1117
1150
|
rotationOrigin: e.rotationOrigin,
|
|
1118
1151
|
scale: e.scale,
|
|
@@ -1122,20 +1155,20 @@ function x(e, a) {
|
|
|
1122
1155
|
a
|
|
1123
1156
|
);
|
|
1124
1157
|
case "graph":
|
|
1125
|
-
return /* @__PURE__ */
|
|
1126
|
-
|
|
1158
|
+
return /* @__PURE__ */ c(
|
|
1159
|
+
Le,
|
|
1127
1160
|
{
|
|
1128
1161
|
nodes: e.nodes,
|
|
1129
1162
|
edges: e.edges,
|
|
1130
|
-
nodeColor:
|
|
1163
|
+
nodeColor: h(e.nodeColor),
|
|
1131
1164
|
nodeRadius: e.nodeRadius,
|
|
1132
|
-
edgeColor:
|
|
1165
|
+
edgeColor: h(e.edgeColor),
|
|
1133
1166
|
edgeWidth: e.edgeWidth,
|
|
1134
|
-
labelColor:
|
|
1167
|
+
labelColor: h(e.labelColor),
|
|
1135
1168
|
labelFontSize: e.labelFontSize,
|
|
1136
1169
|
fadeIn: e.fadeIn,
|
|
1137
1170
|
fadeOut: e.fadeOut,
|
|
1138
|
-
easing:
|
|
1171
|
+
easing: g(e.easing),
|
|
1139
1172
|
rotation: e.rotation,
|
|
1140
1173
|
rotationOrigin: e.rotationOrigin,
|
|
1141
1174
|
scale: e.scale,
|
|
@@ -1145,18 +1178,18 @@ function x(e, a) {
|
|
|
1145
1178
|
a
|
|
1146
1179
|
);
|
|
1147
1180
|
case "latex":
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
|
|
1181
|
+
return /* @__PURE__ */ c(
|
|
1182
|
+
Ve,
|
|
1150
1183
|
{
|
|
1151
1184
|
expression: e.expression,
|
|
1152
1185
|
x: e.x,
|
|
1153
1186
|
y: e.y,
|
|
1154
|
-
color:
|
|
1187
|
+
color: h(e.color),
|
|
1155
1188
|
fontSize: e.fontSize,
|
|
1156
1189
|
align: e.align,
|
|
1157
1190
|
fadeIn: e.fadeIn,
|
|
1158
1191
|
fadeOut: e.fadeOut,
|
|
1159
|
-
easing:
|
|
1192
|
+
easing: g(e.easing),
|
|
1160
1193
|
rotation: e.rotation,
|
|
1161
1194
|
rotationOrigin: e.rotationOrigin,
|
|
1162
1195
|
scale: e.scale,
|
|
@@ -1166,16 +1199,16 @@ function x(e, a) {
|
|
|
1166
1199
|
a
|
|
1167
1200
|
);
|
|
1168
1201
|
case "barChart":
|
|
1169
|
-
return /* @__PURE__ */
|
|
1170
|
-
|
|
1202
|
+
return /* @__PURE__ */ c(
|
|
1203
|
+
De,
|
|
1171
1204
|
{
|
|
1172
1205
|
bars: e.bars,
|
|
1173
1206
|
x: e.x,
|
|
1174
1207
|
y: e.y,
|
|
1175
1208
|
width: e.width,
|
|
1176
1209
|
height: e.height,
|
|
1177
|
-
barColor:
|
|
1178
|
-
labelColor:
|
|
1210
|
+
barColor: h(e.barColor),
|
|
1211
|
+
labelColor: h(e.labelColor),
|
|
1179
1212
|
labelFontSize: e.labelFontSize,
|
|
1180
1213
|
showValues: e.showValues,
|
|
1181
1214
|
maxValue: e.maxValue,
|
|
@@ -1183,7 +1216,7 @@ function x(e, a) {
|
|
|
1183
1216
|
valueFormat: e.valueFormat,
|
|
1184
1217
|
fadeIn: e.fadeIn,
|
|
1185
1218
|
fadeOut: e.fadeOut,
|
|
1186
|
-
easing:
|
|
1219
|
+
easing: g(e.easing),
|
|
1187
1220
|
rotation: e.rotation,
|
|
1188
1221
|
rotationOrigin: e.rotationOrigin,
|
|
1189
1222
|
scale: e.scale,
|
|
@@ -1193,51 +1226,51 @@ function x(e, a) {
|
|
|
1193
1226
|
a
|
|
1194
1227
|
);
|
|
1195
1228
|
case "fadeIn":
|
|
1196
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ c(_e, { duration: e.duration, easing: g(e.easing), children: e.children.map((s, l) => v(s, l)) }, a);
|
|
1197
1230
|
case "fadeOut":
|
|
1198
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ c(We, { duration: e.duration, totalFrames: e.totalFrames, easing: g(e.easing), children: e.children.map((s, l) => v(s, l)) }, a);
|
|
1199
1232
|
case "draw":
|
|
1200
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ c(Me, { duration: e.duration, pathLength: e.pathLength, easing: g(e.easing), children: v(e.children[0], 0) }, a);
|
|
1201
1234
|
case "write":
|
|
1202
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ c(Te, { duration: e.duration, easing: g(e.easing), children: e.children.map((s, l) => v(s, l)) }, a);
|
|
1203
1236
|
case "transform":
|
|
1204
|
-
return /* @__PURE__ */
|
|
1205
|
-
|
|
1237
|
+
return /* @__PURE__ */ c(
|
|
1238
|
+
Ne,
|
|
1206
1239
|
{
|
|
1207
1240
|
duration: e.duration,
|
|
1208
|
-
easing:
|
|
1241
|
+
easing: g(e.easing),
|
|
1209
1242
|
translate: e.translate,
|
|
1210
1243
|
scale: e.scale,
|
|
1211
1244
|
rotate: e.rotate,
|
|
1212
1245
|
opacity: e.opacity,
|
|
1213
|
-
children: e.children.map((
|
|
1246
|
+
children: e.children.map((s, l) => v(s, l))
|
|
1214
1247
|
},
|
|
1215
1248
|
a
|
|
1216
1249
|
);
|
|
1217
1250
|
case "morph":
|
|
1218
|
-
return /* @__PURE__ */
|
|
1219
|
-
|
|
1251
|
+
return /* @__PURE__ */ c(
|
|
1252
|
+
Re,
|
|
1220
1253
|
{
|
|
1221
1254
|
duration: e.duration,
|
|
1222
|
-
easing:
|
|
1223
|
-
fromColor:
|
|
1224
|
-
toColor:
|
|
1255
|
+
easing: g(e.easing),
|
|
1256
|
+
fromColor: h(e.fromColor),
|
|
1257
|
+
toColor: h(e.toColor),
|
|
1225
1258
|
fromOpacity: e.fromOpacity,
|
|
1226
1259
|
toOpacity: e.toOpacity,
|
|
1227
1260
|
fromScale: e.fromScale,
|
|
1228
1261
|
toScale: e.toScale,
|
|
1229
|
-
children: e.children.map((
|
|
1262
|
+
children: e.children.map((s, l) => v(s, l))
|
|
1230
1263
|
},
|
|
1231
1264
|
a
|
|
1232
1265
|
);
|
|
1233
1266
|
case "stagger":
|
|
1234
|
-
return /* @__PURE__ */
|
|
1267
|
+
return /* @__PURE__ */ c(Pe, { staggerDelay: e.staggerDelay, easing: g(e.easing), children: e.children.map((s, l) => v(s, l)) }, a);
|
|
1235
1268
|
case "parallel":
|
|
1236
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ c(Fe, { children: e.children.map((s, l) => v(s, l)) }, a);
|
|
1237
1270
|
case "scene":
|
|
1238
|
-
return /* @__PURE__ */
|
|
1271
|
+
return /* @__PURE__ */ c(H.Fragment, { children: q(e) }, a);
|
|
1239
1272
|
case "player":
|
|
1240
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ c(H.Fragment, { children: ie(e) }, a);
|
|
1241
1274
|
default:
|
|
1242
1275
|
return null;
|
|
1243
1276
|
}
|
|
@@ -1249,42 +1282,42 @@ function Vt(e) {
|
|
|
1249
1282
|
r !== void 0 && (a[`--elucim-${t}`] = r);
|
|
1250
1283
|
return a;
|
|
1251
1284
|
}
|
|
1252
|
-
const Xt = at(function({ dsl: a, className: t, style: r, theme: i, poster: n, onError:
|
|
1253
|
-
const
|
|
1254
|
-
it(
|
|
1285
|
+
const Xt = at(function({ dsl: a, className: t, style: r, theme: i, poster: n, onError: s }, l) {
|
|
1286
|
+
const b = rt(null);
|
|
1287
|
+
it(l, () => ({
|
|
1255
1288
|
getSvgElement: () => {
|
|
1256
|
-
var
|
|
1257
|
-
return ((
|
|
1289
|
+
var u;
|
|
1290
|
+
return ((u = b.current) == null ? void 0 : u.getSvgElement()) ?? null;
|
|
1258
1291
|
},
|
|
1259
|
-
seekToFrame: (
|
|
1260
|
-
var
|
|
1261
|
-
return (
|
|
1292
|
+
seekToFrame: (u) => {
|
|
1293
|
+
var o;
|
|
1294
|
+
return (o = b.current) == null ? void 0 : o.seekToFrame(u);
|
|
1262
1295
|
},
|
|
1263
1296
|
getTotalFrames: () => {
|
|
1264
|
-
var
|
|
1265
|
-
return ((
|
|
1297
|
+
var u;
|
|
1298
|
+
return ((u = b.current) == null ? void 0 : u.getTotalFrames()) ?? 0;
|
|
1266
1299
|
},
|
|
1267
1300
|
play: () => {
|
|
1268
|
-
var
|
|
1269
|
-
return (
|
|
1301
|
+
var u;
|
|
1302
|
+
return (u = b.current) == null ? void 0 : u.play();
|
|
1270
1303
|
},
|
|
1271
1304
|
pause: () => {
|
|
1272
|
-
var
|
|
1273
|
-
return (
|
|
1305
|
+
var u;
|
|
1306
|
+
return (u = b.current) == null ? void 0 : u.pause();
|
|
1274
1307
|
},
|
|
1275
1308
|
isPlaying: () => {
|
|
1276
|
-
var
|
|
1277
|
-
return ((
|
|
1309
|
+
var u;
|
|
1310
|
+
return ((u = b.current) == null ? void 0 : u.isPlaying()) ?? !1;
|
|
1278
1311
|
}
|
|
1279
1312
|
}));
|
|
1280
|
-
const A =
|
|
1313
|
+
const A = Y(a);
|
|
1281
1314
|
if (!A.valid) {
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
const
|
|
1285
|
-
for (const
|
|
1286
|
-
const w =
|
|
1287
|
-
C.push(
|
|
1315
|
+
const u = A.errors.filter((y) => y.severity === "error").map((y) => ({ path: y.path, message: y.message }));
|
|
1316
|
+
s == null || s(u);
|
|
1317
|
+
const o = /* @__PURE__ */ new Map();
|
|
1318
|
+
for (const y of u) {
|
|
1319
|
+
const w = y.path.split("."), S = w.length > 1 ? w.slice(0, -1).join(".") : y.path, C = o.get(S) ?? [];
|
|
1320
|
+
C.push(y), o.set(S, C);
|
|
1288
1321
|
}
|
|
1289
1322
|
return /* @__PURE__ */ F(
|
|
1290
1323
|
"div",
|
|
@@ -1295,34 +1328,34 @@ const Xt = at(function({ dsl: a, className: t, style: r, theme: i, poster: n, on
|
|
|
1295
1328
|
children: [
|
|
1296
1329
|
/* @__PURE__ */ F("strong", { children: [
|
|
1297
1330
|
"Elucim DSL Validation Errors (",
|
|
1298
|
-
|
|
1331
|
+
u.length,
|
|
1299
1332
|
"):"
|
|
1300
1333
|
] }),
|
|
1301
|
-
[...
|
|
1334
|
+
[...o.entries()].map(([y, w]) => /* @__PURE__ */ F("details", { open: !0, style: { marginTop: 8 }, children: [
|
|
1302
1335
|
/* @__PURE__ */ F("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
|
|
1303
|
-
|
|
1336
|
+
y,
|
|
1304
1337
|
" (",
|
|
1305
1338
|
w.length,
|
|
1306
1339
|
")"
|
|
1307
1340
|
] }),
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ c("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: w.map((S, C) => /* @__PURE__ */ F("li", { children: [
|
|
1342
|
+
/* @__PURE__ */ c("code", { style: { color: "#ffa07a" }, children: S.path }),
|
|
1310
1343
|
": ",
|
|
1311
1344
|
S.message
|
|
1312
1345
|
] }, C)) })
|
|
1313
|
-
] },
|
|
1346
|
+
] }, y)),
|
|
1314
1347
|
/* @__PURE__ */ F("details", { style: { marginTop: 12 }, children: [
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ c("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
|
|
1349
|
+
/* @__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
1350
|
] })
|
|
1318
1351
|
]
|
|
1319
1352
|
}
|
|
1320
1353
|
);
|
|
1321
1354
|
}
|
|
1322
|
-
const E = Vt(i),
|
|
1323
|
-
return /* @__PURE__ */
|
|
1324
|
-
frame:
|
|
1325
|
-
playerRef:
|
|
1355
|
+
const E = Vt(i), x = n !== void 0 ? Lt(n, a) : void 0;
|
|
1356
|
+
return /* @__PURE__ */ c("div", { className: t, style: { ...E, ...r }, "data-testid": "dsl-root", children: re(a.root, {
|
|
1357
|
+
frame: x == null ? void 0 : x.frame,
|
|
1358
|
+
playerRef: b
|
|
1326
1359
|
}) });
|
|
1327
1360
|
});
|
|
1328
1361
|
function Lt(e, a) {
|
|
@@ -1334,18 +1367,18 @@ function Lt(e, a) {
|
|
|
1334
1367
|
return { frame: e };
|
|
1335
1368
|
}
|
|
1336
1369
|
function Jt(e, a, t) {
|
|
1337
|
-
const r =
|
|
1370
|
+
const r = Y(e);
|
|
1338
1371
|
if (!r.valid) {
|
|
1339
|
-
const
|
|
1372
|
+
const s = r.errors.filter((l) => l.severity === "error");
|
|
1340
1373
|
throw new Error(
|
|
1341
1374
|
`DSL validation failed:
|
|
1342
|
-
${
|
|
1375
|
+
${s.map((l) => ` ${l.path}: ${l.message}`).join(`
|
|
1343
1376
|
`)}`
|
|
1344
1377
|
);
|
|
1345
1378
|
}
|
|
1346
1379
|
const i = { ...e.root };
|
|
1347
1380
|
t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
|
|
1348
|
-
const n =
|
|
1381
|
+
const n = re(i, { frame: a });
|
|
1349
1382
|
return nt(n);
|
|
1350
1383
|
}
|
|
1351
1384
|
class jt {
|
|
@@ -1451,7 +1484,7 @@ class jt {
|
|
|
1451
1484
|
}
|
|
1452
1485
|
/** Add an arrow */
|
|
1453
1486
|
arrow(a, t, r, i, n) {
|
|
1454
|
-
const
|
|
1487
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12, l = {
|
|
1455
1488
|
type: "arrow",
|
|
1456
1489
|
x1: a,
|
|
1457
1490
|
y1: t,
|
|
@@ -1461,13 +1494,13 @@ class jt {
|
|
|
1461
1494
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 2,
|
|
1462
1495
|
headSize: (n == null ? void 0 : n.headSize) ?? 8,
|
|
1463
1496
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1464
|
-
fadeIn:
|
|
1497
|
+
fadeIn: s
|
|
1465
1498
|
};
|
|
1466
|
-
return this.addAtCursor(
|
|
1499
|
+
return this.addAtCursor(l, (n == null ? void 0 : n.advance) ?? 3);
|
|
1467
1500
|
}
|
|
1468
1501
|
/** Add a line */
|
|
1469
1502
|
line(a, t, r, i, n) {
|
|
1470
|
-
const
|
|
1503
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1471
1504
|
return this.addAtCursor({
|
|
1472
1505
|
type: "line",
|
|
1473
1506
|
x1: a,
|
|
@@ -1477,12 +1510,12 @@ class jt {
|
|
|
1477
1510
|
stroke: (n == null ? void 0 : n.color) ?? this.theme.muted,
|
|
1478
1511
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1,
|
|
1479
1512
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1480
|
-
fadeIn:
|
|
1513
|
+
fadeIn: s
|
|
1481
1514
|
}, (n == null ? void 0 : n.advance) ?? 3);
|
|
1482
1515
|
}
|
|
1483
1516
|
/** Add a rectangle */
|
|
1484
1517
|
rect(a, t, r, i, n) {
|
|
1485
|
-
const
|
|
1518
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1486
1519
|
return this.addAtCursor({
|
|
1487
1520
|
type: "rect",
|
|
1488
1521
|
x: a,
|
|
@@ -1494,7 +1527,7 @@ class jt {
|
|
|
1494
1527
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1.5,
|
|
1495
1528
|
rx: (n == null ? void 0 : n.rx) ?? 6,
|
|
1496
1529
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1497
|
-
fadeIn:
|
|
1530
|
+
fadeIn: s
|
|
1498
1531
|
}, (n == null ? void 0 : n.advance) ?? 5);
|
|
1499
1532
|
}
|
|
1500
1533
|
/** Add a circle */
|
|
@@ -1567,33 +1600,33 @@ class jt {
|
|
|
1567
1600
|
* Returns the box positions for follow-up arrows, etc.
|
|
1568
1601
|
*/
|
|
1569
1602
|
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,
|
|
1603
|
+
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, b = (this._width - l) / 2;
|
|
1571
1604
|
t == null || t.fadeIn;
|
|
1572
|
-
const A = a.map((
|
|
1573
|
-
const
|
|
1574
|
-
return { x:
|
|
1575
|
-
}), E = a.map((
|
|
1605
|
+
const A = a.map((x, u) => {
|
|
1606
|
+
const o = b + u * (r + n);
|
|
1607
|
+
return { x: o, y: s, w: r, h: i, cx: o + r / 2, cy: s + i / 2 };
|
|
1608
|
+
}), E = a.map((x, u) => {
|
|
1576
1609
|
var S, C;
|
|
1577
|
-
const
|
|
1610
|
+
const o = A[u], y = ((S = t == null ? void 0 : t.colors) == null ? void 0 : S[u]) ?? this.theme.boxFill, w = ((C = t == null ? void 0 : t.strokeColors) == null ? void 0 : C[u]) ?? this.theme.boxStroke;
|
|
1578
1611
|
return {
|
|
1579
1612
|
type: "group",
|
|
1580
1613
|
children: [
|
|
1581
1614
|
{
|
|
1582
1615
|
type: "rect",
|
|
1583
|
-
x:
|
|
1584
|
-
y:
|
|
1616
|
+
x: o.x,
|
|
1617
|
+
y: o.y,
|
|
1585
1618
|
width: r,
|
|
1586
1619
|
height: i,
|
|
1587
|
-
fill:
|
|
1620
|
+
fill: y,
|
|
1588
1621
|
stroke: w,
|
|
1589
1622
|
strokeWidth: 1.5,
|
|
1590
1623
|
rx: 6
|
|
1591
1624
|
},
|
|
1592
1625
|
{
|
|
1593
1626
|
type: "text",
|
|
1594
|
-
x:
|
|
1595
|
-
y:
|
|
1596
|
-
content:
|
|
1627
|
+
x: o.cx,
|
|
1628
|
+
y: o.cy + 5,
|
|
1629
|
+
content: x,
|
|
1597
1630
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1598
1631
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1599
1632
|
textAnchor: "middle",
|
|
@@ -1612,32 +1645,32 @@ class jt {
|
|
|
1612
1645
|
* Render a vertical stack of labeled boxes.
|
|
1613
1646
|
*/
|
|
1614
1647
|
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,
|
|
1648
|
+
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
1649
|
t == null || t.fadeIn;
|
|
1617
|
-
const
|
|
1618
|
-
const
|
|
1619
|
-
return { x:
|
|
1620
|
-
}), A = a.map((E,
|
|
1621
|
-
var
|
|
1622
|
-
const
|
|
1650
|
+
const b = a.map((E, x) => {
|
|
1651
|
+
const u = s + x * (i + n);
|
|
1652
|
+
return { x: l - r / 2, y: u, w: r, h: i, cx: l, cy: u + i / 2 };
|
|
1653
|
+
}), A = a.map((E, x) => {
|
|
1654
|
+
var y, w;
|
|
1655
|
+
const u = b[x], o = ((y = t == null ? void 0 : t.colors) == null ? void 0 : y[x]) ?? this.theme.boxFill;
|
|
1623
1656
|
return {
|
|
1624
1657
|
type: "group",
|
|
1625
1658
|
children: [
|
|
1626
1659
|
{
|
|
1627
1660
|
type: "rect",
|
|
1628
|
-
x:
|
|
1629
|
-
y:
|
|
1661
|
+
x: u.x,
|
|
1662
|
+
y: u.y,
|
|
1630
1663
|
width: r,
|
|
1631
1664
|
height: i,
|
|
1632
|
-
fill:
|
|
1633
|
-
stroke: (w = t == null ? void 0 : t.colors) != null && w[
|
|
1665
|
+
fill: o,
|
|
1666
|
+
stroke: (w = t == null ? void 0 : t.colors) != null && w[x] ? t.colors[x] : this.theme.boxStroke,
|
|
1634
1667
|
strokeWidth: 1.5,
|
|
1635
1668
|
rx: 6
|
|
1636
1669
|
},
|
|
1637
1670
|
{
|
|
1638
1671
|
type: "text",
|
|
1639
|
-
x:
|
|
1640
|
-
y:
|
|
1672
|
+
x: u.cx,
|
|
1673
|
+
y: u.cy + 5,
|
|
1641
1674
|
content: E,
|
|
1642
1675
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1643
1676
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
@@ -1650,7 +1683,7 @@ class jt {
|
|
|
1650
1683
|
type: "stagger",
|
|
1651
1684
|
staggerDelay: 3,
|
|
1652
1685
|
children: A
|
|
1653
|
-
}, 8 + a.length * 2),
|
|
1686
|
+
}, 8 + a.length * 2), b;
|
|
1654
1687
|
}
|
|
1655
1688
|
/**
|
|
1656
1689
|
* Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
|
|
@@ -1658,13 +1691,13 @@ class jt {
|
|
|
1658
1691
|
connectDown(a, t) {
|
|
1659
1692
|
const r = [];
|
|
1660
1693
|
for (let i = 0; i < a.length - 1; i++) {
|
|
1661
|
-
const n = a[i],
|
|
1694
|
+
const n = a[i], s = a[i + 1];
|
|
1662
1695
|
r.push({
|
|
1663
1696
|
type: "arrow",
|
|
1664
1697
|
x1: n.cx,
|
|
1665
1698
|
y1: n.y + n.h + 2,
|
|
1666
|
-
x2:
|
|
1667
|
-
y2:
|
|
1699
|
+
x2: s.cx,
|
|
1700
|
+
y2: s.y - 2,
|
|
1668
1701
|
stroke: (t == null ? void 0 : t.color) ?? this.theme.muted,
|
|
1669
1702
|
strokeWidth: 1.5,
|
|
1670
1703
|
headSize: (t == null ? void 0 : t.headSize) ?? 6
|
|
@@ -1791,7 +1824,7 @@ class Bt {
|
|
|
1791
1824
|
this._opts.height
|
|
1792
1825
|
);
|
|
1793
1826
|
r.build(i);
|
|
1794
|
-
const { elements: n, durationInFrames:
|
|
1827
|
+
const { elements: n, durationInFrames: s } = i._build();
|
|
1795
1828
|
return {
|
|
1796
1829
|
type: "slide",
|
|
1797
1830
|
title: r.title,
|
|
@@ -1802,7 +1835,7 @@ class Bt {
|
|
|
1802
1835
|
width: this._opts.width,
|
|
1803
1836
|
height: this._opts.height,
|
|
1804
1837
|
fps: this._opts.fps,
|
|
1805
|
-
durationInFrames:
|
|
1838
|
+
durationInFrames: s,
|
|
1806
1839
|
controls: !1,
|
|
1807
1840
|
loop: !1,
|
|
1808
1841
|
autoPlay: !0,
|
|
@@ -1836,7 +1869,7 @@ function Zt(e, a, t) {
|
|
|
1836
1869
|
export {
|
|
1837
1870
|
Xt as DslRenderer,
|
|
1838
1871
|
Bt as PresentationBuilder,
|
|
1839
|
-
|
|
1872
|
+
ae as SEMANTIC_TOKENS,
|
|
1840
1873
|
jt as SlideBuilder,
|
|
1841
1874
|
Qt as TOKEN_NAMES,
|
|
1842
1875
|
st as compileExpression,
|
|
@@ -1844,15 +1877,15 @@ export {
|
|
|
1844
1877
|
qt as darkTheme,
|
|
1845
1878
|
Yt as lightTheme,
|
|
1846
1879
|
Zt as presentation,
|
|
1847
|
-
|
|
1848
|
-
|
|
1880
|
+
v as renderElement,
|
|
1881
|
+
ie as renderPlayer,
|
|
1849
1882
|
_t as renderPresentation,
|
|
1850
|
-
|
|
1851
|
-
|
|
1883
|
+
re as renderRoot,
|
|
1884
|
+
q as renderScene,
|
|
1852
1885
|
Dt as renderSlide,
|
|
1853
1886
|
Jt as renderToSvgString,
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1887
|
+
h as resolveColor,
|
|
1888
|
+
g as resolveEasing,
|
|
1889
|
+
Y as validate,
|
|
1890
|
+
J as validateExpression
|
|
1858
1891
|
};
|