@elucim/dsl 0.7.0 → 0.8.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 +36 -0
- package/dist/index.js +404 -364
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
const
|
|
1
|
+
import { easeOutBounce as fe, easeOutElastic as ge, easeOutBack as oe, easeInBack as me, easeInOutExpo as ye, easeOutExpo as be, easeInExpo as xe, easeInOutSine as de, easeOutSine as ve, easeInSine as we, easeInOutQuart as ke, easeOutQuart as Ie, easeInQuart as Se, easeInOutCubic as $e, easeOutCubic as Oe, easeInCubic as Ce, easeInOutQuad as Ae, easeOutQuad as ze, easeInQuad as pe, linear as Ee, spring as Fe, cubicBezier as Re, Presentation as Pe, Scene as Me, Player as Te, Slide as Ne, Parallel as We, Stagger as De, Morph as _e, Transform as Ve, Write as Le, Draw as je, FadeOut as Be, FadeIn as qe, BarChart as Ue, LaTeX as Ge, Graph as He, Matrix as Ke, Text as j, VectorField as Qe, Vector as Xe, FunctionPlot as Je, Axes as Ye, Image as Ze, Polygon as et, Rect as tt, Arrow as at, Line as rt, Circle as it, BezierCurve as nt, Group as st, Sequence as ct } from "@elucim/core";
|
|
2
|
+
import { jsx as l, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
import X, { forwardRef as lt, useRef as ut, useImperativeHandle as ht, useSyncExternalStore as ft } from "react";
|
|
4
|
+
import { renderToStaticMarkup as gt } from "react-dom/server";
|
|
5
|
+
const U = {
|
|
6
6
|
sin: Math.sin,
|
|
7
7
|
cos: Math.cos,
|
|
8
8
|
tan: Math.tan,
|
|
@@ -22,12 +22,12 @@ const B = {
|
|
|
22
22
|
max: (...e) => Math.max(...e),
|
|
23
23
|
sign: Math.sign,
|
|
24
24
|
pow: Math.pow
|
|
25
|
-
},
|
|
25
|
+
}, J = {
|
|
26
26
|
PI: Math.PI,
|
|
27
27
|
E: Math.E,
|
|
28
28
|
TAU: Math.PI * 2
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function K(e) {
|
|
31
31
|
const a = [];
|
|
32
32
|
let t = 0;
|
|
33
33
|
for (; t < e.length; ) {
|
|
@@ -85,12 +85,12 @@ function G(e) {
|
|
|
85
85
|
a.push({ type: "COMMA", value: ",", pos: i });
|
|
86
86
|
break;
|
|
87
87
|
default:
|
|
88
|
-
throw new
|
|
88
|
+
throw new A(`Unexpected character '${r}'`, i);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return a.push({ type: "EOF", value: "", pos: t }), a;
|
|
92
92
|
}
|
|
93
|
-
class
|
|
93
|
+
class Q {
|
|
94
94
|
constructor(a) {
|
|
95
95
|
this.pos = 0, this.tokens = a;
|
|
96
96
|
}
|
|
@@ -104,7 +104,7 @@ class K {
|
|
|
104
104
|
expect(a) {
|
|
105
105
|
const t = this.peek();
|
|
106
106
|
if (t.type !== a)
|
|
107
|
-
throw new
|
|
107
|
+
throw new A(
|
|
108
108
|
`Expected ${a} but got ${t.type} ('${t.value}')`,
|
|
109
109
|
t.pos
|
|
110
110
|
);
|
|
@@ -115,7 +115,7 @@ class K {
|
|
|
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 A(
|
|
119
119
|
`Unexpected token '${t.value}' after expression`,
|
|
120
120
|
t.pos
|
|
121
121
|
);
|
|
@@ -168,14 +168,14 @@ class K {
|
|
|
168
168
|
if (this.peek().type !== "RPAREN")
|
|
169
169
|
for (r.push(this.parseExpression()); this.peek().type === "COMMA"; )
|
|
170
170
|
this.advance(), r.push(this.parseExpression());
|
|
171
|
-
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(
|
|
172
|
-
throw new
|
|
173
|
-
`Unknown function '${t}'. Available: ${Object.keys(
|
|
171
|
+
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(U, t))
|
|
172
|
+
throw new A(
|
|
173
|
+
`Unknown function '${t}'. Available: ${Object.keys(U).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(J, t) ? { kind: "number", value: J[t] } : { kind: "variable", name: t };
|
|
179
179
|
}
|
|
180
180
|
if (a.type === "LPAREN") {
|
|
181
181
|
this.advance();
|
|
@@ -190,24 +190,24 @@ class K {
|
|
|
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 A(
|
|
194
194
|
`Unexpected token '${a.value}'`,
|
|
195
195
|
a.pos
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function E(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 A(`Unknown variable '${e.name}'`, 0);
|
|
206
206
|
case "unary":
|
|
207
|
-
const t =
|
|
207
|
+
const t = E(e.operand, a);
|
|
208
208
|
return e.op === "-" ? -t : t;
|
|
209
209
|
case "binary": {
|
|
210
|
-
const r =
|
|
210
|
+
const r = E(e.left, a), i = E(e.right, a);
|
|
211
211
|
switch (e.op) {
|
|
212
212
|
case "+":
|
|
213
213
|
return r + i;
|
|
@@ -223,74 +223,74 @@ function z(e, a) {
|
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
225
|
case "call": {
|
|
226
|
-
const r =
|
|
226
|
+
const r = U[e.name], i = e.args.map((n) => E(n, a));
|
|
227
227
|
return r(...i);
|
|
228
228
|
}
|
|
229
229
|
case "array":
|
|
230
|
-
return e.elements.map((r) =>
|
|
230
|
+
return e.elements.map((r) => E(r, a));
|
|
231
231
|
}
|
|
232
|
-
throw new
|
|
232
|
+
throw new A("Invalid AST node", 0);
|
|
233
233
|
}
|
|
234
|
-
class
|
|
234
|
+
class A extends Error {
|
|
235
235
|
constructor(a, t) {
|
|
236
236
|
super(a), this.name = "ExpressionError", this.position = t;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
function ot(e) {
|
|
240
|
-
const a =
|
|
241
|
-
return (r) =>
|
|
240
|
+
const a = K(e), t = new Q(a).parse();
|
|
241
|
+
return (r) => E(t, r);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
const a =
|
|
243
|
+
function mt(e) {
|
|
244
|
+
const a = K(e), t = new Q(a).parse();
|
|
245
245
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
246
|
-
throw new
|
|
246
|
+
throw new A(
|
|
247
247
|
'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
|
|
248
248
|
0
|
|
249
249
|
);
|
|
250
|
-
return (r) =>
|
|
250
|
+
return (r) => E(t, r);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function te(e) {
|
|
253
253
|
try {
|
|
254
|
-
const a =
|
|
255
|
-
return new
|
|
254
|
+
const a = K(e);
|
|
255
|
+
return new Q(a).parse(), null;
|
|
256
256
|
} catch (a) {
|
|
257
|
-
return a instanceof
|
|
257
|
+
return a instanceof A ? `${a.message} (at position ${a.position})` : String(a);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
const
|
|
261
|
-
linear:
|
|
262
|
-
easeInQuad:
|
|
263
|
-
easeOutQuad:
|
|
260
|
+
const G = {
|
|
261
|
+
linear: Ee,
|
|
262
|
+
easeInQuad: pe,
|
|
263
|
+
easeOutQuad: ze,
|
|
264
264
|
easeInOutQuad: Ae,
|
|
265
|
-
easeInCubic:
|
|
266
|
-
easeOutCubic:
|
|
267
|
-
easeInOutCubic:
|
|
268
|
-
easeInQuart:
|
|
269
|
-
easeOutQuart:
|
|
270
|
-
easeInOutQuart:
|
|
271
|
-
easeInSine:
|
|
265
|
+
easeInCubic: Ce,
|
|
266
|
+
easeOutCubic: Oe,
|
|
267
|
+
easeInOutCubic: $e,
|
|
268
|
+
easeInQuart: Se,
|
|
269
|
+
easeOutQuart: Ie,
|
|
270
|
+
easeInOutQuart: ke,
|
|
271
|
+
easeInSine: we,
|
|
272
272
|
easeOutSine: ve,
|
|
273
|
-
easeInOutSine:
|
|
274
|
-
easeInExpo:
|
|
275
|
-
easeOutExpo:
|
|
276
|
-
easeInOutExpo:
|
|
277
|
-
easeInBack:
|
|
273
|
+
easeInOutSine: de,
|
|
274
|
+
easeInExpo: xe,
|
|
275
|
+
easeOutExpo: be,
|
|
276
|
+
easeInOutExpo: ye,
|
|
277
|
+
easeInBack: me,
|
|
278
278
|
easeOutBack: oe,
|
|
279
|
-
easeOutElastic:
|
|
280
|
-
easeOutBounce:
|
|
279
|
+
easeOutElastic: ge,
|
|
280
|
+
easeOutBounce: fe
|
|
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 = G[e];
|
|
286
286
|
if (!a) {
|
|
287
|
-
const t = Object.keys(
|
|
287
|
+
const t = Object.keys(G), 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 Fe({
|
|
294
294
|
stiffness: e.stiffness,
|
|
295
295
|
damping: e.damping,
|
|
296
296
|
mass: e.mass
|
|
@@ -300,18 +300,18 @@ function o(e) {
|
|
|
300
300
|
throw new Error(`Unknown easing type: ${e.type}`);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
const
|
|
304
|
-
function
|
|
303
|
+
const B = Object.keys(G);
|
|
304
|
+
function ae(e) {
|
|
305
305
|
const a = [];
|
|
306
306
|
if (!e || typeof e != "object")
|
|
307
307
|
return a.push({ path: "", message: "Document must be an object", severity: "error" }), { valid: !1, errors: a };
|
|
308
308
|
const t = e;
|
|
309
|
-
return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (
|
|
309
|
+
return t.version !== "1.0" && a.push({ path: "version", message: `Expected version "1.0", got "${t.version}"`, severity: "error" }), !t.root || typeof t.root != "object" ? (a.push({ path: "root", message: 'Missing or invalid "root" node', severity: "error" }), { valid: a.filter((r) => r.severity === "error").length === 0, errors: a }) : (yt(t.root, "root", a), {
|
|
310
310
|
valid: a.filter((r) => r.severity === "error").length === 0,
|
|
311
311
|
errors: a
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const Y = ["scene", "player", "presentation"], _ = ["card", "slide", "square"], q = [
|
|
315
315
|
"sequence",
|
|
316
316
|
"group",
|
|
317
317
|
"bezierCurve",
|
|
@@ -340,57 +340,57 @@ const J = ["scene", "player", "presentation"], D = ["card", "slide", "square"],
|
|
|
340
340
|
"parallel",
|
|
341
341
|
"player",
|
|
342
342
|
"scene"
|
|
343
|
-
],
|
|
344
|
-
function
|
|
343
|
+
], Z = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
344
|
+
function yt(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 (!Y.includes(r)) {
|
|
347
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${Y.join(", ")}. Got "${r}"`, severity: "error" });
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
r === "scene" || r === "player" ?
|
|
350
|
+
r === "scene" || r === "player" ? re(e, a, r, t) : r === "presentation" && bt(e, a, t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
|
|
352
|
+
function re(e, a, t, r) {
|
|
353
|
+
jt(e, "durationInFrames", a, r), b(e, "width", a, r), b(e, "height", a, r), b(e, "fps", a, r), z(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (W(e, "controls", a, r), W(e, "loop", a, r), W(e, "autoPlay", a, r)), p(e, a, r);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
if (
|
|
355
|
+
function bt(e, a, t) {
|
|
356
|
+
if (b(e, "width", a, t), b(e, "height", a, t), z(e, "background", a, t), b(e, "transitionDuration", a, t), W(e, "showHud", a, t), W(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (Z.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: ${Z.join(", ")}`,
|
|
359
359
|
severity: "error"
|
|
360
360
|
})), !Array.isArray(e.slides)) {
|
|
361
361
|
t.push({ path: `${a}.slides`, message: 'Presentation must have a "slides" array', severity: "error" });
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
364
|
e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((r, i) => {
|
|
365
|
-
|
|
365
|
+
xt(r, `${a}.slides[${i}]`, t);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function xt(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
|
+
z(e, "title", a, t), z(e, "notes", a, t), z(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
|
|
374
|
+
ie(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 p(e, a, t) {
|
|
378
378
|
if (!Array.isArray(e.children)) {
|
|
379
379
|
t.push({ path: `${a}.children`, message: 'Expected "children" array', severity: "error" });
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
e.children.forEach((r, i) => {
|
|
383
|
-
|
|
383
|
+
ie(r, `${a}.children[${i}]`, t);
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function ie(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
392
|
if (!r || !q.includes(r)) {
|
|
393
|
-
const i = r ?
|
|
393
|
+
const i = r ? ne(r, q) : "";
|
|
394
394
|
t.push({
|
|
395
395
|
path: `${a}.type`,
|
|
396
396
|
message: `Unknown element type "${r}".${i} Valid types: ${q.join(", ")}`,
|
|
@@ -400,136 +400,136 @@ function re(e, a, t) {
|
|
|
400
400
|
}
|
|
401
401
|
switch (r) {
|
|
402
402
|
case "bezierCurve":
|
|
403
|
-
|
|
403
|
+
dt(e, a, t);
|
|
404
404
|
break;
|
|
405
405
|
case "circle":
|
|
406
406
|
vt(e, a, t);
|
|
407
407
|
break;
|
|
408
408
|
case "line":
|
|
409
|
-
|
|
409
|
+
wt(e, a, t);
|
|
410
410
|
break;
|
|
411
411
|
case "arrow":
|
|
412
|
-
|
|
412
|
+
kt(e, a, t);
|
|
413
413
|
break;
|
|
414
414
|
case "rect":
|
|
415
|
-
|
|
415
|
+
It(e, a, t);
|
|
416
416
|
break;
|
|
417
417
|
case "polygon":
|
|
418
|
-
|
|
418
|
+
St(e, a, t);
|
|
419
419
|
break;
|
|
420
420
|
case "text":
|
|
421
|
-
|
|
421
|
+
$t(e, a, t);
|
|
422
422
|
break;
|
|
423
423
|
case "image":
|
|
424
|
-
|
|
424
|
+
_t(e, a, t);
|
|
425
425
|
break;
|
|
426
426
|
case "axes":
|
|
427
|
-
|
|
427
|
+
Ot(e, a, t);
|
|
428
428
|
break;
|
|
429
429
|
case "functionPlot":
|
|
430
|
-
|
|
430
|
+
Ct(e, a, t);
|
|
431
431
|
break;
|
|
432
432
|
case "vector":
|
|
433
433
|
At(e, a, t);
|
|
434
434
|
break;
|
|
435
435
|
case "vectorField":
|
|
436
|
-
|
|
436
|
+
zt(e, a, t);
|
|
437
437
|
break;
|
|
438
438
|
case "matrix":
|
|
439
|
-
|
|
439
|
+
pt(e, a, t);
|
|
440
440
|
break;
|
|
441
441
|
case "graph":
|
|
442
|
-
|
|
442
|
+
Et(e, a, t);
|
|
443
443
|
break;
|
|
444
444
|
case "latex":
|
|
445
|
-
|
|
445
|
+
Ft(e, a, t);
|
|
446
446
|
break;
|
|
447
447
|
case "barChart":
|
|
448
|
-
|
|
448
|
+
Lt(e, a, t);
|
|
449
449
|
break;
|
|
450
450
|
case "sequence":
|
|
451
451
|
Rt(e, a, t);
|
|
452
452
|
break;
|
|
453
453
|
case "group":
|
|
454
|
-
|
|
454
|
+
Vt(e, a, t);
|
|
455
455
|
break;
|
|
456
456
|
case "parallel":
|
|
457
|
-
|
|
457
|
+
p(e, a, t);
|
|
458
458
|
break;
|
|
459
459
|
case "fadeIn":
|
|
460
460
|
case "fadeOut":
|
|
461
461
|
case "draw":
|
|
462
462
|
case "write":
|
|
463
|
-
|
|
463
|
+
Pt(e, a, t);
|
|
464
464
|
break;
|
|
465
465
|
case "transform":
|
|
466
|
-
|
|
466
|
+
Mt(e, a, t);
|
|
467
467
|
break;
|
|
468
468
|
case "morph":
|
|
469
469
|
Tt(e, a, t);
|
|
470
470
|
break;
|
|
471
471
|
case "stagger":
|
|
472
|
-
|
|
472
|
+
Nt(e, a, t);
|
|
473
473
|
break;
|
|
474
474
|
case "scene":
|
|
475
475
|
case "player":
|
|
476
|
-
|
|
476
|
+
re(e, a, r, t);
|
|
477
477
|
break;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 &&
|
|
480
|
+
function dt(e, a, t) {
|
|
481
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 && P(e, "cx2", a, t), e.cy2 !== void 0 && P(e, "cy2", a, t), w(e, a, t);
|
|
482
482
|
}
|
|
483
483
|
function vt(e, a, t) {
|
|
484
|
-
h(e, "cx", a, t), h(e, "cy", a, t),
|
|
485
|
-
}
|
|
486
|
-
function dt(e, a, t) {
|
|
487
|
-
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
|
|
484
|
+
h(e, "cx", a, t), h(e, "cy", a, t), F(e, "r", a, t), w(e, a, t);
|
|
488
485
|
}
|
|
489
486
|
function wt(e, a, t) {
|
|
490
|
-
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t),
|
|
487
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), w(e, a, t);
|
|
491
488
|
}
|
|
492
489
|
function kt(e, a, t) {
|
|
493
|
-
h(e, "
|
|
490
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), w(e, a, t);
|
|
494
491
|
}
|
|
495
492
|
function It(e, a, t) {
|
|
496
|
-
|
|
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);
|
|
493
|
+
h(e, "x", a, t), h(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), w(e, a, t);
|
|
499
494
|
}
|
|
500
495
|
function St(e, a, t) {
|
|
501
|
-
|
|
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" }), w(e, a, t);
|
|
502
499
|
}
|
|
503
500
|
function $t(e, a, t) {
|
|
504
|
-
|
|
501
|
+
h(e, "x", a, t), h(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), w(e, a, t);
|
|
505
502
|
}
|
|
506
503
|
function Ot(e, a, t) {
|
|
504
|
+
S(e, "domain", a, t), S(e, "range", a, t), S(e, "origin", a, t), V(e, a, t);
|
|
505
|
+
}
|
|
506
|
+
function Ct(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 = te(e.fn);
|
|
511
511
|
r && t.push({ path: `${a}.fn`, message: `Invalid expression: ${r}`, severity: "error" });
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
S(e, "domain", a, t), V(e, a, t);
|
|
514
514
|
}
|
|
515
515
|
function At(e, a, t) {
|
|
516
|
-
(!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }),
|
|
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" }), S(e, "from", a, t), V(e, a, t);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function zt(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 = te(e.fn);
|
|
523
523
|
r && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${r}`, severity: "error" });
|
|
524
524
|
}
|
|
525
|
-
|
|
525
|
+
S(e, "domain", a, t), S(e, "range", a, t), V(e, a, t);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function pt(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" }), w(e, a, t);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Et(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 {
|
|
@@ -540,19 +540,19 @@ function pt(e, a, t) {
|
|
|
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
|
+
w(e, a, t);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t),
|
|
545
|
+
function Ft(e, a, t) {
|
|
546
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), w(e, a, t);
|
|
547
547
|
}
|
|
548
548
|
function Rt(e, a, t) {
|
|
549
|
-
h(e, "from", a, t),
|
|
550
|
-
}
|
|
551
|
-
function Ft(e, a, t) {
|
|
552
|
-
g(e, "duration", a, t), P(e, a, t), C(e, a, t);
|
|
549
|
+
h(e, "from", a, t), Bt(e, "durationInFrames", a, t), p(e, a, t);
|
|
553
550
|
}
|
|
554
551
|
function Pt(e, a, t) {
|
|
555
|
-
|
|
552
|
+
b(e, "duration", a, t), M(e, a, t), p(e, a, t);
|
|
553
|
+
}
|
|
554
|
+
function Mt(e, a, t) {
|
|
555
|
+
if (b(e, "duration", a, t), M(e, a, t), e.translate !== void 0) {
|
|
556
556
|
const r = e.translate;
|
|
557
557
|
(!r || typeof r != "object") && t.push({ path: `${a}.translate`, message: "translate must be { from: [x,y], to: [x,y] }", severity: "error" });
|
|
558
558
|
}
|
|
@@ -568,51 +568,51 @@ function Pt(e, a, t) {
|
|
|
568
568
|
const r = e.opacity;
|
|
569
569
|
(!r || typeof r != "object" || typeof r.from != "number" || typeof r.to != "number") && t.push({ path: `${a}.opacity`, message: "opacity must be { from: number, to: number }", severity: "error" });
|
|
570
570
|
}
|
|
571
|
-
|
|
571
|
+
p(e, a, t);
|
|
572
572
|
}
|
|
573
573
|
function Tt(e, a, t) {
|
|
574
|
-
|
|
574
|
+
b(e, "duration", a, t), M(e, a, t), z(e, "fromColor", a, t), z(e, "toColor", a, t), p(e, a, t);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
576
|
+
function Nt(e, a, t) {
|
|
577
|
+
b(e, "staggerDelay", a, t), M(e, a, t), p(e, a, t);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
|
|
579
|
+
function w(e, a, t) {
|
|
580
|
+
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), M(e, a, t), Wt(e, a, t);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
|
|
582
|
+
function V(e, a, t) {
|
|
583
|
+
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), M(e, a, t), Dt(e, a, t);
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
function
|
|
587
|
-
if (
|
|
585
|
+
const ee = ["none", "circle", "ellipse"];
|
|
586
|
+
function Wt(e, a, t) {
|
|
587
|
+
if (P(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(e, "translate", a, t), P(e, "zIndex", a, t), e.scale !== void 0) {
|
|
588
588
|
const r = e.scale;
|
|
589
589
|
typeof r == "number" || Array.isArray(r) && r.length === 2 && typeof r[0] == "number" && typeof r[1] == "number" || t.push({ path: `${a}.scale`, message: '"scale" must be a number or [number, number]', severity: "error" });
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
function _t(e, a, t) {
|
|
593
|
-
F(e, "rotation", a, t), k(e, "rotationOrigin", a, t), k(e, "translate", a, t), F(e, "zIndex", a, t);
|
|
594
|
-
}
|
|
595
592
|
function Dt(e, a, t) {
|
|
596
|
-
|
|
593
|
+
P(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(e, "translate", a, t), P(e, "zIndex", a, t);
|
|
594
|
+
}
|
|
595
|
+
function _t(e, a, t) {
|
|
596
|
+
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), z(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 && (ee.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: ${ee.join(", ")}`,
|
|
599
599
|
severity: "error"
|
|
600
|
-
})),
|
|
601
|
-
}
|
|
602
|
-
function Wt(e, a, t) {
|
|
603
|
-
C(e, a, t), v(e, a, t);
|
|
600
|
+
})), w(e, a, t);
|
|
604
601
|
}
|
|
605
602
|
function Vt(e, a, t) {
|
|
606
|
-
|
|
603
|
+
p(e, a, t), w(e, a, t);
|
|
604
|
+
}
|
|
605
|
+
function Lt(e, a, t) {
|
|
606
|
+
h(e, "x", a, t), h(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), w(e, a, t);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function M(e, a, t) {
|
|
609
609
|
if (e.easing !== void 0) {
|
|
610
610
|
if (typeof e.easing == "string") {
|
|
611
|
-
if (!
|
|
612
|
-
const r =
|
|
611
|
+
if (!B.includes(e.easing)) {
|
|
612
|
+
const r = ne(e.easing, B);
|
|
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: ${B.join(", ")}`,
|
|
616
616
|
severity: "error"
|
|
617
617
|
});
|
|
618
618
|
}
|
|
@@ -635,40 +635,40 @@ function P(e, a, t) {
|
|
|
635
635
|
function h(e, a, t, r) {
|
|
636
636
|
typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function F(e, a, t, r) {
|
|
639
639
|
(typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function jt(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 b(e, a, t, r) {
|
|
646
646
|
e[a] !== void 0 && (typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function Bt(e, a, t, r) {
|
|
649
649
|
const i = e[a];
|
|
650
650
|
i !== void 0 && (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function z(e, a, t, r) {
|
|
653
653
|
e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function P(e, a, t, r) {
|
|
656
656
|
e[a] !== void 0 && typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a number`, severity: "error" });
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function W(e, a, t, r) {
|
|
659
659
|
e[a] !== void 0 && typeof e[a] != "boolean" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a boolean`, severity: "error" });
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function S(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 ne(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 se = {
|
|
672
672
|
foreground: { cssVar: "--elucim-foreground", fallback: "#c8d6e5" },
|
|
673
673
|
background: { cssVar: "--elucim-background", fallback: "#0a0a1e" },
|
|
674
674
|
title: { cssVar: "--elucim-title", fallback: "#e0e7ff" },
|
|
@@ -683,11 +683,11 @@ const ne = {
|
|
|
683
683
|
success: { cssVar: "--elucim-success", fallback: "#34d399" },
|
|
684
684
|
warning: { cssVar: "--elucim-warning", fallback: "#fbbf24" },
|
|
685
685
|
error: { cssVar: "--elucim-error", fallback: "#f87171" }
|
|
686
|
-
},
|
|
686
|
+
}, fa = Object.keys(se);
|
|
687
687
|
function u(e) {
|
|
688
688
|
if (e === void 0) return;
|
|
689
689
|
if (!e.startsWith("$")) return e;
|
|
690
|
-
const a = e.slice(1), t =
|
|
690
|
+
const a = e.slice(1), t = se[a];
|
|
691
691
|
return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
|
|
692
692
|
}
|
|
693
693
|
const qt = {
|
|
@@ -695,18 +695,18 @@ const qt = {
|
|
|
695
695
|
slide: [1280, 720],
|
|
696
696
|
square: [600, 600]
|
|
697
697
|
};
|
|
698
|
-
function
|
|
698
|
+
function L(e, a, t) {
|
|
699
699
|
if (!e) return { width: a, height: t };
|
|
700
700
|
const [r, i] = qt[e];
|
|
701
701
|
return { width: a ?? r, height: t ?? i };
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function ce(e, a) {
|
|
704
704
|
switch (e.type) {
|
|
705
705
|
case "scene":
|
|
706
706
|
return H(e, a);
|
|
707
707
|
case "player":
|
|
708
708
|
if ((a == null ? void 0 : a.frame) !== void 0) {
|
|
709
|
-
const { width: t, height: r } =
|
|
709
|
+
const { width: t, height: r } = L(e.preset, e.width, e.height);
|
|
710
710
|
return H(
|
|
711
711
|
{
|
|
712
712
|
width: t,
|
|
@@ -719,29 +719,30 @@ function se(e, a) {
|
|
|
719
719
|
a
|
|
720
720
|
);
|
|
721
721
|
}
|
|
722
|
-
return
|
|
722
|
+
return le(e, a);
|
|
723
723
|
case "presentation":
|
|
724
|
-
return
|
|
724
|
+
return Ut(e);
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
function H(e, a) {
|
|
728
|
-
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } =
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
|
|
728
|
+
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = L(e.preset, e.width, e.height);
|
|
729
|
+
return /* @__PURE__ */ l(
|
|
730
|
+
Me,
|
|
731
731
|
{
|
|
732
732
|
width: r,
|
|
733
733
|
height: i,
|
|
734
734
|
fps: e.fps,
|
|
735
735
|
durationInFrames: e.durationInFrames,
|
|
736
736
|
background: u(e.background),
|
|
737
|
+
colorScheme: a == null ? void 0 : a.colorScheme,
|
|
737
738
|
...t ? { frame: a.frame, autoPlay: !1 } : {},
|
|
738
|
-
children: e.children.map((n, s) =>
|
|
739
|
+
children: e.children.map((n, s) => v(n, s))
|
|
739
740
|
}
|
|
740
741
|
);
|
|
741
742
|
}
|
|
742
|
-
function
|
|
743
|
-
const { width: t, height: r } =
|
|
744
|
-
return /* @__PURE__ */
|
|
743
|
+
function le(e, a) {
|
|
744
|
+
const { width: t, height: r } = L(e.preset, e.width, e.height);
|
|
745
|
+
return /* @__PURE__ */ l(
|
|
745
746
|
Te,
|
|
746
747
|
{
|
|
747
748
|
ref: a == null ? void 0 : a.playerRef,
|
|
@@ -753,14 +754,15 @@ function ce(e, a) {
|
|
|
753
754
|
controls: e.controls,
|
|
754
755
|
loop: e.loop,
|
|
755
756
|
autoPlay: e.autoPlay,
|
|
756
|
-
|
|
757
|
+
colorScheme: a == null ? void 0 : a.colorScheme,
|
|
758
|
+
children: e.children.map((i, n) => v(i, n))
|
|
757
759
|
}
|
|
758
760
|
);
|
|
759
761
|
}
|
|
760
|
-
function
|
|
761
|
-
const { width: a, height: t } =
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
|
|
762
|
+
function Ut(e) {
|
|
763
|
+
const { width: a, height: t } = L(e.preset, e.width, e.height);
|
|
764
|
+
return /* @__PURE__ */ l(
|
|
765
|
+
Pe,
|
|
764
766
|
{
|
|
765
767
|
width: a,
|
|
766
768
|
height: t,
|
|
@@ -769,38 +771,38 @@ function Bt(e) {
|
|
|
769
771
|
transitionDuration: e.transitionDuration,
|
|
770
772
|
showHUD: e.showHud,
|
|
771
773
|
showNotes: e.showNotes,
|
|
772
|
-
children: e.slides.map((r, i) =>
|
|
774
|
+
children: e.slides.map((r, i) => Gt(r, i))
|
|
773
775
|
}
|
|
774
776
|
);
|
|
775
777
|
}
|
|
776
|
-
function
|
|
778
|
+
function Gt(e, a) {
|
|
777
779
|
var t;
|
|
778
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ l(Ne, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => v(r, i)) }, a);
|
|
779
781
|
}
|
|
780
|
-
function
|
|
782
|
+
function v(e, a) {
|
|
781
783
|
var t, r, i, n;
|
|
782
784
|
switch (e.type) {
|
|
783
785
|
case "sequence":
|
|
784
|
-
return /* @__PURE__ */
|
|
786
|
+
return /* @__PURE__ */ l(ct, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, c) => v(s, c)) }, a);
|
|
785
787
|
case "group":
|
|
786
|
-
return /* @__PURE__ */
|
|
787
|
-
|
|
788
|
+
return /* @__PURE__ */ l(
|
|
789
|
+
st,
|
|
788
790
|
{
|
|
789
791
|
fadeIn: e.fadeIn,
|
|
790
792
|
fadeOut: e.fadeOut,
|
|
791
|
-
easing:
|
|
793
|
+
easing: g(e.easing),
|
|
792
794
|
rotation: e.rotation,
|
|
793
795
|
rotationOrigin: e.rotationOrigin,
|
|
794
796
|
scale: e.scale,
|
|
795
797
|
translate: e.translate,
|
|
796
798
|
zIndex: e.zIndex,
|
|
797
|
-
children: e.children.map((s,
|
|
799
|
+
children: e.children.map((s, c) => v(s, c))
|
|
798
800
|
},
|
|
799
801
|
a
|
|
800
802
|
);
|
|
801
803
|
case "bezierCurve":
|
|
802
|
-
return /* @__PURE__ */
|
|
803
|
-
|
|
804
|
+
return /* @__PURE__ */ l(
|
|
805
|
+
nt,
|
|
804
806
|
{
|
|
805
807
|
x1: e.x1,
|
|
806
808
|
y1: e.y1,
|
|
@@ -818,7 +820,7 @@ function x(e, a) {
|
|
|
818
820
|
fadeIn: e.fadeIn,
|
|
819
821
|
fadeOut: e.fadeOut,
|
|
820
822
|
draw: e.draw,
|
|
821
|
-
easing:
|
|
823
|
+
easing: g(e.easing),
|
|
822
824
|
rotation: e.rotation,
|
|
823
825
|
rotationOrigin: e.rotationOrigin,
|
|
824
826
|
scale: e.scale,
|
|
@@ -828,8 +830,8 @@ function x(e, a) {
|
|
|
828
830
|
a
|
|
829
831
|
);
|
|
830
832
|
case "circle":
|
|
831
|
-
return /* @__PURE__ */
|
|
832
|
-
|
|
833
|
+
return /* @__PURE__ */ l(
|
|
834
|
+
it,
|
|
833
835
|
{
|
|
834
836
|
cx: e.cx,
|
|
835
837
|
cy: e.cy,
|
|
@@ -841,7 +843,7 @@ function x(e, a) {
|
|
|
841
843
|
fadeIn: e.fadeIn,
|
|
842
844
|
fadeOut: e.fadeOut,
|
|
843
845
|
draw: e.draw,
|
|
844
|
-
easing:
|
|
846
|
+
easing: g(e.easing),
|
|
845
847
|
rotation: e.rotation,
|
|
846
848
|
rotationOrigin: e.rotationOrigin,
|
|
847
849
|
scale: e.scale,
|
|
@@ -851,8 +853,8 @@ function x(e, a) {
|
|
|
851
853
|
a
|
|
852
854
|
);
|
|
853
855
|
case "line":
|
|
854
|
-
return /* @__PURE__ */
|
|
855
|
-
|
|
856
|
+
return /* @__PURE__ */ l(
|
|
857
|
+
rt,
|
|
856
858
|
{
|
|
857
859
|
x1: e.x1,
|
|
858
860
|
y1: e.y1,
|
|
@@ -865,7 +867,7 @@ function x(e, a) {
|
|
|
865
867
|
fadeIn: e.fadeIn,
|
|
866
868
|
fadeOut: e.fadeOut,
|
|
867
869
|
draw: e.draw,
|
|
868
|
-
easing:
|
|
870
|
+
easing: g(e.easing),
|
|
869
871
|
rotation: e.rotation,
|
|
870
872
|
rotationOrigin: e.rotationOrigin,
|
|
871
873
|
scale: e.scale,
|
|
@@ -875,8 +877,8 @@ function x(e, a) {
|
|
|
875
877
|
a
|
|
876
878
|
);
|
|
877
879
|
case "arrow":
|
|
878
|
-
return /* @__PURE__ */
|
|
879
|
-
|
|
880
|
+
return /* @__PURE__ */ l(
|
|
881
|
+
at,
|
|
880
882
|
{
|
|
881
883
|
x1: e.x1,
|
|
882
884
|
y1: e.y1,
|
|
@@ -890,7 +892,7 @@ function x(e, a) {
|
|
|
890
892
|
fadeIn: e.fadeIn,
|
|
891
893
|
fadeOut: e.fadeOut,
|
|
892
894
|
draw: e.draw,
|
|
893
|
-
easing:
|
|
895
|
+
easing: g(e.easing),
|
|
894
896
|
rotation: e.rotation,
|
|
895
897
|
rotationOrigin: e.rotationOrigin,
|
|
896
898
|
scale: e.scale,
|
|
@@ -900,8 +902,8 @@ function x(e, a) {
|
|
|
900
902
|
a
|
|
901
903
|
);
|
|
902
904
|
case "rect":
|
|
903
|
-
return /* @__PURE__ */
|
|
904
|
-
|
|
905
|
+
return /* @__PURE__ */ l(
|
|
906
|
+
tt,
|
|
905
907
|
{
|
|
906
908
|
x: e.x,
|
|
907
909
|
y: e.y,
|
|
@@ -917,7 +919,7 @@ function x(e, a) {
|
|
|
917
919
|
fadeIn: e.fadeIn,
|
|
918
920
|
fadeOut: e.fadeOut,
|
|
919
921
|
draw: e.draw,
|
|
920
|
-
easing:
|
|
922
|
+
easing: g(e.easing),
|
|
921
923
|
rotation: e.rotation,
|
|
922
924
|
rotationOrigin: e.rotationOrigin,
|
|
923
925
|
scale: e.scale,
|
|
@@ -927,8 +929,8 @@ function x(e, a) {
|
|
|
927
929
|
a
|
|
928
930
|
);
|
|
929
931
|
case "polygon":
|
|
930
|
-
return /* @__PURE__ */
|
|
931
|
-
|
|
932
|
+
return /* @__PURE__ */ l(
|
|
933
|
+
et,
|
|
932
934
|
{
|
|
933
935
|
points: e.points,
|
|
934
936
|
fill: u(e.fill),
|
|
@@ -939,7 +941,7 @@ function x(e, a) {
|
|
|
939
941
|
fadeIn: e.fadeIn,
|
|
940
942
|
fadeOut: e.fadeOut,
|
|
941
943
|
draw: e.draw,
|
|
942
|
-
easing:
|
|
944
|
+
easing: g(e.easing),
|
|
943
945
|
rotation: e.rotation,
|
|
944
946
|
rotationOrigin: e.rotationOrigin,
|
|
945
947
|
scale: e.scale,
|
|
@@ -949,8 +951,8 @@ function x(e, a) {
|
|
|
949
951
|
a
|
|
950
952
|
);
|
|
951
953
|
case "text":
|
|
952
|
-
return /* @__PURE__ */
|
|
953
|
-
|
|
954
|
+
return /* @__PURE__ */ l(
|
|
955
|
+
j,
|
|
954
956
|
{
|
|
955
957
|
x: e.x,
|
|
956
958
|
y: e.y,
|
|
@@ -963,7 +965,7 @@ function x(e, a) {
|
|
|
963
965
|
opacity: e.opacity,
|
|
964
966
|
fadeIn: e.fadeIn,
|
|
965
967
|
fadeOut: e.fadeOut,
|
|
966
|
-
easing:
|
|
968
|
+
easing: g(e.easing),
|
|
967
969
|
rotation: e.rotation,
|
|
968
970
|
rotationOrigin: e.rotationOrigin,
|
|
969
971
|
scale: e.scale,
|
|
@@ -974,8 +976,8 @@ function x(e, a) {
|
|
|
974
976
|
a
|
|
975
977
|
);
|
|
976
978
|
case "image":
|
|
977
|
-
return /* @__PURE__ */
|
|
978
|
-
|
|
979
|
+
return /* @__PURE__ */ l(
|
|
980
|
+
Ze,
|
|
979
981
|
{
|
|
980
982
|
src: e.src,
|
|
981
983
|
x: e.x,
|
|
@@ -988,7 +990,7 @@ function x(e, a) {
|
|
|
988
990
|
opacity: e.opacity,
|
|
989
991
|
fadeIn: e.fadeIn,
|
|
990
992
|
fadeOut: e.fadeOut,
|
|
991
|
-
easing:
|
|
993
|
+
easing: g(e.easing),
|
|
992
994
|
rotation: e.rotation,
|
|
993
995
|
rotationOrigin: e.rotationOrigin,
|
|
994
996
|
scale: e.scale,
|
|
@@ -998,8 +1000,8 @@ function x(e, a) {
|
|
|
998
1000
|
a
|
|
999
1001
|
);
|
|
1000
1002
|
case "axes":
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
-
|
|
1003
|
+
return /* @__PURE__ */ l(
|
|
1004
|
+
Ye,
|
|
1003
1005
|
{
|
|
1004
1006
|
domain: e.domain,
|
|
1005
1007
|
range: e.range,
|
|
@@ -1016,7 +1018,7 @@ function x(e, a) {
|
|
|
1016
1018
|
fadeIn: e.fadeIn,
|
|
1017
1019
|
fadeOut: e.fadeOut,
|
|
1018
1020
|
draw: e.draw,
|
|
1019
|
-
easing:
|
|
1021
|
+
easing: g(e.easing),
|
|
1020
1022
|
rotation: e.rotation,
|
|
1021
1023
|
rotationOrigin: e.rotationOrigin,
|
|
1022
1024
|
translate: e.translate,
|
|
@@ -1029,8 +1031,8 @@ function x(e, a) {
|
|
|
1029
1031
|
try {
|
|
1030
1032
|
s = ot(e.fn);
|
|
1031
1033
|
} catch {
|
|
1032
|
-
return /* @__PURE__ */
|
|
1033
|
-
|
|
1034
|
+
return /* @__PURE__ */ l(
|
|
1035
|
+
j,
|
|
1034
1036
|
{
|
|
1035
1037
|
x: ((t = e.origin) == null ? void 0 : t[0]) ?? 400,
|
|
1036
1038
|
y: (((r = e.origin) == null ? void 0 : r[1]) ?? 300) - 20,
|
|
@@ -1042,10 +1044,10 @@ function x(e, a) {
|
|
|
1042
1044
|
a
|
|
1043
1045
|
);
|
|
1044
1046
|
}
|
|
1045
|
-
return /* @__PURE__ */
|
|
1046
|
-
|
|
1047
|
+
return /* @__PURE__ */ l(
|
|
1048
|
+
Je,
|
|
1047
1049
|
{
|
|
1048
|
-
fn: (
|
|
1050
|
+
fn: (c) => s({ x: c }),
|
|
1049
1051
|
domain: e.domain,
|
|
1050
1052
|
yClamp: e.yClamp,
|
|
1051
1053
|
origin: e.origin,
|
|
@@ -1054,7 +1056,7 @@ function x(e, a) {
|
|
|
1054
1056
|
strokeWidth: e.strokeWidth,
|
|
1055
1057
|
samples: e.samples,
|
|
1056
1058
|
draw: e.draw,
|
|
1057
|
-
easing:
|
|
1059
|
+
easing: g(e.easing),
|
|
1058
1060
|
opacity: e.opacity,
|
|
1059
1061
|
rotation: e.rotation,
|
|
1060
1062
|
rotationOrigin: e.rotationOrigin,
|
|
@@ -1065,8 +1067,8 @@ function x(e, a) {
|
|
|
1065
1067
|
);
|
|
1066
1068
|
}
|
|
1067
1069
|
case "vector":
|
|
1068
|
-
return /* @__PURE__ */
|
|
1069
|
-
|
|
1070
|
+
return /* @__PURE__ */ l(
|
|
1071
|
+
Xe,
|
|
1070
1072
|
{
|
|
1071
1073
|
from: e.from,
|
|
1072
1074
|
to: e.to,
|
|
@@ -1082,7 +1084,7 @@ function x(e, a) {
|
|
|
1082
1084
|
fadeIn: e.fadeIn,
|
|
1083
1085
|
fadeOut: e.fadeOut,
|
|
1084
1086
|
draw: e.draw,
|
|
1085
|
-
easing:
|
|
1087
|
+
easing: g(e.easing),
|
|
1086
1088
|
rotation: e.rotation,
|
|
1087
1089
|
rotationOrigin: e.rotationOrigin,
|
|
1088
1090
|
translate: e.translate,
|
|
@@ -1093,10 +1095,10 @@ function x(e, a) {
|
|
|
1093
1095
|
case "vectorField": {
|
|
1094
1096
|
let s;
|
|
1095
1097
|
try {
|
|
1096
|
-
s =
|
|
1098
|
+
s = mt(e.fn);
|
|
1097
1099
|
} catch {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
|
|
1100
|
+
return /* @__PURE__ */ l(
|
|
1101
|
+
j,
|
|
1100
1102
|
{
|
|
1101
1103
|
x: ((i = e.origin) == null ? void 0 : i[0]) ?? 400,
|
|
1102
1104
|
y: (((n = e.origin) == null ? void 0 : n[1]) ?? 300) - 20,
|
|
@@ -1108,10 +1110,10 @@ function x(e, a) {
|
|
|
1108
1110
|
a
|
|
1109
1111
|
);
|
|
1110
1112
|
}
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
-
|
|
1113
|
+
return /* @__PURE__ */ l(
|
|
1114
|
+
Qe,
|
|
1113
1115
|
{
|
|
1114
|
-
fn: (
|
|
1116
|
+
fn: (c, x) => s({ x: c, y: x }),
|
|
1115
1117
|
domain: e.domain,
|
|
1116
1118
|
range: e.range,
|
|
1117
1119
|
step: e.step,
|
|
@@ -1125,7 +1127,7 @@ function x(e, a) {
|
|
|
1125
1127
|
maxLength: e.maxLength,
|
|
1126
1128
|
fadeIn: e.fadeIn,
|
|
1127
1129
|
fadeOut: e.fadeOut,
|
|
1128
|
-
easing:
|
|
1130
|
+
easing: g(e.easing),
|
|
1129
1131
|
rotation: e.rotation,
|
|
1130
1132
|
rotationOrigin: e.rotationOrigin,
|
|
1131
1133
|
translate: e.translate,
|
|
@@ -1135,8 +1137,8 @@ function x(e, a) {
|
|
|
1135
1137
|
);
|
|
1136
1138
|
}
|
|
1137
1139
|
case "matrix":
|
|
1138
|
-
return /* @__PURE__ */
|
|
1139
|
-
|
|
1140
|
+
return /* @__PURE__ */ l(
|
|
1141
|
+
Ke,
|
|
1140
1142
|
{
|
|
1141
1143
|
values: e.values,
|
|
1142
1144
|
x: e.x,
|
|
@@ -1147,7 +1149,7 @@ function x(e, a) {
|
|
|
1147
1149
|
fontSize: e.fontSize,
|
|
1148
1150
|
fadeIn: e.fadeIn,
|
|
1149
1151
|
fadeOut: e.fadeOut,
|
|
1150
|
-
easing:
|
|
1152
|
+
easing: g(e.easing),
|
|
1151
1153
|
rotation: e.rotation,
|
|
1152
1154
|
rotationOrigin: e.rotationOrigin,
|
|
1153
1155
|
scale: e.scale,
|
|
@@ -1157,7 +1159,7 @@ function x(e, a) {
|
|
|
1157
1159
|
a
|
|
1158
1160
|
);
|
|
1159
1161
|
case "graph":
|
|
1160
|
-
return /* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ l(
|
|
1161
1163
|
He,
|
|
1162
1164
|
{
|
|
1163
1165
|
nodes: e.nodes,
|
|
@@ -1170,7 +1172,7 @@ function x(e, a) {
|
|
|
1170
1172
|
labelFontSize: e.labelFontSize,
|
|
1171
1173
|
fadeIn: e.fadeIn,
|
|
1172
1174
|
fadeOut: e.fadeOut,
|
|
1173
|
-
easing:
|
|
1175
|
+
easing: g(e.easing),
|
|
1174
1176
|
rotation: e.rotation,
|
|
1175
1177
|
rotationOrigin: e.rotationOrigin,
|
|
1176
1178
|
scale: e.scale,
|
|
@@ -1180,8 +1182,8 @@ function x(e, a) {
|
|
|
1180
1182
|
a
|
|
1181
1183
|
);
|
|
1182
1184
|
case "latex":
|
|
1183
|
-
return /* @__PURE__ */
|
|
1184
|
-
|
|
1185
|
+
return /* @__PURE__ */ l(
|
|
1186
|
+
Ge,
|
|
1185
1187
|
{
|
|
1186
1188
|
expression: e.expression,
|
|
1187
1189
|
x: e.x,
|
|
@@ -1191,7 +1193,7 @@ function x(e, a) {
|
|
|
1191
1193
|
align: e.align,
|
|
1192
1194
|
fadeIn: e.fadeIn,
|
|
1193
1195
|
fadeOut: e.fadeOut,
|
|
1194
|
-
easing:
|
|
1196
|
+
easing: g(e.easing),
|
|
1195
1197
|
rotation: e.rotation,
|
|
1196
1198
|
rotationOrigin: e.rotationOrigin,
|
|
1197
1199
|
scale: e.scale,
|
|
@@ -1201,8 +1203,8 @@ function x(e, a) {
|
|
|
1201
1203
|
a
|
|
1202
1204
|
);
|
|
1203
1205
|
case "barChart":
|
|
1204
|
-
return /* @__PURE__ */
|
|
1205
|
-
|
|
1206
|
+
return /* @__PURE__ */ l(
|
|
1207
|
+
Ue,
|
|
1206
1208
|
{
|
|
1207
1209
|
bars: e.bars,
|
|
1208
1210
|
x: e.x,
|
|
@@ -1218,7 +1220,7 @@ function x(e, a) {
|
|
|
1218
1220
|
valueFormat: e.valueFormat,
|
|
1219
1221
|
fadeIn: e.fadeIn,
|
|
1220
1222
|
fadeOut: e.fadeOut,
|
|
1221
|
-
easing:
|
|
1223
|
+
easing: g(e.easing),
|
|
1222
1224
|
rotation: e.rotation,
|
|
1223
1225
|
rotationOrigin: e.rotationOrigin,
|
|
1224
1226
|
scale: e.scale,
|
|
@@ -1228,56 +1230,56 @@ function x(e, a) {
|
|
|
1228
1230
|
a
|
|
1229
1231
|
);
|
|
1230
1232
|
case "fadeIn":
|
|
1231
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ l(qe, { duration: e.duration, easing: g(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1232
1234
|
case "fadeOut":
|
|
1233
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ l(Be, { duration: e.duration, totalFrames: e.totalFrames, easing: g(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1234
1236
|
case "draw":
|
|
1235
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ l(je, { duration: e.duration, pathLength: e.pathLength, easing: g(e.easing), children: v(e.children[0], 0) }, a);
|
|
1236
1238
|
case "write":
|
|
1237
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ l(Le, { duration: e.duration, easing: g(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1238
1240
|
case "transform":
|
|
1239
|
-
return /* @__PURE__ */
|
|
1240
|
-
|
|
1241
|
+
return /* @__PURE__ */ l(
|
|
1242
|
+
Ve,
|
|
1241
1243
|
{
|
|
1242
1244
|
duration: e.duration,
|
|
1243
|
-
easing:
|
|
1245
|
+
easing: g(e.easing),
|
|
1244
1246
|
translate: e.translate,
|
|
1245
1247
|
scale: e.scale,
|
|
1246
1248
|
rotate: e.rotate,
|
|
1247
1249
|
opacity: e.opacity,
|
|
1248
|
-
children: e.children.map((s,
|
|
1250
|
+
children: e.children.map((s, c) => v(s, c))
|
|
1249
1251
|
},
|
|
1250
1252
|
a
|
|
1251
1253
|
);
|
|
1252
1254
|
case "morph":
|
|
1253
|
-
return /* @__PURE__ */
|
|
1254
|
-
|
|
1255
|
+
return /* @__PURE__ */ l(
|
|
1256
|
+
_e,
|
|
1255
1257
|
{
|
|
1256
1258
|
duration: e.duration,
|
|
1257
|
-
easing:
|
|
1259
|
+
easing: g(e.easing),
|
|
1258
1260
|
fromColor: u(e.fromColor),
|
|
1259
1261
|
toColor: u(e.toColor),
|
|
1260
1262
|
fromOpacity: e.fromOpacity,
|
|
1261
1263
|
toOpacity: e.toOpacity,
|
|
1262
1264
|
fromScale: e.fromScale,
|
|
1263
1265
|
toScale: e.toScale,
|
|
1264
|
-
children: e.children.map((s,
|
|
1266
|
+
children: e.children.map((s, c) => v(s, c))
|
|
1265
1267
|
},
|
|
1266
1268
|
a
|
|
1267
1269
|
);
|
|
1268
1270
|
case "stagger":
|
|
1269
|
-
return /* @__PURE__ */
|
|
1271
|
+
return /* @__PURE__ */ l(De, { staggerDelay: e.staggerDelay, easing: g(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1270
1272
|
case "parallel":
|
|
1271
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ l(We, { children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1272
1274
|
case "scene":
|
|
1273
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ l(X.Fragment, { children: H(e) }, a);
|
|
1274
1276
|
case "player":
|
|
1275
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ l(X.Fragment, { children: le(e) }, a);
|
|
1276
1278
|
default:
|
|
1277
1279
|
return null;
|
|
1278
1280
|
}
|
|
1279
1281
|
}
|
|
1280
|
-
const
|
|
1282
|
+
const ue = {
|
|
1281
1283
|
background: "#0a0a1e",
|
|
1282
1284
|
title: "#e0e7ff",
|
|
1283
1285
|
subtitle: "#94a3b8",
|
|
@@ -1308,14 +1310,14 @@ const le = {
|
|
|
1308
1310
|
error: "#dc2626",
|
|
1309
1311
|
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1310
1312
|
};
|
|
1311
|
-
function
|
|
1313
|
+
function Kt(e) {
|
|
1312
1314
|
if (!e) return {};
|
|
1313
1315
|
const a = {};
|
|
1314
1316
|
for (const [t, r] of Object.entries(e))
|
|
1315
1317
|
r !== void 0 && (a[`--elucim-${t}`] = r);
|
|
1316
1318
|
return a;
|
|
1317
1319
|
}
|
|
1318
|
-
function
|
|
1320
|
+
function he(e) {
|
|
1319
1321
|
return {
|
|
1320
1322
|
"--elucim-foreground": e.text,
|
|
1321
1323
|
"--elucim-background": e.background,
|
|
@@ -1332,58 +1334,58 @@ function ue(e) {
|
|
|
1332
1334
|
"--elucim-error": e.error
|
|
1333
1335
|
};
|
|
1334
1336
|
}
|
|
1335
|
-
const
|
|
1336
|
-
function
|
|
1337
|
+
const Qt = he(ue), Xt = he(Ht);
|
|
1338
|
+
function Jt(e) {
|
|
1337
1339
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {
|
|
1338
1340
|
};
|
|
1339
1341
|
const a = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1340
1342
|
return a.addEventListener("change", e), () => a.removeEventListener("change", e);
|
|
1341
1343
|
}
|
|
1342
|
-
function
|
|
1344
|
+
function Yt() {
|
|
1343
1345
|
return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1344
1346
|
}
|
|
1345
|
-
function
|
|
1347
|
+
function Zt() {
|
|
1346
1348
|
return !0;
|
|
1347
1349
|
}
|
|
1348
|
-
function
|
|
1349
|
-
return
|
|
1350
|
+
function ea() {
|
|
1351
|
+
return ft(Jt, Yt, Zt);
|
|
1350
1352
|
}
|
|
1351
|
-
const
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1353
|
+
const ga = lt(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, onError: c }, x) {
|
|
1354
|
+
const o = ut(null), k = ea();
|
|
1355
|
+
ht(x, () => ({
|
|
1354
1356
|
getSvgElement: () => {
|
|
1355
1357
|
var f;
|
|
1356
|
-
return ((f =
|
|
1358
|
+
return ((f = o.current) == null ? void 0 : f.getSvgElement()) ?? null;
|
|
1357
1359
|
},
|
|
1358
1360
|
seekToFrame: (f) => {
|
|
1359
|
-
var
|
|
1360
|
-
return (
|
|
1361
|
+
var C;
|
|
1362
|
+
return (C = o.current) == null ? void 0 : C.seekToFrame(f);
|
|
1361
1363
|
},
|
|
1362
1364
|
getTotalFrames: () => {
|
|
1363
1365
|
var f;
|
|
1364
|
-
return ((f =
|
|
1366
|
+
return ((f = o.current) == null ? void 0 : f.getTotalFrames()) ?? 0;
|
|
1365
1367
|
},
|
|
1366
1368
|
play: () => {
|
|
1367
1369
|
var f;
|
|
1368
|
-
return (f =
|
|
1370
|
+
return (f = o.current) == null ? void 0 : f.play();
|
|
1369
1371
|
},
|
|
1370
1372
|
pause: () => {
|
|
1371
1373
|
var f;
|
|
1372
|
-
return (f =
|
|
1374
|
+
return (f = o.current) == null ? void 0 : f.pause();
|
|
1373
1375
|
},
|
|
1374
1376
|
isPlaying: () => {
|
|
1375
1377
|
var f;
|
|
1376
|
-
return ((f =
|
|
1378
|
+
return ((f = o.current) == null ? void 0 : f.isPlaying()) ?? !1;
|
|
1377
1379
|
}
|
|
1378
1380
|
}));
|
|
1379
|
-
const
|
|
1380
|
-
if (!
|
|
1381
|
-
const f =
|
|
1382
|
-
|
|
1383
|
-
const
|
|
1384
|
-
for (const
|
|
1385
|
-
const T =
|
|
1386
|
-
|
|
1381
|
+
const y = ae(a);
|
|
1382
|
+
if (!y.valid) {
|
|
1383
|
+
const f = y.errors.filter((I) => I.severity === "error").map((I) => ({ path: I.path, message: I.message }));
|
|
1384
|
+
c == null || c(f);
|
|
1385
|
+
const C = /* @__PURE__ */ new Map();
|
|
1386
|
+
for (const I of f) {
|
|
1387
|
+
const T = I.path.split("."), N = T.length > 1 ? T.slice(0, -1).join(".") : I.path, D = C.get(N) ?? [];
|
|
1388
|
+
D.push(I), C.set(N, D);
|
|
1387
1389
|
}
|
|
1388
1390
|
return /* @__PURE__ */ R(
|
|
1389
1391
|
"div",
|
|
@@ -1397,37 +1399,38 @@ const la = ct(function({ dsl: a, className: t, style: r, theme: i, colorScheme:
|
|
|
1397
1399
|
f.length,
|
|
1398
1400
|
"):"
|
|
1399
1401
|
] }),
|
|
1400
|
-
[...
|
|
1402
|
+
[...C.entries()].map(([I, T]) => /* @__PURE__ */ R("details", { open: !0, style: { marginTop: 8 }, children: [
|
|
1401
1403
|
/* @__PURE__ */ R("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
|
|
1402
|
-
|
|
1404
|
+
I,
|
|
1403
1405
|
" (",
|
|
1404
1406
|
T.length,
|
|
1405
1407
|
")"
|
|
1406
1408
|
] }),
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: T.map((N, D) => /* @__PURE__ */ R("li", { children: [
|
|
1410
|
+
/* @__PURE__ */ l("code", { style: { color: "#ffa07a" }, children: N.path }),
|
|
1409
1411
|
": ",
|
|
1410
|
-
|
|
1411
|
-
] },
|
|
1412
|
-
] },
|
|
1412
|
+
N.message
|
|
1413
|
+
] }, D)) })
|
|
1414
|
+
] }, I)),
|
|
1413
1415
|
/* @__PURE__ */ R("details", { style: { marginTop: 12 }, children: [
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ l("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
|
|
1417
|
+
/* @__PURE__ */ l("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) })
|
|
1416
1418
|
] })
|
|
1417
1419
|
]
|
|
1418
1420
|
}
|
|
1419
1421
|
);
|
|
1420
1422
|
}
|
|
1421
|
-
const m =
|
|
1422
|
-
let
|
|
1423
|
-
n && (
|
|
1424
|
-
const
|
|
1425
|
-
return /* @__PURE__ */
|
|
1426
|
-
frame:
|
|
1427
|
-
playerRef:
|
|
1423
|
+
const m = Kt(i);
|
|
1424
|
+
let d = {};
|
|
1425
|
+
n && (d = (n === "auto" ? k : n === "dark") ? Qt : Xt);
|
|
1426
|
+
const $ = s !== void 0 ? ta(s, a) : void 0, O = n ? n === "auto" ? k ? "dark" : "light" : n : void 0;
|
|
1427
|
+
return /* @__PURE__ */ l("div", { className: t, style: { ...d, ...m, ...r }, "data-testid": "dsl-root", children: ce(a.root, {
|
|
1428
|
+
frame: $ == null ? void 0 : $.frame,
|
|
1429
|
+
playerRef: o,
|
|
1430
|
+
colorScheme: O
|
|
1428
1431
|
}) });
|
|
1429
1432
|
});
|
|
1430
|
-
function
|
|
1433
|
+
function ta(e, a) {
|
|
1431
1434
|
if (e === "first") return { frame: 0 };
|
|
1432
1435
|
if (e === "last") {
|
|
1433
1436
|
const r = a.root.durationInFrames ?? 1;
|
|
@@ -1435,22 +1438,58 @@ function ea(e, a) {
|
|
|
1435
1438
|
}
|
|
1436
1439
|
return { frame: e };
|
|
1437
1440
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const r =
|
|
1441
|
+
function aa(e, a, t) {
|
|
1442
|
+
const r = ae(e);
|
|
1440
1443
|
if (!r.valid) {
|
|
1441
|
-
const s = r.errors.filter((
|
|
1444
|
+
const s = r.errors.filter((c) => c.severity === "error");
|
|
1442
1445
|
throw new Error(
|
|
1443
1446
|
`DSL validation failed:
|
|
1444
|
-
${s.map((
|
|
1447
|
+
${s.map((c) => ` ${c.path}: ${c.message}`).join(`
|
|
1445
1448
|
`)}`
|
|
1446
1449
|
);
|
|
1447
1450
|
}
|
|
1448
1451
|
const i = { ...e.root };
|
|
1449
1452
|
t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
|
|
1450
|
-
const n =
|
|
1451
|
-
return
|
|
1453
|
+
const n = ce(i, { frame: a });
|
|
1454
|
+
return gt(n);
|
|
1455
|
+
}
|
|
1456
|
+
async function oa(e, a, t) {
|
|
1457
|
+
const r = (t == null ? void 0 : t.scale) ?? 2, n = aa(e, a, {
|
|
1458
|
+
width: t == null ? void 0 : t.width,
|
|
1459
|
+
height: t == null ? void 0 : t.height
|
|
1460
|
+
}).match(/<svg[\s\S]*<\/svg>/);
|
|
1461
|
+
if (!n)
|
|
1462
|
+
throw new Error("renderToSvgString did not produce an SVG element");
|
|
1463
|
+
let s = n[0];
|
|
1464
|
+
const c = s.match(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/), x = (t == null ? void 0 : t.width) ?? (c ? parseFloat(c[1]) : 800), o = (t == null ? void 0 : t.height) ?? (c ? parseFloat(c[2]) : 600), k = Math.round(x * r), y = Math.round(o * r);
|
|
1465
|
+
s = s.replace(/width="100%"/, `width="${k}"`).replace(/height="100%"/, `height="${y}"`), s.includes("xmlns=") || (s = s.replace("<svg", '<svg xmlns="http://www.w3.org/2000/svg"')), s = s.replace(/style="[^"]*position:\s*absolute[^"]*"/, "");
|
|
1466
|
+
const m = e.root.background ?? "#ffffff", d = `<rect width="${x}" height="${o}" fill="${m}"/>`;
|
|
1467
|
+
s = s.replace(/>/, `>${d}`);
|
|
1468
|
+
const O = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(s)))}`;
|
|
1469
|
+
return typeof OffscreenCanvas < "u" ? ra(O, k, y) : ia(O, k, y);
|
|
1470
|
+
}
|
|
1471
|
+
async function ra(e, a, t) {
|
|
1472
|
+
const i = await (await fetch(e)).blob(), n = await createImageBitmap(i, { resizeWidth: a, resizeHeight: t }), s = new OffscreenCanvas(a, t);
|
|
1473
|
+
s.getContext("2d").drawImage(n, 0, 0, a, t), n.close();
|
|
1474
|
+
const o = await (await s.convertToBlob({ type: "image/png" })).arrayBuffer();
|
|
1475
|
+
return new Uint8Array(o);
|
|
1476
|
+
}
|
|
1477
|
+
function ia(e, a, t) {
|
|
1478
|
+
return new Promise((r, i) => {
|
|
1479
|
+
const n = new Image();
|
|
1480
|
+
n.onload = () => {
|
|
1481
|
+
const s = document.createElement("canvas");
|
|
1482
|
+
s.width = a, s.height = t, s.getContext("2d").drawImage(n, 0, 0, a, t), s.toBlob(
|
|
1483
|
+
(x) => {
|
|
1484
|
+
if (!x) return i(new Error("Failed to render PNG from SVG"));
|
|
1485
|
+
x.arrayBuffer().then((o) => r(new Uint8Array(o)));
|
|
1486
|
+
},
|
|
1487
|
+
"image/png"
|
|
1488
|
+
);
|
|
1489
|
+
}, n.onerror = () => i(new Error("Failed to load SVG data URI for PNG render")), n.src = e;
|
|
1490
|
+
});
|
|
1452
1491
|
}
|
|
1453
|
-
class
|
|
1492
|
+
class na {
|
|
1454
1493
|
constructor(a, t = 30, r = 900, i = 640) {
|
|
1455
1494
|
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
|
|
1456
1495
|
}
|
|
@@ -1553,7 +1592,7 @@ class ta {
|
|
|
1553
1592
|
}
|
|
1554
1593
|
/** Add an arrow */
|
|
1555
1594
|
arrow(a, t, r, i, n) {
|
|
1556
|
-
const s = (n == null ? void 0 : n.fadeIn) ?? 12,
|
|
1595
|
+
const s = (n == null ? void 0 : n.fadeIn) ?? 12, c = {
|
|
1557
1596
|
type: "arrow",
|
|
1558
1597
|
x1: a,
|
|
1559
1598
|
y1: t,
|
|
@@ -1565,7 +1604,7 @@ class ta {
|
|
|
1565
1604
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1566
1605
|
fadeIn: s
|
|
1567
1606
|
};
|
|
1568
|
-
return this.addAtCursor(
|
|
1607
|
+
return this.addAtCursor(c, (n == null ? void 0 : n.advance) ?? 3);
|
|
1569
1608
|
}
|
|
1570
1609
|
/** Add a line */
|
|
1571
1610
|
line(a, t, r, i, n) {
|
|
@@ -1669,33 +1708,33 @@ class ta {
|
|
|
1669
1708
|
* Returns the box positions for follow-up arrows, etc.
|
|
1670
1709
|
*/
|
|
1671
1710
|
boxRow(a, t) {
|
|
1672
|
-
const r = (t == null ? void 0 : t.boxWidth) ?? 80, i = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, s = (t == null ? void 0 : t.y) ?? 250,
|
|
1711
|
+
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, c = a.length * r + (a.length - 1) * n, x = (this._width - c) / 2;
|
|
1673
1712
|
t == null || t.fadeIn;
|
|
1674
|
-
const
|
|
1675
|
-
const
|
|
1676
|
-
return { x:
|
|
1677
|
-
}),
|
|
1678
|
-
var
|
|
1679
|
-
const
|
|
1713
|
+
const o = a.map((y, m) => {
|
|
1714
|
+
const d = x + m * (r + n);
|
|
1715
|
+
return { x: d, y: s, w: r, h: i, cx: d + r / 2, cy: s + i / 2 };
|
|
1716
|
+
}), k = a.map((y, m) => {
|
|
1717
|
+
var f, C;
|
|
1718
|
+
const d = o[m], $ = ((f = t == null ? void 0 : t.colors) == null ? void 0 : f[m]) ?? this.theme.boxFill, O = ((C = t == null ? void 0 : t.strokeColors) == null ? void 0 : C[m]) ?? this.theme.boxStroke;
|
|
1680
1719
|
return {
|
|
1681
1720
|
type: "group",
|
|
1682
1721
|
children: [
|
|
1683
1722
|
{
|
|
1684
1723
|
type: "rect",
|
|
1685
|
-
x:
|
|
1686
|
-
y:
|
|
1724
|
+
x: d.x,
|
|
1725
|
+
y: d.y,
|
|
1687
1726
|
width: r,
|
|
1688
1727
|
height: i,
|
|
1689
|
-
fill:
|
|
1690
|
-
stroke:
|
|
1728
|
+
fill: $,
|
|
1729
|
+
stroke: O,
|
|
1691
1730
|
strokeWidth: 1.5,
|
|
1692
1731
|
rx: 6
|
|
1693
1732
|
},
|
|
1694
1733
|
{
|
|
1695
1734
|
type: "text",
|
|
1696
|
-
x:
|
|
1697
|
-
y:
|
|
1698
|
-
content:
|
|
1735
|
+
x: d.cx,
|
|
1736
|
+
y: d.cy + 5,
|
|
1737
|
+
content: y,
|
|
1699
1738
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1700
1739
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1701
1740
|
textAnchor: "middle",
|
|
@@ -1707,21 +1746,21 @@ class ta {
|
|
|
1707
1746
|
return this.addAtCursor({
|
|
1708
1747
|
type: "stagger",
|
|
1709
1748
|
staggerDelay: 3,
|
|
1710
|
-
children:
|
|
1711
|
-
}, 8 + a.length * 2),
|
|
1749
|
+
children: k
|
|
1750
|
+
}, 8 + a.length * 2), o;
|
|
1712
1751
|
}
|
|
1713
1752
|
/**
|
|
1714
1753
|
* Render a vertical stack of labeled boxes.
|
|
1715
1754
|
*/
|
|
1716
1755
|
boxColumn(a, t) {
|
|
1717
|
-
const r = (t == null ? void 0 : t.boxWidth) ?? 160, i = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8, s = (t == null ? void 0 : t.y) ?? 150,
|
|
1756
|
+
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, c = (t == null ? void 0 : t.x) ?? this.cx;
|
|
1718
1757
|
t == null || t.fadeIn;
|
|
1719
|
-
const
|
|
1720
|
-
const m = s +
|
|
1721
|
-
return { x:
|
|
1722
|
-
}),
|
|
1723
|
-
var O
|
|
1724
|
-
const m =
|
|
1758
|
+
const x = a.map((k, y) => {
|
|
1759
|
+
const m = s + y * (i + n);
|
|
1760
|
+
return { x: c - r / 2, y: m, w: r, h: i, cx: c, cy: m + i / 2 };
|
|
1761
|
+
}), o = a.map((k, y) => {
|
|
1762
|
+
var $, O;
|
|
1763
|
+
const m = x[y], d = (($ = t == null ? void 0 : t.colors) == null ? void 0 : $[y]) ?? this.theme.boxFill;
|
|
1725
1764
|
return {
|
|
1726
1765
|
type: "group",
|
|
1727
1766
|
children: [
|
|
@@ -1731,8 +1770,8 @@ class ta {
|
|
|
1731
1770
|
y: m.y,
|
|
1732
1771
|
width: r,
|
|
1733
1772
|
height: i,
|
|
1734
|
-
fill:
|
|
1735
|
-
stroke: (
|
|
1773
|
+
fill: d,
|
|
1774
|
+
stroke: (O = t == null ? void 0 : t.colors) != null && O[y] ? t.colors[y] : this.theme.boxStroke,
|
|
1736
1775
|
strokeWidth: 1.5,
|
|
1737
1776
|
rx: 6
|
|
1738
1777
|
},
|
|
@@ -1740,7 +1779,7 @@ class ta {
|
|
|
1740
1779
|
type: "text",
|
|
1741
1780
|
x: m.cx,
|
|
1742
1781
|
y: m.cy + 5,
|
|
1743
|
-
content:
|
|
1782
|
+
content: k,
|
|
1744
1783
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1745
1784
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1746
1785
|
textAnchor: "middle"
|
|
@@ -1751,8 +1790,8 @@ class ta {
|
|
|
1751
1790
|
return this.addAtCursor({
|
|
1752
1791
|
type: "stagger",
|
|
1753
1792
|
staggerDelay: 3,
|
|
1754
|
-
children:
|
|
1755
|
-
}, 8 + a.length * 2),
|
|
1793
|
+
children: o
|
|
1794
|
+
}, 8 + a.length * 2), x;
|
|
1756
1795
|
}
|
|
1757
1796
|
/**
|
|
1758
1797
|
* Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
|
|
@@ -1835,9 +1874,9 @@ class ta {
|
|
|
1835
1874
|
return { elements: this.elements, durationInFrames: a };
|
|
1836
1875
|
}
|
|
1837
1876
|
}
|
|
1838
|
-
class
|
|
1877
|
+
class sa {
|
|
1839
1878
|
constructor(a, t, r) {
|
|
1840
|
-
this._slides = [], this._title = a, this._theme = t ??
|
|
1879
|
+
this._slides = [], this._title = a, this._theme = t ?? ue, this._opts = {
|
|
1841
1880
|
width: 900,
|
|
1842
1881
|
height: 640,
|
|
1843
1882
|
fps: 30,
|
|
@@ -1855,7 +1894,7 @@ class aa {
|
|
|
1855
1894
|
/** Build the final ElucimDocument */
|
|
1856
1895
|
build() {
|
|
1857
1896
|
const a = this._slides.map((r) => {
|
|
1858
|
-
const i = new
|
|
1897
|
+
const i = new na(
|
|
1859
1898
|
this._theme,
|
|
1860
1899
|
this._opts.fps,
|
|
1861
1900
|
this._opts.width,
|
|
@@ -1901,29 +1940,30 @@ class aa {
|
|
|
1901
1940
|
return JSON.stringify(this.build(), null, a ? 2 : void 0);
|
|
1902
1941
|
}
|
|
1903
1942
|
}
|
|
1904
|
-
function
|
|
1905
|
-
return new
|
|
1943
|
+
function ma(e, a, t) {
|
|
1944
|
+
return new sa(e, a, t);
|
|
1906
1945
|
}
|
|
1907
1946
|
export {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1947
|
+
ga as DslRenderer,
|
|
1948
|
+
sa as PresentationBuilder,
|
|
1949
|
+
se as SEMANTIC_TOKENS,
|
|
1950
|
+
na as SlideBuilder,
|
|
1951
|
+
fa as TOKEN_NAMES,
|
|
1913
1952
|
ot as compileExpression,
|
|
1914
|
-
|
|
1915
|
-
|
|
1953
|
+
mt as compileVectorExpression,
|
|
1954
|
+
ue as darkTheme,
|
|
1916
1955
|
Ht as lightTheme,
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1956
|
+
ma as presentation,
|
|
1957
|
+
v as renderElement,
|
|
1958
|
+
le as renderPlayer,
|
|
1959
|
+
Ut as renderPresentation,
|
|
1960
|
+
ce as renderRoot,
|
|
1922
1961
|
H as renderScene,
|
|
1923
|
-
|
|
1924
|
-
|
|
1962
|
+
Gt as renderSlide,
|
|
1963
|
+
oa as renderToPng,
|
|
1964
|
+
aa as renderToSvgString,
|
|
1925
1965
|
u as resolveColor,
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1966
|
+
g as resolveEasing,
|
|
1967
|
+
ae as validate,
|
|
1968
|
+
te as validateExpression
|
|
1929
1969
|
};
|