@algorisys/yappydraw 0.8.269 → 0.8.278
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 +2 -2
- package/chunks/{canva-ai-BkG9bKiO.js → canva-ai-7n8RQQlp.js} +6 -6
- package/chunks/{choice-dialog-state-CdWJAMoe.js → choice-dialog-state-DzWAU-Fv.js} +1 -1
- package/chunks/{design-generator-C1HROSMB.js → design-generator-AHGi1XTI.js} +5 -5
- package/chunks/{drawing-engine-DolRvTFi.js → drawing-engine-DfKBHdTi.js} +1 -1
- package/chunks/{drawings-store-DENBAm4r.js → drawings-store-Cyv-1e1L.js} +41 -41
- package/chunks/{ds-operations-B2OLkKgx.js → ds-operations-C9fmILbu.js} +1 -1
- package/chunks/{export-game-aXEw7eIh.js → export-game-C1SNNfRf.js} +1 -1
- package/chunks/{game-runtime-Co1XPqU6.js → game-runtime-ztkqHa3o.js} +76 -76
- package/chunks/{index-N8KIsBvL.js → index-vjDu6_KH.js} +12361 -11597
- package/chunks/{lucide-solid-BAhUURVQ.js → lucide-solid-UJTMB-sy.js} +1 -1
- package/chunks/{markdown-to-slides-_SQjfqEn.js → markdown-to-slides-CKGVwM_7.js} +1 -1
- package/chunks/{morph-animator-DJ5foG2l.js → morph-animator-D7JpZIyR.js} +1 -1
- package/chunks/{onboarding-tour-CwCg8HQa.js → onboarding-tour-DsN4nEFc.js} +1 -1
- package/chunks/{search-DeYOOpjs.js → search-qTCHUaUH.js} +2 -2
- package/chunks/{slide-generator-rcobWUBi.js → slide-generator-CoHxujzf.js} +1 -1
- package/chunks/{turntable-ai-CnuQXeFx.js → turntable-ai-BEZd382K.js} +1 -1
- package/package.json +1 -1
- package/yappy.js +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as o, b as m, d as b, z as W, w as z, g as a, x as U, y as B } from "./index-
|
|
1
|
+
import { s as o, b as m, d as b, z as W, w as z, g as a, x as U, y as B } from "./index-vjDu6_KH.js";
|
|
2
2
|
const h = /* @__PURE__ */ new Set(), x = [], G = {
|
|
3
3
|
ArrowLeft: "left",
|
|
4
4
|
a: "left",
|
|
@@ -19,27 +19,27 @@ const h = /* @__PURE__ */ new Set(), x = [], G = {
|
|
|
19
19
|
x: "b",
|
|
20
20
|
X: "b",
|
|
21
21
|
Shift: "b"
|
|
22
|
-
},
|
|
22
|
+
}, q = (e) => {
|
|
23
23
|
h.has(e) || (h.add(e), I(e));
|
|
24
24
|
}, Q = (e) => {
|
|
25
25
|
h.delete(e);
|
|
26
26
|
}, I = (e) => {
|
|
27
|
-
for (const
|
|
28
|
-
}, u = { x: 0, y: 0, down: !1 }, v = [], ee = (e,
|
|
29
|
-
u.x = e, u.y =
|
|
30
|
-
}, te = (e,
|
|
31
|
-
u.x = e, u.y =
|
|
32
|
-
for (const s of v) L(() => s(e,
|
|
27
|
+
for (const r of x) r.button === e && L(r.fn);
|
|
28
|
+
}, u = { x: 0, y: 0, down: !1 }, v = [], ee = (e, r) => {
|
|
29
|
+
u.x = e, u.y = r;
|
|
30
|
+
}, te = (e, r) => {
|
|
31
|
+
u.x = e, u.y = r, u.down = !0;
|
|
32
|
+
for (const s of v) L(() => s(e, r));
|
|
33
33
|
}, ne = () => {
|
|
34
34
|
u.down = !1;
|
|
35
35
|
};
|
|
36
36
|
class A {
|
|
37
37
|
id;
|
|
38
|
-
constructor(
|
|
39
|
-
this.id =
|
|
38
|
+
constructor(r) {
|
|
39
|
+
this.id = r;
|
|
40
40
|
}
|
|
41
41
|
el() {
|
|
42
|
-
return o.elements.find((
|
|
42
|
+
return o.elements.find((r) => r.id === this.id);
|
|
43
43
|
}
|
|
44
44
|
get alive() {
|
|
45
45
|
return !!this.el();
|
|
@@ -64,33 +64,33 @@ class A {
|
|
|
64
64
|
}
|
|
65
65
|
/** Center coordinates. */
|
|
66
66
|
get cx() {
|
|
67
|
-
const
|
|
68
|
-
return
|
|
67
|
+
const r = this.el();
|
|
68
|
+
return r ? r.x + r.width / 2 : 0;
|
|
69
69
|
}
|
|
70
70
|
get cy() {
|
|
71
|
-
const
|
|
72
|
-
return
|
|
71
|
+
const r = this.el();
|
|
72
|
+
return r ? r.y + r.height / 2 : 0;
|
|
73
73
|
}
|
|
74
|
-
set(
|
|
75
|
-
return C(this.id,
|
|
74
|
+
set(r) {
|
|
75
|
+
return C(this.id, r), this;
|
|
76
76
|
}
|
|
77
|
-
moveTo(
|
|
78
|
-
return this.set({ x:
|
|
77
|
+
moveTo(r, s) {
|
|
78
|
+
return this.set({ x: r, y: s });
|
|
79
79
|
}
|
|
80
|
-
moveBy(
|
|
81
|
-
return this.set({ x: this.x +
|
|
80
|
+
moveBy(r, s) {
|
|
81
|
+
return this.set({ x: this.x + r, y: this.y + s });
|
|
82
82
|
}
|
|
83
|
-
centerAt(
|
|
84
|
-
return this.set({ x:
|
|
83
|
+
centerAt(r, s) {
|
|
84
|
+
return this.set({ x: r - this.width / 2, y: s - this.height / 2 });
|
|
85
85
|
}
|
|
86
|
-
rotateBy(
|
|
87
|
-
return this.set({ angle: this.angle +
|
|
86
|
+
rotateBy(r) {
|
|
87
|
+
return this.set({ angle: this.angle + r * Math.PI / 180 });
|
|
88
88
|
}
|
|
89
|
-
color(
|
|
90
|
-
return this.set({ backgroundColor:
|
|
89
|
+
color(r) {
|
|
90
|
+
return this.set({ backgroundColor: r, fillStyle: "solid" });
|
|
91
91
|
}
|
|
92
|
-
setText(
|
|
93
|
-
return this.set({ text:
|
|
92
|
+
setText(r) {
|
|
93
|
+
return this.set({ text: r });
|
|
94
94
|
}
|
|
95
95
|
hide() {
|
|
96
96
|
return this.set({ opacity: 0 });
|
|
@@ -102,45 +102,45 @@ class A {
|
|
|
102
102
|
H(this.id);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
const C = (e,
|
|
106
|
-
a("elements", (s) => s.id === e,
|
|
105
|
+
const C = (e, r) => {
|
|
106
|
+
a("elements", (s) => s.id === e, r);
|
|
107
107
|
}, H = (e) => {
|
|
108
|
-
a("elements", (
|
|
108
|
+
a("elements", (r) => r.filter((s) => s.id !== e));
|
|
109
109
|
};
|
|
110
110
|
let g = null, y = null, w = [], k = 0, M = 0, c = null, T = !1, F = "", f = 0;
|
|
111
111
|
const N = "SCORE ";
|
|
112
112
|
let $ = null, V = !1, E = () => {
|
|
113
113
|
};
|
|
114
|
-
const
|
|
114
|
+
const re = (e) => {
|
|
115
115
|
E = e;
|
|
116
|
-
},
|
|
116
|
+
}, J = (e) => {
|
|
117
117
|
$ = e, E();
|
|
118
118
|
}, P = (e) => {
|
|
119
119
|
T = e, V = e, E();
|
|
120
120
|
}, L = (e) => {
|
|
121
121
|
try {
|
|
122
122
|
e();
|
|
123
|
-
} catch (
|
|
124
|
-
console.error("[arcade] script error:",
|
|
123
|
+
} catch (r) {
|
|
124
|
+
console.error("[arcade] script error:", r), m(`Game error: ${r?.message || r}`, "error"), p();
|
|
125
125
|
}
|
|
126
126
|
}, K = (e) => {
|
|
127
127
|
if (e.key === "Escape") {
|
|
128
128
|
p();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
131
|
+
const r = G[e.key];
|
|
132
|
+
r && (e.preventDefault(), h.has(r) || (h.add(r), I(r)));
|
|
133
133
|
}, O = (e) => {
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const r = G[e.key];
|
|
135
|
+
r && h.delete(r);
|
|
136
136
|
};
|
|
137
|
-
let
|
|
138
|
-
function
|
|
137
|
+
let X = 0;
|
|
138
|
+
function Y() {
|
|
139
139
|
const e = o.slides[o.activeSlideIndex] || o.slides[0];
|
|
140
140
|
return e ? { x: e.spatialPosition.x, y: e.spatialPosition.y, width: e.dimensions.width, height: e.dimensions.height } : { x: 0, y: 0, width: 800, height: 600 };
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const e =
|
|
142
|
+
function Z() {
|
|
143
|
+
const e = Y(), r = {
|
|
144
144
|
strokeColor: "transparent",
|
|
145
145
|
strokeWidth: 0,
|
|
146
146
|
strokeStyle: "solid",
|
|
@@ -152,17 +152,17 @@ function Y() {
|
|
|
152
152
|
locked: !1,
|
|
153
153
|
layerId: o.activeLayerId || "default-layer",
|
|
154
154
|
roundness: null
|
|
155
|
-
}, s = (n, t,
|
|
155
|
+
}, s = (n, t, i, d, l, S) => {
|
|
156
156
|
const D = {
|
|
157
|
-
id: `game-${Date.now()}-${++
|
|
157
|
+
id: `game-${Date.now()}-${++X}`,
|
|
158
158
|
type: n,
|
|
159
159
|
x: t,
|
|
160
|
-
y:
|
|
160
|
+
y: i,
|
|
161
161
|
width: d,
|
|
162
162
|
height: l,
|
|
163
163
|
backgroundColor: "#3b82f6",
|
|
164
164
|
seed: 1,
|
|
165
|
-
...
|
|
165
|
+
...r,
|
|
166
166
|
...S
|
|
167
167
|
};
|
|
168
168
|
return a("elements", (R) => [...R, D]), new A(D.id);
|
|
@@ -184,12 +184,12 @@ function Y() {
|
|
|
184
184
|
v.push(n);
|
|
185
185
|
},
|
|
186
186
|
find: (n) => {
|
|
187
|
-
const t = o.elements.find((
|
|
187
|
+
const t = o.elements.find((i) => i.id === n || i.tag === n || i.text === n);
|
|
188
188
|
return t ? new A(t.id) : null;
|
|
189
189
|
},
|
|
190
190
|
findAll: (n) => o.elements.filter((t) => t.id === n || t.tag === n || t.text === n).map((t) => new A(t.id)),
|
|
191
|
-
spawn: (n, t,
|
|
192
|
-
spawnText: (n, t,
|
|
191
|
+
spawn: (n, t, i, d, l, S) => s(n, t, i, d, l, S),
|
|
192
|
+
spawnText: (n, t, i, d = 32, l) => s("text", t, i, Math.max(60, n.length * d * 0.6), d * 1.4, {
|
|
193
193
|
text: n,
|
|
194
194
|
fontSize: d,
|
|
195
195
|
textColor: "#111827",
|
|
@@ -218,13 +218,13 @@ function Y() {
|
|
|
218
218
|
score: (n) => {
|
|
219
219
|
f += n;
|
|
220
220
|
const t = N + f;
|
|
221
|
-
if (c && o.elements.some((
|
|
221
|
+
if (c && o.elements.some((i) => i.id === c))
|
|
222
222
|
C(c, { text: t });
|
|
223
223
|
else {
|
|
224
|
-
const
|
|
225
|
-
c = s("text", e.x + e.width * 0.1, e.y + 16, e.width * 0.8,
|
|
224
|
+
const i = Math.round(e.width / 18);
|
|
225
|
+
c = s("text", e.x + e.width * 0.1, e.y + 16, e.width * 0.8, i * 1.5, {
|
|
226
226
|
text: t,
|
|
227
|
-
fontSize:
|
|
227
|
+
fontSize: i,
|
|
228
228
|
textColor: "#111827",
|
|
229
229
|
textAlign: "center",
|
|
230
230
|
backgroundColor: "transparent",
|
|
@@ -236,21 +236,21 @@ function Y() {
|
|
|
236
236
|
},
|
|
237
237
|
getScore: () => f,
|
|
238
238
|
goToState: (n) => {
|
|
239
|
-
const t = o.states.find((
|
|
239
|
+
const t = o.states.find((i) => i.name === n || i.id === n);
|
|
240
240
|
t && B(t.id);
|
|
241
241
|
},
|
|
242
242
|
playAnim: (n, t) => {
|
|
243
|
-
n?.alive && import("./index-
|
|
243
|
+
n?.alive && import("./index-vjDu6_KH.js").then((i) => i.aq).then((i) => i.sequenceAnimator.playAnimation(n.id, { id: `bhv-${Date.now()}`, type: "preset", name: t, trigger: "programmatic" }, () => {
|
|
244
244
|
}));
|
|
245
245
|
},
|
|
246
246
|
goToPage: (n) => {
|
|
247
247
|
n >= 0 && n < o.slides.length && U(n);
|
|
248
248
|
},
|
|
249
249
|
sound: (n) => {
|
|
250
|
-
import("./index-
|
|
250
|
+
import("./index-vjDu6_KH.js").then((t) => t.ar).then((t) => t.playSfx(n));
|
|
251
251
|
},
|
|
252
252
|
music: (n) => {
|
|
253
|
-
import("./index-
|
|
253
|
+
import("./index-vjDu6_KH.js").then((t) => t.ar).then((t) => n ? t.startMusic() : t.stopMusic());
|
|
254
254
|
},
|
|
255
255
|
end: (n) => {
|
|
256
256
|
if (P(!0), n) {
|
|
@@ -266,16 +266,16 @@ function Y() {
|
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
|
-
pad: (n) =>
|
|
269
|
+
pad: (n) => J(n),
|
|
270
270
|
random: (n, t) => n + Math.random() * (t - n),
|
|
271
|
-
clamp: (n, t,
|
|
271
|
+
clamp: (n, t, i) => Math.max(t, Math.min(i, n))
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
function
|
|
274
|
+
const ie = () => o.gameActive;
|
|
275
|
+
function _(e) {
|
|
276
276
|
o.gameActive && p();
|
|
277
|
-
const
|
|
278
|
-
if (!
|
|
277
|
+
const r = e ?? o.gameScript;
|
|
278
|
+
if (!r?.trim())
|
|
279
279
|
return m("No game script yet — open Menu → Game Script…", "info"), !1;
|
|
280
280
|
g = {
|
|
281
281
|
elements: JSON.stringify(o.elements),
|
|
@@ -283,11 +283,11 @@ function Z(e) {
|
|
|
283
283
|
activeSlideIndex: o.activeSlideIndex,
|
|
284
284
|
appMode: o.appMode,
|
|
285
285
|
viewState: { ...o.viewState }
|
|
286
|
-
}, F =
|
|
286
|
+
}, F = r, w = [], x.length = 0, v.length = 0, h.clear(), c = null, f = 0, P(!1), $ = null;
|
|
287
287
|
let s;
|
|
288
288
|
try {
|
|
289
289
|
s = new Function("game", `'use strict';
|
|
290
|
-
${
|
|
290
|
+
${r}`);
|
|
291
291
|
} catch (t) {
|
|
292
292
|
return m(`Game script error: ${t?.message || t}`, "error"), g = null, !1;
|
|
293
293
|
}
|
|
@@ -295,19 +295,19 @@ ${i}`);
|
|
|
295
295
|
a("selection", []), a("gameActive", !0), a("appMode", "presentation");
|
|
296
296
|
}), W();
|
|
297
297
|
try {
|
|
298
|
-
s(
|
|
298
|
+
s(Z());
|
|
299
299
|
} catch (t) {
|
|
300
300
|
return m(`Game error: ${t?.message || t}`, "error"), p(), !1;
|
|
301
301
|
}
|
|
302
302
|
window.addEventListener("keydown", K, !0), window.addEventListener("keyup", O, !0), k = performance.now(), M = k;
|
|
303
303
|
const n = (t) => {
|
|
304
304
|
y = requestAnimationFrame(n);
|
|
305
|
-
const
|
|
305
|
+
const i = Math.min(0.05, (t - M) / 1e3);
|
|
306
306
|
if (M = t, T) return;
|
|
307
307
|
const d = (t - k) / 1e3;
|
|
308
308
|
try {
|
|
309
309
|
b(() => {
|
|
310
|
-
for (const l of w) l(
|
|
310
|
+
for (const l of w) l(i, d);
|
|
311
311
|
});
|
|
312
312
|
} catch (l) {
|
|
313
313
|
console.error("[arcade] tick error:", l), m(`Game error: ${l?.message || l}`, "error"), p();
|
|
@@ -316,7 +316,7 @@ ${i}`);
|
|
|
316
316
|
return y = requestAnimationFrame(n), !0;
|
|
317
317
|
}
|
|
318
318
|
function p() {
|
|
319
|
-
if (y !== null && (cancelAnimationFrame(y), y = null), window.removeEventListener("keydown", K, !0), window.removeEventListener("keyup", O, !0), import("./index-
|
|
319
|
+
if (y !== null && (cancelAnimationFrame(y), y = null), window.removeEventListener("keydown", K, !0), window.removeEventListener("keyup", O, !0), import("./index-vjDu6_KH.js").then((e) => e.ar).then((e) => e.stopMusic()), h.clear(), w = [], x.length = 0, v.length = 0, g) {
|
|
320
320
|
const e = g;
|
|
321
321
|
g = null, b(() => {
|
|
322
322
|
a("elements", JSON.parse(e.elements)), a("selection", e.selection), a("activeSlideIndex", e.activeSlideIndex), a("appMode", e.appMode), a("gameActive", !1);
|
|
@@ -327,7 +327,7 @@ function p() {
|
|
|
327
327
|
}
|
|
328
328
|
function se() {
|
|
329
329
|
const e = F;
|
|
330
|
-
p(), e &&
|
|
330
|
+
p(), e && _(e);
|
|
331
331
|
}
|
|
332
332
|
export {
|
|
333
333
|
A as Sprite,
|
|
@@ -335,12 +335,12 @@ export {
|
|
|
335
335
|
te as gamePointerDown,
|
|
336
336
|
ee as gamePointerMove,
|
|
337
337
|
ne as gamePointerUp,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
ie as isGameRunning,
|
|
339
|
+
re as onGameUiSignal,
|
|
340
|
+
q as padPress,
|
|
341
341
|
Q as padRelease,
|
|
342
342
|
$ as padVisibleOverride,
|
|
343
343
|
se as restartGame,
|
|
344
|
-
|
|
344
|
+
_ as startGame,
|
|
345
345
|
p as stopGame
|
|
346
346
|
};
|