@algorisys/yappydraw 0.8.268 → 0.8.271
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-5A6-Ox6J.js → canva-ai-C6wDVbtw.js} +6 -6
- package/chunks/{choice-dialog-state-C6UPDRfB.js → choice-dialog-state-BJMeLvok.js} +1 -1
- package/chunks/{design-generator-ayC10OUL.js → design-generator-zAGXW6v7.js} +1 -1
- package/chunks/{drawing-engine-BIAZC4JC.js → drawing-engine-C4_X8tGW.js} +1 -1
- package/chunks/{drawings-store-Cz-Cs6tN.js → drawings-store-DyvjSnjC.js} +41 -41
- package/chunks/{ds-operations-Yj-uBIlD.js → ds-operations-CLjpQNpM.js} +1 -1
- package/chunks/{export-game-DUPH1sTG.js → export-game-D0bFrjKk.js} +11 -11
- package/chunks/{game-runtime-DZ_kL5Ka.js → game-runtime-BKK-V2yX.js} +68 -68
- package/chunks/{index-BML9nyo0.js → index-Cbilitsx.js} +12067 -11949
- package/chunks/{lucide-solid-CUsw7npY.js → lucide-solid-CD2xP-c_.js} +1 -1
- package/chunks/{markdown-to-slides-0dy53SkY.js → markdown-to-slides-BQZl1Zfg.js} +1 -1
- package/chunks/{morph-animator-Bfurws3L.js → morph-animator-DXLGtI7_.js} +1 -1
- package/chunks/{onboarding-tour-BROQsk9M.js → onboarding-tour-CfzFBkMl.js} +1 -1
- package/chunks/{search-Bujezng4.js → search-Dq7MszQj.js} +2 -2
- package/chunks/{slide-generator-DdyZXzM8.js → slide-generator-BhAaTusX.js} +1 -1
- package/chunks/{turntable-ai-9jwBBBp4.js → turntable-ai-ChmygnAJ.js} +1 -1
- package/package.json +1 -1
- package/yappy.js +4 -4
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.271/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.271](https://github.com/algorisys-oss/yappydraw/tree/v0.8.271).
|
|
@@ -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,
|
|
2
|
+
import { s as u, b as r, p as y, u as b, $ as B, g as v, f as j } from "./index-Cbilitsx.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.",
|
|
@@ -38,7 +38,7 @@ ${g.text}`,
|
|
|
38
38
|
}
|
|
39
39
|
return l > 0 ? r(`Magic Write updated ${l} text element${l === 1 ? "" : "s"}`, "success") : c || B(), l;
|
|
40
40
|
}
|
|
41
|
-
async function
|
|
41
|
+
async function $(p, s, i) {
|
|
42
42
|
const e = w("openai");
|
|
43
43
|
if (!e) return { dataURL: null, error: "Add an OpenAI API key in AI Settings first" };
|
|
44
44
|
try {
|
|
@@ -104,9 +104,9 @@ function D(p, s, i, e) {
|
|
|
104
104
|
async function K(p, s = {}) {
|
|
105
105
|
const i = s.size || "1024x1024", e = P("openai"), t = i === "1536x1024" ? "1792x1024" : i === "1024x1536" ? "1024x1792" : "1024x1024";
|
|
106
106
|
r("Generating image…", "loading");
|
|
107
|
-
let a = await
|
|
107
|
+
let a = await $(p, e.startsWith("dall-e") ? t : i, e);
|
|
108
108
|
if (!a.dataURL && e !== "dall-e-3") {
|
|
109
|
-
const l = await
|
|
109
|
+
const l = await $(p, t, "dall-e-3");
|
|
110
110
|
l.dataURL && (a = l);
|
|
111
111
|
}
|
|
112
112
|
if (!a.dataURL)
|
|
@@ -215,14 +215,14 @@ async function Y(p, s = {}) {
|
|
|
215
215
|
"prompt",
|
|
216
216
|
(s.prompt?.trim() ? `${s.prompt.trim()}. ` : "") + "Extend the existing image seamlessly into the transparent areas, continuing its scene, lighting, style, and perspective. Keep the original (non-transparent) pixels unchanged."
|
|
217
217
|
), f.append("size", "auto");
|
|
218
|
-
const { b64: L, error:
|
|
218
|
+
const { b64: L, error: S } = await x(f, t);
|
|
219
219
|
return L ? (y(), b(e.id, {
|
|
220
220
|
dataURL: `data:image/png;base64,${L}`,
|
|
221
221
|
x: e.x - e.width * a,
|
|
222
222
|
y: e.y - e.height * o,
|
|
223
223
|
width: e.width * (1 + a + n),
|
|
224
224
|
height: e.height * (1 + o + l)
|
|
225
|
-
}), r("Magic Expand applied", "success"), !0) : (r(
|
|
225
|
+
}), r("Magic Expand applied", "success"), !0) : (r(S || "Magic Expand failed", "error"), !1);
|
|
226
226
|
} catch (c) {
|
|
227
227
|
return r(`Magic Expand failed: ${c?.message || c}`, "error"), !1;
|
|
228
228
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as x, c as S } from "./ai-providers-CycU8sO1.js";
|
|
2
|
-
import { b as u,
|
|
2
|
+
import { b as u, a0 as A, s as C, g as y, z as M, f as D } from "./index-Cbilitsx.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 { a1 as A, a2 as N } from "./index-Cbilitsx.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,18 +1,18 @@
|
|
|
1
|
-
import { A as I, B as u, C as l, D as m, E as S, G as U, H as w, I as
|
|
1
|
+
import { A as I, B as u, C as l, D as m, E as S, G as U, H as w, I as E, b as N, J as y, K as O, L as p, M as T, N as C, O as G } from "./index-Cbilitsx.js";
|
|
2
2
|
const f = "yappy:drawings:index", c = (t) => `yappy:drawing:${t}`;
|
|
3
|
-
function
|
|
3
|
+
function $() {
|
|
4
4
|
return `d-${typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.floor(Math.random() * 1e9)}`}`;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function J(t) {
|
|
7
7
|
const n = t;
|
|
8
8
|
return !!n.gameScript?.trim() || n.gameAuthoringMode === "code" || (n.sceneBehaviors?.length ?? 0) > 0 || n.blueprints && Object.keys(n.blueprints).length > 0 || Array.isArray(t.elements) && t.elements.some((a) => (a.behaviors?.length ?? 0) > 0);
|
|
9
9
|
}
|
|
10
|
-
class
|
|
10
|
+
class M extends Error {
|
|
11
11
|
constructor() {
|
|
12
12
|
super("Local storage is unavailable — the drawing was not saved to disk."), this.name = "StorageUnavailableError";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
async function
|
|
15
|
+
async function k() {
|
|
16
16
|
return await m(f), S() === null;
|
|
17
17
|
}
|
|
18
18
|
async function o() {
|
|
@@ -22,34 +22,34 @@ async function g(t) {
|
|
|
22
22
|
await y(f, t);
|
|
23
23
|
}
|
|
24
24
|
async function b(t, n = {}) {
|
|
25
|
-
|
|
26
|
-
const a = JSON.stringify(t),
|
|
25
|
+
G();
|
|
26
|
+
const a = JSON.stringify(t), r = (/* @__PURE__ */ new Date()).toISOString(), i = await o(), e = n.id ? i.find((d) => d.id === n.id) : void 0, s = e?.id ?? n.id ?? $(), A = (n.name ?? t.metadata?.name ?? e?.name ?? "Untitled").trim() || "Untitled", h = {
|
|
27
27
|
id: s,
|
|
28
28
|
name: A,
|
|
29
|
-
createdAt: e?.createdAt ??
|
|
30
|
-
updatedAt:
|
|
29
|
+
createdAt: e?.createdAt ?? r,
|
|
30
|
+
updatedAt: r,
|
|
31
31
|
docType: t.metadata?.docType ?? e?.docType,
|
|
32
32
|
elementCount: Array.isArray(t.elements) ? t.elements.length : 0,
|
|
33
33
|
pageCount: Array.isArray(t.slides) ? t.slides.length : 0,
|
|
34
34
|
sizeBytes: a.length,
|
|
35
35
|
thumb: n.thumb ?? e?.thumb,
|
|
36
|
-
isGame:
|
|
37
|
-
}, x = await y(c(s), a), v = [h, ...
|
|
38
|
-
if (await g(v), !x) throw new
|
|
36
|
+
isGame: J(t)
|
|
37
|
+
}, x = await y(c(s), a), v = [h, ...i.filter((d) => d.id !== s)];
|
|
38
|
+
if (await g(v), !x) throw new M();
|
|
39
39
|
return h;
|
|
40
40
|
}
|
|
41
|
-
async function
|
|
42
|
-
const n =
|
|
41
|
+
async function B(t = {}) {
|
|
42
|
+
const n = O(), a = t.name ?? p();
|
|
43
43
|
a && a !== p() && w(a);
|
|
44
|
-
let
|
|
44
|
+
let r;
|
|
45
45
|
try {
|
|
46
|
-
|
|
46
|
+
r = T();
|
|
47
47
|
} catch {
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
return l(e.id),
|
|
49
|
+
const i = t.forceNew ? void 0 : u() ?? void 0, e = await b(n, { id: i, name: a, thumb: r });
|
|
50
|
+
return l(e.id), C(), e;
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
52
|
+
async function K() {
|
|
53
53
|
return o();
|
|
54
54
|
}
|
|
55
55
|
async function D(t) {
|
|
@@ -61,49 +61,49 @@ async function D(t) {
|
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
async function
|
|
64
|
+
async function L(t) {
|
|
65
65
|
const n = await D(t);
|
|
66
66
|
if (!n) return !1;
|
|
67
67
|
try {
|
|
68
68
|
U(n);
|
|
69
|
-
const
|
|
70
|
-
return w(n.metadata?.name ||
|
|
69
|
+
const r = (await o()).find((i) => i.id === t);
|
|
70
|
+
return w(n.metadata?.name || r?.name || "Untitled"), l(t), !0;
|
|
71
71
|
} catch (a) {
|
|
72
|
-
return console.error("[drawings-store] open failed:", a), !1;
|
|
72
|
+
return a instanceof E && N(a.message, "error", 1e4), console.error("[drawings-store] open failed:", a), !1;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
async function
|
|
76
|
-
const a = n.trim() || "Untitled",
|
|
77
|
-
if (!
|
|
78
|
-
|
|
75
|
+
async function R(t, n) {
|
|
76
|
+
const a = n.trim() || "Untitled", r = await o(), i = r.find((s) => s.id === t);
|
|
77
|
+
if (!i) return;
|
|
78
|
+
i.name = a, i.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), await g(r);
|
|
79
79
|
const e = await D(t);
|
|
80
80
|
e && (e.metadata = { ...e.metadata, name: a }, await y(c(t), JSON.stringify(e))), u() === t && w(a);
|
|
81
81
|
}
|
|
82
|
-
async function
|
|
82
|
+
async function Y(t) {
|
|
83
83
|
const n = await D(t);
|
|
84
84
|
if (!n) return null;
|
|
85
|
-
const
|
|
86
|
-
return b(e, { name:
|
|
85
|
+
const r = (await o()).find((s) => s.id === t), i = `${r?.name ?? n.metadata?.name ?? "Untitled"} copy`, e = { ...n, metadata: { ...n.metadata, name: i } };
|
|
86
|
+
return b(e, { name: i, thumb: r?.thumb });
|
|
87
87
|
}
|
|
88
|
-
async function
|
|
88
|
+
async function _(t) {
|
|
89
89
|
const n = await o();
|
|
90
90
|
await g(n.filter((a) => a.id !== t)), await I(c(t)), u() === t && l(null);
|
|
91
91
|
}
|
|
92
|
-
async function
|
|
92
|
+
async function q() {
|
|
93
93
|
return (await o()).length;
|
|
94
94
|
}
|
|
95
95
|
export {
|
|
96
|
-
|
|
96
|
+
M as StorageUnavailableError,
|
|
97
97
|
u as activeDrawingId,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
q as countDrawings,
|
|
99
|
+
_ as deleteDrawing,
|
|
100
|
+
Y as duplicateDrawing,
|
|
101
|
+
k as galleryReadable,
|
|
102
102
|
D as getDrawingDoc,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
K as listDrawings,
|
|
104
|
+
L as openDrawing,
|
|
105
|
+
R as renameDrawing,
|
|
106
|
+
B as saveCurrentToGallery,
|
|
107
107
|
b as saveDrawingDoc,
|
|
108
108
|
l as setActiveDrawingId
|
|
109
109
|
};
|