@elucim/dsl 0.9.0 → 0.11.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 -1
- package/dist/index.js +392 -387
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
2
|
-
import { jsx as l, jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
const
|
|
1
|
+
import { easeOutBounce as be, easeOutElastic as xe, easeOutBack as de, easeInBack as we, easeInOutExpo as ve, easeOutExpo as ke, easeInExpo as Ie, easeInOutSine as Se, easeOutSine as $e, easeInSine as Oe, easeInOutQuart as Ce, easeOutQuart as Ae, easeInQuart as ze, easeInOutCubic as pe, easeOutCubic as Ee, easeInCubic as Pe, easeInOutQuad as Fe, easeOutQuad as Re, easeInQuad as Te, linear as Me, spring as Ne, cubicBezier as We, Presentation as De, Scene as _e, Player as Ve, Slide as Le, Parallel as je, Stagger as Be, Morph as qe, Transform as Ue, Write as Ge, Draw as He, FadeOut as Ke, FadeIn as Qe, BarChart as Xe, LaTeX as Je, Graph as Ye, Matrix as Ze, Text as U, VectorField as et, Vector as tt, FunctionPlot as at, Axes as rt, Image as it, Polygon as nt, Rect as st, Arrow as ct, Line as lt, Circle as ut, BezierCurve as ht, Group as ft, Sequence as gt } from "@elucim/core";
|
|
2
|
+
import { jsx as l, jsxs as F } from "react/jsx-runtime";
|
|
3
|
+
import Z, { forwardRef as ot, useRef as mt, useImperativeHandle as yt, useSyncExternalStore as bt } from "react";
|
|
4
|
+
import { renderToStaticMarkup as xt } from "react-dom/server";
|
|
5
|
+
const K = {
|
|
6
6
|
sin: Math.sin,
|
|
7
7
|
cos: Math.cos,
|
|
8
8
|
tan: Math.tan,
|
|
@@ -22,12 +22,12 @@ const U = {
|
|
|
22
22
|
max: (...e) => Math.max(...e),
|
|
23
23
|
sign: Math.sign,
|
|
24
24
|
pow: Math.pow
|
|
25
|
-
},
|
|
25
|
+
}, ee = {
|
|
26
26
|
PI: Math.PI,
|
|
27
27
|
E: Math.E,
|
|
28
28
|
TAU: Math.PI * 2
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function J(e) {
|
|
31
31
|
const a = [];
|
|
32
32
|
let t = 0;
|
|
33
33
|
for (; t < e.length; ) {
|
|
@@ -85,12 +85,12 @@ function K(e) {
|
|
|
85
85
|
a.push({ type: "COMMA", value: ",", pos: i });
|
|
86
86
|
break;
|
|
87
87
|
default:
|
|
88
|
-
throw new
|
|
88
|
+
throw new O(`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 Y {
|
|
94
94
|
constructor(a) {
|
|
95
95
|
this.pos = 0, this.tokens = a;
|
|
96
96
|
}
|
|
@@ -104,7 +104,7 @@ class Q {
|
|
|
104
104
|
expect(a) {
|
|
105
105
|
const t = this.peek();
|
|
106
106
|
if (t.type !== a)
|
|
107
|
-
throw new
|
|
107
|
+
throw new O(
|
|
108
108
|
`Expected ${a} but got ${t.type} ('${t.value}')`,
|
|
109
109
|
t.pos
|
|
110
110
|
);
|
|
@@ -115,7 +115,7 @@ class Q {
|
|
|
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 O(
|
|
119
119
|
`Unexpected token '${t.value}' after expression`,
|
|
120
120
|
t.pos
|
|
121
121
|
);
|
|
@@ -168,14 +168,14 @@ class Q {
|
|
|
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(K, t))
|
|
172
|
+
throw new O(
|
|
173
|
+
`Unknown function '${t}'. Available: ${Object.keys(K).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(ee, t) ? { kind: "number", value: ee[t] } : { kind: "variable", name: t };
|
|
179
179
|
}
|
|
180
180
|
if (a.type === "LPAREN") {
|
|
181
181
|
this.advance();
|
|
@@ -190,24 +190,24 @@ class Q {
|
|
|
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 O(
|
|
194
194
|
`Unexpected token '${a.value}'`,
|
|
195
195
|
a.pos
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function p(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 O(`Unknown variable '${e.name}'`, 0);
|
|
206
206
|
case "unary":
|
|
207
|
-
const t =
|
|
207
|
+
const t = p(e.operand, a);
|
|
208
208
|
return e.op === "-" ? -t : t;
|
|
209
209
|
case "binary": {
|
|
210
|
-
const r =
|
|
210
|
+
const r = p(e.left, a), i = p(e.right, a);
|
|
211
211
|
switch (e.op) {
|
|
212
212
|
case "+":
|
|
213
213
|
return r + i;
|
|
@@ -223,95 +223,95 @@ function E(e, a) {
|
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
225
|
case "call": {
|
|
226
|
-
const r =
|
|
226
|
+
const r = K[e.name], i = e.args.map((n) => p(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) => p(r, a));
|
|
231
231
|
}
|
|
232
|
-
throw new
|
|
232
|
+
throw new O("Invalid AST node", 0);
|
|
233
233
|
}
|
|
234
|
-
class
|
|
234
|
+
class O extends Error {
|
|
235
235
|
constructor(a, t) {
|
|
236
236
|
super(a), this.name = "ExpressionError", this.position = t;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
const a =
|
|
241
|
-
return (r) =>
|
|
239
|
+
function dt(e) {
|
|
240
|
+
const a = J(e), t = new Y(a).parse();
|
|
241
|
+
return (r) => p(t, r);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
const a =
|
|
243
|
+
function wt(e) {
|
|
244
|
+
const a = J(e), t = new Y(a).parse();
|
|
245
245
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
246
|
-
throw new
|
|
246
|
+
throw new O(
|
|
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) => p(t, r);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function ne(e) {
|
|
253
253
|
try {
|
|
254
|
-
const a =
|
|
255
|
-
return new
|
|
254
|
+
const a = J(e);
|
|
255
|
+
return new Y(a).parse(), null;
|
|
256
256
|
} catch (a) {
|
|
257
|
-
return a instanceof
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const
|
|
261
|
-
linear:
|
|
262
|
-
easeInQuad:
|
|
263
|
-
easeOutQuad:
|
|
264
|
-
easeInOutQuad:
|
|
265
|
-
easeInCubic:
|
|
266
|
-
easeOutCubic:
|
|
267
|
-
easeInOutCubic:
|
|
268
|
-
easeInQuart:
|
|
269
|
-
easeOutQuart:
|
|
270
|
-
easeInOutQuart:
|
|
271
|
-
easeInSine:
|
|
272
|
-
easeOutSine:
|
|
273
|
-
easeInOutSine:
|
|
274
|
-
easeInExpo:
|
|
275
|
-
easeOutExpo:
|
|
276
|
-
easeInOutExpo:
|
|
277
|
-
easeInBack:
|
|
278
|
-
easeOutBack:
|
|
279
|
-
easeOutElastic:
|
|
280
|
-
easeOutBounce:
|
|
257
|
+
return a instanceof O ? `${a.message} (at position ${a.position})` : String(a);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const Q = {
|
|
261
|
+
linear: Me,
|
|
262
|
+
easeInQuad: Te,
|
|
263
|
+
easeOutQuad: Re,
|
|
264
|
+
easeInOutQuad: Fe,
|
|
265
|
+
easeInCubic: Pe,
|
|
266
|
+
easeOutCubic: Ee,
|
|
267
|
+
easeInOutCubic: pe,
|
|
268
|
+
easeInQuart: ze,
|
|
269
|
+
easeOutQuart: Ae,
|
|
270
|
+
easeInOutQuart: Ce,
|
|
271
|
+
easeInSine: Oe,
|
|
272
|
+
easeOutSine: $e,
|
|
273
|
+
easeInOutSine: Se,
|
|
274
|
+
easeInExpo: Ie,
|
|
275
|
+
easeOutExpo: ke,
|
|
276
|
+
easeInOutExpo: ve,
|
|
277
|
+
easeInBack: we,
|
|
278
|
+
easeOutBack: de,
|
|
279
|
+
easeOutElastic: xe,
|
|
280
|
+
easeOutBounce: be
|
|
281
281
|
};
|
|
282
|
-
function
|
|
282
|
+
function f(e) {
|
|
283
283
|
if (e !== void 0) {
|
|
284
284
|
if (typeof e == "string") {
|
|
285
|
-
const a =
|
|
285
|
+
const a = Q[e];
|
|
286
286
|
if (!a) {
|
|
287
|
-
const t = Object.keys(
|
|
287
|
+
const t = Object.keys(Q), 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 Ne({
|
|
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 We(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 G = Object.keys(Q);
|
|
304
|
+
function se(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 }) : (vt(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 te = ["scene", "player", "presentation"], L = ["card", "slide", "square"], H = [
|
|
315
315
|
"sequence",
|
|
316
316
|
"group",
|
|
317
317
|
"bezierCurve",
|
|
@@ -340,196 +340,196 @@ const Y = ["scene", "player", "presentation"], _ = ["card", "slide", "square"],
|
|
|
340
340
|
"parallel",
|
|
341
341
|
"player",
|
|
342
342
|
"scene"
|
|
343
|
-
],
|
|
344
|
-
function
|
|
343
|
+
], ae = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
344
|
+
function vt(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 (!te.includes(r)) {
|
|
347
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${te.join(", ")}. Got "${r}"`, severity: "error" });
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
r === "scene" || r === "player" ?
|
|
350
|
+
r === "scene" || r === "player" ? ce(e, a, r, t) : r === "presentation" && kt(e, a, t);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
|
|
352
|
+
function ce(e, a, t, r) {
|
|
353
|
+
Ht(e, "durationInFrames", a, r), b(e, "width", a, r), b(e, "height", a, r), b(e, "fps", a, r), A(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !L.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${L.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (D(e, "controls", a, r), D(e, "loop", a, r), D(e, "autoPlay", a, r)), z(e, a, r);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
if (b(e, "width", a, t), b(e, "height", a, t),
|
|
355
|
+
function kt(e, a, t) {
|
|
356
|
+
if (b(e, "width", a, t), b(e, "height", a, t), A(e, "background", a, t), b(e, "transitionDuration", a, t), D(e, "showHud", a, t), D(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !L.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${L.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (ae.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: ${ae.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
|
+
It(r, `${a}.slides[${i}]`, t);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function It(e, a, t) {
|
|
369
369
|
if (!e || typeof e != "object") {
|
|
370
370
|
t.push({ path: a, message: "Slide must be an object", severity: "error" });
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
A(e, "title", a, t), A(e, "notes", a, t), A(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((r, i) => {
|
|
374
|
+
le(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 z(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
|
+
le(r, `${a}.children[${i}]`, t);
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function le(e, a, t) {
|
|
387
387
|
if (!e || typeof e != "object") {
|
|
388
388
|
t.push({ path: a, message: "Element must be an object", severity: "error" });
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
const r = e.type;
|
|
392
|
-
if (!r || !
|
|
393
|
-
const i = r ?
|
|
392
|
+
if (!r || !H.includes(r)) {
|
|
393
|
+
const i = r ? ue(r, H) : "";
|
|
394
394
|
t.push({
|
|
395
395
|
path: `${a}.type`,
|
|
396
|
-
message: `Unknown element type "${r}".${i} Valid types: ${
|
|
396
|
+
message: `Unknown element type "${r}".${i} Valid types: ${H.join(", ")}`,
|
|
397
397
|
severity: "error"
|
|
398
398
|
});
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
401
|
switch (r) {
|
|
402
402
|
case "bezierCurve":
|
|
403
|
-
|
|
403
|
+
St(e, a, t);
|
|
404
404
|
break;
|
|
405
405
|
case "circle":
|
|
406
|
-
|
|
406
|
+
$t(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
|
+
Ct(e, a, t);
|
|
413
413
|
break;
|
|
414
414
|
case "rect":
|
|
415
|
-
|
|
415
|
+
At(e, a, t);
|
|
416
416
|
break;
|
|
417
417
|
case "polygon":
|
|
418
|
-
|
|
418
|
+
zt(e, a, t);
|
|
419
419
|
break;
|
|
420
420
|
case "text":
|
|
421
|
-
|
|
421
|
+
pt(e, a, t);
|
|
422
422
|
break;
|
|
423
423
|
case "image":
|
|
424
|
-
|
|
424
|
+
qt(e, a, t);
|
|
425
425
|
break;
|
|
426
426
|
case "axes":
|
|
427
|
-
|
|
427
|
+
Et(e, a, t);
|
|
428
428
|
break;
|
|
429
429
|
case "functionPlot":
|
|
430
|
-
|
|
430
|
+
Pt(e, a, t);
|
|
431
431
|
break;
|
|
432
432
|
case "vector":
|
|
433
|
-
|
|
433
|
+
Ft(e, a, t);
|
|
434
434
|
break;
|
|
435
435
|
case "vectorField":
|
|
436
|
-
|
|
436
|
+
Rt(e, a, t);
|
|
437
437
|
break;
|
|
438
438
|
case "matrix":
|
|
439
|
-
|
|
439
|
+
Tt(e, a, t);
|
|
440
440
|
break;
|
|
441
441
|
case "graph":
|
|
442
|
-
|
|
442
|
+
Mt(e, a, t);
|
|
443
443
|
break;
|
|
444
444
|
case "latex":
|
|
445
|
-
|
|
445
|
+
Nt(e, a, t);
|
|
446
446
|
break;
|
|
447
447
|
case "barChart":
|
|
448
|
-
|
|
448
|
+
Gt(e, a, t);
|
|
449
449
|
break;
|
|
450
450
|
case "sequence":
|
|
451
|
-
|
|
451
|
+
Wt(e, a, t);
|
|
452
452
|
break;
|
|
453
453
|
case "group":
|
|
454
|
-
|
|
454
|
+
Ut(e, a, t);
|
|
455
455
|
break;
|
|
456
456
|
case "parallel":
|
|
457
|
-
|
|
457
|
+
z(e, a, t);
|
|
458
458
|
break;
|
|
459
459
|
case "fadeIn":
|
|
460
460
|
case "fadeOut":
|
|
461
461
|
case "draw":
|
|
462
462
|
case "write":
|
|
463
|
-
|
|
463
|
+
Dt(e, a, t);
|
|
464
464
|
break;
|
|
465
465
|
case "transform":
|
|
466
|
-
|
|
466
|
+
_t(e, a, t);
|
|
467
467
|
break;
|
|
468
468
|
case "morph":
|
|
469
|
-
|
|
469
|
+
Vt(e, a, t);
|
|
470
470
|
break;
|
|
471
471
|
case "stagger":
|
|
472
|
-
|
|
472
|
+
Lt(e, a, t);
|
|
473
473
|
break;
|
|
474
474
|
case "scene":
|
|
475
475
|
case "player":
|
|
476
|
-
|
|
476
|
+
ce(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 && R(e, "cx2", a, t), e.cy2 !== void 0 && R(e, "cy2", a, t),
|
|
480
|
+
function St(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 && R(e, "cx2", a, t), e.cy2 !== void 0 && R(e, "cy2", a, t), v(e, a, t);
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
h(e, "cx", a, t), h(e, "cy", a, t),
|
|
483
|
+
function $t(e, a, t) {
|
|
484
|
+
h(e, "cx", a, t), h(e, "cy", a, t), E(e, "r", a, t), v(e, a, t);
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t),
|
|
486
|
+
function Ot(e, a, t) {
|
|
487
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t),
|
|
489
|
+
function Ct(e, a, t) {
|
|
490
|
+
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), v(e, a, t);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
h(e, "x", a, t), h(e, "y", a, t),
|
|
492
|
+
function At(e, a, t) {
|
|
493
|
+
h(e, "x", a, t), h(e, "y", a, t), E(e, "width", a, t), E(e, "height", a, t), v(e, a, t);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function zt(e, a, t) {
|
|
496
496
|
Array.isArray(e.points) ? e.points.length < 3 ? t.push({ path: `${a}.points`, message: "Polygon requires at least 3 points", severity: "error" }) : e.points.forEach((r, i) => {
|
|
497
497
|
(!Array.isArray(r) || r.length !== 2 || typeof r[0] != "number" || typeof r[1] != "number") && t.push({ path: `${a}.points[${i}]`, message: "Each point must be [number, number]", severity: "error" });
|
|
498
|
-
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }),
|
|
498
|
+
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), v(e, a, t);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
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" }),
|
|
500
|
+
function pt(e, a, t) {
|
|
501
|
+
h(e, "x", a, t), h(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), v(e, a, t);
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
|
|
503
|
+
function Et(e, a, t) {
|
|
504
|
+
I(e, "domain", a, t), I(e, "range", a, t), I(e, "origin", a, t), j(e, a, t);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Pt(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 = ne(e.fn);
|
|
511
511
|
r && t.push({ path: `${a}.fn`, message: `Invalid expression: ${r}`, severity: "error" });
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
I(e, "domain", a, t), j(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 Ft(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" }), I(e, "from", a, t), j(e, a, t);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Rt(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 = ne(e.fn);
|
|
523
523
|
r && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${r}`, severity: "error" });
|
|
524
524
|
}
|
|
525
|
-
|
|
525
|
+
I(e, "domain", a, t), I(e, "range", a, t), j(e, a, t);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function Tt(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" }), v(e, a, t);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Mt(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,18 +540,18 @@ function Ft(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
|
+
v(e, a, t);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t),
|
|
545
|
+
function Nt(e, a, t) {
|
|
546
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), h(e, "x", a, t), h(e, "y", a, t), v(e, a, t);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
h(e, "from", a, t),
|
|
548
|
+
function Wt(e, a, t) {
|
|
549
|
+
h(e, "from", a, t), Kt(e, "durationInFrames", a, t), z(e, a, t);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
b(e, "duration", a, t), T(e, a, t),
|
|
551
|
+
function Dt(e, a, t) {
|
|
552
|
+
b(e, "duration", a, t), T(e, a, t), z(e, a, t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function _t(e, a, t) {
|
|
555
555
|
if (b(e, "duration", a, t), T(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" });
|
|
@@ -568,51 +568,51 @@ function Mt(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
|
+
z(e, a, t);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
b(e, "duration", a, t), T(e, a, t),
|
|
573
|
+
function Vt(e, a, t) {
|
|
574
|
+
b(e, "duration", a, t), T(e, a, t), A(e, "fromColor", a, t), A(e, "toColor", a, t), z(e, a, t);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
b(e, "staggerDelay", a, t), T(e, a, t),
|
|
576
|
+
function Lt(e, a, t) {
|
|
577
|
+
b(e, "staggerDelay", a, t), T(e, a, t), z(e, a, t);
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t),
|
|
579
|
+
function v(e, a, t) {
|
|
580
|
+
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t), jt(e, a, t);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t),
|
|
582
|
+
function j(e, a, t) {
|
|
583
|
+
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t), Bt(e, a, t);
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
function
|
|
587
|
-
if (R(e, "rotation", a, t),
|
|
585
|
+
const re = ["none", "circle", "ellipse"];
|
|
586
|
+
function jt(e, a, t) {
|
|
587
|
+
if (R(e, "rotation", a, t), I(e, "rotationOrigin", a, t), I(e, "translate", a, t), R(e, "zIndex", a, t), e.scale !== void 0) {
|
|
588
588
|
const r = e.scale;
|
|
589
589
|
typeof r == "number" || Array.isArray(r) && r.length === 2 && typeof r[0] == "number" && typeof r[1] == "number" || t.push({ path: `${a}.scale`, message: '"scale" must be a number or [number, number]', severity: "error" });
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
R(e, "rotation", a, t),
|
|
592
|
+
function Bt(e, a, t) {
|
|
593
|
+
R(e, "rotation", a, t), I(e, "rotationOrigin", a, t), I(e, "translate", a, t), R(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" }), h(e, "x", a, t), h(e, "y", a, t),
|
|
595
|
+
function qt(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), E(e, "width", a, t), E(e, "height", a, t), A(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (re.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: ${re.join(", ")}`,
|
|
599
599
|
severity: "error"
|
|
600
|
-
})),
|
|
600
|
+
})), v(e, a, t);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
602
|
+
function Ut(e, a, t) {
|
|
603
|
+
z(e, a, t), v(e, a, t);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
h(e, "x", a, t), h(e, "y", a, t),
|
|
605
|
+
function Gt(e, a, t) {
|
|
606
|
+
h(e, "x", a, t), h(e, "y", a, t), E(e, "width", a, t), E(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
608
|
function T(e, a, t) {
|
|
609
609
|
if (e.easing !== void 0) {
|
|
610
610
|
if (typeof e.easing == "string") {
|
|
611
|
-
if (!
|
|
612
|
-
const r =
|
|
611
|
+
if (!G.includes(e.easing)) {
|
|
612
|
+
const r = ue(e.easing, G);
|
|
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: ${G.join(", ")}`,
|
|
616
616
|
severity: "error"
|
|
617
617
|
});
|
|
618
618
|
}
|
|
@@ -635,40 +635,40 @@ function T(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 E(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 Ht(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
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 Kt(e, a, t, r) {
|
|
649
649
|
const i = e[a];
|
|
650
650
|
i !== void 0 && (typeof i != "number" || i <= 0 || !Number.isInteger(i)) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function A(e, a, t, r) {
|
|
653
653
|
e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
|
|
654
654
|
}
|
|
655
655
|
function R(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 D(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 I(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 ue(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 he = {
|
|
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,31 +683,31 @@ const ce = {
|
|
|
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
|
+
}, ba = Object.keys(he);
|
|
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 = he[a];
|
|
691
691
|
return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
|
|
692
692
|
}
|
|
693
|
-
const
|
|
693
|
+
const Qt = {
|
|
694
694
|
card: [640, 360],
|
|
695
695
|
slide: [1280, 720],
|
|
696
696
|
square: [600, 600]
|
|
697
697
|
};
|
|
698
|
-
function
|
|
698
|
+
function B(e, a, t) {
|
|
699
699
|
if (!e) return { width: a, height: t };
|
|
700
|
-
const [r, i] =
|
|
700
|
+
const [r, i] = Qt[e];
|
|
701
701
|
return { width: a ?? r, height: t ?? i };
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function fe(e, a) {
|
|
704
704
|
switch (e.type) {
|
|
705
705
|
case "scene":
|
|
706
|
-
return
|
|
706
|
+
return X(e, a);
|
|
707
707
|
case "player":
|
|
708
708
|
if ((a == null ? void 0 : a.frame) !== void 0) {
|
|
709
|
-
const { width: t, height: r } =
|
|
710
|
-
return
|
|
709
|
+
const { width: t, height: r } = B(e.preset, e.width, e.height);
|
|
710
|
+
return X(
|
|
711
711
|
{
|
|
712
712
|
width: t,
|
|
713
713
|
height: r,
|
|
@@ -719,15 +719,15 @@ function le(e, a) {
|
|
|
719
719
|
a
|
|
720
720
|
);
|
|
721
721
|
}
|
|
722
|
-
return
|
|
722
|
+
return ge(e, a);
|
|
723
723
|
case "presentation":
|
|
724
|
-
return
|
|
724
|
+
return Xt(e, a);
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
|
-
function
|
|
728
|
-
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } =
|
|
727
|
+
function X(e, a) {
|
|
728
|
+
const t = (a == null ? void 0 : a.frame) !== void 0, { width: r, height: i } = B(e.preset, e.width, e.height);
|
|
729
729
|
return /* @__PURE__ */ l(
|
|
730
|
-
|
|
730
|
+
_e,
|
|
731
731
|
{
|
|
732
732
|
width: r,
|
|
733
733
|
height: i,
|
|
@@ -736,14 +736,14 @@ function H(e, a) {
|
|
|
736
736
|
background: u(e.background),
|
|
737
737
|
colorScheme: a == null ? void 0 : a.colorScheme,
|
|
738
738
|
...t ? { frame: a.frame, autoPlay: !1 } : {},
|
|
739
|
-
children: e.children.map((n, s) =>
|
|
739
|
+
children: e.children.map((n, s) => w(n, s))
|
|
740
740
|
}
|
|
741
741
|
);
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
const { width: t, height: r } =
|
|
743
|
+
function ge(e, a) {
|
|
744
|
+
const { width: t, height: r } = B(e.preset, e.width, e.height);
|
|
745
745
|
return /* @__PURE__ */ l(
|
|
746
|
-
|
|
746
|
+
Ve,
|
|
747
747
|
{
|
|
748
748
|
ref: a == null ? void 0 : a.playerRef,
|
|
749
749
|
width: t,
|
|
@@ -751,18 +751,19 @@ function ue(e, a) {
|
|
|
751
751
|
fps: e.fps,
|
|
752
752
|
durationInFrames: e.durationInFrames,
|
|
753
753
|
background: u(e.background),
|
|
754
|
-
controls: e.controls,
|
|
755
|
-
loop: e.loop,
|
|
756
|
-
autoPlay: e.autoPlay,
|
|
754
|
+
controls: (a == null ? void 0 : a.controls) ?? e.controls,
|
|
755
|
+
loop: (a == null ? void 0 : a.loop) ?? e.loop,
|
|
756
|
+
autoPlay: (a == null ? void 0 : a.autoPlay) ?? e.autoPlay,
|
|
757
|
+
onPlayStateChange: a == null ? void 0 : a.onPlayStateChange,
|
|
757
758
|
colorScheme: a == null ? void 0 : a.colorScheme,
|
|
758
|
-
children: e.children.map((i, n) =>
|
|
759
|
+
children: e.children.map((i, n) => w(i, n))
|
|
759
760
|
}
|
|
760
761
|
);
|
|
761
762
|
}
|
|
762
|
-
function
|
|
763
|
-
const { width: t, height: r } =
|
|
763
|
+
function Xt(e, a) {
|
|
764
|
+
const { width: t, height: r } = B(e.preset, e.width, e.height);
|
|
764
765
|
return /* @__PURE__ */ l(
|
|
765
|
-
|
|
766
|
+
De,
|
|
766
767
|
{
|
|
767
768
|
width: t,
|
|
768
769
|
height: r,
|
|
@@ -772,38 +773,38 @@ function Gt(e, a) {
|
|
|
772
773
|
showHUD: e.showHud,
|
|
773
774
|
showNotes: e.showNotes,
|
|
774
775
|
colorScheme: a == null ? void 0 : a.colorScheme,
|
|
775
|
-
children: e.slides.map((i, n) =>
|
|
776
|
+
children: e.slides.map((i, n) => Jt(i, n))
|
|
776
777
|
}
|
|
777
778
|
);
|
|
778
779
|
}
|
|
779
|
-
function
|
|
780
|
+
function Jt(e, a) {
|
|
780
781
|
var t;
|
|
781
|
-
return /* @__PURE__ */ l(
|
|
782
|
+
return /* @__PURE__ */ l(Le, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => w(r, i)) }, a);
|
|
782
783
|
}
|
|
783
|
-
function
|
|
784
|
+
function w(e, a) {
|
|
784
785
|
var t, r, i, n;
|
|
785
786
|
switch (e.type) {
|
|
786
787
|
case "sequence":
|
|
787
|
-
return /* @__PURE__ */ l(
|
|
788
|
+
return /* @__PURE__ */ l(gt, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, c) => w(s, c)) }, a);
|
|
788
789
|
case "group":
|
|
789
790
|
return /* @__PURE__ */ l(
|
|
790
|
-
|
|
791
|
+
ft,
|
|
791
792
|
{
|
|
792
793
|
fadeIn: e.fadeIn,
|
|
793
794
|
fadeOut: e.fadeOut,
|
|
794
|
-
easing:
|
|
795
|
+
easing: f(e.easing),
|
|
795
796
|
rotation: e.rotation,
|
|
796
797
|
rotationOrigin: e.rotationOrigin,
|
|
797
798
|
scale: e.scale,
|
|
798
799
|
translate: e.translate,
|
|
799
800
|
zIndex: e.zIndex,
|
|
800
|
-
children: e.children.map((s, c) =>
|
|
801
|
+
children: e.children.map((s, c) => w(s, c))
|
|
801
802
|
},
|
|
802
803
|
a
|
|
803
804
|
);
|
|
804
805
|
case "bezierCurve":
|
|
805
806
|
return /* @__PURE__ */ l(
|
|
806
|
-
|
|
807
|
+
ht,
|
|
807
808
|
{
|
|
808
809
|
x1: e.x1,
|
|
809
810
|
y1: e.y1,
|
|
@@ -821,7 +822,7 @@ function v(e, a) {
|
|
|
821
822
|
fadeIn: e.fadeIn,
|
|
822
823
|
fadeOut: e.fadeOut,
|
|
823
824
|
draw: e.draw,
|
|
824
|
-
easing:
|
|
825
|
+
easing: f(e.easing),
|
|
825
826
|
rotation: e.rotation,
|
|
826
827
|
rotationOrigin: e.rotationOrigin,
|
|
827
828
|
scale: e.scale,
|
|
@@ -832,7 +833,7 @@ function v(e, a) {
|
|
|
832
833
|
);
|
|
833
834
|
case "circle":
|
|
834
835
|
return /* @__PURE__ */ l(
|
|
835
|
-
|
|
836
|
+
ut,
|
|
836
837
|
{
|
|
837
838
|
cx: e.cx,
|
|
838
839
|
cy: e.cy,
|
|
@@ -844,7 +845,7 @@ function v(e, a) {
|
|
|
844
845
|
fadeIn: e.fadeIn,
|
|
845
846
|
fadeOut: e.fadeOut,
|
|
846
847
|
draw: e.draw,
|
|
847
|
-
easing:
|
|
848
|
+
easing: f(e.easing),
|
|
848
849
|
rotation: e.rotation,
|
|
849
850
|
rotationOrigin: e.rotationOrigin,
|
|
850
851
|
scale: e.scale,
|
|
@@ -855,7 +856,7 @@ function v(e, a) {
|
|
|
855
856
|
);
|
|
856
857
|
case "line":
|
|
857
858
|
return /* @__PURE__ */ l(
|
|
858
|
-
|
|
859
|
+
lt,
|
|
859
860
|
{
|
|
860
861
|
x1: e.x1,
|
|
861
862
|
y1: e.y1,
|
|
@@ -868,7 +869,7 @@ function v(e, a) {
|
|
|
868
869
|
fadeIn: e.fadeIn,
|
|
869
870
|
fadeOut: e.fadeOut,
|
|
870
871
|
draw: e.draw,
|
|
871
|
-
easing:
|
|
872
|
+
easing: f(e.easing),
|
|
872
873
|
rotation: e.rotation,
|
|
873
874
|
rotationOrigin: e.rotationOrigin,
|
|
874
875
|
scale: e.scale,
|
|
@@ -879,7 +880,7 @@ function v(e, a) {
|
|
|
879
880
|
);
|
|
880
881
|
case "arrow":
|
|
881
882
|
return /* @__PURE__ */ l(
|
|
882
|
-
|
|
883
|
+
ct,
|
|
883
884
|
{
|
|
884
885
|
x1: e.x1,
|
|
885
886
|
y1: e.y1,
|
|
@@ -893,7 +894,7 @@ function v(e, a) {
|
|
|
893
894
|
fadeIn: e.fadeIn,
|
|
894
895
|
fadeOut: e.fadeOut,
|
|
895
896
|
draw: e.draw,
|
|
896
|
-
easing:
|
|
897
|
+
easing: f(e.easing),
|
|
897
898
|
rotation: e.rotation,
|
|
898
899
|
rotationOrigin: e.rotationOrigin,
|
|
899
900
|
scale: e.scale,
|
|
@@ -904,7 +905,7 @@ function v(e, a) {
|
|
|
904
905
|
);
|
|
905
906
|
case "rect":
|
|
906
907
|
return /* @__PURE__ */ l(
|
|
907
|
-
|
|
908
|
+
st,
|
|
908
909
|
{
|
|
909
910
|
x: e.x,
|
|
910
911
|
y: e.y,
|
|
@@ -920,7 +921,7 @@ function v(e, a) {
|
|
|
920
921
|
fadeIn: e.fadeIn,
|
|
921
922
|
fadeOut: e.fadeOut,
|
|
922
923
|
draw: e.draw,
|
|
923
|
-
easing:
|
|
924
|
+
easing: f(e.easing),
|
|
924
925
|
rotation: e.rotation,
|
|
925
926
|
rotationOrigin: e.rotationOrigin,
|
|
926
927
|
scale: e.scale,
|
|
@@ -931,7 +932,7 @@ function v(e, a) {
|
|
|
931
932
|
);
|
|
932
933
|
case "polygon":
|
|
933
934
|
return /* @__PURE__ */ l(
|
|
934
|
-
|
|
935
|
+
nt,
|
|
935
936
|
{
|
|
936
937
|
points: e.points,
|
|
937
938
|
fill: u(e.fill),
|
|
@@ -942,7 +943,7 @@ function v(e, a) {
|
|
|
942
943
|
fadeIn: e.fadeIn,
|
|
943
944
|
fadeOut: e.fadeOut,
|
|
944
945
|
draw: e.draw,
|
|
945
|
-
easing:
|
|
946
|
+
easing: f(e.easing),
|
|
946
947
|
rotation: e.rotation,
|
|
947
948
|
rotationOrigin: e.rotationOrigin,
|
|
948
949
|
scale: e.scale,
|
|
@@ -953,7 +954,7 @@ function v(e, a) {
|
|
|
953
954
|
);
|
|
954
955
|
case "text":
|
|
955
956
|
return /* @__PURE__ */ l(
|
|
956
|
-
|
|
957
|
+
U,
|
|
957
958
|
{
|
|
958
959
|
x: e.x,
|
|
959
960
|
y: e.y,
|
|
@@ -966,7 +967,7 @@ function v(e, a) {
|
|
|
966
967
|
opacity: e.opacity,
|
|
967
968
|
fadeIn: e.fadeIn,
|
|
968
969
|
fadeOut: e.fadeOut,
|
|
969
|
-
easing:
|
|
970
|
+
easing: f(e.easing),
|
|
970
971
|
rotation: e.rotation,
|
|
971
972
|
rotationOrigin: e.rotationOrigin,
|
|
972
973
|
scale: e.scale,
|
|
@@ -978,7 +979,7 @@ function v(e, a) {
|
|
|
978
979
|
);
|
|
979
980
|
case "image":
|
|
980
981
|
return /* @__PURE__ */ l(
|
|
981
|
-
|
|
982
|
+
it,
|
|
982
983
|
{
|
|
983
984
|
src: e.src,
|
|
984
985
|
x: e.x,
|
|
@@ -991,7 +992,7 @@ function v(e, a) {
|
|
|
991
992
|
opacity: e.opacity,
|
|
992
993
|
fadeIn: e.fadeIn,
|
|
993
994
|
fadeOut: e.fadeOut,
|
|
994
|
-
easing:
|
|
995
|
+
easing: f(e.easing),
|
|
995
996
|
rotation: e.rotation,
|
|
996
997
|
rotationOrigin: e.rotationOrigin,
|
|
997
998
|
scale: e.scale,
|
|
@@ -1002,7 +1003,7 @@ function v(e, a) {
|
|
|
1002
1003
|
);
|
|
1003
1004
|
case "axes":
|
|
1004
1005
|
return /* @__PURE__ */ l(
|
|
1005
|
-
|
|
1006
|
+
rt,
|
|
1006
1007
|
{
|
|
1007
1008
|
domain: e.domain,
|
|
1008
1009
|
range: e.range,
|
|
@@ -1019,7 +1020,7 @@ function v(e, a) {
|
|
|
1019
1020
|
fadeIn: e.fadeIn,
|
|
1020
1021
|
fadeOut: e.fadeOut,
|
|
1021
1022
|
draw: e.draw,
|
|
1022
|
-
easing:
|
|
1023
|
+
easing: f(e.easing),
|
|
1023
1024
|
rotation: e.rotation,
|
|
1024
1025
|
rotationOrigin: e.rotationOrigin,
|
|
1025
1026
|
translate: e.translate,
|
|
@@ -1030,10 +1031,10 @@ function v(e, a) {
|
|
|
1030
1031
|
case "functionPlot": {
|
|
1031
1032
|
let s;
|
|
1032
1033
|
try {
|
|
1033
|
-
s =
|
|
1034
|
+
s = dt(e.fn);
|
|
1034
1035
|
} catch {
|
|
1035
1036
|
return /* @__PURE__ */ l(
|
|
1036
|
-
|
|
1037
|
+
U,
|
|
1037
1038
|
{
|
|
1038
1039
|
x: ((t = e.origin) == null ? void 0 : t[0]) ?? 400,
|
|
1039
1040
|
y: (((r = e.origin) == null ? void 0 : r[1]) ?? 300) - 20,
|
|
@@ -1046,7 +1047,7 @@ function v(e, a) {
|
|
|
1046
1047
|
);
|
|
1047
1048
|
}
|
|
1048
1049
|
return /* @__PURE__ */ l(
|
|
1049
|
-
|
|
1050
|
+
at,
|
|
1050
1051
|
{
|
|
1051
1052
|
fn: (c) => s({ x: c }),
|
|
1052
1053
|
domain: e.domain,
|
|
@@ -1057,7 +1058,7 @@ function v(e, a) {
|
|
|
1057
1058
|
strokeWidth: e.strokeWidth,
|
|
1058
1059
|
samples: e.samples,
|
|
1059
1060
|
draw: e.draw,
|
|
1060
|
-
easing:
|
|
1061
|
+
easing: f(e.easing),
|
|
1061
1062
|
opacity: e.opacity,
|
|
1062
1063
|
rotation: e.rotation,
|
|
1063
1064
|
rotationOrigin: e.rotationOrigin,
|
|
@@ -1069,7 +1070,7 @@ function v(e, a) {
|
|
|
1069
1070
|
}
|
|
1070
1071
|
case "vector":
|
|
1071
1072
|
return /* @__PURE__ */ l(
|
|
1072
|
-
|
|
1073
|
+
tt,
|
|
1073
1074
|
{
|
|
1074
1075
|
from: e.from,
|
|
1075
1076
|
to: e.to,
|
|
@@ -1085,7 +1086,7 @@ function v(e, a) {
|
|
|
1085
1086
|
fadeIn: e.fadeIn,
|
|
1086
1087
|
fadeOut: e.fadeOut,
|
|
1087
1088
|
draw: e.draw,
|
|
1088
|
-
easing:
|
|
1089
|
+
easing: f(e.easing),
|
|
1089
1090
|
rotation: e.rotation,
|
|
1090
1091
|
rotationOrigin: e.rotationOrigin,
|
|
1091
1092
|
translate: e.translate,
|
|
@@ -1096,10 +1097,10 @@ function v(e, a) {
|
|
|
1096
1097
|
case "vectorField": {
|
|
1097
1098
|
let s;
|
|
1098
1099
|
try {
|
|
1099
|
-
s =
|
|
1100
|
+
s = wt(e.fn);
|
|
1100
1101
|
} catch {
|
|
1101
1102
|
return /* @__PURE__ */ l(
|
|
1102
|
-
|
|
1103
|
+
U,
|
|
1103
1104
|
{
|
|
1104
1105
|
x: ((i = e.origin) == null ? void 0 : i[0]) ?? 400,
|
|
1105
1106
|
y: (((n = e.origin) == null ? void 0 : n[1]) ?? 300) - 20,
|
|
@@ -1112,7 +1113,7 @@ function v(e, a) {
|
|
|
1112
1113
|
);
|
|
1113
1114
|
}
|
|
1114
1115
|
return /* @__PURE__ */ l(
|
|
1115
|
-
|
|
1116
|
+
et,
|
|
1116
1117
|
{
|
|
1117
1118
|
fn: (c, x) => s({ x: c, y: x }),
|
|
1118
1119
|
domain: e.domain,
|
|
@@ -1128,7 +1129,7 @@ function v(e, a) {
|
|
|
1128
1129
|
maxLength: e.maxLength,
|
|
1129
1130
|
fadeIn: e.fadeIn,
|
|
1130
1131
|
fadeOut: e.fadeOut,
|
|
1131
|
-
easing:
|
|
1132
|
+
easing: f(e.easing),
|
|
1132
1133
|
rotation: e.rotation,
|
|
1133
1134
|
rotationOrigin: e.rotationOrigin,
|
|
1134
1135
|
translate: e.translate,
|
|
@@ -1139,7 +1140,7 @@ function v(e, a) {
|
|
|
1139
1140
|
}
|
|
1140
1141
|
case "matrix":
|
|
1141
1142
|
return /* @__PURE__ */ l(
|
|
1142
|
-
|
|
1143
|
+
Ze,
|
|
1143
1144
|
{
|
|
1144
1145
|
values: e.values,
|
|
1145
1146
|
x: e.x,
|
|
@@ -1150,7 +1151,7 @@ function v(e, a) {
|
|
|
1150
1151
|
fontSize: e.fontSize,
|
|
1151
1152
|
fadeIn: e.fadeIn,
|
|
1152
1153
|
fadeOut: e.fadeOut,
|
|
1153
|
-
easing:
|
|
1154
|
+
easing: f(e.easing),
|
|
1154
1155
|
rotation: e.rotation,
|
|
1155
1156
|
rotationOrigin: e.rotationOrigin,
|
|
1156
1157
|
scale: e.scale,
|
|
@@ -1161,7 +1162,7 @@ function v(e, a) {
|
|
|
1161
1162
|
);
|
|
1162
1163
|
case "graph":
|
|
1163
1164
|
return /* @__PURE__ */ l(
|
|
1164
|
-
|
|
1165
|
+
Ye,
|
|
1165
1166
|
{
|
|
1166
1167
|
nodes: e.nodes,
|
|
1167
1168
|
edges: e.edges,
|
|
@@ -1173,7 +1174,7 @@ function v(e, a) {
|
|
|
1173
1174
|
labelFontSize: e.labelFontSize,
|
|
1174
1175
|
fadeIn: e.fadeIn,
|
|
1175
1176
|
fadeOut: e.fadeOut,
|
|
1176
|
-
easing:
|
|
1177
|
+
easing: f(e.easing),
|
|
1177
1178
|
rotation: e.rotation,
|
|
1178
1179
|
rotationOrigin: e.rotationOrigin,
|
|
1179
1180
|
scale: e.scale,
|
|
@@ -1184,7 +1185,7 @@ function v(e, a) {
|
|
|
1184
1185
|
);
|
|
1185
1186
|
case "latex":
|
|
1186
1187
|
return /* @__PURE__ */ l(
|
|
1187
|
-
|
|
1188
|
+
Je,
|
|
1188
1189
|
{
|
|
1189
1190
|
expression: e.expression,
|
|
1190
1191
|
x: e.x,
|
|
@@ -1194,7 +1195,7 @@ function v(e, a) {
|
|
|
1194
1195
|
align: e.align,
|
|
1195
1196
|
fadeIn: e.fadeIn,
|
|
1196
1197
|
fadeOut: e.fadeOut,
|
|
1197
|
-
easing:
|
|
1198
|
+
easing: f(e.easing),
|
|
1198
1199
|
rotation: e.rotation,
|
|
1199
1200
|
rotationOrigin: e.rotationOrigin,
|
|
1200
1201
|
scale: e.scale,
|
|
@@ -1205,7 +1206,7 @@ function v(e, a) {
|
|
|
1205
1206
|
);
|
|
1206
1207
|
case "barChart":
|
|
1207
1208
|
return /* @__PURE__ */ l(
|
|
1208
|
-
|
|
1209
|
+
Xe,
|
|
1209
1210
|
{
|
|
1210
1211
|
bars: e.bars,
|
|
1211
1212
|
x: e.x,
|
|
@@ -1221,7 +1222,7 @@ function v(e, a) {
|
|
|
1221
1222
|
valueFormat: e.valueFormat,
|
|
1222
1223
|
fadeIn: e.fadeIn,
|
|
1223
1224
|
fadeOut: e.fadeOut,
|
|
1224
|
-
easing:
|
|
1225
|
+
easing: f(e.easing),
|
|
1225
1226
|
rotation: e.rotation,
|
|
1226
1227
|
rotationOrigin: e.rotationOrigin,
|
|
1227
1228
|
scale: e.scale,
|
|
@@ -1231,56 +1232,56 @@ function v(e, a) {
|
|
|
1231
1232
|
a
|
|
1232
1233
|
);
|
|
1233
1234
|
case "fadeIn":
|
|
1234
|
-
return /* @__PURE__ */ l(
|
|
1235
|
+
return /* @__PURE__ */ l(Qe, { duration: e.duration, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
|
|
1235
1236
|
case "fadeOut":
|
|
1236
|
-
return /* @__PURE__ */ l(
|
|
1237
|
+
return /* @__PURE__ */ l(Ke, { duration: e.duration, totalFrames: e.totalFrames, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
|
|
1237
1238
|
case "draw":
|
|
1238
|
-
return /* @__PURE__ */ l(
|
|
1239
|
+
return /* @__PURE__ */ l(He, { duration: e.duration, pathLength: e.pathLength, easing: f(e.easing), children: w(e.children[0], 0) }, a);
|
|
1239
1240
|
case "write":
|
|
1240
|
-
return /* @__PURE__ */ l(
|
|
1241
|
+
return /* @__PURE__ */ l(Ge, { duration: e.duration, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
|
|
1241
1242
|
case "transform":
|
|
1242
1243
|
return /* @__PURE__ */ l(
|
|
1243
|
-
|
|
1244
|
+
Ue,
|
|
1244
1245
|
{
|
|
1245
1246
|
duration: e.duration,
|
|
1246
|
-
easing:
|
|
1247
|
+
easing: f(e.easing),
|
|
1247
1248
|
translate: e.translate,
|
|
1248
1249
|
scale: e.scale,
|
|
1249
1250
|
rotate: e.rotate,
|
|
1250
1251
|
opacity: e.opacity,
|
|
1251
|
-
children: e.children.map((s, c) =>
|
|
1252
|
+
children: e.children.map((s, c) => w(s, c))
|
|
1252
1253
|
},
|
|
1253
1254
|
a
|
|
1254
1255
|
);
|
|
1255
1256
|
case "morph":
|
|
1256
1257
|
return /* @__PURE__ */ l(
|
|
1257
|
-
|
|
1258
|
+
qe,
|
|
1258
1259
|
{
|
|
1259
1260
|
duration: e.duration,
|
|
1260
|
-
easing:
|
|
1261
|
+
easing: f(e.easing),
|
|
1261
1262
|
fromColor: u(e.fromColor),
|
|
1262
1263
|
toColor: u(e.toColor),
|
|
1263
1264
|
fromOpacity: e.fromOpacity,
|
|
1264
1265
|
toOpacity: e.toOpacity,
|
|
1265
1266
|
fromScale: e.fromScale,
|
|
1266
1267
|
toScale: e.toScale,
|
|
1267
|
-
children: e.children.map((s, c) =>
|
|
1268
|
+
children: e.children.map((s, c) => w(s, c))
|
|
1268
1269
|
},
|
|
1269
1270
|
a
|
|
1270
1271
|
);
|
|
1271
1272
|
case "stagger":
|
|
1272
|
-
return /* @__PURE__ */ l(
|
|
1273
|
+
return /* @__PURE__ */ l(Be, { staggerDelay: e.staggerDelay, easing: f(e.easing), children: e.children.map((s, c) => w(s, c)) }, a);
|
|
1273
1274
|
case "parallel":
|
|
1274
|
-
return /* @__PURE__ */ l(
|
|
1275
|
+
return /* @__PURE__ */ l(je, { children: e.children.map((s, c) => w(s, c)) }, a);
|
|
1275
1276
|
case "scene":
|
|
1276
|
-
return /* @__PURE__ */ l(
|
|
1277
|
+
return /* @__PURE__ */ l(Z.Fragment, { children: X(e) }, a);
|
|
1277
1278
|
case "player":
|
|
1278
|
-
return /* @__PURE__ */ l(
|
|
1279
|
+
return /* @__PURE__ */ l(Z.Fragment, { children: ge(e) }, a);
|
|
1279
1280
|
default:
|
|
1280
1281
|
return null;
|
|
1281
1282
|
}
|
|
1282
1283
|
}
|
|
1283
|
-
const
|
|
1284
|
+
const oe = {
|
|
1284
1285
|
background: "#0a0a1e",
|
|
1285
1286
|
title: "#e0e7ff",
|
|
1286
1287
|
subtitle: "#94a3b8",
|
|
@@ -1295,7 +1296,7 @@ const he = {
|
|
|
1295
1296
|
warning: "#fbbf24",
|
|
1296
1297
|
error: "#f87171",
|
|
1297
1298
|
palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
|
|
1298
|
-
},
|
|
1299
|
+
}, Yt = {
|
|
1299
1300
|
background: "#f8fafc",
|
|
1300
1301
|
title: "#1e293b",
|
|
1301
1302
|
subtitle: "#64748b",
|
|
@@ -1311,14 +1312,14 @@ const he = {
|
|
|
1311
1312
|
error: "#dc2626",
|
|
1312
1313
|
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1313
1314
|
};
|
|
1314
|
-
function
|
|
1315
|
+
function Zt(e) {
|
|
1315
1316
|
if (!e) return {};
|
|
1316
1317
|
const a = {};
|
|
1317
1318
|
for (const [t, r] of Object.entries(e))
|
|
1318
1319
|
r !== void 0 && (a[`--elucim-${t}`] = r);
|
|
1319
1320
|
return a;
|
|
1320
1321
|
}
|
|
1321
|
-
function
|
|
1322
|
+
function me(e) {
|
|
1322
1323
|
return {
|
|
1323
1324
|
"--elucim-foreground": e.text,
|
|
1324
1325
|
"--elucim-background": e.background,
|
|
@@ -1335,85 +1336,85 @@ function fe(e) {
|
|
|
1335
1336
|
"--elucim-error": e.error
|
|
1336
1337
|
};
|
|
1337
1338
|
}
|
|
1338
|
-
const
|
|
1339
|
-
function
|
|
1339
|
+
const ea = me(oe), ta = me(Yt);
|
|
1340
|
+
function aa(e) {
|
|
1340
1341
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {
|
|
1341
1342
|
};
|
|
1342
1343
|
const a = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1343
1344
|
return a.addEventListener("change", e), () => a.removeEventListener("change", e);
|
|
1344
1345
|
}
|
|
1345
|
-
function
|
|
1346
|
+
function ra() {
|
|
1346
1347
|
return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1347
1348
|
}
|
|
1348
|
-
function
|
|
1349
|
+
function ia() {
|
|
1349
1350
|
return !0;
|
|
1350
1351
|
}
|
|
1351
|
-
function
|
|
1352
|
-
return
|
|
1352
|
+
function na() {
|
|
1353
|
+
return bt(aa, ra, ia);
|
|
1353
1354
|
}
|
|
1354
|
-
const
|
|
1355
|
-
const m =
|
|
1356
|
-
|
|
1355
|
+
const xa = ot(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, controls: c, autoPlay: x, loop: d, onPlayStateChange: S, onError: y }, g) {
|
|
1356
|
+
const m = mt(null), C = na();
|
|
1357
|
+
yt(g, () => ({
|
|
1357
1358
|
getSvgElement: () => {
|
|
1358
|
-
var
|
|
1359
|
-
return ((
|
|
1359
|
+
var o;
|
|
1360
|
+
return ((o = m.current) == null ? void 0 : o.getSvgElement()) ?? null;
|
|
1360
1361
|
},
|
|
1361
|
-
seekToFrame: (
|
|
1362
|
-
var
|
|
1363
|
-
return (
|
|
1362
|
+
seekToFrame: (o) => {
|
|
1363
|
+
var P;
|
|
1364
|
+
return (P = m.current) == null ? void 0 : P.seekToFrame(o);
|
|
1364
1365
|
},
|
|
1365
1366
|
getTotalFrames: () => {
|
|
1366
|
-
var
|
|
1367
|
-
return ((
|
|
1367
|
+
var o;
|
|
1368
|
+
return ((o = m.current) == null ? void 0 : o.getTotalFrames()) ?? 0;
|
|
1368
1369
|
},
|
|
1369
1370
|
play: () => {
|
|
1370
|
-
var
|
|
1371
|
-
return (
|
|
1371
|
+
var o;
|
|
1372
|
+
return (o = m.current) == null ? void 0 : o.play();
|
|
1372
1373
|
},
|
|
1373
1374
|
pause: () => {
|
|
1374
|
-
var
|
|
1375
|
-
return (
|
|
1375
|
+
var o;
|
|
1376
|
+
return (o = m.current) == null ? void 0 : o.pause();
|
|
1376
1377
|
},
|
|
1377
1378
|
isPlaying: () => {
|
|
1378
|
-
var
|
|
1379
|
-
return ((
|
|
1379
|
+
var o;
|
|
1380
|
+
return ((o = m.current) == null ? void 0 : o.isPlaying()) ?? !1;
|
|
1380
1381
|
}
|
|
1381
1382
|
}));
|
|
1382
|
-
const
|
|
1383
|
-
if (
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
for (const
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1383
|
+
const $ = se(a);
|
|
1384
|
+
if (!$.valid) {
|
|
1385
|
+
const o = $.errors.filter((k) => k.severity === "error").map((k) => ({ path: k.path, message: k.message }));
|
|
1386
|
+
y == null || y(o);
|
|
1387
|
+
const P = /* @__PURE__ */ new Map();
|
|
1388
|
+
for (const k of o) {
|
|
1389
|
+
const N = k.path.split("."), W = N.length > 1 ? N.slice(0, -1).join(".") : k.path, V = P.get(W) ?? [];
|
|
1390
|
+
V.push(k), P.set(W, V);
|
|
1390
1391
|
}
|
|
1391
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ F(
|
|
1392
1393
|
"div",
|
|
1393
1394
|
{
|
|
1394
1395
|
className: t,
|
|
1395
1396
|
style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...r },
|
|
1396
1397
|
"data-testid": "dsl-error",
|
|
1397
1398
|
children: [
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ F("strong", { children: [
|
|
1399
1400
|
"Elucim DSL Validation Errors (",
|
|
1400
|
-
|
|
1401
|
+
o.length,
|
|
1401
1402
|
"):"
|
|
1402
1403
|
] }),
|
|
1403
|
-
[...
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
|
|
1404
|
+
[...P.entries()].map(([k, N]) => /* @__PURE__ */ F("details", { open: !0, style: { marginTop: 8 }, children: [
|
|
1405
|
+
/* @__PURE__ */ F("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
|
|
1406
|
+
k,
|
|
1406
1407
|
" (",
|
|
1407
|
-
|
|
1408
|
+
N.length,
|
|
1408
1409
|
")"
|
|
1409
1410
|
] }),
|
|
1410
|
-
/* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children:
|
|
1411
|
-
/* @__PURE__ */ l("code", { style: { color: "#ffa07a" }, children:
|
|
1411
|
+
/* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: N.map((W, V) => /* @__PURE__ */ F("li", { children: [
|
|
1412
|
+
/* @__PURE__ */ l("code", { style: { color: "#ffa07a" }, children: W.path }),
|
|
1412
1413
|
": ",
|
|
1413
|
-
|
|
1414
|
-
] },
|
|
1415
|
-
] },
|
|
1416
|
-
/* @__PURE__ */
|
|
1414
|
+
W.message
|
|
1415
|
+
] }, V)) })
|
|
1416
|
+
] }, k)),
|
|
1417
|
+
/* @__PURE__ */ F("details", { style: { marginTop: 12 }, children: [
|
|
1417
1418
|
/* @__PURE__ */ l("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
|
|
1418
1419
|
/* @__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) })
|
|
1419
1420
|
] })
|
|
@@ -1421,17 +1422,21 @@ const ga = ut(function({ dsl: a, className: t, style: r, theme: i, colorScheme:
|
|
|
1421
1422
|
}
|
|
1422
1423
|
);
|
|
1423
1424
|
}
|
|
1424
|
-
const
|
|
1425
|
-
let
|
|
1426
|
-
n && (
|
|
1427
|
-
const
|
|
1428
|
-
return /* @__PURE__ */ l("div", { className: t, style: { ...
|
|
1429
|
-
frame:
|
|
1425
|
+
const _ = Zt(i);
|
|
1426
|
+
let M = {};
|
|
1427
|
+
n && (M = (n === "auto" ? C : n === "dark") ? ea : ta);
|
|
1428
|
+
const q = s !== void 0 ? sa(s, a) : void 0, ye = n ? n === "auto" ? C ? "dark" : "light" : n : void 0;
|
|
1429
|
+
return /* @__PURE__ */ l("div", { className: t, style: { ...M, ..._, ...r }, "data-testid": "dsl-root", children: fe(a.root, {
|
|
1430
|
+
frame: q == null ? void 0 : q.frame,
|
|
1430
1431
|
playerRef: m,
|
|
1431
|
-
colorScheme:
|
|
1432
|
+
colorScheme: ye,
|
|
1433
|
+
controls: c,
|
|
1434
|
+
autoPlay: x,
|
|
1435
|
+
loop: d,
|
|
1436
|
+
onPlayStateChange: S
|
|
1432
1437
|
}) });
|
|
1433
1438
|
});
|
|
1434
|
-
function
|
|
1439
|
+
function sa(e, a) {
|
|
1435
1440
|
if (e === "first") return { frame: 0 };
|
|
1436
1441
|
if (e === "last") {
|
|
1437
1442
|
const r = a.root.durationInFrames ?? 1;
|
|
@@ -1439,8 +1444,8 @@ function aa(e, a) {
|
|
|
1439
1444
|
}
|
|
1440
1445
|
return { frame: e };
|
|
1441
1446
|
}
|
|
1442
|
-
function
|
|
1443
|
-
const r =
|
|
1447
|
+
function ca(e, a, t) {
|
|
1448
|
+
const r = se(e);
|
|
1444
1449
|
if (!r.valid) {
|
|
1445
1450
|
const s = r.errors.filter((c) => c.severity === "error");
|
|
1446
1451
|
throw new Error(
|
|
@@ -1451,44 +1456,44 @@ ${s.map((c) => ` ${c.path}: ${c.message}`).join(`
|
|
|
1451
1456
|
}
|
|
1452
1457
|
const i = { ...e.root };
|
|
1453
1458
|
t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
|
|
1454
|
-
const n =
|
|
1455
|
-
return
|
|
1459
|
+
const n = fe(i, { frame: a });
|
|
1460
|
+
return xt(n);
|
|
1456
1461
|
}
|
|
1457
|
-
function
|
|
1462
|
+
function ie(e) {
|
|
1458
1463
|
let a;
|
|
1459
1464
|
do
|
|
1460
1465
|
a = e, e = e.replace(/var\(--[a-z][\w-]*,\s*([^)]+)\)/gi, "$1");
|
|
1461
1466
|
while (e !== a);
|
|
1462
1467
|
return e = e.replace(/var\(--[a-z][\w-]*\)/gi, "none"), e = e.replace(/light-dark\([^,]+,\s*([^)]+)\)/gi, "$1"), e;
|
|
1463
1468
|
}
|
|
1464
|
-
async function
|
|
1465
|
-
const r = (t == null ? void 0 : t.scale) ?? 2, n =
|
|
1469
|
+
async function da(e, a, t) {
|
|
1470
|
+
const r = (t == null ? void 0 : t.scale) ?? 2, n = ca(e, a, {
|
|
1466
1471
|
width: t == null ? void 0 : t.width,
|
|
1467
1472
|
height: t == null ? void 0 : t.height
|
|
1468
1473
|
}).match(/<svg[\s\S]*<\/svg>/);
|
|
1469
1474
|
if (!n)
|
|
1470
1475
|
throw new Error("renderToSvgString did not produce an SVG element");
|
|
1471
1476
|
let s = n[0];
|
|
1472
|
-
const c = s.match(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/), x = (t == null ? void 0 : t.width) ?? (c ? parseFloat(c[1]) : 800),
|
|
1473
|
-
s = s.replace(/width="100%"/, `width="${
|
|
1477
|
+
const c = s.match(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/), x = (t == null ? void 0 : t.width) ?? (c ? parseFloat(c[1]) : 800), d = (t == null ? void 0 : t.height) ?? (c ? parseFloat(c[2]) : 600), S = Math.round(x * r), y = Math.round(d * r);
|
|
1478
|
+
s = s.replace(/width="100%"/, `width="${S}"`).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[^"]*"/, "");
|
|
1474
1479
|
let g = e.root.background ?? "#ffffff";
|
|
1475
|
-
g.startsWith("$") && (g = u(g) ?? "#ffffff"), g =
|
|
1476
|
-
const
|
|
1477
|
-
s = s.replace(/>/, `>${
|
|
1478
|
-
const
|
|
1480
|
+
g.startsWith("$") && (g = u(g) ?? "#ffffff"), g = ie(g);
|
|
1481
|
+
const m = `<rect width="${x}" height="${d}" fill="${g}"/>`;
|
|
1482
|
+
s = s.replace(/>/, `>${m}`), s = ie(s);
|
|
1483
|
+
const $ = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(s)))}`;
|
|
1479
1484
|
if (typeof Image < "u" && typeof document < "u")
|
|
1480
|
-
return
|
|
1485
|
+
return ua($, S, y);
|
|
1481
1486
|
if (typeof OffscreenCanvas < "u")
|
|
1482
|
-
return
|
|
1487
|
+
return la($, S, y);
|
|
1483
1488
|
throw new Error("renderToPng requires Image+document (browser) or OffscreenCanvas (worker)");
|
|
1484
1489
|
}
|
|
1485
|
-
async function
|
|
1490
|
+
async function la(e, a, t) {
|
|
1486
1491
|
const i = await (await fetch(e)).blob(), n = await createImageBitmap(i, { resizeWidth: a, resizeHeight: t }), s = new OffscreenCanvas(a, t);
|
|
1487
1492
|
s.getContext("2d").drawImage(n, 0, 0, a, t), n.close();
|
|
1488
|
-
const
|
|
1489
|
-
return new Uint8Array(
|
|
1493
|
+
const d = await (await s.convertToBlob({ type: "image/png" })).arrayBuffer();
|
|
1494
|
+
return new Uint8Array(d);
|
|
1490
1495
|
}
|
|
1491
|
-
function
|
|
1496
|
+
function ua(e, a, t) {
|
|
1492
1497
|
return new Promise((r, i) => {
|
|
1493
1498
|
const n = new Image();
|
|
1494
1499
|
n.onload = () => {
|
|
@@ -1496,14 +1501,14 @@ function na(e, a, t) {
|
|
|
1496
1501
|
s.width = a, s.height = t, s.getContext("2d").drawImage(n, 0, 0, a, t), s.toBlob(
|
|
1497
1502
|
(x) => {
|
|
1498
1503
|
if (!x) return i(new Error("Failed to render PNG from SVG"));
|
|
1499
|
-
x.arrayBuffer().then((
|
|
1504
|
+
x.arrayBuffer().then((d) => r(new Uint8Array(d)));
|
|
1500
1505
|
},
|
|
1501
1506
|
"image/png"
|
|
1502
1507
|
);
|
|
1503
1508
|
}, n.onerror = () => i(new Error("Failed to load SVG data URI for PNG render")), n.src = e;
|
|
1504
1509
|
});
|
|
1505
1510
|
}
|
|
1506
|
-
class
|
|
1511
|
+
class ha {
|
|
1507
1512
|
constructor(a, t = 30, r = 900, i = 640) {
|
|
1508
1513
|
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
|
|
1509
1514
|
}
|
|
@@ -1724,30 +1729,30 @@ class sa {
|
|
|
1724
1729
|
boxRow(a, t) {
|
|
1725
1730
|
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;
|
|
1726
1731
|
t == null || t.fadeIn;
|
|
1727
|
-
const
|
|
1728
|
-
const
|
|
1729
|
-
return { x:
|
|
1730
|
-
}),
|
|
1731
|
-
var
|
|
1732
|
-
const
|
|
1732
|
+
const d = a.map((y, g) => {
|
|
1733
|
+
const m = x + g * (r + n);
|
|
1734
|
+
return { x: m, y: s, w: r, h: i, cx: m + r / 2, cy: s + i / 2 };
|
|
1735
|
+
}), S = a.map((y, g) => {
|
|
1736
|
+
var _, M;
|
|
1737
|
+
const m = d[g], C = ((_ = t == null ? void 0 : t.colors) == null ? void 0 : _[g]) ?? this.theme.boxFill, $ = ((M = t == null ? void 0 : t.strokeColors) == null ? void 0 : M[g]) ?? this.theme.boxStroke;
|
|
1733
1738
|
return {
|
|
1734
1739
|
type: "group",
|
|
1735
1740
|
children: [
|
|
1736
1741
|
{
|
|
1737
1742
|
type: "rect",
|
|
1738
|
-
x:
|
|
1739
|
-
y:
|
|
1743
|
+
x: m.x,
|
|
1744
|
+
y: m.y,
|
|
1740
1745
|
width: r,
|
|
1741
1746
|
height: i,
|
|
1742
|
-
fill:
|
|
1743
|
-
stroke:
|
|
1747
|
+
fill: C,
|
|
1748
|
+
stroke: $,
|
|
1744
1749
|
strokeWidth: 1.5,
|
|
1745
1750
|
rx: 6
|
|
1746
1751
|
},
|
|
1747
1752
|
{
|
|
1748
1753
|
type: "text",
|
|
1749
|
-
x:
|
|
1750
|
-
y:
|
|
1754
|
+
x: m.cx,
|
|
1755
|
+
y: m.cy + 5,
|
|
1751
1756
|
content: y,
|
|
1752
1757
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1753
1758
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
@@ -1760,8 +1765,8 @@ class sa {
|
|
|
1760
1765
|
return this.addAtCursor({
|
|
1761
1766
|
type: "stagger",
|
|
1762
1767
|
staggerDelay: 3,
|
|
1763
|
-
children:
|
|
1764
|
-
}, 8 + a.length * 2),
|
|
1768
|
+
children: S
|
|
1769
|
+
}, 8 + a.length * 2), d;
|
|
1765
1770
|
}
|
|
1766
1771
|
/**
|
|
1767
1772
|
* Render a vertical stack of labeled boxes.
|
|
@@ -1769,12 +1774,12 @@ class sa {
|
|
|
1769
1774
|
boxColumn(a, t) {
|
|
1770
1775
|
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;
|
|
1771
1776
|
t == null || t.fadeIn;
|
|
1772
|
-
const x = a.map((
|
|
1777
|
+
const x = a.map((S, y) => {
|
|
1773
1778
|
const g = s + y * (i + n);
|
|
1774
1779
|
return { x: c - r / 2, y: g, w: r, h: i, cx: c, cy: g + i / 2 };
|
|
1775
|
-
}),
|
|
1776
|
-
var
|
|
1777
|
-
const g = x[y],
|
|
1780
|
+
}), d = a.map((S, y) => {
|
|
1781
|
+
var C, $;
|
|
1782
|
+
const g = x[y], m = ((C = t == null ? void 0 : t.colors) == null ? void 0 : C[y]) ?? this.theme.boxFill;
|
|
1778
1783
|
return {
|
|
1779
1784
|
type: "group",
|
|
1780
1785
|
children: [
|
|
@@ -1784,8 +1789,8 @@ class sa {
|
|
|
1784
1789
|
y: g.y,
|
|
1785
1790
|
width: r,
|
|
1786
1791
|
height: i,
|
|
1787
|
-
fill:
|
|
1788
|
-
stroke: (
|
|
1792
|
+
fill: m,
|
|
1793
|
+
stroke: ($ = t == null ? void 0 : t.colors) != null && $[y] ? t.colors[y] : this.theme.boxStroke,
|
|
1789
1794
|
strokeWidth: 1.5,
|
|
1790
1795
|
rx: 6
|
|
1791
1796
|
},
|
|
@@ -1793,7 +1798,7 @@ class sa {
|
|
|
1793
1798
|
type: "text",
|
|
1794
1799
|
x: g.cx,
|
|
1795
1800
|
y: g.cy + 5,
|
|
1796
|
-
content:
|
|
1801
|
+
content: S,
|
|
1797
1802
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1798
1803
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1799
1804
|
textAnchor: "middle"
|
|
@@ -1804,7 +1809,7 @@ class sa {
|
|
|
1804
1809
|
return this.addAtCursor({
|
|
1805
1810
|
type: "stagger",
|
|
1806
1811
|
staggerDelay: 3,
|
|
1807
|
-
children:
|
|
1812
|
+
children: d
|
|
1808
1813
|
}, 8 + a.length * 2), x;
|
|
1809
1814
|
}
|
|
1810
1815
|
/**
|
|
@@ -1888,9 +1893,9 @@ class sa {
|
|
|
1888
1893
|
return { elements: this.elements, durationInFrames: a };
|
|
1889
1894
|
}
|
|
1890
1895
|
}
|
|
1891
|
-
class
|
|
1896
|
+
class fa {
|
|
1892
1897
|
constructor(a, t, r) {
|
|
1893
|
-
this._slides = [], this._title = a, this._theme = t ??
|
|
1898
|
+
this._slides = [], this._title = a, this._theme = t ?? oe, this._opts = {
|
|
1894
1899
|
width: 900,
|
|
1895
1900
|
height: 640,
|
|
1896
1901
|
fps: 30,
|
|
@@ -1908,7 +1913,7 @@ class ca {
|
|
|
1908
1913
|
/** Build the final ElucimDocument */
|
|
1909
1914
|
build() {
|
|
1910
1915
|
const a = this._slides.map((r) => {
|
|
1911
|
-
const i = new
|
|
1916
|
+
const i = new ha(
|
|
1912
1917
|
this._theme,
|
|
1913
1918
|
this._opts.fps,
|
|
1914
1919
|
this._opts.width,
|
|
@@ -1954,31 +1959,31 @@ class ca {
|
|
|
1954
1959
|
return JSON.stringify(this.build(), null, a ? 2 : void 0);
|
|
1955
1960
|
}
|
|
1956
1961
|
}
|
|
1957
|
-
function
|
|
1958
|
-
return new
|
|
1962
|
+
function wa(e, a, t) {
|
|
1963
|
+
return new fa(e, a, t);
|
|
1959
1964
|
}
|
|
1960
1965
|
export {
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1966
|
+
xa as DslRenderer,
|
|
1967
|
+
fa as PresentationBuilder,
|
|
1968
|
+
he as SEMANTIC_TOKENS,
|
|
1969
|
+
ha as SlideBuilder,
|
|
1970
|
+
ba as TOKEN_NAMES,
|
|
1971
|
+
dt as compileExpression,
|
|
1972
|
+
wt as compileVectorExpression,
|
|
1973
|
+
oe as darkTheme,
|
|
1974
|
+
Yt as lightTheme,
|
|
1975
|
+
wa as presentation,
|
|
1976
|
+
w as renderElement,
|
|
1977
|
+
ge as renderPlayer,
|
|
1978
|
+
Xt as renderPresentation,
|
|
1979
|
+
fe as renderRoot,
|
|
1980
|
+
X as renderScene,
|
|
1981
|
+
Jt as renderSlide,
|
|
1982
|
+
da as renderToPng,
|
|
1983
|
+
ca as renderToSvgString,
|
|
1979
1984
|
u as resolveColor,
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1985
|
+
f as resolveEasing,
|
|
1986
|
+
ie as stripCssFunctions,
|
|
1987
|
+
se as validate,
|
|
1988
|
+
ne as validateExpression
|
|
1984
1989
|
};
|