@snowcone-app/canvas 0.30.0 → 0.32.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 +11 -0
- package/STYLING_CONTRACT.md +3 -3
- package/dist/{CanvasRenderer-BEf0hXeF.js → CanvasRenderer-1j-twIbs.js} +443 -431
- package/dist/{CanvasRenderer-BEf0hXeF.js.map → CanvasRenderer-1j-twIbs.js.map} +1 -1
- package/dist/{CanvasStateV1-BDSyYo4A.js → CanvasStateV1-BmC1JfPv.js} +813 -798
- package/dist/{CanvasStateV1-BDSyYo4A.js.map → CanvasStateV1-BmC1JfPv.js.map} +1 -1
- package/dist/ContextualToolbars-BKU8IoAM.js +6474 -0
- package/dist/ContextualToolbars-BKU8IoAM.js.map +1 -0
- package/dist/{EditorCanvasImpl-DXeBz2CX.js → EditorCanvasImpl-4voOsj2k.js} +19 -20
- package/dist/{EditorCanvasImpl-DXeBz2CX.js.map → EditorCanvasImpl-4voOsj2k.js.map} +1 -1
- package/dist/{ExportManager-DUdis6se.js → ExportManager-Ci81K6xA.js} +783 -500
- package/dist/ExportManager-Ci81K6xA.js.map +1 -0
- package/dist/{FontAnalyzer-DKG5JK0x.js → FontAnalyzer-BrKY6XYn.js} +1604 -1444
- package/dist/FontAnalyzer-BrKY6XYn.js.map +1 -0
- package/dist/{ImagePanel-CBgGqmVV.js → ImagePanel-ntJBepby.js} +49 -49
- package/dist/{ImagePanel-CBgGqmVV.js.map → ImagePanel-ntJBepby.js.map} +1 -1
- package/dist/{SnowconeCanvas-BWPBngvI.js → SnowconeCanvas-CgQdiBXv.js} +27 -27
- package/dist/{SnowconeCanvas-BWPBngvI.js.map → SnowconeCanvas-CgQdiBXv.js.map} +1 -1
- package/dist/advanced.mjs +14 -14
- package/dist/components/ImageToolbar.d.ts +12 -0
- package/dist/components/ShapeToolbar.d.ts +8 -0
- package/dist/components/TextToolbar.d.ts +5 -1
- package/dist/components/toolbars/EmbeddedToolbarLayout.d.ts +6 -0
- package/dist/components/toolbars/GroupElementToolbar.d.ts +8 -0
- package/dist/components/toolbars/SecondaryPanels.d.ts +40 -1
- package/dist/components/toolbars/index.d.ts +2 -2
- package/dist/components/ui/SliderRow.d.ts +6 -0
- package/dist/components/ui/toolbar-button.d.ts +2 -2
- package/dist/core/BaseElement.d.ts +2 -1
- package/dist/core/image-adjustments.d.ts +32 -0
- package/dist/core/shape-fill.d.ts +31 -0
- package/dist/{custom-icons-BIaRovwG.js → custom-icons-DTWtkJ9N.js} +7 -7
- package/dist/{custom-icons-BIaRovwG.js.map → custom-icons-DTWtkJ9N.js.map} +1 -1
- package/dist/design-builder-BpbYUYtK.js +1672 -0
- package/dist/design-builder-BpbYUYtK.js.map +1 -0
- package/dist/{embed-Csez1hui.js → embed-C69x0jHc.js} +110 -111
- package/dist/{embed-Csez1hui.js.map → embed-C69x0jHc.js.map} +1 -1
- package/dist/embed.mjs +53 -54
- package/dist/embed.mjs.map +1 -1
- package/dist/errors/editorError.d.ts +7 -0
- package/dist/{guards-BSoX73yg.js → guards-BhaQgJrE.js} +2 -2
- package/dist/{guards-BSoX73yg.js.map → guards-BhaQgJrE.js.map} +1 -1
- package/dist/hooks/elementPatch.d.ts +14 -4
- package/dist/index.mjs +41 -41
- package/dist/internals.mjs +202 -133
- package/dist/internals.mjs.map +1 -1
- package/dist/rendering/LayerEffectsRenderer.d.ts +24 -0
- package/dist/rendering/element-painters.d.ts +0 -13
- package/dist/rendering/element-serializer.d.ts +3 -1
- package/dist/rendering/image-adjustments.d.ts +24 -0
- package/dist/rendering/renderer-types.d.ts +10 -1
- package/dist/state/CanvasStateV1.d.ts +22 -0
- package/dist/style.css +1 -1
- package/dist/template-fields-D-2oLhCi.js +505 -0
- package/dist/template-fields-D-2oLhCi.js.map +1 -0
- package/dist/testing.mjs +40 -41
- package/dist/testing.mjs.map +1 -1
- package/dist/types/index.d.ts +105 -1
- package/dist/types/public.d.ts +3 -2
- package/dist/{UnifiedFontService-Co9tQ59z.js → useCommands-DwnZHUg8.js} +2361 -2103
- package/dist/useCommands-DwnZHUg8.js.map +1 -0
- package/dist/{usePieceGuideBundle-CRLY2iQa.js → usePieceGuideBundle-CnSmYrmM.js} +2 -2
- package/dist/{usePieceGuideBundle-CRLY2iQa.js.map → usePieceGuideBundle-CnSmYrmM.js.map} +1 -1
- package/dist/utils/featureApplied.d.ts +6 -0
- package/dist/{validation-BGEl9rrE.js → validation-DyUOjRGa.js} +465 -465
- package/dist/{validation-BGEl9rrE.js.map → validation-DyUOjRGa.js.map} +1 -1
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +1 -1
- package/dist/ContextualToolbars-C3D_6sep.js +0 -5960
- package/dist/ContextualToolbars-C3D_6sep.js.map +0 -1
- package/dist/ExportManager-DUdis6se.js.map +0 -1
- package/dist/FontAnalyzer-DKG5JK0x.js.map +0 -1
- package/dist/UnifiedFontService-Co9tQ59z.js.map +0 -1
- package/dist/design-builder-JYLO_Hyi.js +0 -470
- package/dist/design-builder-JYLO_Hyi.js.map +0 -1
- package/dist/editorErrors-WzaNxU1Y.js +0 -1206
- package/dist/editorErrors-WzaNxU1Y.js.map +0 -1
- package/dist/template-fields-DYPW7bVU.js +0 -716
- package/dist/template-fields-DYPW7bVU.js.map +0 -1
package/ERROR_CONTRACT.md
CHANGED
|
@@ -43,6 +43,7 @@ the issue key in `error.data.issue`.
|
|
|
43
43
|
| [`E_COLOR_ROLE_NOT_FOUND`](#e_color_role_not_found) | throw | `design.color(name)`: no color role with this name — lists the design's declared roles. |
|
|
44
44
|
| [`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. |
|
|
45
45
|
| [`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. |
|
|
46
|
+
| [`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. |
|
|
46
47
|
| [`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. |
|
|
47
48
|
| [`E_ASSET_FORBIDDEN`](#e_asset_forbidden) | throw | `assertRenders`: the shop's asset-origin allowlist denied a design asset (translated from the server's 403 — F4). |
|
|
48
49
|
| [`E_RENDER_FAILED`](#e_render_failed) | throw | `assertRenders`: the render failed or produced no usable image (F4). |
|
|
@@ -432,6 +433,16 @@ the issue key in `error.data.issue`.
|
|
|
432
433
|
|
|
433
434
|
`error.data`: `code`, `...data`, `docSlug`
|
|
434
435
|
|
|
436
|
+
### `E_INVALID_FILL`
|
|
437
|
+
|
|
438
|
+
**Fires when:** 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.
|
|
439
|
+
|
|
440
|
+
- `src/core/shape-fill.ts`
|
|
441
|
+
|
|
442
|
+
```text
|
|
443
|
+
${message}
|
|
444
|
+
```
|
|
445
|
+
|
|
435
446
|
### `E_NO_ACTIVE_ARTBOARD`
|
|
436
447
|
|
|
437
448
|
**Fires when:** `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.
|
package/STYLING_CONTRACT.md
CHANGED
|
@@ -92,7 +92,7 @@ stable hooks; `sc:`-prefixed utility classes are internal and NOT contract.
|
|
|
92
92
|
<div class="sc-toolbar" data-mode="embedded">
|
|
93
93
|
…
|
|
94
94
|
<div class="sc-secondary-toolbar-panel-wrapper">
|
|
95
|
-
<div> ×
|
|
95
|
+
<div> ×19
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
### `controls` — Editor.Controls — built-in floating toolbar (no Controls mounted; body portal)
|
|
@@ -117,7 +117,7 @@ stable hooks; `sc:`-prefixed utility classes are internal and NOT contract.
|
|
|
117
117
|
… ×5
|
|
118
118
|
<button aria-expanded="false" aria-label=<label> class="sc-toolbar-btn" type="button">
|
|
119
119
|
<button aria-label=<label> aria-pressed="false">
|
|
120
|
-
… ×
|
|
120
|
+
… ×8
|
|
121
121
|
<button aria-label=<label> aria-pressed="false" disabled>
|
|
122
122
|
…
|
|
123
123
|
<button aria-expanded="false" aria-label=<label> class="sc-toolbar-btn" type="button">
|
|
@@ -398,7 +398,7 @@ stable hooks; `sc:`-prefixed utility classes are internal and NOT contract.
|
|
|
398
398
|
<div>
|
|
399
399
|
…
|
|
400
400
|
<div class="sc-secondary-toolbar-panel-wrapper">
|
|
401
|
-
… ×
|
|
401
|
+
… ×19
|
|
402
402
|
<div data-sc-part="snowcone-editor-idle-dock">
|
|
403
403
|
<div data-sc-part="add">
|
|
404
404
|
<div>
|