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