@algorisys/yappydraw 0.8.297 → 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/{canva-ai-cwK_LwEk.js → canva-ai-wYv31lWm.js} +1 -1
- package/chunks/{choice-dialog-state-CF9ddIAk.js → choice-dialog-state-DqR_5IIZ.js} +1 -1
- package/chunks/{custgeom-N1NlyQKZ.js → custgeom-DUHYX5Vs.js} +28 -26
- package/chunks/{design-generator-DSEgwQ7i.js → design-generator-DGqLbsqR.js} +1 -1
- package/chunks/{drawing-engine-CPFaJPyz.js → drawing-engine-BCPX1hm_.js} +1 -1
- package/chunks/{drawings-store-CxGNbTN7.js → drawings-store-BJW1Dmw_.js} +1 -1
- package/chunks/{ds-operations-BTcGLr6X.js → ds-operations-Bi7WKGwN.js} +1 -1
- package/chunks/{export-game-BVjxTYD1.js → export-game-BkUpm1R8.js} +1 -1
- package/chunks/{from-yappy-kTebD-0Y.js → from-yappy-fz7AULvS.js} +175 -173
- package/chunks/{game-runtime-Ch0y0mLm.js → game-runtime-Bng0zlkA.js} +24 -24
- package/chunks/import-BvGSYTzL.js +1895 -0
- package/chunks/{index-zg1eC33A.js → index-Bqlr2FLr.js} +9325 -9170
- package/chunks/{lucide-solid-DAmszm-d.js → lucide-solid-Db2bPSrx.js} +1 -1
- package/chunks/{markdown-to-slides-CGvmGrK2.js → markdown-to-slides-D1OVYcQV.js} +1 -1
- package/chunks/{morph-animator-BQPPQ08b.js → morph-animator-DCs2sEkC.js} +1 -1
- package/chunks/{onboarding-tour-CpRCV3Ub.js → onboarding-tour-DoZ9Sivk.js} +1 -1
- package/chunks/{pdf-vector-D65OC03c.js → pdf-vector-DTgEkBKW.js} +1 -1
- package/chunks/{search-rp-eRNJ6.js → search-4gFkAhbD.js} +9 -9
- package/chunks/{slide-generator-Ctxdc9Yn.js → slide-generator-D1fy8u8B.js} +5 -5
- package/chunks/{turntable-ai-ZhAGEjzz.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-eCGTFoVi.js +0 -1814
- package/chunks/write-ZW6FSyj1.js +0 -327
- package/chunks/yappy-CvwwkLs8.css +0 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Or with no install, from a CDN:
|
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
22
|
<script type="module">
|
|
23
|
-
import { Yappy, mount } from 'https://cdn.jsdelivr.net/npm/@algorisys/yappydraw@0.8.
|
|
23
|
+
import { Yappy, mount } from 'https://cdn.jsdelivr.net/npm/@algorisys/yappydraw@0.8.298/yappy.js'
|
|
24
24
|
</script>
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -42,4 +42,4 @@ Or with no install, from a CDN:
|
|
|
42
42
|
- **Licence: AGPL-3.0-only**, as the rest of YappyDraw. Check that it suits your project before
|
|
43
43
|
bundling it into software you distribute or run as a network service.
|
|
44
44
|
|
|
45
|
-
Source: [algorisys-oss/yappydraw @ v0.8.
|
|
45
|
+
Source: [algorisys-oss/yappydraw @ v0.8.298](https://github.com/algorisys-oss/yappydraw/tree/v0.8.298).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as w, a as P, b as E, c as T } from "./ai-providers-CycU8sO1.js";
|
|
2
|
-
import { s as u, b as r, p as y, u as b, C as B, g as v, f as j } from "./index-
|
|
2
|
+
import { s as u, b as r, p as y, u as b, C as B, g as v, f as j } from "./index-Bqlr2FLr.js";
|
|
3
3
|
const z = {
|
|
4
4
|
rewrite: "Rewrite this text to be clearer and more engaging while keeping its meaning and rough length.",
|
|
5
5
|
shorten: "Shorten this text to roughly half its length while keeping the key message.",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as w } from "./index-Bqlr2FLr.js";
|
|
2
2
|
import { s as z, z as X } from "./browser-DbZP-BrN.js";
|
|
3
3
|
const Z = 9525, _ = 12700, U = (c) => {
|
|
4
4
|
const o = ((Number.isFinite(c) ? c : 0) % 360 + 360) % 360;
|
|
5
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),
|
|
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), T = (c) => String(c).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), N = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
7
7
|
`, R = {
|
|
8
8
|
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
|
|
9
9
|
r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
|
|
@@ -26,8 +26,10 @@ const Z = 9525, _ = 12700, U = (c) => {
|
|
|
26
26
|
tableStyles: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles",
|
|
27
27
|
notesSlide: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",
|
|
28
28
|
notesMaster: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",
|
|
29
|
-
hyperlink: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
|
|
30
|
-
|
|
29
|
+
hyperlink: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
|
|
30
|
+
chart: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
|
|
31
|
+
package: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
|
|
32
|
+
}, Q = (c) => N + `<Relationships xmlns="${R.rel}">` + c.map((o) => `<Relationship Id="${T(o.id)}" Type="${o.type}" Target="${T(o.target)}"${o.external ? ' TargetMode="External"' : ""}/>`).join("") + "</Relationships>";
|
|
31
33
|
function Y(c) {
|
|
32
34
|
const o = {}, i = [...c.keys()].sort((r, n) => r === "[Content_Types].xml" ? -1 : n === "[Content_Types].xml" ? 1 : 0);
|
|
33
35
|
for (const r of i) {
|
|
@@ -40,7 +42,7 @@ const F = /[MmLlHhVvCcSsQqTtAaZz]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g;
|
|
|
40
42
|
function H(c) {
|
|
41
43
|
const o = [], i = String(c).match(F);
|
|
42
44
|
if (!i) return o;
|
|
43
|
-
let r = 0, n = "", e = 0, s = 0,
|
|
45
|
+
let r = 0, n = "", e = 0, s = 0, g = 0, d = 0, u = 0, a = 0, y = "", h = !1;
|
|
44
46
|
const M = (f) => /^[A-Za-z]$/.test(f), l = () => {
|
|
45
47
|
if (r >= i.length || M(i[r])) return null;
|
|
46
48
|
const f = parseFloat(i[r++]);
|
|
@@ -54,11 +56,11 @@ function H(c) {
|
|
|
54
56
|
}
|
|
55
57
|
return b;
|
|
56
58
|
}, L = () => {
|
|
57
|
-
h || (o.push({ op: "M", x: e, y: s }), h = !0,
|
|
58
|
-
},
|
|
59
|
+
h || (o.push({ op: "M", x: e, y: s }), h = !0, g = e, d = s);
|
|
60
|
+
}, D = (f, b, p, m, x, t) => {
|
|
59
61
|
L(), o.push({ op: "C", x1: f, y1: b, x2: p, y2: m, x, y: t }), u = p, a = m, e = x, s = t;
|
|
60
62
|
}, S = (f, b, p, m) => {
|
|
61
|
-
|
|
63
|
+
D(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;
|
|
62
64
|
};
|
|
63
65
|
for (; r < i.length; ) {
|
|
64
66
|
if (M(i[r])) n = i[r++];
|
|
@@ -75,7 +77,7 @@ function H(c) {
|
|
|
75
77
|
x = !1;
|
|
76
78
|
break;
|
|
77
79
|
}
|
|
78
|
-
e = p + t[0], s = m + t[1], o.push({ op: "M", x: e, y: s }), h = !0,
|
|
80
|
+
e = p + t[0], s = m + t[1], o.push({ op: "M", x: e, y: s }), h = !0, g = e, d = s, n = f ? "l" : "L";
|
|
79
81
|
break;
|
|
80
82
|
}
|
|
81
83
|
case "L": {
|
|
@@ -111,7 +113,7 @@ function H(c) {
|
|
|
111
113
|
x = !1;
|
|
112
114
|
break;
|
|
113
115
|
}
|
|
114
|
-
|
|
116
|
+
D(p + t[0], m + t[1], p + t[2], m + t[3], p + t[4], m + t[5]);
|
|
115
117
|
break;
|
|
116
118
|
}
|
|
117
119
|
case "S": {
|
|
@@ -120,8 +122,8 @@ function H(c) {
|
|
|
120
122
|
x = !1;
|
|
121
123
|
break;
|
|
122
124
|
}
|
|
123
|
-
const v = /[CS]/.test(
|
|
124
|
-
|
|
125
|
+
const v = /[CS]/.test(y) ? { x: 2 * e - u, y: 2 * s - a } : { x: e, y: s };
|
|
126
|
+
D(v.x, v.y, p + t[0], m + t[1], p + t[2], m + t[3]);
|
|
125
127
|
break;
|
|
126
128
|
}
|
|
127
129
|
case "Q": {
|
|
@@ -139,7 +141,7 @@ function H(c) {
|
|
|
139
141
|
x = !1;
|
|
140
142
|
break;
|
|
141
143
|
}
|
|
142
|
-
const v = /[QT]/.test(
|
|
144
|
+
const v = /[QT]/.test(y) ? { x: 2 * e - u, y: 2 * s - a } : { x: e, y: s };
|
|
143
145
|
S(v.x, v.y, p + t[0], m + t[1]);
|
|
144
146
|
break;
|
|
145
147
|
}
|
|
@@ -154,17 +156,17 @@ function H(c) {
|
|
|
154
156
|
const P = w.arcToCubics(e, s, t[0], t[1], t[2], t[3] !== 0, t[4] !== 0, v, k);
|
|
155
157
|
if (P.length === 0)
|
|
156
158
|
o.push({ op: "L", x: v, y: k }), e = v, s = k;
|
|
157
|
-
else for (const C of P)
|
|
159
|
+
else for (const C of P) D(C.c1.x, C.c1.y, C.c2.x, C.c2.y, C.end.x, C.end.y);
|
|
158
160
|
break;
|
|
159
161
|
}
|
|
160
162
|
case "Z": {
|
|
161
|
-
h && o.push({ op: "Z" }), e =
|
|
163
|
+
h && o.push({ op: "Z" }), e = g, s = d, h = !1;
|
|
162
164
|
break;
|
|
163
165
|
}
|
|
164
166
|
default:
|
|
165
167
|
x = !1;
|
|
166
168
|
}
|
|
167
|
-
if (
|
|
169
|
+
if (y = b, !x) break;
|
|
168
170
|
b === "Z" && (n = "");
|
|
169
171
|
}
|
|
170
172
|
return o;
|
|
@@ -173,13 +175,13 @@ function V(c, o, i, r = 1, n = 1) {
|
|
|
173
175
|
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 });
|
|
174
176
|
}
|
|
175
177
|
function K(c, o) {
|
|
176
|
-
const [i, r, n, e, s,
|
|
178
|
+
const [i, r, n, e, s, g] = o, d = (a, y) => i * a + n * y + s, u = (a, y) => r * a + e * y + g;
|
|
177
179
|
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) });
|
|
178
180
|
}
|
|
179
181
|
function q(c) {
|
|
180
182
|
let o = 1 / 0, i = 1 / 0, r = -1 / 0, n = -1 / 0;
|
|
181
|
-
const e = (s,
|
|
182
|
-
s < o && (o = s),
|
|
183
|
+
const e = (s, g) => {
|
|
184
|
+
s < o && (o = s), g < i && (i = g), s > r && (r = s), g > n && (n = g);
|
|
183
185
|
};
|
|
184
186
|
for (const s of c)
|
|
185
187
|
s.op !== "Z" && (s.op === "C" && (e(s.x1, s.y1), e(s.x2, s.y2)), e(s.x, s.y));
|
|
@@ -187,25 +189,25 @@ function q(c) {
|
|
|
187
189
|
}
|
|
188
190
|
const G = 1e5, E = 2e9;
|
|
189
191
|
function J(c, o, i) {
|
|
190
|
-
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)),
|
|
192
|
+
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)), g = Math.max(1, Math.round(n * e)), d = (h) => {
|
|
191
193
|
const M = Math.round(h * e);
|
|
192
194
|
return Number.isFinite(M) ? Math.max(-E, Math.min(E, M)) : 0;
|
|
193
195
|
}, u = (h, M) => `<a:pt x="${d(h)}" y="${d(M)}"/>`;
|
|
194
196
|
let a = "";
|
|
195
197
|
for (const h of c) {
|
|
196
198
|
if (!h.cmds.some((l) => l.op !== "M" && l.op !== "Z")) continue;
|
|
197
|
-
const M = `w="${s}" h="${
|
|
199
|
+
const M = `w="${s}" h="${g}"${h.fill === !1 ? ' fill="none"' : ""}${h.stroke === !1 ? ' stroke="0"' : ""}`;
|
|
198
200
|
a += `<a:path ${M}>`;
|
|
199
201
|
for (const l of h.cmds)
|
|
200
202
|
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/>";
|
|
201
203
|
a += "</a:path>";
|
|
202
204
|
}
|
|
203
|
-
const
|
|
204
|
-
return `<a:custGeom><a:avLst/><a:gdLst/><a:ahLst/><a:cxnLst>${
|
|
205
|
+
const y = (h, M) => `<a:cxn ang="0"><a:pos x="${h}" y="${M}"/></a:cxn>`;
|
|
206
|
+
return `<a:custGeom><a:avLst/><a:gdLst/><a:ahLst/><a:cxnLst>${y("hc", "t")}${y("l", "vc")}${y("hc", "b")}${y("r", "vc")}</a:cxnLst><a:rect l="l" t="t" r="r" b="b"/><a:pathLst>${a}</a:pathLst></a:custGeom>`;
|
|
205
207
|
}
|
|
206
208
|
const W = (c, o) => {
|
|
207
|
-
const i = o ? Object.entries(o).map(([r, n]) => `<a:gd name="${
|
|
208
|
-
return `<a:prstGeom prst="${
|
|
209
|
+
const i = o ? Object.entries(o).map(([r, n]) => `<a:gd name="${T(r)}" fmla="val ${Math.round(n)}"/>`).join("") : "";
|
|
210
|
+
return `<a:prstGeom prst="${T(c)}"><a:avLst>${i}</a:avLst></a:prstGeom>`;
|
|
209
211
|
};
|
|
210
212
|
export {
|
|
211
213
|
Z as E,
|
|
@@ -216,7 +218,7 @@ export {
|
|
|
216
218
|
W as b,
|
|
217
219
|
J as c,
|
|
218
220
|
H as d,
|
|
219
|
-
|
|
221
|
+
T as e,
|
|
220
222
|
A as f,
|
|
221
223
|
q as g,
|
|
222
224
|
K as h,
|
|
@@ -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-
|
|
2
|
+
import { b as u, E as A, s as C, g as y, z as M, f as D } from "./index-Bqlr2FLr.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 {
|
|
3
|
+
import { aH as A, aI as N } from "./index-Bqlr2FLr.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-
|
|
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-Bqlr2FLr.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)}`}`;
|