@algorisys/yappydraw 0.8.267 → 0.8.269

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.
@@ -1,4 +1,4 @@
1
- import { s as o, b as m, d as b, f as a, z as W, w as z, x as U, y as B } from "./index-DdYrWfgJ.js";
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-N8KIsBvL.js";
2
2
  const h = /* @__PURE__ */ new Set(), x = [], G = {
3
3
  ArrowLeft: "left",
4
4
  a: "left",
@@ -19,9 +19,9 @@ const h = /* @__PURE__ */ new Set(), x = [], G = {
19
19
  x: "b",
20
20
  X: "b",
21
21
  Shift: "b"
22
- }, Q = (e) => {
22
+ }, j = (e) => {
23
23
  h.has(e) || (h.add(e), I(e));
24
- }, q = (e) => {
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);
@@ -113,7 +113,7 @@ let $ = null, V = !1, E = () => {
113
113
  };
114
114
  const ie = (e) => {
115
115
  E = e;
116
- }, J = (e) => {
116
+ }, q = (e) => {
117
117
  $ = e, E();
118
118
  }, P = (e) => {
119
119
  T = e, V = e, E();
@@ -134,13 +134,13 @@ const ie = (e) => {
134
134
  const i = G[e.key];
135
135
  i && h.delete(i);
136
136
  };
137
- let X = 0;
138
- function Y() {
137
+ let J = 0;
138
+ function X() {
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 Z() {
143
- const e = Y(), i = {
142
+ function Y() {
143
+ const e = X(), i = {
144
144
  strokeColor: "transparent",
145
145
  strokeWidth: 0,
146
146
  strokeStyle: "solid",
@@ -154,7 +154,7 @@ function Z() {
154
154
  roundness: null
155
155
  }, s = (n, t, r, d, l, S) => {
156
156
  const D = {
157
- id: `game-${Date.now()}-${++X}`,
157
+ id: `game-${Date.now()}-${++J}`,
158
158
  type: n,
159
159
  x: t,
160
160
  y: r,
@@ -240,17 +240,17 @@ function Z() {
240
240
  t && B(t.id);
241
241
  },
242
242
  playAnim: (n, t) => {
243
- n?.alive && import("./index-DdYrWfgJ.js").then((r) => r.ao).then((r) => r.sequenceAnimator.playAnimation(n.id, { id: `bhv-${Date.now()}`, type: "preset", name: t, trigger: "programmatic" }, () => {
243
+ n?.alive && import("./index-N8KIsBvL.js").then((r) => r.ap).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
247
  n >= 0 && n < o.slides.length && U(n);
248
248
  },
249
249
  sound: (n) => {
250
- import("./index-DdYrWfgJ.js").then((t) => t.ap).then((t) => t.playSfx(n));
250
+ import("./index-N8KIsBvL.js").then((t) => t.aq).then((t) => t.playSfx(n));
251
251
  },
252
252
  music: (n) => {
253
- import("./index-DdYrWfgJ.js").then((t) => t.ap).then((t) => n ? t.startMusic() : t.stopMusic());
253
+ import("./index-N8KIsBvL.js").then((t) => t.aq).then((t) => n ? t.startMusic() : t.stopMusic());
254
254
  },
255
255
  end: (n) => {
256
256
  if (P(!0), n) {
@@ -266,13 +266,13 @@ function Z() {
266
266
  });
267
267
  }
268
268
  },
269
- pad: (n) => J(n),
269
+ pad: (n) => q(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 _(e) {
275
+ function Z(e) {
276
276
  o.gameActive && p();
277
277
  const i = e ?? o.gameScript;
278
278
  if (!i?.trim())
@@ -295,7 +295,7 @@ ${i}`);
295
295
  a("selection", []), a("gameActive", !0), a("appMode", "presentation");
296
296
  }), W();
297
297
  try {
298
- s(Z());
298
+ s(Y());
299
299
  } catch (t) {
300
300
  return m(`Game error: ${t?.message || t}`, "error"), p(), !1;
301
301
  }
@@ -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-DdYrWfgJ.js").then((e) => e.ap).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", K, !0), window.removeEventListener("keyup", O, !0), import("./index-N8KIsBvL.js").then((e) => e.aq).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 && _(e);
330
+ p(), e && Z(e);
331
331
  }
332
332
  export {
333
333
  A as Sprite,
@@ -337,10 +337,10 @@ export {
337
337
  ne as gamePointerUp,
338
338
  re as isGameRunning,
339
339
  ie as onGameUiSignal,
340
- Q as padPress,
341
- q as padRelease,
340
+ j as padPress,
341
+ Q as padRelease,
342
342
  $ as padVisibleOverride,
343
343
  se as restartGame,
344
- _ as startGame,
344
+ Z as startGame,
345
345
  p as stopGame
346
346
  };