@overtone-art/canvas-editor-core 0.3.2 → 0.4.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-Dh1unrzT.mjs';
1
+ import { c as EditorState } from './types-BNzE_X5M.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-Dh1unrzT.js';
1
+ import { c as EditorState } from './types-BNzE_X5M.js';
2
2
  import 'fabric';
3
3
 
4
4
  interface PrintPdfOptions {
@@ -74,8 +74,6 @@ interface EditorConfig {
74
74
  preserveObjectStacking?: boolean;
75
75
  unit?: Unit;
76
76
  dpi?: number;
77
- /** Resolve a non-CORS image through a trusted proxy or same-origin store for pattern rendering. */
78
- patternSourceResolver?: PatternSourceResolver;
79
77
  fonts?: FontDefinition[];
80
78
  license?: LicenseConfig;
81
79
  }
@@ -161,7 +159,6 @@ interface ImageAdjustments {
161
159
  /** Range 0 to 1. */
162
160
  blur?: number;
163
161
  }
164
- type PatternSourceResolver = (source: string) => Promise<string>;
165
162
  interface FontDefinition {
166
163
  family: string;
167
164
  /** URL, data URL, or a complete CSS FontFace source such as `local(...)`. */
@@ -346,28 +343,25 @@ interface PatternLocks {
346
343
  lockRotation: boolean;
347
344
  hasControls: boolean;
348
345
  }
349
- /** Persisted on a layer's meta while it is rendered as a repeating pattern. */
346
+ /**
347
+ * Persisted on a layer's meta while it is tiled across the print area.
348
+ *
349
+ * Current states carry `config` and nothing else: the layer keeps its real
350
+ * object and the tiling is drawn by a render proxy, so there is no "original"
351
+ * to remember. The `original*` fields belong to states written by the engine
352
+ * that baked the tiled bitmap into the layer; they are read once, on restore,
353
+ * to put the artwork back (see `PatternManager.rehydrateAll`).
354
+ */
350
355
  interface PatternState {
351
356
  config: PatternConfig;
352
- /** Original (pre-pattern) image source, as a durable data URL when possible. */
353
- originalSrc: string;
354
- /**
355
- * Serialized `clipPath` the image carried before it became a pattern, or null
356
- * if it had none. A pattern must fill the whole print area, so any pre-pattern
357
- * clip (e.g. a template crop sized to the original box) is stripped while the
358
- * pattern is on and re-applied when it is turned off. Persisted so it survives
359
- * serialization / reload / undo.
360
- */
357
+ /** Legacy: pre-bake image source, as a durable data URL when possible. */
358
+ originalSrc?: string;
359
+ /** Legacy: serialized `clipPath` the image carried before it was baked. */
361
360
  originalClip?: Record<string, unknown> | null;
362
- /**
363
- * Interaction flags the object carried before it became a pattern. A pattern
364
- * fills the whole print area, so while it is on the object is locked in place
365
- * (a drag/resize would slide the tiled bitmap off the area and leave a bare
366
- * band); the captured flags are restored when the pattern is turned off.
367
- */
361
+ /** Legacy: interaction flags frozen while the baked bitmap was in place. */
368
362
  originalLocks?: PatternLocks;
369
- /** Original fabric transform, restored when the pattern is turned off. */
370
- original: {
363
+ /** Legacy: fabric transform to restore when un-baking. */
364
+ original?: {
371
365
  left: number;
372
366
  top: number;
373
367
  scaleX: number;
@@ -485,4 +479,4 @@ interface EditorEvents {
485
479
  };
486
480
  }
487
481
 
488
- export { type TemplateParameter as $, type MockupOverlay as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupPrintArea as G, type PatternLocks as H, type ImageAdjustments as I, type PatternSourceResolver as J, type PatternState as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PositioningAdapter as O, type PatternConfig as P, type PrintifyPositioning as Q, type ProjectPage as R, type ProjectState as S, type ResizeOptions as T, type SemanticExportOptions as U, type SerializedBackgroundImageOptions as V, type SerializedLayer as W, type ShapeMaskPresetId as X, type ShapePlugin as Y, type SvgExportOptions as Z, type TemplateDefinition as _, type DpiIssue as a, type TextCurveConfig as a0, type TextureMaskPresetId as a1, type TileMode as a2, type Unit as a3, 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 LayerMeta as k, type LayerShadowConfig as l, type LayerType as m, type LicenseConfig as n, type LicensePayload as o, type LicenseStatus as p, type MaskPoint as q, type MaskPresetId as r, type MaskRefinementPrompt as s, type MaskRefinementProvider as t, type MaskRefinementRequest as u, type MaskRefinementResult as v, type MockupBlendMode as w, type MockupConfig as x, type MockupDisplacement as y, type MockupDisplacementChannel as z };
482
+ export { type TextCurveConfig as $, type MockupOverlay as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupPrintArea as G, type PatternLocks as H, type ImageAdjustments as I, type PatternState as J, type PositioningAdapter as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PrintifyPositioning as O, type PatternConfig as P, type ProjectPage as Q, type ProjectState as R, type ResizeOptions as S, type SemanticExportOptions as T, type SerializedBackgroundImageOptions as U, type SerializedLayer as V, type ShapeMaskPresetId as W, type ShapePlugin as X, type SvgExportOptions as Y, type TemplateDefinition as Z, type TemplateParameter as _, type DpiIssue as a, type TextureMaskPresetId as a0, type TileMode as a1, type Unit as a2, 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 LayerMeta as k, type LayerShadowConfig as l, type LayerType as m, type LicenseConfig as n, type LicensePayload as o, type LicenseStatus as p, type MaskPoint as q, type MaskPresetId as r, type MaskRefinementPrompt as s, type MaskRefinementProvider as t, type MaskRefinementRequest as u, type MaskRefinementResult as v, type MockupBlendMode as w, type MockupConfig as x, type MockupDisplacement as y, type MockupDisplacementChannel as z };
@@ -74,8 +74,6 @@ interface EditorConfig {
74
74
  preserveObjectStacking?: boolean;
75
75
  unit?: Unit;
76
76
  dpi?: number;
77
- /** Resolve a non-CORS image through a trusted proxy or same-origin store for pattern rendering. */
78
- patternSourceResolver?: PatternSourceResolver;
79
77
  fonts?: FontDefinition[];
80
78
  license?: LicenseConfig;
81
79
  }
@@ -161,7 +159,6 @@ interface ImageAdjustments {
161
159
  /** Range 0 to 1. */
162
160
  blur?: number;
163
161
  }
164
- type PatternSourceResolver = (source: string) => Promise<string>;
165
162
  interface FontDefinition {
166
163
  family: string;
167
164
  /** URL, data URL, or a complete CSS FontFace source such as `local(...)`. */
@@ -346,28 +343,25 @@ interface PatternLocks {
346
343
  lockRotation: boolean;
347
344
  hasControls: boolean;
348
345
  }
349
- /** Persisted on a layer's meta while it is rendered as a repeating pattern. */
346
+ /**
347
+ * Persisted on a layer's meta while it is tiled across the print area.
348
+ *
349
+ * Current states carry `config` and nothing else: the layer keeps its real
350
+ * object and the tiling is drawn by a render proxy, so there is no "original"
351
+ * to remember. The `original*` fields belong to states written by the engine
352
+ * that baked the tiled bitmap into the layer; they are read once, on restore,
353
+ * to put the artwork back (see `PatternManager.rehydrateAll`).
354
+ */
350
355
  interface PatternState {
351
356
  config: PatternConfig;
352
- /** Original (pre-pattern) image source, as a durable data URL when possible. */
353
- originalSrc: string;
354
- /**
355
- * Serialized `clipPath` the image carried before it became a pattern, or null
356
- * if it had none. A pattern must fill the whole print area, so any pre-pattern
357
- * clip (e.g. a template crop sized to the original box) is stripped while the
358
- * pattern is on and re-applied when it is turned off. Persisted so it survives
359
- * serialization / reload / undo.
360
- */
357
+ /** Legacy: pre-bake image source, as a durable data URL when possible. */
358
+ originalSrc?: string;
359
+ /** Legacy: serialized `clipPath` the image carried before it was baked. */
361
360
  originalClip?: Record<string, unknown> | null;
362
- /**
363
- * Interaction flags the object carried before it became a pattern. A pattern
364
- * fills the whole print area, so while it is on the object is locked in place
365
- * (a drag/resize would slide the tiled bitmap off the area and leave a bare
366
- * band); the captured flags are restored when the pattern is turned off.
367
- */
361
+ /** Legacy: interaction flags frozen while the baked bitmap was in place. */
368
362
  originalLocks?: PatternLocks;
369
- /** Original fabric transform, restored when the pattern is turned off. */
370
- original: {
363
+ /** Legacy: fabric transform to restore when un-baking. */
364
+ original?: {
371
365
  left: number;
372
366
  top: number;
373
367
  scaleX: number;
@@ -485,4 +479,4 @@ interface EditorEvents {
485
479
  };
486
480
  }
487
481
 
488
- export { type TemplateParameter as $, type MockupOverlay as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupPrintArea as G, type PatternLocks as H, type ImageAdjustments as I, type PatternSourceResolver as J, type PatternState as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PositioningAdapter as O, type PatternConfig as P, type PrintifyPositioning as Q, type ProjectPage as R, type ProjectState as S, type ResizeOptions as T, type SemanticExportOptions as U, type SerializedBackgroundImageOptions as V, type SerializedLayer as W, type ShapeMaskPresetId as X, type ShapePlugin as Y, type SvgExportOptions as Z, type TemplateDefinition as _, type DpiIssue as a, type TextCurveConfig as a0, type TextureMaskPresetId as a1, type TileMode as a2, type Unit as a3, 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 LayerMeta as k, type LayerShadowConfig as l, type LayerType as m, type LicenseConfig as n, type LicensePayload as o, type LicenseStatus as p, type MaskPoint as q, type MaskPresetId as r, type MaskRefinementPrompt as s, type MaskRefinementProvider as t, type MaskRefinementRequest as u, type MaskRefinementResult as v, type MockupBlendMode as w, type MockupConfig as x, type MockupDisplacement as y, type MockupDisplacementChannel as z };
482
+ export { type TextCurveConfig as $, type MockupOverlay as A, type BackgroundImageOptions as B, type CanvasSizePreset as C, DEFAULT_PATTERN_CONFIG as D, type EditorConfig as E, type FileAdapter as F, type MockupPrintArea as G, type PatternLocks as H, type ImageAdjustments as I, type PatternState as J, type PositioningAdapter as K, type LayerData as L, type MaskBrushOptions as M, type NormalizedLayerPosition as N, type PrintifyPositioning as O, type PatternConfig as P, type ProjectPage as Q, type ProjectState as R, type ResizeOptions as S, type SemanticExportOptions as T, type SerializedBackgroundImageOptions as U, type SerializedLayer as V, type ShapeMaskPresetId as W, type ShapePlugin as X, type SvgExportOptions as Y, type TemplateDefinition as Z, type TemplateParameter as _, type DpiIssue as a, type TextureMaskPresetId as a0, type TileMode as a1, type Unit as a2, 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 LayerMeta as k, type LayerShadowConfig as l, type LayerType as m, type LicenseConfig as n, type LicensePayload as o, type LicenseStatus as p, type MaskPoint as q, type MaskPresetId as r, type MaskRefinementPrompt as s, type MaskRefinementProvider as t, type MaskRefinementRequest as u, type MaskRefinementResult as v, type MockupBlendMode as w, type MockupConfig as x, type MockupDisplacement as y, type MockupDisplacementChannel as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overtone-art/canvas-editor-core",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Abstract pluggable canvas editor built on Fabric.js",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",