@overtone-art/canvas-editor-core 0.7.0 → 0.8.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/dist/index.d.mts +86 -4
- package/dist/index.d.ts +86 -4
- package/dist/index.global.js +52 -52
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +254 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +233 -3
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/{types-DLrbzRj1.d.mts → types-DmintAiu.d.mts} +37 -2
- package/dist/{types-DLrbzRj1.d.ts → types-DmintAiu.d.ts} +37 -2
- package/package.json +1 -1
package/dist/node.d.mts
CHANGED
package/dist/node.d.ts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { FabricObject } from 'fabric';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Layer blend modes — the seventeen the canvas can composite natively, verified
|
|
5
|
+
* identical in the browser and in node-canvas 3.2.3.
|
|
6
|
+
*
|
|
7
|
+
* The ten Photoshop modes with no canvas equivalent (Dissolve, Linear Burn,
|
|
8
|
+
* Darker/Lighter Color, Vivid/Linear/Pin Light, Hard Mix, Subtract, Divide) are
|
|
9
|
+
* deliberately absent: each would need a per-layer pixel readback pass, in the
|
|
10
|
+
* browser AND again in the API's Node compositor, and the two drifting is a
|
|
11
|
+
* print that does not match the preview.
|
|
12
|
+
*/
|
|
13
|
+
declare const BLEND_MODES: readonly ["normal", "darken", "multiply", "color-burn", "lighten", "screen", "color-dodge", "linear-dodge", "overlay", "soft-light", "hard-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
14
|
+
type BlendMode = (typeof BLEND_MODES)[number];
|
|
15
|
+
declare function blendOperation(mode: BlendMode): GlobalCompositeOperation;
|
|
16
|
+
/**
|
|
17
|
+
* The mode an object's `globalCompositeOperation` represents.
|
|
18
|
+
*
|
|
19
|
+
* Anything the menu cannot produce reads as `normal` — a mask entry's
|
|
20
|
+
* `destination-in` is a compositing instruction from the mask stack, not a blend
|
|
21
|
+
* a user chose, and must not appear in the picker as though it were.
|
|
22
|
+
*/
|
|
23
|
+
declare function blendModeOf(operation: string | undefined | null): BlendMode;
|
|
24
|
+
/** Menu grouping, in Photoshop's order. */
|
|
25
|
+
declare const BLEND_GROUPS: {
|
|
26
|
+
label: string;
|
|
27
|
+
modes: BlendMode[];
|
|
28
|
+
}[];
|
|
29
|
+
/** Human label for a mode, e.g. `color-burn` → `Color Burn`. */
|
|
30
|
+
declare function blendModeLabel(mode: BlendMode): string;
|
|
31
|
+
|
|
3
32
|
type Unit = 'px' | 'mm' | 'in';
|
|
4
|
-
type LayerType = 'image' | 'mask' | 'text' | 'shape' | 'template' | 'group';
|
|
33
|
+
type LayerType = 'image' | 'mask' | 'text' | 'shape' | 'template' | 'group' | 'gradient';
|
|
5
34
|
interface LayerData {
|
|
6
35
|
id: string;
|
|
7
36
|
type: LayerType;
|
|
@@ -9,6 +38,12 @@ interface LayerData {
|
|
|
9
38
|
visible: boolean;
|
|
10
39
|
locked: boolean;
|
|
11
40
|
opacity: number;
|
|
41
|
+
/**
|
|
42
|
+
* Compositing mode, derived from the fabric object's
|
|
43
|
+
* `globalCompositeOperation` rather than stored beside it. Absent means
|
|
44
|
+
* `normal`; the fabric object is what serializes and what restores.
|
|
45
|
+
*/
|
|
46
|
+
blend?: BlendMode;
|
|
12
47
|
/** Non-fabric metadata persisted with the layer (pattern config, etc). */
|
|
13
48
|
meta?: LayerMeta;
|
|
14
49
|
/** Layers nested inside this one. Only a `group` layer has any. */
|
|
@@ -577,4 +612,4 @@ interface EditorEvents {
|
|
|
577
612
|
};
|
|
578
613
|
}
|
|
579
614
|
|
|
580
|
-
export { type
|
|
615
|
+
export { type ShapeMaskPresetId as $, type MaskRefinementResult as A, BLEND_GROUPS as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupBlendMode as G, type MockupConfig as H, type ImageAdjustments as I, type MockupDisplacement as J, type MockupDisplacementChannel as K, type LayerData as L, type MaskBrushOptions as M, type MockupOverlay as N, type MockupPrintArea as O, type NormalizedLayerPosition as P, type PatternConfig as Q, type PatternLocks as R, type PatternState as S, type PositioningAdapter as T, type PrintifyPositioning as U, type ProjectPage as V, type ProjectState as W, type ResizeOptions as X, type SemanticExportOptions as Y, type SerializedBackgroundImageOptions as Z, type SerializedLayer as _, BLEND_MODES as a, type ShapePlugin as a0, type SvgExportOptions as a1, type TemplateDefinition as a2, type TemplateParameter as a3, type TextCurveConfig as a4, type TextCurveInput as a5, type TextCurveShape as a6, type TextOverflow as a7, type TextWrapMode as a8, type TextureMaskPresetId as a9, type TileMode as aa, type Unit as ab, blendModeLabel as ac, blendModeOf as ad, blendOperation as ae, type BackgroundImageOptions as b, type BlendMode as c, type DpiIssue as d, type EditorEvents as e, type EditorState as f, type ExportFormat as g, type FontDefinition as h, type ImageAttribution as i, type ImageProvider as j, type ImageProviderResult as k, type ImageSearchOptions as l, type ImageSearchResult as m, type LayerMaskEntry as n, type LayerMaskMode as o, type LayerMeta as p, type LayerShadowConfig as q, type LayerType as r, type LicenseConfig as s, type LicensePayload as t, type LicenseStatus as u, type MaskPoint as v, type MaskPresetId as w, type MaskRefinementPrompt as x, type MaskRefinementProvider as y, type MaskRefinementRequest as z };
|
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { FabricObject } from 'fabric';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Layer blend modes — the seventeen the canvas can composite natively, verified
|
|
5
|
+
* identical in the browser and in node-canvas 3.2.3.
|
|
6
|
+
*
|
|
7
|
+
* The ten Photoshop modes with no canvas equivalent (Dissolve, Linear Burn,
|
|
8
|
+
* Darker/Lighter Color, Vivid/Linear/Pin Light, Hard Mix, Subtract, Divide) are
|
|
9
|
+
* deliberately absent: each would need a per-layer pixel readback pass, in the
|
|
10
|
+
* browser AND again in the API's Node compositor, and the two drifting is a
|
|
11
|
+
* print that does not match the preview.
|
|
12
|
+
*/
|
|
13
|
+
declare const BLEND_MODES: readonly ["normal", "darken", "multiply", "color-burn", "lighten", "screen", "color-dodge", "linear-dodge", "overlay", "soft-light", "hard-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
14
|
+
type BlendMode = (typeof BLEND_MODES)[number];
|
|
15
|
+
declare function blendOperation(mode: BlendMode): GlobalCompositeOperation;
|
|
16
|
+
/**
|
|
17
|
+
* The mode an object's `globalCompositeOperation` represents.
|
|
18
|
+
*
|
|
19
|
+
* Anything the menu cannot produce reads as `normal` — a mask entry's
|
|
20
|
+
* `destination-in` is a compositing instruction from the mask stack, not a blend
|
|
21
|
+
* a user chose, and must not appear in the picker as though it were.
|
|
22
|
+
*/
|
|
23
|
+
declare function blendModeOf(operation: string | undefined | null): BlendMode;
|
|
24
|
+
/** Menu grouping, in Photoshop's order. */
|
|
25
|
+
declare const BLEND_GROUPS: {
|
|
26
|
+
label: string;
|
|
27
|
+
modes: BlendMode[];
|
|
28
|
+
}[];
|
|
29
|
+
/** Human label for a mode, e.g. `color-burn` → `Color Burn`. */
|
|
30
|
+
declare function blendModeLabel(mode: BlendMode): string;
|
|
31
|
+
|
|
3
32
|
type Unit = 'px' | 'mm' | 'in';
|
|
4
|
-
type LayerType = 'image' | 'mask' | 'text' | 'shape' | 'template' | 'group';
|
|
33
|
+
type LayerType = 'image' | 'mask' | 'text' | 'shape' | 'template' | 'group' | 'gradient';
|
|
5
34
|
interface LayerData {
|
|
6
35
|
id: string;
|
|
7
36
|
type: LayerType;
|
|
@@ -9,6 +38,12 @@ interface LayerData {
|
|
|
9
38
|
visible: boolean;
|
|
10
39
|
locked: boolean;
|
|
11
40
|
opacity: number;
|
|
41
|
+
/**
|
|
42
|
+
* Compositing mode, derived from the fabric object's
|
|
43
|
+
* `globalCompositeOperation` rather than stored beside it. Absent means
|
|
44
|
+
* `normal`; the fabric object is what serializes and what restores.
|
|
45
|
+
*/
|
|
46
|
+
blend?: BlendMode;
|
|
12
47
|
/** Non-fabric metadata persisted with the layer (pattern config, etc). */
|
|
13
48
|
meta?: LayerMeta;
|
|
14
49
|
/** Layers nested inside this one. Only a `group` layer has any. */
|
|
@@ -577,4 +612,4 @@ interface EditorEvents {
|
|
|
577
612
|
};
|
|
578
613
|
}
|
|
579
614
|
|
|
580
|
-
export { type
|
|
615
|
+
export { type ShapeMaskPresetId as $, type MaskRefinementResult as A, BLEND_GROUPS as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupBlendMode as G, type MockupConfig as H, type ImageAdjustments as I, type MockupDisplacement as J, type MockupDisplacementChannel as K, type LayerData as L, type MaskBrushOptions as M, type MockupOverlay as N, type MockupPrintArea as O, type NormalizedLayerPosition as P, type PatternConfig as Q, type PatternLocks as R, type PatternState as S, type PositioningAdapter as T, type PrintifyPositioning as U, type ProjectPage as V, type ProjectState as W, type ResizeOptions as X, type SemanticExportOptions as Y, type SerializedBackgroundImageOptions as Z, type SerializedLayer as _, BLEND_MODES as a, type ShapePlugin as a0, type SvgExportOptions as a1, type TemplateDefinition as a2, type TemplateParameter as a3, type TextCurveConfig as a4, type TextCurveInput as a5, type TextCurveShape as a6, type TextOverflow as a7, type TextWrapMode as a8, type TextureMaskPresetId as a9, type TileMode as aa, type Unit as ab, blendModeLabel as ac, blendModeOf as ad, blendOperation as ae, type BackgroundImageOptions as b, type BlendMode as c, type DpiIssue as d, type EditorEvents as e, type EditorState as f, type ExportFormat as g, type FontDefinition as h, type ImageAttribution as i, type ImageProvider as j, type ImageProviderResult as k, type ImageSearchOptions as l, type ImageSearchResult as m, type LayerMaskEntry as n, type LayerMaskMode as o, type LayerMeta as p, type LayerShadowConfig as q, type LayerType as r, type LicenseConfig as s, type LicensePayload as t, type LicenseStatus as u, type MaskPoint as v, type MaskPresetId as w, type MaskRefinementPrompt as x, type MaskRefinementProvider as y, type MaskRefinementRequest as z };
|