@snowcone-app/canvas 0.42.1 → 0.43.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.
- package/ERROR_CONTRACT.md +45 -0
- package/dist/{CanvasRenderer-Bm7KLh38.js → CanvasRenderer-DnYgiWjt.js} +2 -2
- package/dist/{CanvasRenderer-Bm7KLh38.js.map → CanvasRenderer-DnYgiWjt.js.map} +1 -1
- package/dist/{CanvasStateV1-DPSSkdyD.js → CanvasStateV1-B51bXTyy.js} +2 -2
- package/dist/{CanvasStateV1-DPSSkdyD.js.map → CanvasStateV1-B51bXTyy.js.map} +1 -1
- package/dist/{ContextualToolbars-BuWJ3vD8.js → ContextualToolbars-DtlxDatY.js} +4 -4
- package/dist/{ContextualToolbars-BuWJ3vD8.js.map → ContextualToolbars-DtlxDatY.js.map} +1 -1
- package/dist/{EditorCanvasImpl-CtiIZyyt.js → EditorCanvasImpl-BpudFLkw.js} +6 -6
- package/dist/{EditorCanvasImpl-CtiIZyyt.js.map → EditorCanvasImpl-BpudFLkw.js.map} +1 -1
- package/dist/{ExportManager-DCEgNCL-.js → ExportManager-vAuaoF5Q.js} +1212 -1224
- package/dist/{ExportManager-DCEgNCL-.js.map → ExportManager-vAuaoF5Q.js.map} +1 -1
- package/dist/FontAnalyzer-D9R2PYsy.js.map +1 -1
- package/dist/{ImagePanel-WLkHhuBY.js → ImagePanel-kybrF6yT.js} +3 -3
- package/dist/{ImagePanel-WLkHhuBY.js.map → ImagePanel-kybrF6yT.js.map} +1 -1
- package/dist/SnowconeCanvas-p9XmnSCK.js +1157 -0
- package/dist/SnowconeCanvas-p9XmnSCK.js.map +1 -0
- package/dist/advanced.mjs +9 -9
- package/dist/api/embed.d.ts +1 -0
- package/dist/api/stable.d.ts +1 -0
- package/dist/components/embed/SnowconeCanvas.d.ts +13 -0
- package/dist/{custom-icons-B3auKmXj.js → custom-icons-Dlfrg3A_.js} +2 -2
- package/dist/{custom-icons-B3auKmXj.js.map → custom-icons-Dlfrg3A_.js.map} +1 -1
- package/dist/{embed-hQtKIv0u.js → embed-DuIOU8mL.js} +7 -7
- package/dist/{embed-hQtKIv0u.js.map → embed-DuIOU8mL.js.map} +1 -1
- package/dist/embed.mjs +5 -5
- package/dist/errors/editorError.d.ts +4 -1
- package/dist/index.mjs +7 -7
- package/dist/internals.mjs +4 -4
- package/dist/{template-fields-pasAAplQ.js → template-fields-DCZ9TqxY.js} +3 -3
- package/dist/{template-fields-pasAAplQ.js.map → template-fields-DCZ9TqxY.js.map} +1 -1
- package/dist/{useCommands-htOtw7w6.js → useCommands-d5UM6Cnc.js} +5 -5
- package/dist/{useCommands-htOtw7w6.js.map → useCommands-d5UM6Cnc.js.map} +1 -1
- package/dist/utils/ExportManager.d.ts +37 -1
- package/dist/utils/printFiles.d.ts +23 -0
- package/dist/{validation-m6hAaElF.js → validation-C8qNtk6j.js} +9 -9
- package/dist/{validation-m6hAaElF.js.map → validation-C8qNtk6j.js.map} +1 -1
- package/example/package.json +1 -1
- package/package.json +2 -2
- package/dist/SnowconeCanvas-1wc08k_m.js +0 -1098
- package/dist/SnowconeCanvas-1wc08k_m.js.map +0 -1
package/ERROR_CONTRACT.md
CHANGED
|
@@ -61,6 +61,7 @@ the issue key in `error.data.issue`.
|
|
|
61
61
|
| [`E_BUNDLE_ROLE_NOT_FOUND`](#e_bundle_role_not_found) | throw | `picks` / `variants` named a role the bundle has no slot for. `validNames` lists the bundle's roles. |
|
|
62
62
|
| [`E_BUNDLE_PICK_NOT_FOUND`](#e_bundle_pick_not_found) | throw | `picks[role]` named a product that is not one of that slot's alternatives. `validNames` lists the slot's alternatives. |
|
|
63
63
|
| [`E_BUNDLE_VARIANT_NOT_FOUND`](#e_bundle_variant_not_found) | throw | A slot has no resolvable variant: `variants[role]` is not one of the picked alternative's variant gvids (`validNames`), or the alternative publishes no variant at all. Every role of a bundle session needs a variant — the server keys the render on the per-role set. |
|
|
64
|
+
| [`E_PRINT_FILE_FAILED`](#e_print_file_failed) | throw | `exportPrintFiles`: a print file could not be made — the device refused its canvas (too many pixels for it), or the request named an artboard / region that does not exist (`validNames` lists the artboards). |
|
|
64
65
|
| [`missing-shop`](#missing-shop) | error → throws `E_EMBED_CONFIG` | No `shop` (the publishable shop id) was passed. |
|
|
65
66
|
| [`missing-grant`](#missing-grant) | error → throws `E_EMBED_CONFIG` | No grant source (`grantUrl`/`grant`) — the session can never authorize, so no mockup ever renders. |
|
|
66
67
|
| [`empty-mockup-ids`](#empty-mockup-ids) | error → throws `E_EMBED_CONFIG` | `product.mockupIds` is empty — nothing to render. |
|
|
@@ -741,6 +742,50 @@ the issue key in `error.data.issue`.
|
|
|
741
742
|
|
|
742
743
|
`error.data`: `code`, `productId`, `role`, `memberProductId`, `requested`, `validNames`, `docSlug`
|
|
743
744
|
|
|
745
|
+
### `E_PRINT_FILE_FAILED`
|
|
746
|
+
|
|
747
|
+
**Fires when:** `exportPrintFiles`: a print file could not be made — the device refused its canvas (too many pixels for it), or the request named an artboard / region that does not exist (`validNames` lists the artboards).
|
|
748
|
+
|
|
749
|
+
- `src/utils/ExportManager.ts`
|
|
750
|
+
|
|
751
|
+
```text
|
|
752
|
+
scale must be a finite number above 0 (got ${scale}).
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
`error.data`: `code`, `artboard`, `scale`
|
|
756
|
+
|
|
757
|
+
- `src/utils/ExportManager.ts`
|
|
758
|
+
|
|
759
|
+
```text
|
|
760
|
+
the device could not make the ${width} x ${height} px print file of "${artboard.name}"${region ? ` (region ${region.id})` : ''}: its canvas was refused. Ask for a smaller scale for this device.
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
`error.data`: `code`, `artboard`, `region`, `width`, `height`, `scale`
|
|
764
|
+
|
|
765
|
+
- `src/utils/printFiles.ts`
|
|
766
|
+
|
|
767
|
+
```text
|
|
768
|
+
the print file of "${artboard.name}" needs every picture on it, and ${which.join(', ')} ${failed.length > 0 ? 'failed to load' : `has not loaded after ${waitMs} ms`}: remove or re-add that picture, then ask again.
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
`error.data`: `code`, `artboard`, `elements`, `state`
|
|
772
|
+
|
|
773
|
+
- `src/utils/printFiles.ts`
|
|
774
|
+
|
|
775
|
+
```text
|
|
776
|
+
regions name the artboard "${name}", which is not one of [${names.join(', ')}].
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
`error.data`: `code`, `artboard`, `validNames`
|
|
780
|
+
|
|
781
|
+
- `src/utils/printFiles.ts`
|
|
782
|
+
|
|
783
|
+
```text
|
|
784
|
+
two print files are keyed "${key}": region ids and artboard names must all differ.
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
`error.data`: `code`, `key`
|
|
788
|
+
|
|
744
789
|
## Embed wiring issues (the `onIssue` channel)
|
|
745
790
|
|
|
746
791
|
Mount-time wiring problems and runtime stalls are `EmbedIssue` objects
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as le, l as he, a1 as nt, m as Ot, a2 as ce, a3 as de, a4 as Yt, a5 as fe, a6 as gt, a7 as ge, a8 as Gt, a9 as ue, aa as pe, c as te, ab as ye, ac as be, ad as Se, ae as me, v as ee, s as ne, af as pt, w as se, ag as Lt, ah as Xt, ai as Pt, aj as Nt, ak as Te, al as we, am as Kt, an as ve, ao as Me, ap as xe, I as Re, aq as Ce, ar as ke, as as tt } from "./FontAnalyzer-D9R2PYsy.js";
|
|
2
|
-
import { T as Wt, b as Pe, v as Ae, L as Ee, M as Dt, A as At, N as He, O as Ie, P as Be, Q as $t } from "./ExportManager-
|
|
2
|
+
import { T as Wt, b as Pe, v as Ae, L as Ee, M as Dt, A as At, N as He, O as Ie, P as Be, Q as $t } from "./ExportManager-vAuaoF5Q.js";
|
|
3
3
|
import { a as _t, i as jt } from "./guards-B0PNEbK6.js";
|
|
4
4
|
const ct = {
|
|
5
5
|
// Canvas-specific
|
|
@@ -3493,4 +3493,4 @@ export {
|
|
|
3493
3493
|
hn as p,
|
|
3494
3494
|
nn as r
|
|
3495
3495
|
};
|
|
3496
|
-
//# sourceMappingURL=CanvasRenderer-
|
|
3496
|
+
//# sourceMappingURL=CanvasRenderer-DnYgiWjt.js.map
|