@algorisys/yappydraw 0.8.291 → 0.8.293

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 (32) hide show
  1. package/README.md +2 -2
  2. package/chunks/browser-DbZP-BrN.js +641 -0
  3. package/chunks/{canva-ai-BFOytREO.js → canva-ai-B5NJGMGr.js} +1 -1
  4. package/chunks/{choice-dialog-state-BxwyrXRG.js → choice-dialog-state-Cw0WShhc.js} +1 -1
  5. package/chunks/custgeom-BeeylhzV.js +225 -0
  6. package/chunks/{design-generator-BGXMoviP.js → design-generator-BSZ2XUOE.js} +1 -1
  7. package/chunks/{drawing-engine-ChTNR20M.js → drawing-engine-DfASJ_gK.js} +1 -1
  8. package/chunks/{drawings-store-C2gQVOCO.js → drawings-store-cl-M93Eh.js} +1 -1
  9. package/chunks/{ds-operations-aFfgZej1.js → ds-operations-CXoS_Obn.js} +1 -1
  10. package/chunks/{export-game-vrAl7xq7.js → export-game-BTjE-uv-.js} +1 -1
  11. package/chunks/from-yappy-hUcG5auS.js +814 -0
  12. package/chunks/{game-runtime-CpvR1mdl.js → game-runtime-33Ly0Axb.js} +25 -25
  13. package/chunks/import-Dk___UKU.js +1635 -0
  14. package/chunks/{index-BhrKqu0C.js → index-OCtbNe3Y.js} +11456 -11207
  15. package/chunks/{index.es-Cmz4JyRm.js → index.es-m_qpxIjM.js} +1 -1
  16. package/chunks/jspdf.es.min-DGjtdWau.js +9526 -0
  17. package/chunks/{lucide-solid-DU0uSW4D.js → lucide-solid-Btzt68l9.js} +1 -1
  18. package/chunks/{markdown-to-slides-CZ_4B6Pe.js → markdown-to-slides-CNpwNPE8.js} +1 -1
  19. package/chunks/{morph-animator-CD-EWxCR.js → morph-animator-CWLzpuUc.js} +1 -1
  20. package/chunks/{onboarding-tour-DpXkBcSr.js → onboarding-tour-eLES7UJM.js} +1 -1
  21. package/chunks/{pdf-vector-BBxb3gRO.js → pdf-vector-C1l03NEO.js} +2 -2
  22. package/chunks/presets-DP49P8i2.js +379 -0
  23. package/chunks/{search-B09o2eIz.js → search-tbh5OqVp.js} +2 -2
  24. package/chunks/{slide-generator-CyshVj2x.js → slide-generator-CZfB2tSO.js} +1 -1
  25. package/chunks/{svg2pdf.es.min-BVaMJ-wC.js → svg2pdf.es.min-B6z21zR3.js} +1 -1
  26. package/chunks/{turntable-ai-cz89NMQ6.js → turntable-ai-CeD-w_eE.js} +1 -1
  27. package/chunks/write-BUtbdS9L.js +212 -0
  28. package/chunks/yappy-CvwwkLs8.css +1 -0
  29. package/package.json +1 -1
  30. package/yappy.js +6 -6
  31. package/chunks/jspdf.es.min-rJE95jGX.js +0 -9859
  32. package/chunks/yappy-FCQs01wv.css +0 -1
@@ -0,0 +1,225 @@
1
+ import { al as w } from "./index-OCtbNe3Y.js";
2
+ import { s as z, z as X } from "./browser-DbZP-BrN.js";
3
+ const Z = 9525, _ = 12700, U = (c) => {
4
+ const o = ((Number.isFinite(c) ? c : 0) % 360 + 360) % 360;
5
+ return Math.round(o * 6e4) % 216e5;
6
+ }, A = (c) => Math.max(100, Math.min(4e5, Math.round(c * (Z / _) * 100))), B = (c) => Math.round(Math.max(0, Math.min(1, c)) * 1e5), D = (c) => String(c).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]/g, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), N = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
7
+ `, R = {
8
+ a: "http://schemas.openxmlformats.org/drawingml/2006/main",
9
+ r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
10
+ p: "http://schemas.openxmlformats.org/presentationml/2006/main",
11
+ p14: "http://schemas.microsoft.com/office/powerpoint/2010/main",
12
+ mc: "http://schemas.openxmlformats.org/markup-compatibility/2006",
13
+ rel: "http://schemas.openxmlformats.org/package/2006/relationships",
14
+ ct: "http://schemas.openxmlformats.org/package/2006/content-types"
15
+ }, j = {
16
+ officeDocument: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
17
+ coreProps: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
18
+ extProps: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
19
+ slide: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",
20
+ slideLayout: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
21
+ slideMaster: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",
22
+ theme: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
23
+ image: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
24
+ presProps: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",
25
+ viewProps: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",
26
+ tableStyles: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"
27
+ }, Q = (c) => N + `<Relationships xmlns="${R.rel}">` + c.map((o) => `<Relationship Id="${D(o.id)}" Type="${o.type}" Target="${D(o.target)}"${o.external ? ' TargetMode="External"' : ""}/>`).join("") + "</Relationships>";
28
+ function Y(c) {
29
+ const o = {}, i = [...c.keys()].sort((r, n) => r === "[Content_Types].xml" ? -1 : n === "[Content_Types].xml" ? 1 : 0);
30
+ for (const r of i) {
31
+ const n = c.get(r), e = typeof n == "string" ? z(n) : n, s = typeof n != "string" && /\.(png|jpe?g|gif|webp)$/i.test(r);
32
+ o[r] = [e, { level: s ? 0 : 6 }];
33
+ }
34
+ return X(o);
35
+ }
36
+ const F = /[MmLlHhVvCcSsQqTtAaZz]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g;
37
+ function H(c) {
38
+ const o = [], i = String(c).match(F);
39
+ if (!i) return o;
40
+ let r = 0, n = "", e = 0, s = 0, y = 0, d = 0, u = 0, a = 0, g = "", h = !1;
41
+ const M = (f) => /^[A-Za-z]$/.test(f), l = () => {
42
+ if (r >= i.length || M(i[r])) return null;
43
+ const f = parseFloat(i[r++]);
44
+ return Number.isFinite(f) ? f : null;
45
+ }, $ = (f) => {
46
+ const b = [];
47
+ for (let p = 0; p < f; p++) {
48
+ const m = l();
49
+ if (m === null) return null;
50
+ b.push(m);
51
+ }
52
+ return b;
53
+ }, L = () => {
54
+ h || (o.push({ op: "M", x: e, y: s }), h = !0, y = e, d = s);
55
+ }, T = (f, b, p, m, x, t) => {
56
+ L(), o.push({ op: "C", x1: f, y1: b, x2: p, y2: m, x, y: t }), u = p, a = m, e = x, s = t;
57
+ }, k = (f, b, p, m) => {
58
+ T(e + 2 / 3 * (f - e), s + 2 / 3 * (b - s), p + 2 / 3 * (f - p), m + 2 / 3 * (b - m), p, m), u = f, a = b;
59
+ };
60
+ for (; r < i.length; ) {
61
+ if (M(i[r])) n = i[r++];
62
+ else if (!n) {
63
+ r++;
64
+ continue;
65
+ }
66
+ const f = n === n.toLowerCase(), b = n.toUpperCase(), p = f ? e : 0, m = f ? s : 0;
67
+ let x = !0;
68
+ switch (b) {
69
+ case "M": {
70
+ const t = $(2);
71
+ if (!t) {
72
+ x = !1;
73
+ break;
74
+ }
75
+ e = p + t[0], s = m + t[1], o.push({ op: "M", x: e, y: s }), h = !0, y = e, d = s, n = f ? "l" : "L";
76
+ break;
77
+ }
78
+ case "L": {
79
+ const t = $(2);
80
+ if (!t) {
81
+ x = !1;
82
+ break;
83
+ }
84
+ L(), e = p + t[0], s = m + t[1], o.push({ op: "L", x: e, y: s });
85
+ break;
86
+ }
87
+ case "H": {
88
+ const t = $(1);
89
+ if (!t) {
90
+ x = !1;
91
+ break;
92
+ }
93
+ L(), e = (f ? e : 0) + t[0], o.push({ op: "L", x: e, y: s });
94
+ break;
95
+ }
96
+ case "V": {
97
+ const t = $(1);
98
+ if (!t) {
99
+ x = !1;
100
+ break;
101
+ }
102
+ L(), s = (f ? s : 0) + t[0], o.push({ op: "L", x: e, y: s });
103
+ break;
104
+ }
105
+ case "C": {
106
+ const t = $(6);
107
+ if (!t) {
108
+ x = !1;
109
+ break;
110
+ }
111
+ T(p + t[0], m + t[1], p + t[2], m + t[3], p + t[4], m + t[5]);
112
+ break;
113
+ }
114
+ case "S": {
115
+ const t = $(4);
116
+ if (!t) {
117
+ x = !1;
118
+ break;
119
+ }
120
+ const v = /[CS]/.test(g) ? { x: 2 * e - u, y: 2 * s - a } : { x: e, y: s };
121
+ T(v.x, v.y, p + t[0], m + t[1], p + t[2], m + t[3]);
122
+ break;
123
+ }
124
+ case "Q": {
125
+ const t = $(4);
126
+ if (!t) {
127
+ x = !1;
128
+ break;
129
+ }
130
+ k(p + t[0], m + t[1], p + t[2], m + t[3]);
131
+ break;
132
+ }
133
+ case "T": {
134
+ const t = $(2);
135
+ if (!t) {
136
+ x = !1;
137
+ break;
138
+ }
139
+ const v = /[QT]/.test(g) ? { x: 2 * e - u, y: 2 * s - a } : { x: e, y: s };
140
+ k(v.x, v.y, p + t[0], m + t[1]);
141
+ break;
142
+ }
143
+ case "A": {
144
+ const t = $(7);
145
+ if (!t) {
146
+ x = !1;
147
+ break;
148
+ }
149
+ const v = p + t[5], P = m + t[6];
150
+ L();
151
+ const S = w.arcToCubics(e, s, t[0], t[1], t[2], t[3] !== 0, t[4] !== 0, v, P);
152
+ if (S.length === 0)
153
+ o.push({ op: "L", x: v, y: P }), e = v, s = P;
154
+ else for (const C of S) T(C.c1.x, C.c1.y, C.c2.x, C.c2.y, C.end.x, C.end.y);
155
+ break;
156
+ }
157
+ case "Z": {
158
+ h && o.push({ op: "Z" }), e = y, s = d, h = !1;
159
+ break;
160
+ }
161
+ default:
162
+ x = !1;
163
+ }
164
+ if (g = b, !x) break;
165
+ b === "Z" && (n = "");
166
+ }
167
+ return o;
168
+ }
169
+ function V(c, o, i, r = 1, n = 1) {
170
+ return c.map((e) => e.op === "Z" ? e : e.op === "C" ? { op: "C", x1: e.x1 * r + o, y1: e.y1 * n + i, x2: e.x2 * r + o, y2: e.y2 * n + i, x: e.x * r + o, y: e.y * n + i } : { op: e.op, x: e.x * r + o, y: e.y * n + i });
171
+ }
172
+ function K(c, o) {
173
+ const [i, r, n, e, s, y] = o, d = (a, g) => i * a + n * g + s, u = (a, g) => r * a + e * g + y;
174
+ return c.map((a) => a.op === "Z" ? a : a.op === "C" ? { op: "C", x1: d(a.x1, a.y1), y1: u(a.x1, a.y1), x2: d(a.x2, a.y2), y2: u(a.x2, a.y2), x: d(a.x, a.y), y: u(a.x, a.y) } : { op: a.op, x: d(a.x, a.y), y: u(a.x, a.y) });
175
+ }
176
+ function q(c) {
177
+ let o = 1 / 0, i = 1 / 0, r = -1 / 0, n = -1 / 0;
178
+ const e = (s, y) => {
179
+ s < o && (o = s), y < i && (i = y), s > r && (r = s), y > n && (n = y);
180
+ };
181
+ for (const s of c)
182
+ s.op !== "Z" && (s.op === "C" && (e(s.x1, s.y1), e(s.x2, s.y2)), e(s.x, s.y));
183
+ return Number.isFinite(o) ? { minX: o, minY: i, maxX: r, maxY: n } : null;
184
+ }
185
+ const G = 1e5, E = 2e9;
186
+ function J(c, o, i) {
187
+ const r = Math.max(Math.abs(o), 1e-6), n = Math.max(Math.abs(i), 1e-6), e = Math.max(1, G / Math.max(r, n)), s = Math.max(1, Math.round(r * e)), y = Math.max(1, Math.round(n * e)), d = (h) => {
188
+ const M = Math.round(h * e);
189
+ return Number.isFinite(M) ? Math.max(-E, Math.min(E, M)) : 0;
190
+ }, u = (h, M) => `<a:pt x="${d(h)}" y="${d(M)}"/>`;
191
+ let a = "";
192
+ for (const h of c) {
193
+ if (!h.cmds.some((l) => l.op !== "M" && l.op !== "Z")) continue;
194
+ const M = `w="${s}" h="${y}"${h.fill === !1 ? ' fill="none"' : ""}${h.stroke === !1 ? ' stroke="0"' : ""}`;
195
+ a += `<a:path ${M}>`;
196
+ for (const l of h.cmds)
197
+ l.op === "M" ? a += `<a:moveTo>${u(l.x, l.y)}</a:moveTo>` : l.op === "L" ? a += `<a:lnTo>${u(l.x, l.y)}</a:lnTo>` : l.op === "C" ? a += `<a:cubicBezTo>${u(l.x1, l.y1)}${u(l.x2, l.y2)}${u(l.x, l.y)}</a:cubicBezTo>` : a += "<a:close/>";
198
+ a += "</a:path>";
199
+ }
200
+ const g = (h, M) => `<a:cxn ang="0"><a:pos x="${h}" y="${M}"/></a:cxn>`;
201
+ return `<a:custGeom><a:avLst/><a:gdLst/><a:ahLst/><a:cxnLst>${g("hc", "t")}${g("l", "vc")}${g("hc", "b")}${g("r", "vc")}</a:cxnLst><a:rect l="l" t="t" r="r" b="b"/><a:pathLst>${a}</a:pathLst></a:custGeom>`;
202
+ }
203
+ const W = (c, o) => {
204
+ const i = o ? Object.entries(o).map(([r, n]) => `<a:gd name="${D(r)}" fmla="val ${Math.round(n)}"/>`).join("") : "";
205
+ return `<a:prstGeom prst="${D(c)}"><a:avLst>${i}</a:avLst></a:prstGeom>`;
206
+ };
207
+ export {
208
+ Z as E,
209
+ R as N,
210
+ j as R,
211
+ N as X,
212
+ U as a,
213
+ W as b,
214
+ J as c,
215
+ H as d,
216
+ D as e,
217
+ A as f,
218
+ q as g,
219
+ K as h,
220
+ _ as i,
221
+ B as p,
222
+ Q as r,
223
+ V as t,
224
+ Y as z
225
+ };
@@ -1,5 +1,5 @@
1
1
  import { b as x, c as S } from "./ai-providers-CycU8sO1.js";
2
- import { b as u, E as A, s as C, g as y, z as M, f as D } from "./index-BhrKqu0C.js";
2
+ import { b as u, E as A, s as C, g as y, z as M, f as D } from "./index-OCtbNe3Y.js";
3
3
  const P = 'You are a senior graphic designer. Reply with ONLY a JSON object, no markdown fences, matching exactly: {"headline": string (max 6 words), "subhead": string (max 12 words), "bullets": string[] (0-4 short items), "cta": string (max 5 words, optional), "palette": {"background": hex, "primary": hex, "accent": hex, "text": hex}}. The palette must be harmonious with strong text/background contrast.';
4
4
  function $(r) {
5
5
  try {
@@ -1,6 +1,6 @@
1
1
  import { l as w, g as v, c as g } from "./ai-providers-CycU8sO1.js";
2
2
  import { a as x } from "./image-utils-CJQBaGoQ.js";
3
- import { ac as A, ad as N } from "./index-BhrKqu0C.js";
3
+ import { az as A, aA as N } from "./index-OCtbNe3Y.js";
4
4
  function y() {
5
5
  return `You are a diagram generation assistant for YappyDraw. You output ONLY valid JSON DSL — no markdown fences, no explanation, no commentary. Just the raw JSON object.
6
6
 
@@ -1,4 +1,4 @@
1
- import { k as I, l as u, m as l, n as m, o as S, q as U, r as w, D as E, b as N, v as y, w as O, x as p, y as T, A as C, B as G } from "./index-BhrKqu0C.js";
1
+ import { k as I, l as u, m as l, n as m, o as S, q as U, r as w, D as E, b as N, v as y, w as O, x as p, y as T, A as C, B as G } from "./index-OCtbNe3Y.js";
2
2
  const f = "yappy:drawings:index", c = (t) => `yappy:drawing:${t}`;
3
3
  function $() {
4
4
  return `d-${typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.floor(Math.random() * 1e9)}`}`;
@@ -1,4 +1,4 @@
1
- import { s as p, u as d, a as g } from "./index-BhrKqu0C.js";
1
+ import { s as p, u as d, a as g } from "./index-OCtbNe3Y.js";
2
2
  function x(n) {
3
3
  return n ? n.split(",").map((r) => r.trim()).filter((r) => r.length > 0) : [];
4
4
  }