@overtone-art/canvas-editor-core 0.6.0 → 0.6.2

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 CHANGED
@@ -63,6 +63,14 @@ declare class LayerManager {
63
63
  * group's matrix must NOT be re-applied on top of it.
64
64
  */
65
65
  private dissolve;
66
+ /**
67
+ * Move existing layer records under a group, and announce the new tree.
68
+ * Assigning `group.children` directly emits nothing, and the reorder that
69
+ * follows a grouping is a no-op whenever the group already sits where it
70
+ * belongs — leaving `layers:changed` describing a childless group, so a panel
71
+ * built on it renders the group with nothing inside.
72
+ */
73
+ adoptChildren(group: Layer, children: Layer[]): void;
66
74
  /**
67
75
  * Re-attach child records to an enlivened group. `data[i]` describes
68
76
  * `group._objects[i]` — the order fabric serializes and restores them in. A
@@ -505,7 +513,18 @@ declare class TextCurveManager {
505
513
  private layers;
506
514
  private history;
507
515
  private events;
516
+ /**
517
+ * Typing on the canvas changes the run the paths were built for. Fabric drops
518
+ * a glyph whose centre falls past the end of the path, so without rebuilding
519
+ * here a longer replacement simply vanishes — select-all-and-retype rendered
520
+ * an empty box — and a shorter one piles up on a path built for the old text.
521
+ *
522
+ * No history entry: fabric records the edit when editing exits, and one save
523
+ * per keystroke would bury every earlier step under the typing.
524
+ */
525
+ private readonly onTextChanged;
508
526
  constructor(canvas: Canvas, layers: LayerManager, history: HistoryManager, events: EventEmitter<EditorEvents>);
527
+ dispose(): void;
509
528
  /** Curve parameters for a layer, or null when it is not curved text. */
510
529
  get(layerId: string): TextCurveConfig | null;
511
530
  isCurved(layerId: string): boolean;
@@ -519,7 +538,13 @@ declare class TextCurveManager {
519
538
  * without this the curve keeps that of the text it was created from.
520
539
  */
521
540
  refresh(layerId: string, save?: boolean): boolean;
522
- /** Rebuild every curved layer — used after a state restore. */
541
+ /**
542
+ * Rebuild every curved layer — used after a state restore.
543
+ *
544
+ * `getAll` is the canvas stack, so this walks each group's children too:
545
+ * curved text inside a group would otherwise keep the path geometry it was
546
+ * restored with, and stop tracking its own text, font and size.
547
+ */
523
548
  refreshAll(): void;
524
549
  /**
525
550
  * Puts every line's path on the object as one shape, and hooks per-line
package/dist/index.d.ts CHANGED
@@ -63,6 +63,14 @@ declare class LayerManager {
63
63
  * group's matrix must NOT be re-applied on top of it.
64
64
  */
65
65
  private dissolve;
66
+ /**
67
+ * Move existing layer records under a group, and announce the new tree.
68
+ * Assigning `group.children` directly emits nothing, and the reorder that
69
+ * follows a grouping is a no-op whenever the group already sits where it
70
+ * belongs — leaving `layers:changed` describing a childless group, so a panel
71
+ * built on it renders the group with nothing inside.
72
+ */
73
+ adoptChildren(group: Layer, children: Layer[]): void;
66
74
  /**
67
75
  * Re-attach child records to an enlivened group. `data[i]` describes
68
76
  * `group._objects[i]` — the order fabric serializes and restores them in. A
@@ -505,7 +513,18 @@ declare class TextCurveManager {
505
513
  private layers;
506
514
  private history;
507
515
  private events;
516
+ /**
517
+ * Typing on the canvas changes the run the paths were built for. Fabric drops
518
+ * a glyph whose centre falls past the end of the path, so without rebuilding
519
+ * here a longer replacement simply vanishes — select-all-and-retype rendered
520
+ * an empty box — and a shorter one piles up on a path built for the old text.
521
+ *
522
+ * No history entry: fabric records the edit when editing exits, and one save
523
+ * per keystroke would bury every earlier step under the typing.
524
+ */
525
+ private readonly onTextChanged;
508
526
  constructor(canvas: Canvas, layers: LayerManager, history: HistoryManager, events: EventEmitter<EditorEvents>);
527
+ dispose(): void;
509
528
  /** Curve parameters for a layer, or null when it is not curved text. */
510
529
  get(layerId: string): TextCurveConfig | null;
511
530
  isCurved(layerId: string): boolean;
@@ -519,7 +538,13 @@ declare class TextCurveManager {
519
538
  * without this the curve keeps that of the text it was created from.
520
539
  */
521
540
  refresh(layerId: string, save?: boolean): boolean;
522
- /** Rebuild every curved layer — used after a state restore. */
541
+ /**
542
+ * Rebuild every curved layer — used after a state restore.
543
+ *
544
+ * `getAll` is the canvas stack, so this walks each group's children too:
545
+ * curved text inside a group would otherwise keep the path geometry it was
546
+ * restored with, and stop tracking its own text, font and size.
547
+ */
523
548
  refreshAll(): void;
524
549
  /**
525
550
  * Puts every line's path on the object as one shape, and hooks per-line