@snowcone-app/canvas 0.41.4 → 0.41.5

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 (58) hide show
  1. package/dist/{CanvasRenderer-JcBrIZ6I.js → CanvasRenderer-3M-52sAd.js} +4 -4
  2. package/dist/{CanvasRenderer-JcBrIZ6I.js.map → CanvasRenderer-3M-52sAd.js.map} +1 -1
  3. package/dist/{CanvasStateV1-BJ5-75NN.js → CanvasStateV1-C9tFMK5q.js} +3 -3
  4. package/dist/{CanvasStateV1-BJ5-75NN.js.map → CanvasStateV1-C9tFMK5q.js.map} +1 -1
  5. package/dist/{ContextualToolbars-wmbHxn5a.js → ContextualToolbars-B2LTNu7r.js} +358 -358
  6. package/dist/{ContextualToolbars-wmbHxn5a.js.map → ContextualToolbars-B2LTNu7r.js.map} +1 -1
  7. package/dist/{EditorCanvasImpl-CSDnCIpN.js → EditorCanvasImpl-CKqnla_y.js} +26 -26
  8. package/dist/EditorCanvasImpl-CKqnla_y.js.map +1 -0
  9. package/dist/{ExportManager-CHlByUYV.js → ExportManager-9_RjQEv0.js} +2 -2
  10. package/dist/{ExportManager-CHlByUYV.js.map → ExportManager-9_RjQEv0.js.map} +1 -1
  11. package/dist/{FontAnalyzer-Bj2KrX80.js → FontAnalyzer-Ch1jgTq7.js} +88 -68
  12. package/dist/FontAnalyzer-Ch1jgTq7.js.map +1 -0
  13. package/dist/ImagePanel-DY9Ve3X7.js +1016 -0
  14. package/dist/{ImagePanel-0ZwDDaCy.js.map → ImagePanel-DY9Ve3X7.js.map} +1 -1
  15. package/dist/SnowconeCanvas-BSFMazgl.js +1098 -0
  16. package/dist/SnowconeCanvas-BSFMazgl.js.map +1 -0
  17. package/dist/advanced.mjs +44 -44
  18. package/dist/api/stable.d.ts +1 -1
  19. package/dist/components/embed/SnowconeCanvas.d.ts +15 -0
  20. package/dist/components/embed/kernel.d.ts +3 -1
  21. package/dist/core/ArtboardElement.d.ts +2 -0
  22. package/dist/core/ArtboardManager.d.ts +11 -0
  23. package/dist/{custom-icons-up58ZbC9.js → custom-icons-D_XezOul.js} +2 -2
  24. package/dist/{custom-icons-up58ZbC9.js.map → custom-icons-D_XezOul.js.map} +1 -1
  25. package/dist/design-builder-BFM94eA9.js +1859 -0
  26. package/dist/design-builder-BFM94eA9.js.map +1 -0
  27. package/dist/{embed-GXevsHX5.js → embed-KG_YnRHA.js} +10 -10
  28. package/dist/{embed-GXevsHX5.js.map → embed-KG_YnRHA.js.map} +1 -1
  29. package/dist/embed.mjs +12 -12
  30. package/dist/{guards-CQeF53PN.js → guards-D_mw4DgS.js} +2 -2
  31. package/dist/{guards-CQeF53PN.js.map → guards-D_mw4DgS.js.map} +1 -1
  32. package/dist/index.mjs +9 -9
  33. package/dist/internals.mjs +6 -6
  34. package/dist/{placement-D31o3YYC.js → placement-tSiIVhrL.js} +3 -3
  35. package/dist/{placement-D31o3YYC.js.map → placement-tSiIVhrL.js.map} +1 -1
  36. package/dist/placement.mjs +2 -2
  37. package/dist/{template-fields-tobyHoMe.js → template-fields-C0qoE_ZH.js} +32 -32
  38. package/dist/{template-fields-tobyHoMe.js.map → template-fields-C0qoE_ZH.js.map} +1 -1
  39. package/dist/testing.mjs +3 -3
  40. package/dist/{useCommands-Cm3mDB-l.js → useCommands-DSapP-w1.js} +7 -7
  41. package/dist/{useCommands-Cm3mDB-l.js.map → useCommands-DSapP-w1.js.map} +1 -1
  42. package/dist/{usePieceGuideBundle-BTnUn33k.js → usePieceGuideBundle-oBykb3X8.js} +2 -2
  43. package/dist/{usePieceGuideBundle-BTnUn33k.js.map → usePieceGuideBundle-oBykb3X8.js.map} +1 -1
  44. package/dist/utils/newImagePlacement.d.ts +56 -0
  45. package/dist/{validation-D4zxugNJ.js → validation-D6zVSeTh.js} +307 -307
  46. package/dist/{validation-D4zxugNJ.js.map → validation-D6zVSeTh.js.map} +1 -1
  47. package/dist/vendor/ui/primitives/badge.d.ts +1 -1
  48. package/dist/vendor/ui/primitives/link.d.ts +1 -1
  49. package/dist/vendor/ui/primitives/spinner.d.ts +1 -1
  50. package/example/package.json +1 -1
  51. package/package.json +1 -1
  52. package/dist/EditorCanvasImpl-CSDnCIpN.js.map +0 -1
  53. package/dist/FontAnalyzer-Bj2KrX80.js.map +0 -1
  54. package/dist/ImagePanel-0ZwDDaCy.js +0 -984
  55. package/dist/SnowconeCanvas-BZk7PRpk.js +0 -1215
  56. package/dist/SnowconeCanvas-BZk7PRpk.js.map +0 -1
  57. package/dist/design-builder-DUEwCUmA.js +0 -1676
  58. package/dist/design-builder-DUEwCUmA.js.map +0 -1
@@ -1,12 +1,12 @@
1
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-BZk7PRpk.js";
4
- import { C as G } from "./ContextualToolbars-wmbHxn5a.js";
5
- import { s as I, u as J, a as U } from "./design-builder-DUEwCUmA.js";
6
- import { u as V } from "./embed-GXevsHX5.js";
7
- import { A as z, T as L } from "./FontAnalyzer-Bj2KrX80.js";
8
- import { E as P } from "./ExportManager-CHlByUYV.js";
9
- import { E as k } from "./useCommands-Cm3mDB-l.js";
2
+ import { forwardRef as T, useContext as F, useSyncExternalStore as D, useMemo as N, useRef as w, useLayoutEffect as j } from "react";
3
+ import { S as $ } from "./SnowconeCanvas-BSFMazgl.js";
4
+ import { C as G } from "./ContextualToolbars-B2LTNu7r.js";
5
+ import { s as I, u as J, a as U } from "./design-builder-BFM94eA9.js";
6
+ import { u as V } from "./embed-KG_YnRHA.js";
7
+ import { A as z, T as L } from "./FontAnalyzer-Ch1jgTq7.js";
8
+ import { E as P } from "./ExportManager-9_RjQEv0.js";
9
+ import { E as M } from "./useCommands-DSapP-w1.js";
10
10
  const q = () => () => {
11
11
  };
12
12
  function K() {
@@ -16,7 +16,7 @@ function K() {
16
16
  executeRemoveElement: A,
17
17
  executeCreateArtboard: f,
18
18
  executeDeleteArtboard: C
19
- } = U(), g = w(k), o = M({
19
+ } = U(), g = F(M), o = w({
20
20
  elementStore: h,
21
21
  artboardManager: b,
22
22
  refreshArtboards: x,
@@ -36,12 +36,12 @@ function K() {
36
36
  executeCreateArtboard: f,
37
37
  executeDeleteArtboard: C
38
38
  };
39
- const i = (g == null ? void 0 : g.registry) ?? null;
39
+ const u = (g == null ? void 0 : g.registry) ?? null;
40
40
  return j(() => {
41
- if (i)
42
- return i.registerCanvasBridge({
41
+ if (u)
42
+ return u.registerCanvasBridge({
43
43
  setTextByName(c, s) {
44
- const { elementStore: u, executeElementUpdate: a } = o.current, e = u.getAllByName(c).filter((t) => t instanceof L);
44
+ const { elementStore: i, executeElementUpdate: a } = o.current, e = i.getAllByName(c).filter((t) => t instanceof L);
45
45
  if (e.length === 0) return !1;
46
46
  for (const t of e) {
47
47
  const n = t.clone();
@@ -54,7 +54,7 @@ function K() {
54
54
  // path so it is one undoable step per command and lands in the Root
55
55
  // store via onChange like any edit.
56
56
  splitArtboard(c) {
57
- const { artboardManager: s, elementStore: u } = o.current, a = s.getAllArtboards(), e = a[0];
57
+ const { artboardManager: s, elementStore: i } = o.current, a = s.getAllArtboards(), e = a[0];
58
58
  if (!e) return !1;
59
59
  if (a.some((l) => l.name === c)) return !0;
60
60
  const t = new z({
@@ -67,9 +67,9 @@ function K() {
67
67
  });
68
68
  o.current.executeCreateArtboard(t);
69
69
  const n = s.getArtboard(t.id);
70
- n && (n.exportBackground = e.exportBackground, n.clipShape = e.clipShape, n.role = e.role);
70
+ n && (n.exportBackground = e.exportBackground, n.clipShape = e.clipShape, n.role = e.role, n.imageFit = e.imageFit ? { ...e.imageFit } : void 0);
71
71
  for (const l of s.getElementsOnArtboard(e.id)) {
72
- const d = u.get(l);
72
+ const d = i.get(l);
73
73
  if (!d) continue;
74
74
  const r = { ...d.toJSON() };
75
75
  delete r.id, r.artboard = c, o.current.executeAddElement(P.createFromJSON(r), t.id);
@@ -79,16 +79,16 @@ function K() {
79
79
  // ADR-0101: link = remove the artboard named `label` and its elements
80
80
  // through the command path; the placement inherits the base again.
81
81
  removeArtboard(c) {
82
- const { artboardManager: s, elementStore: u } = o.current, a = s.getAllArtboards().find((e) => e.name === c);
82
+ const { artboardManager: s, elementStore: i } = o.current, a = s.getAllArtboards().find((e) => e.name === c);
83
83
  if (!a) return !1;
84
84
  for (const e of [...s.getElementsOnArtboard(a.id)]) {
85
- const t = u.get(e);
85
+ const t = i.get(e);
86
86
  t && o.current.executeRemoveElement(t);
87
87
  }
88
88
  return o.current.executeDeleteArtboard(a), o.current.refreshArtboards(), !0;
89
89
  }
90
90
  });
91
- }, [i]), null;
91
+ }, [u]), null;
92
92
  }
93
93
  const oe = T(
94
94
  function({
@@ -101,17 +101,17 @@ const oe = T(
101
101
  selfScope: C = !1,
102
102
  partAttr: g,
103
103
  builtinControls: o = !1,
104
- className: i,
104
+ className: u,
105
105
  style: c
106
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;
107
+ const { placement: i, throttleMs: a, pieceGuides: e, pushRender: t, stateStore: n } = V(), l = F(M), d = l !== null, r = (l == null ? void 0 : l.registry) ?? null;
108
108
  D(
109
109
  r ? r.subscribe : q,
110
110
  r ? r.getVersion : () => 0,
111
111
  r ? r.getVersion : () => 0
112
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(
113
+ const k = o && d && !((r == null ? void 0 : r.hasDockedControls()) ?? !1), y = N(() => n.getState(), [n]), E = w(f);
114
+ return E.current = f, /* @__PURE__ */ S("div", { className: `${C ? "sc-root" : "sc-canvas-frame"}${u ? ` ${u}` : ""}`, style: c, "data-sc-part": g, children: /* @__PURE__ */ S(
115
115
  $,
116
116
  {
117
117
  ref: s,
@@ -121,12 +121,12 @@ const oe = T(
121
121
  externalProvider: d,
122
122
  resetDocumentOnMount: d,
123
123
  artboards: y.artboards,
124
- activeArtboard: u,
124
+ activeArtboard: i,
125
125
  initialElements: y.elements,
126
126
  layoutConfig: m ? { maxHeight: m } : void 0,
127
127
  overlay: /* @__PURE__ */ O(R, { children: [
128
128
  /* @__PURE__ */ S(K, {}),
129
- F ? /* @__PURE__ */ S(G, { mode: "floating", partAttr: "controls" }) : null,
129
+ k ? /* @__PURE__ */ S(G, { mode: "floating", partAttr: "controls" }) : null,
130
130
  b
131
131
  ] }),
132
132
  pieceGuides: e ?? void 0,
@@ -141,4 +141,4 @@ const oe = T(
141
141
  export {
142
142
  oe as EditorCanvasImpl
143
143
  };
144
- //# sourceMappingURL=EditorCanvasImpl-CSDnCIpN.js.map
144
+ //# sourceMappingURL=EditorCanvasImpl-CKqnla_y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorCanvasImpl-CKqnla_y.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 created.imageFit = base.imageFit ? { ...base.imageFit } : undefined;\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;AA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tB,cAAcpB,IAAY,EAAE,WAAAA,EAAA,IAAc;AAAA,QAC1C,SACE,gBAAAyB,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAH,EAAClE,GAAA,EAAoB;AAAA,UACpB8D,IAA8B,gBAAAI,EAACI,GAAA,EAAmB,MAAK,YAAW,UAAS,YAAW,IAAK;AAAA,UAC3F9B;AAAA,QAAA,GACH;AAAA,QAKF,aAAac,KAAe;AAAA,QAC5B,UAAU,CAACiB,MAAU;;AAInB,UAAAf,EAAW,SAASe,CAAK,GACzBhB,EAAWiB,EAAwBD,CAAK,GAAGlB,CAAU,IACrDoB,IAAAR,EAAY,YAAZ,QAAAQ,EAAA,KAAAR,GAAsBM;AAAA,QACxB;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;"}
@@ -1,4 +1,4 @@
1
- import { c as j, G as Yt, ag as Ve, x as Je, v as Ke, ak as Ee, aS as Vt, ai as Qe, af as x, s as ze, w as Ze, ah as at, aj as Jt, z as te, ax as De, al as xe, aT as J, aU as tr, b as er, aV as Tt, aW as rr, _ as Se, aX as Me, P as nr, S as or, I as At, F as sr, W as ar, f as ir, d as lr, L as cr, C as hr, g as fr, A as ee, $ as dr, a0 as ur, i as gr, t as Ce } from "./FontAnalyzer-Bj2KrX80.js";
1
+ import { c as j, G as Yt, ag as Ve, x as Je, v as Ke, ak as Ee, aS as Vt, ai as Qe, af as x, s as ze, w as Ze, ah as at, aj as Jt, z as te, ax as De, al as xe, aT as J, aU as tr, b as er, aV as Tt, aW as rr, _ as Se, aX as Me, P as nr, S as or, I as At, F as sr, W as ar, f as ir, d as lr, L as cr, C as hr, g as fr, A as ee, $ as dr, a0 as ur, i as gr, t as Ce } from "./FontAnalyzer-Ch1jgTq7.js";
2
2
  let Pe = null;
3
3
  function pr(e) {
4
4
  Pe = e;
@@ -3655,4 +3655,4 @@ export {
3655
3655
  Ae as y,
3656
3656
  eo as z
3657
3657
  };
3658
- //# sourceMappingURL=ExportManager-CHlByUYV.js.map
3658
+ //# sourceMappingURL=ExportManager-9_RjQEv0.js.map