@elucim/dsl 0.8.1 → 0.8.3
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 +8 -0
- package/dist/index.js +265 -262
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -931,6 +931,14 @@ export declare interface StaggerNode {
|
|
|
931
931
|
children: ElementNode[];
|
|
932
932
|
}
|
|
933
933
|
|
|
934
|
+
/**
|
|
935
|
+
* Strip all CSS functions that are invalid in standalone SVGs loaded via Image:
|
|
936
|
+
* - var(--x, fallback) → fallback (iterative for nested vars)
|
|
937
|
+
* - var(--x) with no fallback → 'none'
|
|
938
|
+
* - light-dark(light, dark) → dark value (elucim defaults to dark theme)
|
|
939
|
+
*/
|
|
940
|
+
export declare function stripCssFunctions(s: string): string;
|
|
941
|
+
|
|
934
942
|
export declare interface TextNode {
|
|
935
943
|
type: 'text';
|
|
936
944
|
id?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
2
|
-
import { jsx as l, jsxs as
|
|
3
|
-
import
|
|
1
|
+
import { easeOutBounce as oe, easeOutElastic as ge, easeOutBack as me, easeInBack as ye, easeInOutExpo as be, easeOutExpo as xe, easeInExpo as de, easeInOutSine as ve, easeOutSine as we, easeInSine as ke, easeInOutQuart as Ie, easeOutQuart as Se, easeInQuart as $e, easeInOutCubic as Oe, easeOutCubic as Ce, easeInCubic as Ae, easeInOutQuad as ze, easeOutQuad as pe, easeInQuad as Ee, linear as Fe, spring as Pe, cubicBezier as Re, Presentation as Te, Scene as Me, Player as Ne, Slide as We, Parallel as De, Stagger as _e, Morph as Ve, Transform as Le, Write as je, Draw as Be, FadeOut as qe, FadeIn as Ue, BarChart as Ge, LaTeX as He, Graph as Ke, Matrix as Qe, Text as j, VectorField as Xe, Vector as Je, FunctionPlot as Ye, Axes as Ze, Image as et, Polygon as tt, Rect as at, Arrow as rt, Line as it, Circle as nt, BezierCurve as st, Group as ct, Sequence as lt } from "@elucim/core";
|
|
2
|
+
import { jsx as l, jsxs as P } from "react/jsx-runtime";
|
|
3
|
+
import X, { forwardRef as ut, useRef as ft, useImperativeHandle as ht, useSyncExternalStore as ot } from "react";
|
|
4
4
|
import { renderToStaticMarkup as gt } from "react-dom/server";
|
|
5
5
|
const U = {
|
|
6
6
|
sin: Math.sin,
|
|
@@ -22,7 +22,7 @@ const U = {
|
|
|
22
22
|
max: (...e) => Math.max(...e),
|
|
23
23
|
sign: Math.sign,
|
|
24
24
|
pow: Math.pow
|
|
25
|
-
},
|
|
25
|
+
}, J = {
|
|
26
26
|
PI: Math.PI,
|
|
27
27
|
E: Math.E,
|
|
28
28
|
TAU: Math.PI * 2
|
|
@@ -175,7 +175,7 @@ class Q {
|
|
|
175
175
|
);
|
|
176
176
|
return { kind: "call", name: t, args: r };
|
|
177
177
|
}
|
|
178
|
-
return Object.prototype.hasOwnProperty.call(
|
|
178
|
+
return Object.prototype.hasOwnProperty.call(J, t) ? { kind: "number", value: J[t] } : { kind: "variable", name: t };
|
|
179
179
|
}
|
|
180
180
|
if (a.type === "LPAREN") {
|
|
181
181
|
this.advance();
|
|
@@ -236,11 +236,11 @@ class A extends Error {
|
|
|
236
236
|
super(a), this.name = "ExpressionError", this.position = t;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function mt(e) {
|
|
240
240
|
const a = K(e), t = new Q(a).parse();
|
|
241
241
|
return (r) => E(t, r);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function yt(e) {
|
|
244
244
|
const a = K(e), t = new Q(a).parse();
|
|
245
245
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
246
246
|
throw new A(
|
|
@@ -258,28 +258,28 @@ function ae(e) {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
const G = {
|
|
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:
|
|
261
|
+
linear: Fe,
|
|
262
|
+
easeInQuad: Ee,
|
|
263
|
+
easeOutQuad: pe,
|
|
264
|
+
easeInOutQuad: ze,
|
|
265
|
+
easeInCubic: Ae,
|
|
266
|
+
easeOutCubic: Ce,
|
|
267
|
+
easeInOutCubic: Oe,
|
|
268
|
+
easeInQuart: $e,
|
|
269
|
+
easeOutQuart: Se,
|
|
270
|
+
easeInOutQuart: Ie,
|
|
271
|
+
easeInSine: ke,
|
|
272
|
+
easeOutSine: we,
|
|
273
|
+
easeInOutSine: ve,
|
|
274
|
+
easeInExpo: de,
|
|
275
|
+
easeOutExpo: xe,
|
|
276
|
+
easeInOutExpo: be,
|
|
277
|
+
easeInBack: ye,
|
|
278
|
+
easeOutBack: me,
|
|
279
279
|
easeOutElastic: ge,
|
|
280
|
-
easeOutBounce:
|
|
280
|
+
easeOutBounce: oe
|
|
281
281
|
};
|
|
282
|
-
function
|
|
282
|
+
function o(e) {
|
|
283
283
|
if (e !== void 0) {
|
|
284
284
|
if (typeof e == "string") {
|
|
285
285
|
const a = G[e];
|
|
@@ -290,7 +290,7 @@ function g(e) {
|
|
|
290
290
|
return a;
|
|
291
291
|
}
|
|
292
292
|
if (e.type === "spring")
|
|
293
|
-
return
|
|
293
|
+
return Pe({
|
|
294
294
|
stiffness: e.stiffness,
|
|
295
295
|
damping: e.damping,
|
|
296
296
|
mass: e.mass
|
|
@@ -306,12 +306,12 @@ function re(e) {
|
|
|
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 }) : (bt(t.root, "root", a), {
|
|
310
310
|
valid: a.filter((r) => r.severity === "error").length === 0,
|
|
311
311
|
errors: a
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const Y = ["scene", "player", "presentation"], _ = ["card", "slide", "square"], q = [
|
|
315
315
|
"sequence",
|
|
316
316
|
"group",
|
|
317
317
|
"bezierCurve",
|
|
@@ -340,32 +340,32 @@ const Z = ["scene", "player", "presentation"], _ = ["card", "slide", "square"],
|
|
|
340
340
|
"parallel",
|
|
341
341
|
"player",
|
|
342
342
|
"scene"
|
|
343
|
-
],
|
|
344
|
-
function
|
|
343
|
+
], Z = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
344
|
+
function bt(e, a, t) {
|
|
345
345
|
const r = e.type;
|
|
346
|
-
if (!
|
|
347
|
-
t.push({ path: `${a}.type`, message: `Root type must be one of: ${
|
|
346
|
+
if (!Y.includes(r)) {
|
|
347
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${Y.join(", ")}. Got "${r}"`, severity: "error" });
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
|
-
r === "scene" || r === "player" ? ie(e, a, r, t) : r === "presentation" &&
|
|
350
|
+
r === "scene" || r === "player" ? ie(e, a, r, t) : r === "presentation" && xt(e, a, t);
|
|
351
351
|
}
|
|
352
352
|
function ie(e, a, t, r) {
|
|
353
|
-
|
|
353
|
+
Bt(e, "durationInFrames", a, r), b(e, "width", a, r), b(e, "height", a, r), b(e, "fps", a, r), z(e, "background", a, r), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && r.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), t === "player" && (W(e, "controls", a, r), W(e, "loop", a, r), W(e, "autoPlay", a, r)), p(e, a, r);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
if (b(e, "width", a, t), b(e, "height", a, t), z(e, "background", a, t), b(e, "transitionDuration", a, t), W(e, "showHud", a, t), W(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (
|
|
355
|
+
function xt(e, a, t) {
|
|
356
|
+
if (b(e, "width", a, t), b(e, "height", a, t), z(e, "background", a, t), b(e, "transitionDuration", a, t), W(e, "showHud", a, t), W(e, "showNotes", a, t), e.preset !== void 0 && (typeof e.preset != "string" || !_.includes(e.preset)) && t.push({ path: `${a}.preset`, message: `preset must be one of: ${_.join(", ")}. Got "${e.preset}"`, severity: "error" }), e.transition !== void 0 && (Z.includes(e.transition) || t.push({
|
|
357
357
|
path: `${a}.transition`,
|
|
358
|
-
message: `Invalid transition "${e.transition}". Must be one of: ${
|
|
358
|
+
message: `Invalid transition "${e.transition}". Must be one of: ${Z.join(", ")}`,
|
|
359
359
|
severity: "error"
|
|
360
360
|
})), !Array.isArray(e.slides)) {
|
|
361
361
|
t.push({ path: `${a}.slides`, message: 'Presentation must have a "slides" array', severity: "error" });
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
364
|
e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((r, i) => {
|
|
365
|
-
|
|
365
|
+
dt(r, `${a}.slides[${i}]`, t);
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function dt(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;
|
|
@@ -400,58 +400,58 @@ function ne(e, a, t) {
|
|
|
400
400
|
}
|
|
401
401
|
switch (r) {
|
|
402
402
|
case "bezierCurve":
|
|
403
|
-
|
|
403
|
+
vt(e, a, t);
|
|
404
404
|
break;
|
|
405
405
|
case "circle":
|
|
406
|
-
|
|
406
|
+
wt(e, a, t);
|
|
407
407
|
break;
|
|
408
408
|
case "line":
|
|
409
|
-
|
|
409
|
+
kt(e, a, t);
|
|
410
410
|
break;
|
|
411
411
|
case "arrow":
|
|
412
|
-
|
|
412
|
+
It(e, a, t);
|
|
413
413
|
break;
|
|
414
414
|
case "rect":
|
|
415
|
-
|
|
415
|
+
St(e, a, t);
|
|
416
416
|
break;
|
|
417
417
|
case "polygon":
|
|
418
|
-
|
|
418
|
+
$t(e, a, t);
|
|
419
419
|
break;
|
|
420
420
|
case "text":
|
|
421
|
-
|
|
421
|
+
Ot(e, a, t);
|
|
422
422
|
break;
|
|
423
423
|
case "image":
|
|
424
|
-
|
|
424
|
+
Vt(e, a, t);
|
|
425
425
|
break;
|
|
426
426
|
case "axes":
|
|
427
|
-
|
|
427
|
+
Ct(e, a, t);
|
|
428
428
|
break;
|
|
429
429
|
case "functionPlot":
|
|
430
|
-
|
|
430
|
+
At(e, a, t);
|
|
431
431
|
break;
|
|
432
432
|
case "vector":
|
|
433
|
-
|
|
433
|
+
zt(e, a, t);
|
|
434
434
|
break;
|
|
435
435
|
case "vectorField":
|
|
436
|
-
|
|
436
|
+
pt(e, a, t);
|
|
437
437
|
break;
|
|
438
438
|
case "matrix":
|
|
439
|
-
|
|
439
|
+
Et(e, a, t);
|
|
440
440
|
break;
|
|
441
441
|
case "graph":
|
|
442
|
-
|
|
442
|
+
Ft(e, a, t);
|
|
443
443
|
break;
|
|
444
444
|
case "latex":
|
|
445
|
-
|
|
445
|
+
Pt(e, a, t);
|
|
446
446
|
break;
|
|
447
447
|
case "barChart":
|
|
448
|
-
|
|
448
|
+
jt(e, a, t);
|
|
449
449
|
break;
|
|
450
450
|
case "sequence":
|
|
451
451
|
Rt(e, a, t);
|
|
452
452
|
break;
|
|
453
453
|
case "group":
|
|
454
|
-
|
|
454
|
+
Lt(e, a, t);
|
|
455
455
|
break;
|
|
456
456
|
case "parallel":
|
|
457
457
|
p(e, a, t);
|
|
@@ -460,16 +460,16 @@ function ne(e, a, t) {
|
|
|
460
460
|
case "fadeOut":
|
|
461
461
|
case "draw":
|
|
462
462
|
case "write":
|
|
463
|
-
|
|
463
|
+
Tt(e, a, t);
|
|
464
464
|
break;
|
|
465
465
|
case "transform":
|
|
466
466
|
Mt(e, a, t);
|
|
467
467
|
break;
|
|
468
468
|
case "morph":
|
|
469
|
-
|
|
469
|
+
Nt(e, a, t);
|
|
470
470
|
break;
|
|
471
471
|
case "stagger":
|
|
472
|
-
|
|
472
|
+
Wt(e, a, t);
|
|
473
473
|
break;
|
|
474
474
|
case "scene":
|
|
475
475
|
case "player":
|
|
@@ -477,33 +477,33 @@ function ne(e, a, t) {
|
|
|
477
477
|
break;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
function dt(e, a, t) {
|
|
481
|
-
h(e, "x1", a, t), h(e, "y1", a, t), h(e, "cx1", a, t), h(e, "cy1", a, t), h(e, "x2", a, t), h(e, "y2", a, t), e.cx2 !== void 0 && P(e, "cx2", a, t), e.cy2 !== void 0 && P(e, "cy2", a, t), w(e, a, t);
|
|
482
|
-
}
|
|
483
480
|
function vt(e, a, t) {
|
|
484
|
-
|
|
481
|
+
f(e, "x1", a, t), f(e, "y1", a, t), f(e, "cx1", a, t), f(e, "cy1", a, t), f(e, "x2", a, t), f(e, "y2", a, t), e.cx2 !== void 0 && R(e, "cx2", a, t), e.cy2 !== void 0 && R(e, "cy2", a, t), w(e, a, t);
|
|
485
482
|
}
|
|
486
483
|
function wt(e, a, t) {
|
|
487
|
-
|
|
484
|
+
f(e, "cx", a, t), f(e, "cy", a, t), F(e, "r", a, t), w(e, a, t);
|
|
488
485
|
}
|
|
489
486
|
function kt(e, a, t) {
|
|
490
|
-
|
|
487
|
+
f(e, "x1", a, t), f(e, "y1", a, t), f(e, "x2", a, t), f(e, "y2", a, t), w(e, a, t);
|
|
491
488
|
}
|
|
492
489
|
function It(e, a, t) {
|
|
493
|
-
|
|
490
|
+
f(e, "x1", a, t), f(e, "y1", a, t), f(e, "x2", a, t), f(e, "y2", a, t), w(e, a, t);
|
|
494
491
|
}
|
|
495
492
|
function St(e, a, t) {
|
|
493
|
+
f(e, "x", a, t), f(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), w(e, a, t);
|
|
494
|
+
}
|
|
495
|
+
function $t(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
498
|
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), w(e, a, t);
|
|
499
499
|
}
|
|
500
|
-
function $t(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" }), w(e, a, t);
|
|
502
|
-
}
|
|
503
500
|
function Ot(e, a, t) {
|
|
504
|
-
|
|
501
|
+
f(e, "x", a, t), f(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), w(e, a, t);
|
|
505
502
|
}
|
|
506
503
|
function Ct(e, a, t) {
|
|
504
|
+
S(e, "domain", a, t), S(e, "range", a, t), S(e, "origin", a, t), V(e, a, t);
|
|
505
|
+
}
|
|
506
|
+
function At(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 {
|
|
@@ -512,10 +512,10 @@ function Ct(e, a, t) {
|
|
|
512
512
|
}
|
|
513
513
|
S(e, "domain", a, t), V(e, a, t);
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function zt(e, a, t) {
|
|
516
516
|
(!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), S(e, "from", a, t), V(e, a, t);
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function pt(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 {
|
|
@@ -524,35 +524,35 @@ function zt(e, a, t) {
|
|
|
524
524
|
}
|
|
525
525
|
S(e, "domain", a, t), S(e, "range", a, t), V(e, a, t);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function Et(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
530
|
}) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), w(e, a, t);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Ft(e, a, t) {
|
|
533
533
|
if (!Array.isArray(e.nodes))
|
|
534
534
|
t.push({ path: `${a}.nodes`, message: 'Graph requires a "nodes" array', severity: "error" });
|
|
535
535
|
else {
|
|
536
536
|
const r = /* @__PURE__ */ new Set();
|
|
537
537
|
e.nodes.forEach((i, n) => {
|
|
538
|
-
typeof i.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (r.has(i.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${i.id}"`, severity: "error" }), r.add(i.id)),
|
|
538
|
+
typeof i.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (r.has(i.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${i.id}"`, severity: "error" }), r.add(i.id)), f(i, "x", `${a}.nodes[${n}]`, t), f(i, "y", `${a}.nodes[${n}]`, t);
|
|
539
539
|
}), Array.isArray(e.edges) && e.edges.forEach((i, n) => {
|
|
540
540
|
(typeof i.from != "string" || !r.has(i.from)) && t.push({ path: `${a}.edges[${n}].from`, message: `Edge "from" references unknown node "${i.from}"`, severity: "error" }), (typeof i.to != "string" || !r.has(i.to)) && t.push({ path: `${a}.edges[${n}].to`, message: `Edge "to" references unknown node "${i.to}"`, severity: "error" });
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
w(e, a, t);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }),
|
|
545
|
+
function Pt(e, a, t) {
|
|
546
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), f(e, "x", a, t), f(e, "y", a, t), w(e, a, t);
|
|
547
547
|
}
|
|
548
548
|
function Rt(e, a, t) {
|
|
549
|
-
|
|
549
|
+
f(e, "from", a, t), qt(e, "durationInFrames", a, t), p(e, a, t);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
b(e, "duration", a, t),
|
|
551
|
+
function Tt(e, a, t) {
|
|
552
|
+
b(e, "duration", a, t), T(e, a, t), p(e, a, t);
|
|
553
553
|
}
|
|
554
554
|
function Mt(e, a, t) {
|
|
555
|
-
if (b(e, "duration", a, t),
|
|
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" });
|
|
558
558
|
}
|
|
@@ -570,42 +570,42 @@ function Mt(e, a, t) {
|
|
|
570
570
|
}
|
|
571
571
|
p(e, a, t);
|
|
572
572
|
}
|
|
573
|
-
function Tt(e, a, t) {
|
|
574
|
-
b(e, "duration", a, t), M(e, a, t), z(e, "fromColor", a, t), z(e, "toColor", a, t), p(e, a, t);
|
|
575
|
-
}
|
|
576
573
|
function Nt(e, a, t) {
|
|
577
|
-
b(e, "
|
|
574
|
+
b(e, "duration", a, t), T(e, a, t), z(e, "fromColor", a, t), z(e, "toColor", a, t), p(e, a, t);
|
|
575
|
+
}
|
|
576
|
+
function Wt(e, a, t) {
|
|
577
|
+
b(e, "staggerDelay", a, t), T(e, a, t), p(e, a, t);
|
|
578
578
|
}
|
|
579
579
|
function w(e, a, t) {
|
|
580
|
-
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t),
|
|
580
|
+
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t), Dt(e, a, t);
|
|
581
581
|
}
|
|
582
582
|
function V(e, a, t) {
|
|
583
|
-
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t),
|
|
583
|
+
b(e, "fadeIn", a, t), b(e, "fadeOut", a, t), b(e, "draw", a, t), T(e, a, t), _t(e, a, t);
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
function
|
|
587
|
-
if (
|
|
585
|
+
const ee = ["none", "circle", "ellipse"];
|
|
586
|
+
function Dt(e, a, t) {
|
|
587
|
+
if (R(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(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 Dt(e, a, t) {
|
|
593
|
-
P(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(e, "translate", a, t), P(e, "zIndex", a, t);
|
|
594
|
-
}
|
|
595
592
|
function _t(e, a, t) {
|
|
596
|
-
|
|
593
|
+
R(e, "rotation", a, t), S(e, "rotationOrigin", a, t), S(e, "translate", a, t), R(e, "zIndex", a, t);
|
|
594
|
+
}
|
|
595
|
+
function Vt(e, a, t) {
|
|
596
|
+
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), f(e, "x", a, t), f(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), z(e, "preserveAspectRatio", a, t), e.borderRadius !== void 0 && (typeof e.borderRadius != "number" || e.borderRadius < 0) && t.push({ path: `${a}.borderRadius`, message: '"borderRadius" must be a number >= 0', severity: "error" }), e.clipShape !== void 0 && (ee.includes(e.clipShape) || t.push({
|
|
597
597
|
path: `${a}.clipShape`,
|
|
598
|
-
message: `Invalid clipShape "${e.clipShape}". Must be one of: ${
|
|
598
|
+
message: `Invalid clipShape "${e.clipShape}". Must be one of: ${ee.join(", ")}`,
|
|
599
599
|
severity: "error"
|
|
600
600
|
})), w(e, a, t);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Lt(e, a, t) {
|
|
603
603
|
p(e, a, t), w(e, a, t);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
605
|
+
function jt(e, a, t) {
|
|
606
|
+
f(e, "x", a, t), f(e, "y", a, t), F(e, "width", a, t), F(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), w(e, a, t);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function T(e, a, t) {
|
|
609
609
|
if (e.easing !== void 0) {
|
|
610
610
|
if (typeof e.easing == "string") {
|
|
611
611
|
if (!B.includes(e.easing)) {
|
|
@@ -632,27 +632,27 @@ function M(e, a, t) {
|
|
|
632
632
|
t.push({ path: `${a}.easing`, message: 'Easing must be a string name or { type: "spring"|"cubicBezier", ... }', severity: "error" });
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function f(e, a, t, r) {
|
|
636
636
|
typeof e[a] != "number" && r.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
|
|
637
637
|
}
|
|
638
638
|
function F(e, a, t, r) {
|
|
639
639
|
(typeof e[a] != "number" || e[a] <= 0) && r.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Bt(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 qt(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
652
|
function z(e, a, t, r) {
|
|
653
653
|
e[a] !== void 0 && typeof e[a] != "string" && r.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function 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
658
|
function W(e, a, t, r) {
|
|
@@ -668,7 +668,7 @@ function se(e, a) {
|
|
|
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 ce = {
|
|
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,24 +683,24 @@ const X = {
|
|
|
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
|
+
}, oa = Object.keys(ce);
|
|
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 = ce[a];
|
|
691
691
|
return t ? `var(${t.cssVar}, ${t.fallback})` : `var(--elucim-${a})`;
|
|
692
692
|
}
|
|
693
|
-
const
|
|
693
|
+
const Ut = {
|
|
694
694
|
card: [640, 360],
|
|
695
695
|
slide: [1280, 720],
|
|
696
696
|
square: [600, 600]
|
|
697
697
|
};
|
|
698
698
|
function L(e, a, t) {
|
|
699
699
|
if (!e) return { width: a, height: t };
|
|
700
|
-
const [r, i] =
|
|
700
|
+
const [r, i] = Ut[e];
|
|
701
701
|
return { width: a ?? r, height: t ?? i };
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function le(e, a) {
|
|
704
704
|
switch (e.type) {
|
|
705
705
|
case "scene":
|
|
706
706
|
return H(e, a);
|
|
@@ -719,9 +719,9 @@ function ce(e, a) {
|
|
|
719
719
|
a
|
|
720
720
|
);
|
|
721
721
|
}
|
|
722
|
-
return
|
|
722
|
+
return ue(e, a);
|
|
723
723
|
case "presentation":
|
|
724
|
-
return
|
|
724
|
+
return Gt(e);
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
function H(e, a) {
|
|
@@ -740,10 +740,10 @@ function H(e, a) {
|
|
|
740
740
|
}
|
|
741
741
|
);
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function ue(e, a) {
|
|
744
744
|
const { width: t, height: r } = L(e.preset, e.width, e.height);
|
|
745
745
|
return /* @__PURE__ */ l(
|
|
746
|
-
|
|
746
|
+
Ne,
|
|
747
747
|
{
|
|
748
748
|
ref: a == null ? void 0 : a.playerRef,
|
|
749
749
|
width: t,
|
|
@@ -759,10 +759,10 @@ function le(e, a) {
|
|
|
759
759
|
}
|
|
760
760
|
);
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Gt(e) {
|
|
763
763
|
const { width: a, height: t } = L(e.preset, e.width, e.height);
|
|
764
764
|
return /* @__PURE__ */ l(
|
|
765
|
-
|
|
765
|
+
Te,
|
|
766
766
|
{
|
|
767
767
|
width: a,
|
|
768
768
|
height: t,
|
|
@@ -771,26 +771,26 @@ function Ut(e) {
|
|
|
771
771
|
transitionDuration: e.transitionDuration,
|
|
772
772
|
showHUD: e.showHud,
|
|
773
773
|
showNotes: e.showNotes,
|
|
774
|
-
children: e.slides.map((r, i) =>
|
|
774
|
+
children: e.slides.map((r, i) => Ht(r, i))
|
|
775
775
|
}
|
|
776
776
|
);
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function Ht(e, a) {
|
|
779
779
|
var t;
|
|
780
|
-
return /* @__PURE__ */ l(
|
|
780
|
+
return /* @__PURE__ */ l(We, { title: e.title, notes: e.notes, background: u(e.background), children: (t = e.children) == null ? void 0 : t.map((r, i) => v(r, i)) }, a);
|
|
781
781
|
}
|
|
782
782
|
function v(e, a) {
|
|
783
783
|
var t, r, i, n;
|
|
784
784
|
switch (e.type) {
|
|
785
785
|
case "sequence":
|
|
786
|
-
return /* @__PURE__ */ l(
|
|
786
|
+
return /* @__PURE__ */ l(lt, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((s, c) => v(s, c)) }, a);
|
|
787
787
|
case "group":
|
|
788
788
|
return /* @__PURE__ */ l(
|
|
789
|
-
|
|
789
|
+
ct,
|
|
790
790
|
{
|
|
791
791
|
fadeIn: e.fadeIn,
|
|
792
792
|
fadeOut: e.fadeOut,
|
|
793
|
-
easing:
|
|
793
|
+
easing: o(e.easing),
|
|
794
794
|
rotation: e.rotation,
|
|
795
795
|
rotationOrigin: e.rotationOrigin,
|
|
796
796
|
scale: e.scale,
|
|
@@ -802,7 +802,7 @@ function v(e, a) {
|
|
|
802
802
|
);
|
|
803
803
|
case "bezierCurve":
|
|
804
804
|
return /* @__PURE__ */ l(
|
|
805
|
-
|
|
805
|
+
st,
|
|
806
806
|
{
|
|
807
807
|
x1: e.x1,
|
|
808
808
|
y1: e.y1,
|
|
@@ -820,7 +820,7 @@ function v(e, a) {
|
|
|
820
820
|
fadeIn: e.fadeIn,
|
|
821
821
|
fadeOut: e.fadeOut,
|
|
822
822
|
draw: e.draw,
|
|
823
|
-
easing:
|
|
823
|
+
easing: o(e.easing),
|
|
824
824
|
rotation: e.rotation,
|
|
825
825
|
rotationOrigin: e.rotationOrigin,
|
|
826
826
|
scale: e.scale,
|
|
@@ -831,7 +831,7 @@ function v(e, a) {
|
|
|
831
831
|
);
|
|
832
832
|
case "circle":
|
|
833
833
|
return /* @__PURE__ */ l(
|
|
834
|
-
|
|
834
|
+
nt,
|
|
835
835
|
{
|
|
836
836
|
cx: e.cx,
|
|
837
837
|
cy: e.cy,
|
|
@@ -843,7 +843,7 @@ function v(e, a) {
|
|
|
843
843
|
fadeIn: e.fadeIn,
|
|
844
844
|
fadeOut: e.fadeOut,
|
|
845
845
|
draw: e.draw,
|
|
846
|
-
easing:
|
|
846
|
+
easing: o(e.easing),
|
|
847
847
|
rotation: e.rotation,
|
|
848
848
|
rotationOrigin: e.rotationOrigin,
|
|
849
849
|
scale: e.scale,
|
|
@@ -854,7 +854,7 @@ function v(e, a) {
|
|
|
854
854
|
);
|
|
855
855
|
case "line":
|
|
856
856
|
return /* @__PURE__ */ l(
|
|
857
|
-
|
|
857
|
+
it,
|
|
858
858
|
{
|
|
859
859
|
x1: e.x1,
|
|
860
860
|
y1: e.y1,
|
|
@@ -867,7 +867,7 @@ function v(e, a) {
|
|
|
867
867
|
fadeIn: e.fadeIn,
|
|
868
868
|
fadeOut: e.fadeOut,
|
|
869
869
|
draw: e.draw,
|
|
870
|
-
easing:
|
|
870
|
+
easing: o(e.easing),
|
|
871
871
|
rotation: e.rotation,
|
|
872
872
|
rotationOrigin: e.rotationOrigin,
|
|
873
873
|
scale: e.scale,
|
|
@@ -878,7 +878,7 @@ function v(e, a) {
|
|
|
878
878
|
);
|
|
879
879
|
case "arrow":
|
|
880
880
|
return /* @__PURE__ */ l(
|
|
881
|
-
|
|
881
|
+
rt,
|
|
882
882
|
{
|
|
883
883
|
x1: e.x1,
|
|
884
884
|
y1: e.y1,
|
|
@@ -892,7 +892,7 @@ function v(e, a) {
|
|
|
892
892
|
fadeIn: e.fadeIn,
|
|
893
893
|
fadeOut: e.fadeOut,
|
|
894
894
|
draw: e.draw,
|
|
895
|
-
easing:
|
|
895
|
+
easing: o(e.easing),
|
|
896
896
|
rotation: e.rotation,
|
|
897
897
|
rotationOrigin: e.rotationOrigin,
|
|
898
898
|
scale: e.scale,
|
|
@@ -903,7 +903,7 @@ function v(e, a) {
|
|
|
903
903
|
);
|
|
904
904
|
case "rect":
|
|
905
905
|
return /* @__PURE__ */ l(
|
|
906
|
-
|
|
906
|
+
at,
|
|
907
907
|
{
|
|
908
908
|
x: e.x,
|
|
909
909
|
y: e.y,
|
|
@@ -919,7 +919,7 @@ function v(e, a) {
|
|
|
919
919
|
fadeIn: e.fadeIn,
|
|
920
920
|
fadeOut: e.fadeOut,
|
|
921
921
|
draw: e.draw,
|
|
922
|
-
easing:
|
|
922
|
+
easing: o(e.easing),
|
|
923
923
|
rotation: e.rotation,
|
|
924
924
|
rotationOrigin: e.rotationOrigin,
|
|
925
925
|
scale: e.scale,
|
|
@@ -930,7 +930,7 @@ function v(e, a) {
|
|
|
930
930
|
);
|
|
931
931
|
case "polygon":
|
|
932
932
|
return /* @__PURE__ */ l(
|
|
933
|
-
|
|
933
|
+
tt,
|
|
934
934
|
{
|
|
935
935
|
points: e.points,
|
|
936
936
|
fill: u(e.fill),
|
|
@@ -941,7 +941,7 @@ function v(e, a) {
|
|
|
941
941
|
fadeIn: e.fadeIn,
|
|
942
942
|
fadeOut: e.fadeOut,
|
|
943
943
|
draw: e.draw,
|
|
944
|
-
easing:
|
|
944
|
+
easing: o(e.easing),
|
|
945
945
|
rotation: e.rotation,
|
|
946
946
|
rotationOrigin: e.rotationOrigin,
|
|
947
947
|
scale: e.scale,
|
|
@@ -965,7 +965,7 @@ function v(e, a) {
|
|
|
965
965
|
opacity: e.opacity,
|
|
966
966
|
fadeIn: e.fadeIn,
|
|
967
967
|
fadeOut: e.fadeOut,
|
|
968
|
-
easing:
|
|
968
|
+
easing: o(e.easing),
|
|
969
969
|
rotation: e.rotation,
|
|
970
970
|
rotationOrigin: e.rotationOrigin,
|
|
971
971
|
scale: e.scale,
|
|
@@ -977,7 +977,7 @@ function v(e, a) {
|
|
|
977
977
|
);
|
|
978
978
|
case "image":
|
|
979
979
|
return /* @__PURE__ */ l(
|
|
980
|
-
|
|
980
|
+
et,
|
|
981
981
|
{
|
|
982
982
|
src: e.src,
|
|
983
983
|
x: e.x,
|
|
@@ -990,7 +990,7 @@ function v(e, a) {
|
|
|
990
990
|
opacity: e.opacity,
|
|
991
991
|
fadeIn: e.fadeIn,
|
|
992
992
|
fadeOut: e.fadeOut,
|
|
993
|
-
easing:
|
|
993
|
+
easing: o(e.easing),
|
|
994
994
|
rotation: e.rotation,
|
|
995
995
|
rotationOrigin: e.rotationOrigin,
|
|
996
996
|
scale: e.scale,
|
|
@@ -1001,7 +1001,7 @@ function v(e, a) {
|
|
|
1001
1001
|
);
|
|
1002
1002
|
case "axes":
|
|
1003
1003
|
return /* @__PURE__ */ l(
|
|
1004
|
-
|
|
1004
|
+
Ze,
|
|
1005
1005
|
{
|
|
1006
1006
|
domain: e.domain,
|
|
1007
1007
|
range: e.range,
|
|
@@ -1018,7 +1018,7 @@ function v(e, a) {
|
|
|
1018
1018
|
fadeIn: e.fadeIn,
|
|
1019
1019
|
fadeOut: e.fadeOut,
|
|
1020
1020
|
draw: e.draw,
|
|
1021
|
-
easing:
|
|
1021
|
+
easing: o(e.easing),
|
|
1022
1022
|
rotation: e.rotation,
|
|
1023
1023
|
rotationOrigin: e.rotationOrigin,
|
|
1024
1024
|
translate: e.translate,
|
|
@@ -1029,7 +1029,7 @@ function v(e, a) {
|
|
|
1029
1029
|
case "functionPlot": {
|
|
1030
1030
|
let s;
|
|
1031
1031
|
try {
|
|
1032
|
-
s =
|
|
1032
|
+
s = mt(e.fn);
|
|
1033
1033
|
} catch {
|
|
1034
1034
|
return /* @__PURE__ */ l(
|
|
1035
1035
|
j,
|
|
@@ -1045,7 +1045,7 @@ function v(e, a) {
|
|
|
1045
1045
|
);
|
|
1046
1046
|
}
|
|
1047
1047
|
return /* @__PURE__ */ l(
|
|
1048
|
-
|
|
1048
|
+
Ye,
|
|
1049
1049
|
{
|
|
1050
1050
|
fn: (c) => s({ x: c }),
|
|
1051
1051
|
domain: e.domain,
|
|
@@ -1056,7 +1056,7 @@ function v(e, a) {
|
|
|
1056
1056
|
strokeWidth: e.strokeWidth,
|
|
1057
1057
|
samples: e.samples,
|
|
1058
1058
|
draw: e.draw,
|
|
1059
|
-
easing:
|
|
1059
|
+
easing: o(e.easing),
|
|
1060
1060
|
opacity: e.opacity,
|
|
1061
1061
|
rotation: e.rotation,
|
|
1062
1062
|
rotationOrigin: e.rotationOrigin,
|
|
@@ -1068,7 +1068,7 @@ function v(e, a) {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
case "vector":
|
|
1070
1070
|
return /* @__PURE__ */ l(
|
|
1071
|
-
|
|
1071
|
+
Je,
|
|
1072
1072
|
{
|
|
1073
1073
|
from: e.from,
|
|
1074
1074
|
to: e.to,
|
|
@@ -1084,7 +1084,7 @@ function v(e, a) {
|
|
|
1084
1084
|
fadeIn: e.fadeIn,
|
|
1085
1085
|
fadeOut: e.fadeOut,
|
|
1086
1086
|
draw: e.draw,
|
|
1087
|
-
easing:
|
|
1087
|
+
easing: o(e.easing),
|
|
1088
1088
|
rotation: e.rotation,
|
|
1089
1089
|
rotationOrigin: e.rotationOrigin,
|
|
1090
1090
|
translate: e.translate,
|
|
@@ -1095,7 +1095,7 @@ function v(e, a) {
|
|
|
1095
1095
|
case "vectorField": {
|
|
1096
1096
|
let s;
|
|
1097
1097
|
try {
|
|
1098
|
-
s =
|
|
1098
|
+
s = yt(e.fn);
|
|
1099
1099
|
} catch {
|
|
1100
1100
|
return /* @__PURE__ */ l(
|
|
1101
1101
|
j,
|
|
@@ -1111,7 +1111,7 @@ function v(e, a) {
|
|
|
1111
1111
|
);
|
|
1112
1112
|
}
|
|
1113
1113
|
return /* @__PURE__ */ l(
|
|
1114
|
-
|
|
1114
|
+
Xe,
|
|
1115
1115
|
{
|
|
1116
1116
|
fn: (c, x) => s({ x: c, y: x }),
|
|
1117
1117
|
domain: e.domain,
|
|
@@ -1127,7 +1127,7 @@ function v(e, a) {
|
|
|
1127
1127
|
maxLength: e.maxLength,
|
|
1128
1128
|
fadeIn: e.fadeIn,
|
|
1129
1129
|
fadeOut: e.fadeOut,
|
|
1130
|
-
easing:
|
|
1130
|
+
easing: o(e.easing),
|
|
1131
1131
|
rotation: e.rotation,
|
|
1132
1132
|
rotationOrigin: e.rotationOrigin,
|
|
1133
1133
|
translate: e.translate,
|
|
@@ -1138,7 +1138,7 @@ function v(e, a) {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
case "matrix":
|
|
1140
1140
|
return /* @__PURE__ */ l(
|
|
1141
|
-
|
|
1141
|
+
Qe,
|
|
1142
1142
|
{
|
|
1143
1143
|
values: e.values,
|
|
1144
1144
|
x: e.x,
|
|
@@ -1149,7 +1149,7 @@ function v(e, a) {
|
|
|
1149
1149
|
fontSize: e.fontSize,
|
|
1150
1150
|
fadeIn: e.fadeIn,
|
|
1151
1151
|
fadeOut: e.fadeOut,
|
|
1152
|
-
easing:
|
|
1152
|
+
easing: o(e.easing),
|
|
1153
1153
|
rotation: e.rotation,
|
|
1154
1154
|
rotationOrigin: e.rotationOrigin,
|
|
1155
1155
|
scale: e.scale,
|
|
@@ -1160,7 +1160,7 @@ function v(e, a) {
|
|
|
1160
1160
|
);
|
|
1161
1161
|
case "graph":
|
|
1162
1162
|
return /* @__PURE__ */ l(
|
|
1163
|
-
|
|
1163
|
+
Ke,
|
|
1164
1164
|
{
|
|
1165
1165
|
nodes: e.nodes,
|
|
1166
1166
|
edges: e.edges,
|
|
@@ -1172,7 +1172,7 @@ function v(e, a) {
|
|
|
1172
1172
|
labelFontSize: e.labelFontSize,
|
|
1173
1173
|
fadeIn: e.fadeIn,
|
|
1174
1174
|
fadeOut: e.fadeOut,
|
|
1175
|
-
easing:
|
|
1175
|
+
easing: o(e.easing),
|
|
1176
1176
|
rotation: e.rotation,
|
|
1177
1177
|
rotationOrigin: e.rotationOrigin,
|
|
1178
1178
|
scale: e.scale,
|
|
@@ -1183,7 +1183,7 @@ function v(e, a) {
|
|
|
1183
1183
|
);
|
|
1184
1184
|
case "latex":
|
|
1185
1185
|
return /* @__PURE__ */ l(
|
|
1186
|
-
|
|
1186
|
+
He,
|
|
1187
1187
|
{
|
|
1188
1188
|
expression: e.expression,
|
|
1189
1189
|
x: e.x,
|
|
@@ -1193,7 +1193,7 @@ function v(e, a) {
|
|
|
1193
1193
|
align: e.align,
|
|
1194
1194
|
fadeIn: e.fadeIn,
|
|
1195
1195
|
fadeOut: e.fadeOut,
|
|
1196
|
-
easing:
|
|
1196
|
+
easing: o(e.easing),
|
|
1197
1197
|
rotation: e.rotation,
|
|
1198
1198
|
rotationOrigin: e.rotationOrigin,
|
|
1199
1199
|
scale: e.scale,
|
|
@@ -1204,7 +1204,7 @@ function v(e, a) {
|
|
|
1204
1204
|
);
|
|
1205
1205
|
case "barChart":
|
|
1206
1206
|
return /* @__PURE__ */ l(
|
|
1207
|
-
|
|
1207
|
+
Ge,
|
|
1208
1208
|
{
|
|
1209
1209
|
bars: e.bars,
|
|
1210
1210
|
x: e.x,
|
|
@@ -1220,7 +1220,7 @@ function v(e, a) {
|
|
|
1220
1220
|
valueFormat: e.valueFormat,
|
|
1221
1221
|
fadeIn: e.fadeIn,
|
|
1222
1222
|
fadeOut: e.fadeOut,
|
|
1223
|
-
easing:
|
|
1223
|
+
easing: o(e.easing),
|
|
1224
1224
|
rotation: e.rotation,
|
|
1225
1225
|
rotationOrigin: e.rotationOrigin,
|
|
1226
1226
|
scale: e.scale,
|
|
@@ -1230,19 +1230,19 @@ function v(e, a) {
|
|
|
1230
1230
|
a
|
|
1231
1231
|
);
|
|
1232
1232
|
case "fadeIn":
|
|
1233
|
-
return /* @__PURE__ */ l(
|
|
1233
|
+
return /* @__PURE__ */ l(Ue, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1234
1234
|
case "fadeOut":
|
|
1235
|
-
return /* @__PURE__ */ l(
|
|
1235
|
+
return /* @__PURE__ */ l(qe, { duration: e.duration, totalFrames: e.totalFrames, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1236
1236
|
case "draw":
|
|
1237
|
-
return /* @__PURE__ */ l(
|
|
1237
|
+
return /* @__PURE__ */ l(Be, { duration: e.duration, pathLength: e.pathLength, easing: o(e.easing), children: v(e.children[0], 0) }, a);
|
|
1238
1238
|
case "write":
|
|
1239
|
-
return /* @__PURE__ */ l(
|
|
1239
|
+
return /* @__PURE__ */ l(je, { duration: e.duration, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1240
1240
|
case "transform":
|
|
1241
1241
|
return /* @__PURE__ */ l(
|
|
1242
|
-
|
|
1242
|
+
Le,
|
|
1243
1243
|
{
|
|
1244
1244
|
duration: e.duration,
|
|
1245
|
-
easing:
|
|
1245
|
+
easing: o(e.easing),
|
|
1246
1246
|
translate: e.translate,
|
|
1247
1247
|
scale: e.scale,
|
|
1248
1248
|
rotate: e.rotate,
|
|
@@ -1253,10 +1253,10 @@ function v(e, a) {
|
|
|
1253
1253
|
);
|
|
1254
1254
|
case "morph":
|
|
1255
1255
|
return /* @__PURE__ */ l(
|
|
1256
|
-
|
|
1256
|
+
Ve,
|
|
1257
1257
|
{
|
|
1258
1258
|
duration: e.duration,
|
|
1259
|
-
easing:
|
|
1259
|
+
easing: o(e.easing),
|
|
1260
1260
|
fromColor: u(e.fromColor),
|
|
1261
1261
|
toColor: u(e.toColor),
|
|
1262
1262
|
fromOpacity: e.fromOpacity,
|
|
@@ -1268,18 +1268,18 @@ function v(e, a) {
|
|
|
1268
1268
|
a
|
|
1269
1269
|
);
|
|
1270
1270
|
case "stagger":
|
|
1271
|
-
return /* @__PURE__ */ l(
|
|
1271
|
+
return /* @__PURE__ */ l(_e, { staggerDelay: e.staggerDelay, easing: o(e.easing), children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1272
1272
|
case "parallel":
|
|
1273
|
-
return /* @__PURE__ */ l(
|
|
1273
|
+
return /* @__PURE__ */ l(De, { children: e.children.map((s, c) => v(s, c)) }, a);
|
|
1274
1274
|
case "scene":
|
|
1275
|
-
return /* @__PURE__ */ l(
|
|
1275
|
+
return /* @__PURE__ */ l(X.Fragment, { children: H(e) }, a);
|
|
1276
1276
|
case "player":
|
|
1277
|
-
return /* @__PURE__ */ l(
|
|
1277
|
+
return /* @__PURE__ */ l(X.Fragment, { children: ue(e) }, a);
|
|
1278
1278
|
default:
|
|
1279
1279
|
return null;
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
-
const
|
|
1282
|
+
const fe = {
|
|
1283
1283
|
background: "#0a0a1e",
|
|
1284
1284
|
title: "#e0e7ff",
|
|
1285
1285
|
subtitle: "#94a3b8",
|
|
@@ -1294,7 +1294,7 @@ const ue = {
|
|
|
1294
1294
|
warning: "#fbbf24",
|
|
1295
1295
|
error: "#f87171",
|
|
1296
1296
|
palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
|
|
1297
|
-
},
|
|
1297
|
+
}, Kt = {
|
|
1298
1298
|
background: "#f8fafc",
|
|
1299
1299
|
title: "#1e293b",
|
|
1300
1300
|
subtitle: "#64748b",
|
|
@@ -1310,7 +1310,7 @@ const ue = {
|
|
|
1310
1310
|
error: "#dc2626",
|
|
1311
1311
|
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1312
1312
|
};
|
|
1313
|
-
function
|
|
1313
|
+
function Qt(e) {
|
|
1314
1314
|
if (!e) return {};
|
|
1315
1315
|
const a = {};
|
|
1316
1316
|
for (const [t, r] of Object.entries(e))
|
|
@@ -1334,85 +1334,85 @@ function he(e) {
|
|
|
1334
1334
|
"--elucim-error": e.error
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
|
-
const
|
|
1338
|
-
function
|
|
1337
|
+
const Xt = he(fe), Jt = he(Kt);
|
|
1338
|
+
function Yt(e) {
|
|
1339
1339
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {
|
|
1340
1340
|
};
|
|
1341
1341
|
const a = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1342
1342
|
return a.addEventListener("change", e), () => a.removeEventListener("change", e);
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Zt() {
|
|
1345
1345
|
return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function ea() {
|
|
1348
1348
|
return !0;
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1351
|
-
return
|
|
1350
|
+
function ta() {
|
|
1351
|
+
return ot(Yt, Zt, ea);
|
|
1352
1352
|
}
|
|
1353
|
-
const ga =
|
|
1354
|
-
const m =
|
|
1353
|
+
const ga = ut(function({ dsl: a, className: t, style: r, theme: i, colorScheme: n, poster: s, onError: c }, x) {
|
|
1354
|
+
const m = ft(null), k = ta();
|
|
1355
1355
|
ht(x, () => ({
|
|
1356
1356
|
getSvgElement: () => {
|
|
1357
|
-
var
|
|
1358
|
-
return ((
|
|
1357
|
+
var h;
|
|
1358
|
+
return ((h = m.current) == null ? void 0 : h.getSvgElement()) ?? null;
|
|
1359
1359
|
},
|
|
1360
|
-
seekToFrame: (
|
|
1360
|
+
seekToFrame: (h) => {
|
|
1361
1361
|
var C;
|
|
1362
|
-
return (C = m.current) == null ? void 0 : C.seekToFrame(
|
|
1362
|
+
return (C = m.current) == null ? void 0 : C.seekToFrame(h);
|
|
1363
1363
|
},
|
|
1364
1364
|
getTotalFrames: () => {
|
|
1365
|
-
var
|
|
1366
|
-
return ((
|
|
1365
|
+
var h;
|
|
1366
|
+
return ((h = m.current) == null ? void 0 : h.getTotalFrames()) ?? 0;
|
|
1367
1367
|
},
|
|
1368
1368
|
play: () => {
|
|
1369
|
-
var
|
|
1370
|
-
return (
|
|
1369
|
+
var h;
|
|
1370
|
+
return (h = m.current) == null ? void 0 : h.play();
|
|
1371
1371
|
},
|
|
1372
1372
|
pause: () => {
|
|
1373
|
-
var
|
|
1374
|
-
return (
|
|
1373
|
+
var h;
|
|
1374
|
+
return (h = m.current) == null ? void 0 : h.pause();
|
|
1375
1375
|
},
|
|
1376
1376
|
isPlaying: () => {
|
|
1377
|
-
var
|
|
1378
|
-
return ((
|
|
1377
|
+
var h;
|
|
1378
|
+
return ((h = m.current) == null ? void 0 : h.isPlaying()) ?? !1;
|
|
1379
1379
|
}
|
|
1380
1380
|
}));
|
|
1381
1381
|
const y = re(a);
|
|
1382
1382
|
if (!y.valid) {
|
|
1383
|
-
const
|
|
1384
|
-
c == null || c(
|
|
1383
|
+
const h = y.errors.filter((I) => I.severity === "error").map((I) => ({ path: I.path, message: I.message }));
|
|
1384
|
+
c == null || c(h);
|
|
1385
1385
|
const C = /* @__PURE__ */ new Map();
|
|
1386
|
-
for (const I of
|
|
1387
|
-
const
|
|
1386
|
+
for (const I of h) {
|
|
1387
|
+
const M = I.path.split("."), N = M.length > 1 ? M.slice(0, -1).join(".") : I.path, D = C.get(N) ?? [];
|
|
1388
1388
|
D.push(I), C.set(N, D);
|
|
1389
1389
|
}
|
|
1390
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ P(
|
|
1391
1391
|
"div",
|
|
1392
1392
|
{
|
|
1393
1393
|
className: t,
|
|
1394
1394
|
style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, fontSize: 13, ...r },
|
|
1395
1395
|
"data-testid": "dsl-error",
|
|
1396
1396
|
children: [
|
|
1397
|
-
/* @__PURE__ */
|
|
1397
|
+
/* @__PURE__ */ P("strong", { children: [
|
|
1398
1398
|
"Elucim DSL Validation Errors (",
|
|
1399
|
-
|
|
1399
|
+
h.length,
|
|
1400
1400
|
"):"
|
|
1401
1401
|
] }),
|
|
1402
|
-
[...C.entries()].map(([I,
|
|
1403
|
-
/* @__PURE__ */
|
|
1402
|
+
[...C.entries()].map(([I, M]) => /* @__PURE__ */ P("details", { open: !0, style: { marginTop: 8 }, children: [
|
|
1403
|
+
/* @__PURE__ */ P("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: [
|
|
1404
1404
|
I,
|
|
1405
1405
|
" (",
|
|
1406
|
-
|
|
1406
|
+
M.length,
|
|
1407
1407
|
")"
|
|
1408
1408
|
] }),
|
|
1409
|
-
/* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children:
|
|
1409
|
+
/* @__PURE__ */ l("ul", { style: { margin: "4px 0", paddingLeft: 20 }, children: M.map((N, D) => /* @__PURE__ */ P("li", { children: [
|
|
1410
1410
|
/* @__PURE__ */ l("code", { style: { color: "#ffa07a" }, children: N.path }),
|
|
1411
1411
|
": ",
|
|
1412
1412
|
N.message
|
|
1413
1413
|
] }, D)) })
|
|
1414
1414
|
] }, I)),
|
|
1415
|
-
/* @__PURE__ */
|
|
1415
|
+
/* @__PURE__ */ P("details", { style: { marginTop: 12 }, children: [
|
|
1416
1416
|
/* @__PURE__ */ l("summary", { style: { cursor: "pointer", opacity: 0.7 }, children: "Raw JSON" }),
|
|
1417
1417
|
/* @__PURE__ */ l("pre", { style: { fontSize: 11, maxHeight: 300, overflow: "auto", marginTop: 4, padding: 8, background: "rgba(0,0,0,0.3)", borderRadius: 4 }, children: JSON.stringify(a, null, 2) })
|
|
1418
1418
|
] })
|
|
@@ -1420,17 +1420,17 @@ const ga = lt(function({ dsl: a, className: t, style: r, theme: i, colorScheme:
|
|
|
1420
1420
|
}
|
|
1421
1421
|
);
|
|
1422
1422
|
}
|
|
1423
|
-
const
|
|
1423
|
+
const g = Qt(i);
|
|
1424
1424
|
let d = {};
|
|
1425
|
-
n && (d = (n === "auto" ? k : n === "dark") ?
|
|
1426
|
-
const $ = s !== void 0 ?
|
|
1427
|
-
return /* @__PURE__ */ l("div", { className: t, style: { ...d, ...
|
|
1425
|
+
n && (d = (n === "auto" ? k : n === "dark") ? Xt : Jt);
|
|
1426
|
+
const $ = s !== void 0 ? aa(s, a) : void 0, O = n ? n === "auto" ? k ? "dark" : "light" : n : void 0;
|
|
1427
|
+
return /* @__PURE__ */ l("div", { className: t, style: { ...d, ...g, ...r }, "data-testid": "dsl-root", children: le(a.root, {
|
|
1428
1428
|
frame: $ == null ? void 0 : $.frame,
|
|
1429
1429
|
playerRef: m,
|
|
1430
1430
|
colorScheme: O
|
|
1431
1431
|
}) });
|
|
1432
1432
|
});
|
|
1433
|
-
function
|
|
1433
|
+
function aa(e, a) {
|
|
1434
1434
|
if (e === "first") return { frame: 0 };
|
|
1435
1435
|
if (e === "last") {
|
|
1436
1436
|
const r = a.root.durationInFrames ?? 1;
|
|
@@ -1438,7 +1438,7 @@ function ta(e, a) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
return { frame: e };
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function ra(e, a, t) {
|
|
1442
1442
|
const r = re(e);
|
|
1443
1443
|
if (!r.valid) {
|
|
1444
1444
|
const s = r.errors.filter((c) => c.severity === "error");
|
|
@@ -1450,11 +1450,18 @@ ${s.map((c) => ` ${c.path}: ${c.message}`).join(`
|
|
|
1450
1450
|
}
|
|
1451
1451
|
const i = { ...e.root };
|
|
1452
1452
|
t != null && t.width && (i.width = t.width), t != null && t.height && (i.height = t.height);
|
|
1453
|
-
const n =
|
|
1453
|
+
const n = le(i, { frame: a });
|
|
1454
1454
|
return gt(n);
|
|
1455
1455
|
}
|
|
1456
|
-
|
|
1457
|
-
|
|
1456
|
+
function te(e) {
|
|
1457
|
+
let a;
|
|
1458
|
+
do
|
|
1459
|
+
a = e, e = e.replace(/var\(--[a-z][\w-]*,\s*([^)]+)\)/gi, "$1");
|
|
1460
|
+
while (e !== a);
|
|
1461
|
+
return e = e.replace(/var\(--[a-z][\w-]*\)/gi, "none"), e = e.replace(/light-dark\([^,]+,\s*([^)]+)\)/gi, "$1"), e;
|
|
1462
|
+
}
|
|
1463
|
+
async function ma(e, a, t) {
|
|
1464
|
+
const r = (t == null ? void 0 : t.scale) ?? 2, n = ra(e, a, {
|
|
1458
1465
|
width: t == null ? void 0 : t.width,
|
|
1459
1466
|
height: t == null ? void 0 : t.height
|
|
1460
1467
|
}).match(/<svg[\s\S]*<\/svg>/);
|
|
@@ -1463,29 +1470,24 @@ async function oa(e, a, t) {
|
|
|
1463
1470
|
let s = n[0];
|
|
1464
1471
|
const c = s.match(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/), x = (t == null ? void 0 : t.width) ?? (c ? parseFloat(c[1]) : 800), m = (t == null ? void 0 : t.height) ?? (c ? parseFloat(c[2]) : 600), k = Math.round(x * r), y = Math.round(m * r);
|
|
1465
1472
|
s = s.replace(/width="100%"/, `width="${k}"`).replace(/height="100%"/, `height="${y}"`), s.includes("xmlns=") || (s = s.replace("<svg", '<svg xmlns="http://www.w3.org/2000/svg"')), s = s.replace(/style="[^"]*position:\s*absolute[^"]*"/, "");
|
|
1466
|
-
let
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
}
|
|
1471
|
-
const d = `<rect width="${x}" height="${m}" fill="${o}"/>`;
|
|
1472
|
-
s = s.replace(/>/, `>${d}`), s = s.replace(
|
|
1473
|
-
/var\(--elucim-[\w-]+,\s*(#[0-9a-fA-F]{3,8})\)/g,
|
|
1474
|
-
"$1"
|
|
1475
|
-
), s = s.replace(
|
|
1476
|
-
/var\(--elucim-[\w-]+\)/g,
|
|
1477
|
-
"none"
|
|
1478
|
-
);
|
|
1473
|
+
let g = e.root.background ?? "#ffffff";
|
|
1474
|
+
g.startsWith("$") && (g = u(g) ?? "#ffffff"), g = te(g);
|
|
1475
|
+
const d = `<rect width="${x}" height="${m}" fill="${g}"/>`;
|
|
1476
|
+
s = s.replace(/>/, `>${d}`), s = te(s);
|
|
1479
1477
|
const O = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(s)))}`;
|
|
1480
|
-
|
|
1478
|
+
if (typeof Image < "u" && typeof document < "u")
|
|
1479
|
+
return na(O, k, y);
|
|
1480
|
+
if (typeof OffscreenCanvas < "u")
|
|
1481
|
+
return ia(O, k, y);
|
|
1482
|
+
throw new Error("renderToPng requires Image+document (browser) or OffscreenCanvas (worker)");
|
|
1481
1483
|
}
|
|
1482
|
-
async function
|
|
1484
|
+
async function ia(e, a, t) {
|
|
1483
1485
|
const i = await (await fetch(e)).blob(), n = await createImageBitmap(i, { resizeWidth: a, resizeHeight: t }), s = new OffscreenCanvas(a, t);
|
|
1484
1486
|
s.getContext("2d").drawImage(n, 0, 0, a, t), n.close();
|
|
1485
1487
|
const m = await (await s.convertToBlob({ type: "image/png" })).arrayBuffer();
|
|
1486
1488
|
return new Uint8Array(m);
|
|
1487
1489
|
}
|
|
1488
|
-
function
|
|
1490
|
+
function na(e, a, t) {
|
|
1489
1491
|
return new Promise((r, i) => {
|
|
1490
1492
|
const n = new Image();
|
|
1491
1493
|
n.onload = () => {
|
|
@@ -1500,7 +1502,7 @@ function ia(e, a, t) {
|
|
|
1500
1502
|
}, n.onerror = () => i(new Error("Failed to load SVG data URI for PNG render")), n.src = e;
|
|
1501
1503
|
});
|
|
1502
1504
|
}
|
|
1503
|
-
class
|
|
1505
|
+
class sa {
|
|
1504
1506
|
constructor(a, t = 30, r = 900, i = 640) {
|
|
1505
1507
|
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = r, this._height = i;
|
|
1506
1508
|
}
|
|
@@ -1721,12 +1723,12 @@ class na {
|
|
|
1721
1723
|
boxRow(a, t) {
|
|
1722
1724
|
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;
|
|
1723
1725
|
t == null || t.fadeIn;
|
|
1724
|
-
const m = a.map((y,
|
|
1725
|
-
const d = x +
|
|
1726
|
+
const m = a.map((y, g) => {
|
|
1727
|
+
const d = x + g * (r + n);
|
|
1726
1728
|
return { x: d, y: s, w: r, h: i, cx: d + r / 2, cy: s + i / 2 };
|
|
1727
|
-
}), k = a.map((y,
|
|
1728
|
-
var
|
|
1729
|
-
const d = m[
|
|
1729
|
+
}), k = a.map((y, g) => {
|
|
1730
|
+
var h, C;
|
|
1731
|
+
const d = m[g], $ = ((h = t == null ? void 0 : t.colors) == null ? void 0 : h[g]) ?? this.theme.boxFill, O = ((C = t == null ? void 0 : t.strokeColors) == null ? void 0 : C[g]) ?? this.theme.boxStroke;
|
|
1730
1732
|
return {
|
|
1731
1733
|
type: "group",
|
|
1732
1734
|
children: [
|
|
@@ -1767,18 +1769,18 @@ class na {
|
|
|
1767
1769
|
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;
|
|
1768
1770
|
t == null || t.fadeIn;
|
|
1769
1771
|
const x = a.map((k, y) => {
|
|
1770
|
-
const
|
|
1771
|
-
return { x: c - r / 2, y:
|
|
1772
|
+
const g = s + y * (i + n);
|
|
1773
|
+
return { x: c - r / 2, y: g, w: r, h: i, cx: c, cy: g + i / 2 };
|
|
1772
1774
|
}), m = a.map((k, y) => {
|
|
1773
1775
|
var $, O;
|
|
1774
|
-
const
|
|
1776
|
+
const g = x[y], d = (($ = t == null ? void 0 : t.colors) == null ? void 0 : $[y]) ?? this.theme.boxFill;
|
|
1775
1777
|
return {
|
|
1776
1778
|
type: "group",
|
|
1777
1779
|
children: [
|
|
1778
1780
|
{
|
|
1779
1781
|
type: "rect",
|
|
1780
|
-
x:
|
|
1781
|
-
y:
|
|
1782
|
+
x: g.x,
|
|
1783
|
+
y: g.y,
|
|
1782
1784
|
width: r,
|
|
1783
1785
|
height: i,
|
|
1784
1786
|
fill: d,
|
|
@@ -1788,8 +1790,8 @@ class na {
|
|
|
1788
1790
|
},
|
|
1789
1791
|
{
|
|
1790
1792
|
type: "text",
|
|
1791
|
-
x:
|
|
1792
|
-
y:
|
|
1793
|
+
x: g.cx,
|
|
1794
|
+
y: g.cy + 5,
|
|
1793
1795
|
content: k,
|
|
1794
1796
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1795
1797
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
@@ -1885,9 +1887,9 @@ class na {
|
|
|
1885
1887
|
return { elements: this.elements, durationInFrames: a };
|
|
1886
1888
|
}
|
|
1887
1889
|
}
|
|
1888
|
-
class
|
|
1890
|
+
class ca {
|
|
1889
1891
|
constructor(a, t, r) {
|
|
1890
|
-
this._slides = [], this._title = a, this._theme = t ??
|
|
1892
|
+
this._slides = [], this._title = a, this._theme = t ?? fe, this._opts = {
|
|
1891
1893
|
width: 900,
|
|
1892
1894
|
height: 640,
|
|
1893
1895
|
fps: 30,
|
|
@@ -1905,7 +1907,7 @@ class sa {
|
|
|
1905
1907
|
/** Build the final ElucimDocument */
|
|
1906
1908
|
build() {
|
|
1907
1909
|
const a = this._slides.map((r) => {
|
|
1908
|
-
const i = new
|
|
1910
|
+
const i = new sa(
|
|
1909
1911
|
this._theme,
|
|
1910
1912
|
this._opts.fps,
|
|
1911
1913
|
this._opts.width,
|
|
@@ -1951,30 +1953,31 @@ class sa {
|
|
|
1951
1953
|
return JSON.stringify(this.build(), null, a ? 2 : void 0);
|
|
1952
1954
|
}
|
|
1953
1955
|
}
|
|
1954
|
-
function
|
|
1955
|
-
return new
|
|
1956
|
+
function ya(e, a, t) {
|
|
1957
|
+
return new ca(e, a, t);
|
|
1956
1958
|
}
|
|
1957
1959
|
export {
|
|
1958
1960
|
ga as DslRenderer,
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1961
|
+
ca as PresentationBuilder,
|
|
1962
|
+
ce as SEMANTIC_TOKENS,
|
|
1963
|
+
sa as SlideBuilder,
|
|
1964
|
+
oa as TOKEN_NAMES,
|
|
1965
|
+
mt as compileExpression,
|
|
1966
|
+
yt as compileVectorExpression,
|
|
1967
|
+
fe as darkTheme,
|
|
1968
|
+
Kt as lightTheme,
|
|
1969
|
+
ya as presentation,
|
|
1968
1970
|
v as renderElement,
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1971
|
+
ue as renderPlayer,
|
|
1972
|
+
Gt as renderPresentation,
|
|
1973
|
+
le as renderRoot,
|
|
1972
1974
|
H as renderScene,
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1975
|
+
Ht as renderSlide,
|
|
1976
|
+
ma as renderToPng,
|
|
1977
|
+
ra as renderToSvgString,
|
|
1976
1978
|
u as resolveColor,
|
|
1977
|
-
|
|
1979
|
+
o as resolveEasing,
|
|
1980
|
+
te as stripCssFunctions,
|
|
1978
1981
|
re as validate,
|
|
1979
1982
|
ae as validateExpression
|
|
1980
1983
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elucim/dsl",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "JSON/YAML DSL for declarative Elucim animations — define visualizations without writing React code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@elucim/core": "0.8.
|
|
48
|
+
"@elucim/core": "0.8.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@testing-library/jest-dom": "^6.9.1",
|