@hy-bricks/canvas 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/index.d.ts CHANGED
@@ -10,8 +10,6 @@ import { Ref } from 'vue';
10
10
  import { ShallowRef } from 'vue';
11
11
  import { VNode } from 'vue';
12
12
 
13
- export declare function __resetRendererDiagnosticsRegistry(): void;
14
-
15
13
  declare const __VLS_component: DefineComponent<__VLS_Props_2, {
16
14
  context: CanvasContext;
17
15
  handle: CanvasHandle & {
@@ -47,6 +45,7 @@ parentLayoutMode: ContainerLayoutConfig["mode"];
47
45
  }>, {
48
46
  mode: CanvasMode;
49
47
  freeSplitEnabled: boolean | (() => boolean);
48
+ cascadeRemove: boolean;
50
49
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
51
50
  stageContainerEl: HTMLDivElement;
52
51
  }, any>;
@@ -98,6 +97,7 @@ declare type __VLS_Props_2 = {
98
97
  adapters?: CanvasAdapters;
99
98
  canvasId?: string;
100
99
  freeSplitEnabled?: boolean | (() => boolean);
100
+ cascadeRemove?: boolean;
101
101
  };
102
102
 
103
103
  declare type __VLS_Props_3 = {
@@ -288,10 +288,6 @@ export declare function applyFreeSplitResizeDrag(startSizes: readonly NodeSize[]
288
288
 
289
289
  export declare function applySplitDividerDrag(startRatios: readonly number[], dividerIndex: number, deltaPx: number, parentAxisPx: number, gap?: number): number[];
290
290
 
291
- export declare function assertNeverBindingSource(s: never): never;
292
-
293
- export declare function assertNeverBindingTarget(t: never): never;
294
-
295
291
  export declare interface AssetRef {
296
292
  id: string;
297
293
  type?: 'image' | 'video' | 'font' | 'json' | 'file';
@@ -547,6 +543,7 @@ export declare interface CanvasContext {
547
543
  registerHooks(hooks: CanvasActionHooks): () => void;
548
544
  readonly isRecordingSuppressed: ComputedRef<boolean>;
549
545
  readonly freeSplitEnabled: ComputedRef<boolean>;
546
+ readonly cascadeRemove: boolean;
550
547
  suppressRecording<T>(fn: () => T): T;
551
548
  readonly effectiveBehavior: ComputedRef<CanvasBehaviorConfig>;
552
549
  readonly interactionOptions: ComputedRef<Readonly<Partial<InteractionOptions>>>;
@@ -581,6 +578,7 @@ export declare interface CanvasContextOptions {
581
578
  hooks?: CanvasActionHooks;
582
579
  getMode?: () => CanvasMode;
583
580
  freeSplitEnabled?: boolean | (() => boolean | undefined);
581
+ cascadeRemove?: boolean;
584
582
  }
585
583
 
586
584
  export declare type CanvasDocumentAction = {
@@ -735,6 +733,7 @@ export declare interface CanvasHandle {
735
733
  endBatch(batchType?: string): void;
736
734
  readonly isBatching: Readonly<Ref<boolean>>;
737
735
  getSnapshot(): PageDocument;
736
+ getRemoveImpact(instanceId: string): RemoveImpact;
738
737
  readonly selectedIds: Readonly<Ref<readonly string[]>>;
739
738
  readonly selectedInstances: ComputedRef<readonly PageInstance[]>;
740
739
  readonly freeSplitSelection: Readonly<Ref<FreeSplitSelection | null>>;
@@ -776,11 +775,11 @@ export declare interface CanvasHandle {
776
775
  readonly cannotReparentEvent: Readonly<Ref<CannotReparentEvent | null>>;
777
776
  readonly cannotDragLayoutManagedChildEvent: Readonly<Ref<CannotDragLayoutManagedChildEvent | null>>;
778
777
  getViewportState(): ViewportState;
779
- getVisibleBounds(): Rect_2;
780
- getCanvasBounds(): Rect_2;
781
- getContentBounds(): Rect_2 | null;
782
- getSelectionBounds(): Rect_2 | null;
783
- getInstanceBounds(instanceId: string): Rect_2 | null;
778
+ getVisibleBounds(): Rect;
779
+ getCanvasBounds(): Rect;
780
+ getContentBounds(): Rect | null;
781
+ getSelectionBounds(): Rect | null;
782
+ getInstanceBounds(instanceId: string): Rect | null;
784
783
  panBy(dx: number, dy: number): void;
785
784
  panTo(panX: number, panY: number): void;
786
785
  zoomTo(scale: number, options?: {
@@ -793,7 +792,7 @@ export declare interface CanvasHandle {
793
792
  resetViewport(): void;
794
793
  fitToContent(options?: FitOptions): void;
795
794
  fitToSelection(options?: FitOptions): void;
796
- scrollToRect(rect: Rect_2, options?: FitOptions): void;
795
+ scrollToRect(rect: Rect, options?: FitOptions): void;
797
796
  readonly toolMode: ComputedRef<CanvasToolMode>;
798
797
  getToolMode(): CanvasToolMode;
799
798
  setToolMode(mode: CanvasToolMode): void;
@@ -1071,11 +1070,11 @@ export declare type ComponentVersionKey = string;
1071
1070
 
1072
1071
  export declare type ComponentVersionStatus = 'ok' | 'unavailable' | 'missing' | 'broken';
1073
1072
 
1074
- export declare function computeContentBounds(instances: readonly PageInstance[]): Rect_2 | null;
1073
+ export declare function computeContentBounds(instances: readonly PageInstance[]): Rect | null;
1075
1074
 
1076
1075
  export declare function computeEffectiveSplitRatios(rawRatios: readonly number[] | undefined, childrenRatios: readonly (number | undefined)[]): number[];
1077
1076
 
1078
- export declare function computeFit(rect: Rect_2, container: {
1077
+ export declare function computeFit(rect: Rect, container: {
1079
1078
  w: number;
1080
1079
  h: number;
1081
1080
  }, options?: FitOptions): FitResult;
@@ -1097,7 +1096,7 @@ export declare function computeNextLayoutBoxAxis(startMode: LayoutBoxAxisMode |
1097
1096
 
1098
1097
  export declare function computeParentLayoutMode(layout: CanvasLayoutConfig | undefined | null, instances: readonly PageInstance[], instanceId: string): ContainerLayoutConfig['mode'] | undefined;
1099
1098
 
1100
- export declare function computeSelectionBounds(instances: readonly PageInstance[], selectedIds: readonly string[]): Rect_2 | null;
1099
+ export declare function computeSelectionBounds(instances: readonly PageInstance[], selectedIds: readonly string[]): Rect | null;
1101
1100
 
1102
1101
  export declare function computeSlotChildCanvasRect(instanceId: string, stageEl: HTMLElement | null, viewport: CanvasContext['viewport']): Rect | null;
1103
1102
 
@@ -1114,7 +1113,7 @@ export declare function computeVisibleBounds(viewport: {
1114
1113
  }, container: {
1115
1114
  w: number;
1116
1115
  h: number;
1117
- }): Rect_2;
1116
+ }): Rect;
1118
1117
 
1119
1118
  export declare type ContainerLayoutConfig = {
1120
1119
  mode: 'none';
@@ -1996,13 +1995,6 @@ export declare interface Rect {
1996
1995
  h: number;
1997
1996
  }
1998
1997
 
1999
- declare interface Rect_2 {
2000
- x: number;
2001
- y: number;
2002
- w: number;
2003
- h: number;
2004
- }
2005
-
2006
1998
  export declare function registerDesignerHandle(canvasId: string, handle: CanvasHandle): void;
2007
1999
 
2008
2000
  export declare function registerRendererDiagnostics(canvasId: string, handle: RendererDiagnosticsHandle): void;
@@ -2011,6 +2003,11 @@ declare type RegistryEvent = 'register' | 'unregister';
2011
2003
 
2012
2004
  declare type RegistryListener = (event: RegistryEvent, canvasId: string) => void;
2013
2005
 
2006
+ export declare interface RemoveImpact {
2007
+ instanceIds: string[];
2008
+ descendantCount: number;
2009
+ }
2010
+
2014
2011
  export declare interface RendererDiagnosticsHandle {
2015
2012
  readonly canvasId: string;
2016
2013
  getSchedulerStats(): {
@@ -2269,7 +2266,7 @@ export declare interface TreeMoveTarget {
2269
2266
  index?: number;
2270
2267
  }
2271
2268
 
2272
- export declare function unionRects(rects: readonly Rect_2[]): Rect_2 | null;
2269
+ export declare function unionRects(rects: readonly Rect[]): Rect | null;
2273
2270
 
2274
2271
  export declare function unregisterDesignerHandle(canvasId: string): void;
2275
2272