@algorisys/yappydraw 0.8.296 → 0.8.297

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.
Files changed (26) hide show
  1. package/README.md +2 -2
  2. package/chunks/anim-map-D7T1mIAM.js +111 -0
  3. package/chunks/{canva-ai-CkUlVY-Y.js → canva-ai-cwK_LwEk.js} +1 -1
  4. package/chunks/{choice-dialog-state-BUFvjtpq.js → choice-dialog-state-CF9ddIAk.js} +1 -1
  5. package/chunks/{custgeom-DThQ1Qnp.js → custgeom-N1NlyQKZ.js} +1 -1
  6. package/chunks/{design-generator-BlrBbMDM.js → design-generator-DSEgwQ7i.js} +1 -1
  7. package/chunks/{drawing-engine-KJLwmUE-.js → drawing-engine-CPFaJPyz.js} +1 -1
  8. package/chunks/{drawings-store-CiDEeh5h.js → drawings-store-CxGNbTN7.js} +1 -1
  9. package/chunks/{ds-operations-C27tW9qb.js → ds-operations-BTcGLr6X.js} +1 -1
  10. package/chunks/{export-game-Bcz0A67O.js → export-game-BVjxTYD1.js} +1 -1
  11. package/chunks/{from-yappy-lL1q0m9y.js → from-yappy-kTebD-0Y.js} +269 -239
  12. package/chunks/{game-runtime-RZ6Ygr7N.js → game-runtime-Ch0y0mLm.js} +27 -27
  13. package/chunks/{import-DFZ1uZOp.js → import-eCGTFoVi.js} +697 -619
  14. package/chunks/{index-NbpsufU1.js → index-zg1eC33A.js} +1941 -1936
  15. package/chunks/{lucide-solid-DL_MnmQm.js → lucide-solid-DAmszm-d.js} +1 -1
  16. package/chunks/{markdown-to-slides-D9CoIzTi.js → markdown-to-slides-CGvmGrK2.js} +1 -1
  17. package/chunks/{morph-animator-C_rDbafN.js → morph-animator-BQPPQ08b.js} +1 -1
  18. package/chunks/{onboarding-tour-B1fDeTqe.js → onboarding-tour-CpRCV3Ub.js} +1 -1
  19. package/chunks/{pdf-vector-ByOSpRwK.js → pdf-vector-D65OC03c.js} +1 -1
  20. package/chunks/{search-MWY5OrgG.js → search-rp-eRNJ6.js} +2 -2
  21. package/chunks/{slide-generator-8-amet_R.js → slide-generator-Ctxdc9Yn.js} +5 -5
  22. package/chunks/{turntable-ai-DgSAtAc8.js → turntable-ai-ZhAGEjzz.js} +1 -1
  23. package/chunks/write-ZW6FSyj1.js +327 -0
  24. package/package.json +1 -1
  25. package/yappy.js +1 -1
  26. package/chunks/write-B1-j7TNq.js +0 -265
@@ -1,5 +1,5 @@
1
- import { s as o, b as m, d as b, z as R, h as W, g as a, i as z, j as B } from "./index-NbpsufU1.js";
2
- const h = /* @__PURE__ */ new Set(), x = [], D = {
1
+ import { s as o, b as m, d as b, z as R, h as U, g as a, i as W, j as z } from "./index-zg1eC33A.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), G(e));
23
+ h.has(e) || (h.add(e), I(e));
24
24
  }, q = (e) => {
25
25
  h.delete(e);
26
- }, G = (e) => {
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,39 +99,39 @@ class A {
99
99
  return this.set({ opacity: 100 });
100
100
  }
101
101
  destroy() {
102
- H(this.id);
102
+ B(this.id);
103
103
  }
104
104
  }
105
105
  const C = (e, i) => {
106
106
  a("elements", (s) => s.id === e, i);
107
- }, H = (e) => {
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, I = !1, F = "", f = 0;
111
- const N = "SCORE ";
112
- let $ = null, V = !1, E = () => {
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
  }, J = (e) => {
117
117
  $ = e, E();
118
118
  }, P = (e) => {
119
- I = e, V = e, E();
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
- }, U = (e) => {
126
+ }, V = (e) => {
127
127
  if (e.key === "Escape") {
128
128
  p();
129
129
  return;
130
130
  }
131
- const i = D[e.key];
132
- i && (e.preventDefault(), h.has(i) || (h.add(i), G(i)));
131
+ const i = G[e.key];
132
+ i && (e.preventDefault(), h.has(i) || (h.add(i), I(i)));
133
133
  }, K = (e) => {
134
- const i = D[e.key];
134
+ const i = G[e.key];
135
135
  i && h.delete(i);
136
136
  };
137
137
  let j = 0;
@@ -153,7 +153,7 @@ function Y() {
153
153
  layerId: o.activeLayerId || "default-layer",
154
154
  roundness: null
155
155
  }, s = (n, t, r, d, l, S) => {
156
- const T = {
156
+ const D = {
157
157
  id: `game-${Date.now()}-${++j}`,
158
158
  type: n,
159
159
  x: t,
@@ -165,7 +165,7 @@ function Y() {
165
165
  ...i,
166
166
  ...S
167
167
  };
168
- return a("elements", (O) => [...O, T]), new A(T.id);
168
+ return a("elements", (O) => [...O, 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 = N + f;
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 && B(t.id);
240
+ t && z(t.id);
241
241
  },
242
242
  playAnim: (n, t) => {
243
- n?.alive && import("./index-NbpsufU1.js").then((r) => r.aT).then((r) => r.sequenceAnimator.playAnimation(n.id, { id: `bhv-${Date.now()}`, type: "preset", name: t, trigger: "programmatic" }, () => {
243
+ n?.alive && import("./index-zg1eC33A.js").then((r) => r.aU).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 && z(n);
247
+ n >= 0 && n < o.slides.length && W(n);
248
248
  },
249
249
  sound: (n) => {
250
- import("./index-NbpsufU1.js").then((t) => t.aU).then((t) => t.playSfx(n));
250
+ import("./index-zg1eC33A.js").then((t) => t.aV).then((t) => t.playSfx(n));
251
251
  },
252
252
  music: (n) => {
253
- import("./index-NbpsufU1.js").then((t) => t.aU).then((t) => n ? t.startMusic() : t.stopMusic());
253
+ import("./index-zg1eC33A.js").then((t) => t.aV).then((t) => n ? t.startMusic() : t.stopMusic());
254
254
  },
255
255
  end: (n) => {
256
256
  if (P(!0), n) {
@@ -299,11 +299,11 @@ ${i}`);
299
299
  } catch (t) {
300
300
  return m(`Game error: ${t?.message || t}`, "error"), p(), !1;
301
301
  }
302
- window.addEventListener("keydown", U, !0), window.addEventListener("keyup", K, !0), k = performance.now(), M = k;
302
+ window.addEventListener("keydown", V, !0), window.addEventListener("keyup", K, !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, I) return;
306
+ if (M = t, T) return;
307
307
  const d = (t - k) / 1e3;
308
308
  try {
309
309
  b(() => {
@@ -316,11 +316,11 @@ ${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", U, !0), window.removeEventListener("keyup", K, !0), import("./index-NbpsufU1.js").then((e) => e.aU).then((e) => e.stopMusic()), h.clear(), w = [], x.length = 0, v.length = 0, g) {
319
+ if (y !== null && (cancelAnimationFrame(y), y = null), window.removeEventListener("keydown", V, !0), window.removeEventListener("keyup", K, !0), import("./index-zg1eC33A.js").then((e) => e.aV).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
- }), W(e.viewState);
323
+ }), U(e.viewState);
324
324
  } else
325
325
  a("gameActive", !1);
326
326
  P(!1);
@@ -331,7 +331,7 @@ function se() {
331
331
  }
332
332
  export {
333
333
  A as Sprite,
334
- V as gameEnded,
334
+ N as gameEnded,
335
335
  te as gamePointerDown,
336
336
  ee as gamePointerMove,
337
337
  ne as gamePointerUp,