@snowcone-app/canvas 0.40.0 → 0.40.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/README.md +6 -6
- package/dist/api/embed.d.ts +3 -3
- package/dist/default-editor/SnowconeEditor.d.ts +1 -1
- package/dist/design/product-config.d.ts +1 -1
- package/dist/embed-BY6gMPTK.js.map +1 -1
- package/example/README.md +2 -2
- package/example/package.json +1 -1
- package/example/src/Widget.tsx +6 -6
- package/package.json +3 -3
package/example/README.md
CHANGED
|
@@ -114,8 +114,8 @@ catalog product's `options` verbatim; the shape is:
|
|
|
114
114
|
|
|
115
115
|
```ts
|
|
116
116
|
const product = {
|
|
117
|
-
productId: '
|
|
118
|
-
mockupIds: ['
|
|
117
|
+
productId: 'BC43BE',
|
|
118
|
+
mockupIds: ['947QAD'],
|
|
119
119
|
placements: ['Front'],
|
|
120
120
|
variantId: 'gv-black-s', // initial selection (REQUIRED for color axes)
|
|
121
121
|
options: {
|
package/example/package.json
CHANGED
package/example/src/Widget.tsx
CHANGED
|
@@ -25,12 +25,12 @@ const nameDrop = design({ name: 'Front', width: 1480, height: 2328 })
|
|
|
25
25
|
.text('YOUR NAME', { anchor: 'top', name: 'name' });
|
|
26
26
|
|
|
27
27
|
const product = {
|
|
28
|
-
productId: '
|
|
29
|
-
mockupIds: ['
|
|
28
|
+
productId: 'BC43BE',
|
|
29
|
+
mockupIds: ['947QAD'],
|
|
30
30
|
placements: ['Front'],
|
|
31
|
-
//
|
|
31
|
+
// The variant you render. A product with a COLOR axis REQUIRES variantId, or
|
|
32
32
|
// a live render times out. Read real ids from the catalog with getProduct().
|
|
33
|
-
variantId: '
|
|
33
|
+
variantId: 'e92f40',
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export function PersonalizationWidget({
|
|
@@ -45,7 +45,7 @@ export function PersonalizationWidget({
|
|
|
45
45
|
return (
|
|
46
46
|
<Editor.Root shop={SHOP_KEY} product={product} design={nameDrop} grantUrl="/api/realtime/grant">
|
|
47
47
|
<div style={{ display: 'grid', gap: 12, maxWidth: 320 }}>
|
|
48
|
-
<Editor.Preview alt="Your personalized
|
|
48
|
+
<Editor.Preview alt="Your personalized case" fallback={<div aria-busy="true">Rendering…</div>} />
|
|
49
49
|
<Editor.TextField layer={nameDrop.layer('name')} placeholder="Your name" />
|
|
50
50
|
<Editor.Buy
|
|
51
51
|
onAddToCart={
|
|
@@ -57,7 +57,7 @@ export function PersonalizationWidget({
|
|
|
57
57
|
})
|
|
58
58
|
}
|
|
59
59
|
>
|
|
60
|
-
Add to cart · $
|
|
60
|
+
Add to cart · $37.72
|
|
61
61
|
</Editor.Buy>
|
|
62
62
|
</div>
|
|
63
63
|
</Editor.Root>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowcone-app/canvas",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.1",
|
|
4
4
|
"description": "Self-contained canvas editor component for e-commerce product customization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"react-colorful": "^5.6.1",
|
|
118
118
|
"tailwind-merge": "^3.0.0",
|
|
119
119
|
"tailwind-variants": "^3.1.1",
|
|
120
|
-
"@snowcone-app/sdk": "0.24.
|
|
120
|
+
"@snowcone-app/sdk": "0.24.4"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@axe-core/playwright": "^4.11.0",
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"vite-plugin-node-polyfills": "^0.24.0",
|
|
180
180
|
"vitest": "^3.2.7",
|
|
181
181
|
"zod": "^4.1.12",
|
|
182
|
-
"@snowcone-app/ui": "0.9.
|
|
182
|
+
"@snowcone-app/ui": "0.9.2"
|
|
183
183
|
},
|
|
184
184
|
"scripts": {
|
|
185
185
|
"dev": "vite",
|