@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/ERROR_CONTRACT.md +137 -0
- package/dist/{EditorCanvasImpl-BeeY09cA.js → EditorCanvasImpl-BRdFWZA5.js} +2 -2
- package/dist/{EditorCanvasImpl-BeeY09cA.js.map → EditorCanvasImpl-BRdFWZA5.js.map} +1 -1
- package/dist/FontAnalyzer-CEYA_6fY.js.map +1 -1
- package/dist/api/embed.d.ts +3 -0
- package/dist/components/embed-realtime/validateEmbed.d.ts +13 -0
- package/dist/design/bundle-config.d.ts +127 -0
- package/dist/design/product-config.d.ts +3 -0
- package/dist/embed-CLz3CTcX.js +1799 -0
- package/dist/embed-CLz3CTcX.js.map +1 -0
- package/dist/embed.mjs +50 -45
- package/dist/errors/editorError.d.ts +28 -1
- package/example/package.json +1 -1
- package/package.json +3 -3
- package/dist/embed-D9n0deJ3.js +0 -1588
- package/dist/embed-D9n0deJ3.js.map +0 -1
package/dist/embed.mjs
CHANGED
|
@@ -1,59 +1,64 @@
|
|
|
1
|
-
import { C as a, a as t, b as
|
|
2
|
-
import { E as
|
|
3
|
-
import { E as
|
|
4
|
-
import { D as
|
|
5
|
-
import { D as
|
|
6
|
-
import { c as
|
|
7
|
-
import { s as
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
36
|
+
J as isLayerToken,
|
|
33
37
|
d as isPathElement,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
48
|
+
Q as useColorBinding,
|
|
44
49
|
c as useCommands,
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
N as useEditor,
|
|
51
|
+
U as useElementByName,
|
|
47
52
|
p as useExport,
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
W as useFontBinding,
|
|
54
|
+
X as useImageBinding,
|
|
50
55
|
g as useLayers,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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. */
|
package/example/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowcone-app/canvas",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
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.
|
|
177
|
+
"@snowcone-app/ui": "0.8.2"
|
|
178
178
|
},
|
|
179
179
|
"scripts": {
|
|
180
180
|
"dev": "vite",
|