@popcraft/kit 0.53.17 → 0.53.18

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 (81) hide show
  1. package/dist/chunks/{agent-76MOJF7H.js → agent-QSCYOPEH.js} +1 -1
  2. package/dist/chunks/{builtin-O5D2Q6RV.js → builtin-5P5A2IMY.js} +4 -4
  3. package/dist/chunks/{buy-credits-2RI5ALP3.js → buy-credits-LK6QXRXO.js} +2 -2
  4. package/dist/chunks/{check-template-5FJPJLKN.js → check-template-SWWOPCV6.js} +3 -3
  5. package/dist/chunks/{chunk-GZZNTUHF.js → chunk-2O3AJLC7.js} +5 -5
  6. package/dist/chunks/{chunk-MUOTQRR5.js → chunk-35ZHGX7R.js} +3 -3
  7. package/dist/chunks/{chunk-YZYQTXAK.js → chunk-56ZMLITS.js} +4 -4
  8. package/dist/chunks/{chunk-64TRA3OH.js → chunk-735IMMB6.js} +4 -4
  9. package/dist/chunks/{chunk-ZIOF5AO6.js → chunk-7G7UOKM4.js} +1 -1
  10. package/dist/chunks/{chunk-MEEB2X3B.js → chunk-7HICNIH2.js} +54 -54
  11. package/dist/chunks/{chunk-4UOE2QLJ.js → chunk-7PRWYB7R.js} +4 -4
  12. package/dist/chunks/{chunk-NH42V7UK.js → chunk-7R77JLIP.js} +1 -1
  13. package/dist/chunks/{chunk-E4P2HVUD.js → chunk-AN22TGNL.js} +3 -1
  14. package/dist/chunks/{chunk-B4FB4B2M.js → chunk-ASMDKFSL.js} +1 -1
  15. package/dist/chunks/{chunk-AMQ2XV6E.js → chunk-C4JKLCPX.js} +10 -10
  16. package/dist/chunks/{chunk-SAUZ2HYM.js → chunk-E6LFTCYF.js} +4 -4
  17. package/dist/chunks/{chunk-QJU5LRJX.js → chunk-ETC4DTCD.js} +2 -2
  18. package/dist/chunks/{chunk-ROIDWBDQ.js → chunk-F4AFFSFA.js} +4 -4
  19. package/dist/chunks/{chunk-N6T6XKGC.js → chunk-GZWJRQRF.js} +1 -1
  20. package/dist/chunks/{chunk-LVENLTN6.js → chunk-HC2BCDFS.js} +4 -4
  21. package/dist/chunks/{chunk-ZEERADTI.js → chunk-I5VBP754.js} +12 -12
  22. package/dist/chunks/{chunk-IIPH3CZZ.js → chunk-IY5UZMTO.js} +251 -2
  23. package/dist/chunks/{chunk-U6OKU7J4.js → chunk-L5MSOOYG.js} +2 -2
  24. package/dist/chunks/{chunk-IAL55FGC.js → chunk-LC62KWV5.js} +2 -2
  25. package/dist/chunks/{chunk-SELEMFEP.js → chunk-LPGPKUME.js} +1 -1
  26. package/dist/chunks/{chunk-YLNK64NW.js → chunk-MGLGBL5N.js} +12 -12
  27. package/dist/chunks/{chunk-UXNXHMBD.js → chunk-NK4G5HDO.js} +5 -7
  28. package/dist/chunks/{chunk-VRGEEHBR.js → chunk-OK3DQPII.js} +269 -50
  29. package/dist/chunks/{chunk-QS4AT3DM.js → chunk-RPZJC2IG.js} +2 -4
  30. package/dist/chunks/{chunk-NAXSGXBD.js → chunk-VWL5XI7L.js} +11 -11
  31. package/dist/chunks/{chunk-XKUI2K2V.js → chunk-X4JKF2JG.js} +214 -1
  32. package/dist/chunks/{chunk-K63NQAOB.js → chunk-XE6NJFI2.js} +89 -89
  33. package/dist/chunks/{client-3EX4LVI6.js → client-3JR3D6HI.js} +3 -3
  34. package/dist/chunks/{client-RIPJA5PK.js → client-7ABQN2CO.js} +1 -1
  35. package/dist/chunks/{client-N525NCFB.js → client-LHZIJH23.js} +2 -2
  36. package/dist/chunks/{client-actions-232DIA3G.js → client-actions-VNMC4A7Z.js} +13 -14
  37. package/dist/chunks/{dangerous-2CPJMLP6.js → dangerous-VGWX2YEI.js} +4 -4
  38. package/dist/chunks/{delete-current-file-IVQD2M3K.js → delete-current-file-5IZOBWY2.js} +9 -10
  39. package/dist/chunks/{editor-seams-AFXFNM6K.js → editor-seams-4M7R4HNW.js} +18 -20
  40. package/dist/chunks/{editor-store-ZFR2ZHNM.js → editor-store-L4V3QA4A.js} +5 -5
  41. package/dist/chunks/{export-FWVSW5AN.js → export-FZA6A6I6.js} +1 -1
  42. package/dist/chunks/{export-watermark-KT25FYVD.js → export-watermark-3FQ7QOYR.js} +9 -10
  43. package/dist/chunks/{eyedropper-W6X2VHUB.js → eyedropper-P3ZONVHS.js} +7 -11
  44. package/dist/chunks/{generate-media-Y3NYLLSS.js → generate-media-SSWL4Y2L.js} +4 -4
  45. package/dist/chunks/{host-PKGEIJZF.js → host-VSSIPMLW.js} +14 -17
  46. package/dist/chunks/{integrations-4NFCLH3S.js → integrations-OQV4PCCS.js} +1 -1
  47. package/dist/chunks/{libraries-565L4UXX.js → libraries-CWODJKJI.js} +9 -10
  48. package/dist/chunks/{live-X3AP4MHF.js → live-DQITX7DB.js} +5 -5
  49. package/dist/chunks/{lottie-AGAHYTZE.js → lottie-ZKR6H64U.js} +3 -4
  50. package/dist/chunks/{media-tool-HVMNAVAE.js → media-tool-3IFICUR3.js} +12 -126
  51. package/dist/chunks/{new-file-Z7EJFO2J.js → new-file-GYD6TJYO.js} +7 -7
  52. package/dist/chunks/{pdf-X3ZB6QKO.js → pdf-RPD6QHMP.js} +5 -7
  53. package/dist/chunks/{player-check-ZGWLAHXY.js → player-check-CZVWUJXW.js} +3 -4
  54. package/dist/chunks/{plugin-OLV3V7ZN.js → plugin-V2XZNMZE.js} +3 -3
  55. package/dist/chunks/{plugin-import-SM3NLQ5A.js → plugin-import-UFRJVWX3.js} +23 -26
  56. package/dist/chunks/{pptx-OI7DTHPN.js → pptx-QZMA6SRM.js} +3 -4
  57. package/dist/chunks/{presence-TL24PA2T.js → presence-GGLTIRS2.js} +6 -6
  58. package/dist/chunks/{project-TS27R5XO.js → project-XENIE5UL.js} +3 -3
  59. package/dist/chunks/{publish-site-34NCZ274.js → publish-site-HBMHT6ZH.js} +10 -11
  60. package/dist/chunks/{publish-store-V27NWG4I.js → publish-store-PFXW7OCQ.js} +5 -5
  61. package/dist/chunks/{raster-actions-PGNW6BX6.js → raster-actions-ZGFZYTAH.js} +7 -11
  62. package/dist/chunks/{reference-images-36D6WIRI.js → reference-images-RAJE3NRE.js} +2 -2
  63. package/dist/chunks/{resolvers-V6SR7XRN.js → resolvers-J3DRJJ7P.js} +5 -6
  64. package/dist/chunks/{runner-Q6HI2WVB.js → runner-KSX7DGFW.js} +25 -27
  65. package/dist/chunks/{store-SIAVD2I6.js → store-4GUNFV7U.js} +14 -15
  66. package/dist/chunks/{storefront-prepare-6WYLPH6E.js → storefront-prepare-S6A5FZXC.js} +1 -1
  67. package/dist/chunks/{svg-export-QTVHP7B2.js → svg-export-J23NHZWC.js} +4 -5
  68. package/dist/chunks/{sync-PQCW3ZLW.js → sync-K2VRUB23.js} +9 -10
  69. package/dist/chunks/{tabs-HTDE6XGQ.js → tabs-A6SMBMFX.js} +12 -12
  70. package/dist/chunks/{team-H4DYU4NF.js → team-T3SVBBAO.js} +1 -1
  71. package/dist/chunks/{team-client-DW5CMJ4L.js → team-client-S3GCAISX.js} +1 -1
  72. package/dist/chunks/{theme-store-FAYEXX7K.js → theme-store-CBS2LI4H.js} +2 -3
  73. package/dist/chunks/{tools-HBJ2I7YP.js → tools-JRQSLBJK.js} +2 -2
  74. package/dist/chunks/{ui-commands-NRTJFHI6.js → ui-commands-ECGJ3AYH.js} +20 -22
  75. package/dist/chunks/{versions-22FL7N6P.js → versions-MP3FT4IV.js} +9 -10
  76. package/dist/index.js +1 -1
  77. package/package.json +1 -1
  78. package/dist/chunks/chunk-C3QJHVOH.js +0 -269
  79. package/dist/chunks/chunk-I5REOOP7.js +0 -225
  80. package/dist/chunks/chunk-P4LE4WLR.js +0 -25
  81. package/dist/chunks/chunk-ZBANBY2Q.js +0 -27
@@ -1,269 +0,0 @@
1
- import { createRequire as __popcraftRequire } from 'node:module';
2
- import { fileURLToPath as __popcraftPath } from 'node:url';
3
- import { dirname as __popcraftDirname } from 'node:path';
4
- const require = __popcraftRequire(import.meta.url);
5
- const __filename = __popcraftPath(import.meta.url);
6
- const __dirname = __popcraftDirname(__filename);
7
- import {
8
- computeBooleanMultiPoly
9
- } from "./chunk-IIPH3CZZ.js";
10
- import {
11
- glyphOutline,
12
- init_text_rings
13
- } from "./chunk-XK54ZTFX.js";
14
- import {
15
- fitCornersToBox,
16
- init_shape_to_path,
17
- init_trim,
18
- isFullTrim,
19
- polygonCorners,
20
- starCorners,
21
- trimPolylines
22
- } from "./chunk-HOQFG5J7.js";
23
- import {
24
- init_define_POPCRAFT_COMPONENT_IDS
25
- } from "./chunk-63KP74KB.js";
26
-
27
- // lib/io/export-ir/paths.ts
28
- init_define_POPCRAFT_COMPONENT_IDS();
29
- init_trim();
30
- init_shape_to_path();
31
- init_text_rings();
32
- function fmt(n) {
33
- const r = Math.round(n * 100) / 100;
34
- return Object.is(r, -0) ? "0" : String(r);
35
- }
36
- function cornerRadii(node) {
37
- const cr = node.cornerRadius;
38
- if (typeof cr === "number") return [cr, cr, cr, cr];
39
- if (Array.isArray(cr)) return cr;
40
- return [0, 0, 0, 0];
41
- }
42
- var K = 0.5522847498;
43
- function arcTo(cmds, fromX, fromY, toX, toY, cx, cy) {
44
- cmds.push({ op: "C", x1: fromX + (cx - fromX) * K, y1: fromY + (cy - fromY) * K, x2: toX + (cx - toX) * K, y2: toY + (cy - toY) * K, x: toX, y: toY });
45
- }
46
- function fittedRadii(w, h, radii) {
47
- const maxR = Math.min(w, h) / 2;
48
- const fit = (r) => Math.max(0, Math.min(r || 0, maxR));
49
- return [fit(radii[0]), fit(radii[1]), fit(radii[2]), fit(radii[3])];
50
- }
51
- function roundedRectCmds(w, h, radii) {
52
- const [tl, tr, br, bl] = fittedRadii(w, h, radii);
53
- if (!tl && !tr && !br && !bl) return [{ op: "M", x: 0, y: 0 }, { op: "L", x: w, y: 0 }, { op: "L", x: w, y: h }, { op: "L", x: 0, y: h }, { op: "Z" }];
54
- const c = [{ op: "M", x: tl, y: 0 }, { op: "L", x: w - tr, y: 0 }];
55
- if (tr) arcTo(c, w - tr, 0, w, tr, w, 0);
56
- c.push({ op: "L", x: w, y: h - br });
57
- if (br) arcTo(c, w, h - br, w - br, h, w, h);
58
- c.push({ op: "L", x: bl, y: h });
59
- if (bl) arcTo(c, bl, h, 0, h - bl, 0, h);
60
- c.push({ op: "L", x: 0, y: tl });
61
- if (tl) arcTo(c, 0, tl, tl, 0, 0, 0);
62
- c.push({ op: "Z" });
63
- return c;
64
- }
65
- function ellipseCmds(w, h) {
66
- const rx = w / 2, ry = h / 2, cx = rx, cy = ry;
67
- return [
68
- { op: "M", x: cx + rx, y: cy },
69
- { op: "C", x1: cx + rx, y1: cy + ry * K, x2: cx + rx * K, y2: cy + ry, x: cx, y: cy + ry },
70
- { op: "C", x1: cx - rx * K, y1: cy + ry, x2: cx - rx, y2: cy + ry * K, x: cx - rx, y: cy },
71
- { op: "C", x1: cx - rx, y1: cy - ry * K, x2: cx - rx * K, y2: cy - ry, x: cx, y: cy - ry },
72
- { op: "C", x1: cx + rx * K, y1: cy - ry, x2: cx + rx, y2: cy - ry * K, x: cx + rx, y: cy },
73
- { op: "Z" }
74
- ];
75
- }
76
- function cornerCmds(pts) {
77
- return [...pts.map(([x, y], i) => ({ op: i ? "L" : "M", x, y })), { op: "Z" }];
78
- }
79
- function polygonCmds(node) {
80
- return cornerCmds(fitCornersToBox(polygonCorners(node.pointCount || 3), node.width, node.height));
81
- }
82
- function starCmds(node) {
83
- const n = node;
84
- return cornerCmds(fitCornersToBox(starCorners(n.pointCount || 5, n.innerRadius ?? 0.4), node.width, node.height));
85
- }
86
- function vectorCmds(node) {
87
- const paths = node.paths || [];
88
- const out = [];
89
- const segment = (prev, curr) => {
90
- if (prev.handleOut && curr.handleIn) return { op: "C", x1: prev.handleOut.x, y1: prev.handleOut.y, x2: curr.handleIn.x, y2: curr.handleIn.y, x: curr.x, y: curr.y };
91
- if (prev.handleOut) return { op: "Q", x1: prev.handleOut.x, y1: prev.handleOut.y, x: curr.x, y: curr.y };
92
- if (curr.handleIn) return { op: "Q", x1: curr.handleIn.x, y1: curr.handleIn.y, x: curr.x, y: curr.y };
93
- return { op: "L", x: curr.x, y: curr.y };
94
- };
95
- for (const path of paths) {
96
- const pts = path.points;
97
- if (!pts?.length) continue;
98
- out.push({ op: "M", x: pts[0].x, y: pts[0].y });
99
- for (let i = 1; i < pts.length; i++) out.push(segment(pts[i - 1], pts[i]));
100
- if (path.closed && pts.length > 1) out.push(segment(pts[pts.length - 1], pts[0]));
101
- if (path.closed) out.push({ op: "Z" });
102
- }
103
- return out;
104
- }
105
- function multiPolyCmds(mp) {
106
- const out = [];
107
- for (const poly of mp) for (const ring of poly) {
108
- if (!ring.length) continue;
109
- ring.forEach((p, i) => out.push({ op: i ? "L" : "M", x: p[0], y: p[1] }));
110
- out.push({ op: "Z" });
111
- }
112
- return out;
113
- }
114
- function ringsCmds(rings) {
115
- const out = [];
116
- for (const ring of rings) {
117
- if (ring.length < 3) continue;
118
- ring.forEach((p, i) => out.push({ op: i ? "L" : "M", x: p[0], y: p[1] }));
119
- out.push({ op: "Z" });
120
- }
121
- return out;
122
- }
123
- function glyphCmds(instances) {
124
- const out = [];
125
- for (const g of instances) {
126
- const o = glyphOutline(g);
127
- if (!o) continue;
128
- let open = false;
129
- for (const c of o.commands) {
130
- const a = c.args;
131
- switch (c.command) {
132
- case "moveTo": {
133
- if (open) out.push({ op: "Z" });
134
- const [x, y] = o.place(a[0], a[1]);
135
- out.push({ op: "M", x, y });
136
- open = true;
137
- break;
138
- }
139
- case "lineTo": {
140
- const [x, y] = o.place(a[0], a[1]);
141
- out.push({ op: "L", x, y });
142
- break;
143
- }
144
- case "quadraticCurveTo": {
145
- const [x1, y1] = o.place(a[0], a[1]), [x, y] = o.place(a[2], a[3]);
146
- out.push({ op: "Q", x1, y1, x, y });
147
- break;
148
- }
149
- case "bezierCurveTo": {
150
- const [x1, y1] = o.place(a[0], a[1]), [x2, y2] = o.place(a[2], a[3]), [x, y] = o.place(a[4], a[5]);
151
- out.push({ op: "C", x1, y1, x2, y2, x, y });
152
- break;
153
- }
154
- case "closePath":
155
- if (open) {
156
- out.push({ op: "Z" });
157
- open = false;
158
- }
159
- break;
160
- }
161
- }
162
- if (open) out.push({ op: "Z" });
163
- }
164
- return out;
165
- }
166
- function shapeCmds(node, nodes) {
167
- switch (node.type) {
168
- case "RECTANGLE":
169
- case "FRAME":
170
- case "COMPONENT":
171
- case "COMPONENT_SET":
172
- case "INSTANCE":
173
- case "IMAGE":
174
- return roundedRectCmds(node.width, node.height, cornerRadii(node));
175
- case "SECTION":
176
- return roundedRectCmds(node.width, node.height, [0, 0, 0, 0]);
177
- case "ELLIPSE":
178
- return ellipseCmds(node.width, node.height);
179
- case "POLYGON":
180
- return polygonCmds(node);
181
- case "STAR":
182
- return starCmds(node);
183
- case "VECTOR":
184
- return vectorCmds(node);
185
- case "BOOLEAN":
186
- return multiPolyCmds(computeBooleanMultiPoly(node, nodes));
187
- default:
188
- return null;
189
- }
190
- }
191
- function cmdsToPolylines(cmds, steps = 24) {
192
- const out = [];
193
- let cur = null;
194
- let x = 0, y = 0, sx = 0, sy = 0;
195
- for (const c of cmds) {
196
- if (c.op === "M") {
197
- if (cur && cur.length > 2) out.push(cur);
198
- cur = [c.x, c.y];
199
- x = sx = c.x;
200
- y = sy = c.y;
201
- continue;
202
- }
203
- if (c.op === "Z") {
204
- if (cur) {
205
- if (x !== sx || y !== sy) cur.push(sx, sy);
206
- out.push(cur);
207
- }
208
- cur = null;
209
- x = sx;
210
- y = sy;
211
- continue;
212
- }
213
- cur ??= [x, y];
214
- if (c.op === "L") cur.push(c.x, c.y);
215
- else for (let i = 1; i <= steps; i++) {
216
- const t = i / steps, u = 1 - t;
217
- if (c.op === "Q") cur.push(u * u * x + 2 * u * t * c.x1 + t * t * c.x, u * u * y + 2 * u * t * c.y1 + t * t * c.y);
218
- else cur.push(u * u * u * x + 3 * u * u * t * c.x1 + 3 * u * t * t * c.x2 + t * t * t * c.x, u * u * u * y + 3 * u * u * t * c.y1 + 3 * u * t * t * c.y2 + t * t * t * c.y);
219
- }
220
- x = c.x;
221
- y = c.y;
222
- }
223
- if (cur && cur.length > 2) out.push(cur);
224
- return out;
225
- }
226
- function trimCmds(cmds, trim) {
227
- if (isFullTrim(trim)) return cmds;
228
- const out = [];
229
- for (const p of trimPolylines(cmdsToPolylines(cmds), trim)) {
230
- for (let i = 0; i < p.length; i += 2) out.push({ op: i ? "L" : "M", x: p[i], y: p[i + 1] });
231
- }
232
- return out;
233
- }
234
- function toSvgD(cmds) {
235
- let d = "";
236
- for (const c of cmds) {
237
- switch (c.op) {
238
- case "M":
239
- d += `M${fmt(c.x)} ${fmt(c.y)}`;
240
- break;
241
- case "L":
242
- d += `L${fmt(c.x)} ${fmt(c.y)}`;
243
- break;
244
- case "Q":
245
- d += `Q${fmt(c.x1)} ${fmt(c.y1)} ${fmt(c.x)} ${fmt(c.y)}`;
246
- break;
247
- case "C":
248
- d += `C${fmt(c.x1)} ${fmt(c.y1)} ${fmt(c.x2)} ${fmt(c.y2)} ${fmt(c.x)} ${fmt(c.y)}`;
249
- break;
250
- case "Z":
251
- d += "Z";
252
- break;
253
- }
254
- }
255
- return d;
256
- }
257
-
258
- export {
259
- fmt,
260
- cornerRadii,
261
- fittedRadii,
262
- roundedRectCmds,
263
- vectorCmds,
264
- ringsCmds,
265
- glyphCmds,
266
- shapeCmds,
267
- trimCmds,
268
- toSvgD
269
- };
@@ -1,225 +0,0 @@
1
- import { createRequire as __popcraftRequire } from 'node:module';
2
- import { fileURLToPath as __popcraftPath } from 'node:url';
3
- import { dirname as __popcraftDirname } from 'node:path';
4
- const require = __popcraftRequire(import.meta.url);
5
- const __filename = __popcraftPath(import.meta.url);
6
- const __dirname = __popcraftDirname(__filename);
7
- import {
8
- init_define_POPCRAFT_COMPONENT_IDS
9
- } from "./chunk-63KP74KB.js";
10
-
11
- // lib/theme/resolve.ts
12
- init_define_POPCRAFT_COMPONENT_IDS();
13
-
14
- // lib/theme/tokens.ts
15
- init_define_POPCRAFT_COMPONENT_IDS();
16
- var c = (group, def, description) => ({ type: "color", group, default: def, description });
17
- var TOKENS = {
18
- // surface — an elevation ramp, darkest first. PopCraft Dark's defaults are the Dune IDE "Space Optimal" palette:
19
- // a flat, near-black violet-grey (#0F0F13 chrome over a #131318 canvas) with lavender (#A78BFA) as the accent.
20
- // The comic themes override every color they use, so these only shape PopCraft Dark.
21
- "app.bg": c("surface", "#0F0F13", "Window background behind every panel."),
22
- sunken: c("surface", "#0A0A0D", "Wells and focused inline fields sunk below a panel."),
23
- base: c("surface", "#131318", "Recessed areas: previews, segmented-control tracks, dialog headers."),
24
- window: c("surface", "#0F0F13", "Floating chips and cards over the canvas."),
25
- overlay: c("surface", "#0F0F13", "Popovers, menus and dialogs."),
26
- field: c("surface", "#16161C", "Compact inputs and context menus."),
27
- "panel.bg": c("surface", "#0F0F13", "Side panels, top bar and toolbars."),
28
- raised: c("surface", "#1B1B22", "Secondary buttons and list rows."),
29
- "raised.hover": c("surface", "#262238", "Hovered secondary buttons and rows."),
30
- control: c("surface", "#1B1B22", "Selects, steppers, and hovered icon buttons."),
31
- "control.hover": c("surface", "#2A2A36", "Hovered controls, toggles and separators."),
32
- border: c("surface", "rgba(228,227,238,0.075)", "Default hairline between regions."),
33
- "border.strong": c("surface", "#322D48", "Borders around menus and cards."),
34
- "border.faint": c("surface", "rgba(228,227,238,0.05)", "Barely-visible separators."),
35
- "border.muted": c("surface", "#262238", "Secondary buttons and chips."),
36
- "border.emph": c("surface", "rgba(228,227,238,0.15)", "Hovered chips and emphasised outlines."),
37
- // text — brightest first
38
- fg: c("text", "#E4E3EE", "Primary text and icons."),
39
- "fg.bright": c("text", "#F4F3FA", "Headings in dialogs."),
40
- "fg.soft": c("text", "rgba(228,227,238,0.85)", "Body text in panels and menus."),
41
- "fg.dim": c("text", "rgba(228,227,238,0.74)", "Menu items and secondary body text."),
42
- "fg.muted": c("text", "#A6A5B8", "Labels and inactive icons."),
43
- "fg.subtle": c("text", "#85849A", "Hints, placeholders and section captions."),
44
- "fg.disabled": c("text", "#585868", "Disabled controls and faint captions."),
45
- "fg.faint": c("text", "#3E3E4C", "Decorative text that should barely show."),
46
- "fg.onAccent": c("text", "#0A0A0D", "Text and icons on accent-colored surfaces."),
47
- // accent
48
- accent: c("accent", "#A78BFA", "Primary action color."),
49
- "accent.hover": c("accent", "#C4A7FF", "Hovered primary action."),
50
- focusRing: c("accent", "#A78BFA", "Keyboard focus outline."),
51
- component: c("accent", "#7DD3FC", "Components and instances."),
52
- ai: c("accent", "#F0ABFC", "AI features: sparkle icons and AI badges."),
53
- prototype: c("accent", "#93C5FD", "Prototype connections and interactions in panels."),
54
- danger: c("accent", "#FB7185", "Destructive actions and errors."),
55
- warning: c("accent", "#FCD34D", "Warnings."),
56
- success: c("accent", "#6EE7B7", "Success states."),
57
- // shape
58
- "radius.sm": { type: "length", group: "shape", default: "4px", description: "Small controls." },
59
- "radius.md": { type: "length", group: "shape", default: "6px", description: "Inputs, buttons, menus and segmented controls." },
60
- "radius.lg": { type: "length", group: "shape", default: "8px", description: "Menu surfaces and cards." },
61
- "radius.xl": { type: "length", group: "shape", default: "10px", description: "Dialogs." },
62
- "border.width": { type: "length", group: "shape", default: "1px", description: "Width of panel and input borders." },
63
- "shadow.panel": { type: "shadow", group: "shape", default: "none", description: "Shadow under docked panels." },
64
- "shadow.popover": { type: "shadow", group: "shape", default: "0 8px 24px rgba(0,0,0,0.6)", description: "Shadow under floating surfaces." },
65
- "shadow.button": { type: "shadow", group: "shape", default: "none", description: "Shadow under buttons." },
66
- // type
67
- "font.ui": { type: "font", group: "type", default: "-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable', 'Segoe UI', Inter, system-ui, sans-serif", description: "UI text." },
68
- "font.heading": { type: "font", group: "type", default: "-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable', 'Segoe UI', Inter, system-ui, sans-serif", description: "Section titles." },
69
- "font.mono": { type: "font", group: "type", default: "'Monaspace Argon', 'Geist Mono Fallback'", description: "Code and numeric values." },
70
- "letterSpacing.heading": { type: "length", group: "type", default: "0", description: "Tracking on section titles." },
71
- "textTransform.heading": { type: "string", group: "type", default: "none", description: "none | uppercase for section titles." },
72
- "heading.stroke": { type: "length", group: "type", default: "0px", description: "Outline width drawn around section titles (comic lettering); 0px for none." },
73
- // decor
74
- "panel.pattern": { type: "string", group: "decor", default: "none", description: "background-image layered on panels (e.g. halftone)." },
75
- "tilt.popover": { type: "length", group: "decor", default: "0deg", description: "Rotation applied to popovers." },
76
- "motion.enabled": { type: "string", group: "decor", default: "1", description: "1 to allow theme animations, 0 to turn them off (reduced-motion users never see them)." },
77
- "decor.pop1": c("decor", "#A78BFA", "First flourish color: active-tool bursts, caption tags and halftone washes."),
78
- "decor.pop1.fg": c("decor", "#0A0A0D", "Text and icons on `decor.pop1` surfaces (pressed tabs and buttons, hovered menu items, the active tool)."),
79
- "decor.pop2": c("decor", "#F0ABFC", "Second flourish color: dialog bursts, focus pops and highlight bars."),
80
- "decor.pop3": c("decor", "#7DD3FC", "Third flourish color: canvas-corner halftones and hover accents."),
81
- // canvas — editor chrome drawn by WebGPU (lib/theme/chrome.ts). Must be hex or rgb()/rgba() colors.
82
- "canvas.selection": c("canvas", "#A78BFA", "Selection outline, marquee, lasso, pen and vector-edit handles."),
83
- "canvas.selection.component": c("canvas", "#7DD3FC", "Selection outline and labels on components."),
84
- "canvas.handle.fill": c("canvas", "#ffffff", "Fill of resize, vector and gradient handles."),
85
- "canvas.handle.stroke": c("canvas", "#A78BFA", "Outline of resize and corner-radius handles."),
86
- "canvas.handle.strokeWidth": { type: "number", group: "canvas", default: "1", description: "Handle outline thickness, as a multiple of the default hairline (1\u20134)." },
87
- "canvas.ruler.bg": c("canvas", "#0F0F13", "Ruler background."),
88
- "canvas.ruler.tick": c("canvas", "#3E3E4C", "Ruler ticks."),
89
- "canvas.ruler.label": c("canvas", "#A6A5B8", "Ruler numbers."),
90
- "canvas.ruler.track": c("canvas", "#7DD3FC", "Selection span on the ruler, ruler guides and control points."),
91
- "canvas.guide.hover": c("canvas", "#93C5FD", "Hovered ruler guide."),
92
- "canvas.measure": c("canvas", "#FB7185", "Snap lines and distance measurements."),
93
- "canvas.caret": c("canvas", "#C4A7FF", "Text caret, text selection, and auto-layout padding handles."),
94
- "canvas.prototype": c("canvas", "#93C5FD", "Prototype connection arrows."),
95
- "canvas.cursor.fill": c("canvas", "#0A0A0D", "Inside of the arrow and hand cursors."),
96
- "canvas.cursor.outline": c("canvas", "#E4E3EE", "Cursor outlines, and the lines of the crosshair, text and resize cursors."),
97
- "canvas.cursor.shadow": c("canvas", "rgba(0,0,0,0)", "Hard drop shadow under cursors; transparent for none. A visible shadow also makes cursor lines bolder."),
98
- "canvas.backdrop.dots": c("canvas", "rgba(0,0,0,0)", "Halftone dots behind the canvas content, growing toward the bottom-right corner. The alpha is the strength; transparent turns them off."),
99
- "canvas.backdrop.dotsAlt": c("canvas", "rgba(0,0,0,0)", "Second halftone layer, growing toward the top-left corner."),
100
- "canvas.stage": c("canvas", "#0B0B0E", "Letterbox around the frame in Stage view (the active frame alone, fitted like a video)."),
101
- "canvas.cursor.move": c("canvas", "#5EEAD4", "Pulsing crosshair shown while dragging selected layers."),
102
- "canvas.cursor.resize": c("canvas", "#FB7185", "Throbbing glow shown while resizing."),
103
- "canvas.cursor.rotate": c("canvas", "#F0ABFC", "Spinning dashed ring shown while rotating.")
104
- };
105
- var TOKEN_IDS = Object.keys(TOKENS);
106
- function tokenVar(id) {
107
- return "--pc-" + id.replace(/\./g, "-").replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
108
- }
109
-
110
- // lib/theme/resolve.ts
111
- function resolveTheme(themeId, lookup, overrides = {}) {
112
- const chain = [];
113
- const seen = /* @__PURE__ */ new Set();
114
- for (let t = lookup(themeId); t && !seen.has(t.id); t = t.extends ? lookup(t.extends) : void 0) {
115
- seen.add(t.id);
116
- chain.unshift(t);
117
- }
118
- const out = {};
119
- for (const id of TOKEN_IDS) out[id] = TOKENS[id].default;
120
- const set = /* @__PURE__ */ new Set();
121
- for (const t of chain) for (const [k, v] of Object.entries(t.tokens)) {
122
- out[k] = v;
123
- set.add(k);
124
- }
125
- for (const [k, v] of Object.entries(overrides)) {
126
- out[k] = v;
127
- set.add(k);
128
- }
129
- for (const [id, rule2] of DERIVED) {
130
- if (set.has(id)) continue;
131
- const from = rule2.from.filter((f) => set.has(f));
132
- if (from.length === rule2.from.length) out[id] = rule2.make(out);
133
- }
134
- return out;
135
- }
136
- var mix = (a, b, pct) => `color-mix(in oklab, ${a} ${100 - pct}%, ${b} ${pct}%)`;
137
- var rule = (from, make) => ({ from, make });
138
- var DERIVED = [
139
- ["accent.hover", rule(["accent"], (t) => mix(t.accent, t.fg, 15))],
140
- ["focusRing", rule(["accent"], (t) => t["accent.hover"])],
141
- ["fg.bright", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 3))],
142
- ["fg.soft", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 8))],
143
- ["fg.dim", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 14))],
144
- ["fg.muted", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 32))],
145
- ["fg.subtle", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 48))],
146
- ["fg.disabled", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 62))],
147
- ["fg.faint", rule(["fg"], (t) => mix(t.fg, t["panel.bg"], 72))],
148
- ["field", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 2))],
149
- ["control", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 8))],
150
- ["control.hover", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 14))],
151
- ["raised", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 5))],
152
- ["raised.hover", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 11))],
153
- ["overlay", rule(["panel.bg"], (t) => mix(t["panel.bg"], t["app.bg"], 25))],
154
- ["window", rule(["panel.bg"], (t) => mix(t["panel.bg"], t["app.bg"], 40))],
155
- ["base", rule(["panel.bg"], (t) => mix(t["panel.bg"], t["app.bg"], 55))],
156
- ["sunken", rule(["panel.bg"], (t) => mix(t["panel.bg"], t["app.bg"], 75))],
157
- ["border", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 10))],
158
- ["border.strong", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 16))],
159
- ["border.faint", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 6))],
160
- ["border.muted", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 12))],
161
- ["border.emph", rule(["panel.bg"], (t) => mix(t["panel.bg"], t.fg, 22))]
162
- ];
163
- function collectFonts(themeId, lookup) {
164
- const fonts = [];
165
- const seen = /* @__PURE__ */ new Set();
166
- for (let t = lookup(themeId); t && !seen.has(t.id); t = t.extends ? lookup(t.extends) : void 0) {
167
- seen.add(t.id);
168
- if (t.fonts) fonts.unshift(...t.fonts);
169
- }
170
- return fonts;
171
- }
172
- function collectCss(themeId, lookup) {
173
- const css = [];
174
- const seen = /* @__PURE__ */ new Set();
175
- for (let t = lookup(themeId); t && !seen.has(t.id); t = t.extends ? lookup(t.extends) : void 0) {
176
- seen.add(t.id);
177
- if (t.css) css.unshift(t.css);
178
- }
179
- return css;
180
- }
181
- function toCssVars(tokens) {
182
- return TOKEN_IDS.map((id) => `${tokenVar(id)}: ${tokens[id]};`).join("\n");
183
- }
184
- function parseColor(value) {
185
- const v = value.trim();
186
- const hex = /^#([0-9a-f]{3,8})$/i.exec(v);
187
- if (hex) {
188
- let h = hex[1];
189
- if (h.length === 3 || h.length === 4) h = [...h].map((ch) => ch + ch).join("");
190
- if (h.length !== 6 && h.length !== 8) return null;
191
- const n = (i) => parseInt(h.slice(i, i + 2), 16) / 255;
192
- return { r: n(0), g: n(2), b: n(4), a: h.length === 8 ? n(6) : 1 };
193
- }
194
- const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(v);
195
- if (rgb) {
196
- const a = rgb[4] === void 0 ? 1 : rgb[4].endsWith("%") ? parseFloat(rgb[4]) / 100 : parseFloat(rgb[4]);
197
- return { r: +rgb[1] / 255, g: +rgb[2] / 255, b: +rgb[3] / 255, a };
198
- }
199
- const srgb = /^color\(\s*srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+%?))?\s*\)$/i.exec(v);
200
- if (srgb) {
201
- const a = srgb[4] === void 0 ? 1 : srgb[4].endsWith("%") ? parseFloat(srgb[4]) / 100 : parseFloat(srgb[4]);
202
- return { r: +srgb[1], g: +srgb[2], b: +srgb[3], a };
203
- }
204
- return null;
205
- }
206
- function canvasColors(tokens) {
207
- const out = {};
208
- for (const id of TOKEN_IDS) {
209
- if (TOKENS[id].group !== "canvas" || TOKENS[id].type !== "color") continue;
210
- out[id] = parseColor(tokens[id]) ?? parseColor(TOKENS[id].default);
211
- }
212
- return out;
213
- }
214
-
215
- export {
216
- TOKENS,
217
- TOKEN_IDS,
218
- tokenVar,
219
- resolveTheme,
220
- collectFonts,
221
- collectCss,
222
- toCssVars,
223
- parseColor,
224
- canvasColors
225
- };
@@ -1,25 +0,0 @@
1
- import { createRequire as __popcraftRequire } from 'node:module';
2
- import { fileURLToPath as __popcraftPath } from 'node:url';
3
- import { dirname as __popcraftDirname } from 'node:path';
4
- const require = __popcraftRequire(import.meta.url);
5
- const __filename = __popcraftPath(import.meta.url);
6
- const __dirname = __popcraftDirname(__filename);
7
- import {
8
- init_define_POPCRAFT_COMPONENT_IDS
9
- } from "./chunk-63KP74KB.js";
10
-
11
- // lib/engine/camera.ts
12
- init_define_POPCRAFT_COMPONENT_IDS();
13
- function screenToWorld(screenX, screenY, camera, canvasWidth, canvasHeight) {
14
- const ndcX = screenX / canvasWidth * 2 - 1;
15
- const ndcY = screenY / canvasHeight * 2 - 1;
16
- const halfWidth = canvasWidth / (2 * camera.zoom);
17
- const halfHeight = canvasHeight / (2 * camera.zoom);
18
- const worldX = ndcX * halfWidth + camera.x;
19
- const worldY = ndcY * halfHeight + camera.y;
20
- return { x: worldX, y: worldY };
21
- }
22
-
23
- export {
24
- screenToWorld
25
- };
@@ -1,27 +0,0 @@
1
- import { createRequire as __popcraftRequire } from 'node:module';
2
- import { fileURLToPath as __popcraftPath } from 'node:url';
3
- import { dirname as __popcraftDirname } from 'node:path';
4
- const require = __popcraftRequire(import.meta.url);
5
- const __filename = __popcraftPath(import.meta.url);
6
- const __dirname = __popcraftDirname(__filename);
7
- import {
8
- init_define_POPCRAFT_COMPONENT_IDS
9
- } from "./chunk-63KP74KB.js";
10
-
11
- // lib/engine/canvas-dpr.ts
12
- init_define_POPCRAFT_COMPONENT_IDS();
13
- function isAppleMobile() {
14
- if (typeof navigator === "undefined") return false;
15
- return /iPad|iPhone|iPod/.test(navigator.userAgent) || /Mac/.test(navigator.platform) && navigator.maxTouchPoints > 1;
16
- }
17
- function canvasDpr() {
18
- if (typeof window === "undefined") return 1;
19
- const dpr = window.devicePixelRatio || 1;
20
- return dpr > 1 ? Math.max(1, dpr * renderScale) : dpr;
21
- }
22
- var renderScale = 1;
23
-
24
- export {
25
- isAppleMobile,
26
- canvasDpr
27
- };