@elucim/dsl 0.1.3 → 0.2.1
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/README.md +12 -1
- package/dist/index.d.ts +98 -1
- package/dist/index.js +672 -530
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { easeOutBounce as
|
|
1
|
+
import { easeOutBounce as J, easeOutElastic as Z, easeOutBack as ee, easeInBack as te, easeInOutExpo as ae, easeOutExpo as ie, easeInExpo as re, easeInOutSine as ne, easeOutSine as se, easeInSine as ce, easeInOutQuart as le, easeOutQuart as ue, easeInQuart as he, easeInOutCubic as fe, easeOutCubic as ge, easeInCubic as oe, easeInOutQuad as ye, easeOutQuad as me, easeInQuad as be, linear as xe, spring as ve, cubicBezier as de, Presentation as we, Player as ke, Scene as Ie, Slide as $e, Parallel as Se, Stagger as Oe, Morph as Ae, Transform as Ce, Write as ze, Draw as Ee, FadeOut as Fe, FadeIn as Pe, BarChart as Re, LaTeX as pe, Graph as Ne, Matrix as Me, VectorField as We, Vector as _e, FunctionPlot as De, Axes as Te, Image as Le, Text as je, Polygon as qe, Rect as Be, Arrow as Ue, Line as Ve, Circle as He, Group as Ge, Sequence as Qe } from "@elucim/core";
|
|
2
2
|
import { jsxs as L, jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import j from "react";
|
|
4
|
+
const N = {
|
|
5
5
|
sin: Math.sin,
|
|
6
6
|
cos: Math.cos,
|
|
7
7
|
tan: Math.tan,
|
|
8
8
|
asin: Math.asin,
|
|
9
9
|
acos: Math.acos,
|
|
10
10
|
atan: Math.atan,
|
|
11
|
-
atan2: (e,
|
|
11
|
+
atan2: (e, a) => Math.atan2(e, a),
|
|
12
12
|
sqrt: Math.sqrt,
|
|
13
13
|
abs: Math.abs,
|
|
14
14
|
log: Math.log10,
|
|
@@ -21,133 +21,133 @@ const M = {
|
|
|
21
21
|
max: (...e) => Math.max(...e),
|
|
22
22
|
sign: Math.sign,
|
|
23
23
|
pow: Math.pow
|
|
24
|
-
},
|
|
24
|
+
}, q = {
|
|
25
25
|
PI: Math.PI,
|
|
26
26
|
E: Math.E,
|
|
27
27
|
TAU: Math.PI * 2
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
const
|
|
29
|
+
function W(e) {
|
|
30
|
+
const a = [];
|
|
31
31
|
let t = 0;
|
|
32
32
|
for (; t < e.length; ) {
|
|
33
|
-
const
|
|
34
|
-
if (/\s/.test(
|
|
33
|
+
const i = e[t];
|
|
34
|
+
if (/\s/.test(i)) {
|
|
35
35
|
t++;
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
|
-
if (/[0-9]/.test(
|
|
38
|
+
if (/[0-9]/.test(i) || i === "." && t + 1 < e.length && /[0-9]/.test(e[t + 1])) {
|
|
39
39
|
let n = "";
|
|
40
|
-
const
|
|
40
|
+
const u = t;
|
|
41
41
|
for (; t < e.length && /[0-9.]/.test(e[t]); )
|
|
42
42
|
n += e[t++];
|
|
43
|
-
|
|
43
|
+
a.push({ type: "NUMBER", value: n, pos: u });
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
|
-
if (/[a-zA-Z_]/.test(
|
|
46
|
+
if (/[a-zA-Z_]/.test(i)) {
|
|
47
47
|
let n = "";
|
|
48
|
-
const
|
|
48
|
+
const u = t;
|
|
49
49
|
for (; t < e.length && /[a-zA-Z0-9_]/.test(e[t]); )
|
|
50
50
|
n += e[t++];
|
|
51
|
-
|
|
51
|
+
a.push({ type: "IDENT", value: n, pos: u });
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
switch (t++,
|
|
54
|
+
const r = t;
|
|
55
|
+
switch (t++, i) {
|
|
56
56
|
case "+":
|
|
57
|
-
|
|
57
|
+
a.push({ type: "PLUS", value: "+", pos: r });
|
|
58
58
|
break;
|
|
59
59
|
case "-":
|
|
60
|
-
|
|
60
|
+
a.push({ type: "MINUS", value: "-", pos: r });
|
|
61
61
|
break;
|
|
62
62
|
case "*":
|
|
63
|
-
|
|
63
|
+
a.push({ type: "STAR", value: "*", pos: r });
|
|
64
64
|
break;
|
|
65
65
|
case "/":
|
|
66
|
-
|
|
66
|
+
a.push({ type: "SLASH", value: "/", pos: r });
|
|
67
67
|
break;
|
|
68
68
|
case "^":
|
|
69
|
-
|
|
69
|
+
a.push({ type: "CARET", value: "^", pos: r });
|
|
70
70
|
break;
|
|
71
71
|
case "(":
|
|
72
|
-
|
|
72
|
+
a.push({ type: "LPAREN", value: "(", pos: r });
|
|
73
73
|
break;
|
|
74
74
|
case ")":
|
|
75
|
-
|
|
75
|
+
a.push({ type: "RPAREN", value: ")", pos: r });
|
|
76
76
|
break;
|
|
77
77
|
case "[":
|
|
78
|
-
|
|
78
|
+
a.push({ type: "LBRACKET", value: "[", pos: r });
|
|
79
79
|
break;
|
|
80
80
|
case "]":
|
|
81
|
-
|
|
81
|
+
a.push({ type: "RBRACKET", value: "]", pos: r });
|
|
82
82
|
break;
|
|
83
83
|
case ",":
|
|
84
|
-
|
|
84
|
+
a.push({ type: "COMMA", value: ",", pos: r });
|
|
85
85
|
break;
|
|
86
86
|
default:
|
|
87
|
-
throw new
|
|
87
|
+
throw new x(`Unexpected character '${i}'`, r);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return a.push({ type: "EOF", value: "", pos: t }), a;
|
|
91
91
|
}
|
|
92
|
-
class
|
|
93
|
-
constructor(
|
|
94
|
-
this.pos = 0, this.tokens =
|
|
92
|
+
class _ {
|
|
93
|
+
constructor(a) {
|
|
94
|
+
this.pos = 0, this.tokens = a;
|
|
95
95
|
}
|
|
96
96
|
peek() {
|
|
97
97
|
return this.tokens[this.pos];
|
|
98
98
|
}
|
|
99
99
|
advance() {
|
|
100
|
-
const
|
|
101
|
-
return this.pos++,
|
|
100
|
+
const a = this.tokens[this.pos];
|
|
101
|
+
return this.pos++, a;
|
|
102
102
|
}
|
|
103
|
-
expect(
|
|
103
|
+
expect(a) {
|
|
104
104
|
const t = this.peek();
|
|
105
|
-
if (t.type !==
|
|
106
|
-
throw new
|
|
107
|
-
`Expected ${
|
|
105
|
+
if (t.type !== a)
|
|
106
|
+
throw new x(
|
|
107
|
+
`Expected ${a} but got ${t.type} ('${t.value}')`,
|
|
108
108
|
t.pos
|
|
109
109
|
);
|
|
110
110
|
return this.advance();
|
|
111
111
|
}
|
|
112
112
|
// Entry point
|
|
113
113
|
parse() {
|
|
114
|
-
const
|
|
114
|
+
const a = this.parseExpression();
|
|
115
115
|
if (this.peek().type !== "EOF") {
|
|
116
116
|
const t = this.peek();
|
|
117
|
-
throw new
|
|
117
|
+
throw new x(
|
|
118
118
|
`Unexpected token '${t.value}' after expression`,
|
|
119
119
|
t.pos
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return a;
|
|
123
123
|
}
|
|
124
124
|
// expression = term (('+' | '-') term)*
|
|
125
125
|
parseExpression() {
|
|
126
|
-
let
|
|
126
|
+
let a = this.parseTerm();
|
|
127
127
|
for (; this.peek().type === "PLUS" || this.peek().type === "MINUS"; ) {
|
|
128
|
-
const t = this.advance().value,
|
|
129
|
-
|
|
128
|
+
const t = this.advance().value, i = this.parseTerm();
|
|
129
|
+
a = { kind: "binary", op: t, left: a, right: i };
|
|
130
130
|
}
|
|
131
|
-
return
|
|
131
|
+
return a;
|
|
132
132
|
}
|
|
133
133
|
// term = power (('*' | '/') power)*
|
|
134
134
|
parseTerm() {
|
|
135
|
-
let
|
|
135
|
+
let a = this.parsePower();
|
|
136
136
|
for (; this.peek().type === "STAR" || this.peek().type === "SLASH"; ) {
|
|
137
|
-
const t = this.advance().value,
|
|
138
|
-
|
|
137
|
+
const t = this.advance().value, i = this.parsePower();
|
|
138
|
+
a = { kind: "binary", op: t, left: a, right: i };
|
|
139
139
|
}
|
|
140
|
-
return
|
|
140
|
+
return a;
|
|
141
141
|
}
|
|
142
142
|
// power = unary ('^' power)? (right-associative)
|
|
143
143
|
parsePower() {
|
|
144
|
-
const
|
|
144
|
+
const a = this.parseUnary();
|
|
145
145
|
if (this.peek().type === "CARET") {
|
|
146
146
|
this.advance();
|
|
147
147
|
const t = this.parsePower();
|
|
148
|
-
return { kind: "binary", op: "^", left:
|
|
148
|
+
return { kind: "binary", op: "^", left: a, right: t };
|
|
149
149
|
}
|
|
150
|
-
return
|
|
150
|
+
return a;
|
|
151
151
|
}
|
|
152
152
|
// unary = ('+' | '-') unary | primary
|
|
153
153
|
parseUnary() {
|
|
@@ -155,33 +155,33 @@ class R {
|
|
|
155
155
|
}
|
|
156
156
|
// primary = NUMBER | IDENT ('(' args ')')? | '(' expression ')' | '[' elements ']'
|
|
157
157
|
parsePrimary() {
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
return this.advance(), { kind: "number", value: parseFloat(
|
|
161
|
-
if (
|
|
158
|
+
const a = this.peek();
|
|
159
|
+
if (a.type === "NUMBER")
|
|
160
|
+
return this.advance(), { kind: "number", value: parseFloat(a.value) };
|
|
161
|
+
if (a.type === "IDENT") {
|
|
162
162
|
this.advance();
|
|
163
|
-
const t =
|
|
163
|
+
const t = a.value;
|
|
164
164
|
if (this.peek().type === "LPAREN") {
|
|
165
165
|
this.advance();
|
|
166
|
-
const
|
|
166
|
+
const i = [];
|
|
167
167
|
if (this.peek().type !== "RPAREN")
|
|
168
|
-
for (
|
|
169
|
-
this.advance(),
|
|
170
|
-
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(
|
|
171
|
-
throw new
|
|
172
|
-
`Unknown function '${t}'. Available: ${Object.keys(
|
|
173
|
-
|
|
168
|
+
for (i.push(this.parseExpression()); this.peek().type === "COMMA"; )
|
|
169
|
+
this.advance(), i.push(this.parseExpression());
|
|
170
|
+
if (this.expect("RPAREN"), !Object.prototype.hasOwnProperty.call(N, t))
|
|
171
|
+
throw new x(
|
|
172
|
+
`Unknown function '${t}'. Available: ${Object.keys(N).join(", ")}`,
|
|
173
|
+
a.pos
|
|
174
174
|
);
|
|
175
|
-
return { kind: "call", name: t, args:
|
|
175
|
+
return { kind: "call", name: t, args: i };
|
|
176
176
|
}
|
|
177
|
-
return Object.prototype.hasOwnProperty.call(
|
|
177
|
+
return Object.prototype.hasOwnProperty.call(q, t) ? { kind: "number", value: q[t] } : { kind: "variable", name: t };
|
|
178
178
|
}
|
|
179
|
-
if (
|
|
179
|
+
if (a.type === "LPAREN") {
|
|
180
180
|
this.advance();
|
|
181
181
|
const t = this.parseExpression();
|
|
182
182
|
return this.expect("RPAREN"), t;
|
|
183
183
|
}
|
|
184
|
-
if (
|
|
184
|
+
if (a.type === "LBRACKET") {
|
|
185
185
|
this.advance();
|
|
186
186
|
const t = [];
|
|
187
187
|
if (this.peek().type !== "RBRACKET")
|
|
@@ -189,128 +189,128 @@ class R {
|
|
|
189
189
|
this.advance(), t.push(this.parseExpression());
|
|
190
190
|
return this.expect("RBRACKET"), { kind: "array", elements: t };
|
|
191
191
|
}
|
|
192
|
-
throw new
|
|
193
|
-
`Unexpected token '${
|
|
194
|
-
|
|
192
|
+
throw new x(
|
|
193
|
+
`Unexpected token '${a.value}'`,
|
|
194
|
+
a.pos
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function w(e, a) {
|
|
199
199
|
switch (e.kind) {
|
|
200
200
|
case "number":
|
|
201
201
|
return e.value;
|
|
202
202
|
case "variable":
|
|
203
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
204
|
-
throw new
|
|
203
|
+
if (Object.prototype.hasOwnProperty.call(a, e.name)) return a[e.name];
|
|
204
|
+
throw new x(`Unknown variable '${e.name}'`, 0);
|
|
205
205
|
case "unary":
|
|
206
|
-
const t =
|
|
206
|
+
const t = w(e.operand, a);
|
|
207
207
|
return e.op === "-" ? -t : t;
|
|
208
208
|
case "binary": {
|
|
209
|
-
const
|
|
209
|
+
const i = w(e.left, a), r = w(e.right, a);
|
|
210
210
|
switch (e.op) {
|
|
211
211
|
case "+":
|
|
212
|
-
return
|
|
212
|
+
return i + r;
|
|
213
213
|
case "-":
|
|
214
|
-
return
|
|
214
|
+
return i - r;
|
|
215
215
|
case "*":
|
|
216
|
-
return
|
|
216
|
+
return i * r;
|
|
217
217
|
case "/":
|
|
218
|
-
return
|
|
218
|
+
return r === 0 ? 1 / 0 : i / r;
|
|
219
219
|
case "^":
|
|
220
|
-
return Math.pow(
|
|
220
|
+
return Math.pow(i, r);
|
|
221
221
|
}
|
|
222
222
|
break;
|
|
223
223
|
}
|
|
224
224
|
case "call": {
|
|
225
|
-
const
|
|
226
|
-
return
|
|
225
|
+
const i = N[e.name], r = e.args.map((n) => w(n, a));
|
|
226
|
+
return i(...r);
|
|
227
227
|
}
|
|
228
228
|
case "array":
|
|
229
|
-
return e.elements.map((
|
|
229
|
+
return e.elements.map((i) => w(i, a));
|
|
230
230
|
}
|
|
231
|
-
throw new
|
|
231
|
+
throw new x("Invalid AST node", 0);
|
|
232
232
|
}
|
|
233
|
-
class
|
|
234
|
-
constructor(
|
|
235
|
-
super(
|
|
233
|
+
class x extends Error {
|
|
234
|
+
constructor(a, t) {
|
|
235
|
+
super(a), this.name = "ExpressionError", this.position = t;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
const
|
|
240
|
-
return (
|
|
238
|
+
function Ke(e) {
|
|
239
|
+
const a = W(e), t = new _(a).parse();
|
|
240
|
+
return (i) => w(t, i);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
242
|
+
function Xe(e) {
|
|
243
|
+
const a = W(e), t = new _(a).parse();
|
|
244
244
|
if (t.kind !== "array" || t.elements.length !== 2)
|
|
245
|
-
throw new
|
|
245
|
+
throw new x(
|
|
246
246
|
'Vector expression must be an array of 2 elements, e.g. "[-y, x]"',
|
|
247
247
|
0
|
|
248
248
|
);
|
|
249
|
-
return (
|
|
249
|
+
return (i) => w(t, i);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function H(e) {
|
|
252
252
|
try {
|
|
253
|
-
const
|
|
254
|
-
return new
|
|
255
|
-
} catch (
|
|
256
|
-
return
|
|
253
|
+
const a = W(e);
|
|
254
|
+
return new _(a).parse(), null;
|
|
255
|
+
} catch (a) {
|
|
256
|
+
return a instanceof x ? `${a.message} (at position ${a.position})` : String(a);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
linear:
|
|
261
|
-
easeInQuad:
|
|
262
|
-
easeOutQuad:
|
|
263
|
-
easeInOutQuad:
|
|
264
|
-
easeInCubic:
|
|
265
|
-
easeOutCubic:
|
|
266
|
-
easeInOutCubic:
|
|
267
|
-
easeInQuart:
|
|
268
|
-
easeOutQuart:
|
|
269
|
-
easeInOutQuart:
|
|
270
|
-
easeInSine:
|
|
271
|
-
easeOutSine:
|
|
272
|
-
easeInOutSine:
|
|
273
|
-
easeInExpo:
|
|
274
|
-
easeOutExpo:
|
|
275
|
-
easeInOutExpo:
|
|
276
|
-
easeInBack:
|
|
277
|
-
easeOutBack:
|
|
278
|
-
easeOutElastic:
|
|
279
|
-
easeOutBounce:
|
|
259
|
+
const M = {
|
|
260
|
+
linear: xe,
|
|
261
|
+
easeInQuad: be,
|
|
262
|
+
easeOutQuad: me,
|
|
263
|
+
easeInOutQuad: ye,
|
|
264
|
+
easeInCubic: oe,
|
|
265
|
+
easeOutCubic: ge,
|
|
266
|
+
easeInOutCubic: fe,
|
|
267
|
+
easeInQuart: he,
|
|
268
|
+
easeOutQuart: ue,
|
|
269
|
+
easeInOutQuart: le,
|
|
270
|
+
easeInSine: ce,
|
|
271
|
+
easeOutSine: se,
|
|
272
|
+
easeInOutSine: ne,
|
|
273
|
+
easeInExpo: re,
|
|
274
|
+
easeOutExpo: ie,
|
|
275
|
+
easeInOutExpo: ae,
|
|
276
|
+
easeInBack: te,
|
|
277
|
+
easeOutBack: ee,
|
|
278
|
+
easeOutElastic: Z,
|
|
279
|
+
easeOutBounce: J
|
|
280
280
|
};
|
|
281
281
|
function c(e) {
|
|
282
282
|
if (e !== void 0) {
|
|
283
283
|
if (typeof e == "string") {
|
|
284
|
-
const
|
|
285
|
-
if (!
|
|
286
|
-
const t = Object.keys(
|
|
287
|
-
throw new Error(`Unknown easing '${e}'.${
|
|
284
|
+
const a = M[e];
|
|
285
|
+
if (!a) {
|
|
286
|
+
const t = Object.keys(M), i = t.find((n) => n.toLowerCase() === e.toLowerCase()), r = i ? ` Did you mean '${i}'?` : "";
|
|
287
|
+
throw new Error(`Unknown easing '${e}'.${r} Available: ${t.join(", ")}`);
|
|
288
288
|
}
|
|
289
|
-
return
|
|
289
|
+
return a;
|
|
290
290
|
}
|
|
291
291
|
if (e.type === "spring")
|
|
292
|
-
return
|
|
292
|
+
return ve({
|
|
293
293
|
stiffness: e.stiffness,
|
|
294
294
|
damping: e.damping,
|
|
295
295
|
mass: e.mass
|
|
296
296
|
});
|
|
297
297
|
if (e.type === "cubicBezier")
|
|
298
|
-
return
|
|
298
|
+
return de(e.x1, e.y1, e.x2, e.y2);
|
|
299
299
|
throw new Error(`Unknown easing type: ${e.type}`);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
const
|
|
302
|
+
const R = Object.keys(M);
|
|
303
|
+
function Ye(e) {
|
|
304
|
+
const a = [];
|
|
305
305
|
if (!e || typeof e != "object")
|
|
306
|
-
return
|
|
306
|
+
return a.push({ path: "", message: "Document must be an object", severity: "error" }), { valid: !1, errors: a };
|
|
307
307
|
const t = e;
|
|
308
|
-
return t.version !== "1.0" &&
|
|
309
|
-
valid:
|
|
310
|
-
errors:
|
|
308
|
+
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((i) => i.severity === "error").length === 0, errors: a }) : (Je(t.root, "root", a), {
|
|
309
|
+
valid: a.filter((i) => i.severity === "error").length === 0,
|
|
310
|
+
errors: a
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
const
|
|
313
|
+
const B = ["scene", "player", "presentation"], p = [
|
|
314
314
|
"sequence",
|
|
315
315
|
"group",
|
|
316
316
|
"circle",
|
|
@@ -319,6 +319,7 @@ const p = ["scene", "player", "presentation"], P = [
|
|
|
319
319
|
"rect",
|
|
320
320
|
"polygon",
|
|
321
321
|
"text",
|
|
322
|
+
"image",
|
|
322
323
|
"axes",
|
|
323
324
|
"functionPlot",
|
|
324
325
|
"vectorField",
|
|
@@ -337,336 +338,373 @@ const p = ["scene", "player", "presentation"], P = [
|
|
|
337
338
|
"parallel",
|
|
338
339
|
"player",
|
|
339
340
|
"scene"
|
|
340
|
-
],
|
|
341
|
-
function
|
|
342
|
-
const
|
|
343
|
-
if (!
|
|
344
|
-
t.push({ path: `${
|
|
341
|
+
], U = ["none", "fade", "slide-left", "slide-up", "zoom"];
|
|
342
|
+
function Je(e, a, t) {
|
|
343
|
+
const i = e.type;
|
|
344
|
+
if (!B.includes(i)) {
|
|
345
|
+
t.push({ path: `${a}.type`, message: `Root type must be one of: ${B.join(", ")}. Got "${i}"`, severity: "error" });
|
|
345
346
|
return;
|
|
346
347
|
}
|
|
347
|
-
|
|
348
|
+
i === "scene" || i === "player" ? G(e, a, i, t) : i === "presentation" && Ze(e, a, t);
|
|
348
349
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
350
|
+
function G(e, a, t, i) {
|
|
351
|
+
St(e, "durationInFrames", a, i), h(e, "width", a, i), h(e, "height", a, i), h(e, "fps", a, i), v(e, "background", a, i), t === "player" && (S(e, "controls", a, i), S(e, "loop", a, i), S(e, "autoPlay", a, i)), d(e, a, i);
|
|
351
352
|
}
|
|
352
|
-
function
|
|
353
|
-
if (
|
|
354
|
-
path: `${
|
|
355
|
-
message: `Invalid transition "${e.transition}". Must be one of: ${
|
|
353
|
+
function Ze(e, a, t) {
|
|
354
|
+
if (h(e, "width", a, t), h(e, "height", a, t), v(e, "background", a, t), h(e, "transitionDuration", a, t), S(e, "showHud", a, t), S(e, "showNotes", a, t), e.transition !== void 0 && (U.includes(e.transition) || t.push({
|
|
355
|
+
path: `${a}.transition`,
|
|
356
|
+
message: `Invalid transition "${e.transition}". Must be one of: ${U.join(", ")}`,
|
|
356
357
|
severity: "error"
|
|
357
358
|
})), !Array.isArray(e.slides)) {
|
|
358
|
-
t.push({ path: `${
|
|
359
|
+
t.push({ path: `${a}.slides`, message: 'Presentation must have a "slides" array', severity: "error" });
|
|
359
360
|
return;
|
|
360
361
|
}
|
|
361
|
-
e.slides.length === 0 && t.push({ path: `${
|
|
362
|
-
|
|
362
|
+
e.slides.length === 0 && t.push({ path: `${a}.slides`, message: "Presentation must have at least one slide", severity: "warning" }), e.slides.forEach((i, r) => {
|
|
363
|
+
et(i, `${a}.slides[${r}]`, t);
|
|
363
364
|
});
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
+
function et(e, a, t) {
|
|
366
367
|
if (!e || typeof e != "object") {
|
|
367
|
-
t.push({ path:
|
|
368
|
+
t.push({ path: a, message: "Slide must be an object", severity: "error" });
|
|
368
369
|
return;
|
|
369
370
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}) : t.push({ path: `${
|
|
371
|
+
v(e, "title", a, t), v(e, "notes", a, t), v(e, "background", a, t), e.children !== void 0 && (Array.isArray(e.children) ? e.children.forEach((i, r) => {
|
|
372
|
+
Q(i, `${a}.children[${r}]`, t);
|
|
373
|
+
}) : t.push({ path: `${a}.children`, message: "Slide children must be an array", severity: "error" }));
|
|
373
374
|
}
|
|
374
|
-
function
|
|
375
|
+
function d(e, a, t) {
|
|
375
376
|
if (!Array.isArray(e.children)) {
|
|
376
|
-
t.push({ path: `${
|
|
377
|
+
t.push({ path: `${a}.children`, message: 'Expected "children" array', severity: "error" });
|
|
377
378
|
return;
|
|
378
379
|
}
|
|
379
|
-
e.children.forEach((
|
|
380
|
-
|
|
380
|
+
e.children.forEach((i, r) => {
|
|
381
|
+
Q(i, `${a}.children[${r}]`, t);
|
|
381
382
|
});
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
+
function Q(e, a, t) {
|
|
384
385
|
if (!e || typeof e != "object") {
|
|
385
|
-
t.push({ path:
|
|
386
|
+
t.push({ path: a, message: "Element must be an object", severity: "error" });
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
389
|
+
const i = e.type;
|
|
390
|
+
if (!i || !p.includes(i)) {
|
|
391
|
+
const r = i ? K(i, p) : "";
|
|
391
392
|
t.push({
|
|
392
|
-
path: `${
|
|
393
|
-
message: `Unknown element type "${
|
|
393
|
+
path: `${a}.type`,
|
|
394
|
+
message: `Unknown element type "${i}".${r} Valid types: ${p.join(", ")}`,
|
|
394
395
|
severity: "error"
|
|
395
396
|
});
|
|
396
397
|
return;
|
|
397
398
|
}
|
|
398
|
-
switch (
|
|
399
|
+
switch (i) {
|
|
399
400
|
case "circle":
|
|
400
|
-
|
|
401
|
+
tt(e, a, t);
|
|
401
402
|
break;
|
|
402
403
|
case "line":
|
|
403
|
-
|
|
404
|
+
at(e, a, t);
|
|
404
405
|
break;
|
|
405
406
|
case "arrow":
|
|
406
|
-
|
|
407
|
+
it(e, a, t);
|
|
407
408
|
break;
|
|
408
409
|
case "rect":
|
|
409
|
-
|
|
410
|
+
rt(e, a, t);
|
|
410
411
|
break;
|
|
411
412
|
case "polygon":
|
|
412
|
-
|
|
413
|
+
nt(e, a, t);
|
|
413
414
|
break;
|
|
414
415
|
case "text":
|
|
415
|
-
|
|
416
|
+
st(e, a, t);
|
|
417
|
+
break;
|
|
418
|
+
case "image":
|
|
419
|
+
kt(e, a, t);
|
|
416
420
|
break;
|
|
417
421
|
case "axes":
|
|
418
|
-
|
|
422
|
+
ct(e, a, t);
|
|
419
423
|
break;
|
|
420
424
|
case "functionPlot":
|
|
421
|
-
|
|
425
|
+
lt(e, a, t);
|
|
422
426
|
break;
|
|
423
427
|
case "vector":
|
|
424
|
-
|
|
428
|
+
ut(e, a, t);
|
|
425
429
|
break;
|
|
426
430
|
case "vectorField":
|
|
427
|
-
|
|
431
|
+
ht(e, a, t);
|
|
428
432
|
break;
|
|
429
433
|
case "matrix":
|
|
430
|
-
|
|
434
|
+
ft(e, a, t);
|
|
431
435
|
break;
|
|
432
436
|
case "graph":
|
|
433
|
-
|
|
437
|
+
gt(e, a, t);
|
|
434
438
|
break;
|
|
435
439
|
case "latex":
|
|
436
|
-
|
|
440
|
+
ot(e, a, t);
|
|
441
|
+
break;
|
|
442
|
+
case "barChart":
|
|
443
|
+
$t(e, a, t);
|
|
437
444
|
break;
|
|
438
445
|
case "sequence":
|
|
439
|
-
|
|
446
|
+
yt(e, a, t);
|
|
440
447
|
break;
|
|
441
448
|
case "group":
|
|
449
|
+
It(e, a, t);
|
|
450
|
+
break;
|
|
442
451
|
case "parallel":
|
|
443
|
-
|
|
452
|
+
d(e, a, t);
|
|
444
453
|
break;
|
|
445
454
|
case "fadeIn":
|
|
446
455
|
case "fadeOut":
|
|
447
456
|
case "draw":
|
|
448
457
|
case "write":
|
|
449
|
-
|
|
458
|
+
mt(e, a, t);
|
|
450
459
|
break;
|
|
451
460
|
case "transform":
|
|
452
|
-
|
|
461
|
+
bt(e, a, t);
|
|
453
462
|
break;
|
|
454
463
|
case "morph":
|
|
455
|
-
|
|
464
|
+
xt(e, a, t);
|
|
456
465
|
break;
|
|
457
466
|
case "stagger":
|
|
458
|
-
|
|
467
|
+
vt(e, a, t);
|
|
459
468
|
break;
|
|
460
469
|
case "scene":
|
|
461
470
|
case "player":
|
|
462
|
-
|
|
471
|
+
G(e, a, i, t);
|
|
463
472
|
break;
|
|
464
473
|
}
|
|
465
474
|
}
|
|
466
|
-
function
|
|
467
|
-
|
|
475
|
+
function tt(e, a, t) {
|
|
476
|
+
l(e, "cx", a, t), l(e, "cy", a, t), k(e, "r", a, t), o(e, a, t);
|
|
468
477
|
}
|
|
469
|
-
function
|
|
470
|
-
|
|
478
|
+
function at(e, a, t) {
|
|
479
|
+
l(e, "x1", a, t), l(e, "y1", a, t), l(e, "x2", a, t), l(e, "y2", a, t), o(e, a, t);
|
|
471
480
|
}
|
|
472
|
-
function
|
|
473
|
-
|
|
481
|
+
function it(e, a, t) {
|
|
482
|
+
l(e, "x1", a, t), l(e, "y1", a, t), l(e, "x2", a, t), l(e, "y2", a, t), o(e, a, t);
|
|
474
483
|
}
|
|
475
|
-
function
|
|
476
|
-
|
|
484
|
+
function rt(e, a, t) {
|
|
485
|
+
l(e, "x", a, t), l(e, "y", a, t), k(e, "width", a, t), k(e, "height", a, t), o(e, a, t);
|
|
477
486
|
}
|
|
478
|
-
function
|
|
479
|
-
Array.isArray(e.points) ? e.points.length < 3 ? t.push({ path: `${
|
|
480
|
-
(!Array.isArray(
|
|
481
|
-
}) : t.push({ path: `${
|
|
487
|
+
function nt(e, a, t) {
|
|
488
|
+
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((i, r) => {
|
|
489
|
+
(!Array.isArray(i) || i.length !== 2 || typeof i[0] != "number" || typeof i[1] != "number") && t.push({ path: `${a}.points[${r}]`, message: "Each point must be [number, number]", severity: "error" });
|
|
490
|
+
}) : t.push({ path: `${a}.points`, message: 'Polygon requires a "points" array', severity: "error" }), o(e, a, t);
|
|
482
491
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
492
|
+
function st(e, a, t) {
|
|
493
|
+
l(e, "x", a, t), l(e, "y", a, t), typeof e.content != "string" && t.push({ path: `${a}.content`, message: 'Text requires a "content" string', severity: "error" }), o(e, a, t);
|
|
485
494
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
495
|
+
function ct(e, a, t) {
|
|
496
|
+
y(e, "domain", a, t), y(e, "range", a, t), y(e, "origin", a, t), P(e, a, t);
|
|
488
497
|
}
|
|
489
|
-
function
|
|
498
|
+
function lt(e, a, t) {
|
|
490
499
|
if (typeof e.fn != "string")
|
|
491
|
-
t.push({ path: `${
|
|
500
|
+
t.push({ path: `${a}.fn`, message: 'FunctionPlot requires a "fn" expression string', severity: "error" });
|
|
492
501
|
else {
|
|
493
|
-
const
|
|
494
|
-
|
|
502
|
+
const i = H(e.fn);
|
|
503
|
+
i && t.push({ path: `${a}.fn`, message: `Invalid expression: ${i}`, severity: "error" });
|
|
495
504
|
}
|
|
496
|
-
|
|
505
|
+
y(e, "domain", a, t), P(e, a, t);
|
|
497
506
|
}
|
|
498
|
-
function
|
|
499
|
-
(!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${
|
|
507
|
+
function ut(e, a, t) {
|
|
508
|
+
(!Array.isArray(e.to) || e.to.length !== 2) && t.push({ path: `${a}.to`, message: 'Vector requires a "to" array of [number, number]', severity: "error" }), y(e, "from", a, t), P(e, a, t);
|
|
500
509
|
}
|
|
501
|
-
function
|
|
510
|
+
function ht(e, a, t) {
|
|
502
511
|
if (typeof e.fn != "string")
|
|
503
|
-
t.push({ path: `${
|
|
512
|
+
t.push({ path: `${a}.fn`, message: 'VectorField requires a "fn" expression string', severity: "error" });
|
|
504
513
|
else {
|
|
505
|
-
const
|
|
506
|
-
|
|
514
|
+
const i = H(e.fn);
|
|
515
|
+
i && t.push({ path: `${a}.fn`, message: `Invalid vector expression: ${i}`, severity: "error" });
|
|
507
516
|
}
|
|
508
|
-
|
|
517
|
+
y(e, "domain", a, t), y(e, "range", a, t), P(e, a, t);
|
|
509
518
|
}
|
|
510
|
-
function
|
|
511
|
-
Array.isArray(e.values) ? e.values.forEach((
|
|
512
|
-
Array.isArray(
|
|
513
|
-
}) : t.push({ path: `${
|
|
519
|
+
function ft(e, a, t) {
|
|
520
|
+
Array.isArray(e.values) ? e.values.forEach((i, r) => {
|
|
521
|
+
Array.isArray(i) || t.push({ path: `${a}.values[${r}]`, message: "Each matrix row must be an array", severity: "error" });
|
|
522
|
+
}) : t.push({ path: `${a}.values`, message: 'Matrix requires a "values" 2D array', severity: "error" }), o(e, a, t);
|
|
514
523
|
}
|
|
515
|
-
function
|
|
524
|
+
function gt(e, a, t) {
|
|
516
525
|
if (!Array.isArray(e.nodes))
|
|
517
|
-
t.push({ path: `${
|
|
526
|
+
t.push({ path: `${a}.nodes`, message: 'Graph requires a "nodes" array', severity: "error" });
|
|
518
527
|
else {
|
|
519
|
-
const
|
|
520
|
-
e.nodes.forEach((
|
|
521
|
-
typeof
|
|
522
|
-
}), Array.isArray(e.edges) && e.edges.forEach((
|
|
523
|
-
(typeof
|
|
528
|
+
const i = /* @__PURE__ */ new Set();
|
|
529
|
+
e.nodes.forEach((r, n) => {
|
|
530
|
+
typeof r.id != "string" ? t.push({ path: `${a}.nodes[${n}].id`, message: 'Graph node requires a string "id"', severity: "error" }) : (i.has(r.id) && t.push({ path: `${a}.nodes[${n}].id`, message: `Duplicate node id "${r.id}"`, severity: "error" }), i.add(r.id)), l(r, "x", `${a}.nodes[${n}]`, t), l(r, "y", `${a}.nodes[${n}]`, t);
|
|
531
|
+
}), Array.isArray(e.edges) && e.edges.forEach((r, n) => {
|
|
532
|
+
(typeof r.from != "string" || !i.has(r.from)) && t.push({ path: `${a}.edges[${n}].from`, message: `Edge "from" references unknown node "${r.from}"`, severity: "error" }), (typeof r.to != "string" || !i.has(r.to)) && t.push({ path: `${a}.edges[${n}].to`, message: `Edge "to" references unknown node "${r.to}"`, severity: "error" });
|
|
524
533
|
});
|
|
525
534
|
}
|
|
526
|
-
|
|
535
|
+
o(e, a, t);
|
|
527
536
|
}
|
|
528
|
-
function
|
|
529
|
-
typeof e.expression != "string" && t.push({ path: `${
|
|
537
|
+
function ot(e, a, t) {
|
|
538
|
+
typeof e.expression != "string" && t.push({ path: `${a}.expression`, message: 'LaTeX requires an "expression" string', severity: "error" }), l(e, "x", a, t), l(e, "y", a, t), o(e, a, t);
|
|
530
539
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
540
|
+
function yt(e, a, t) {
|
|
541
|
+
l(e, "from", a, t), Ot(e, "durationInFrames", a, t), d(e, a, t);
|
|
533
542
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
543
|
+
function mt(e, a, t) {
|
|
544
|
+
h(e, "duration", a, t), $(e, a, t), d(e, a, t);
|
|
536
545
|
}
|
|
537
|
-
function
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
540
|
-
(!
|
|
546
|
+
function bt(e, a, t) {
|
|
547
|
+
if (h(e, "duration", a, t), $(e, a, t), e.translate !== void 0) {
|
|
548
|
+
const i = e.translate;
|
|
549
|
+
(!i || typeof i != "object") && t.push({ path: `${a}.translate`, message: "translate must be { from: [x,y], to: [x,y] }", severity: "error" });
|
|
541
550
|
}
|
|
542
551
|
if (e.scale !== void 0) {
|
|
543
|
-
const
|
|
544
|
-
(!
|
|
552
|
+
const i = e.scale;
|
|
553
|
+
(!i || typeof i != "object" || typeof i.from != "number" || typeof i.to != "number") && t.push({ path: `${a}.scale`, message: "scale must be { from: number, to: number }", severity: "error" });
|
|
545
554
|
}
|
|
546
555
|
if (e.rotate !== void 0) {
|
|
547
|
-
const
|
|
548
|
-
(!
|
|
556
|
+
const i = e.rotate;
|
|
557
|
+
(!i || typeof i != "object" || typeof i.from != "number" || typeof i.to != "number") && t.push({ path: `${a}.rotate`, message: "rotate must be { from: number, to: number }", severity: "error" });
|
|
549
558
|
}
|
|
550
559
|
if (e.opacity !== void 0) {
|
|
551
|
-
const
|
|
552
|
-
(!
|
|
560
|
+
const i = e.opacity;
|
|
561
|
+
(!i || typeof i != "object" || typeof i.from != "number" || typeof i.to != "number") && t.push({ path: `${a}.opacity`, message: "opacity must be { from: number, to: number }", severity: "error" });
|
|
562
|
+
}
|
|
563
|
+
d(e, a, t);
|
|
564
|
+
}
|
|
565
|
+
function xt(e, a, t) {
|
|
566
|
+
h(e, "duration", a, t), $(e, a, t), v(e, "fromColor", a, t), v(e, "toColor", a, t), d(e, a, t);
|
|
567
|
+
}
|
|
568
|
+
function vt(e, a, t) {
|
|
569
|
+
h(e, "staggerDelay", a, t), $(e, a, t), d(e, a, t);
|
|
570
|
+
}
|
|
571
|
+
function o(e, a, t) {
|
|
572
|
+
h(e, "fadeIn", a, t), h(e, "fadeOut", a, t), h(e, "draw", a, t), $(e, a, t), dt(e, a, t);
|
|
573
|
+
}
|
|
574
|
+
function P(e, a, t) {
|
|
575
|
+
h(e, "fadeIn", a, t), h(e, "fadeOut", a, t), h(e, "draw", a, t), $(e, a, t), wt(e, a, t);
|
|
576
|
+
}
|
|
577
|
+
const V = ["none", "circle", "ellipse"];
|
|
578
|
+
function dt(e, a, t) {
|
|
579
|
+
if (F(e, "rotation", a, t), y(e, "rotationOrigin", a, t), y(e, "translate", a, t), F(e, "zIndex", a, t), e.scale !== void 0) {
|
|
580
|
+
const i = e.scale;
|
|
581
|
+
typeof i == "number" || Array.isArray(i) && i.length === 2 && typeof i[0] == "number" && typeof i[1] == "number" || t.push({ path: `${a}.scale`, message: '"scale" must be a number or [number, number]', severity: "error" });
|
|
553
582
|
}
|
|
554
|
-
w(e, r, t);
|
|
555
583
|
}
|
|
556
|
-
function
|
|
557
|
-
|
|
584
|
+
function wt(e, a, t) {
|
|
585
|
+
F(e, "rotation", a, t), y(e, "rotationOrigin", a, t), y(e, "translate", a, t), F(e, "zIndex", a, t);
|
|
586
|
+
}
|
|
587
|
+
function kt(e, a, t) {
|
|
588
|
+
typeof e.src != "string" && t.push({ path: `${a}.src`, message: 'Image requires a "src" string', severity: "error" }), l(e, "x", a, t), l(e, "y", a, t), k(e, "width", a, t), k(e, "height", a, t), v(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 && (V.includes(e.clipShape) || t.push({
|
|
589
|
+
path: `${a}.clipShape`,
|
|
590
|
+
message: `Invalid clipShape "${e.clipShape}". Must be one of: ${V.join(", ")}`,
|
|
591
|
+
severity: "error"
|
|
592
|
+
})), o(e, a, t);
|
|
558
593
|
}
|
|
559
|
-
function
|
|
560
|
-
|
|
594
|
+
function It(e, a, t) {
|
|
595
|
+
d(e, a, t), o(e, a, t);
|
|
561
596
|
}
|
|
562
|
-
function
|
|
563
|
-
|
|
597
|
+
function $t(e, a, t) {
|
|
598
|
+
l(e, "x", a, t), l(e, "y", a, t), k(e, "width", a, t), k(e, "height", a, t), Array.isArray(e.bars) || t.push({ path: `${a}.bars`, message: 'BarChart requires a "bars" array', severity: "error" }), o(e, a, t);
|
|
564
599
|
}
|
|
565
|
-
function
|
|
600
|
+
function $(e, a, t) {
|
|
566
601
|
if (e.easing !== void 0) {
|
|
567
602
|
if (typeof e.easing == "string") {
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
603
|
+
if (!R.includes(e.easing)) {
|
|
604
|
+
const i = K(e.easing, R);
|
|
570
605
|
t.push({
|
|
571
|
-
path: `${
|
|
572
|
-
message: `Unknown easing "${e.easing}".${
|
|
606
|
+
path: `${a}.easing`,
|
|
607
|
+
message: `Unknown easing "${e.easing}".${i} Available: ${R.join(", ")}`,
|
|
573
608
|
severity: "error"
|
|
574
609
|
});
|
|
575
610
|
}
|
|
576
611
|
return;
|
|
577
612
|
}
|
|
578
613
|
if (typeof e.easing == "object" && e.easing !== null) {
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
if (
|
|
582
|
-
for (const
|
|
583
|
-
typeof
|
|
614
|
+
const i = e.easing;
|
|
615
|
+
if (i.type === "spring") return;
|
|
616
|
+
if (i.type === "cubicBezier") {
|
|
617
|
+
for (const r of ["x1", "y1", "x2", "y2"])
|
|
618
|
+
typeof i[r] != "number" && t.push({ path: `${a}.easing.${r}`, message: `cubicBezier requires numeric "${r}"`, severity: "error" });
|
|
584
619
|
return;
|
|
585
620
|
}
|
|
586
|
-
t.push({ path: `${
|
|
621
|
+
t.push({ path: `${a}.easing.type`, message: 'Easing object type must be "spring" or "cubicBezier"', severity: "error" });
|
|
587
622
|
return;
|
|
588
623
|
}
|
|
589
|
-
t.push({ path: `${
|
|
624
|
+
t.push({ path: `${a}.easing`, message: 'Easing must be a string name or { type: "spring"|"cubicBezier", ... }', severity: "error" });
|
|
590
625
|
}
|
|
591
626
|
}
|
|
592
|
-
function
|
|
593
|
-
typeof e[
|
|
627
|
+
function l(e, a, t, i) {
|
|
628
|
+
typeof e[a] != "number" && i.push({ path: `${t}.${a}`, message: `Required numeric field "${a}" is missing or not a number`, severity: "error" });
|
|
594
629
|
}
|
|
595
|
-
function
|
|
596
|
-
(typeof e[
|
|
630
|
+
function k(e, a, t, i) {
|
|
631
|
+
(typeof e[a] != "number" || e[a] <= 0) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
597
632
|
}
|
|
598
|
-
function
|
|
599
|
-
const
|
|
600
|
-
(typeof
|
|
633
|
+
function St(e, a, t, i) {
|
|
634
|
+
const r = e[a];
|
|
635
|
+
(typeof r != "number" || r <= 0 || !Number.isInteger(r)) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
601
636
|
}
|
|
602
|
-
function
|
|
603
|
-
e[
|
|
637
|
+
function h(e, a, t, i) {
|
|
638
|
+
e[a] !== void 0 && (typeof e[a] != "number" || e[a] <= 0) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive number`, severity: "error" });
|
|
604
639
|
}
|
|
605
|
-
function
|
|
606
|
-
const
|
|
607
|
-
|
|
640
|
+
function Ot(e, a, t, i) {
|
|
641
|
+
const r = e[a];
|
|
642
|
+
r !== void 0 && (typeof r != "number" || r <= 0 || !Number.isInteger(r)) && i.push({ path: `${t}.${a}`, message: `"${a}" must be a positive integer`, severity: "error" });
|
|
608
643
|
}
|
|
609
|
-
function
|
|
610
|
-
e[
|
|
644
|
+
function v(e, a, t, i) {
|
|
645
|
+
e[a] !== void 0 && typeof e[a] != "string" && i.push({ path: `${t}.${a}`, message: `"${a}" must be a string`, severity: "error" });
|
|
611
646
|
}
|
|
612
|
-
function
|
|
613
|
-
e[
|
|
647
|
+
function F(e, a, t, i) {
|
|
648
|
+
e[a] !== void 0 && typeof e[a] != "number" && i.push({ path: `${t}.${a}`, message: `"${a}" must be a number`, severity: "error" });
|
|
614
649
|
}
|
|
615
|
-
function
|
|
616
|
-
|
|
617
|
-
i !== void 0 && (!Array.isArray(i) || i.length !== 2 || typeof i[0] != "number" || typeof i[1] != "number") && a.push({ path: `${t}.${r}`, message: `"${r}" must be [number, number]`, severity: "error" });
|
|
650
|
+
function S(e, a, t, i) {
|
|
651
|
+
e[a] !== void 0 && typeof e[a] != "boolean" && i.push({ path: `${t}.${a}`, message: `"${a}" must be a boolean`, severity: "error" });
|
|
618
652
|
}
|
|
619
|
-
function
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
const i = r.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
|
|
623
|
-
return i ? ` Did you mean '${i}'?` : "";
|
|
653
|
+
function y(e, a, t, i) {
|
|
654
|
+
const r = e[a];
|
|
655
|
+
r !== void 0 && (!Array.isArray(r) || r.length !== 2 || typeof r[0] != "number" || typeof r[1] != "number") && i.push({ path: `${t}.${a}`, message: `"${a}" must be [number, number]`, severity: "error" });
|
|
624
656
|
}
|
|
625
|
-
function
|
|
626
|
-
const
|
|
627
|
-
|
|
657
|
+
function K(e, a) {
|
|
658
|
+
const t = e.toLowerCase(), i = a.find((n) => n.toLowerCase() === t);
|
|
659
|
+
if (i) return ` Did you mean '${i}'?`;
|
|
660
|
+
const r = a.find((n) => n.toLowerCase().startsWith(t.slice(0, 4)));
|
|
661
|
+
return r ? ` Did you mean '${r}'?` : "";
|
|
662
|
+
}
|
|
663
|
+
function Mt({ dsl: e, className: a, style: t }) {
|
|
664
|
+
const i = Ye(e);
|
|
665
|
+
return i.valid ? /* @__PURE__ */ s("div", { className: a, style: t, "data-testid": "dsl-root", children: At(e.root) }) : /* @__PURE__ */ L(
|
|
628
666
|
"div",
|
|
629
667
|
{
|
|
630
|
-
className:
|
|
668
|
+
className: a,
|
|
631
669
|
style: { color: "#ff6b6b", fontFamily: "monospace", padding: 16, ...t },
|
|
632
670
|
"data-testid": "dsl-error",
|
|
633
671
|
children: [
|
|
634
672
|
/* @__PURE__ */ s("strong", { children: "Elucim DSL Validation Errors:" }),
|
|
635
|
-
/* @__PURE__ */ s("ul", { children:
|
|
636
|
-
|
|
673
|
+
/* @__PURE__ */ s("ul", { children: i.errors.filter((r) => r.severity === "error").map((r, n) => /* @__PURE__ */ L("li", { children: [
|
|
674
|
+
r.path,
|
|
637
675
|
": ",
|
|
638
|
-
|
|
676
|
+
r.message
|
|
639
677
|
] }, n)) })
|
|
640
678
|
]
|
|
641
679
|
}
|
|
642
680
|
);
|
|
643
681
|
}
|
|
644
|
-
function
|
|
682
|
+
function At(e) {
|
|
645
683
|
switch (e.type) {
|
|
646
684
|
case "scene":
|
|
647
|
-
return
|
|
685
|
+
return X(e);
|
|
648
686
|
case "player":
|
|
649
|
-
return
|
|
687
|
+
return Y(e);
|
|
650
688
|
case "presentation":
|
|
651
|
-
return
|
|
689
|
+
return Ct(e);
|
|
652
690
|
}
|
|
653
691
|
}
|
|
654
|
-
function
|
|
692
|
+
function X(e) {
|
|
655
693
|
return /* @__PURE__ */ s(
|
|
656
|
-
|
|
694
|
+
Ie,
|
|
657
695
|
{
|
|
658
696
|
width: e.width,
|
|
659
697
|
height: e.height,
|
|
660
698
|
fps: e.fps,
|
|
661
699
|
durationInFrames: e.durationInFrames,
|
|
662
700
|
background: e.background,
|
|
663
|
-
children: e.children.map((
|
|
701
|
+
children: e.children.map((a, t) => g(a, t))
|
|
664
702
|
}
|
|
665
703
|
);
|
|
666
704
|
}
|
|
667
|
-
function
|
|
705
|
+
function Y(e) {
|
|
668
706
|
return /* @__PURE__ */ s(
|
|
669
|
-
|
|
707
|
+
ke,
|
|
670
708
|
{
|
|
671
709
|
width: e.width,
|
|
672
710
|
height: e.height,
|
|
@@ -676,13 +714,13 @@ function Q(e) {
|
|
|
676
714
|
controls: e.controls,
|
|
677
715
|
loop: e.loop,
|
|
678
716
|
autoPlay: e.autoPlay,
|
|
679
|
-
children: e.children.map((
|
|
717
|
+
children: e.children.map((a, t) => g(a, t))
|
|
680
718
|
}
|
|
681
719
|
);
|
|
682
720
|
}
|
|
683
|
-
function
|
|
721
|
+
function Ct(e) {
|
|
684
722
|
return /* @__PURE__ */ s(
|
|
685
|
-
|
|
723
|
+
we,
|
|
686
724
|
{
|
|
687
725
|
width: e.width,
|
|
688
726
|
height: e.height,
|
|
@@ -691,23 +729,37 @@ function dt(e) {
|
|
|
691
729
|
transitionDuration: e.transitionDuration,
|
|
692
730
|
showHUD: e.showHud,
|
|
693
731
|
showNotes: e.showNotes,
|
|
694
|
-
children: e.slides.map((
|
|
732
|
+
children: e.slides.map((a, t) => zt(a, t))
|
|
695
733
|
}
|
|
696
734
|
);
|
|
697
735
|
}
|
|
698
|
-
function
|
|
736
|
+
function zt(e, a) {
|
|
699
737
|
var t;
|
|
700
|
-
return /* @__PURE__ */ s(
|
|
738
|
+
return /* @__PURE__ */ s($e, { title: e.title, notes: e.notes, background: e.background, children: (t = e.children) == null ? void 0 : t.map((i, r) => g(i, r)) }, a);
|
|
701
739
|
}
|
|
702
|
-
function
|
|
740
|
+
function g(e, a) {
|
|
703
741
|
switch (e.type) {
|
|
704
742
|
case "sequence":
|
|
705
|
-
return /* @__PURE__ */ s(
|
|
743
|
+
return /* @__PURE__ */ s(Qe, { from: e.from, durationInFrames: e.durationInFrames, name: e.name, children: e.children.map((t, i) => g(t, i)) }, a);
|
|
706
744
|
case "group":
|
|
707
|
-
return /* @__PURE__ */ s(
|
|
745
|
+
return /* @__PURE__ */ s(
|
|
746
|
+
Ge,
|
|
747
|
+
{
|
|
748
|
+
fadeIn: e.fadeIn,
|
|
749
|
+
fadeOut: e.fadeOut,
|
|
750
|
+
easing: c(e.easing),
|
|
751
|
+
rotation: e.rotation,
|
|
752
|
+
rotationOrigin: e.rotationOrigin,
|
|
753
|
+
scale: e.scale,
|
|
754
|
+
translate: e.translate,
|
|
755
|
+
zIndex: e.zIndex,
|
|
756
|
+
children: e.children.map((t, i) => g(t, i))
|
|
757
|
+
},
|
|
758
|
+
a
|
|
759
|
+
);
|
|
708
760
|
case "circle":
|
|
709
761
|
return /* @__PURE__ */ s(
|
|
710
|
-
|
|
762
|
+
He,
|
|
711
763
|
{
|
|
712
764
|
cx: e.cx,
|
|
713
765
|
cy: e.cy,
|
|
@@ -719,13 +771,18 @@ function f(e, r) {
|
|
|
719
771
|
fadeIn: e.fadeIn,
|
|
720
772
|
fadeOut: e.fadeOut,
|
|
721
773
|
draw: e.draw,
|
|
722
|
-
easing: c(e.easing)
|
|
774
|
+
easing: c(e.easing),
|
|
775
|
+
rotation: e.rotation,
|
|
776
|
+
rotationOrigin: e.rotationOrigin,
|
|
777
|
+
scale: e.scale,
|
|
778
|
+
translate: e.translate,
|
|
779
|
+
zIndex: e.zIndex
|
|
723
780
|
},
|
|
724
|
-
|
|
781
|
+
a
|
|
725
782
|
);
|
|
726
783
|
case "line":
|
|
727
784
|
return /* @__PURE__ */ s(
|
|
728
|
-
|
|
785
|
+
Ve,
|
|
729
786
|
{
|
|
730
787
|
x1: e.x1,
|
|
731
788
|
y1: e.y1,
|
|
@@ -738,13 +795,18 @@ function f(e, r) {
|
|
|
738
795
|
fadeIn: e.fadeIn,
|
|
739
796
|
fadeOut: e.fadeOut,
|
|
740
797
|
draw: e.draw,
|
|
741
|
-
easing: c(e.easing)
|
|
798
|
+
easing: c(e.easing),
|
|
799
|
+
rotation: e.rotation,
|
|
800
|
+
rotationOrigin: e.rotationOrigin,
|
|
801
|
+
scale: e.scale,
|
|
802
|
+
translate: e.translate,
|
|
803
|
+
zIndex: e.zIndex
|
|
742
804
|
},
|
|
743
|
-
|
|
805
|
+
a
|
|
744
806
|
);
|
|
745
807
|
case "arrow":
|
|
746
808
|
return /* @__PURE__ */ s(
|
|
747
|
-
|
|
809
|
+
Ue,
|
|
748
810
|
{
|
|
749
811
|
x1: e.x1,
|
|
750
812
|
y1: e.y1,
|
|
@@ -758,13 +820,18 @@ function f(e, r) {
|
|
|
758
820
|
fadeIn: e.fadeIn,
|
|
759
821
|
fadeOut: e.fadeOut,
|
|
760
822
|
draw: e.draw,
|
|
761
|
-
easing: c(e.easing)
|
|
823
|
+
easing: c(e.easing),
|
|
824
|
+
rotation: e.rotation,
|
|
825
|
+
rotationOrigin: e.rotationOrigin,
|
|
826
|
+
scale: e.scale,
|
|
827
|
+
translate: e.translate,
|
|
828
|
+
zIndex: e.zIndex
|
|
762
829
|
},
|
|
763
|
-
|
|
830
|
+
a
|
|
764
831
|
);
|
|
765
832
|
case "rect":
|
|
766
833
|
return /* @__PURE__ */ s(
|
|
767
|
-
|
|
834
|
+
Be,
|
|
768
835
|
{
|
|
769
836
|
x: e.x,
|
|
770
837
|
y: e.y,
|
|
@@ -780,13 +847,18 @@ function f(e, r) {
|
|
|
780
847
|
fadeIn: e.fadeIn,
|
|
781
848
|
fadeOut: e.fadeOut,
|
|
782
849
|
draw: e.draw,
|
|
783
|
-
easing: c(e.easing)
|
|
850
|
+
easing: c(e.easing),
|
|
851
|
+
rotation: e.rotation,
|
|
852
|
+
rotationOrigin: e.rotationOrigin,
|
|
853
|
+
scale: e.scale,
|
|
854
|
+
translate: e.translate,
|
|
855
|
+
zIndex: e.zIndex
|
|
784
856
|
},
|
|
785
|
-
|
|
857
|
+
a
|
|
786
858
|
);
|
|
787
859
|
case "polygon":
|
|
788
860
|
return /* @__PURE__ */ s(
|
|
789
|
-
|
|
861
|
+
qe,
|
|
790
862
|
{
|
|
791
863
|
points: e.points,
|
|
792
864
|
fill: e.fill,
|
|
@@ -797,13 +869,18 @@ function f(e, r) {
|
|
|
797
869
|
fadeIn: e.fadeIn,
|
|
798
870
|
fadeOut: e.fadeOut,
|
|
799
871
|
draw: e.draw,
|
|
800
|
-
easing: c(e.easing)
|
|
872
|
+
easing: c(e.easing),
|
|
873
|
+
rotation: e.rotation,
|
|
874
|
+
rotationOrigin: e.rotationOrigin,
|
|
875
|
+
scale: e.scale,
|
|
876
|
+
translate: e.translate,
|
|
877
|
+
zIndex: e.zIndex
|
|
801
878
|
},
|
|
802
|
-
|
|
879
|
+
a
|
|
803
880
|
);
|
|
804
881
|
case "text":
|
|
805
882
|
return /* @__PURE__ */ s(
|
|
806
|
-
|
|
883
|
+
je,
|
|
807
884
|
{
|
|
808
885
|
x: e.x,
|
|
809
886
|
y: e.y,
|
|
@@ -817,13 +894,42 @@ function f(e, r) {
|
|
|
817
894
|
fadeIn: e.fadeIn,
|
|
818
895
|
fadeOut: e.fadeOut,
|
|
819
896
|
easing: c(e.easing),
|
|
897
|
+
rotation: e.rotation,
|
|
898
|
+
rotationOrigin: e.rotationOrigin,
|
|
899
|
+
scale: e.scale,
|
|
900
|
+
translate: e.translate,
|
|
901
|
+
zIndex: e.zIndex,
|
|
820
902
|
children: e.content
|
|
821
903
|
},
|
|
822
|
-
|
|
904
|
+
a
|
|
905
|
+
);
|
|
906
|
+
case "image":
|
|
907
|
+
return /* @__PURE__ */ s(
|
|
908
|
+
Le,
|
|
909
|
+
{
|
|
910
|
+
src: e.src,
|
|
911
|
+
x: e.x,
|
|
912
|
+
y: e.y,
|
|
913
|
+
width: e.width,
|
|
914
|
+
height: e.height,
|
|
915
|
+
preserveAspectRatio: e.preserveAspectRatio,
|
|
916
|
+
borderRadius: e.borderRadius,
|
|
917
|
+
clipShape: e.clipShape,
|
|
918
|
+
opacity: e.opacity,
|
|
919
|
+
fadeIn: e.fadeIn,
|
|
920
|
+
fadeOut: e.fadeOut,
|
|
921
|
+
easing: c(e.easing),
|
|
922
|
+
rotation: e.rotation,
|
|
923
|
+
rotationOrigin: e.rotationOrigin,
|
|
924
|
+
scale: e.scale,
|
|
925
|
+
translate: e.translate,
|
|
926
|
+
zIndex: e.zIndex
|
|
927
|
+
},
|
|
928
|
+
a
|
|
823
929
|
);
|
|
824
930
|
case "axes":
|
|
825
931
|
return /* @__PURE__ */ s(
|
|
826
|
-
|
|
932
|
+
Te,
|
|
827
933
|
{
|
|
828
934
|
domain: e.domain,
|
|
829
935
|
range: e.range,
|
|
@@ -840,16 +946,20 @@ function f(e, r) {
|
|
|
840
946
|
fadeIn: e.fadeIn,
|
|
841
947
|
fadeOut: e.fadeOut,
|
|
842
948
|
draw: e.draw,
|
|
843
|
-
easing: c(e.easing)
|
|
949
|
+
easing: c(e.easing),
|
|
950
|
+
rotation: e.rotation,
|
|
951
|
+
rotationOrigin: e.rotationOrigin,
|
|
952
|
+
translate: e.translate,
|
|
953
|
+
zIndex: e.zIndex
|
|
844
954
|
},
|
|
845
|
-
|
|
955
|
+
a
|
|
846
956
|
);
|
|
847
957
|
case "functionPlot": {
|
|
848
|
-
const t =
|
|
958
|
+
const t = Ke(e.fn);
|
|
849
959
|
return /* @__PURE__ */ s(
|
|
850
|
-
|
|
960
|
+
De,
|
|
851
961
|
{
|
|
852
|
-
fn: (
|
|
962
|
+
fn: (i) => t({ x: i }),
|
|
853
963
|
domain: e.domain,
|
|
854
964
|
yClamp: e.yClamp,
|
|
855
965
|
origin: e.origin,
|
|
@@ -859,14 +969,18 @@ function f(e, r) {
|
|
|
859
969
|
samples: e.samples,
|
|
860
970
|
draw: e.draw,
|
|
861
971
|
easing: c(e.easing),
|
|
862
|
-
opacity: e.opacity
|
|
972
|
+
opacity: e.opacity,
|
|
973
|
+
rotation: e.rotation,
|
|
974
|
+
rotationOrigin: e.rotationOrigin,
|
|
975
|
+
translate: e.translate,
|
|
976
|
+
zIndex: e.zIndex
|
|
863
977
|
},
|
|
864
|
-
|
|
978
|
+
a
|
|
865
979
|
);
|
|
866
980
|
}
|
|
867
981
|
case "vector":
|
|
868
982
|
return /* @__PURE__ */ s(
|
|
869
|
-
|
|
983
|
+
_e,
|
|
870
984
|
{
|
|
871
985
|
from: e.from,
|
|
872
986
|
to: e.to,
|
|
@@ -882,16 +996,20 @@ function f(e, r) {
|
|
|
882
996
|
fadeIn: e.fadeIn,
|
|
883
997
|
fadeOut: e.fadeOut,
|
|
884
998
|
draw: e.draw,
|
|
885
|
-
easing: c(e.easing)
|
|
999
|
+
easing: c(e.easing),
|
|
1000
|
+
rotation: e.rotation,
|
|
1001
|
+
rotationOrigin: e.rotationOrigin,
|
|
1002
|
+
translate: e.translate,
|
|
1003
|
+
zIndex: e.zIndex
|
|
886
1004
|
},
|
|
887
|
-
|
|
1005
|
+
a
|
|
888
1006
|
);
|
|
889
1007
|
case "vectorField": {
|
|
890
|
-
const t =
|
|
1008
|
+
const t = Xe(e.fn);
|
|
891
1009
|
return /* @__PURE__ */ s(
|
|
892
1010
|
We,
|
|
893
1011
|
{
|
|
894
|
-
fn: (
|
|
1012
|
+
fn: (i, r) => t({ x: i, y: r }),
|
|
895
1013
|
domain: e.domain,
|
|
896
1014
|
range: e.range,
|
|
897
1015
|
step: e.step,
|
|
@@ -905,9 +1023,13 @@ function f(e, r) {
|
|
|
905
1023
|
maxLength: e.maxLength,
|
|
906
1024
|
fadeIn: e.fadeIn,
|
|
907
1025
|
fadeOut: e.fadeOut,
|
|
908
|
-
easing: c(e.easing)
|
|
1026
|
+
easing: c(e.easing),
|
|
1027
|
+
rotation: e.rotation,
|
|
1028
|
+
rotationOrigin: e.rotationOrigin,
|
|
1029
|
+
translate: e.translate,
|
|
1030
|
+
zIndex: e.zIndex
|
|
909
1031
|
},
|
|
910
|
-
|
|
1032
|
+
a
|
|
911
1033
|
);
|
|
912
1034
|
}
|
|
913
1035
|
case "matrix":
|
|
@@ -923,13 +1045,18 @@ function f(e, r) {
|
|
|
923
1045
|
fontSize: e.fontSize,
|
|
924
1046
|
fadeIn: e.fadeIn,
|
|
925
1047
|
fadeOut: e.fadeOut,
|
|
926
|
-
easing: c(e.easing)
|
|
1048
|
+
easing: c(e.easing),
|
|
1049
|
+
rotation: e.rotation,
|
|
1050
|
+
rotationOrigin: e.rotationOrigin,
|
|
1051
|
+
scale: e.scale,
|
|
1052
|
+
translate: e.translate,
|
|
1053
|
+
zIndex: e.zIndex
|
|
927
1054
|
},
|
|
928
|
-
|
|
1055
|
+
a
|
|
929
1056
|
);
|
|
930
1057
|
case "graph":
|
|
931
1058
|
return /* @__PURE__ */ s(
|
|
932
|
-
|
|
1059
|
+
Ne,
|
|
933
1060
|
{
|
|
934
1061
|
nodes: e.nodes,
|
|
935
1062
|
edges: e.edges,
|
|
@@ -941,13 +1068,18 @@ function f(e, r) {
|
|
|
941
1068
|
labelFontSize: e.labelFontSize,
|
|
942
1069
|
fadeIn: e.fadeIn,
|
|
943
1070
|
fadeOut: e.fadeOut,
|
|
944
|
-
easing: c(e.easing)
|
|
1071
|
+
easing: c(e.easing),
|
|
1072
|
+
rotation: e.rotation,
|
|
1073
|
+
rotationOrigin: e.rotationOrigin,
|
|
1074
|
+
scale: e.scale,
|
|
1075
|
+
translate: e.translate,
|
|
1076
|
+
zIndex: e.zIndex
|
|
945
1077
|
},
|
|
946
|
-
|
|
1078
|
+
a
|
|
947
1079
|
);
|
|
948
1080
|
case "latex":
|
|
949
1081
|
return /* @__PURE__ */ s(
|
|
950
|
-
|
|
1082
|
+
pe,
|
|
951
1083
|
{
|
|
952
1084
|
expression: e.expression,
|
|
953
1085
|
x: e.x,
|
|
@@ -957,13 +1089,18 @@ function f(e, r) {
|
|
|
957
1089
|
align: e.align,
|
|
958
1090
|
fadeIn: e.fadeIn,
|
|
959
1091
|
fadeOut: e.fadeOut,
|
|
960
|
-
easing: c(e.easing)
|
|
1092
|
+
easing: c(e.easing),
|
|
1093
|
+
rotation: e.rotation,
|
|
1094
|
+
rotationOrigin: e.rotationOrigin,
|
|
1095
|
+
scale: e.scale,
|
|
1096
|
+
translate: e.translate,
|
|
1097
|
+
zIndex: e.zIndex
|
|
961
1098
|
},
|
|
962
|
-
|
|
1099
|
+
a
|
|
963
1100
|
);
|
|
964
1101
|
case "barChart":
|
|
965
1102
|
return /* @__PURE__ */ s(
|
|
966
|
-
|
|
1103
|
+
Re,
|
|
967
1104
|
{
|
|
968
1105
|
bars: e.bars,
|
|
969
1106
|
x: e.x,
|
|
@@ -979,21 +1116,26 @@ function f(e, r) {
|
|
|
979
1116
|
valueFormat: e.valueFormat,
|
|
980
1117
|
fadeIn: e.fadeIn,
|
|
981
1118
|
fadeOut: e.fadeOut,
|
|
982
|
-
easing: c(e.easing)
|
|
1119
|
+
easing: c(e.easing),
|
|
1120
|
+
rotation: e.rotation,
|
|
1121
|
+
rotationOrigin: e.rotationOrigin,
|
|
1122
|
+
scale: e.scale,
|
|
1123
|
+
translate: e.translate,
|
|
1124
|
+
zIndex: e.zIndex
|
|
983
1125
|
},
|
|
984
|
-
|
|
1126
|
+
a
|
|
985
1127
|
);
|
|
986
1128
|
case "fadeIn":
|
|
987
|
-
return /* @__PURE__ */ s(
|
|
1129
|
+
return /* @__PURE__ */ s(Pe, { duration: e.duration, easing: c(e.easing), children: e.children.map((t, i) => g(t, i)) }, a);
|
|
988
1130
|
case "fadeOut":
|
|
989
|
-
return /* @__PURE__ */ s(
|
|
1131
|
+
return /* @__PURE__ */ s(Fe, { duration: e.duration, totalFrames: e.totalFrames, easing: c(e.easing), children: e.children.map((t, i) => g(t, i)) }, a);
|
|
990
1132
|
case "draw":
|
|
991
|
-
return /* @__PURE__ */ s(
|
|
1133
|
+
return /* @__PURE__ */ s(Ee, { duration: e.duration, pathLength: e.pathLength, easing: c(e.easing), children: g(e.children[0], 0) }, a);
|
|
992
1134
|
case "write":
|
|
993
|
-
return /* @__PURE__ */ s(
|
|
1135
|
+
return /* @__PURE__ */ s(ze, { duration: e.duration, easing: c(e.easing), children: e.children.map((t, i) => g(t, i)) }, a);
|
|
994
1136
|
case "transform":
|
|
995
1137
|
return /* @__PURE__ */ s(
|
|
996
|
-
|
|
1138
|
+
Ce,
|
|
997
1139
|
{
|
|
998
1140
|
duration: e.duration,
|
|
999
1141
|
easing: c(e.easing),
|
|
@@ -1001,13 +1143,13 @@ function f(e, r) {
|
|
|
1001
1143
|
scale: e.scale,
|
|
1002
1144
|
rotate: e.rotate,
|
|
1003
1145
|
opacity: e.opacity,
|
|
1004
|
-
children: e.children.map((t,
|
|
1146
|
+
children: e.children.map((t, i) => g(t, i))
|
|
1005
1147
|
},
|
|
1006
|
-
|
|
1148
|
+
a
|
|
1007
1149
|
);
|
|
1008
1150
|
case "morph":
|
|
1009
1151
|
return /* @__PURE__ */ s(
|
|
1010
|
-
|
|
1152
|
+
Ae,
|
|
1011
1153
|
{
|
|
1012
1154
|
duration: e.duration,
|
|
1013
1155
|
easing: c(e.easing),
|
|
@@ -1017,25 +1159,25 @@ function f(e, r) {
|
|
|
1017
1159
|
toOpacity: e.toOpacity,
|
|
1018
1160
|
fromScale: e.fromScale,
|
|
1019
1161
|
toScale: e.toScale,
|
|
1020
|
-
children: e.children.map((t,
|
|
1162
|
+
children: e.children.map((t, i) => g(t, i))
|
|
1021
1163
|
},
|
|
1022
|
-
|
|
1164
|
+
a
|
|
1023
1165
|
);
|
|
1024
1166
|
case "stagger":
|
|
1025
|
-
return /* @__PURE__ */ s(
|
|
1167
|
+
return /* @__PURE__ */ s(Oe, { staggerDelay: e.staggerDelay, easing: c(e.easing), children: e.children.map((t, i) => g(t, i)) }, a);
|
|
1026
1168
|
case "parallel":
|
|
1027
|
-
return /* @__PURE__ */ s(
|
|
1169
|
+
return /* @__PURE__ */ s(Se, { children: e.children.map((t, i) => g(t, i)) }, a);
|
|
1028
1170
|
case "scene":
|
|
1029
|
-
return /* @__PURE__ */ s(
|
|
1171
|
+
return /* @__PURE__ */ s(j.Fragment, { children: X(e) }, a);
|
|
1030
1172
|
case "player":
|
|
1031
|
-
return /* @__PURE__ */ s(
|
|
1173
|
+
return /* @__PURE__ */ s(j.Fragment, { children: Y(e) }, a);
|
|
1032
1174
|
default:
|
|
1033
1175
|
return null;
|
|
1034
1176
|
}
|
|
1035
1177
|
}
|
|
1036
|
-
class
|
|
1037
|
-
constructor(
|
|
1038
|
-
this.elements = [], this.cursor = 0, this.theme =
|
|
1178
|
+
class Et {
|
|
1179
|
+
constructor(a, t = 30, i = 900, r = 640) {
|
|
1180
|
+
this.elements = [], this.cursor = 0, this.theme = a, this._fps = t, this._width = i, this._height = r;
|
|
1039
1181
|
}
|
|
1040
1182
|
get width() {
|
|
1041
1183
|
return this._width;
|
|
@@ -1057,16 +1199,16 @@ class vt {
|
|
|
1057
1199
|
return this.cursor;
|
|
1058
1200
|
}
|
|
1059
1201
|
/** Advance the cursor by N frames */
|
|
1060
|
-
wait(
|
|
1061
|
-
return this.cursor +=
|
|
1202
|
+
wait(a) {
|
|
1203
|
+
return this.cursor += a, this;
|
|
1062
1204
|
}
|
|
1063
1205
|
/** Set cursor to an absolute frame */
|
|
1064
|
-
at(
|
|
1065
|
-
return this.cursor =
|
|
1206
|
+
at(a) {
|
|
1207
|
+
return this.cursor = a, this;
|
|
1066
1208
|
}
|
|
1067
1209
|
// ─── High-level helpers ──────────────────────────────────────────────
|
|
1068
1210
|
/** Large centered title text */
|
|
1069
|
-
title(
|
|
1211
|
+
title(a, t) {
|
|
1070
1212
|
return this.addAtCursor({
|
|
1071
1213
|
type: "fadeIn",
|
|
1072
1214
|
duration: 15,
|
|
@@ -1074,7 +1216,7 @@ class vt {
|
|
|
1074
1216
|
type: "text",
|
|
1075
1217
|
x: this.cx,
|
|
1076
1218
|
y: (t == null ? void 0 : t.y) ?? 55,
|
|
1077
|
-
content:
|
|
1219
|
+
content: a,
|
|
1078
1220
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 28,
|
|
1079
1221
|
fill: (t == null ? void 0 : t.color) ?? this.theme.title,
|
|
1080
1222
|
textAnchor: "middle",
|
|
@@ -1083,7 +1225,7 @@ class vt {
|
|
|
1083
1225
|
}, 15);
|
|
1084
1226
|
}
|
|
1085
1227
|
/** Smaller subtitle text */
|
|
1086
|
-
subtitle(
|
|
1228
|
+
subtitle(a, t) {
|
|
1087
1229
|
return this.addAtCursor({
|
|
1088
1230
|
type: "fadeIn",
|
|
1089
1231
|
duration: 12,
|
|
@@ -1091,7 +1233,7 @@ class vt {
|
|
|
1091
1233
|
type: "text",
|
|
1092
1234
|
x: this.cx,
|
|
1093
1235
|
y: (t == null ? void 0 : t.y) ?? 95,
|
|
1094
|
-
content:
|
|
1236
|
+
content: a,
|
|
1095
1237
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 16,
|
|
1096
1238
|
fill: (t == null ? void 0 : t.color) ?? this.theme.subtitle,
|
|
1097
1239
|
textAnchor: "middle"
|
|
@@ -1099,14 +1241,14 @@ class vt {
|
|
|
1099
1241
|
}, 10);
|
|
1100
1242
|
}
|
|
1101
1243
|
/** Add a LaTeX expression */
|
|
1102
|
-
latex(
|
|
1103
|
-
const
|
|
1244
|
+
latex(a, t) {
|
|
1245
|
+
const i = (t == null ? void 0 : t.fadeIn) ?? 15;
|
|
1104
1246
|
return this.addAtCursor({
|
|
1105
1247
|
type: "fadeIn",
|
|
1106
|
-
duration:
|
|
1248
|
+
duration: i,
|
|
1107
1249
|
children: [{
|
|
1108
1250
|
type: "latex",
|
|
1109
|
-
expression:
|
|
1251
|
+
expression: a,
|
|
1110
1252
|
x: (t == null ? void 0 : t.x) ?? this.cx,
|
|
1111
1253
|
y: (t == null ? void 0 : t.y) ?? 300,
|
|
1112
1254
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 28,
|
|
@@ -1116,92 +1258,92 @@ class vt {
|
|
|
1116
1258
|
}, (t == null ? void 0 : t.advance) ?? 10);
|
|
1117
1259
|
}
|
|
1118
1260
|
/** Add text at a position */
|
|
1119
|
-
text(
|
|
1120
|
-
const
|
|
1261
|
+
text(a, t) {
|
|
1262
|
+
const i = t.fadeIn ?? 15, r = t.advance ?? 5;
|
|
1121
1263
|
return this.addAtCursor({
|
|
1122
1264
|
type: "fadeIn",
|
|
1123
|
-
duration:
|
|
1265
|
+
duration: i,
|
|
1124
1266
|
children: [{
|
|
1125
1267
|
type: "text",
|
|
1126
1268
|
x: t.x,
|
|
1127
1269
|
y: t.y,
|
|
1128
|
-
content:
|
|
1270
|
+
content: a,
|
|
1129
1271
|
fontSize: t.fontSize ?? 14,
|
|
1130
1272
|
fill: t.color ?? this.theme.text,
|
|
1131
1273
|
textAnchor: t.anchor ?? "middle",
|
|
1132
1274
|
fontWeight: t.fontWeight,
|
|
1133
1275
|
fontFamily: t.fontFamily
|
|
1134
1276
|
}]
|
|
1135
|
-
},
|
|
1277
|
+
}, r);
|
|
1136
1278
|
}
|
|
1137
1279
|
/** Add an arrow */
|
|
1138
|
-
arrow(
|
|
1139
|
-
const
|
|
1280
|
+
arrow(a, t, i, r, n) {
|
|
1281
|
+
const u = (n == null ? void 0 : n.fadeIn) ?? 12, I = {
|
|
1140
1282
|
type: "arrow",
|
|
1141
|
-
x1:
|
|
1283
|
+
x1: a,
|
|
1142
1284
|
y1: t,
|
|
1143
|
-
x2:
|
|
1144
|
-
y2:
|
|
1285
|
+
x2: i,
|
|
1286
|
+
y2: r,
|
|
1145
1287
|
stroke: (n == null ? void 0 : n.color) ?? this.theme.primary,
|
|
1146
1288
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 2,
|
|
1147
1289
|
headSize: (n == null ? void 0 : n.headSize) ?? 8,
|
|
1148
1290
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1149
|
-
fadeIn:
|
|
1291
|
+
fadeIn: u
|
|
1150
1292
|
};
|
|
1151
|
-
return this.addAtCursor(
|
|
1293
|
+
return this.addAtCursor(I, (n == null ? void 0 : n.advance) ?? 3);
|
|
1152
1294
|
}
|
|
1153
1295
|
/** Add a line */
|
|
1154
|
-
line(
|
|
1155
|
-
const
|
|
1296
|
+
line(a, t, i, r, n) {
|
|
1297
|
+
const u = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1156
1298
|
return this.addAtCursor({
|
|
1157
1299
|
type: "line",
|
|
1158
|
-
x1:
|
|
1300
|
+
x1: a,
|
|
1159
1301
|
y1: t,
|
|
1160
|
-
x2:
|
|
1161
|
-
y2:
|
|
1302
|
+
x2: i,
|
|
1303
|
+
y2: r,
|
|
1162
1304
|
stroke: (n == null ? void 0 : n.color) ?? this.theme.muted,
|
|
1163
1305
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1,
|
|
1164
1306
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1165
|
-
fadeIn:
|
|
1307
|
+
fadeIn: u
|
|
1166
1308
|
}, (n == null ? void 0 : n.advance) ?? 3);
|
|
1167
1309
|
}
|
|
1168
1310
|
/** Add a rectangle */
|
|
1169
|
-
rect(
|
|
1170
|
-
const
|
|
1311
|
+
rect(a, t, i, r, n) {
|
|
1312
|
+
const u = (n == null ? void 0 : n.fadeIn) ?? 12;
|
|
1171
1313
|
return this.addAtCursor({
|
|
1172
1314
|
type: "rect",
|
|
1173
|
-
x:
|
|
1315
|
+
x: a,
|
|
1174
1316
|
y: t,
|
|
1175
|
-
width:
|
|
1176
|
-
height:
|
|
1317
|
+
width: i,
|
|
1318
|
+
height: r,
|
|
1177
1319
|
fill: (n == null ? void 0 : n.fill) ?? "none",
|
|
1178
1320
|
stroke: (n == null ? void 0 : n.stroke) ?? this.theme.boxStroke,
|
|
1179
1321
|
strokeWidth: (n == null ? void 0 : n.strokeWidth) ?? 1.5,
|
|
1180
1322
|
rx: (n == null ? void 0 : n.rx) ?? 6,
|
|
1181
1323
|
strokeDasharray: n != null && n.dashed ? "6 3" : void 0,
|
|
1182
|
-
fadeIn:
|
|
1324
|
+
fadeIn: u
|
|
1183
1325
|
}, (n == null ? void 0 : n.advance) ?? 5);
|
|
1184
1326
|
}
|
|
1185
1327
|
/** Add a circle */
|
|
1186
|
-
circle(
|
|
1187
|
-
const n = (
|
|
1328
|
+
circle(a, t, i, r) {
|
|
1329
|
+
const n = (r == null ? void 0 : r.fadeIn) ?? 12;
|
|
1188
1330
|
return this.addAtCursor({
|
|
1189
1331
|
type: "circle",
|
|
1190
|
-
cx:
|
|
1332
|
+
cx: a,
|
|
1191
1333
|
cy: t,
|
|
1192
|
-
r:
|
|
1193
|
-
fill: (
|
|
1194
|
-
stroke: (
|
|
1195
|
-
strokeWidth: (
|
|
1334
|
+
r: i,
|
|
1335
|
+
fill: (r == null ? void 0 : r.fill) ?? "none",
|
|
1336
|
+
stroke: (r == null ? void 0 : r.stroke) ?? this.theme.primary,
|
|
1337
|
+
strokeWidth: (r == null ? void 0 : r.strokeWidth) ?? 2,
|
|
1196
1338
|
fadeIn: n
|
|
1197
|
-
}, (
|
|
1339
|
+
}, (r == null ? void 0 : r.advance) ?? 5);
|
|
1198
1340
|
}
|
|
1199
1341
|
/** Add a bar chart */
|
|
1200
|
-
barChart(
|
|
1201
|
-
const
|
|
1342
|
+
barChart(a, t) {
|
|
1343
|
+
const i = t.fadeIn ?? 20;
|
|
1202
1344
|
return this.addAtCursor({
|
|
1203
1345
|
type: "barChart",
|
|
1204
|
-
bars:
|
|
1346
|
+
bars: a,
|
|
1205
1347
|
x: t.x,
|
|
1206
1348
|
y: t.y,
|
|
1207
1349
|
width: t.width,
|
|
@@ -1213,37 +1355,37 @@ class vt {
|
|
|
1213
1355
|
valueFormat: t.valueFormat,
|
|
1214
1356
|
gap: t.gap,
|
|
1215
1357
|
showValues: t.showValues,
|
|
1216
|
-
fadeIn:
|
|
1358
|
+
fadeIn: i
|
|
1217
1359
|
}, 10);
|
|
1218
1360
|
}
|
|
1219
1361
|
/** Add a matrix visualization */
|
|
1220
|
-
matrix(
|
|
1221
|
-
const
|
|
1362
|
+
matrix(a, t) {
|
|
1363
|
+
const i = (t == null ? void 0 : t.fadeIn) ?? 20;
|
|
1222
1364
|
return this.addAtCursor({
|
|
1223
1365
|
type: "matrix",
|
|
1224
|
-
values:
|
|
1366
|
+
values: a,
|
|
1225
1367
|
x: (t == null ? void 0 : t.x) ?? this.cx,
|
|
1226
1368
|
y: (t == null ? void 0 : t.y) ?? 300,
|
|
1227
1369
|
cellSize: (t == null ? void 0 : t.cellSize) ?? 50,
|
|
1228
1370
|
color: (t == null ? void 0 : t.color) ?? this.theme.text,
|
|
1229
1371
|
bracketColor: (t == null ? void 0 : t.bracketColor) ?? this.theme.primary,
|
|
1230
1372
|
fontSize: t == null ? void 0 : t.fontSize,
|
|
1231
|
-
fadeIn:
|
|
1373
|
+
fadeIn: i
|
|
1232
1374
|
}, 10);
|
|
1233
1375
|
}
|
|
1234
1376
|
/** Add a graph (nodes + edges) */
|
|
1235
|
-
graph(
|
|
1236
|
-
const
|
|
1377
|
+
graph(a, t, i) {
|
|
1378
|
+
const r = (i == null ? void 0 : i.fadeIn) ?? 20;
|
|
1237
1379
|
return this.addAtCursor({
|
|
1238
1380
|
type: "graph",
|
|
1239
|
-
nodes:
|
|
1381
|
+
nodes: a,
|
|
1240
1382
|
edges: t,
|
|
1241
|
-
nodeColor: (
|
|
1242
|
-
edgeColor: (
|
|
1243
|
-
labelColor: (
|
|
1244
|
-
nodeRadius:
|
|
1245
|
-
edgeWidth:
|
|
1246
|
-
fadeIn:
|
|
1383
|
+
nodeColor: (i == null ? void 0 : i.nodeColor) ?? this.theme.secondary,
|
|
1384
|
+
edgeColor: (i == null ? void 0 : i.edgeColor) ?? this.theme.muted,
|
|
1385
|
+
labelColor: (i == null ? void 0 : i.labelColor) ?? "#fff",
|
|
1386
|
+
nodeRadius: i == null ? void 0 : i.nodeRadius,
|
|
1387
|
+
edgeWidth: i == null ? void 0 : i.edgeWidth,
|
|
1388
|
+
fadeIn: r
|
|
1247
1389
|
}, 10);
|
|
1248
1390
|
}
|
|
1249
1391
|
// ─── Layout helpers ──────────────────────────────────────────────────
|
|
@@ -1251,34 +1393,34 @@ class vt {
|
|
|
1251
1393
|
* Render a horizontal row of labeled boxes.
|
|
1252
1394
|
* Returns the box positions for follow-up arrows, etc.
|
|
1253
1395
|
*/
|
|
1254
|
-
boxRow(
|
|
1255
|
-
const
|
|
1396
|
+
boxRow(a, t) {
|
|
1397
|
+
const i = (t == null ? void 0 : t.boxWidth) ?? 80, r = (t == null ? void 0 : t.boxHeight) ?? 40, n = (t == null ? void 0 : t.gap) ?? 12, u = (t == null ? void 0 : t.y) ?? 250, I = a.length * i + (a.length - 1) * n, O = (this._width - I) / 2;
|
|
1256
1398
|
t == null || t.fadeIn;
|
|
1257
|
-
const
|
|
1258
|
-
const
|
|
1259
|
-
return { x:
|
|
1260
|
-
}),
|
|
1399
|
+
const A = a.map((b, f) => {
|
|
1400
|
+
const m = O + f * (i + n);
|
|
1401
|
+
return { x: m, y: u, w: i, h: r, cx: m + i / 2, cy: u + r / 2 };
|
|
1402
|
+
}), C = a.map((b, f) => {
|
|
1261
1403
|
var D, T;
|
|
1262
|
-
const
|
|
1404
|
+
const m = A[f], z = ((D = t == null ? void 0 : t.colors) == null ? void 0 : D[f]) ?? this.theme.boxFill, E = ((T = t == null ? void 0 : t.strokeColors) == null ? void 0 : T[f]) ?? this.theme.boxStroke;
|
|
1263
1405
|
return {
|
|
1264
1406
|
type: "group",
|
|
1265
1407
|
children: [
|
|
1266
1408
|
{
|
|
1267
1409
|
type: "rect",
|
|
1268
|
-
x:
|
|
1269
|
-
y:
|
|
1270
|
-
width:
|
|
1271
|
-
height:
|
|
1272
|
-
fill:
|
|
1273
|
-
stroke:
|
|
1410
|
+
x: m.x,
|
|
1411
|
+
y: m.y,
|
|
1412
|
+
width: i,
|
|
1413
|
+
height: r,
|
|
1414
|
+
fill: z,
|
|
1415
|
+
stroke: E,
|
|
1274
1416
|
strokeWidth: 1.5,
|
|
1275
1417
|
rx: 6
|
|
1276
1418
|
},
|
|
1277
1419
|
{
|
|
1278
1420
|
type: "text",
|
|
1279
|
-
x:
|
|
1280
|
-
y:
|
|
1281
|
-
content:
|
|
1421
|
+
x: m.cx,
|
|
1422
|
+
y: m.cy + 5,
|
|
1423
|
+
content: b,
|
|
1282
1424
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1283
1425
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1284
1426
|
textAnchor: "middle",
|
|
@@ -1290,40 +1432,40 @@ class vt {
|
|
|
1290
1432
|
return this.addAtCursor({
|
|
1291
1433
|
type: "stagger",
|
|
1292
1434
|
staggerDelay: 3,
|
|
1293
|
-
children:
|
|
1294
|
-
}, 8 +
|
|
1435
|
+
children: C
|
|
1436
|
+
}, 8 + a.length * 2), A;
|
|
1295
1437
|
}
|
|
1296
1438
|
/**
|
|
1297
1439
|
* Render a vertical stack of labeled boxes.
|
|
1298
1440
|
*/
|
|
1299
|
-
boxColumn(
|
|
1300
|
-
const
|
|
1441
|
+
boxColumn(a, t) {
|
|
1442
|
+
const i = (t == null ? void 0 : t.boxWidth) ?? 160, r = (t == null ? void 0 : t.boxHeight) ?? 36, n = (t == null ? void 0 : t.gap) ?? 8, u = (t == null ? void 0 : t.y) ?? 150, I = (t == null ? void 0 : t.x) ?? this.cx;
|
|
1301
1443
|
t == null || t.fadeIn;
|
|
1302
|
-
const
|
|
1303
|
-
const
|
|
1304
|
-
return { x:
|
|
1305
|
-
}),
|
|
1306
|
-
var
|
|
1307
|
-
const
|
|
1444
|
+
const O = a.map((C, b) => {
|
|
1445
|
+
const f = u + b * (r + n);
|
|
1446
|
+
return { x: I - i / 2, y: f, w: i, h: r, cx: I, cy: f + r / 2 };
|
|
1447
|
+
}), A = a.map((C, b) => {
|
|
1448
|
+
var z, E;
|
|
1449
|
+
const f = O[b], m = ((z = t == null ? void 0 : t.colors) == null ? void 0 : z[b]) ?? this.theme.boxFill;
|
|
1308
1450
|
return {
|
|
1309
1451
|
type: "group",
|
|
1310
1452
|
children: [
|
|
1311
1453
|
{
|
|
1312
1454
|
type: "rect",
|
|
1313
|
-
x:
|
|
1314
|
-
y:
|
|
1315
|
-
width:
|
|
1316
|
-
height:
|
|
1317
|
-
fill:
|
|
1318
|
-
stroke: (
|
|
1455
|
+
x: f.x,
|
|
1456
|
+
y: f.y,
|
|
1457
|
+
width: i,
|
|
1458
|
+
height: r,
|
|
1459
|
+
fill: m,
|
|
1460
|
+
stroke: (E = t == null ? void 0 : t.colors) != null && E[b] ? t.colors[b] : this.theme.boxStroke,
|
|
1319
1461
|
strokeWidth: 1.5,
|
|
1320
1462
|
rx: 6
|
|
1321
1463
|
},
|
|
1322
1464
|
{
|
|
1323
1465
|
type: "text",
|
|
1324
|
-
x:
|
|
1325
|
-
y:
|
|
1326
|
-
content:
|
|
1466
|
+
x: f.cx,
|
|
1467
|
+
y: f.cy + 5,
|
|
1468
|
+
content: C,
|
|
1327
1469
|
fontSize: (t == null ? void 0 : t.fontSize) ?? 13,
|
|
1328
1470
|
fill: (t == null ? void 0 : t.textColor) ?? this.theme.text,
|
|
1329
1471
|
textAnchor: "middle"
|
|
@@ -1334,22 +1476,22 @@ class vt {
|
|
|
1334
1476
|
return this.addAtCursor({
|
|
1335
1477
|
type: "stagger",
|
|
1336
1478
|
staggerDelay: 3,
|
|
1337
|
-
children:
|
|
1338
|
-
}, 8 +
|
|
1479
|
+
children: A
|
|
1480
|
+
}, 8 + a.length * 2), O;
|
|
1339
1481
|
}
|
|
1340
1482
|
/**
|
|
1341
1483
|
* Draw arrows connecting sequential positions (e.g., output of boxRow/boxColumn).
|
|
1342
1484
|
*/
|
|
1343
|
-
connectDown(
|
|
1344
|
-
const
|
|
1345
|
-
for (let
|
|
1346
|
-
const n = r
|
|
1347
|
-
|
|
1485
|
+
connectDown(a, t) {
|
|
1486
|
+
const i = [];
|
|
1487
|
+
for (let r = 0; r < a.length - 1; r++) {
|
|
1488
|
+
const n = a[r], u = a[r + 1];
|
|
1489
|
+
i.push({
|
|
1348
1490
|
type: "arrow",
|
|
1349
1491
|
x1: n.cx,
|
|
1350
1492
|
y1: n.y + n.h + 2,
|
|
1351
|
-
x2:
|
|
1352
|
-
y2:
|
|
1493
|
+
x2: u.cx,
|
|
1494
|
+
y2: u.y - 2,
|
|
1353
1495
|
stroke: (t == null ? void 0 : t.color) ?? this.theme.muted,
|
|
1354
1496
|
strokeWidth: 1.5,
|
|
1355
1497
|
headSize: (t == null ? void 0 : t.headSize) ?? 6
|
|
@@ -1358,67 +1500,67 @@ class vt {
|
|
|
1358
1500
|
return this.addAtCursor({
|
|
1359
1501
|
type: "stagger",
|
|
1360
1502
|
staggerDelay: 2,
|
|
1361
|
-
children:
|
|
1362
|
-
}, 5 +
|
|
1503
|
+
children: i
|
|
1504
|
+
}, 5 + a.length * 2);
|
|
1363
1505
|
}
|
|
1364
1506
|
/**
|
|
1365
1507
|
* Draw arrows between two rows of boxes (fan-out pattern).
|
|
1366
1508
|
*/
|
|
1367
|
-
connectRows(
|
|
1368
|
-
const
|
|
1369
|
-
if (
|
|
1370
|
-
for (let n = 0; n <
|
|
1371
|
-
|
|
1509
|
+
connectRows(a, t, i) {
|
|
1510
|
+
const r = [];
|
|
1511
|
+
if (a.length === t.length)
|
|
1512
|
+
for (let n = 0; n < a.length; n++)
|
|
1513
|
+
r.push({
|
|
1372
1514
|
type: "arrow",
|
|
1373
|
-
x1:
|
|
1374
|
-
y1:
|
|
1515
|
+
x1: a[n].cx,
|
|
1516
|
+
y1: a[n].y + a[n].h + 2,
|
|
1375
1517
|
x2: t[n].cx,
|
|
1376
1518
|
y2: t[n].y - 2,
|
|
1377
|
-
stroke: (
|
|
1519
|
+
stroke: (i == null ? void 0 : i.color) ?? this.theme.muted,
|
|
1378
1520
|
strokeWidth: 1.5,
|
|
1379
|
-
headSize: (
|
|
1521
|
+
headSize: (i == null ? void 0 : i.headSize) ?? 6
|
|
1380
1522
|
});
|
|
1381
1523
|
return this.addAtCursor({
|
|
1382
1524
|
type: "fadeIn",
|
|
1383
1525
|
duration: 15,
|
|
1384
|
-
children:
|
|
1526
|
+
children: r
|
|
1385
1527
|
}, 15);
|
|
1386
1528
|
}
|
|
1387
1529
|
// ─── Raw element access ──────────────────────────────────────────────
|
|
1388
1530
|
/** Add any raw ElementNode at the current cursor position */
|
|
1389
|
-
add(
|
|
1390
|
-
return this.addAtCursor(
|
|
1531
|
+
add(a, t = 0) {
|
|
1532
|
+
return this.addAtCursor(a, t);
|
|
1391
1533
|
}
|
|
1392
1534
|
/** Add a raw element at a specific frame (doesn't move cursor) */
|
|
1393
|
-
addAt(
|
|
1535
|
+
addAt(a, t) {
|
|
1394
1536
|
return this.elements.push({
|
|
1395
1537
|
type: "sequence",
|
|
1396
|
-
from:
|
|
1538
|
+
from: a,
|
|
1397
1539
|
children: [t]
|
|
1398
1540
|
}), this;
|
|
1399
1541
|
}
|
|
1400
1542
|
/** Add multiple raw elements simultaneously at current cursor */
|
|
1401
|
-
addAll(
|
|
1543
|
+
addAll(a, t = 0) {
|
|
1402
1544
|
return this.addAtCursor({
|
|
1403
1545
|
type: "group",
|
|
1404
|
-
children:
|
|
1546
|
+
children: a
|
|
1405
1547
|
}, t);
|
|
1406
1548
|
}
|
|
1407
1549
|
// ─── Internal ────────────────────────────────────────────────────────
|
|
1408
|
-
addAtCursor(
|
|
1550
|
+
addAtCursor(a, t) {
|
|
1409
1551
|
return this.elements.push({
|
|
1410
1552
|
type: "sequence",
|
|
1411
1553
|
from: this.cursor,
|
|
1412
|
-
children: [
|
|
1554
|
+
children: [a]
|
|
1413
1555
|
}), this.cursor += t, this;
|
|
1414
1556
|
}
|
|
1415
1557
|
/** Build the slide's player node with all timed elements */
|
|
1416
1558
|
_build() {
|
|
1417
|
-
const
|
|
1418
|
-
return { elements: this.elements, durationInFrames:
|
|
1559
|
+
const a = Math.max(this.cursor + 60, 90);
|
|
1560
|
+
return { elements: this.elements, durationInFrames: a };
|
|
1419
1561
|
}
|
|
1420
1562
|
}
|
|
1421
|
-
const
|
|
1563
|
+
const Ft = {
|
|
1422
1564
|
background: "#0a0a1e",
|
|
1423
1565
|
title: "#e0e7ff",
|
|
1424
1566
|
subtitle: "#94a3b8",
|
|
@@ -1433,7 +1575,7 @@ const wt = {
|
|
|
1433
1575
|
warning: "#fbbf24",
|
|
1434
1576
|
error: "#f87171",
|
|
1435
1577
|
palette: ["#4fc3f7", "#a78bfa", "#f472b6", "#34d399", "#fbbf24", "#fb923c", "#6366f1", "#22d3ee"]
|
|
1436
|
-
},
|
|
1578
|
+
}, Wt = {
|
|
1437
1579
|
background: "#f8fafc",
|
|
1438
1580
|
title: "#1e293b",
|
|
1439
1581
|
subtitle: "#64748b",
|
|
@@ -1449,9 +1591,9 @@ const wt = {
|
|
|
1449
1591
|
error: "#dc2626",
|
|
1450
1592
|
palette: ["#2563eb", "#7c3aed", "#db2777", "#16a34a", "#d97706", "#ea580c", "#4f46e5", "#0891b2"]
|
|
1451
1593
|
};
|
|
1452
|
-
class
|
|
1453
|
-
constructor(
|
|
1454
|
-
this._slides = [], this._title =
|
|
1594
|
+
class Pt {
|
|
1595
|
+
constructor(a, t, i) {
|
|
1596
|
+
this._slides = [], this._title = a, this._theme = t ?? Ft, this._opts = {
|
|
1455
1597
|
width: 900,
|
|
1456
1598
|
height: 640,
|
|
1457
1599
|
fps: 30,
|
|
@@ -1459,35 +1601,35 @@ class kt {
|
|
|
1459
1601
|
transitionDuration: 10,
|
|
1460
1602
|
showHud: !0,
|
|
1461
1603
|
showNotes: !0,
|
|
1462
|
-
...
|
|
1604
|
+
...i
|
|
1463
1605
|
};
|
|
1464
1606
|
}
|
|
1465
1607
|
/** Add a slide */
|
|
1466
|
-
slide(
|
|
1467
|
-
return this._slides.push({ title:
|
|
1608
|
+
slide(a, t, i) {
|
|
1609
|
+
return this._slides.push({ title: a, build: t, notes: i == null ? void 0 : i.notes, background: i == null ? void 0 : i.background }), this;
|
|
1468
1610
|
}
|
|
1469
1611
|
/** Build the final ElucimDocument */
|
|
1470
1612
|
build() {
|
|
1471
|
-
const
|
|
1472
|
-
const
|
|
1613
|
+
const a = this._slides.map((i) => {
|
|
1614
|
+
const r = new Et(
|
|
1473
1615
|
this._theme,
|
|
1474
1616
|
this._opts.fps,
|
|
1475
1617
|
this._opts.width,
|
|
1476
1618
|
this._opts.height
|
|
1477
1619
|
);
|
|
1478
|
-
|
|
1479
|
-
const { elements: n, durationInFrames:
|
|
1620
|
+
i.build(r);
|
|
1621
|
+
const { elements: n, durationInFrames: u } = r._build();
|
|
1480
1622
|
return {
|
|
1481
1623
|
type: "slide",
|
|
1482
|
-
title:
|
|
1483
|
-
notes:
|
|
1484
|
-
background:
|
|
1624
|
+
title: i.title,
|
|
1625
|
+
notes: i.notes,
|
|
1626
|
+
background: i.background,
|
|
1485
1627
|
children: [{
|
|
1486
1628
|
type: "player",
|
|
1487
1629
|
width: this._opts.width,
|
|
1488
1630
|
height: this._opts.height,
|
|
1489
1631
|
fps: this._opts.fps,
|
|
1490
|
-
durationInFrames:
|
|
1632
|
+
durationInFrames: u,
|
|
1491
1633
|
controls: !1,
|
|
1492
1634
|
loop: !1,
|
|
1493
1635
|
autoPlay: !0,
|
|
@@ -1506,28 +1648,28 @@ class kt {
|
|
|
1506
1648
|
transitionDuration: this._opts.transitionDuration,
|
|
1507
1649
|
showHud: this._opts.showHud,
|
|
1508
1650
|
showNotes: this._opts.showNotes,
|
|
1509
|
-
slides:
|
|
1651
|
+
slides: a
|
|
1510
1652
|
}
|
|
1511
1653
|
};
|
|
1512
1654
|
}
|
|
1513
1655
|
/** Build and return as JSON string (for saving to file) */
|
|
1514
|
-
toJSON(
|
|
1515
|
-
return JSON.stringify(this.build(), null,
|
|
1656
|
+
toJSON(a = !0) {
|
|
1657
|
+
return JSON.stringify(this.build(), null, a ? 2 : void 0);
|
|
1516
1658
|
}
|
|
1517
1659
|
}
|
|
1518
|
-
function
|
|
1519
|
-
return new
|
|
1660
|
+
function _t(e, a, t) {
|
|
1661
|
+
return new Pt(e, a, t);
|
|
1520
1662
|
}
|
|
1521
1663
|
export {
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1664
|
+
Mt as DslRenderer,
|
|
1665
|
+
Pt as PresentationBuilder,
|
|
1666
|
+
Et as SlideBuilder,
|
|
1667
|
+
Ke as compileExpression,
|
|
1668
|
+
Xe as compileVectorExpression,
|
|
1669
|
+
Ft as darkTheme,
|
|
1670
|
+
Wt as lightTheme,
|
|
1671
|
+
_t as presentation,
|
|
1530
1672
|
c as resolveEasing,
|
|
1531
|
-
|
|
1532
|
-
|
|
1673
|
+
Ye as validate,
|
|
1674
|
+
H as validateExpression
|
|
1533
1675
|
};
|