@algorisys/yappydraw 0.8.294 → 0.8.296

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 (30) hide show
  1. package/README.md +2 -2
  2. package/chunks/{canva-ai-DqccAnxC.js → canva-ai-CkUlVY-Y.js} +1 -1
  3. package/chunks/{choice-dialog-state-10-yA9qy.js → choice-dialog-state-BUFvjtpq.js} +1 -1
  4. package/chunks/{custgeom-gp_HWEYw.js → custgeom-DThQ1Qnp.js} +1 -1
  5. package/chunks/{design-generator-DIyJ4Dr0.js → design-generator-BlrBbMDM.js} +1 -1
  6. package/chunks/{drawing-engine-nqE0zI8L.js → drawing-engine-KJLwmUE-.js} +1 -1
  7. package/chunks/{drawings-store-BFtMld-q.js → drawings-store-CiDEeh5h.js} +1 -1
  8. package/chunks/{ds-operations-40JYI4lM.js → ds-operations-C27tW9qb.js} +1 -1
  9. package/chunks/{export-game-5Kek7Bol.js → export-game-Bcz0A67O.js} +1 -1
  10. package/chunks/{from-yappy-ChRzxzZ9.js → from-yappy-lL1q0m9y.js} +31 -20
  11. package/chunks/{game-runtime--zmzKmmo.js → game-runtime-RZ6Ygr7N.js} +5 -5
  12. package/chunks/import-DFZ1uZOp.js +1736 -0
  13. package/chunks/{index-v2rH-W8-.js → index-NbpsufU1.js} +24121 -23837
  14. package/chunks/{index.es-m_qpxIjM.js → index.es-yTIj1Pnc.js} +1 -1
  15. package/chunks/{jspdf.es.min-DGjtdWau.js → jspdf.es.min-DFBFqtMo.js} +2 -2
  16. package/chunks/{lucide-solid-BHWkJbay.js → lucide-solid-DL_MnmQm.js} +1 -1
  17. package/chunks/{markdown-to-slides-siI6fZd3.js → markdown-to-slides-D9CoIzTi.js} +1 -1
  18. package/chunks/{morph-animator-klLNQx0a.js → morph-animator-C_rDbafN.js} +1 -1
  19. package/chunks/{onboarding-tour-CV0e3oyB.js → onboarding-tour-B1fDeTqe.js} +1 -1
  20. package/chunks/{pdf-vector-DLxGyE10.js → pdf-vector-ByOSpRwK.js} +2 -2
  21. package/chunks/purify.es-B0KlbA1O.js +1520 -0
  22. package/chunks/{search-53sGgwDp.js → search-MWY5OrgG.js} +2 -2
  23. package/chunks/{slide-generator-BttJgv2N.js → slide-generator-8-amet_R.js} +1 -1
  24. package/chunks/{svg2pdf.es.min-B6z21zR3.js → svg2pdf.es.min-4O9RYeoT.js} +1 -1
  25. package/chunks/{turntable-ai-7udakZBz.js → turntable-ai-DgSAtAc8.js} +1 -1
  26. package/chunks/{write-CIGfHqn4.js → write-B1-j7TNq.js} +130 -119
  27. package/package.json +1 -1
  28. package/yappy.js +1 -1
  29. package/chunks/import-DGbhv-Je.js +0 -1699
  30. package/chunks/purify.es-C2Qa7b4C.js +0 -906
@@ -1,5 +1,5 @@
1
- import { a1 as et, a2 as pt, a3 as mt, a4 as xt, a5 as gt, a6 as yt, a7 as kt, a8 as bt, a9 as G, aa as Mt, ab as wt, ac as vt, ad as St, ae as At, af as $t, ag as It, ah as Ct, ai as Tt, aj as Pt, ak as zt, al as Ft } from "./index-v2rH-W8-.js";
2
- import { d as F, g as j, t as C, h as Lt } from "./custgeom-gp_HWEYw.js";
1
+ import { a1 as et, a2 as pt, a3 as mt, a4 as xt, a5 as gt, a6 as yt, a7 as kt, a8 as bt, a9 as G, aa as Mt, ab as wt, ac as vt, ad as St, ae as At, af as $t, ag as It, ah as Ct, ai as Tt, aj as Ft, ak as Pt, al as zt } from "./index-NbpsufU1.js";
2
+ import { d as z, g as j, t as C, h as Lt } from "./custgeom-DThQ1Qnp.js";
3
3
  function Et(t) {
4
4
  const { l: n, c: e, h: r } = t, i = r * Math.PI / 180, o = e * Math.cos(i), l = e * Math.sin(i), f = n + 0.3963377774 * o + 0.2158037573 * l, s = n - 0.1055613458 * o - 0.0638541728 * l, a = n - 0.0894841775 * o - 1.291485548 * l, c = f * f * f, u = s * s * s, p = a * a * a, d = 1.2270138511 * c - 0.5577999807 * u + 0.2812561489 * p, h = -0.0405801784 * c + 1.1122568696 * u - 0.0716766787 * p, x = -0.0763812845 * c - 0.4214819787 * u + 1.5861632204 * p, g = 2.4039459 * d - 0.9898517 * h - 0.4141151 * x, k = -0.7797967 * d + 1.5445214 * h + 0.0352745 * x, m = 0.0384795 * d - 0.1141381 * h + 1.0756786 * x, y = (b) => {
5
5
  const M = Math.abs(b), w = M > 31308e-7 ? 1.055 * Math.pow(M, 1 / 2.4) - 0.055 : 12.92 * M;
@@ -58,10 +58,10 @@ function T(t) {
58
58
  }
59
59
  return Rt(n);
60
60
  }
61
- const P = /* @__PURE__ */ new Map();
61
+ const F = /* @__PURE__ */ new Map();
62
62
  let $;
63
63
  function Rt(t) {
64
- if (P.has(t)) return P.get(t);
64
+ if (F.has(t)) return F.get(t);
65
65
  let n = null;
66
66
  try {
67
67
  if ($ === void 0) {
@@ -76,7 +76,7 @@ function Rt(t) {
76
76
  } catch {
77
77
  n = null;
78
78
  }
79
- return P.size < 512 && P.set(t, n), n;
79
+ return F.size < 512 && F.set(t, n), n;
80
80
  }
81
81
  const L = (t) => "#" + t.map((n) => n.toString(16).padStart(2, "0")).join("");
82
82
  function Xt(t) {
@@ -172,13 +172,13 @@ function Wt(t, n, e, r) {
172
172
  s && (o.bulletColor = s);
173
173
  }
174
174
  t.listMarkerScale && t.listMarkerScale !== 1 && (o.bulletScale = t.listMarkerScale);
175
- const l = Ft(t), f = r(t);
175
+ const l = zt(t), f = r(t);
176
176
  return o.marL = f, o.indent = l - f, o;
177
177
  }
178
178
  function at(t, n, e, r) {
179
179
  const i = [];
180
180
  let o = { runs: [], align: n }, l = !1, f = null;
181
- const s = Pt(Yt, t, r), a = () => {
181
+ const s = Ft(Yt, t, r), a = () => {
182
182
  i.push(o), o = { runs: [], align: n }, l = !1;
183
183
  };
184
184
  for (const c of t)
@@ -232,7 +232,7 @@ function ft(t, n) {
232
232
  }
233
233
  function jt(t, n, e) {
234
234
  const r = [], i = Math.abs(n) / 2, o = Math.abs(e) / 2, l = (s, a, c) => {
235
- const u = C(F(s), i, o);
235
+ const u = C(z(s), i, o);
236
236
  if (u.length === 0) return;
237
237
  const p = a, d = { fill: p.noFill ? !1 : void 0, stroke: p.noStroke ? !1 : void 0 };
238
238
  if (c) {
@@ -386,7 +386,7 @@ function Qt(t, n) {
386
386
  const e = (t.opacity ?? 100) / 100, r = N(t, e, !0), i = bt(t), o = [];
387
387
  if (r) {
388
388
  const l = t.type === "arrow", f = l ? t.startArrowhead : null, s = l ? t.endArrowhead || (t.startArrowhead ? null : "arrow") : null, a = { ...r, head: J(f, G(t, "start"), t.strokeWidth), tail: J(s, G(t, "end"), t.strokeWidth) };
389
- if (!i.d || Kt(F(i.d), i.start, i.end)) {
389
+ if (!i.d || Kt(z(i.d), i.start, i.end)) {
390
390
  const { start: c, end: u } = i, p = {
391
391
  kind: "connector",
392
392
  id: n.nextId++,
@@ -409,7 +409,7 @@ function Qt(t, n) {
409
409
  p.start = d(t.startBinding, c), p.end = d(t.endBinding, u);
410
410
  }), o.push(p);
411
411
  } else {
412
- const c = F(i.d), u = j(c);
412
+ const c = z(i.d), u = j(c);
413
413
  if (u) {
414
414
  const p = Math.max(u.maxX - u.minX, 0.01), d = Math.max(u.maxY - u.minY, 0.01);
415
415
  o.push({
@@ -471,7 +471,7 @@ const en = (t) => {
471
471
  return e.length === 6 && e.every(Number.isFinite) ? e : [1, 0, 0, 1, 0, 0];
472
472
  }, Q = (t, n, e) => ({ x: t[0] * n + t[2] * e + t[4], y: t[1] * n + t[3] * e + t[5] });
473
473
  function rn(t) {
474
- const n = zt.generator(), e = (i) => {
474
+ const n = Pt.generator(), e = (i) => {
475
475
  for (const o of n.toPaths(i))
476
476
  t.save(), o.fill && o.fill !== "none" && (!o.stroke || o.stroke === "none") ? (t.fillStyle = o.fill, t.fillPath(o.d)) : o.stroke && o.stroke !== "none" && o.strokeWidth > 0 && (t.strokeStyle = o.stroke, t.lineWidth = o.strokeWidth, t.strokePath(o.d)), t.restore();
477
477
  return i;
@@ -540,7 +540,7 @@ function on(t) {
540
540
  f = "fail";
541
541
  return;
542
542
  }
543
- const d = en(c.getAttribute("transform")), h = Lt(F(p || ""), d);
543
+ const d = en(c.getAttribute("transform")), h = Lt(z(p || ""), d);
544
544
  if (!h.length) continue;
545
545
  const x = c.getAttribute("fill"), g = c.getAttribute("stroke"), k = !!x && x.startsWith("url("), m = +(c.getAttribute("fill-opacity") ?? 1), y = +(c.getAttribute("stroke-opacity") ?? 1);
546
546
  l.push({
@@ -637,14 +637,14 @@ function an(t, n) {
637
637
  }
638
638
  const cn = (t) => t.map((n) => n.op === "Z" ? "Z" : n.op === "C" ? `C ${n.x1} ${n.y1} ${n.x2} ${n.y2} ${n.x} ${n.y}` : `${n.op} ${n.x} ${n.y}`).join(" ");
639
639
  let B = null;
640
- const z = 28;
640
+ const P = 28;
641
641
  function D(t, n, e) {
642
642
  B ??= document.createElement("canvas").getContext("2d");
643
643
  const r = [];
644
644
  if (!B) return r;
645
645
  const i = t.map((o) => new Path2D(cn(o)));
646
- for (let o = 0; o < z; o++) for (let l = 0; l < z; l++) {
647
- const f = e.minX + (l + 0.5) / z * (e.maxX - e.minX), s = e.minY + (o + 0.5) / z * (e.maxY - e.minY);
646
+ for (let o = 0; o < P; o++) for (let l = 0; l < P; l++) {
647
+ const f = e.minX + (l + 0.5) / P * (e.maxX - e.minX), s = e.minY + (o + 0.5) / P * (e.maxY - e.minY);
648
648
  r.push(i.some((a) => B.isPointInPath(a, f, s, n)));
649
649
  }
650
650
  return r;
@@ -762,6 +762,8 @@ function dn(t) {
762
762
  return { kind: "zoom", zoomIn: !0, durationMs: n };
763
763
  case "zoom-out":
764
764
  return { kind: "zoom", zoomIn: !1, durationMs: n };
765
+ case "morph":
766
+ return { kind: "morph", durationMs: n };
765
767
  default:
766
768
  return;
767
769
  }
@@ -798,7 +800,14 @@ function xn(t) {
798
800
  if (n.kind === "slide") return { kind: "slide", key: n.slideId };
799
801
  if (n.kind === "action") return { kind: "action", action: n.action };
800
802
  }
801
- function kn(t, n, e) {
803
+ function gn(t) {
804
+ return {
805
+ ...t?.hidden && { hidden: !0 },
806
+ ...t?.advanceAfter && t.advanceAfter > 0 && { advanceAfterMs: t.advanceAfter },
807
+ ...t?.section && { section: t.section }
808
+ };
809
+ }
810
+ function bn(t, n, e) {
802
811
  const r = { ox: t.x, oy: t.y, nextId: 2, ids: /* @__PURE__ */ new Map(), glue: [], hooks: n, report: e }, i = ht(t.elements, 0, r);
803
812
  return r.glue.forEach((o) => o()), {
804
813
  name: t.name,
@@ -806,18 +815,20 @@ function kn(t, n, e) {
806
815
  background: hn(t, n),
807
816
  transition: dn(t.slide?.transition),
808
817
  notes: t.slide?.notes?.trim() ? t.slide.notes : void 0,
809
- key: t.slide?.id
818
+ key: t.slide?.id,
819
+ ...gn(t.slide)
810
820
  };
811
821
  }
812
- function bn(t, n, e, r) {
822
+ function Mn(t, n, e, r) {
813
823
  const i = Math.min(e / Math.max(t, 1), r / Math.max(n, 1));
814
824
  return { scale: i, dx: (e - t * i) / 2, dy: (r - n * i) / 2 };
815
825
  }
816
826
  export {
817
- bn as fitInto,
827
+ Mn as fitInto,
818
828
  _ as mediaOf,
819
- kn as pageToSlide,
829
+ bn as pageToSlide,
820
830
  pn as remapPageStops,
831
+ gn as showFields,
821
832
  S as toColor,
822
833
  dn as transitionOf,
823
834
  rt as typefaceOf
@@ -1,4 +1,4 @@
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-v2rH-W8-.js";
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
2
  const h = /* @__PURE__ */ new Set(), x = [], D = {
3
3
  ArrowLeft: "left",
4
4
  a: "left",
@@ -240,17 +240,17 @@ function Y() {
240
240
  t && B(t.id);
241
241
  },
242
242
  playAnim: (n, t) => {
243
- n?.alive && import("./index-v2rH-W8-.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-NbpsufU1.js").then((r) => r.aT).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 && z(n);
248
248
  },
249
249
  sound: (n) => {
250
- import("./index-v2rH-W8-.js").then((t) => t.aU).then((t) => t.playSfx(n));
250
+ import("./index-NbpsufU1.js").then((t) => t.aU).then((t) => t.playSfx(n));
251
251
  },
252
252
  music: (n) => {
253
- import("./index-v2rH-W8-.js").then((t) => t.aU).then((t) => n ? t.startMusic() : t.stopMusic());
253
+ import("./index-NbpsufU1.js").then((t) => t.aU).then((t) => n ? t.startMusic() : t.stopMusic());
254
254
  },
255
255
  end: (n) => {
256
256
  if (P(!0), n) {
@@ -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", U, !0), window.removeEventListener("keyup", K, !0), import("./index-v2rH-W8-.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", 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) {
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);