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