@snowcone-app/canvas 0.30.0 → 0.31.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/STYLING_CONTRACT.md +2 -2
- package/dist/{CanvasRenderer-BEf0hXeF.js → CanvasRenderer-hpJ05JGO.js} +4 -4
- package/dist/{CanvasRenderer-BEf0hXeF.js.map → CanvasRenderer-hpJ05JGO.js.map} +1 -1
- package/dist/{CanvasStateV1-BDSyYo4A.js → CanvasStateV1-jLOibojY.js} +11 -4
- package/dist/{CanvasStateV1-BDSyYo4A.js.map → CanvasStateV1-jLOibojY.js.map} +1 -1
- package/dist/{ContextualToolbars-C3D_6sep.js → ContextualToolbars-DRbuUE7W.js} +2086 -1985
- package/dist/ContextualToolbars-DRbuUE7W.js.map +1 -0
- package/dist/{EditorCanvasImpl-DXeBz2CX.js → EditorCanvasImpl-P2GHPNA3.js} +19 -20
- package/dist/{EditorCanvasImpl-DXeBz2CX.js.map → EditorCanvasImpl-P2GHPNA3.js.map} +1 -1
- package/dist/{ExportManager-DUdis6se.js → ExportManager-Bkzzyxgw.js} +400 -261
- package/dist/ExportManager-Bkzzyxgw.js.map +1 -0
- package/dist/{FontAnalyzer-DKG5JK0x.js → FontAnalyzer-BYhwxDhe.js} +1084 -1034
- package/dist/FontAnalyzer-BYhwxDhe.js.map +1 -0
- package/dist/{ImagePanel-CBgGqmVV.js → ImagePanel-CEr0_FYy.js} +49 -49
- package/dist/{ImagePanel-CBgGqmVV.js.map → ImagePanel-CEr0_FYy.js.map} +1 -1
- package/dist/{SnowconeCanvas-BWPBngvI.js → SnowconeCanvas-Fa0isFpO.js} +27 -27
- package/dist/{SnowconeCanvas-BWPBngvI.js.map → SnowconeCanvas-Fa0isFpO.js.map} +1 -1
- package/dist/advanced.mjs +14 -14
- package/dist/components/ImageToolbar.d.ts +4 -0
- package/dist/components/toolbars/EmbeddedToolbarLayout.d.ts +2 -0
- package/dist/components/toolbars/SecondaryPanels.d.ts +17 -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/image-adjustments.d.ts +32 -0
- package/dist/{custom-icons-BIaRovwG.js → custom-icons-Co4rcW0S.js} +7 -7
- package/dist/{custom-icons-BIaRovwG.js.map → custom-icons-Co4rcW0S.js.map} +1 -1
- package/dist/design-builder-CBG2hKc8.js +1672 -0
- package/dist/design-builder-CBG2hKc8.js.map +1 -0
- package/dist/{embed-Csez1hui.js → embed-D4TIzO7g.js} +110 -111
- package/dist/{embed-Csez1hui.js.map → embed-D4TIzO7g.js.map} +1 -1
- package/dist/embed.mjs +53 -54
- package/dist/embed.mjs.map +1 -1
- package/dist/{guards-BSoX73yg.js → guards-DgZuwVgu.js} +2 -2
- package/dist/{guards-BSoX73yg.js.map → guards-DgZuwVgu.js.map} +1 -1
- package/dist/hooks/elementPatch.d.ts +7 -2
- package/dist/index.mjs +41 -41
- package/dist/internals.mjs +196 -127
- package/dist/internals.mjs.map +1 -1
- 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 +8 -1
- package/dist/state/CanvasStateV1.d.ts +5 -0
- package/dist/template-fields-CvFcr5zy.js +505 -0
- package/dist/template-fields-CvFcr5zy.js.map +1 -0
- package/dist/testing.mjs +40 -41
- package/dist/testing.mjs.map +1 -1
- package/dist/types/index.d.ts +21 -0
- package/dist/{UnifiedFontService-Co9tQ59z.js → useCommands-bPXY9rCh.js} +2344 -2103
- package/dist/useCommands-bPXY9rCh.js.map +1 -0
- package/dist/{usePieceGuideBundle-CRLY2iQa.js → usePieceGuideBundle-Bj98nPk0.js} +2 -2
- package/dist/{usePieceGuideBundle-CRLY2iQa.js.map → usePieceGuideBundle-Bj98nPk0.js.map} +1 -1
- package/dist/utils/featureApplied.d.ts +2 -0
- package/dist/{validation-BGEl9rrE.js → validation-CsTlSvJJ.js} +465 -465
- package/dist/{validation-BGEl9rrE.js.map → validation-CsTlSvJJ.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.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/dist/embed.mjs
CHANGED
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import { C as a, a as t, b as r,
|
|
2
|
-
import { E as
|
|
3
|
-
import { E as
|
|
4
|
-
import { D as
|
|
5
|
-
import { u as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { s as te } from "./CanvasStateV1-BDSyYo4A.js";
|
|
1
|
+
import { C as a, a as t, b as r, A as o, F as i, G as n, H as d, J as m, K as u, u as l, d as E, f as c, g as p, h as g } from "./useCommands-bPXY9rCh.js";
|
|
2
|
+
import { E as S, R as f, a as C, b as T, S as F, c as v, d as y, f as P, p as b, e as B, g as R, h, v as D } from "./embed-D4TIzO7g.js";
|
|
3
|
+
import { E as L, y as k } from "./FontAnalyzer-BYhwxDhe.js";
|
|
4
|
+
import { D as A, d as G, j as K, i as M, u as _ } from "./design-builder-CBG2hKc8.js";
|
|
5
|
+
import { D as z, T as H, r as J, u as N, a as Y, b as q, c as O, d as Q, e as U, w as V } from "./template-fields-CvFcr5zy.js";
|
|
6
|
+
import { c as X, e as Z, l as $, r as ee } from "./ExportManager-Bkzzyxgw.js";
|
|
7
|
+
import { s as ae } from "./CanvasStateV1-jLOibojY.js";
|
|
9
8
|
export {
|
|
10
9
|
a as CanvasServicesProvider,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
A as DesignBuilder,
|
|
11
|
+
z as DesignStateStore,
|
|
12
|
+
S as Editor,
|
|
13
|
+
L as EditorError,
|
|
14
|
+
f as RealtimeCanvas,
|
|
15
|
+
C as RealtimeEmbed,
|
|
16
|
+
T as RealtimeMockup,
|
|
17
|
+
F as SnowconeEditor,
|
|
18
|
+
H as TEMPLATE_FIELDS_KEY,
|
|
19
|
+
v as auditEditor,
|
|
20
|
+
y as collectEmbedIssues,
|
|
22
21
|
t as createProxyGenerate,
|
|
23
22
|
r as createProxyImageSearch,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
23
|
+
X as customFontRegistry,
|
|
24
|
+
G as design,
|
|
25
|
+
o as editorElementKind,
|
|
26
|
+
Z as ensureCustomFontsLoaded,
|
|
27
|
+
P as formatBuyPrice,
|
|
28
|
+
K as isColorToken,
|
|
29
|
+
k as isEditorError,
|
|
30
|
+
i as isGroupElement,
|
|
31
|
+
n as isImageElement,
|
|
32
|
+
M as isLayerToken,
|
|
33
|
+
d as isPathElement,
|
|
34
|
+
m as isShapeElement,
|
|
35
|
+
u as isTextElement,
|
|
36
|
+
$ as loadCustomFont,
|
|
37
|
+
b as productToRenderConfig,
|
|
38
|
+
J as readTemplateFields,
|
|
39
|
+
ee as registerCustomFonts,
|
|
40
|
+
ae as serializeState,
|
|
41
|
+
l as useArtboards,
|
|
42
|
+
E as useCanvasServices,
|
|
43
|
+
N as useColorBinding,
|
|
44
|
+
c as useCommands,
|
|
45
|
+
_ as useEditor,
|
|
46
|
+
Y as useElementByName,
|
|
47
|
+
p as useExport,
|
|
48
|
+
q as useFontBinding,
|
|
49
|
+
O as useImageBinding,
|
|
50
|
+
g as useLayers,
|
|
51
|
+
B as usePlacements,
|
|
52
|
+
R as useProductSelection,
|
|
53
|
+
h as useRealtimeMockups,
|
|
54
|
+
Q as useSelectedElement,
|
|
55
|
+
U as useTextBinding,
|
|
56
|
+
D as validateEmbed,
|
|
57
|
+
V as withTemplateFields
|
|
59
58
|
};
|
|
60
59
|
//# sourceMappingURL=embed.mjs.map
|
package/dist/embed.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"embed.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as n, I as t, P as a, S as s, T as i } from "./FontAnalyzer-
|
|
1
|
+
import { G as n, I as t, P as a, S as s, T as i } from "./FontAnalyzer-BYhwxDhe.js";
|
|
2
2
|
function r(e) {
|
|
3
3
|
return e instanceof i;
|
|
4
4
|
}
|
|
@@ -21,4 +21,4 @@ export {
|
|
|
21
21
|
r as d,
|
|
22
22
|
u as i
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=guards-
|
|
24
|
+
//# sourceMappingURL=guards-DgZuwVgu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards-
|
|
1
|
+
{"version":3,"file":"guards-DgZuwVgu.js","sources":["../src/types/guards.ts"],"sourcesContent":["/**\n * Type guards for EditorElement discrimination\n *\n * These guards use instanceof checks against the concrete element classes,\n * matching the pattern established in EditorContext.tsx. They accept\n * BaseElement | EditorElement | undefined | null for maximum flexibility\n * at call sites.\n */\n\nimport { BaseElement } from '../core/BaseElement.js';\nimport { TextElement } from '../core/TextElement.js';\nimport { ImageElement } from '../core/ImageElement.js';\nimport { GroupElement } from '../core/GroupElement.js';\nimport { ShapeElement } from '../core/ShapeElement.js';\nimport { PathElement } from '../core/PathElement.js';\n\ntype Narrowable = BaseElement | TextElement | ImageElement | GroupElement | ShapeElement | PathElement | undefined | null;\n\n/**\n * Type guard: checks if an element is a TextElement (or any text-based transform subclass).\n *\n * TextElement is the base class for all text transforms (custom, circle, arch, wave, etc.),\n * so this returns true for any text-based element regardless of its specific transformType.\n */\nexport function isTextElement(element: Narrowable): element is TextElement {\n return element instanceof TextElement;\n}\n\n/**\n * Type guard: checks if an element is an ImageElement.\n */\nexport function isImageElement(element: Narrowable): element is ImageElement {\n return element instanceof ImageElement;\n}\n\n/**\n * Type guard: checks if an element is a GroupElement.\n */\nexport function isGroupElement(element: Narrowable): element is GroupElement {\n return element instanceof GroupElement;\n}\n\n/**\n * Type guard: checks if an element is a ShapeElement.\n */\nexport function isShapeElement(element: Narrowable): element is ShapeElement {\n return element instanceof ShapeElement;\n}\n\n/**\n * Type guard: checks if an element is a PathElement.\n */\nexport function isPathElement(element: Narrowable): element is PathElement {\n return element instanceof PathElement;\n}\n"],"names":["isTextElement","element","TextElement","isImageElement","ImageElement","isGroupElement","GroupElement","isShapeElement","ShapeElement","isPathElement","PathElement"],"mappings":";AAwBO,SAASA,EAAcC,GAA6C;AACzE,SAAOA,aAAmBC;AAC5B;AAKO,SAASC,EAAeF,GAA8C;AAC3E,SAAOA,aAAmBG;AAC5B;AAKO,SAASC,EAAeJ,GAA8C;AAC3E,SAAOA,aAAmBK;AAC5B;AAKO,SAASC,EAAeN,GAA8C;AAC3E,SAAOA,aAAmBO;AAC5B;AAKO,SAASC,EAAcR,GAA6C;AACzE,SAAOA,aAAmBS;AAC5B;"}
|
|
@@ -2,7 +2,7 @@ import { LayerToken } from '../design/design-builder.js';
|
|
|
2
2
|
import { EditorElementKind } from '../core/elementGuards.js';
|
|
3
3
|
import { ElementStore } from '../core/ElementStore.js';
|
|
4
4
|
import { EditorElement } from '../contexts/EditorContext.js';
|
|
5
|
-
import { TextAlign } from '../types/index.js';
|
|
5
|
+
import { TextAlign, ImageAdjustments } from '../types/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* A serializable element patch for {@link UseCommandsReturn.updateElement}.
|
|
8
8
|
*
|
|
@@ -15,7 +15,7 @@ import { TextAlign } from '../types/index.js';
|
|
|
15
15
|
* | `x`, `y`, `rotation`, `opacity`, `name`, `visible`, `locked` | every kind |
|
|
16
16
|
* | `text`, `fontSize`, `color`, `fontFamily`, `bold`, `italic`, `textAlign` | text |
|
|
17
17
|
* | `fillColor`, `width`, `height` | shape |
|
|
18
|
-
* | `imageUrl`, `width`, `height` | image |
|
|
18
|
+
* | `imageUrl`, `width`, `height`, `adjustments` | image |
|
|
19
19
|
*/
|
|
20
20
|
export interface ElementPatch {
|
|
21
21
|
/** Center x in artboard coordinates. Any kind. */
|
|
@@ -56,6 +56,11 @@ export interface ElementPatch {
|
|
|
56
56
|
* Combined with explicit `width`/`height` the frame is preserved;
|
|
57
57
|
* otherwise the frame height re-fits the loaded aspect ratio. */
|
|
58
58
|
imageUrl?: string;
|
|
59
|
+
/** Brightness/contrast/saturation multipliers (each 0..3, 1 = neutral —
|
|
60
|
+
* e.g. "warmer/brighter photo" ≈ `{ brightness: 1.1, contrast: 1, saturation: 1.2 }`).
|
|
61
|
+
* Passing all-neutral `{1, 1, 1}` RESETS (the stored neutral state is the
|
|
62
|
+
* absence of adjustments). Image elements only. */
|
|
63
|
+
adjustments?: ImageAdjustments;
|
|
59
64
|
}
|
|
60
65
|
/** Options for {@link UseCommandsReturn.updateElement}. */
|
|
61
66
|
export interface UpdateElementOptions {
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { e as u } from "./
|
|
2
|
-
import { C as p, c as x, a as I, b as v, u as A, d as g, f as T, g as B } from "./
|
|
3
|
-
import { E as
|
|
4
|
-
import { u as m, a as d } from "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { e as u } from "./useCommands-bPXY9rCh.js";
|
|
2
|
+
import { C as p, c as x, a as I, b as v, u as A, d as g, f as T, g as B, h as P } from "./useCommands-bPXY9rCh.js";
|
|
3
|
+
import { E as F, S as L, S as _, u as O, a as R } from "./SnowconeCanvas-Fa0isFpO.js";
|
|
4
|
+
import { u as m, a as d } from "./design-builder-CBG2hKc8.js";
|
|
5
|
+
import { C as z, D as w, d as D, s as K } from "./design-builder-CBG2hKc8.js";
|
|
6
|
+
import { T as V, r as b, u as h, a as U, b as Y, c as Z, d as G, e as H, w as j } from "./template-fields-CvFcr5zy.js";
|
|
7
|
+
import { A as q, C as J, E as Q, M as W, P as X, r as $, v as ee } from "./validation-CsTlSvJJ.js";
|
|
8
|
+
import { c as ae, e as te, l as oe, r as re } from "./ExportManager-Bkzzyxgw.js";
|
|
9
9
|
import { c as ie, e as ue } from "./compose-DtQL_oit.js";
|
|
10
|
-
import { d as de, m as Ce, s as Se, v as Ee } from "./CanvasStateV1-
|
|
10
|
+
import { d as de, m as Ce, s as Se, v as Ee } from "./CanvasStateV1-jLOibojY.js";
|
|
11
11
|
function E() {
|
|
12
12
|
const { isCanvasReady: e } = m();
|
|
13
13
|
return e;
|
|
@@ -18,52 +18,52 @@ function c() {
|
|
|
18
18
|
}
|
|
19
19
|
u();
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
q as ALL_CAPABILITIES,
|
|
22
|
+
z as CANVAS_STATE_SCHEMA_VERSION,
|
|
23
|
+
J as COMPACT_CUSTOMIZER,
|
|
24
24
|
p as CanvasServicesProvider,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
w as DesignBuilder,
|
|
26
|
+
Q as EMBED_ONLY,
|
|
27
|
+
F as ErrorBoundary,
|
|
28
|
+
W as MINIMAL_CAPABILITIES,
|
|
29
|
+
X as PRO_STUDIO,
|
|
30
|
+
L as SnowconeCanvas,
|
|
31
|
+
V as TEMPLATE_FIELDS_KEY,
|
|
32
32
|
ie as createKit,
|
|
33
33
|
x as createProxyBgRemove,
|
|
34
34
|
I as createProxyGenerate,
|
|
35
35
|
v as createProxyImageSearch,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
ae as customFontRegistry,
|
|
37
|
+
_ as default,
|
|
38
38
|
de as deserializeState,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
D as design,
|
|
40
|
+
te as ensureCustomFontsLoaded,
|
|
41
41
|
ue as extendKit,
|
|
42
|
-
|
|
42
|
+
oe as loadCustomFont,
|
|
43
43
|
Ce as migrateState,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
b as readTemplateFields,
|
|
45
|
+
re as registerCustomFonts,
|
|
46
|
+
$ as resolveKit,
|
|
47
47
|
Se as serializeState,
|
|
48
|
-
|
|
48
|
+
K as serializeStateForServer,
|
|
49
49
|
A as useArtboards,
|
|
50
|
-
|
|
50
|
+
O as useAutoExport,
|
|
51
51
|
E as useCanvasReady,
|
|
52
52
|
g as useCanvasServices,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
h as useColorBinding,
|
|
54
|
+
T as useCommands,
|
|
55
|
+
R as useContentReady,
|
|
56
56
|
m as useEditor,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
U as useElementByName,
|
|
58
|
+
B as useExport,
|
|
59
|
+
Y as useFontBinding,
|
|
60
|
+
Z as useImageBinding,
|
|
61
|
+
P as useLayers,
|
|
62
|
+
G as useSelectedElement,
|
|
63
|
+
H as useTextBinding,
|
|
64
64
|
c as useViewport,
|
|
65
|
-
|
|
65
|
+
ee as validateKit,
|
|
66
66
|
Ee as validateState,
|
|
67
|
-
|
|
67
|
+
j as withTemplateFields
|
|
68
68
|
};
|
|
69
69
|
//# sourceMappingURL=index.mjs.map
|