@snowcone-app/canvas 0.36.7 → 0.37.1

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/dist/embed.mjs CHANGED
@@ -1,59 +1,64 @@
1
- import { C as a, a as t, b as r, A as o, F as i, G as n, H as d, J as m, K as u, u as l, d as E, f as c, g as p, h as g } from "./useCommands-CQi4Pyd2.js";
2
- import { E as S, R as f, a as C, b as T, S as F, c as v, d as y, f as P, p as b, e as B, g as R, h, v as D } from "./embed-D9n0deJ3.js";
3
- import { E as L, y as k } from "./FontAnalyzer-CEYA_6fY.js";
4
- import { D as A, d as G, j as K, i as M, u as _ } from "./design-builder-CqgTpp9B.js";
5
- import { D as z, T as H, r as J, u as N, a as Y, b as q, c as O, d as Q, e as U, w as V } from "./template-fields-D8uOutD4.js";
6
- import { c as X, e as Z, l as $, r as ee } from "./ExportManager-CDX5_up8.js";
7
- import { s as ae } from "./CanvasStateV1-DLE5d1-d.js";
1
+ import { C as a, a as t, b as o, A as r, F as i, G as n, H as d, J as u, K as m, u as l, d as E, f as c, g as p, h as g } from "./useCommands-CQi4Pyd2.js";
2
+ import { E as x, R as C, a as S, b as T, S as P, c as R, d as b, e as y, f as B, g as F, i as v, h, p as k, s as D, j as I, k as L, l as K, v as w } from "./embed-CLz3CTcX.js";
3
+ import { E as G, y as M } from "./FontAnalyzer-CEYA_6fY.js";
4
+ import { D as _, d as z, j as H, i as J, u as N } from "./design-builder-CqgTpp9B.js";
5
+ import { D as Y, T as q, r as O, u as Q, a as U, b as W, c as X, d as Z, e as $, w as ee } from "./template-fields-D8uOutD4.js";
6
+ import { c as ae, e as te, l as oe, r as re } from "./ExportManager-CDX5_up8.js";
7
+ import { s as ne } from "./CanvasStateV1-DLE5d1-d.js";
8
8
  export {
9
9
  a as CanvasServicesProvider,
10
- A as DesignBuilder,
11
- z as DesignStateStore,
12
- S as Editor,
13
- L as EditorError,
14
- f as RealtimeCanvas,
15
- C as RealtimeEmbed,
10
+ _ as DesignBuilder,
11
+ Y as DesignStateStore,
12
+ x as Editor,
13
+ G as EditorError,
14
+ C as RealtimeCanvas,
15
+ S as RealtimeEmbed,
16
16
  T as RealtimeMockup,
17
- F as SnowconeEditor,
18
- H as TEMPLATE_FIELDS_KEY,
19
- v as auditEditor,
20
- y as collectEmbedIssues,
17
+ P as SnowconeEditor,
18
+ q as TEMPLATE_FIELDS_KEY,
19
+ R as auditEditor,
20
+ b as bundleToRenderConfig,
21
+ y as bundleVariantToken,
22
+ B as collectEmbedIssues,
21
23
  t as createProxyGenerate,
22
- r as createProxyImageSearch,
23
- X as customFontRegistry,
24
- G as design,
25
- o as editorElementKind,
26
- Z as ensureCustomFontsLoaded,
27
- P as formatBuyPrice,
28
- K as isColorToken,
29
- k as isEditorError,
24
+ o as createProxyImageSearch,
25
+ ae as customFontRegistry,
26
+ z as design,
27
+ r as editorElementKind,
28
+ te as ensureCustomFontsLoaded,
29
+ F as formatBuyPrice,
30
+ v as isBundleProduct,
31
+ h as isBundleRenderProduct,
32
+ H as isColorToken,
33
+ M as isEditorError,
30
34
  i as isGroupElement,
31
35
  n as isImageElement,
32
- M as isLayerToken,
36
+ J as isLayerToken,
33
37
  d as isPathElement,
34
- m as isShapeElement,
35
- u as isTextElement,
36
- $ as loadCustomFont,
37
- b as productToRenderConfig,
38
- J as readTemplateFields,
39
- ee as registerCustomFonts,
40
- ae as serializeState,
38
+ u as isShapeElement,
39
+ m as isTextElement,
40
+ oe as loadCustomFont,
41
+ k as productToRenderConfig,
42
+ O as readTemplateFields,
43
+ re as registerCustomFonts,
44
+ ne as serializeState,
45
+ D as splitRoleKey,
41
46
  l as useArtboards,
42
47
  E as useCanvasServices,
43
- N as useColorBinding,
48
+ Q as useColorBinding,
44
49
  c as useCommands,
45
- _ as useEditor,
46
- Y as useElementByName,
50
+ N as useEditor,
51
+ U as useElementByName,
47
52
  p as useExport,
48
- q as useFontBinding,
49
- O as useImageBinding,
53
+ W as useFontBinding,
54
+ X as useImageBinding,
50
55
  g as useLayers,
51
- B as usePlacements,
52
- R as useProductSelection,
53
- h as useRealtimeMockups,
54
- Q as useSelectedElement,
55
- U as useTextBinding,
56
- D as validateEmbed,
57
- V as withTemplateFields
56
+ I as usePlacements,
57
+ L as useProductSelection,
58
+ K as useRealtimeMockups,
59
+ Z as useSelectedElement,
60
+ $ as useTextBinding,
61
+ w as validateEmbed,
62
+ ee as withTemplateFields
58
63
  };
59
64
  //# sourceMappingURL=embed.mjs.map
@@ -108,7 +108,34 @@ export type EditorErrorCode =
108
108
  * `useAlignDistribute().canDistribute` instead of calling below the
109
109
  * threshold (the toolbar hides its distribute buttons for exactly this
110
110
  * reason). */
111
- | 'E_DISTRIBUTE_MIN_THREE';
111
+ | 'E_DISTRIBUTE_MIN_THREE'
112
+ /** `productToRenderConfig()` was handed a BUNDLE (a catalog product with a
113
+ * `bundle` block — several products in one mockup, ADR-0099). A bundle
114
+ * has no single `variantId` and its placements are role-scoped
115
+ * (`top.front`), so the single-product adapter cannot describe it: use
116
+ * `bundleToRenderConfig()` instead. Never renders the wrong thing. */
117
+ | 'E_BUNDLE_CONFIG_REQUIRED'
118
+ /** `bundleToRenderConfig()` was handed a product with no `bundle` block —
119
+ * `picks` / `variants` are bundle parameters the server refuses on a
120
+ * single product. Use `productToRenderConfig()`. */
121
+ | 'E_NOT_A_BUNDLE'
122
+ /** A bundle placement was named WITHOUT its role (`"front"` instead of
123
+ * `"top.front"`): `options.placement` on `bundleToRenderConfig()`, or a
124
+ * design artboard on a bundle session. Two members can both have a
125
+ * "Front", so the bare label is never the identity — `validNames` lists
126
+ * the role-scoped keys. */
127
+ | 'E_BUNDLE_ROLE_REQUIRED'
128
+ /** `picks` / `variants` named a role the bundle has no slot for.
129
+ * `validNames` lists the bundle's roles. */
130
+ | 'E_BUNDLE_ROLE_NOT_FOUND'
131
+ /** `picks[role]` named a product that is not one of that slot's
132
+ * alternatives. `validNames` lists the slot's alternatives. */
133
+ | 'E_BUNDLE_PICK_NOT_FOUND'
134
+ /** A slot has no resolvable variant: `variants[role]` is not one of the
135
+ * picked alternative's variant gvids (`validNames`), or the alternative
136
+ * publishes no variant at all. Every role of a bundle session needs a
137
+ * variant — the server keys the render on the per-role set. */
138
+ | 'E_BUNDLE_VARIANT_NOT_FOUND';
112
139
  export interface EditorErrorData {
113
140
  code: EditorErrorCode;
114
141
  /** Slug under https://developers.snowcone.app/ for the violated contract. */
@@ -10,7 +10,7 @@
10
10
  "build": "tsc --noEmit && vite build"
11
11
  },
12
12
  "dependencies": {
13
- "@snowcone-app/canvas": "^0.36.7",
13
+ "@snowcone-app/canvas": "^0.37.1",
14
14
  "react": "^19.1.0",
15
15
  "react-dom": "^19.1.0"
16
16
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowcone-app/canvas",
3
- "version": "0.36.7",
3
+ "version": "0.37.1",
4
4
  "description": "Self-contained canvas editor component for e-commerce product customization",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -112,7 +112,7 @@
112
112
  "react-colorful": "^5.6.1",
113
113
  "tailwind-merge": "^3.0.0",
114
114
  "tailwind-variants": "^3.1.1",
115
- "@snowcone-app/sdk": "0.23.0"
115
+ "@snowcone-app/sdk": "0.24.1"
116
116
  },
117
117
  "devDependencies": {
118
118
  "@axe-core/playwright": "^4.11.0",
@@ -174,7 +174,7 @@
174
174
  "vite-plugin-node-polyfills": "^0.24.0",
175
175
  "vitest": "^3.2.4",
176
176
  "zod": "^4.1.12",
177
- "@snowcone-app/ui": "0.8.0"
177
+ "@snowcone-app/ui": "0.8.2"
178
178
  },
179
179
  "scripts": {
180
180
  "dev": "vite",