@snowcone-app/canvas 0.46.11 → 0.46.14
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 +13 -0
- package/dist/{CanvasRenderer-CLL5V71e.js → CanvasRenderer-CV8fDS6m.js} +2 -2
- package/dist/{CanvasRenderer-CLL5V71e.js.map → CanvasRenderer-CV8fDS6m.js.map} +1 -1
- package/dist/{ContextualToolbars-DnsfOy7x.js → ContextualToolbars-DsQ83_VR.js} +4 -4
- package/dist/{ContextualToolbars-DnsfOy7x.js.map → ContextualToolbars-DsQ83_VR.js.map} +1 -1
- package/dist/{EditorCanvasImpl-DDBa3pvE.js → EditorCanvasImpl-CbKLAe8P.js} +6 -6
- package/dist/{EditorCanvasImpl-DDBa3pvE.js.map → EditorCanvasImpl-CbKLAe8P.js.map} +1 -1
- package/dist/{ExportManager-BR5uca6R.js → ExportManager-Q4GQE68T.js} +381 -376
- package/dist/{ExportManager-BR5uca6R.js.map → ExportManager-Q4GQE68T.js.map} +1 -1
- package/dist/{ImagePanel-Bez-5INu.js → ImagePanel-DNgvLouH.js} +3 -3
- package/dist/{ImagePanel-Bez-5INu.js.map → ImagePanel-DNgvLouH.js.map} +1 -1
- package/dist/{SnowconeCanvas-Cjnp1ztd.js → SnowconeCanvas-Cu3IuAhp.js} +8 -8
- package/dist/{SnowconeCanvas-Cjnp1ztd.js.map → SnowconeCanvas-Cu3IuAhp.js.map} +1 -1
- package/dist/advanced.mjs +10 -10
- package/dist/{compose-CZslfDUm.js → compose-CatWJeVf.js} +3 -3
- package/dist/{compose-CZslfDUm.js.map → compose-CatWJeVf.js.map} +1 -1
- package/dist/{custom-icons-DIqddGX1.js → custom-icons-DP6uSyX-.js} +2 -2
- package/dist/{custom-icons-DIqddGX1.js.map → custom-icons-DP6uSyX-.js.map} +1 -1
- package/dist/{embed-BydDaNDy.js → embed-DobFUit8.js} +6 -6
- package/dist/{embed-BydDaNDy.js.map → embed-DobFUit8.js.map} +1 -1
- package/dist/embed.mjs +4 -4
- package/dist/errors/editorError.d.ts +3 -0
- package/dist/fontAnalysisCache-B2lh7X-_.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/internals.mjs +3 -3
- package/dist/{template-fields-cNoo8zDC.js → template-fields-BqGWVbJo.js} +3 -3
- package/dist/{template-fields-cNoo8zDC.js.map → template-fields-BqGWVbJo.js.map} +1 -1
- package/dist/{useCommands-mpsd0_l5.js → useCommands-DHwYOhSp.js} +5 -5
- package/dist/{useCommands-mpsd0_l5.js.map → useCommands-DHwYOhSp.js.map} +1 -1
- package/dist/{validation-DjdrFk2P.js → validation-EoPS9fDC.js} +9 -9
- package/dist/{validation-DjdrFk2P.js.map → validation-EoPS9fDC.js.map} +1 -1
- package/example/package.json +1 -1
- package/package.json +4 -4
package/ERROR_CONTRACT.md
CHANGED
|
@@ -45,6 +45,7 @@ the issue key in `error.data.issue`.
|
|
|
45
45
|
| [`E_PREVIEW_NO_LOADER`](#e_preview_no_loader) | throw | `Editor.Preview loadingOverlay` got `false`/an unknown value. A mockup preview ALWAYS has a render-in-flight treatment (a server render takes real time, and the loader paints OVER the still-visible previous mockup) — keep the default, pass a variant/custom element, or declare `"host-owned"` with your own indicator. Silence-then-pop-in is a composition mistake, not a preference. |
|
|
46
46
|
| [`E_INITIAL_TEXT_NO_IMAGE`](#e_initial_text_no_image) | throw | `SnowconeCanvas initialImageText` given with no `initialImage` for the words to belong to. Pass the picture as `initialImage`, or the whole design as `initialElements` without `initialImageText`. |
|
|
47
47
|
| [`E_INITIAL_TEXT_INVALID`](#e_initial_text_invalid) | throw | An `initialImageText` line that cannot be placed: no text, no font family, a colour that is not `#rrggbb`, or a size or place that is not a share of the picture. The message names the line and what to change. |
|
|
48
|
+
| [`E_ELEMENT_TYPE_UNSUPPORTED`](#e_element_type_unsupported) | throw | An element config names an element type the editor cannot build (today: 'distort', never implemented and refused by the design format). The message lists the types that exist. |
|
|
48
49
|
| [`E_INVALID_PATCH`](#e_invalid_patch) | throw | `updateElement(target, patch)`: a patch key doesn't apply to the target element's kind (e.g. `fontSize` on a shape), or a value is out of range (opacity outside 0..1, fontSize/width/height <= 0, non-finite number, wrong primitive type). The message names the element kind and lists the valid keys for it. Dev AND prod. |
|
|
49
50
|
| [`E_INVALID_FILL`](#e_invalid_fill) | throw | A shape `fill` value is not a valid `ShapeFill` union member: unknown `type` (valid: "solid" \| "linear" \| "radial"), a gradient with fewer than 2 stops, a stop `offset` outside 0..1 (or non-finite), a non-string stop `color`, or a non-finite linear `angle`. Thrown wherever a fill enters the model — `new ShapeElement(...)` and `updateElement` patches. Dev AND prod. |
|
|
50
51
|
| [`E_NO_ACTIVE_ARTBOARD`](#e_no_active_artboard) | throw | `addElement(spec)`: there is no active artboard to add the element to. Create or select an artboard first (`<Editor.Root>` seeds one automatically; with a raw `EditorProvider` use `executeCreateArtboard`). Replaces the old `handleAddElement` window.alert — agents read throws, not dialogs. |
|
|
@@ -513,6 +514,18 @@ the issue key in `error.data.issue`.
|
|
|
513
514
|
|
|
514
515
|
`error.data`: `code`, `docSlug`, `index`
|
|
515
516
|
|
|
517
|
+
### `E_ELEMENT_TYPE_UNSUPPORTED`
|
|
518
|
+
|
|
519
|
+
**Fires when:** An element config names an element type the editor cannot build (today: 'distort', never implemented and refused by the design format). The message lists the types that exist.
|
|
520
|
+
|
|
521
|
+
- `src/core/ElementFactory.ts`
|
|
522
|
+
|
|
523
|
+
```text
|
|
524
|
+
'distort' is not an element type the editor can open: it was never implemented, and the design format (@snowcone-app/design) refuses it. Use a text transform that exists: ${SUPPORTED_TYPES.join(', ')}.
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
`error.data`: `code`, `received`, `validNames`
|
|
528
|
+
|
|
516
529
|
### `E_INVALID_PATCH`
|
|
517
530
|
|
|
518
531
|
**Fires when:** `updateElement(target, patch)`: a patch key doesn't apply to the target element's kind (e.g. `fontSize` on a shape), or a value is out of range (opacity outside 0..1, fontSize/width/height <= 0, non-finite number, wrong primitive type). The message names the element kind and lists the valid keys for it. Dev AND prod.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as pe, k as ye, _ as nt, l as $t, $ as be, a0 as Se, a1 as Kt, a2 as me, a3 as gt, a4 as Te, a5 as jt, a6 as we, a7 as ve, c as ae, a8 as _t, a9 as Me, aa as xe, ab as Re, ac as Ce, u as re, s as le, ad as pt, w as he, ae as zt, af as qt, ag as At, ah as Ut, ai as ke, aj as Ae, ak as Zt, al as Pe, am as Ee, an as He, I as Ie, ao as Be, ap as Le, aq as tt } from "./fontAnalysisCache-B2lh7X-_.js";
|
|
2
|
-
import { T as Vt, b as De, v as We, L as _e, M as Ft, A as Pt, N as ze, O as Ve, P as Fe, Q as Jt } from "./ExportManager-
|
|
2
|
+
import { T as Vt, b as De, v as We, L as _e, M as Ft, A as Pt, N as ze, O as Ve, P as Fe, Q as Jt } from "./ExportManager-Q4GQE68T.js";
|
|
3
3
|
import { a as Ot, i as Qt } from "./guards-2oykBUel.js";
|
|
4
4
|
import { cutValue as Oe, CUT_THRESHOLD as ce, hairlineMask as Ge } from "@snowcone-app/sdk/engrave";
|
|
5
5
|
import { m as Ye } from "./adjust-CDVzlVBY.js";
|
|
@@ -3539,4 +3539,4 @@ export {
|
|
|
3539
3539
|
mn as r,
|
|
3540
3540
|
Rn as t
|
|
3541
3541
|
};
|
|
3542
|
-
//# sourceMappingURL=CanvasRenderer-
|
|
3542
|
+
//# sourceMappingURL=CanvasRenderer-CV8fDS6m.js.map
|