@snowcone-app/canvas 0.40.20 → 0.40.22
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 +30 -0
- package/dist/{CanvasRenderer-COHWEK1r.js → CanvasRenderer-BmLEU_Zb.js} +4 -4
- package/dist/{CanvasRenderer-COHWEK1r.js.map → CanvasRenderer-BmLEU_Zb.js.map} +1 -1
- package/dist/{CanvasStateV1-DwziqxMO.js → CanvasStateV1-DnpfA376.js} +3 -3
- package/dist/{CanvasStateV1-DwziqxMO.js.map → CanvasStateV1-DnpfA376.js.map} +1 -1
- package/dist/{ContextualToolbars-D-EX9Q9L.js → ContextualToolbars-DSJykxdc.js} +196 -196
- package/dist/{ContextualToolbars-D-EX9Q9L.js.map → ContextualToolbars-DSJykxdc.js.map} +1 -1
- package/dist/{EditorCanvasImpl-Bt-dfd8v.js → EditorCanvasImpl-t5MD0lMB.js} +8 -8
- package/dist/{EditorCanvasImpl-Bt-dfd8v.js.map → EditorCanvasImpl-t5MD0lMB.js.map} +1 -1
- package/dist/{ExportManager-DLOH2Kzk.js → ExportManager-CnUTZrbv.js} +2 -2
- package/dist/{ExportManager-DLOH2Kzk.js.map → ExportManager-CnUTZrbv.js.map} +1 -1
- package/dist/{FontAnalyzer-DWHS41ba.js → FontAnalyzer-Bjtl4XTH.js} +70 -70
- package/dist/{FontAnalyzer-DWHS41ba.js.map → FontAnalyzer-Bjtl4XTH.js.map} +1 -1
- package/dist/{ImagePanel-BIzwlaf5.js → ImagePanel-AWQgzuXz.js} +6 -6
- package/dist/{ImagePanel-BIzwlaf5.js.map → ImagePanel-AWQgzuXz.js.map} +1 -1
- package/dist/SnowconeCanvas-BWv3Sd5P.js +1213 -0
- package/dist/SnowconeCanvas-BWv3Sd5P.js.map +1 -0
- package/dist/advanced.mjs +15 -15
- package/dist/api/stable.d.ts +1 -0
- package/dist/components/embed/SnowconeCanvas.d.ts +13 -0
- package/dist/components/embed/kernel.d.ts +8 -0
- package/dist/{custom-icons-DHew1GPV.js → custom-icons-Bn8_I4kt.js} +2 -2
- package/dist/{custom-icons-DHew1GPV.js.map → custom-icons-Bn8_I4kt.js.map} +1 -1
- package/dist/{design-builder-CoCtjIwj.js → design-builder-B3v5OAQo.js} +48 -48
- package/dist/{design-builder-CoCtjIwj.js.map → design-builder-B3v5OAQo.js.map} +1 -1
- package/dist/{embed-Dzblbo8q.js → embed-D6-jVZMw.js} +10 -10
- package/dist/{embed-Dzblbo8q.js.map → embed-D6-jVZMw.js.map} +1 -1
- package/dist/embed.mjs +9 -9
- package/dist/errors/editorError.d.ts +6 -0
- package/dist/{guards-DMmhw_Ow.js → guards-B_Q3pewr.js} +2 -2
- package/dist/{guards-DMmhw_Ow.js.map → guards-B_Q3pewr.js.map} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/internals.mjs +6 -6
- package/dist/{template-fields-BzAlpOEB.js → template-fields-B4sJfQjP.js} +18 -18
- package/dist/{template-fields-BzAlpOEB.js.map → template-fields-B4sJfQjP.js.map} +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{useCommands-CLnk8kvW.js → useCommands-CZHeVauL.js} +7 -7
- package/dist/{useCommands-CLnk8kvW.js.map → useCommands-CZHeVauL.js.map} +1 -1
- package/dist/{usePieceGuideBundle-BpIz4qow.js → usePieceGuideBundle-DsCv7HKy.js} +2 -2
- package/dist/{usePieceGuideBundle-BpIz4qow.js.map → usePieceGuideBundle-DsCv7HKy.js.map} +1 -1
- package/dist/utils/initialImageText.d.ts +51 -0
- package/dist/{validation-Ds2Df_gS.js → validation-D9catdeB.js} +11 -11
- package/dist/{validation-Ds2Df_gS.js.map → validation-D9catdeB.js.map} +1 -1
- package/example/package.json +1 -1
- package/package.json +3 -3
- package/dist/SnowconeCanvas-BZVuH85I.js +0 -1134
- package/dist/SnowconeCanvas-BZVuH85I.js.map +0 -1
package/ERROR_CONTRACT.md
CHANGED
|
@@ -43,6 +43,8 @@ the issue key in `error.data.issue`.
|
|
|
43
43
|
| [`E_COLOR_ROLE_INVALID`](#e_color_role_invalid) | throw | `design({ colors })`: a role's value is not a `#RGB`/`#RRGGBB` hex (value-matched bindings normalize hex; other syntaxes can't bind). |
|
|
44
44
|
| [`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. |
|
|
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
|
+
| [`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
|
+
| [`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. |
|
|
46
48
|
| [`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. |
|
|
47
49
|
| [`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. |
|
|
48
50
|
| [`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. |
|
|
@@ -482,6 +484,34 @@ the issue key in `error.data.issue`.
|
|
|
482
484
|
|
|
483
485
|
`error.data`: `code`, `docSlug`
|
|
484
486
|
|
|
487
|
+
### `E_INITIAL_TEXT_NO_IMAGE`
|
|
488
|
+
|
|
489
|
+
**Fires when:** `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`.
|
|
490
|
+
|
|
491
|
+
**Docs:** <https://developers.snowcone.app/initial-image-text> (`error.data.docSlug`)
|
|
492
|
+
|
|
493
|
+
- `src/utils/initialImageText.ts`
|
|
494
|
+
|
|
495
|
+
```text
|
|
496
|
+
initialImageText places words on the first picture, and no initialImage was given. Pass the picture as initialImage (the words go where they belong on it), or pass the whole design as initialElements and leave initialImageText out.
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
`error.data`: `code`, `docSlug`
|
|
500
|
+
|
|
501
|
+
### `E_INITIAL_TEXT_INVALID`
|
|
502
|
+
|
|
503
|
+
**Fires when:** 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.
|
|
504
|
+
|
|
505
|
+
**Docs:** <https://developers.snowcone.app/initial-image-text> (`error.data.docSlug`)
|
|
506
|
+
|
|
507
|
+
- `src/utils/initialImageText.ts`
|
|
508
|
+
|
|
509
|
+
```text
|
|
510
|
+
initialImageText[${i}]: ${wrong.join('; ')}.
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
`error.data`: `code`, `docSlug`, `index`
|
|
514
|
+
|
|
485
515
|
### `E_INVALID_PATCH`
|
|
486
516
|
|
|
487
517
|
**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 { k as re, l as le,
|
|
2
|
-
import { T as Wt, b as ke, v as Pe, L as Ae, M as Dt, A as At, N as Ee, O as He, P as Ie, Q as $t } from "./ExportManager-
|
|
3
|
-
import { a as _t, i as Be } from "./guards-
|
|
1
|
+
import { k as re, l as le, _ as nt, m as Ot, $ as he, a0 as ce, a1 as Yt, a2 as de, a3 as gt, a4 as fe, a5 as Gt, a6 as ge, a7 as ue, c as Qt, a8 as pe, a9 as ye, aa as be, ab as Se, v as te, s as ee, ac as pt, w as ne, ad as Lt, ae as Xt, af as Pt, ag as Nt, ah as me, ai as Te, aj as Kt, ak as we, al as ve, am as Me, I as xe, an as Re, ao as Ce, ap as tt } from "./FontAnalyzer-Bjtl4XTH.js";
|
|
2
|
+
import { T as Wt, b as ke, v as Pe, L as Ae, M as Dt, A as At, N as Ee, O as He, P as Ie, Q as $t } from "./ExportManager-CnUTZrbv.js";
|
|
3
|
+
import { a as _t, i as Be } from "./guards-B_Q3pewr.js";
|
|
4
4
|
const ct = {
|
|
5
5
|
// Canvas-specific
|
|
6
6
|
canvas: {
|
|
@@ -3491,4 +3491,4 @@ export {
|
|
|
3491
3491
|
ln as p,
|
|
3492
3492
|
en as r
|
|
3493
3493
|
};
|
|
3494
|
-
//# sourceMappingURL=CanvasRenderer-
|
|
3494
|
+
//# sourceMappingURL=CanvasRenderer-BmLEU_Zb.js.map
|