@snowcone-app/canvas 0.27.0 → 0.29.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 +13 -0
- package/dist/{CanvasRenderer-yszzrDfo.js → CanvasRenderer-_lFoIoz5.js} +916 -848
- package/dist/CanvasRenderer-_lFoIoz5.js.map +1 -0
- package/dist/{CanvasStateV1-BTbCD_xC.js → CanvasStateV1-BMxr6xb8.js} +7 -4
- package/dist/{CanvasStateV1-BTbCD_xC.js.map → CanvasStateV1-BMxr6xb8.js.map} +1 -1
- package/dist/ContextualToolbars-0jWvnQgp.js +5833 -0
- package/dist/ContextualToolbars-0jWvnQgp.js.map +1 -0
- package/dist/{EditorCanvasImpl-Ui8Ceb-h.js → EditorCanvasImpl-BNz8TPFs.js} +8 -8
- package/dist/{EditorCanvasImpl-Ui8Ceb-h.js.map → EditorCanvasImpl-BNz8TPFs.js.map} +1 -1
- package/dist/{ExportManager-BTcyj4cf.js → ExportManager-B8Td7uR5.js} +1051 -976
- package/dist/ExportManager-B8Td7uR5.js.map +1 -0
- package/dist/{FontAnalyzer-EF3gLPr8.js → FontAnalyzer-D4Sg-P6_.js} +1410 -1329
- package/dist/FontAnalyzer-D4Sg-P6_.js.map +1 -0
- package/dist/{ImagePanel-CIk6z41z.js → ImagePanel-CN2Bu3hf.js} +6 -6
- package/dist/{ImagePanel-CIk6z41z.js.map → ImagePanel-CN2Bu3hf.js.map} +1 -1
- package/dist/{SnowconeCanvas-DuWALOAt.js → SnowconeCanvas-CR_LdRFP.js} +27 -27
- package/dist/{SnowconeCanvas-DuWALOAt.js.map → SnowconeCanvas-CR_LdRFP.js.map} +1 -1
- package/dist/{UnifiedFontService-CHVYDBDW.js → UnifiedFontService-CgYnYTj7.js} +755 -713
- package/dist/UnifiedFontService-CgYnYTj7.js.map +1 -0
- package/dist/advanced.mjs +14 -14
- package/dist/components/MultiSelectionToolbar.d.ts +18 -0
- package/dist/components/toolbars/SecondaryPanels.d.ts +11 -0
- package/dist/components/ui/toolbar-button.d.ts +2 -0
- package/dist/core/GestureConstraints.d.ts +92 -0
- package/dist/core/InteractionStateMachine.d.ts +16 -2
- package/dist/core/ResizeHandler.d.ts +4 -1
- package/dist/core/ResizePipeline.d.ts +3 -0
- package/dist/core/TextElement.d.ts +13 -0
- package/dist/core/TextMetrics.d.ts +17 -3
- package/dist/core/rich-text-layout.d.ts +2 -0
- package/dist/core/text-spacing.d.ts +74 -0
- package/dist/{custom-icons-CcLMyybv.js → custom-icons-B5TRC1Ed.js} +2 -2
- package/dist/{custom-icons-CcLMyybv.js.map → custom-icons-B5TRC1Ed.js.map} +1 -1
- package/dist/{design-builder-cZY958Rw.js → design-builder-COj0zkxu.js} +2 -2
- package/dist/{design-builder-cZY958Rw.js.map → design-builder-COj0zkxu.js.map} +1 -1
- package/dist/{editorErrors-BhrZ_nwj.js → editorErrors-CCvoKj_P.js} +2 -2
- package/dist/editorErrors-CCvoKj_P.js.map +1 -0
- package/dist/{embed-CJswRZte.js → embed-BTRtoktw.js} +10 -10
- package/dist/{embed-CJswRZte.js.map → embed-BTRtoktw.js.map} +1 -1
- package/dist/embed.mjs +6 -6
- package/dist/errors/editorError.d.ts +7 -1
- package/dist/{guards-DIX8aXWM.js → guards-uQtEQJbs.js} +2 -2
- package/dist/{guards-DIX8aXWM.js.map → guards-uQtEQJbs.js.map} +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useAlignDistribute.d.ts +19 -0
- package/dist/hooks/useTextToolbar.d.ts +8 -0
- package/dist/index.mjs +8 -8
- package/dist/internals.mjs +5 -5
- package/dist/rendering/renderer-types.d.ts +4 -0
- package/dist/rendering/rich-text-renderer.d.ts +4 -0
- package/dist/rendering/text-renderer.d.ts +4 -1
- package/dist/state/CanvasStateV1.d.ts +3 -0
- package/dist/{template-fields-BXl29sgh.js → template-fields-BLRp84Ny.js} +6 -6
- package/dist/{template-fields-BXl29sgh.js.map → template-fields-BLRp84Ny.js.map} +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/types/index.d.ts +26 -0
- package/dist/{usePieceGuideBundle-DE21DQGZ.js → usePieceGuideBundle-CTQszfKA.js} +2 -2
- package/dist/{usePieceGuideBundle-DE21DQGZ.js.map → usePieceGuideBundle-CTQszfKA.js.map} +1 -1
- package/dist/utils/alignDistribute.d.ts +41 -0
- package/dist/utils/featureApplied.d.ts +6 -0
- package/dist/{validation-DGXAQmUC.js → validation-eCebhplp.js} +2991 -2956
- package/dist/validation-eCebhplp.js.map +1 -0
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +1 -1
- package/dist/CanvasRenderer-yszzrDfo.js.map +0 -1
- package/dist/ContextualToolbars-BHjYsril.js +0 -5556
- package/dist/ContextualToolbars-BHjYsril.js.map +0 -1
- package/dist/ExportManager-BTcyj4cf.js.map +0 -1
- package/dist/FontAnalyzer-EF3gLPr8.js.map +0 -1
- package/dist/UnifiedFontService-CHVYDBDW.js.map +0 -1
- package/dist/editorErrors-BhrZ_nwj.js.map +0 -1
- package/dist/validation-DGXAQmUC.js.map +0 -1
package/ERROR_CONTRACT.md
CHANGED
|
@@ -49,6 +49,7 @@ the issue key in `error.data.issue`.
|
|
|
49
49
|
| [`E_BINDING_INERT`](#e_binding_inert) | throw | `assertRenders`: the mutated render is byte-identical to the seed render — the binding under test is dead (the two-render contract, F4). |
|
|
50
50
|
| [`E_NO_MUTABLE_BINDING`](#e_no_mutable_binding) | throw | `assertRenders`: the design has no named text layer to mutate and no `mutate` override was given (F4). |
|
|
51
51
|
| [`E_AUDIT_NO_ROOT`](#e_audit_no_root) | throw | `auditEditor()` called with no `<Editor.Root>` mounted — the imperative audit reads the most-recent mounted Root's registry (#10). |
|
|
52
|
+
| [`E_DISTRIBUTE_MIN_THREE`](#e_distribute_min_three) | throw | `computeDistribute()` called with fewer than 3 movable elements — distributing needs something between the two ends. Gate the action on `useAlignDistribute().canDistribute` instead of calling below the threshold (the toolbar hides its distribute buttons for exactly this reason). |
|
|
52
53
|
| [`missing-shop`](#missing-shop) | error → throws `E_EMBED_CONFIG` | No `shop` (the publishable shop id) was passed. |
|
|
53
54
|
| [`missing-grant`](#missing-grant) | error → throws `E_EMBED_CONFIG` | No grant source (`grantUrl`/`grant`) — the session can never authorize, so no mockup ever renders. |
|
|
54
55
|
| [`empty-mockup-ids`](#empty-mockup-ids) | error → throws `E_EMBED_CONFIG` | `product.mockupIds` is empty — nothing to render. |
|
|
@@ -536,6 +537,18 @@ the issue key in `error.data.issue`.
|
|
|
536
537
|
|
|
537
538
|
`error.data`: `code`, `docSlug`
|
|
538
539
|
|
|
540
|
+
### `E_DISTRIBUTE_MIN_THREE`
|
|
541
|
+
|
|
542
|
+
**Fires when:** `computeDistribute()` called with fewer than 3 movable elements — distributing needs something between the two ends. Gate the action on `useAlignDistribute().canDistribute` instead of calling below the threshold (the toolbar hides its distribute buttons for exactly this reason).
|
|
543
|
+
|
|
544
|
+
- `src/utils/alignDistribute.ts`
|
|
545
|
+
|
|
546
|
+
```text
|
|
547
|
+
distribute ${mode} needs at least ${DISTRIBUTE_MIN_COUNT} movable elements, got ${items.length}. Gate the action on useAlignDistribute().canDistribute (or items.length >= DISTRIBUTE_MIN_COUNT) instead of calling computeDistribute below the threshold.
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
`error.data`: `code`, `mode`, `count`, `min`
|
|
551
|
+
|
|
539
552
|
## Embed wiring issues (the `onIssue` channel)
|
|
540
553
|
|
|
541
554
|
Mount-time wiring problems and runtime stalls are `EmbedIssue` objects
|