@snowcone-app/canvas 0.46.10 → 0.46.13

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.
Files changed (52) hide show
  1. package/ERROR_CONTRACT.md +13 -0
  2. package/dist/{CanvasRenderer-CmIQSVCK.js → CanvasRenderer-CV8fDS6m.js} +4 -4
  3. package/dist/{CanvasRenderer-CmIQSVCK.js.map → CanvasRenderer-CV8fDS6m.js.map} +1 -1
  4. package/dist/{ContextualToolbars-BG90V6-s.js → ContextualToolbars-DsQ83_VR.js} +138 -137
  5. package/dist/ContextualToolbars-DsQ83_VR.js.map +1 -0
  6. package/dist/{EditorCanvasImpl-C7y7UNl1.js → EditorCanvasImpl-CbKLAe8P.js} +8 -8
  7. package/dist/{EditorCanvasImpl-C7y7UNl1.js.map → EditorCanvasImpl-CbKLAe8P.js.map} +1 -1
  8. package/dist/ExportManager-Q4GQE68T.js +5584 -0
  9. package/dist/ExportManager-Q4GQE68T.js.map +1 -0
  10. package/dist/{ImagePanel-BaEJnUvS.js → ImagePanel-DNgvLouH.js} +6 -6
  11. package/dist/{ImagePanel-BaEJnUvS.js.map → ImagePanel-DNgvLouH.js.map} +1 -1
  12. package/dist/{SnowconeCanvas-C6FmL0pj.js → SnowconeCanvas-Cu3IuAhp.js} +10 -10
  13. package/dist/{SnowconeCanvas-C6FmL0pj.js.map → SnowconeCanvas-Cu3IuAhp.js.map} +1 -1
  14. package/dist/advanced.mjs +16 -16
  15. package/dist/{compose-Ce53EW1v.js → compose-CatWJeVf.js} +3 -3
  16. package/dist/{compose-Ce53EW1v.js.map → compose-CatWJeVf.js.map} +1 -1
  17. package/dist/constants.d.ts +0 -1
  18. package/dist/{custom-icons-BA-MX7Y2.js → custom-icons-DP6uSyX-.js} +2 -2
  19. package/dist/{custom-icons-BA-MX7Y2.js.map → custom-icons-DP6uSyX-.js.map} +1 -1
  20. package/dist/{design-builder-HKRo18WT.js → design-builder-CCPB3WRx.js} +4 -4
  21. package/dist/design-builder-CCPB3WRx.js.map +1 -0
  22. package/dist/{embed-CYlEe_Xv.js → embed-DobFUit8.js} +9 -9
  23. package/dist/{embed-CYlEe_Xv.js.map → embed-DobFUit8.js.map} +1 -1
  24. package/dist/embed.mjs +6 -6
  25. package/dist/errors/editorError.d.ts +3 -0
  26. package/dist/{export-worker.bundle.string-CyMb_XjB.js → export-worker.bundle.string-DG2f-C1t.js} +1490 -1487
  27. package/dist/{export-worker.bundle.string-CyMb_XjB.js.map → export-worker.bundle.string-DG2f-C1t.js.map} +1 -1
  28. package/dist/{FontAnalyzer-CLMJi2Sw.js → fontAnalysisCache-B2lh7X-_.js} +1408 -3329
  29. package/dist/fontAnalysisCache-B2lh7X-_.js.map +1 -0
  30. package/dist/{guards-Dk86a-kH.js → guards-2oykBUel.js} +2 -2
  31. package/dist/{guards-Dk86a-kH.js.map → guards-2oykBUel.js.map} +1 -1
  32. package/dist/index.mjs +9 -9
  33. package/dist/internals.mjs +5 -5
  34. package/dist/{template-fields-3CH15MFC.js → template-fields-BqGWVbJo.js} +6 -6
  35. package/dist/template-fields-BqGWVbJo.js.map +1 -0
  36. package/dist/testing.mjs +3 -3
  37. package/dist/{useCommands-C6nE770t.js → useCommands-DHwYOhSp.js} +17 -17
  38. package/dist/{useCommands-C6nE770t.js.map → useCommands-DHwYOhSp.js.map} +1 -1
  39. package/dist/{usePieceGuideBundle-DJfjOVEd.js → usePieceGuideBundle-BuxwVcb5.js} +2 -2
  40. package/dist/{usePieceGuideBundle-DJfjOVEd.js.map → usePieceGuideBundle-BuxwVcb5.js.map} +1 -1
  41. package/dist/utils/fontAnalysisCache.d.ts +14 -0
  42. package/dist/{validation-C3FHoCbQ.js → validation-EoPS9fDC.js} +11 -11
  43. package/dist/{validation-C3FHoCbQ.js.map → validation-EoPS9fDC.js.map} +1 -1
  44. package/dist/workers/export-worker.bundle.string.d.ts +1 -1
  45. package/example/package.json +1 -1
  46. package/package.json +4 -4
  47. package/dist/ContextualToolbars-BG90V6-s.js.map +0 -1
  48. package/dist/ExportManager-DEJgxB0S.js +0 -3647
  49. package/dist/ExportManager-DEJgxB0S.js.map +0 -1
  50. package/dist/FontAnalyzer-CLMJi2Sw.js.map +0 -1
  51. package/dist/design-builder-HKRo18WT.js.map +0 -1
  52. package/dist/template-fields-3CH15MFC.js.map +0 -1
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,6 +1,6 @@
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 "./FontAnalyzer-CLMJi2Sw.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-DEJgxB0S.js";
3
- import { a as Ot, i as Qt } from "./guards-Dk86a-kH.js";
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-Q4GQE68T.js";
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";
6
6
  const ct = {
@@ -3539,4 +3539,4 @@ export {
3539
3539
  mn as r,
3540
3540
  Rn as t
3541
3541
  };
3542
- //# sourceMappingURL=CanvasRenderer-CmIQSVCK.js.map
3542
+ //# sourceMappingURL=CanvasRenderer-CV8fDS6m.js.map