@algorisys/yappydraw 0.8.296 → 0.8.298
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/anim-map-D7T1mIAM.js +111 -0
- package/chunks/{canva-ai-CkUlVY-Y.js → canva-ai-wYv31lWm.js} +1 -1
- package/chunks/{choice-dialog-state-BUFvjtpq.js → choice-dialog-state-DqR_5IIZ.js} +1 -1
- package/chunks/{custgeom-DThQ1Qnp.js → custgeom-DUHYX5Vs.js} +28 -26
- package/chunks/{design-generator-BlrBbMDM.js → design-generator-DGqLbsqR.js} +1 -1
- package/chunks/{drawing-engine-KJLwmUE-.js → drawing-engine-BCPX1hm_.js} +1 -1
- package/chunks/{drawings-store-CiDEeh5h.js → drawings-store-BJW1Dmw_.js} +1 -1
- package/chunks/{ds-operations-C27tW9qb.js → ds-operations-Bi7WKGwN.js} +1 -1
- package/chunks/{export-game-Bcz0A67O.js → export-game-BkUpm1R8.js} +1 -1
- package/chunks/{from-yappy-lL1q0m9y.js → from-yappy-fz7AULvS.js} +327 -295
- package/chunks/{game-runtime-RZ6Ygr7N.js → game-runtime-Bng0zlkA.js} +40 -40
- package/chunks/import-BvGSYTzL.js +1895 -0
- package/chunks/{index-NbpsufU1.js → index-Bqlr2FLr.js} +9405 -9245
- package/chunks/{lucide-solid-DL_MnmQm.js → lucide-solid-Db2bPSrx.js} +1 -1
- package/chunks/{markdown-to-slides-D9CoIzTi.js → markdown-to-slides-D1OVYcQV.js} +1 -1
- package/chunks/{morph-animator-C_rDbafN.js → morph-animator-DCs2sEkC.js} +1 -1
- package/chunks/{onboarding-tour-B1fDeTqe.js → onboarding-tour-DoZ9Sivk.js} +1 -1
- package/chunks/{pdf-vector-ByOSpRwK.js → pdf-vector-DTgEkBKW.js} +1 -1
- package/chunks/{search-MWY5OrgG.js → search-4gFkAhbD.js} +9 -9
- package/chunks/{slide-generator-8-amet_R.js → slide-generator-D1fy8u8B.js} +1 -1
- package/chunks/{turntable-ai-DgSAtAc8.js → turntable-ai-C1B4jzNc.js} +1 -1
- package/chunks/write-DDXhxpu-.js +408 -0
- package/chunks/yappy-Btkc8ueG.css +1 -0
- package/package.json +1 -1
- package/yappy.js +1 -1
- package/chunks/import-DFZ1uZOp.js +0 -1736
- package/chunks/write-B1-j7TNq.js +0 -265
- package/chunks/yappy-CvwwkLs8.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as o, b as m, d as b, z as
|
|
2
|
-
const h = /* @__PURE__ */ new Set(), x = [],
|
|
1
|
+
import { s as o, b as m, d as b, z as W, h as z, g as a, i as U, j as Z } from "./index-Bqlr2FLr.js";
|
|
2
|
+
const h = /* @__PURE__ */ new Set(), x = [], G = {
|
|
3
3
|
ArrowLeft: "left",
|
|
4
4
|
a: "left",
|
|
5
5
|
A: "left",
|
|
@@ -20,10 +20,10 @@ const h = /* @__PURE__ */ new Set(), x = [], D = {
|
|
|
20
20
|
X: "b",
|
|
21
21
|
Shift: "b"
|
|
22
22
|
}, Q = (e) => {
|
|
23
|
-
h.has(e) || (h.add(e),
|
|
23
|
+
h.has(e) || (h.add(e), I(e));
|
|
24
24
|
}, q = (e) => {
|
|
25
25
|
h.delete(e);
|
|
26
|
-
},
|
|
26
|
+
}, I = (e) => {
|
|
27
27
|
for (const i of x) i.button === e && L(i.fn);
|
|
28
28
|
}, u = { x: 0, y: 0, down: !1 }, v = [], ee = (e, i) => {
|
|
29
29
|
u.x = e, u.y = i;
|
|
@@ -99,48 +99,48 @@ class A {
|
|
|
99
99
|
return this.set({ opacity: 100 });
|
|
100
100
|
}
|
|
101
101
|
destroy() {
|
|
102
|
-
|
|
102
|
+
B(this.id);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
const C = (e, i) => {
|
|
106
106
|
a("elements", (s) => s.id === e, i);
|
|
107
|
-
},
|
|
107
|
+
}, B = (e) => {
|
|
108
108
|
a("elements", (i) => i.filter((s) => s.id !== e));
|
|
109
109
|
};
|
|
110
|
-
let g = null, y = null, w = [], k = 0, M = 0, c = null,
|
|
111
|
-
const
|
|
112
|
-
let $ = null,
|
|
110
|
+
let g = null, y = null, w = [], k = 0, M = 0, c = null, T = !1, F = "", f = 0;
|
|
111
|
+
const H = "SCORE ";
|
|
112
|
+
let $ = null, N = !1, E = () => {
|
|
113
113
|
};
|
|
114
114
|
const ie = (e) => {
|
|
115
115
|
E = e;
|
|
116
|
-
},
|
|
116
|
+
}, V = (e) => {
|
|
117
117
|
$ = e, E();
|
|
118
118
|
}, P = (e) => {
|
|
119
|
-
|
|
119
|
+
T = e, N = e, E();
|
|
120
120
|
}, L = (e) => {
|
|
121
121
|
try {
|
|
122
122
|
e();
|
|
123
123
|
} catch (i) {
|
|
124
124
|
console.error("[arcade] script error:", i), m(`Game error: ${i?.message || i}`, "error"), p();
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, K = (e) => {
|
|
127
127
|
if (e.key === "Escape") {
|
|
128
128
|
p();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
const i =
|
|
132
|
-
i && (e.preventDefault(), h.has(i) || (h.add(i),
|
|
133
|
-
},
|
|
134
|
-
const i =
|
|
131
|
+
const i = G[e.key];
|
|
132
|
+
i && (e.preventDefault(), h.has(i) || (h.add(i), I(i)));
|
|
133
|
+
}, O = (e) => {
|
|
134
|
+
const i = G[e.key];
|
|
135
135
|
i && h.delete(i);
|
|
136
136
|
};
|
|
137
|
-
let
|
|
138
|
-
function
|
|
137
|
+
let J = 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 j() {
|
|
143
|
+
const e = Y(), i = {
|
|
144
144
|
strokeColor: "transparent",
|
|
145
145
|
strokeWidth: 0,
|
|
146
146
|
strokeStyle: "solid",
|
|
@@ -153,8 +153,8 @@ function Y() {
|
|
|
153
153
|
layerId: o.activeLayerId || "default-layer",
|
|
154
154
|
roundness: null
|
|
155
155
|
}, s = (n, t, r, d, l, S) => {
|
|
156
|
-
const
|
|
157
|
-
id: `game-${Date.now()}-${++
|
|
156
|
+
const D = {
|
|
157
|
+
id: `game-${Date.now()}-${++J}`,
|
|
158
158
|
type: n,
|
|
159
159
|
x: t,
|
|
160
160
|
y: r,
|
|
@@ -165,7 +165,7 @@ function Y() {
|
|
|
165
165
|
...i,
|
|
166
166
|
...S
|
|
167
167
|
};
|
|
168
|
-
return a("elements", (
|
|
168
|
+
return a("elements", (R) => [...R, D]), new A(D.id);
|
|
169
169
|
};
|
|
170
170
|
return {
|
|
171
171
|
x: e.x,
|
|
@@ -217,7 +217,7 @@ function Y() {
|
|
|
217
217
|
},
|
|
218
218
|
score: (n) => {
|
|
219
219
|
f += n;
|
|
220
|
-
const t =
|
|
220
|
+
const t = H + f;
|
|
221
221
|
if (c && o.elements.some((r) => r.id === c))
|
|
222
222
|
C(c, { text: t });
|
|
223
223
|
else {
|
|
@@ -237,20 +237,20 @@ function Y() {
|
|
|
237
237
|
getScore: () => f,
|
|
238
238
|
goToState: (n) => {
|
|
239
239
|
const t = o.states.find((r) => r.name === n || r.id === n);
|
|
240
|
-
t &&
|
|
240
|
+
t && Z(t.id);
|
|
241
241
|
},
|
|
242
242
|
playAnim: (n, t) => {
|
|
243
|
-
n?.alive && import("./index-
|
|
243
|
+
n?.alive && import("./index-Bqlr2FLr.js").then((r) => r.aY).then((r) => r.sequenceAnimator.playAnimation(n.id, { id: `bhv-${Date.now()}`, type: "preset", name: t, trigger: "programmatic" }, () => {
|
|
244
244
|
}));
|
|
245
245
|
},
|
|
246
246
|
goToPage: (n) => {
|
|
247
|
-
n >= 0 && n < o.slides.length &&
|
|
247
|
+
n >= 0 && n < o.slides.length && U(n);
|
|
248
248
|
},
|
|
249
249
|
sound: (n) => {
|
|
250
|
-
import("./index-
|
|
250
|
+
import("./index-Bqlr2FLr.js").then((t) => t.aZ).then((t) => t.playSfx(n));
|
|
251
251
|
},
|
|
252
252
|
music: (n) => {
|
|
253
|
-
import("./index-
|
|
253
|
+
import("./index-Bqlr2FLr.js").then((t) => t.aZ).then((t) => n ? t.startMusic() : t.stopMusic());
|
|
254
254
|
},
|
|
255
255
|
end: (n) => {
|
|
256
256
|
if (P(!0), n) {
|
|
@@ -266,13 +266,13 @@ function Y() {
|
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
|
-
pad: (n) =>
|
|
269
|
+
pad: (n) => V(n),
|
|
270
270
|
random: (n, t) => n + Math.random() * (t - n),
|
|
271
271
|
clamp: (n, t, r) => Math.max(t, Math.min(r, n))
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
const re = () => o.gameActive;
|
|
275
|
-
function
|
|
275
|
+
function X(e) {
|
|
276
276
|
o.gameActive && p();
|
|
277
277
|
const i = e ?? o.gameScript;
|
|
278
278
|
if (!i?.trim())
|
|
@@ -293,17 +293,17 @@ ${i}`);
|
|
|
293
293
|
}
|
|
294
294
|
b(() => {
|
|
295
295
|
a("selection", []), a("gameActive", !0), a("appMode", "presentation");
|
|
296
|
-
}),
|
|
296
|
+
}), W();
|
|
297
297
|
try {
|
|
298
|
-
s(
|
|
298
|
+
s(j());
|
|
299
299
|
} catch (t) {
|
|
300
300
|
return m(`Game error: ${t?.message || t}`, "error"), p(), !1;
|
|
301
301
|
}
|
|
302
|
-
window.addEventListener("keydown",
|
|
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
305
|
const r = Math.min(0.05, (t - M) / 1e3);
|
|
306
|
-
if (M = t,
|
|
306
|
+
if (M = t, T) return;
|
|
307
307
|
const d = (t - k) / 1e3;
|
|
308
308
|
try {
|
|
309
309
|
b(() => {
|
|
@@ -316,22 +316,22 @@ ${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",
|
|
319
|
+
if (y !== null && (cancelAnimationFrame(y), y = null), window.removeEventListener("keydown", K, !0), window.removeEventListener("keyup", O, !0), import("./index-Bqlr2FLr.js").then((e) => e.aZ).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);
|
|
323
|
-
}),
|
|
323
|
+
}), z(e.viewState);
|
|
324
324
|
} else
|
|
325
325
|
a("gameActive", !1);
|
|
326
326
|
P(!1);
|
|
327
327
|
}
|
|
328
328
|
function se() {
|
|
329
329
|
const e = F;
|
|
330
|
-
p(), e &&
|
|
330
|
+
p(), e && X(e);
|
|
331
331
|
}
|
|
332
332
|
export {
|
|
333
333
|
A as Sprite,
|
|
334
|
-
|
|
334
|
+
N as gameEnded,
|
|
335
335
|
te as gamePointerDown,
|
|
336
336
|
ee as gamePointerMove,
|
|
337
337
|
ne as gamePointerUp,
|
|
@@ -341,6 +341,6 @@ export {
|
|
|
341
341
|
q as padRelease,
|
|
342
342
|
$ as padVisibleOverride,
|
|
343
343
|
se as restartGame,
|
|
344
|
-
|
|
344
|
+
X as startGame,
|
|
345
345
|
p as stopGame
|
|
346
346
|
};
|