@overtone-art/canvas-editor-core 0.5.0 → 0.6.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/node.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as EditorState } from './types-JP8MZsIs.mjs';
1
+ import { c as EditorState } from './types-LM7pOkkj.mjs';
2
2
  import 'fabric';
3
3
 
4
4
  interface PrintPdfOptions {
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as EditorState } from './types-JP8MZsIs.js';
1
+ import { c as EditorState } from './types-LM7pOkkj.js';
2
2
  import 'fabric';
3
3
 
4
4
  interface PrintPdfOptions {
@@ -11,6 +11,8 @@ interface LayerData {
11
11
  opacity: number;
12
12
  /** Non-fabric metadata persisted with the layer (pattern config, etc). */
13
13
  meta?: LayerMeta;
14
+ /** Layers nested inside this one. Only a `group` layer has any. */
15
+ children?: LayerData[];
14
16
  }
15
17
  interface LayerMeta {
16
18
  pattern?: PatternState;
@@ -25,23 +27,51 @@ interface LayerMeta {
25
27
  maskStack?: LayerMaskEntry[];
26
28
  /** Marks the overlay layer that carries the whole-design mask stack. */
27
29
  canvasMask?: boolean;
28
- /** Baseline curve applied to a text layer. */
29
- curve?: TextCurveConfig;
30
+ /** Baseline curve applied to a text layer. States saved before the shape
31
+ * switch existed carry only `arc`/`wave`; reads normalize them. */
32
+ curve?: TextCurveInput;
30
33
  /** Text box width authored before a curve widened it, in px. */
31
34
  curveWidth?: number;
32
35
  /** Layer resizes uniformly: single-axis handles are hidden. */
33
36
  lockAspect?: boolean;
34
37
  [key: string]: unknown;
35
38
  }
39
+ /** Shape the baseline follows. The two are alternatives, never combined. */
40
+ type TextCurveShape = 'arc' | 'wave';
36
41
  interface TextCurveConfig {
42
+ /**
43
+ * Which of the two shapes is live. The parameters of the other one are kept
44
+ * so switching back and forth does not lose them.
45
+ */
46
+ shape: TextCurveShape;
37
47
  /**
38
48
  * Baseline bend, −100…100. Positive arcs the run upward (a rainbow),
39
49
  * negative into a valley; ±100 closes it into a full ring. 0 is straight.
40
50
  */
41
51
  arc: number;
42
- /** Sine-wave amplitude, 0…100, as a share of the font size. Ignored when arced. */
52
+ /** Sine-wave amplitude, 0…100, as a share of the font size. */
43
53
  wave: number;
54
+ /** Sine-wave period, in font sizes. Lower is a tighter ripple. */
55
+ waveLength: number;
56
+ /**
57
+ * Shift of the run along its baseline, −100…100. On an arc that is a share
58
+ * of the sweep (±100 walks a closed ring right round); on a wave it is a
59
+ * share of one wavelength.
60
+ */
61
+ offset: number;
62
+ /**
63
+ * Pushes the run off the ring it is bent around, −100…100 (±100 halves or
64
+ * doubles the radius). Arc only: outward flattens the letters, inward curls
65
+ * them tighter round a smaller circle.
66
+ */
67
+ centerOffset: number;
44
68
  }
69
+ /**
70
+ * A curve as authored: every field optional, missing ones fall back to the
71
+ * defaults. Also the shape older saved states are in — they predate `shape`,
72
+ * `waveLength` and `offset`.
73
+ */
74
+ type TextCurveInput = Partial<TextCurveConfig>;
45
75
  type ShapeMaskPresetId = 'circle' | 'square' | 'triangle' | 'star' | 'heart' | 'octagram' | 'arch' | 'zigzag';
46
76
  type TextureMaskPresetId = 'vignette' | 'halftone' | 'spray' | 'grunge' | 'torn' | 'band';
47
77
  type MaskPresetId = ShapeMaskPresetId | TextureMaskPresetId;
@@ -520,4 +550,4 @@ interface EditorEvents {
520
550
  };
521
551
  }
522
552
 
523
- export { type TemplateDefinition as $, type MockupDisplacement as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupDisplacementChannel as G, type MockupOverlay as H, type ImageAdjustments as I, type MockupPrintArea as J, type PatternLocks as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PatternState as O, type PatternConfig as P, type PositioningAdapter as Q, type PrintifyPositioning as R, type ProjectPage as S, type ProjectState as T, type ResizeOptions as U, type SemanticExportOptions as V, type SerializedBackgroundImageOptions as W, type SerializedLayer as X, type ShapeMaskPresetId as Y, type ShapePlugin as Z, type SvgExportOptions as _, type DpiIssue as a, type TemplateParameter as a0, type TextCurveConfig as a1, type TextureMaskPresetId as a2, type TileMode as a3, type Unit as a4, type EditorEvents as b, type EditorState as c, type ExportFormat as d, type FontDefinition as e, type ImageAttribution as f, type ImageProvider as g, type ImageProviderResult as h, type ImageSearchOptions as i, type ImageSearchResult as j, type LayerMaskEntry as k, type LayerMaskMode as l, type LayerMeta as m, type LayerShadowConfig as n, type LayerType as o, type LicenseConfig as p, type LicensePayload as q, type LicenseStatus as r, type MaskPoint as s, type MaskPresetId as t, type MaskRefinementPrompt as u, type MaskRefinementProvider as v, type MaskRefinementRequest as w, type MaskRefinementResult as x, type MockupBlendMode as y, type MockupConfig as z };
553
+ export { type TemplateDefinition as $, type MockupDisplacement as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupDisplacementChannel as G, type MockupOverlay as H, type ImageAdjustments as I, type MockupPrintArea as J, type PatternLocks as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PatternState as O, type PatternConfig as P, type PositioningAdapter as Q, type PrintifyPositioning as R, type ProjectPage as S, type ProjectState as T, type ResizeOptions as U, type SemanticExportOptions as V, type SerializedBackgroundImageOptions as W, type SerializedLayer as X, type ShapeMaskPresetId as Y, type ShapePlugin as Z, type SvgExportOptions as _, type DpiIssue as a, type TemplateParameter as a0, type TextCurveConfig as a1, type TextCurveInput as a2, type TextCurveShape as a3, type TextureMaskPresetId as a4, type TileMode as a5, type Unit as a6, type EditorEvents as b, type EditorState as c, type ExportFormat as d, type FontDefinition as e, type ImageAttribution as f, type ImageProvider as g, type ImageProviderResult as h, type ImageSearchOptions as i, type ImageSearchResult as j, type LayerMaskEntry as k, type LayerMaskMode as l, type LayerMeta as m, type LayerShadowConfig as n, type LayerType as o, type LicenseConfig as p, type LicensePayload as q, type LicenseStatus as r, type MaskPoint as s, type MaskPresetId as t, type MaskRefinementPrompt as u, type MaskRefinementProvider as v, type MaskRefinementRequest as w, type MaskRefinementResult as x, type MockupBlendMode as y, type MockupConfig as z };
@@ -11,6 +11,8 @@ interface LayerData {
11
11
  opacity: number;
12
12
  /** Non-fabric metadata persisted with the layer (pattern config, etc). */
13
13
  meta?: LayerMeta;
14
+ /** Layers nested inside this one. Only a `group` layer has any. */
15
+ children?: LayerData[];
14
16
  }
15
17
  interface LayerMeta {
16
18
  pattern?: PatternState;
@@ -25,23 +27,51 @@ interface LayerMeta {
25
27
  maskStack?: LayerMaskEntry[];
26
28
  /** Marks the overlay layer that carries the whole-design mask stack. */
27
29
  canvasMask?: boolean;
28
- /** Baseline curve applied to a text layer. */
29
- curve?: TextCurveConfig;
30
+ /** Baseline curve applied to a text layer. States saved before the shape
31
+ * switch existed carry only `arc`/`wave`; reads normalize them. */
32
+ curve?: TextCurveInput;
30
33
  /** Text box width authored before a curve widened it, in px. */
31
34
  curveWidth?: number;
32
35
  /** Layer resizes uniformly: single-axis handles are hidden. */
33
36
  lockAspect?: boolean;
34
37
  [key: string]: unknown;
35
38
  }
39
+ /** Shape the baseline follows. The two are alternatives, never combined. */
40
+ type TextCurveShape = 'arc' | 'wave';
36
41
  interface TextCurveConfig {
42
+ /**
43
+ * Which of the two shapes is live. The parameters of the other one are kept
44
+ * so switching back and forth does not lose them.
45
+ */
46
+ shape: TextCurveShape;
37
47
  /**
38
48
  * Baseline bend, −100…100. Positive arcs the run upward (a rainbow),
39
49
  * negative into a valley; ±100 closes it into a full ring. 0 is straight.
40
50
  */
41
51
  arc: number;
42
- /** Sine-wave amplitude, 0…100, as a share of the font size. Ignored when arced. */
52
+ /** Sine-wave amplitude, 0…100, as a share of the font size. */
43
53
  wave: number;
54
+ /** Sine-wave period, in font sizes. Lower is a tighter ripple. */
55
+ waveLength: number;
56
+ /**
57
+ * Shift of the run along its baseline, −100…100. On an arc that is a share
58
+ * of the sweep (±100 walks a closed ring right round); on a wave it is a
59
+ * share of one wavelength.
60
+ */
61
+ offset: number;
62
+ /**
63
+ * Pushes the run off the ring it is bent around, −100…100 (±100 halves or
64
+ * doubles the radius). Arc only: outward flattens the letters, inward curls
65
+ * them tighter round a smaller circle.
66
+ */
67
+ centerOffset: number;
44
68
  }
69
+ /**
70
+ * A curve as authored: every field optional, missing ones fall back to the
71
+ * defaults. Also the shape older saved states are in — they predate `shape`,
72
+ * `waveLength` and `offset`.
73
+ */
74
+ type TextCurveInput = Partial<TextCurveConfig>;
45
75
  type ShapeMaskPresetId = 'circle' | 'square' | 'triangle' | 'star' | 'heart' | 'octagram' | 'arch' | 'zigzag';
46
76
  type TextureMaskPresetId = 'vignette' | 'halftone' | 'spray' | 'grunge' | 'torn' | 'band';
47
77
  type MaskPresetId = ShapeMaskPresetId | TextureMaskPresetId;
@@ -520,4 +550,4 @@ interface EditorEvents {
520
550
  };
521
551
  }
522
552
 
523
- export { type TemplateDefinition as $, type MockupDisplacement as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupDisplacementChannel as G, type MockupOverlay as H, type ImageAdjustments as I, type MockupPrintArea as J, type PatternLocks as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PatternState as O, type PatternConfig as P, type PositioningAdapter as Q, type PrintifyPositioning as R, type ProjectPage as S, type ProjectState as T, type ResizeOptions as U, type SemanticExportOptions as V, type SerializedBackgroundImageOptions as W, type SerializedLayer as X, type ShapeMaskPresetId as Y, type ShapePlugin as Z, type SvgExportOptions as _, type DpiIssue as a, type TemplateParameter as a0, type TextCurveConfig as a1, type TextureMaskPresetId as a2, type TileMode as a3, type Unit as a4, type EditorEvents as b, type EditorState as c, type ExportFormat as d, type FontDefinition as e, type ImageAttribution as f, type ImageProvider as g, type ImageProviderResult as h, type ImageSearchOptions as i, type ImageSearchResult as j, type LayerMaskEntry as k, type LayerMaskMode as l, type LayerMeta as m, type LayerShadowConfig as n, type LayerType as o, type LicenseConfig as p, type LicensePayload as q, type LicenseStatus as r, type MaskPoint as s, type MaskPresetId as t, type MaskRefinementPrompt as u, type MaskRefinementProvider as v, type MaskRefinementRequest as w, type MaskRefinementResult as x, type MockupBlendMode as y, type MockupConfig as z };
553
+ export { type TemplateDefinition as $, type MockupDisplacement as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupDisplacementChannel as G, type MockupOverlay as H, type ImageAdjustments as I, type MockupPrintArea as J, type PatternLocks as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PatternState as O, type PatternConfig as P, type PositioningAdapter as Q, type PrintifyPositioning as R, type ProjectPage as S, type ProjectState as T, type ResizeOptions as U, type SemanticExportOptions as V, type SerializedBackgroundImageOptions as W, type SerializedLayer as X, type ShapeMaskPresetId as Y, type ShapePlugin as Z, type SvgExportOptions as _, type DpiIssue as a, type TemplateParameter as a0, type TextCurveConfig as a1, type TextCurveInput as a2, type TextCurveShape as a3, type TextureMaskPresetId as a4, type TileMode as a5, type Unit as a6, type EditorEvents as b, type EditorState as c, type ExportFormat as d, type FontDefinition as e, type ImageAttribution as f, type ImageProvider as g, type ImageProviderResult as h, type ImageSearchOptions as i, type ImageSearchResult as j, type LayerMaskEntry as k, type LayerMaskMode as l, type LayerMeta as m, type LayerShadowConfig as n, type LayerType as o, type LicenseConfig as p, type LicensePayload as q, type LicenseStatus as r, type MaskPoint as s, type MaskPresetId as t, type MaskRefinementPrompt as u, type MaskRefinementProvider as v, type MaskRefinementRequest as w, type MaskRefinementResult as x, type MockupBlendMode as y, type MockupConfig as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overtone-art/canvas-editor-core",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Abstract pluggable canvas editor built on Fabric.js",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",