@elucim/dsl 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +21 -0
- package/dist/index.js +556 -533
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
2
|
-
import { jsx as s, jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
const
|
|
1
|
+
import { easeOutBounce as ie, easeOutElastic as ne, easeOutBack as se, easeInBack as ce, easeInOutExpo as le, easeOutExpo as ue, easeInExpo as he, easeInOutSine as fe, easeOutSine as ge, easeInSine as oe, easeInOutQuart as ye, easeOutQuart as me, easeInQuart as be, easeInOutCubic as xe, easeOutCubic as ve, easeInCubic as de, easeInOutQuad as ke, easeOutQuad as we, easeInQuad as Ie, linear as Se, spring as $e, cubicBezier as Oe, Presentation as Ae, Scene as Ce, Player as ze, Slide as pe, Parallel as Ee, Stagger as Fe, Morph as Pe, Transform as Re, Write as Ne, Draw as Te, FadeOut as Me, FadeIn as We, BarChart as _e, LaTeX as De, Graph as Ve, Matrix as Le, VectorField as je, Vector as qe, FunctionPlot as Be, Axes as Ue, Image as He, Text 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 s, jsxs as F } from "react/jsx-runtime";
|
|
3
|
+
import U, { forwardRef as at, useRef as rt, useImperativeHandle as it } from "react";
|
|
4
|
+
import { renderToStaticMarkup as nt } from "react-dom/server";
|
|
5
|
+
const V = {
|
|
6
6
|
sin: Math.sin,
|
|
7
7
|
cos: Math.cos,
|
|
8
8
|
tan: Math.tan,
|
|
@@ -22,7 +22,7 @@ const D = {
|
|
|
22
22
|
max: (...e) => Math.max(...e),
|
|
23
23
|
sign: Math.sign,
|
|
24
24
|
pow: Math.pow
|
|
25
|
-
},
|
|
25
|
+
}, H = {
|
|
26
26
|
PI: Math.PI,
|
|
27
27
|
E: Math.E,
|
|
28
28
|
TAU: Math.PI * 2
|
|
@@ -31,61 +31,61 @@ function q(e) {
|
|
|
31
31
|
const a = [];
|
|
32
32
|
let t = 0;
|
|
33
33
|
for (; t < e.length; ) {
|
|
34
|
-
const
|
|
35
|
-
if (/\s/.test(
|
|
34
|
+
const r = e[t];
|
|
35
|
+
if (/\s/.test(r)) {
|
|
36
36
|
t++;
|
|
37
37
|
continue;
|
|
38
38
|
}
|
|
39
|
-
if (/[0-9]/.test(
|
|
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 h = 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: h });
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
-
if (/[a-zA-Z_]/.test(
|
|
47
|
+
if (/[a-zA-Z_]/.test(r)) {
|
|
48
48
|
let n = "";
|
|
49
|
-
const
|
|
49
|
+
const h = 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: h });
|
|
53
53
|
continue;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
switch (t++,
|
|
55
|
+
const i = t;
|
|
56
|
+
switch (t++, r) {
|
|
57
57
|
case "+":
|
|
58
|
-
a.push({ type: "PLUS", value: "+", pos:
|
|
58
|
+
a.push({ type: "PLUS", value: "+", pos: i });
|
|
59
59
|
break;
|
|
60
60
|
case "-":
|
|
61
|
-
a.push({ type: "MINUS", value: "-", pos:
|
|
61
|
+
a.push({ type: "MINUS", value: "-", pos: i });
|
|
62
62
|
break;
|
|
63
63
|
case "*":
|
|
64
|
-
a.push({ type: "STAR", value: "*", pos:
|
|
64
|
+
a.push({ type: "STAR", value: "*", pos: i });
|
|
65
65
|
break;
|
|
66
66
|
case "/":
|
|
67
|
-
a.push({ type: "SLASH", value: "/", pos:
|
|
67
|
+
a.push({ type: "SLASH", value: "/", pos: i });
|
|
68
68
|
break;
|
|
69
69
|
case "^":
|
|
70
|
-
a.push({ type: "CARET", value: "^", pos:
|
|
70
|
+
a.push({ type: "CARET", value: "^", pos: i });
|
|
71
71
|
break;
|
|
72
72
|
case "(":
|
|
73
|
-
a.push({ type: "LPAREN", value: "(", pos:
|
|
73
|
+
a.push({ type: "LPAREN", value: "(", pos: i });
|
|
74
74
|
break;
|
|
75
75
|
case ")":
|
|
76
|
-
a.push({ type: "RPAREN", value: ")", pos:
|
|
76
|
+
a.push({ type: "RPAREN", value: ")", pos: i });
|
|
77
77
|
break;
|
|
78
78
|
case "[":
|
|
79
|
-
a.push({ type: "LBRACKET", value: "[", pos:
|
|
79
|
+
a.push({ type: "LBRACKET", value: "[", pos: i });
|
|
80
80
|
break;
|
|
81
81
|
case "]":
|
|
82
|
-
a.push({ type: "RBRACKET", value: "]", pos:
|
|
82
|
+
a.push({ type: "RBRACKET", value: "]", pos: i });
|
|
83
83
|
break;
|
|
84
84
|
case ",":
|
|
85
|
-
a.push({ type: "COMMA", value: ",", pos:
|
|
85
|
+
a.push({ type: "COMMA", value: ",", pos: i });
|
|
86
86
|
break;
|
|
87
87
|
default:
|
|
88
|
-
throw new
|
|
88
|
+
throw new I(`Unexpected character '${r}'`, i);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return a.push({ type: "EOF", value: "", pos: t }), a;
|
|
@@ -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 I(
|
|
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 I(
|
|
119
119
|
`Unexpected token '${t.value}' after expression`,
|
|
120
120
|
t.pos
|
|
121
121
|
);
|
|
@@ -126,8 +126,8 @@ class B {
|
|
|
126
126
|
parseExpression() {
|
|
127
127
|
let a = this.parseTerm();
|
|
128
128
|
for (; this.peek().type === "PLUS" || this.peek().type === "MINUS"; ) {
|
|
129
|
-
const t = this.advance().value,
|
|
130
|
-
a = { kind: "binary", op: t, left: a, right:
|
|
129
|
+
const t = this.advance().value, r = this.parseTerm();
|
|
130
|
+
a = { kind: "binary", op: t, left: a, right: r };
|
|
131
131
|
}
|
|
132
132
|
return a;
|
|
133
133
|
}
|
|
@@ -135,8 +135,8 @@ class B {
|
|
|
135
135
|
parseTerm() {
|
|
136
136
|
let a = this.parsePower();
|
|
137
137
|
for (; this.peek().type === "STAR" || this.peek().type === "SLASH"; ) {
|
|
138
|
-
const t = this.advance().value,
|
|
139
|
-
a = { kind: "binary", op: t, left: a, right:
|
|
138
|
+
const t = this.advance().value, r = this.parsePower();
|
|
139
|
+
a = { kind: "binary", op: t, left: a, right: r };
|
|
140
140
|
}
|
|
141
141
|
return a;
|
|
142
142
|
}
|
|
@@ -164,18 +164,18 @@ class B {
|
|
|
164
164
|
const t = a.value;
|
|
165
165
|
if (this.peek().type === "LPAREN") {
|
|
166
166
|
this.advance();
|
|
167
|
-
const
|
|
167
|
+
const r = [];
|
|
168
168
|
if (this.peek().type !== "RPAREN")
|
|
169
|
-
for (
|
|
170
|
-
this.advance(),
|
|
171
|
-
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(
|
|
172
|
-
throw new
|
|
173
|
-
`Unknown function '${t}'. Available: ${Object.keys(
|
|
169
|
+
for (r.push(this.parseExpression()); this.peek().type === "COMMA"; )
|
|
170
|
+
this.advance(), r.push(this.parseExpression());
|
|
171
|
+
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(V, t))
|
|
172
|
+
throw new I(
|
|
173
|
+
`Unknown function '${t}'. Available: ${Object.keys(V).join(", ")}`,
|
|
174
174
|
a.pos
|
|
175
175
|
);
|
|
176
|
-
return { kind: "call", name: t, args:
|
|
176
|
+
return { kind: "call", name: t, args: r };
|
|
177
177
|
}
|
|
178
|
-
return Object.prototype.hasOwnProperty.call(
|
|
178
|
+
return Object.prototype.hasOwnProperty.call(H, t) ? { kind: "number", value: H[t] } : { kind: "variable", name: t };
|
|
179
179
|
}
|
|
180
180
|
if (a.type === "LPAREN") {
|
|
181
181
|
this.advance();
|
|
@@ -190,128 +190,128 @@ 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 I(
|
|
194
194
|
`Unexpected token '${a.value}'`,
|
|
195
195
|
a.pos
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function z(e, a) {
|
|
200
200
|
switch (e.kind) {
|
|
201
201
|
case "number":
|
|
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 I(`Unknown variable '${e.name}'`, 0);
|
|
206
206
|
case "unary":
|
|
207
|
-
const t =
|
|
207
|
+
const t = z(e.operand, a);
|
|
208
208
|
return e.op === "-" ? -t : t;
|
|
209
209
|
case "binary": {
|
|
210
|
-
const
|
|
210
|
+
const r = z(e.left, a), i = z(e.right, a);
|
|
211
211
|
switch (e.op) {
|
|
212
212
|
case "+":
|
|
213
|
-
return
|
|
213
|
+
return r + i;
|
|
214
214
|
case "-":
|
|
215
|
-
return
|
|
215
|
+
return r - i;
|
|
216
216
|
case "*":
|
|
217
|
-
return
|
|
217
|
+
return r * i;
|
|
218
218
|
case "/":
|
|
219
|
-
return
|
|
219
|
+
return i === 0 ? 1 / 0 : r / i;
|
|
220
220
|
case "^":
|
|
221
|
-
return Math.pow(
|
|
221
|
+
return Math.pow(r, i);
|
|
222
222
|
}
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
225
|
case "call": {
|
|
226
|
-
const
|
|
227
|
-
return
|
|
226
|
+
const r = V[e.name], i = e.args.map((n) => z(n, a));
|
|
227
|
+
return r(...i);
|
|
228
228
|
}
|
|
229
229
|
case "array":
|
|
230
|
-
return e.elements.map((
|
|
230
|
+
return e.elements.map((r) => z(r, a));
|
|
231
231
|
}
|
|
232
|
-
throw new
|
|
232
|
+
throw new I("Invalid AST node", 0);
|
|
233
233
|
}
|
|
234
|
-
class
|
|
234
|
+
class I extends Error {
|
|
235
235
|
constructor(a, t) {
|
|
236
236
|
super(a), this.name = "ExpressionError", this.position = t;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function st(e) {
|
|
240
240
|
const a = q(e), t = new B(a).parse();
|
|
241
|
-
return (
|
|
241
|
+
return (r) => z(t, r);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function ct(e) {
|
|
244
244
|
const a = q(e), t = new B(a).parse();
|
|
245
245
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
246
|
-
throw new
|
|
246
|
+
throw new I(
|
|
247
247
|
'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
|
|
248
248
|
0
|
|
249
249
|
);
|
|
250
|
-
return (
|
|
250
|
+
return (r) => z(t, r);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function X(e) {
|
|
253
253
|
try {
|
|
254
254
|
const a = q(e);
|
|
255
255
|
return new B(a).parse(), null;
|
|
256
256
|
} catch (a) {
|
|
257
|
-
return a instanceof
|
|
257
|
+
return a instanceof I ? `${a.message} (at position ${a.position})` : String(a);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
const L = {
|
|
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:
|
|
261
|
+
linear: Se,
|
|
262
|
+
easeInQuad: Ie,
|
|
263
|
+
easeOutQuad: we,
|
|
264
|
+
easeInOutQuad: ke,
|
|
265
|
+
easeInCubic: de,
|
|
266
|
+
easeOutCubic: ve,
|
|
267
|
+
easeInOutCubic: xe,
|
|
268
|
+
easeInQuart: be,
|
|
269
|
+
easeOutQuart: me,
|
|
270
|
+
easeInOutQuart: ye,
|
|
271
|
+
easeInSine: oe,
|
|
272
|
+
easeOutSine: ge,
|
|
273
|
+
easeInOutSine: fe,
|
|
274
|
+
easeInExpo: he,
|
|
275
|
+
easeOutExpo: ue,
|
|
276
|
+
easeInOutExpo: le,
|
|
277
|
+
easeInBack: ce,
|
|
278
|
+
easeOutBack: se,
|
|
279
|
+
easeOutElastic: ne,
|
|
280
|
+
easeOutBounce: ie
|
|
281
281
|
};
|
|
282
|
-
function
|
|
282
|
+
function f(e) {
|
|
283
283
|
if (e !== void 0) {
|
|
284
284
|
if (typeof e == "string") {
|
|
285
285
|
const a = L[e];
|
|
286
286
|
if (!a) {
|
|
287
|
-
const t = Object.keys(L),
|
|
288
|
-
throw new Error(`Unknown easing '${e}'.${
|
|
287
|
+
const t = Object.keys(L), r = t.find((n) => n.toLowerCase() === e.toLowerCase()), i = r ? ` Did you mean '${r}'?` : "";
|
|
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 $e({
|
|
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 Oe(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 _ = Object.keys(L);
|
|
304
|
+
function J(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((
|
|
310
|
-
valid: a.filter((
|
|
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 }) : (lt(t.root, "root", a), {
|
|
310
|
+
valid: a.filter((r) => r.severity === "error").length === 0,
|
|
311
311
|
errors: a
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const G = ["scene", "player", "presentation"], T = ["card", "slide", "square"], D = [
|
|
315
315
|
"sequence",
|
|
316
316
|
"group",
|
|
317
317
|
"bezierCurve",
|
|
@@ -340,290 +340,290 @@ const H = ["scene", "player", "presentation"], T = ["card", "slide", "square"],
|
|
|
340
340
|
"parallel",
|
|
341
341
|
"player",
|
|
342
342
|
"scene"
|
|
343
|
-
],
|
|
344
|
-
function
|
|
345
|
-
const
|
|
346
|
-
if (!
|
|
347
|
-
t.push({ path: `${a}.type`, message: `Root type must be one of: ${
|
|
343
|
+
], K = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
344
|
+
function lt(e, a, t) {
|
|
345
|
+
const r = e.type;
|
|
346
|
+
if (!G.includes(r)) {
|
|
347
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${G.join(", ")}. Got "${r}"`, severity: "error" });
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
r === "scene" || r === "player" ? Y(e, a, r, t) : r === "presentation" && ut(e, a, t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
|
|
352
|
+
function Y(e, a, t, r) {
|
|
353
|
+
Tt(e, "durationInFrames", a, r), y(e, "width", a, r), y(e, "height", a, r), y(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
|
-
function
|
|
356
|
-
if (y(e, "width", a, t), y(e, "height", a, t),
|
|
355
|
+
function ut(e, a, t) {
|
|
356
|
+
if (y(e, "width", a, t), y(e, "height", a, t), $(e, "background", a, t), y(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 && (K.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: ${K.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
|
-
e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((
|
|
365
|
-
|
|
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
|
+
ht(r, `${a}.slides[${i}]`, t);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function ht(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
|
+
$(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
|
+
Z(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 O(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
|
-
e.children.forEach((
|
|
383
|
-
|
|
382
|
+
e.children.forEach((r, i) => {
|
|
383
|
+
Z(r, `${a}.children[${i}]`, t);
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Z(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
|
-
const
|
|
392
|
-
if (!
|
|
393
|
-
const
|
|
391
|
+
const r = e.type;
|
|
392
|
+
if (!r || !D.includes(r)) {
|
|
393
|
+
const i = r ? ee(r, D) : "";
|
|
394
394
|
t.push({
|
|
395
395
|
path: `${a}.type`,
|
|
396
|
-
message: `Unknown element type "${
|
|
396
|
+
message: `Unknown element type "${r}".${i} Valid types: ${D.join(", ")}`,
|
|
397
397
|
severity: "error"
|
|
398
398
|
});
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
|
-
switch (
|
|
401
|
+
switch (r) {
|
|
402
402
|
case "bezierCurve":
|
|
403
|
-
|
|
403
|
+
ft(e, a, t);
|
|
404
404
|
break;
|
|
405
405
|
case "circle":
|
|
406
|
-
|
|
406
|
+
gt(e, a, t);
|
|
407
407
|
break;
|
|
408
408
|
case "line":
|
|
409
|
-
|
|
409
|
+
ot(e, a, t);
|
|
410
410
|
break;
|
|
411
411
|
case "arrow":
|
|
412
|
-
|
|
412
|
+
yt(e, a, t);
|
|
413
413
|
break;
|
|
414
414
|
case "rect":
|
|
415
|
-
|
|
415
|
+
mt(e, a, t);
|
|
416
416
|
break;
|
|
417
417
|
case "polygon":
|
|
418
|
-
|
|
418
|
+
bt(e, a, t);
|
|
419
419
|
break;
|
|
420
420
|
case "text":
|
|
421
|
-
|
|
421
|
+
xt(e, a, t);
|
|
422
422
|
break;
|
|
423
423
|
case "image":
|
|
424
|
-
|
|
424
|
+
Pt(e, a, t);
|
|
425
425
|
break;
|
|
426
426
|
case "axes":
|
|
427
|
-
|
|
427
|
+
vt(e, a, t);
|
|
428
428
|
break;
|
|
429
429
|
case "functionPlot":
|
|
430
|
-
|
|
430
|
+
dt(e, a, t);
|
|
431
431
|
break;
|
|
432
432
|
case "vector":
|
|
433
|
-
|
|
433
|
+
kt(e, a, t);
|
|
434
434
|
break;
|
|
435
435
|
case "vectorField":
|
|
436
|
-
|
|
436
|
+
wt(e, a, t);
|
|
437
437
|
break;
|
|
438
438
|
case "matrix":
|
|
439
|
-
|
|
439
|
+
It(e, a, t);
|
|
440
440
|
break;
|
|
441
441
|
case "graph":
|
|
442
|
-
|
|
442
|
+
St(e, a, t);
|
|
443
443
|
break;
|
|
444
444
|
case "latex":
|
|
445
|
-
|
|
445
|
+
$t(e, a, t);
|
|
446
446
|
break;
|
|
447
447
|
case "barChart":
|
|
448
|
-
|
|
448
|
+
Nt(e, a, t);
|
|
449
449
|
break;
|
|
450
450
|
case "sequence":
|
|
451
|
-
|
|
451
|
+
Ot(e, a, t);
|
|
452
452
|
break;
|
|
453
453
|
case "group":
|
|
454
|
-
|
|
454
|
+
Rt(e, a, t);
|
|
455
455
|
break;
|
|
456
456
|
case "parallel":
|
|
457
|
-
|
|
457
|
+
O(e, a, t);
|
|
458
458
|
break;
|
|
459
459
|
case "fadeIn":
|
|
460
460
|
case "fadeOut":
|
|
461
461
|
case "draw":
|
|
462
462
|
case "write":
|
|
463
|
-
|
|
463
|
+
At(e, a, t);
|
|
464
464
|
break;
|
|
465
465
|
case "transform":
|
|
466
|
-
|
|
466
|
+
Ct(e, a, t);
|
|
467
467
|
break;
|
|
468
468
|
case "morph":
|
|
469
|
-
|
|
469
|
+
zt(e, a, t);
|
|
470
470
|
break;
|
|
471
471
|
case "stagger":
|
|
472
|
-
|
|
472
|
+
pt(e, a, t);
|
|
473
473
|
break;
|
|
474
474
|
case "scene":
|
|
475
475
|
case "player":
|
|
476
|
-
|
|
476
|
+
Y(e, a, r, t);
|
|
477
477
|
break;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
function ut(e, a, t) {
|
|
481
|
-
l(e, "x1", a, t), l(e, "y1", a, t), l(e, "cx1", a, t), l(e, "cy1", a, t), l(e, "x2", a, t), l(e, "y2", a, t), e.cx2 !== void 0 && F(e, "cx2", a, t), e.cy2 !== void 0 && F(e, "cy2", a, t), x(e, a, t);
|
|
482
|
-
}
|
|
483
|
-
function ht(e, a, t) {
|
|
484
|
-
l(e, "cx", a, t), l(e, "cy", a, t), z(e, "r", a, t), x(e, a, t);
|
|
485
|
-
}
|
|
486
480
|
function ft(e, a, t) {
|
|
487
|
-
|
|
481
|
+
u(e, "x1", a, t), u(e, "y1", a, t), u(e, "cx1", a, t), u(e, "cy1", a, t), u(e, "x2", a, t), u(e, "y2", a, t), e.cx2 !== void 0 && P(e, "cx2", a, t), e.cy2 !== void 0 && P(e, "cy2", a, t), v(e, a, t);
|
|
488
482
|
}
|
|
489
483
|
function gt(e, a, t) {
|
|
490
|
-
|
|
491
|
-
}
|
|
492
|
-
function yt(e, a, t) {
|
|
493
|
-
l(e, "x", a, t), l(e, "y", a, t), z(e, "width", a, t), z(e, "height", a, t), x(e, a, t);
|
|
484
|
+
u(e, "cx", a, t), u(e, "cy", a, t), p(e, "r", a, t), v(e, a, t);
|
|
494
485
|
}
|
|
495
486
|
function ot(e, a, t) {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
487
|
+
u(e, "x1", a, t), u(e, "y1", a, t), u(e, "x2", a, t), u(e, "y2", a, t), v(e, a, t);
|
|
488
|
+
}
|
|
489
|
+
function yt(e, a, t) {
|
|
490
|
+
u(e, "x1", a, t), u(e, "y1", a, t), u(e, "x2", a, t), u(e, "y2", a, t), v(e, a, t);
|
|
499
491
|
}
|
|
500
492
|
function mt(e, a, t) {
|
|
501
|
-
|
|
493
|
+
u(e, "x", a, t), u(e, "y", a, t), p(e, "width", a, t), p(e, "height", a, t), v(e, a, t);
|
|
502
494
|
}
|
|
503
495
|
function bt(e, a, t) {
|
|
504
|
-
|
|
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
|
+
(!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" }), v(e, a, t);
|
|
505
499
|
}
|
|
506
500
|
function xt(e, a, t) {
|
|
501
|
+
u(e, "x", a, t), u(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
|
+
}
|
|
503
|
+
function vt(e, a, t) {
|
|
504
|
+
k(e, "domain", a, t), k(e, "range", a, t), k(e, "origin", a, t), M(e, a, t);
|
|
505
|
+
}
|
|
506
|
+
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
|
|
511
|
-
|
|
510
|
+
const r = X(e.fn);
|
|
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);
|
|
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" }),
|
|
515
|
+
function kt(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), M(e, a, t);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
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
|
|
523
|
-
|
|
522
|
+
const r = X(e.fn);
|
|
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);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
Array.isArray(e.values) ? e.values.forEach((
|
|
529
|
-
Array.isArray(
|
|
530
|
-
}) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }),
|
|
527
|
+
function It(e, a, t) {
|
|
528
|
+
Array.isArray(e.values) ? e.values.forEach((r, i) => {
|
|
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" }), v(e, a, t);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function St(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
|
-
const
|
|
537
|
-
e.nodes.forEach((
|
|
538
|
-
typeof
|
|
539
|
-
}), Array.isArray(e.edges) && e.edges.forEach((
|
|
540
|
-
(typeof
|
|
536
|
+
const r = /* @__PURE__ */ new Set();
|
|
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)), u(i, "x", `${a}.nodes[${n}]`, t), u(i, "y", `${a}.nodes[${n}]`, t);
|
|
539
|
+
}), Array.isArray(e.edges) && e.edges.forEach((i, n) => {
|
|
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
|
-
|
|
544
|
-
}
|
|
545
|
-
function It(e, a, t) {
|
|
546
|
-
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), l(e, "x", a, t), l(e, "y", a, t), x(e, a, t);
|
|
547
|
-
}
|
|
548
|
-
function St(e, a, t) {
|
|
549
|
-
l(e, "from", a, t), Tt(e, "durationInFrames", a, t), $(e, a, t);
|
|
543
|
+
v(e, a, t);
|
|
550
544
|
}
|
|
551
545
|
function $t(e, a, t) {
|
|
552
|
-
|
|
546
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), u(e, "x", a, t), u(e, "y", a, t), v(e, a, t);
|
|
553
547
|
}
|
|
554
548
|
function Ot(e, a, t) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
549
|
+
u(e, "from", a, t), Mt(e, "durationInFrames", a, t), O(e, a, t);
|
|
550
|
+
}
|
|
551
|
+
function At(e, a, t) {
|
|
552
|
+
y(e, "duration", a, t), R(e, a, t), O(e, a, t);
|
|
553
|
+
}
|
|
554
|
+
function Ct(e, a, t) {
|
|
555
|
+
if (y(e, "duration", a, t), R(e, a, t), e.translate !== void 0) {
|
|
556
|
+
const r = e.translate;
|
|
557
|
+
(!r || typeof r != "object") && t.push({ path: `${a}.translate`, message: "translate must be { from: [x,y], to: [x,y] }", severity: "error" });
|
|
558
558
|
}
|
|
559
559
|
if (e.scale !== void 0) {
|
|
560
|
-
const
|
|
561
|
-
(!
|
|
560
|
+
const r = e.scale;
|
|
561
|
+
(!r || typeof r != "object" || typeof r.from != "number" || typeof r.to != "number") && t.push({ path: `${a}.scale`, message: "scale must be { from: number, to: number }", severity: "error" });
|
|
562
562
|
}
|
|
563
563
|
if (e.rotate !== void 0) {
|
|
564
|
-
const
|
|
565
|
-
(!
|
|
564
|
+
const r = e.rotate;
|
|
565
|
+
(!r || typeof r != "object" || typeof r.from != "number" || typeof r.to != "number") && t.push({ path: `${a}.rotate`, message: "rotate must be { from: number, to: number }", severity: "error" });
|
|
566
566
|
}
|
|
567
567
|
if (e.opacity !== void 0) {
|
|
568
|
-
const
|
|
569
|
-
(!
|
|
568
|
+
const r = e.opacity;
|
|
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
|
+
O(e, a, t);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
y(e, "duration", a, t),
|
|
573
|
+
function zt(e, a, t) {
|
|
574
|
+
y(e, "duration", a, t), R(e, a, t), $(e, "fromColor", a, t), $(e, "toColor", a, t), O(e, a, t);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
y(e, "staggerDelay", a, t),
|
|
576
|
+
function pt(e, a, t) {
|
|
577
|
+
y(e, "staggerDelay", a, t), R(e, a, t), O(e, a, t);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
y(e, "fadeIn", a, t), y(e, "fadeOut", a, t), y(e, "draw", a, t),
|
|
579
|
+
function v(e, a, t) {
|
|
580
|
+
y(e, "fadeIn", a, t), y(e, "fadeOut", a, t), y(e, "draw", a, t), R(e, a, t), Et(e, a, t);
|
|
581
581
|
}
|
|
582
582
|
function M(e, a, t) {
|
|
583
|
-
y(e, "fadeIn", a, t), y(e, "fadeOut", a, t), y(e, "draw", a, t),
|
|
583
|
+
y(e, "fadeIn", a, t), y(e, "fadeOut", a, t), y(e, "draw", a, t), R(e, a, t), Ft(e, a, t);
|
|
584
584
|
}
|
|
585
585
|
const Q = ["none", "circle", "ellipse"];
|
|
586
|
-
function
|
|
587
|
-
if (
|
|
588
|
-
const
|
|
589
|
-
typeof
|
|
586
|
+
function Et(e, a, t) {
|
|
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
|
+
const r = e.scale;
|
|
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 Ft(e, a, t) {
|
|
593
|
+
P(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), P(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 Pt(e, a, t) {
|
|
596
|
+
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), u(e, "x", a, t), u(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 && (Q.includes(e.clipShape) || t.push({
|
|
597
597
|
path: `${a}.clipShape`,
|
|
598
598
|
message: `Invalid clipShape "${e.clipShape}". Must be one of: ${Q.join(", ")}`,
|
|
599
599
|
severity: "error"
|
|
600
|
-
})),
|
|
600
|
+
})), v(e, a, t);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
602
|
+
function Rt(e, a, t) {
|
|
603
|
+
O(e, a, t), v(e, a, t);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
605
|
+
function Nt(e, a, t) {
|
|
606
|
+
u(e, "x", a, t), u(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 R(e, a, t) {
|
|
609
609
|
if (e.easing !== void 0) {
|
|
610
610
|
if (typeof e.easing == "string") {
|
|
611
|
-
if (!
|
|
612
|
-
const
|
|
611
|
+
if (!_.includes(e.easing)) {
|
|
612
|
+
const r = ee(e.easing, _);
|
|
613
613
|
t.push({
|
|
614
614
|
path: `${a}.easing`,
|
|
615
|
-
message: `Unknown easing "${e.easing}".${
|
|
615
|
+
message: `Unknown easing "${e.easing}".${r} Available: ${_.join(", ")}`,
|
|
616
616
|
severity: "error"
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
621
|
if (typeof e.easing == "object" && e.easing !== null) {
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
if (
|
|
625
|
-
for (const
|
|
626
|
-
typeof i
|
|
622
|
+
const r = e.easing;
|
|
623
|
+
if (r.type === "spring") return;
|
|
624
|
+
if (r.type === "cubicBezier") {
|
|
625
|
+
for (const i of ["x1", "y1", "x2", "y2"])
|
|
626
|
+
typeof r[i] != "number" && t.push({ path: `${a}.easing.${i}`, message: `cubicBezier requires numeric "${i}"`, severity: "error" });
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
629
|
t.push({ path: `${a}.easing.type`, message: 'Easing object type must be "spring" or "cubicBezier"', severity: "error" });
|
|
@@ -632,63 +632,83 @@ function P(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
|
|
636
|
-
typeof e[a] != "number" &&
|
|
637
|
-
}
|
|
638
|
-
function z(e, a, t, i) {
|
|
639
|
-
(typeof e[a] != "number" || e[a] <= 0) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
635
|
+
function u(e, a, t, r) {
|
|
636
|
+
typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
|
|
640
637
|
}
|
|
641
|
-
function
|
|
642
|
-
|
|
643
|
-
(typeof r != "number" || r <= 0 || !Number.isInteger(r)) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
638
|
+
function p(e, a, t, r) {
|
|
639
|
+
(typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
644
640
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
641
|
+
function Tt(e, a, t, r) {
|
|
642
|
+
const i = e[a];
|
|
643
|
+
(typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
647
644
|
}
|
|
648
|
-
function
|
|
649
|
-
|
|
650
|
-
r !== void 0 && (typeof r != "number" || r <= 0 || !Number.isInteger(r)) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
645
|
+
function y(e, a, t, r) {
|
|
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" });
|
|
651
647
|
}
|
|
652
|
-
function
|
|
653
|
-
|
|
648
|
+
function Mt(e, a, t, r) {
|
|
649
|
+
const i = e[a];
|
|
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" });
|
|
654
651
|
}
|
|
655
|
-
function
|
|
656
|
-
e[a] !== void 0 && typeof e[a] != "
|
|
652
|
+
function $(e, a, t, r) {
|
|
653
|
+
e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
|
|
657
654
|
}
|
|
658
|
-
function
|
|
659
|
-
e[a] !== void 0 && typeof e[a] != "
|
|
655
|
+
function P(e, a, t, r) {
|
|
656
|
+
e[a] !== void 0 && typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a number`, severity: "error" });
|
|
660
657
|
}
|
|
661
|
-
function
|
|
662
|
-
|
|
663
|
-
r !== void 0 && (!Array.isArray(r) || r.length !== 2 || typeof r[0] != "number" || typeof r[1] != "number") && i.push({ path: `${t}.${a}`, message: `"${a}" must be [number, number]`, severity: "error" });
|
|
658
|
+
function N(e, a, t, r) {
|
|
659
|
+
e[a] !== void 0 && typeof e[a] != "boolean" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a boolean`, severity: "error" });
|
|
664
660
|
}
|
|
665
|
-
function
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
const r = a.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
|
|
669
|
-
return r ? ` Did you mean '${r}'?` : "";
|
|
661
|
+
function k(e, a, t, r) {
|
|
662
|
+
const i = e[a];
|
|
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" });
|
|
670
664
|
}
|
|
671
|
-
|
|
665
|
+
function ee(e, a) {
|
|
666
|
+
const t = e.toLowerCase(), r = a.find((n) => n.toLowerCase() === t);
|
|
667
|
+
if (r) return ` Did you mean '${r}'?`;
|
|
668
|
+
const i = a.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
|
|
669
|
+
return i ? ` Did you mean '${i}'?` : "";
|
|
670
|
+
}
|
|
671
|
+
const te = {
|
|
672
|
+
foreground: { cssVar: "--elucim-foreground", fallback: "#e0e0e0" },
|
|
673
|
+
background: { cssVar: "--elucim-background", fallback: "#0f172a" },
|
|
674
|
+
accent: { cssVar: "--elucim-accent", fallback: "#4fc3f7" },
|
|
675
|
+
muted: { cssVar: "--elucim-muted", fallback: "#64748b" },
|
|
676
|
+
surface: { cssVar: "--elucim-surface", fallback: "#1e293b" },
|
|
677
|
+
border: { cssVar: "--elucim-border", fallback: "#334155" },
|
|
678
|
+
primary: { cssVar: "--elucim-primary", fallback: "#4fc3f7" },
|
|
679
|
+
secondary: { cssVar: "--elucim-secondary", fallback: "#a78bfa" },
|
|
680
|
+
tertiary: { cssVar: "--elucim-tertiary", fallback: "#f472b6" },
|
|
681
|
+
success: { cssVar: "--elucim-success", fallback: "#34d399" },
|
|
682
|
+
warning: { cssVar: "--elucim-warning", fallback: "#fbbf24" },
|
|
683
|
+
error: { cssVar: "--elucim-error", fallback: "#f87171" }
|
|
684
|
+
}, Qt = Object.keys(te);
|
|
685
|
+
function l(e) {
|
|
686
|
+
if (e === void 0) return;
|
|
687
|
+
if (!e.startsWith("$")) return e;
|
|
688
|
+
const a = e.slice(1), t = te[a];
|
|
689
|
+
return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
|
|
690
|
+
}
|
|
691
|
+
const Wt = {
|
|
672
692
|
card: [640, 360],
|
|
673
693
|
slide: [1280, 720],
|
|
674
694
|
square: [600, 600]
|
|
675
695
|
};
|
|
676
|
-
function
|
|
696
|
+
function W(e, a, t) {
|
|
677
697
|
if (!e) return { width: a, height: t };
|
|
678
|
-
const [
|
|
679
|
-
return { width: a ??
|
|
698
|
+
const [r, i] = Wt[e];
|
|
699
|
+
return { width: a ?? r, height: t ?? i };
|
|
680
700
|
}
|
|
681
|
-
function
|
|
701
|
+
function ae(e, a) {
|
|
682
702
|
switch (e.type) {
|
|
683
703
|
case "scene":
|
|
684
704
|
return j(e, a);
|
|
685
705
|
case "player":
|
|
686
706
|
if ((a == null ? void 0 : a.frame) !== void 0) {
|
|
687
|
-
const { width: t, height:
|
|
707
|
+
const { width: t, height: r } = W(e.preset, e.width, e.height);
|
|
688
708
|
return j(
|
|
689
709
|
{
|
|
690
710
|
width: t,
|
|
691
|
-
height:
|
|
711
|
+
height: r,
|
|
692
712
|
fps: e.fps,
|
|
693
713
|
durationInFrames: e.durationInFrames,
|
|
694
714
|
background: e.background,
|
|
@@ -697,87 +717,87 @@ function ee(e, a) {
|
|
|
697
717
|
a
|
|
698
718
|
);
|
|
699
719
|
}
|
|
700
|
-
return
|
|
720
|
+
return re(e, a);
|
|
701
721
|
case "presentation":
|
|
702
|
-
return
|
|
722
|
+
return _t(e);
|
|
703
723
|
}
|
|
704
724
|
}
|
|
705
725
|
function j(e, a) {
|
|
706
|
-
const t = (a == null ? void 0 : a.frame) !== void 0, { width:
|
|
726
|
+
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = W(e.preset, e.width, e.height);
|
|
707
727
|
return /* @__PURE__ */ s(
|
|
708
|
-
|
|
728
|
+
Ce,
|
|
709
729
|
{
|
|
710
|
-
width:
|
|
711
|
-
height:
|
|
730
|
+
width: r,
|
|
731
|
+
height: i,
|
|
712
732
|
fps: e.fps,
|
|
713
733
|
durationInFrames: e.durationInFrames,
|
|
714
|
-
background: e.background,
|
|
734
|
+
background: l(e.background),
|
|
715
735
|
...t ? { frame: a.frame, autoPlay: !1 } : {},
|
|
716
|
-
children: e.children.map((n,
|
|
736
|
+
children: e.children.map((n, h) => x(n, h))
|
|
717
737
|
}
|
|
718
738
|
);
|
|
719
739
|
}
|
|
720
|
-
function
|
|
721
|
-
const { width: t, height:
|
|
740
|
+
function re(e, a) {
|
|
741
|
+
const { width: t, height: r } = W(e.preset, e.width, e.height);
|
|
722
742
|
return /* @__PURE__ */ s(
|
|
723
|
-
|
|
743
|
+
ze,
|
|
724
744
|
{
|
|
725
745
|
ref: a == null ? void 0 : a.playerRef,
|
|
726
746
|
width: t,
|
|
727
|
-
height:
|
|
747
|
+
height: r,
|
|
728
748
|
fps: e.fps,
|
|
729
749
|
durationInFrames: e.durationInFrames,
|
|
730
|
-
background: e.background,
|
|
750
|
+
background: l(e.background),
|
|
731
751
|
controls: e.controls,
|
|
732
752
|
loop: e.loop,
|
|
733
753
|
autoPlay: e.autoPlay,
|
|
734
|
-
children: e.children.map((
|
|
754
|
+
children: e.children.map((i, n) => x(i, n))
|
|
735
755
|
}
|
|
736
756
|
);
|
|
737
757
|
}
|
|
738
|
-
function
|
|
739
|
-
const { width: a, height: t } =
|
|
758
|
+
function _t(e) {
|
|
759
|
+
const { width: a, height: t } = W(e.preset, e.width, e.height);
|
|
740
760
|
return /* @__PURE__ */ s(
|
|
741
|
-
|
|
761
|
+
Ae,
|
|
742
762
|
{
|
|
743
763
|
width: a,
|
|
744
764
|
height: t,
|
|
745
|
-
background: e.background,
|
|
765
|
+
background: l(e.background),
|
|
746
766
|
transition: e.transition,
|
|
747
767
|
transitionDuration: e.transitionDuration,
|
|
748
768
|
showHUD: e.showHud,
|
|
749
769
|
showNotes: e.showNotes,
|
|
750
|
-
children: e.slides.map((
|
|
770
|
+
children: e.slides.map((r, i) => Dt(r, i))
|
|
751
771
|
}
|
|
752
772
|
);
|
|
753
773
|
}
|
|
754
|
-
function
|
|
774
|
+
function Dt(e, a) {
|
|
755
775
|
var t;
|
|
756
|
-
return /* @__PURE__ */ s(
|
|
776
|
+
return /* @__PURE__ */ s(pe, { title: e.title, notes: e.notes, background: l(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => x(r, i)) }, a);
|
|
757
777
|
}
|
|
758
|
-
function
|
|
778
|
+
function x(e, a) {
|
|
759
779
|
switch (e.type) {
|
|
760
780
|
case "sequence":
|
|
761
|
-
return /* @__PURE__ */ s(
|
|
781
|
+
return /* @__PURE__ */ s(tt, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((t, r) => x(t, r)) }, a);
|
|
762
782
|
case "group":
|
|
763
783
|
return /* @__PURE__ */ s(
|
|
764
|
-
|
|
784
|
+
et,
|
|
765
785
|
{
|
|
766
786
|
fadeIn: e.fadeIn,
|
|
767
787
|
fadeOut: e.fadeOut,
|
|
768
|
-
easing:
|
|
788
|
+
easing: f(e.easing),
|
|
769
789
|
rotation: e.rotation,
|
|
770
790
|
rotationOrigin: e.rotationOrigin,
|
|
771
791
|
scale: e.scale,
|
|
772
792
|
translate: e.translate,
|
|
773
793
|
zIndex: e.zIndex,
|
|
774
|
-
children: e.children.map((t,
|
|
794
|
+
children: e.children.map((t, r) => x(t, r))
|
|
775
795
|
},
|
|
776
796
|
a
|
|
777
797
|
);
|
|
778
798
|
case "bezierCurve":
|
|
779
799
|
return /* @__PURE__ */ s(
|
|
780
|
-
|
|
800
|
+
Ze,
|
|
781
801
|
{
|
|
782
802
|
x1: e.x1,
|
|
783
803
|
y1: e.y1,
|
|
@@ -787,15 +807,15 @@ function b(e, a) {
|
|
|
787
807
|
cy2: e.cy2,
|
|
788
808
|
x2: e.x2,
|
|
789
809
|
y2: e.y2,
|
|
790
|
-
stroke: e.stroke,
|
|
810
|
+
stroke: l(e.stroke),
|
|
791
811
|
strokeWidth: e.strokeWidth,
|
|
792
|
-
fill: e.fill,
|
|
812
|
+
fill: l(e.fill),
|
|
793
813
|
strokeDasharray: e.strokeDasharray,
|
|
794
814
|
opacity: e.opacity,
|
|
795
815
|
fadeIn: e.fadeIn,
|
|
796
816
|
fadeOut: e.fadeOut,
|
|
797
817
|
draw: e.draw,
|
|
798
|
-
easing:
|
|
818
|
+
easing: f(e.easing),
|
|
799
819
|
rotation: e.rotation,
|
|
800
820
|
rotationOrigin: e.rotationOrigin,
|
|
801
821
|
scale: e.scale,
|
|
@@ -806,19 +826,19 @@ function b(e, a) {
|
|
|
806
826
|
);
|
|
807
827
|
case "circle":
|
|
808
828
|
return /* @__PURE__ */ s(
|
|
809
|
-
|
|
829
|
+
Ye,
|
|
810
830
|
{
|
|
811
831
|
cx: e.cx,
|
|
812
832
|
cy: e.cy,
|
|
813
833
|
r: e.r,
|
|
814
|
-
fill: e.fill,
|
|
815
|
-
stroke: e.stroke,
|
|
834
|
+
fill: l(e.fill),
|
|
835
|
+
stroke: l(e.stroke),
|
|
816
836
|
strokeWidth: e.strokeWidth,
|
|
817
837
|
opacity: e.opacity,
|
|
818
838
|
fadeIn: e.fadeIn,
|
|
819
839
|
fadeOut: e.fadeOut,
|
|
820
840
|
draw: e.draw,
|
|
821
|
-
easing:
|
|
841
|
+
easing: f(e.easing),
|
|
822
842
|
rotation: e.rotation,
|
|
823
843
|
rotationOrigin: e.rotationOrigin,
|
|
824
844
|
scale: e.scale,
|
|
@@ -829,20 +849,20 @@ function b(e, a) {
|
|
|
829
849
|
);
|
|
830
850
|
case "line":
|
|
831
851
|
return /* @__PURE__ */ s(
|
|
832
|
-
|
|
852
|
+
Je,
|
|
833
853
|
{
|
|
834
854
|
x1: e.x1,
|
|
835
855
|
y1: e.y1,
|
|
836
856
|
x2: e.x2,
|
|
837
857
|
y2: e.y2,
|
|
838
|
-
stroke: e.stroke,
|
|
858
|
+
stroke: l(e.stroke),
|
|
839
859
|
strokeWidth: e.strokeWidth,
|
|
840
860
|
strokeDasharray: e.strokeDasharray,
|
|
841
861
|
opacity: e.opacity,
|
|
842
862
|
fadeIn: e.fadeIn,
|
|
843
863
|
fadeOut: e.fadeOut,
|
|
844
864
|
draw: e.draw,
|
|
845
|
-
easing:
|
|
865
|
+
easing: f(e.easing),
|
|
846
866
|
rotation: e.rotation,
|
|
847
867
|
rotationOrigin: e.rotationOrigin,
|
|
848
868
|
scale: e.scale,
|
|
@@ -853,13 +873,13 @@ function b(e, a) {
|
|
|
853
873
|
);
|
|
854
874
|
case "arrow":
|
|
855
875
|
return /* @__PURE__ */ s(
|
|
856
|
-
|
|
876
|
+
Xe,
|
|
857
877
|
{
|
|
858
878
|
x1: e.x1,
|
|
859
879
|
y1: e.y1,
|
|
860
880
|
x2: e.x2,
|
|
861
881
|
y2: e.y2,
|
|
862
|
-
stroke: e.stroke,
|
|
882
|
+
stroke: l(e.stroke),
|
|
863
883
|
strokeWidth: e.strokeWidth,
|
|
864
884
|
headSize: e.headSize,
|
|
865
885
|
strokeDasharray: e.strokeDasharray,
|
|
@@ -867,7 +887,7 @@ function b(e, a) {
|
|
|
867
887
|
fadeIn: e.fadeIn,
|
|
868
888
|
fadeOut: e.fadeOut,
|
|
869
889
|
draw: e.draw,
|
|
870
|
-
easing:
|
|
890
|
+
easing: f(e.easing),
|
|
871
891
|
rotation: e.rotation,
|
|
872
892
|
rotationOrigin: e.rotationOrigin,
|
|
873
893
|
scale: e.scale,
|
|
@@ -878,14 +898,14 @@ function b(e, a) {
|
|
|
878
898
|
);
|
|
879
899
|
case "rect":
|
|
880
900
|
return /* @__PURE__ */ s(
|
|
881
|
-
|
|
901
|
+
Qe,
|
|
882
902
|
{
|
|
883
903
|
x: e.x,
|
|
884
904
|
y: e.y,
|
|
885
905
|
width: e.width,
|
|
886
906
|
height: e.height,
|
|
887
|
-
fill: e.fill,
|
|
888
|
-
stroke: e.stroke,
|
|
907
|
+
fill: l(e.fill),
|
|
908
|
+
stroke: l(e.stroke),
|
|
889
909
|
strokeWidth: e.strokeWidth,
|
|
890
910
|
rx: e.rx,
|
|
891
911
|
ry: e.ry,
|
|
@@ -894,7 +914,7 @@ function b(e, a) {
|
|
|
894
914
|
fadeIn: e.fadeIn,
|
|
895
915
|
fadeOut: e.fadeOut,
|
|
896
916
|
draw: e.draw,
|
|
897
|
-
easing:
|
|
917
|
+
easing: f(e.easing),
|
|
898
918
|
rotation: e.rotation,
|
|
899
919
|
rotationOrigin: e.rotationOrigin,
|
|
900
920
|
scale: e.scale,
|
|
@@ -905,18 +925,18 @@ function b(e, a) {
|
|
|
905
925
|
);
|
|
906
926
|
case "polygon":
|
|
907
927
|
return /* @__PURE__ */ s(
|
|
908
|
-
|
|
928
|
+
Ke,
|
|
909
929
|
{
|
|
910
930
|
points: e.points,
|
|
911
|
-
fill: e.fill,
|
|
912
|
-
stroke: e.stroke,
|
|
931
|
+
fill: l(e.fill),
|
|
932
|
+
stroke: l(e.stroke),
|
|
913
933
|
strokeWidth: e.strokeWidth,
|
|
914
934
|
closed: e.closed,
|
|
915
935
|
opacity: e.opacity,
|
|
916
936
|
fadeIn: e.fadeIn,
|
|
917
937
|
fadeOut: e.fadeOut,
|
|
918
938
|
draw: e.draw,
|
|
919
|
-
easing:
|
|
939
|
+
easing: f(e.easing),
|
|
920
940
|
rotation: e.rotation,
|
|
921
941
|
rotationOrigin: e.rotationOrigin,
|
|
922
942
|
scale: e.scale,
|
|
@@ -927,11 +947,11 @@ function b(e, a) {
|
|
|
927
947
|
);
|
|
928
948
|
case "text":
|
|
929
949
|
return /* @__PURE__ */ s(
|
|
930
|
-
|
|
950
|
+
Ge,
|
|
931
951
|
{
|
|
932
952
|
x: e.x,
|
|
933
953
|
y: e.y,
|
|
934
|
-
fill: e.fill,
|
|
954
|
+
fill: l(e.fill),
|
|
935
955
|
fontSize: e.fontSize,
|
|
936
956
|
fontFamily: e.fontFamily,
|
|
937
957
|
fontWeight: e.fontWeight,
|
|
@@ -940,7 +960,7 @@ function b(e, a) {
|
|
|
940
960
|
opacity: e.opacity,
|
|
941
961
|
fadeIn: e.fadeIn,
|
|
942
962
|
fadeOut: e.fadeOut,
|
|
943
|
-
easing:
|
|
963
|
+
easing: f(e.easing),
|
|
944
964
|
rotation: e.rotation,
|
|
945
965
|
rotationOrigin: e.rotationOrigin,
|
|
946
966
|
scale: e.scale,
|
|
@@ -952,7 +972,7 @@ function b(e, a) {
|
|
|
952
972
|
);
|
|
953
973
|
case "image":
|
|
954
974
|
return /* @__PURE__ */ s(
|
|
955
|
-
|
|
975
|
+
He,
|
|
956
976
|
{
|
|
957
977
|
src: e.src,
|
|
958
978
|
x: e.x,
|
|
@@ -965,7 +985,7 @@ function b(e, a) {
|
|
|
965
985
|
opacity: e.opacity,
|
|
966
986
|
fadeIn: e.fadeIn,
|
|
967
987
|
fadeOut: e.fadeOut,
|
|
968
|
-
easing:
|
|
988
|
+
easing: f(e.easing),
|
|
969
989
|
rotation: e.rotation,
|
|
970
990
|
rotationOrigin: e.rotationOrigin,
|
|
971
991
|
scale: e.scale,
|
|
@@ -976,7 +996,7 @@ function b(e, a) {
|
|
|
976
996
|
);
|
|
977
997
|
case "axes":
|
|
978
998
|
return /* @__PURE__ */ s(
|
|
979
|
-
|
|
999
|
+
Ue,
|
|
980
1000
|
{
|
|
981
1001
|
domain: e.domain,
|
|
982
1002
|
range: e.range,
|
|
@@ -986,14 +1006,14 @@ function b(e, a) {
|
|
|
986
1006
|
showTicks: e.showTicks,
|
|
987
1007
|
showLabels: e.showLabels,
|
|
988
1008
|
tickStep: e.tickStep,
|
|
989
|
-
axisColor: e.axisColor,
|
|
990
|
-
gridColor: e.gridColor,
|
|
991
|
-
labelColor: e.labelColor,
|
|
1009
|
+
axisColor: l(e.axisColor),
|
|
1010
|
+
gridColor: l(e.gridColor),
|
|
1011
|
+
labelColor: l(e.labelColor),
|
|
992
1012
|
labelFontSize: e.labelFontSize,
|
|
993
1013
|
fadeIn: e.fadeIn,
|
|
994
1014
|
fadeOut: e.fadeOut,
|
|
995
1015
|
draw: e.draw,
|
|
996
|
-
easing:
|
|
1016
|
+
easing: f(e.easing),
|
|
997
1017
|
rotation: e.rotation,
|
|
998
1018
|
rotationOrigin: e.rotationOrigin,
|
|
999
1019
|
translate: e.translate,
|
|
@@ -1002,20 +1022,20 @@ function b(e, a) {
|
|
|
1002
1022
|
a
|
|
1003
1023
|
);
|
|
1004
1024
|
case "functionPlot": {
|
|
1005
|
-
const t =
|
|
1025
|
+
const t = st(e.fn);
|
|
1006
1026
|
return /* @__PURE__ */ s(
|
|
1007
|
-
|
|
1027
|
+
Be,
|
|
1008
1028
|
{
|
|
1009
|
-
fn: (
|
|
1029
|
+
fn: (r) => t({ x: r }),
|
|
1010
1030
|
domain: e.domain,
|
|
1011
1031
|
yClamp: e.yClamp,
|
|
1012
1032
|
origin: e.origin,
|
|
1013
1033
|
scale: e.scale,
|
|
1014
|
-
color: e.color,
|
|
1034
|
+
color: l(e.color),
|
|
1015
1035
|
strokeWidth: e.strokeWidth,
|
|
1016
1036
|
samples: e.samples,
|
|
1017
1037
|
draw: e.draw,
|
|
1018
|
-
easing:
|
|
1038
|
+
easing: f(e.easing),
|
|
1019
1039
|
opacity: e.opacity,
|
|
1020
1040
|
rotation: e.rotation,
|
|
1021
1041
|
rotationOrigin: e.rotationOrigin,
|
|
@@ -1027,23 +1047,23 @@ function b(e, a) {
|
|
|
1027
1047
|
}
|
|
1028
1048
|
case "vector":
|
|
1029
1049
|
return /* @__PURE__ */ s(
|
|
1030
|
-
|
|
1050
|
+
qe,
|
|
1031
1051
|
{
|
|
1032
1052
|
from: e.from,
|
|
1033
1053
|
to: e.to,
|
|
1034
1054
|
origin: e.origin,
|
|
1035
1055
|
scale: e.scale,
|
|
1036
|
-
color: e.color,
|
|
1056
|
+
color: l(e.color),
|
|
1037
1057
|
strokeWidth: e.strokeWidth,
|
|
1038
1058
|
headSize: e.headSize,
|
|
1039
1059
|
label: e.label,
|
|
1040
1060
|
labelOffset: e.labelOffset,
|
|
1041
|
-
labelColor: e.labelColor,
|
|
1061
|
+
labelColor: l(e.labelColor),
|
|
1042
1062
|
labelFontSize: e.labelFontSize,
|
|
1043
1063
|
fadeIn: e.fadeIn,
|
|
1044
1064
|
fadeOut: e.fadeOut,
|
|
1045
1065
|
draw: e.draw,
|
|
1046
|
-
easing:
|
|
1066
|
+
easing: f(e.easing),
|
|
1047
1067
|
rotation: e.rotation,
|
|
1048
1068
|
rotationOrigin: e.rotationOrigin,
|
|
1049
1069
|
translate: e.translate,
|
|
@@ -1052,25 +1072,25 @@ function b(e, a) {
|
|
|
1052
1072
|
a
|
|
1053
1073
|
);
|
|
1054
1074
|
case "vectorField": {
|
|
1055
|
-
const t =
|
|
1075
|
+
const t = ct(e.fn);
|
|
1056
1076
|
return /* @__PURE__ */ s(
|
|
1057
|
-
|
|
1077
|
+
je,
|
|
1058
1078
|
{
|
|
1059
|
-
fn: (
|
|
1079
|
+
fn: (r, i) => t({ x: r, y: i }),
|
|
1060
1080
|
domain: e.domain,
|
|
1061
1081
|
range: e.range,
|
|
1062
1082
|
step: e.step,
|
|
1063
1083
|
origin: e.origin,
|
|
1064
1084
|
scale: e.scale,
|
|
1065
1085
|
arrowScale: e.arrowScale,
|
|
1066
|
-
color: e.color,
|
|
1086
|
+
color: l(e.color),
|
|
1067
1087
|
strokeWidth: e.strokeWidth,
|
|
1068
1088
|
headSize: e.headSize,
|
|
1069
1089
|
normalize: e.normalize,
|
|
1070
1090
|
maxLength: e.maxLength,
|
|
1071
1091
|
fadeIn: e.fadeIn,
|
|
1072
1092
|
fadeOut: e.fadeOut,
|
|
1073
|
-
easing:
|
|
1093
|
+
easing: f(e.easing),
|
|
1074
1094
|
rotation: e.rotation,
|
|
1075
1095
|
rotationOrigin: e.rotationOrigin,
|
|
1076
1096
|
translate: e.translate,
|
|
@@ -1081,18 +1101,18 @@ function b(e, a) {
|
|
|
1081
1101
|
}
|
|
1082
1102
|
case "matrix":
|
|
1083
1103
|
return /* @__PURE__ */ s(
|
|
1084
|
-
|
|
1104
|
+
Le,
|
|
1085
1105
|
{
|
|
1086
1106
|
values: e.values,
|
|
1087
1107
|
x: e.x,
|
|
1088
1108
|
y: e.y,
|
|
1089
1109
|
cellSize: e.cellSize,
|
|
1090
|
-
color: e.color,
|
|
1091
|
-
bracketColor: e.bracketColor,
|
|
1110
|
+
color: l(e.color),
|
|
1111
|
+
bracketColor: l(e.bracketColor),
|
|
1092
1112
|
fontSize: e.fontSize,
|
|
1093
1113
|
fadeIn: e.fadeIn,
|
|
1094
1114
|
fadeOut: e.fadeOut,
|
|
1095
|
-
easing:
|
|
1115
|
+
easing: f(e.easing),
|
|
1096
1116
|
rotation: e.rotation,
|
|
1097
1117
|
rotationOrigin: e.rotationOrigin,
|
|
1098
1118
|
scale: e.scale,
|
|
@@ -1103,19 +1123,19 @@ function b(e, a) {
|
|
|
1103
1123
|
);
|
|
1104
1124
|
case "graph":
|
|
1105
1125
|
return /* @__PURE__ */ s(
|
|
1106
|
-
|
|
1126
|
+
Ve,
|
|
1107
1127
|
{
|
|
1108
1128
|
nodes: e.nodes,
|
|
1109
1129
|
edges: e.edges,
|
|
1110
|
-
nodeColor: e.nodeColor,
|
|
1130
|
+
nodeColor: l(e.nodeColor),
|
|
1111
1131
|
nodeRadius: e.nodeRadius,
|
|
1112
|
-
edgeColor: e.edgeColor,
|
|
1132
|
+
edgeColor: l(e.edgeColor),
|
|
1113
1133
|
edgeWidth: e.edgeWidth,
|
|
1114
|
-
labelColor: e.labelColor,
|
|
1134
|
+
labelColor: l(e.labelColor),
|
|
1115
1135
|
labelFontSize: e.labelFontSize,
|
|
1116
1136
|
fadeIn: e.fadeIn,
|
|
1117
1137
|
fadeOut: e.fadeOut,
|
|
1118
|
-
easing:
|
|
1138
|
+
easing: f(e.easing),
|
|
1119
1139
|
rotation: e.rotation,
|
|
1120
1140
|
rotationOrigin: e.rotationOrigin,
|
|
1121
1141
|
scale: e.scale,
|
|
@@ -1126,17 +1146,17 @@ function b(e, a) {
|
|
|
1126
1146
|
);
|
|
1127
1147
|
case "latex":
|
|
1128
1148
|
return /* @__PURE__ */ s(
|
|
1129
|
-
|
|
1149
|
+
De,
|
|
1130
1150
|
{
|
|
1131
1151
|
expression: e.expression,
|
|
1132
1152
|
x: e.x,
|
|
1133
1153
|
y: e.y,
|
|
1134
|
-
color: e.color,
|
|
1154
|
+
color: l(e.color),
|
|
1135
1155
|
fontSize: e.fontSize,
|
|
1136
1156
|
align: e.align,
|
|
1137
1157
|
fadeIn: e.fadeIn,
|
|
1138
1158
|
fadeOut: e.fadeOut,
|
|
1139
|
-
easing:
|
|
1159
|
+
easing: f(e.easing),
|
|
1140
1160
|
rotation: e.rotation,
|
|
1141
1161
|
rotationOrigin: e.rotationOrigin,
|
|
1142
1162
|
scale: e.scale,
|
|
@@ -1147,15 +1167,15 @@ function b(e, a) {
|
|
|
1147
1167
|
);
|
|
1148
1168
|
case "barChart":
|
|
1149
1169
|
return /* @__PURE__ */ s(
|
|
1150
|
-
|
|
1170
|
+
_e,
|
|
1151
1171
|
{
|
|
1152
1172
|
bars: e.bars,
|
|
1153
1173
|
x: e.x,
|
|
1154
1174
|
y: e.y,
|
|
1155
1175
|
width: e.width,
|
|
1156
1176
|
height: e.height,
|
|
1157
|
-
barColor: e.barColor,
|
|
1158
|
-
labelColor: e.labelColor,
|
|
1177
|
+
barColor: l(e.barColor),
|
|
1178
|
+
labelColor: l(e.labelColor),
|
|
1159
1179
|
labelFontSize: e.labelFontSize,
|
|
1160
1180
|
showValues: e.showValues,
|
|
1161
1181
|
maxValue: e.maxValue,
|
|
@@ -1163,7 +1183,7 @@ function b(e, a) {
|
|
|
1163
1183
|
valueFormat: e.valueFormat,
|
|
1164
1184
|
fadeIn: e.fadeIn,
|
|
1165
1185
|
fadeOut: e.fadeOut,
|
|
1166
|
-
easing:
|
|
1186
|
+
easing: f(e.easing),
|
|
1167
1187
|
rotation: e.rotation,
|
|
1168
1188
|
rotationOrigin: e.rotationOrigin,
|
|
1169
1189
|
scale: e.scale,
|
|
@@ -1173,125 +1193,125 @@ function b(e, a) {
|
|
|
1173
1193
|
a
|
|
1174
1194
|
);
|
|
1175
1195
|
case "fadeIn":
|
|
1176
|
-
return /* @__PURE__ */ s(
|
|
1196
|
+
return /* @__PURE__ */ s(We, { duration: e.duration, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
|
|
1177
1197
|
case "fadeOut":
|
|
1178
|
-
return /* @__PURE__ */ s(
|
|
1198
|
+
return /* @__PURE__ */ s(Me, { duration: e.duration, totalFrames: e.totalFrames, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
|
|
1179
1199
|
case "draw":
|
|
1180
|
-
return /* @__PURE__ */ s(
|
|
1200
|
+
return /* @__PURE__ */ s(Te, { duration: e.duration, pathLength: e.pathLength, easing: f(e.easing), children: x(e.children[0], 0) }, a);
|
|
1181
1201
|
case "write":
|
|
1182
|
-
return /* @__PURE__ */ s(
|
|
1202
|
+
return /* @__PURE__ */ s(Ne, { duration: e.duration, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
|
|
1183
1203
|
case "transform":
|
|
1184
1204
|
return /* @__PURE__ */ s(
|
|
1185
|
-
|
|
1205
|
+
Re,
|
|
1186
1206
|
{
|
|
1187
1207
|
duration: e.duration,
|
|
1188
|
-
easing:
|
|
1208
|
+
easing: f(e.easing),
|
|
1189
1209
|
translate: e.translate,
|
|
1190
1210
|
scale: e.scale,
|
|
1191
1211
|
rotate: e.rotate,
|
|
1192
1212
|
opacity: e.opacity,
|
|
1193
|
-
children: e.children.map((t,
|
|
1213
|
+
children: e.children.map((t, r) => x(t, r))
|
|
1194
1214
|
},
|
|
1195
1215
|
a
|
|
1196
1216
|
);
|
|
1197
1217
|
case "morph":
|
|
1198
1218
|
return /* @__PURE__ */ s(
|
|
1199
|
-
|
|
1219
|
+
Pe,
|
|
1200
1220
|
{
|
|
1201
1221
|
duration: e.duration,
|
|
1202
|
-
easing:
|
|
1203
|
-
fromColor: e.fromColor,
|
|
1204
|
-
toColor: e.toColor,
|
|
1222
|
+
easing: f(e.easing),
|
|
1223
|
+
fromColor: l(e.fromColor),
|
|
1224
|
+
toColor: l(e.toColor),
|
|
1205
1225
|
fromOpacity: e.fromOpacity,
|
|
1206
1226
|
toOpacity: e.toOpacity,
|
|
1207
1227
|
fromScale: e.fromScale,
|
|
1208
1228
|
toScale: e.toScale,
|
|
1209
|
-
children: e.children.map((t,
|
|
1229
|
+
children: e.children.map((t, r) => x(t, r))
|
|
1210
1230
|
},
|
|
1211
1231
|
a
|
|
1212
1232
|
);
|
|
1213
1233
|
case "stagger":
|
|
1214
|
-
return /* @__PURE__ */ s(
|
|
1234
|
+
return /* @__PURE__ */ s(Fe, { staggerDelay: e.staggerDelay, easing: f(e.easing), children: e.children.map((t, r) => x(t, r)) }, a);
|
|
1215
1235
|
case "parallel":
|
|
1216
|
-
return /* @__PURE__ */ s(
|
|
1236
|
+
return /* @__PURE__ */ s(Ee, { children: e.children.map((t, r) => x(t, r)) }, a);
|
|
1217
1237
|
case "scene":
|
|
1218
|
-
return /* @__PURE__ */ s(
|
|
1238
|
+
return /* @__PURE__ */ s(U.Fragment, { children: j(e) }, a);
|
|
1219
1239
|
case "player":
|
|
1220
|
-
return /* @__PURE__ */ s(
|
|
1240
|
+
return /* @__PURE__ */ s(U.Fragment, { children: re(e) }, a);
|
|
1221
1241
|
default:
|
|
1222
1242
|
return null;
|
|
1223
1243
|
}
|
|
1224
1244
|
}
|
|
1225
|
-
function
|
|
1245
|
+
function Vt(e) {
|
|
1226
1246
|
if (!e) return {};
|
|
1227
1247
|
const a = {};
|
|
1228
|
-
for (const [t,
|
|
1229
|
-
|
|
1248
|
+
for (const [t, r] of Object.entries(e))
|
|
1249
|
+
r !== void 0 && (a[`--elucim-${t}`] = r);
|
|
1230
1250
|
return a;
|
|
1231
1251
|
}
|
|
1232
|
-
const
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1252
|
+
const Xt = at(function({ dsl: a, className: t, style: r, theme: i, poster: n, onError: h }, m) {
|
|
1253
|
+
const d = rt(null);
|
|
1254
|
+
it(m, () => ({
|
|
1235
1255
|
getSvgElement: () => {
|
|
1236
1256
|
var c;
|
|
1237
|
-
return ((c =
|
|
1257
|
+
return ((c = d.current) == null ? void 0 : c.getSvgElement()) ?? null;
|
|
1238
1258
|
},
|
|
1239
1259
|
seekToFrame: (c) => {
|
|
1240
|
-
var
|
|
1241
|
-
return (
|
|
1260
|
+
var g;
|
|
1261
|
+
return (g = d.current) == null ? void 0 : g.seekToFrame(c);
|
|
1242
1262
|
},
|
|
1243
1263
|
getTotalFrames: () => {
|
|
1244
1264
|
var c;
|
|
1245
|
-
return ((c =
|
|
1265
|
+
return ((c = d.current) == null ? void 0 : c.getTotalFrames()) ?? 0;
|
|
1246
1266
|
},
|
|
1247
1267
|
play: () => {
|
|
1248
1268
|
var c;
|
|
1249
|
-
return (c =
|
|
1269
|
+
return (c = d.current) == null ? void 0 : c.play();
|
|
1250
1270
|
},
|
|
1251
1271
|
pause: () => {
|
|
1252
1272
|
var c;
|
|
1253
|
-
return (c =
|
|
1273
|
+
return (c = d.current) == null ? void 0 : c.pause();
|
|
1254
1274
|
},
|
|
1255
1275
|
isPlaying: () => {
|
|
1256
1276
|
var c;
|
|
1257
|
-
return ((c =
|
|
1277
|
+
return ((c = d.current) == null ? void 0 : c.isPlaying()) ?? !1;
|
|
1258
1278
|
}
|
|
1259
1279
|
}));
|
|
1260
|
-
const
|
|
1261
|
-
if (!
|
|
1262
|
-
const c =
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1265
|
-
for (const
|
|
1266
|
-
const w =
|
|
1267
|
-
|
|
1280
|
+
const A = J(a);
|
|
1281
|
+
if (!A.valid) {
|
|
1282
|
+
const c = A.errors.filter((o) => o.severity === "error").map((o) => ({ path: o.path, message: o.message }));
|
|
1283
|
+
h == null || h(c);
|
|
1284
|
+
const g = /* @__PURE__ */ new Map();
|
|
1285
|
+
for (const o of c) {
|
|
1286
|
+
const w = o.path.split("."), S = w.length > 1 ? w.slice(0, -1).join(".") : o.path, C = g.get(S) ?? [];
|
|
1287
|
+
C.push(o), g.set(S, C);
|
|
1268
1288
|
}
|
|
1269
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ F(
|
|
1270
1290
|
"div",
|
|
1271
1291
|
{
|
|
1272
1292
|
className: t,
|
|
1273
|
-
style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...
|
|
1293
|
+
style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...r },
|
|
1274
1294
|
"data-testid": "dsl-error",
|
|
1275
1295
|
children: [
|
|
1276
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ F("strong", { children: [
|
|
1277
1297
|
"Elucim DSL Validation Errors (",
|
|
1278
1298
|
c.length,
|
|
1279
1299
|
"):"
|
|
1280
1300
|
] }),
|
|
1281
|
-
[...
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
|
|
1301
|
+
[...g.entries()].map(([o, w]) => /* @__PURE__ */ F("details", { open: !0, style: { marginTop: 8 }, children: [
|
|
1302
|
+
/* @__PURE__ */ F("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
|
|
1303
|
+
o,
|
|
1284
1304
|
" (",
|
|
1285
1305
|
w.length,
|
|
1286
1306
|
")"
|
|
1287
1307
|
] }),
|
|
1288
|
-
/* @__PURE__ */ s("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: w.map((
|
|
1289
|
-
/* @__PURE__ */ s("code", { style: { color: "#ffa07a" }, children:
|
|
1308
|
+
/* @__PURE__ */ s("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: w.map((S, C) => /* @__PURE__ */ F("li", { children: [
|
|
1309
|
+
/* @__PURE__ */ s("code", { style: { color: "#ffa07a" }, children: S.path }),
|
|
1290
1310
|
": ",
|
|
1291
|
-
|
|
1292
|
-
] },
|
|
1293
|
-
] },
|
|
1294
|
-
/* @__PURE__ */
|
|
1311
|
+
S.message
|
|
1312
|
+
] }, C)) })
|
|
1313
|
+
] }, o)),
|
|
1314
|
+
/* @__PURE__ */ F("details", { style: { marginTop: 12 }, children: [
|
|
1295
1315
|
/* @__PURE__ */ s("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
|
|
1296
1316
|
/* @__PURE__ */ s("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) })
|
|
1297
1317
|
] })
|
|
@@ -1299,38 +1319,38 @@ const Gt = et(function({ dsl: a, className: t, style: i, theme: r, poster: n, on
|
|
|
1299
1319
|
}
|
|
1300
1320
|
);
|
|
1301
1321
|
}
|
|
1302
|
-
const
|
|
1303
|
-
return /* @__PURE__ */ s("div", { className: t, style: { ...
|
|
1304
|
-
frame:
|
|
1305
|
-
playerRef:
|
|
1322
|
+
const E = Vt(i), b = n !== void 0 ? Lt(n, a) : void 0;
|
|
1323
|
+
return /* @__PURE__ */ s("div", { className: t, style: { ...E, ...r }, "data-testid": "dsl-root", children: ae(a.root, {
|
|
1324
|
+
frame: b == null ? void 0 : b.frame,
|
|
1325
|
+
playerRef: d
|
|
1306
1326
|
}) });
|
|
1307
1327
|
});
|
|
1308
|
-
function
|
|
1328
|
+
function Lt(e, a) {
|
|
1309
1329
|
if (e === "first") return { frame: 0 };
|
|
1310
1330
|
if (e === "last") {
|
|
1311
|
-
const
|
|
1312
|
-
return { frame: Math.max(0,
|
|
1331
|
+
const r = a.root.durationInFrames ?? 1;
|
|
1332
|
+
return { frame: Math.max(0, r - 1) };
|
|
1313
1333
|
}
|
|
1314
1334
|
return { frame: e };
|
|
1315
1335
|
}
|
|
1316
|
-
function
|
|
1317
|
-
const
|
|
1318
|
-
if (!
|
|
1319
|
-
const
|
|
1336
|
+
function Jt(e, a, t) {
|
|
1337
|
+
const r = J(e);
|
|
1338
|
+
if (!r.valid) {
|
|
1339
|
+
const h = r.errors.filter((m) => m.severity === "error");
|
|
1320
1340
|
throw new Error(
|
|
1321
1341
|
`DSL validation failed:
|
|
1322
|
-
${
|
|
1342
|
+
${h.map((m) => ` ${m.path}: ${m.message}`).join(`
|
|
1323
1343
|
`)}`
|
|
1324
1344
|
);
|
|
1325
1345
|
}
|
|
1326
|
-
const
|
|
1327
|
-
t != null && t.width && (
|
|
1328
|
-
const n =
|
|
1329
|
-
return
|
|
1346
|
+
const i = { ...e.root };
|
|
1347
|
+
t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
|
|
1348
|
+
const n = ae(i, { frame: a });
|
|
1349
|
+
return nt(n);
|
|
1330
1350
|
}
|
|
1331
|
-
class
|
|
1332
|
-
constructor(a, t = 30,
|
|
1333
|
-
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width =
|
|
1351
|
+
class jt {
|
|
1352
|
+
constructor(a, t = 30, r = 900, i = 640) {
|
|
1353
|
+
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
|
|
1334
1354
|
}
|
|
1335
1355
|
get width() {
|
|
1336
1356
|
return this._width;
|
|
@@ -1395,10 +1415,10 @@ class Lt {
|
|
|
1395
1415
|
}
|
|
1396
1416
|
/** Add a LaTeX expression */
|
|
1397
1417
|
latex(a, t) {
|
|
1398
|
-
const
|
|
1418
|
+
const r = (t == null ? void 0 : t.fadeIn) ?? 15;
|
|
1399
1419
|
return this.addAtCursor({
|
|
1400
1420
|
type: "fadeIn",
|
|
1401
|
-
duration:
|
|
1421
|
+
duration: r,
|
|
1402
1422
|
children: [{
|
|
1403
1423
|
type: "latex",
|
|
1404
1424
|
expression: a,
|
|
@@ -1412,10 +1432,10 @@ class Lt {
|
|
|
1412
1432
|
}
|
|
1413
1433
|
/** Add text at a position */
|
|
1414
1434
|
text(a, t) {
|
|
1415
|
-
const
|
|
1435
|
+
const r = t.fadeIn ?? 15, i = t.advance ?? 5;
|
|
1416
1436
|
return this.addAtCursor({
|
|
1417
1437
|
type: "fadeIn",
|
|
1418
|
-
duration:
|
|
1438
|
+
duration: r,
|
|
1419
1439
|
children: [{
|
|
1420
1440
|
type: "text",
|
|
1421
1441
|
x: t.x,
|
|
@@ -1427,73 +1447,73 @@ class Lt {
|
|
|
1427
1447
|
fontWeight: t.fontWeight,
|
|
1428
1448
|
fontFamily: t.fontFamily
|
|
1429
1449
|
}]
|
|
1430
|
-
},
|
|
1450
|
+
}, i);
|
|
1431
1451
|
}
|
|
1432
1452
|
/** Add an arrow */
|
|
1433
|
-
arrow(a, t,
|
|
1434
|
-
const
|
|
1453
|
+
arrow(a, t, r, i, n) {
|
|
1454
|
+
const h = (n == null ? void 0 : n.fadeIn) ?? 12, m = {
|
|
1435
1455
|
type: "arrow",
|
|
1436
1456
|
x1: a,
|
|
1437
1457
|
y1: t,
|
|
1438
|
-
x2:
|
|
1439
|
-
y2:
|
|
1458
|
+
x2: r,
|
|
1459
|
+
y2: i,
|
|
1440
1460
|
stroke: (n == null ? void 0 : n.color) ?? this.theme.primary,
|
|
1441
1461
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 2,
|
|
1442
1462
|
headSize: (n == null ? void 0 : n.headSize) ?? 8,
|
|
1443
1463
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1444
|
-
fadeIn:
|
|
1464
|
+
fadeIn: h
|
|
1445
1465
|
};
|
|
1446
|
-
return this.addAtCursor(
|
|
1466
|
+
return this.addAtCursor(m, (n == null ? void 0 : n.advance) ?? 3);
|
|
1447
1467
|
}
|
|
1448
1468
|
/** Add a line */
|
|
1449
|
-
line(a, t,
|
|
1450
|
-
const
|
|
1469
|
+
line(a, t, r, i, n) {
|
|
1470
|
+
const h = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1451
1471
|
return this.addAtCursor({
|
|
1452
1472
|
type: "line",
|
|
1453
1473
|
x1: a,
|
|
1454
1474
|
y1: t,
|
|
1455
|
-
x2:
|
|
1456
|
-
y2:
|
|
1475
|
+
x2: r,
|
|
1476
|
+
y2: i,
|
|
1457
1477
|
stroke: (n == null ? void 0 : n.color) ?? this.theme.muted,
|
|
1458
1478
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1,
|
|
1459
1479
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1460
|
-
fadeIn:
|
|
1480
|
+
fadeIn: h
|
|
1461
1481
|
}, (n == null ? void 0 : n.advance) ?? 3);
|
|
1462
1482
|
}
|
|
1463
1483
|
/** Add a rectangle */
|
|
1464
|
-
rect(a, t,
|
|
1465
|
-
const
|
|
1484
|
+
rect(a, t, r, i, n) {
|
|
1485
|
+
const h = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1466
1486
|
return this.addAtCursor({
|
|
1467
1487
|
type: "rect",
|
|
1468
1488
|
x: a,
|
|
1469
1489
|
y: t,
|
|
1470
|
-
width:
|
|
1471
|
-
height:
|
|
1490
|
+
width: r,
|
|
1491
|
+
height: i,
|
|
1472
1492
|
fill: (n == null ? void 0 : n.fill) ?? "none",
|
|
1473
1493
|
stroke: (n == null ? void 0 : n.stroke) ?? this.theme.boxStroke,
|
|
1474
1494
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1.5,
|
|
1475
1495
|
rx: (n == null ? void 0 : n.rx) ?? 6,
|
|
1476
1496
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1477
|
-
fadeIn:
|
|
1497
|
+
fadeIn: h
|
|
1478
1498
|
}, (n == null ? void 0 : n.advance) ?? 5);
|
|
1479
1499
|
}
|
|
1480
1500
|
/** Add a circle */
|
|
1481
|
-
circle(a, t,
|
|
1482
|
-
const n = (
|
|
1501
|
+
circle(a, t, r, i) {
|
|
1502
|
+
const n = (i == null ? void 0 : i.fadeIn) ?? 12;
|
|
1483
1503
|
return this.addAtCursor({
|
|
1484
1504
|
type: "circle",
|
|
1485
1505
|
cx: a,
|
|
1486
1506
|
cy: t,
|
|
1487
|
-
r
|
|
1488
|
-
fill: (
|
|
1489
|
-
stroke: (
|
|
1490
|
-
strokeWidth: (
|
|
1507
|
+
r,
|
|
1508
|
+
fill: (i == null ? void 0 : i.fill) ?? "none",
|
|
1509
|
+
stroke: (i == null ? void 0 : i.stroke) ?? this.theme.primary,
|
|
1510
|
+
strokeWidth: (i == null ? void 0 : i.strokeWidth) ?? 2,
|
|
1491
1511
|
fadeIn: n
|
|
1492
|
-
}, (
|
|
1512
|
+
}, (i == null ? void 0 : i.advance) ?? 5);
|
|
1493
1513
|
}
|
|
1494
1514
|
/** Add a bar chart */
|
|
1495
1515
|
barChart(a, t) {
|
|
1496
|
-
const
|
|
1516
|
+
const r = t.fadeIn ?? 20;
|
|
1497
1517
|
return this.addAtCursor({
|
|
1498
1518
|
type: "barChart",
|
|
1499
1519
|
bars: a,
|
|
@@ -1508,12 +1528,12 @@ class Lt {
|
|
|
1508
1528
|
valueFormat: t.valueFormat,
|
|
1509
1529
|
gap: t.gap,
|
|
1510
1530
|
showValues: t.showValues,
|
|
1511
|
-
fadeIn:
|
|
1531
|
+
fadeIn: r
|
|
1512
1532
|
}, 10);
|
|
1513
1533
|
}
|
|
1514
1534
|
/** Add a matrix visualization */
|
|
1515
1535
|
matrix(a, t) {
|
|
1516
|
-
const
|
|
1536
|
+
const r = (t == null ? void 0 : t.fadeIn) ?? 20;
|
|
1517
1537
|
return this.addAtCursor({
|
|
1518
1538
|
type: "matrix",
|
|
1519
1539
|
values: a,
|
|
@@ -1523,22 +1543,22 @@ class Lt {
|
|
|
1523
1543
|
color: (t == null ? void 0 : t.color) ?? this.theme.text,
|
|
1524
1544
|
bracketColor: (t == null ? void 0 : t.bracketColor) ?? this.theme.primary,
|
|
1525
1545
|
fontSize: t == null ? void 0 : t.fontSize,
|
|
1526
|
-
fadeIn:
|
|
1546
|
+
fadeIn: r
|
|
1527
1547
|
}, 10);
|
|
1528
1548
|
}
|
|
1529
1549
|
/** Add a graph (nodes + edges) */
|
|
1530
|
-
graph(a, t,
|
|
1531
|
-
const
|
|
1550
|
+
graph(a, t, r) {
|
|
1551
|
+
const i = (r == null ? void 0 : r.fadeIn) ?? 20;
|
|
1532
1552
|
return this.addAtCursor({
|
|
1533
1553
|
type: "graph",
|
|
1534
1554
|
nodes: a,
|
|
1535
1555
|
edges: t,
|
|
1536
|
-
nodeColor: (
|
|
1537
|
-
edgeColor: (
|
|
1538
|
-
labelColor: (
|
|
1539
|
-
nodeRadius:
|
|
1540
|
-
edgeWidth:
|
|
1541
|
-
fadeIn:
|
|
1556
|
+
nodeColor: (r == null ? void 0 : r.nodeColor) ?? this.theme.secondary,
|
|
1557
|
+
edgeColor: (r == null ? void 0 : r.edgeColor) ?? this.theme.muted,
|
|
1558
|
+
labelColor: (r == null ? void 0 : r.labelColor) ?? "#fff",
|
|
1559
|
+
nodeRadius: r == null ? void 0 : r.nodeRadius,
|
|
1560
|
+
edgeWidth: r == null ? void 0 : r.edgeWidth,
|
|
1561
|
+
fadeIn: i
|
|
1542
1562
|
}, 10);
|
|
1543
1563
|
}
|
|
1544
1564
|
// ─── Layout helpers ──────────────────────────────────────────────────
|
|
@@ -1547,33 +1567,33 @@ class Lt {
|
|
|
1547
1567
|
* Returns the box positions for follow-up arrows, etc.
|
|
1548
1568
|
*/
|
|
1549
1569
|
boxRow(a, t) {
|
|
1550
|
-
const
|
|
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, h = (t == null ? void 0 : t.y) ?? 250, m = a.length * r + (a.length - 1) * n, d = (this._width - m) / 2;
|
|
1551
1571
|
t == null || t.fadeIn;
|
|
1552
|
-
const
|
|
1553
|
-
const
|
|
1554
|
-
return { x:
|
|
1555
|
-
}),
|
|
1556
|
-
var
|
|
1557
|
-
const
|
|
1572
|
+
const A = a.map((b, c) => {
|
|
1573
|
+
const g = d + c * (r + n);
|
|
1574
|
+
return { x: g, y: h, w: r, h: i, cx: g + r / 2, cy: h + i / 2 };
|
|
1575
|
+
}), E = a.map((b, c) => {
|
|
1576
|
+
var S, C;
|
|
1577
|
+
const g = A[c], o = ((S = t == null ? void 0 : t.colors) == null ? void 0 : S[c]) ?? this.theme.boxFill, w = ((C = t == null ? void 0 : t.strokeColors) == null ? void 0 : C[c]) ?? this.theme.boxStroke;
|
|
1558
1578
|
return {
|
|
1559
1579
|
type: "group",
|
|
1560
1580
|
children: [
|
|
1561
1581
|
{
|
|
1562
1582
|
type: "rect",
|
|
1563
|
-
x:
|
|
1564
|
-
y:
|
|
1565
|
-
width:
|
|
1566
|
-
height:
|
|
1567
|
-
fill:
|
|
1583
|
+
x: g.x,
|
|
1584
|
+
y: g.y,
|
|
1585
|
+
width: r,
|
|
1586
|
+
height: i,
|
|
1587
|
+
fill: o,
|
|
1568
1588
|
stroke: w,
|
|
1569
1589
|
strokeWidth: 1.5,
|
|
1570
1590
|
rx: 6
|
|
1571
1591
|
},
|
|
1572
1592
|
{
|
|
1573
1593
|
type: "text",
|
|
1574
|
-
x:
|
|
1575
|
-
y:
|
|
1576
|
-
content:
|
|
1594
|
+
x: g.cx,
|
|
1595
|
+
y: g.cy + 5,
|
|
1596
|
+
content: b,
|
|
1577
1597
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1578
1598
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1579
1599
|
textAnchor: "middle",
|
|
@@ -1585,21 +1605,21 @@ class Lt {
|
|
|
1585
1605
|
return this.addAtCursor({
|
|
1586
1606
|
type: "stagger",
|
|
1587
1607
|
staggerDelay: 3,
|
|
1588
|
-
children:
|
|
1589
|
-
}, 8 + a.length * 2),
|
|
1608
|
+
children: E
|
|
1609
|
+
}, 8 + a.length * 2), A;
|
|
1590
1610
|
}
|
|
1591
1611
|
/**
|
|
1592
1612
|
* Render a vertical stack of labeled boxes.
|
|
1593
1613
|
*/
|
|
1594
1614
|
boxColumn(a, t) {
|
|
1595
|
-
const
|
|
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, h = (t == null ? void 0 : t.y) ?? 150, m = (t == null ? void 0 : t.x) ?? this.cx;
|
|
1596
1616
|
t == null || t.fadeIn;
|
|
1597
|
-
const
|
|
1598
|
-
const c =
|
|
1599
|
-
return { x:
|
|
1600
|
-
}),
|
|
1601
|
-
var
|
|
1602
|
-
const c =
|
|
1617
|
+
const d = a.map((E, b) => {
|
|
1618
|
+
const c = h + b * (i + n);
|
|
1619
|
+
return { x: m - r / 2, y: c, w: r, h: i, cx: m, cy: c + i / 2 };
|
|
1620
|
+
}), A = a.map((E, b) => {
|
|
1621
|
+
var o, w;
|
|
1622
|
+
const c = d[b], g = ((o = t == null ? void 0 : t.colors) == null ? void 0 : o[b]) ?? this.theme.boxFill;
|
|
1603
1623
|
return {
|
|
1604
1624
|
type: "group",
|
|
1605
1625
|
children: [
|
|
@@ -1607,10 +1627,10 @@ class Lt {
|
|
|
1607
1627
|
type: "rect",
|
|
1608
1628
|
x: c.x,
|
|
1609
1629
|
y: c.y,
|
|
1610
|
-
width:
|
|
1611
|
-
height:
|
|
1612
|
-
fill:
|
|
1613
|
-
stroke: (w = t == null ? void 0 : t.colors) != null && w[
|
|
1630
|
+
width: r,
|
|
1631
|
+
height: i,
|
|
1632
|
+
fill: g,
|
|
1633
|
+
stroke: (w = t == null ? void 0 : t.colors) != null && w[b] ? t.colors[b] : this.theme.boxStroke,
|
|
1614
1634
|
strokeWidth: 1.5,
|
|
1615
1635
|
rx: 6
|
|
1616
1636
|
},
|
|
@@ -1618,7 +1638,7 @@ class Lt {
|
|
|
1618
1638
|
type: "text",
|
|
1619
1639
|
x: c.cx,
|
|
1620
1640
|
y: c.cy + 5,
|
|
1621
|
-
content:
|
|
1641
|
+
content: E,
|
|
1622
1642
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1623
1643
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1624
1644
|
textAnchor: "middle"
|
|
@@ -1629,22 +1649,22 @@ class Lt {
|
|
|
1629
1649
|
return this.addAtCursor({
|
|
1630
1650
|
type: "stagger",
|
|
1631
1651
|
staggerDelay: 3,
|
|
1632
|
-
children:
|
|
1633
|
-
}, 8 + a.length * 2),
|
|
1652
|
+
children: A
|
|
1653
|
+
}, 8 + a.length * 2), d;
|
|
1634
1654
|
}
|
|
1635
1655
|
/**
|
|
1636
1656
|
* Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
|
|
1637
1657
|
*/
|
|
1638
1658
|
connectDown(a, t) {
|
|
1639
|
-
const
|
|
1640
|
-
for (let
|
|
1641
|
-
const n = a[
|
|
1642
|
-
|
|
1659
|
+
const r = [];
|
|
1660
|
+
for (let i = 0; i < a.length - 1; i++) {
|
|
1661
|
+
const n = a[i], h = a[i + 1];
|
|
1662
|
+
r.push({
|
|
1643
1663
|
type: "arrow",
|
|
1644
1664
|
x1: n.cx,
|
|
1645
1665
|
y1: n.y + n.h + 2,
|
|
1646
|
-
x2:
|
|
1647
|
-
y2:
|
|
1666
|
+
x2: h.cx,
|
|
1667
|
+
y2: h.y - 2,
|
|
1648
1668
|
stroke: (t == null ? void 0 : t.color) ?? this.theme.muted,
|
|
1649
1669
|
strokeWidth: 1.5,
|
|
1650
1670
|
headSize: (t == null ? void 0 : t.headSize) ?? 6
|
|
@@ -1653,30 +1673,30 @@ class Lt {
|
|
|
1653
1673
|
return this.addAtCursor({
|
|
1654
1674
|
type: "stagger",
|
|
1655
1675
|
staggerDelay: 2,
|
|
1656
|
-
children:
|
|
1676
|
+
children: r
|
|
1657
1677
|
}, 5 + a.length * 2);
|
|
1658
1678
|
}
|
|
1659
1679
|
/**
|
|
1660
1680
|
* Draw arrows between two rows of boxes (fan-out pattern).
|
|
1661
1681
|
*/
|
|
1662
|
-
connectRows(a, t,
|
|
1663
|
-
const
|
|
1682
|
+
connectRows(a, t, r) {
|
|
1683
|
+
const i = [];
|
|
1664
1684
|
if (a.length === t.length)
|
|
1665
1685
|
for (let n = 0; n < a.length; n++)
|
|
1666
|
-
|
|
1686
|
+
i.push({
|
|
1667
1687
|
type: "arrow",
|
|
1668
1688
|
x1: a[n].cx,
|
|
1669
1689
|
y1: a[n].y + a[n].h + 2,
|
|
1670
1690
|
x2: t[n].cx,
|
|
1671
1691
|
y2: t[n].y - 2,
|
|
1672
|
-
stroke: (
|
|
1692
|
+
stroke: (r == null ? void 0 : r.color) ?? this.theme.muted,
|
|
1673
1693
|
strokeWidth: 1.5,
|
|
1674
|
-
headSize: (
|
|
1694
|
+
headSize: (r == null ? void 0 : r.headSize) ?? 6
|
|
1675
1695
|
});
|
|
1676
1696
|
return this.addAtCursor({
|
|
1677
1697
|
type: "fadeIn",
|
|
1678
1698
|
duration: 15,
|
|
1679
|
-
children:
|
|
1699
|
+
children: i
|
|
1680
1700
|
}, 15);
|
|
1681
1701
|
}
|
|
1682
1702
|
// ─── Raw element access ──────────────────────────────────────────────
|
|
@@ -1713,7 +1733,7 @@ class Lt {
|
|
|
1713
1733
|
return { elements: this.elements, durationInFrames: a };
|
|
1714
1734
|
}
|
|
1715
1735
|
}
|
|
1716
|
-
const
|
|
1736
|
+
const qt = {
|
|
1717
1737
|
background: "#0a0a1e",
|
|
1718
1738
|
title: "#e0e7ff",
|
|
1719
1739
|
subtitle: "#94a3b8",
|
|
@@ -1728,7 +1748,7 @@ const jt = {
|
|
|
1728
1748
|
warning: "#fbbf24",
|
|
1729
1749
|
error: "#f87171",
|
|
1730
1750
|
palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
|
|
1731
|
-
},
|
|
1751
|
+
}, Yt = {
|
|
1732
1752
|
background: "#f8fafc",
|
|
1733
1753
|
title: "#1e293b",
|
|
1734
1754
|
subtitle: "#64748b",
|
|
@@ -1744,9 +1764,9 @@ const jt = {
|
|
|
1744
1764
|
error: "#dc2626",
|
|
1745
1765
|
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1746
1766
|
};
|
|
1747
|
-
class
|
|
1748
|
-
constructor(a, t,
|
|
1749
|
-
this._slides = [], this._title = a, this._theme = t ??
|
|
1767
|
+
class Bt {
|
|
1768
|
+
constructor(a, t, r) {
|
|
1769
|
+
this._slides = [], this._title = a, this._theme = t ?? qt, this._opts = {
|
|
1750
1770
|
width: 900,
|
|
1751
1771
|
height: 640,
|
|
1752
1772
|
fps: 30,
|
|
@@ -1754,35 +1774,35 @@ class qt {
|
|
|
1754
1774
|
transitionDuration: 10,
|
|
1755
1775
|
showHud: !0,
|
|
1756
1776
|
showNotes: !0,
|
|
1757
|
-
...
|
|
1777
|
+
...r
|
|
1758
1778
|
};
|
|
1759
1779
|
}
|
|
1760
1780
|
/** Add a slide */
|
|
1761
|
-
slide(a, t,
|
|
1762
|
-
return this._slides.push({ title: a, build: t, notes:
|
|
1781
|
+
slide(a, t, r) {
|
|
1782
|
+
return this._slides.push({ title: a, build: t, notes: r == null ? void 0 : r.notes, background: r == null ? void 0 : r.background }), this;
|
|
1763
1783
|
}
|
|
1764
1784
|
/** Build the final ElucimDocument */
|
|
1765
1785
|
build() {
|
|
1766
|
-
const a = this._slides.map((
|
|
1767
|
-
const
|
|
1786
|
+
const a = this._slides.map((r) => {
|
|
1787
|
+
const i = new jt(
|
|
1768
1788
|
this._theme,
|
|
1769
1789
|
this._opts.fps,
|
|
1770
1790
|
this._opts.width,
|
|
1771
1791
|
this._opts.height
|
|
1772
1792
|
);
|
|
1773
|
-
|
|
1774
|
-
const { elements: n, durationInFrames:
|
|
1793
|
+
r.build(i);
|
|
1794
|
+
const { elements: n, durationInFrames: h } = i._build();
|
|
1775
1795
|
return {
|
|
1776
1796
|
type: "slide",
|
|
1777
|
-
title:
|
|
1778
|
-
notes:
|
|
1779
|
-
background:
|
|
1797
|
+
title: r.title,
|
|
1798
|
+
notes: r.notes,
|
|
1799
|
+
background: r.background,
|
|
1780
1800
|
children: [{
|
|
1781
1801
|
type: "player",
|
|
1782
1802
|
width: this._opts.width,
|
|
1783
1803
|
height: this._opts.height,
|
|
1784
1804
|
fps: this._opts.fps,
|
|
1785
|
-
durationInFrames:
|
|
1805
|
+
durationInFrames: h,
|
|
1786
1806
|
controls: !1,
|
|
1787
1807
|
loop: !1,
|
|
1788
1808
|
autoPlay: !0,
|
|
@@ -1810,26 +1830,29 @@ class qt {
|
|
|
1810
1830
|
return JSON.stringify(this.build(), null, a ? 2 : void 0);
|
|
1811
1831
|
}
|
|
1812
1832
|
}
|
|
1813
|
-
function
|
|
1814
|
-
return new
|
|
1833
|
+
function Zt(e, a, t) {
|
|
1834
|
+
return new Bt(e, a, t);
|
|
1815
1835
|
}
|
|
1816
1836
|
export {
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1837
|
+
Xt as DslRenderer,
|
|
1838
|
+
Bt as PresentationBuilder,
|
|
1839
|
+
te as SEMANTIC_TOKENS,
|
|
1840
|
+
jt as SlideBuilder,
|
|
1841
|
+
Qt as TOKEN_NAMES,
|
|
1842
|
+
st as compileExpression,
|
|
1843
|
+
ct as compileVectorExpression,
|
|
1844
|
+
qt as darkTheme,
|
|
1845
|
+
Yt as lightTheme,
|
|
1846
|
+
Zt as presentation,
|
|
1847
|
+
x as renderElement,
|
|
1848
|
+
re as renderPlayer,
|
|
1849
|
+
_t as renderPresentation,
|
|
1850
|
+
ae as renderRoot,
|
|
1829
1851
|
j as renderScene,
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1852
|
+
Dt as renderSlide,
|
|
1853
|
+
Jt as renderToSvgString,
|
|
1854
|
+
l as resolveColor,
|
|
1855
|
+
f as resolveEasing,
|
|
1856
|
+
J as validate,
|
|
1857
|
+
X as validateExpression
|
|
1835
1858
|
};
|