@algorisys/yappydraw 0.8.296 → 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/anim-map-D7T1mIAM.js +111 -0
- package/chunks/{canva-ai-CkUlVY-Y.js → canva-ai-wYv31lWm.js} +1 -1
- package/chunks/{choice-dialog-state-BUFvjtpq.js → choice-dialog-state-DqR_5IIZ.js} +1 -1
- package/chunks/{custgeom-DThQ1Qnp.js → custgeom-DUHYX5Vs.js} +28 -26
- package/chunks/{design-generator-BlrBbMDM.js → design-generator-DGqLbsqR.js} +1 -1
- package/chunks/{drawing-engine-KJLwmUE-.js → drawing-engine-BCPX1hm_.js} +1 -1
- package/chunks/{drawings-store-CiDEeh5h.js → drawings-store-BJW1Dmw_.js} +1 -1
- package/chunks/{ds-operations-C27tW9qb.js → ds-operations-Bi7WKGwN.js} +1 -1
- package/chunks/{export-game-Bcz0A67O.js → export-game-BkUpm1R8.js} +1 -1
- package/chunks/{from-yappy-lL1q0m9y.js → from-yappy-fz7AULvS.js} +327 -295
- package/chunks/{game-runtime-RZ6Ygr7N.js → game-runtime-Bng0zlkA.js} +40 -40
- package/chunks/import-BvGSYTzL.js +1895 -0
- package/chunks/{index-NbpsufU1.js → index-Bqlr2FLr.js} +9405 -9245
- package/chunks/{lucide-solid-DL_MnmQm.js → lucide-solid-Db2bPSrx.js} +1 -1
- package/chunks/{markdown-to-slides-D9CoIzTi.js → markdown-to-slides-D1OVYcQV.js} +1 -1
- package/chunks/{morph-animator-C_rDbafN.js → morph-animator-DCs2sEkC.js} +1 -1
- package/chunks/{onboarding-tour-B1fDeTqe.js → onboarding-tour-DoZ9Sivk.js} +1 -1
- package/chunks/{pdf-vector-ByOSpRwK.js → pdf-vector-DTgEkBKW.js} +1 -1
- package/chunks/{search-MWY5OrgG.js → search-4gFkAhbD.js} +9 -9
- package/chunks/{slide-generator-8-amet_R.js → slide-generator-D1fy8u8B.js} +1 -1
- package/chunks/{turntable-ai-DgSAtAc8.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-DFZ1uZOp.js +0 -1736
- package/chunks/write-B1-j7TNq.js +0 -265
- 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).
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const u = {
|
|
2
|
+
entr: { appear: 1, fly: 2, fade: 10, wipe: 22, bounce: 26, grow: 31, swivel: 45, spinner: 49, zoom: 53 },
|
|
3
|
+
exit: { appear: 1, fly: 2, fade: 10, wipe: 22, bounce: 26, grow: 31, swivel: 45, spinner: 49, zoom: 53 },
|
|
4
|
+
emph: { growShrink: 6, spin: 8, pulse: 26, teeter: 32 }
|
|
5
|
+
}, c = { t: 1, r: 2, b: 4, l: 8 }, a = { 1: "t", 2: "r", 4: "b", 8: "l" }, p = (e) => {
|
|
6
|
+
if (/Left/.test(e)) return "l";
|
|
7
|
+
if (/Right/.test(e)) return "r";
|
|
8
|
+
if (/InUp|OutDown/.test(e)) return "b";
|
|
9
|
+
if (/InDown|OutUp/.test(e)) return "t";
|
|
10
|
+
};
|
|
11
|
+
function l(e) {
|
|
12
|
+
const t = /Out/.test(e) || e === "hinge" || e === "textDelete" ? "exit" : /In|^flip$|^drawIn$|^scaleIn$|^jackInTheBox$|^typewriter|^charByChar$|^wordByWord$|^lineByLine$|^textScramble$|^table|^ds|^code/.test(e) ? "entr" : "emph";
|
|
13
|
+
if (t === "emph")
|
|
14
|
+
return /^(pulse|heartBeat|flash)$/.test(e) ? { cls: t, effect: "pulse" } : /^(rubberBand|jello)$/.test(e) ? { cls: t, effect: "growShrink" } : { cls: t, effect: "teeter" };
|
|
15
|
+
const r = p(e);
|
|
16
|
+
return /^(slide|back|lightSpeed)(In|Out)/.test(e) || /^fade(In|Out).*Big$/.test(e) ? { cls: t, effect: "fly", dir: r ?? "b" } : /^bounce(In|Out)/.test(e) ? { cls: t, effect: "bounce" } : /^(zoom|scale)(In|Out)|^jackInTheBox$/.test(e) ? { cls: t, effect: "zoom" } : /^(rotate|roll)(In|Out)|^hinge$/.test(e) ? { cls: t, effect: "spinner" } : /^flip/.test(e) ? { cls: t, effect: "swivel" } : /^(draw(In|Out)|typewriter|charByChar|wordByWord|lineByLine|textScramble|textDelete)/.test(e) ? { cls: t, effect: "wipe", dir: "l" } : { cls: t, effect: "fade" };
|
|
17
|
+
}
|
|
18
|
+
function h(e, n, t) {
|
|
19
|
+
const r = { target: n, start: t, durationMs: Math.max(1, Math.round(e.duration ?? 500)), delayMs: Math.max(0, Math.round(e.delay ?? 0)) }, s = typeof e.repeat == "number" && e.repeat !== 0 ? { repeat: e.repeat < 0 ? -1 : e.repeat + 1 } : {};
|
|
20
|
+
if (e.type === "preset") {
|
|
21
|
+
const { cls: i, effect: f, dir: o } = l(e.name);
|
|
22
|
+
return { ...r, ...s, cls: i, effect: f, presetId: u[i][f] ?? 10, subtype: o ? c[o] : f === "zoom" ? 16 : 0, ...o && { dir: o } };
|
|
23
|
+
}
|
|
24
|
+
if (e.type === "rotate") {
|
|
25
|
+
const i = e.relative === !1 && typeof e.fromAngle == "number" ? e.toAngle - e.fromAngle : e.toAngle;
|
|
26
|
+
return { ...r, ...s, cls: "emph", effect: "spin", presetId: 8, subtype: 0, degrees: Number(i) || 360 };
|
|
27
|
+
}
|
|
28
|
+
if (e.type === "autoSpin") {
|
|
29
|
+
const i = e.iterations === "infinite" ? 1 : Math.max(1, Number(e.iterations) || 1), f = e.direction === "counterclockwise" ? -1 : 1;
|
|
30
|
+
return {
|
|
31
|
+
...r,
|
|
32
|
+
cls: "emph",
|
|
33
|
+
effect: "spin",
|
|
34
|
+
presetId: 8,
|
|
35
|
+
subtype: 0,
|
|
36
|
+
degrees: 360 * i * f,
|
|
37
|
+
...e.iterations === "infinite" && { repeat: -1 }
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
function d(e) {
|
|
43
|
+
const n = (t) => t === "l" ? "Left" : t === "r" ? "Right" : t === "t" ? "Down" : "Up";
|
|
44
|
+
if (e.cls === "entr") switch (e.effect) {
|
|
45
|
+
case "fly":
|
|
46
|
+
return `slideIn${n(e.dir ?? "b")}`;
|
|
47
|
+
case "bounce":
|
|
48
|
+
return "bounceIn";
|
|
49
|
+
case "zoom":
|
|
50
|
+
case "grow":
|
|
51
|
+
return "zoomIn";
|
|
52
|
+
case "spinner":
|
|
53
|
+
return "rotateIn";
|
|
54
|
+
case "swivel":
|
|
55
|
+
return "flipInY";
|
|
56
|
+
case "wipe":
|
|
57
|
+
return "drawIn";
|
|
58
|
+
default:
|
|
59
|
+
return "fadeIn";
|
|
60
|
+
}
|
|
61
|
+
if (e.cls === "exit") switch (e.effect) {
|
|
62
|
+
// "slideOutLeft" leaves to the left; PowerPoint's Fly Out names the side it leaves by too.
|
|
63
|
+
case "fly":
|
|
64
|
+
return `slideOut${e.dir === "l" ? "Left" : e.dir === "r" ? "Right" : e.dir === "t" ? "Up" : "Down"}`;
|
|
65
|
+
case "bounce":
|
|
66
|
+
return "bounceOut";
|
|
67
|
+
case "zoom":
|
|
68
|
+
case "grow":
|
|
69
|
+
return "zoomOut";
|
|
70
|
+
case "spinner":
|
|
71
|
+
return "rotateOut";
|
|
72
|
+
case "swivel":
|
|
73
|
+
return "flipOutY";
|
|
74
|
+
case "wipe":
|
|
75
|
+
return "drawOut";
|
|
76
|
+
default:
|
|
77
|
+
return "fadeOut";
|
|
78
|
+
}
|
|
79
|
+
switch (e.effect) {
|
|
80
|
+
case "growShrink":
|
|
81
|
+
return "rubberBand";
|
|
82
|
+
case "teeter":
|
|
83
|
+
return "shakeX";
|
|
84
|
+
default:
|
|
85
|
+
return "pulse";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function w(e, n, t) {
|
|
89
|
+
const r = t ? e.start === "after" ? "after-prev" : "on-load" : e.start === "click" ? "on-click" : e.start === "with" ? "with-prev" : "after-prev", s = {
|
|
90
|
+
id: n,
|
|
91
|
+
trigger: r,
|
|
92
|
+
duration: Math.max(1, e.durationMs),
|
|
93
|
+
delay: Math.max(0, e.delayMs),
|
|
94
|
+
easing: "easeOutQuad",
|
|
95
|
+
...e.repeat !== void 0 && e.repeat !== 1 && { repeat: e.repeat < 0 ? -1 : Math.max(0, e.repeat - 1) },
|
|
96
|
+
// PowerPoint hides an entrance's object until it plays.
|
|
97
|
+
...e.cls === "entr" && { startHidden: !0 }
|
|
98
|
+
};
|
|
99
|
+
return e.cls === "emph" && e.effect === "spin" ? { ...s, type: "rotate", toAngle: e.degrees ?? 360, relative: !0 } : { ...s, type: "preset", name: d(e) };
|
|
100
|
+
}
|
|
101
|
+
function b(e, n) {
|
|
102
|
+
for (const [t, r] of Object.entries(u[e])) if (r === n) return { effect: t, known: !0 };
|
|
103
|
+
return { effect: e === "emph" ? "pulse" : "fade", known: !1 };
|
|
104
|
+
}
|
|
105
|
+
const g = (e) => a[e];
|
|
106
|
+
export {
|
|
107
|
+
b as e,
|
|
108
|
+
w as f,
|
|
109
|
+
g as s,
|
|
110
|
+
h as t
|
|
111
|
+
};
|
|
@@ -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)}`}`;
|