@snowcone-app/canvas 0.37.1 → 0.38.0

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 (69) hide show
  1. package/ERROR_CONTRACT.md +39 -8
  2. package/STYLING_CONTRACT.md +24 -2
  3. package/dist/{CanvasRenderer-CTN4j-uO.js → CanvasRenderer-D-E5WWLm.js} +4 -4
  4. package/dist/{CanvasRenderer-CTN4j-uO.js.map → CanvasRenderer-D-E5WWLm.js.map} +1 -1
  5. package/dist/{CanvasStateV1-DLE5d1-d.js → CanvasStateV1-C9LQt2J0.js} +7 -7
  6. package/dist/{CanvasStateV1-DLE5d1-d.js.map → CanvasStateV1-C9LQt2J0.js.map} +1 -1
  7. package/dist/{ContextualToolbars-CG5Gmv_i.js → ContextualToolbars-C62As-xY.js} +202 -202
  8. package/dist/{ContextualToolbars-CG5Gmv_i.js.map → ContextualToolbars-C62As-xY.js.map} +1 -1
  9. package/dist/EditorCanvasImpl-BnxEbr2p.js +144 -0
  10. package/dist/EditorCanvasImpl-BnxEbr2p.js.map +1 -0
  11. package/dist/{ExportManager-CDX5_up8.js → ExportManager-BbBfO22S.js} +45 -45
  12. package/dist/{ExportManager-CDX5_up8.js.map → ExportManager-BbBfO22S.js.map} +1 -1
  13. package/dist/{FontAnalyzer-CEYA_6fY.js → FontAnalyzer-DWHS41ba.js} +128 -128
  14. package/dist/FontAnalyzer-DWHS41ba.js.map +1 -0
  15. package/dist/{ImagePanel-DLxIDKV-.js → ImagePanel-BaX0UE-L.js} +57 -57
  16. package/dist/{ImagePanel-DLxIDKV-.js.map → ImagePanel-BaX0UE-L.js.map} +1 -1
  17. package/dist/SnowconeCanvas-CWSPyqqj.js +1112 -0
  18. package/dist/SnowconeCanvas-CWSPyqqj.js.map +1 -0
  19. package/dist/advanced.mjs +138 -138
  20. package/dist/api/placement.d.ts +3 -0
  21. package/dist/components/editor/EditorPlacements.d.ts +19 -6
  22. package/dist/components/editor/RootInternals.d.ts +7 -0
  23. package/dist/components/editor/designStateStore.d.ts +18 -0
  24. package/dist/components/editor/index.d.ts +3 -1
  25. package/dist/components/editor/placementLinks.d.ts +52 -0
  26. package/dist/components/editor/usePlacements.d.ts +28 -4
  27. package/dist/components/embed-realtime/context.d.ts +20 -4
  28. package/dist/components/embed-realtime/usePieceGuideBundle.d.ts +1 -0
  29. package/dist/components/embed-realtime/validateEmbed.d.ts +6 -3
  30. package/dist/{custom-icons-D51KIAfz.js → custom-icons-o1U13Vcg.js} +14 -14
  31. package/dist/{custom-icons-D51KIAfz.js.map → custom-icons-o1U13Vcg.js.map} +1 -1
  32. package/dist/{design-builder-CqgTpp9B.js → design-builder-CoCtjIwj.js} +86 -86
  33. package/dist/{design-builder-CqgTpp9B.js.map → design-builder-CoCtjIwj.js.map} +1 -1
  34. package/dist/{embed-CLz3CTcX.js → embed-SOFUZlGB.js} +843 -729
  35. package/dist/embed-SOFUZlGB.js.map +1 -0
  36. package/dist/embed.mjs +28 -28
  37. package/dist/errors/editorError.d.ts +7 -2
  38. package/dist/{guards-DldCuuJq.js → guards-DMmhw_Ow.js} +4 -4
  39. package/dist/{guards-DldCuuJq.js.map → guards-DMmhw_Ow.js.map} +1 -1
  40. package/dist/index.mjs +21 -21
  41. package/dist/internals.mjs +108 -108
  42. package/dist/internals.mjs.map +1 -1
  43. package/dist/placement-Br5jI_-u.js +90 -0
  44. package/dist/placement-Br5jI_-u.js.map +1 -0
  45. package/dist/placement.d.ts +2 -0
  46. package/dist/placement.mjs +5 -0
  47. package/dist/placement.mjs.map +1 -0
  48. package/dist/template-fields-CBLHgW7G.js +556 -0
  49. package/dist/template-fields-CBLHgW7G.js.map +1 -0
  50. package/dist/testing.mjs +24 -24
  51. package/dist/{useCommands-CQi4Pyd2.js → useCommands-x8J7_Mzy.js} +262 -262
  52. package/dist/{useCommands-CQi4Pyd2.js.map → useCommands-x8J7_Mzy.js.map} +1 -1
  53. package/dist/usePieceGuideBundle-C7r06a_x.js +65 -0
  54. package/dist/usePieceGuideBundle-C7r06a_x.js.map +1 -0
  55. package/dist/{validation-THw5W6N_.js → validation-BG-V98h0.js} +846 -846
  56. package/dist/validation-BG-V98h0.js.map +1 -0
  57. package/example/package.json +1 -1
  58. package/package.json +7 -2
  59. package/dist/EditorCanvasImpl-BRdFWZA5.js +0 -81
  60. package/dist/EditorCanvasImpl-BRdFWZA5.js.map +0 -1
  61. package/dist/FontAnalyzer-CEYA_6fY.js.map +0 -1
  62. package/dist/SnowconeCanvas-BaFR8QXs.js +0 -1196
  63. package/dist/SnowconeCanvas-BaFR8QXs.js.map +0 -1
  64. package/dist/embed-CLz3CTcX.js.map +0 -1
  65. package/dist/template-fields-D8uOutD4.js +0 -505
  66. package/dist/template-fields-D8uOutD4.js.map +0 -1
  67. package/dist/usePieceGuideBundle-BUQKb0Ja.js +0 -61
  68. package/dist/usePieceGuideBundle-BUQKb0Ja.js.map +0 -1
  69. package/dist/validation-THw5W6N_.js.map +0 -1
@@ -0,0 +1,144 @@
1
+ import { jsx as S, jsxs as O, Fragment as R } from "react/jsx-runtime";
2
+ import { forwardRef as T, useContext as w, useSyncExternalStore as D, useMemo as N, useRef as M, useLayoutEffect as j } from "react";
3
+ import { S as $ } from "./SnowconeCanvas-CWSPyqqj.js";
4
+ import { C as G } from "./ContextualToolbars-C62As-xY.js";
5
+ import { s as I, u as J, a as U } from "./design-builder-CoCtjIwj.js";
6
+ import { u as V } from "./embed-SOFUZlGB.js";
7
+ import { A as z, T as L } from "./FontAnalyzer-DWHS41ba.js";
8
+ import { E as P } from "./ExportManager-BbBfO22S.js";
9
+ import { E as k } from "./useCommands-x8J7_Mzy.js";
10
+ const q = () => () => {
11
+ };
12
+ function K() {
13
+ const { elementStore: h, artboardManager: b, refreshArtboards: x } = J(), {
14
+ executeElementUpdate: p,
15
+ executeAddElement: m,
16
+ executeRemoveElement: A,
17
+ executeCreateArtboard: f,
18
+ executeDeleteArtboard: C
19
+ } = U(), g = w(k), o = M({
20
+ elementStore: h,
21
+ artboardManager: b,
22
+ refreshArtboards: x,
23
+ executeElementUpdate: p,
24
+ executeAddElement: m,
25
+ executeRemoveElement: A,
26
+ executeCreateArtboard: f,
27
+ executeDeleteArtboard: C
28
+ });
29
+ o.current = {
30
+ elementStore: h,
31
+ artboardManager: b,
32
+ refreshArtboards: x,
33
+ executeElementUpdate: p,
34
+ executeAddElement: m,
35
+ executeRemoveElement: A,
36
+ executeCreateArtboard: f,
37
+ executeDeleteArtboard: C
38
+ };
39
+ const i = (g == null ? void 0 : g.registry) ?? null;
40
+ return j(() => {
41
+ if (i)
42
+ return i.registerCanvasBridge({
43
+ setTextByName(c, s) {
44
+ const { elementStore: u, executeElementUpdate: a } = o.current, e = u.getAllByName(c).filter((t) => t instanceof L);
45
+ if (e.length === 0) return !1;
46
+ for (const t of e) {
47
+ const n = t.clone();
48
+ n.setText(s), a(t, n);
49
+ }
50
+ return !0;
51
+ },
52
+ // ADR-0101: split = clone the BASE artboard (the first one) and every
53
+ // element on it into a new artboard named `label`, through the command
54
+ // path so it is one undoable step per command and lands in the Root
55
+ // store via onChange like any edit.
56
+ splitArtboard(c) {
57
+ const { artboardManager: s, elementStore: u } = o.current, a = s.getAllArtboards(), e = a[0];
58
+ if (!e) return !1;
59
+ if (a.some((l) => l.name === c)) return !0;
60
+ const t = new z({
61
+ name: c,
62
+ x: e.x,
63
+ y: e.y,
64
+ width: e.width,
65
+ height: e.height,
66
+ backgroundColor: e.backgroundColor
67
+ });
68
+ o.current.executeCreateArtboard(t);
69
+ const n = s.getArtboard(t.id);
70
+ n && (n.exportBackground = e.exportBackground, n.clipShape = e.clipShape, n.role = e.role);
71
+ for (const l of s.getElementsOnArtboard(e.id)) {
72
+ const d = u.get(l);
73
+ if (!d) continue;
74
+ const r = { ...d.toJSON() };
75
+ delete r.id, r.artboard = c, o.current.executeAddElement(P.createFromJSON(r), t.id);
76
+ }
77
+ return o.current.refreshArtboards(), !0;
78
+ },
79
+ // ADR-0101: link = remove the artboard named `label` and its elements
80
+ // through the command path; the placement inherits the base again.
81
+ removeArtboard(c) {
82
+ const { artboardManager: s, elementStore: u } = o.current, a = s.getAllArtboards().find((e) => e.name === c);
83
+ if (!a) return !1;
84
+ for (const e of [...s.getElementsOnArtboard(a.id)]) {
85
+ const t = u.get(e);
86
+ t && o.current.executeRemoveElement(t);
87
+ }
88
+ return o.current.executeDeleteArtboard(a), o.current.refreshArtboards(), !0;
89
+ }
90
+ });
91
+ }, [i]), null;
92
+ }
93
+ const oe = T(
94
+ function({
95
+ children: b,
96
+ kit: x = "embed-only",
97
+ inheritTheme: p = !0,
98
+ maxHeight: m,
99
+ services: A,
100
+ onChange: f,
101
+ selfScope: C = !1,
102
+ partAttr: g,
103
+ builtinControls: o = !1,
104
+ className: i,
105
+ style: c
106
+ }, s) {
107
+ const { placement: u, throttleMs: a, pieceGuides: e, pushRender: t, stateStore: n } = V(), l = w(k), d = l !== null, r = (l == null ? void 0 : l.registry) ?? null;
108
+ D(
109
+ r ? r.subscribe : q,
110
+ r ? r.getVersion : () => 0,
111
+ r ? r.getVersion : () => 0
112
+ );
113
+ const F = o && d && !((r == null ? void 0 : r.hasDockedControls()) ?? !1), y = N(() => n.getState(), [n]), E = M(f);
114
+ return E.current = f, /* @__PURE__ */ S("div", { className: `${C ? "sc-root" : "sc-canvas-frame"}${i ? ` ${i}` : ""}`, style: c, "data-sc-part": g, children: /* @__PURE__ */ S(
115
+ $,
116
+ {
117
+ ref: s,
118
+ kit: x,
119
+ inheritTheme: p,
120
+ services: A,
121
+ externalProvider: d,
122
+ resetDocumentOnMount: d,
123
+ artboards: y.artboards,
124
+ activeArtboard: u,
125
+ initialElements: y.elements,
126
+ layoutConfig: m ? { maxHeight: m } : void 0,
127
+ overlay: /* @__PURE__ */ O(R, { children: [
128
+ /* @__PURE__ */ S(K, {}),
129
+ F ? /* @__PURE__ */ S(G, { mode: "floating", partAttr: "controls" }) : null,
130
+ b
131
+ ] }),
132
+ pieceGuides: e ?? void 0,
133
+ onChange: (v) => {
134
+ var B;
135
+ n.setState(v), t(I(v), a), (B = E.current) == null || B.call(E, v);
136
+ }
137
+ }
138
+ ) });
139
+ }
140
+ );
141
+ export {
142
+ oe as EditorCanvasImpl
143
+ };
144
+ //# sourceMappingURL=EditorCanvasImpl-BnxEbr2p.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorCanvasImpl-BnxEbr2p.js","sources":["../src/components/editor/EditorCanvasImpl.tsx"],"sourcesContent":["'use client';\n\n/**\n * The heavy half of `Editor.Canvas` (and of the legacy `<RealtimeCanvas>`),\n * extracted from RealtimeCanvas's body. This module statically imports\n * `SnowconeCanvas` — i.e. the full rendering engine — and is therefore ONLY\n * ever reached through a dynamic `import()` (D9): the embed entry's static\n * import graph stays renderer-free, mechanically enforced by the\n * import-graph CI check.\n *\n * Beyond the original wiring (seed → SnowconeCanvas, edit →\n * `serializeStateForServer` → `pushRender`), this adds the ADR-0085 §3 store\n * wiring: every canvas change lands in the Root's {@link DesignStateStore}\n * (the ONE live design state), and a {@link CanvasBridge} is registered so\n * `Editor.TextField` writes route through the editor command path (undo/redo,\n * repaint) while a canvas is mounted — the editor document stays the single\n * write authority.\n */\n\nimport React, {\n forwardRef,\n useContext,\n useLayoutEffect,\n useMemo,\n useRef,\n useSyncExternalStore,\n type CSSProperties,\n type ReactNode,\n} from 'react';\nimport { SnowconeCanvas } from '../embed/SnowconeCanvas.js';\nimport { ContextualToolbars } from '../ContextualToolbars.js';\nimport type { CanvasState, SnowconeCanvasHandle } from '../embed/SnowconeCanvas.js';\nimport { serializeStateForServer } from '../../rendering/serialize-for-server.js';\nimport type { KitPresetId, KitDefinition } from '../../kits/types.js';\nimport type { CanvasServices } from '../../contexts/CanvasServicesContext.js';\nimport { useEmbedContext } from '../embed-realtime/context.js';\nimport { useElementsContext } from '../../contexts/ElementsContext.js';\nimport { useCommandContext } from '../../contexts/CommandContext.js';\nimport { TextElement } from '../../core/TextElement.js';\nimport { ArtboardElement } from '../../core/ArtboardElement.js';\nimport { ElementFactory } from '../../core/ElementFactory.js';\nimport type { AnyElementConfig } from '../../types/index.js';\nimport { EditorRootInternalsContext } from './RootInternals.js';\n\nexport interface EditorCanvasImplProps {\n /** Your controls (toolbar, inputs). Rendered as an overlay inside the editor\n * context so binding hooks work. */\n children?: ReactNode;\n /** Editor chrome preset. `Editor.Canvas` pins the chrome-less `'embed-only'`;\n * the legacy `<RealtimeCanvas kit>` prop passes richer presets through. */\n kit?: KitPresetId | KitDefinition;\n /** Inherit the host app's theme instead of managing its own (default true). */\n inheritTheme?: boolean;\n /** Cap the canvas height in px. */\n maxHeight?: number;\n /** Privileged-service wiring override (usually inherited from Root). */\n services?: CanvasServices;\n /** Observe the live design state (the same {@link CanvasState} the Root's\n * state store tracks). Safe to pass inline — read through a ref. */\n onChange?: (state: CanvasState) => void;\n /** Whether the wrapping div self-applies `.sc-root`. The legacy\n * `<RealtimeCanvas>` always did (it could be the only Snowcone DOM on the\n * page); under `Editor.Root` the Root applies it once and parts never\n * self-apply (ADR-0085). Re-applying is harmless (same variables), so the\n * legacy wrapper keeps `true` for bit-identical back-compat. */\n selfScope?: boolean;\n /** `data-sc-part` value for the wrapping div (the parts contract). */\n partAttr?: string;\n /** Mount the built-in floating contextual toolbar (ADR-0085 §5: with no\n * `Editor.Controls` mounted, `Editor.Canvas` defaults to the floating\n * toolbar; a registered DOCKED Controls suppresses it). Set by\n * `Editor.Canvas` only — the legacy `<RealtimeCanvas>` wrapper keeps\n * today's chrome-less behavior. @internal */\n builtinControls?: boolean;\n className?: string;\n style?: CSSProperties;\n}\n\nconst noopSubscribe = (): (() => void) => () => {};\n\n/**\n * Runs INSIDE the canvas's editor context (the overlay slot) and registers\n * the imperative bridge sibling parts use to edit by layer name through the\n * command path. Generalizes `useTextBinding`'s write mechanics to a dynamic\n * name (a hook can't take names at call time).\n */\nfunction CanvasBindingBridge(): null {\n const { elementStore, artboardManager, refreshArtboards } = useElementsContext();\n const {\n executeElementUpdate,\n executeAddElement,\n executeRemoveElement,\n executeCreateArtboard,\n executeDeleteArtboard,\n } = useCommandContext();\n // Tolerant on purpose: the legacy <RealtimeCanvas> is supported inside a\n // bare EmbedContext (advanced consumers provide their own); only under an\n // <Editor.Root> is there a registry to bridge into.\n const internals = useContext(EditorRootInternalsContext);\n\n const latest = useRef({\n elementStore,\n artboardManager,\n refreshArtboards,\n executeElementUpdate,\n executeAddElement,\n executeRemoveElement,\n executeCreateArtboard,\n executeDeleteArtboard,\n });\n latest.current = {\n elementStore,\n artboardManager,\n refreshArtboards,\n executeElementUpdate,\n executeAddElement,\n executeRemoveElement,\n executeCreateArtboard,\n executeDeleteArtboard,\n };\n\n const registry = internals?.registry ?? null;\n useLayoutEffect(() => {\n if (!registry) return;\n return registry.registerCanvasBridge({\n setTextByName(name: string, text: string): boolean {\n const { elementStore: store, executeElementUpdate: execute } = latest.current;\n const matches = store.getAllByName(name).filter((el): el is TextElement => el instanceof TextElement);\n if (matches.length === 0) return false;\n for (const el of matches) {\n const cloned = el.clone() as TextElement;\n cloned.setText(text);\n execute(el, cloned);\n }\n return true;\n },\n // ADR-0101: split = clone the BASE artboard (the first one) and every\n // element on it into a new artboard named `label`, through the command\n // path so it is one undoable step per command and lands in the Root\n // store via onChange like any edit.\n splitArtboard(label: string): boolean {\n const { artboardManager: mgr, elementStore: store } = latest.current;\n const all = mgr.getAllArtboards();\n const base = all[0];\n if (!base) return false;\n if (all.some((ab) => ab.name === label)) return true;\n const next = new ArtboardElement({\n name: label,\n x: base.x,\n y: base.y,\n width: base.width,\n height: base.height,\n backgroundColor: base.backgroundColor,\n });\n latest.current.executeCreateArtboard(next);\n // CreateArtboardCommand re-creates from a clone of the basic config;\n // carry the fields it doesn't (export flag, clip, role) directly.\n const created = mgr.getArtboard(next.id);\n if (created) {\n created.exportBackground = base.exportBackground;\n created.clipShape = base.clipShape;\n created.role = base.role;\n }\n for (const id of mgr.getElementsOnArtboard(base.id)) {\n const el = store.get(id);\n if (!el) continue;\n const json = { ...(el.toJSON() as AnyElementConfig) } as AnyElementConfig & { id?: string; artboard?: string };\n delete json.id;\n json.artboard = label;\n latest.current.executeAddElement(ElementFactory.createFromJSON(json) as Parameters<typeof executeAddElement>[0], next.id);\n }\n latest.current.refreshArtboards();\n return true;\n },\n // ADR-0101: link = remove the artboard named `label` and its elements\n // through the command path; the placement inherits the base again.\n removeArtboard(label: string): boolean {\n const { artboardManager: mgr, elementStore: store } = latest.current;\n const target = mgr.getAllArtboards().find((ab) => ab.name === label);\n if (!target) return false;\n for (const id of [...mgr.getElementsOnArtboard(target.id)]) {\n const el = store.get(id);\n if (el) latest.current.executeRemoveElement(el as Parameters<typeof executeRemoveElement>[0]);\n }\n latest.current.executeDeleteArtboard(target);\n latest.current.refreshArtboards();\n return true;\n },\n });\n }, [registry]);\n\n return null;\n}\n\nexport const EditorCanvasImpl = forwardRef<SnowconeCanvasHandle, EditorCanvasImplProps>(\n function EditorCanvasImpl(\n {\n children,\n kit = 'embed-only',\n inheritTheme = true,\n maxHeight,\n services,\n onChange,\n selfScope = false,\n partAttr,\n builtinControls = false,\n className,\n style,\n }: EditorCanvasImplProps,\n ref,\n ): React.ReactElement {\n const { placement, throttleMs, pieceGuides, pushRender, stateStore } = useEmbedContext();\n\n // Under an <Editor.Root> the editor document is mounted by the ROOT (P1\n // provider inversion, D9: state always) — SnowconeCanvas must write into\n // that document instead of mounting its own, and a REMOUNT of this part\n // must rebuild the (surviving) document from the live seed instead of\n // accreting onto the previous mount's artboards/elements. The legacy\n // <RealtimeCanvas> inside a bare EmbedContext (no Root) keeps mounting\n // its own provider, exactly as before.\n const rootInternals = useContext(EditorRootInternalsContext);\n const underRoot = rootInternals !== null;\n\n // ADR-0085 §5 (Controls placement resolution): with no Editor.Controls\n // mounted — or a `placement=\"floating\"` one — the canvas owns the\n // floating contextual toolbar; a registered DOCKED Controls suppresses\n // it. Subscribed to the part registry so the zones swap live when a\n // docked Controls mounts/unmounts.\n const partsRegistry = rootInternals?.registry ?? null;\n useSyncExternalStore(\n partsRegistry ? partsRegistry.subscribe : noopSubscribe,\n partsRegistry ? partsRegistry.getVersion : () => 0,\n partsRegistry ? partsRegistry.getVersion : () => 0,\n );\n const showBuiltinFloatingControls =\n builtinControls && underRoot && !(partsRegistry?.hasDockedControls() ?? false);\n\n // Seed from the LIVE store, not the original design (ADR-0085 §3): the\n // store starts as design.toJSON(), so a fresh mount is identical to the\n // old behavior — but edits made while this chunk was loading (e.g. a\n // TextField keystroke in the first second) survive instead of being\n // clobbered by a stale seed. Captured once per store identity; later\n // store changes flow through the editor document, not re-seeding.\n const seed = useMemo(() => stateStore.getState(), [stateStore]);\n\n // Latest-ref so a host's inline `onChange` identity never matters here\n // (SnowconeCanvas already refs ITS callback; this keeps ours symmetric).\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const rootClass = selfScope ? 'sc-root' : 'sc-canvas-frame';\n\n return (\n <div className={`${rootClass}${className ? ` ${className}` : ''}`} style={style} data-sc-part={partAttr}>\n <SnowconeCanvas\n ref={ref}\n kit={kit}\n inheritTheme={inheritTheme}\n services={services}\n externalProvider={underRoot}\n resetDocumentOnMount={underRoot}\n artboards={seed.artboards}\n activeArtboard={placement}\n initialElements={seed.elements}\n layoutConfig={maxHeight ? { maxHeight } : undefined}\n overlay={\n <>\n <CanvasBindingBridge />\n {showBuiltinFloatingControls ? <ContextualToolbars mode=\"floating\" partAttr=\"controls\" /> : null}\n {children}\n </>\n }\n // #566: the product's printable-area / dead-zone overlay, fetched and\n // dims-gated by the Root — same overlay snowcone.app's editor\n // shows, so a buyer can't unknowingly edit under a camera cutout.\n pieceGuides={pieceGuides ?? undefined}\n onChange={(state) => {\n // ONE store, last-write-wins (ADR-0085 §3): the editor document is\n // the write authority while mounted; the Root store derives from\n // its onChange, then the render follows the store.\n stateStore.setState(state);\n pushRender(serializeStateForServer(state), throttleMs);\n onChangeRef.current?.(state);\n }}\n />\n </div>\n );\n },\n);\n\nexport type { CanvasState, SnowconeCanvasHandle };\n"],"names":["noopSubscribe","CanvasBindingBridge","elementStore","artboardManager","refreshArtboards","useElementsContext","executeElementUpdate","executeAddElement","executeRemoveElement","executeCreateArtboard","executeDeleteArtboard","useCommandContext","internals","useContext","EditorRootInternalsContext","latest","useRef","registry","useLayoutEffect","name","text","store","execute","matches","el","TextElement","cloned","label","mgr","all","base","ab","next","ArtboardElement","created","id","json","ElementFactory","target","EditorCanvasImpl","forwardRef","children","kit","inheritTheme","maxHeight","services","onChange","selfScope","partAttr","builtinControls","className","style","ref","placement","throttleMs","pieceGuides","pushRender","stateStore","useEmbedContext","rootInternals","underRoot","partsRegistry","useSyncExternalStore","showBuiltinFloatingControls","seed","useMemo","onChangeRef","jsx","SnowconeCanvas","jsxs","Fragment","ContextualToolbars","state","serializeStateForServer","_a"],"mappings":";;;;;;;;;AA8EA,MAAMA,IAAgB,MAAoB,MAAM;AAAC;AAQjD,SAASC,IAA4B;AACnC,QAAM,EAAE,cAAAC,GAAc,iBAAAC,GAAiB,kBAAAC,EAAA,IAAqBC,EAAA,GACtD;AAAA,IACJ,sBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,EAAA,IACEC,EAAA,GAIEC,IAAYC,EAAWC,CAA0B,GAEjDC,IAASC,EAAO;AAAA,IACpB,cAAAd;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,sBAAAE;AAAA,IACA,mBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,EAAA,CACD;AACD,EAAAK,EAAO,UAAU;AAAA,IACf,cAAAb;AAAA,IACA,iBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,sBAAAE;AAAA,IACA,mBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,uBAAAC;AAAA,EAAA;AAGF,QAAMO,KAAWL,KAAA,gBAAAA,EAAW,aAAY;AACxC,SAAAM,E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Ve, ae as je, af as we, ag as Gn, ah as qe, ai as Q, aa as Xe, ab as Ye, aj as on, ak as Hn, C as Jn, R as Ke, al as Je, am as q, an as Ze, Q as Qe, ao as wn, ap as Se, P as nt, S as et, I as An, $ as tt, a3 as at, X as rt, V as st, a1 as it, Y as ot, Z as ct, A as Zn, M as lt, E as Ce } from "./FontAnalyzer-CEYA_6fY.js";
1
+ import { c as U, G as ve, ac as He, aO as Ve, aa as je, ag as we, aP as Gn, ae as qe, ab as Q, s as Xe, w as Ye, ad as on, af as Hn, x as Jn, at as Ke, ah as Je, aQ as q, aR as Ze, b as Qe, aS as wn, aT as Se, P as nt, S as et, I as An, F as tt, W as at, f as rt, d as st, L as it, C as ot, g as ct, A as Zn, i as lt, t as Ce } from "./FontAnalyzer-DWHS41ba.js";
2
2
  let ke = null;
3
3
  function dt(e) {
4
4
  ke = e;
@@ -27916,57 +27916,57 @@ const ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27916
27916
  default: vn
27917
27917
  }, Symbol.toStringTag, { value: "Module" }));
27918
27918
  export {
27919
- Ct as A,
27920
- _e as B,
27921
- Xa as C,
27919
+ tr as A,
27920
+ ze as B,
27921
+ kt as C,
27922
27922
  We as D,
27923
- vn as E,
27924
- oe as F,
27925
- tr as G,
27926
- ze as H,
27923
+ yn as E,
27924
+ Wn as F,
27925
+ nr as G,
27926
+ La as H,
27927
27927
  ge as I,
27928
- kt as J,
27929
- yn as K,
27930
- Ca as L,
27931
- va as M,
27932
- Ja as N,
27933
- Dn as O,
27934
- ce as P,
27935
- Ta as Q,
27936
- pa as R,
27937
- jn as S,
27928
+ Ba as J,
27929
+ Dn as K,
27930
+ ce as L,
27931
+ Ta as M,
27932
+ pa as N,
27933
+ jn as O,
27934
+ he as P,
27935
+ Ua as Q,
27936
+ Ca as R,
27937
+ va as S,
27938
27938
  Z as T,
27939
- he as U,
27939
+ Ja as U,
27940
27940
  sa as V,
27941
27941
  pn as W,
27942
27942
  ra as X,
27943
27943
  ht as Y,
27944
27944
  ar as Z,
27945
- xt as a,
27945
+ vn as a,
27946
27946
  Va as b,
27947
- Wn as c,
27948
- Te as d,
27949
- nr as e,
27950
- B as f,
27951
- Ua as g,
27952
- Za as h,
27953
- Ka as i,
27954
- Nn as j,
27955
- za as k,
27956
- La as l,
27957
- mt as m,
27958
- Ga as n,
27959
- Wa as o,
27960
- fn as p,
27961
- er as q,
27962
- Ba as r,
27963
- Ya as s,
27964
- ee as t,
27965
- Qa as u,
27966
- In as v,
27967
- ja as w,
27968
- Ha as x,
27969
- St as y,
27970
- qa as z
27947
+ Te as c,
27948
+ B as d,
27949
+ Za as e,
27950
+ Ka as f,
27951
+ Nn as g,
27952
+ za as h,
27953
+ mt as i,
27954
+ Ga as j,
27955
+ Wa as k,
27956
+ fn as l,
27957
+ er as m,
27958
+ Ya as n,
27959
+ ee as o,
27960
+ Qa as p,
27961
+ In as q,
27962
+ xt as r,
27963
+ ja as s,
27964
+ Ha as t,
27965
+ St as u,
27966
+ qa as v,
27967
+ Ct as w,
27968
+ _e as x,
27969
+ Xa as y,
27970
+ oe as z
27971
27971
  };
27972
- //# sourceMappingURL=ExportManager-CDX5_up8.js.map
27972
+ //# sourceMappingURL=ExportManager-BbBfO22S.js.map