@hy-bricks/canvas 0.4.3 → 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/CHANGELOG.md +61 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +287 -32
- 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 & {
|
|
@@ -46,6 +44,8 @@ parentLayoutMode: ContainerLayoutConfig["mode"];
|
|
|
46
44
|
"onHandle-ready"?: ((handle: CanvasHandle) => any) | undefined;
|
|
47
45
|
}>, {
|
|
48
46
|
mode: CanvasMode;
|
|
47
|
+
freeSplitEnabled: boolean | (() => boolean);
|
|
48
|
+
cascadeRemove: boolean;
|
|
49
49
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
50
50
|
stageContainerEl: HTMLDivElement;
|
|
51
51
|
}, any>;
|
|
@@ -96,6 +96,8 @@ declare type __VLS_Props_2 = {
|
|
|
96
96
|
schedulerOptions?: RenderSchedulerOptions;
|
|
97
97
|
adapters?: CanvasAdapters;
|
|
98
98
|
canvasId?: string;
|
|
99
|
+
freeSplitEnabled?: boolean | (() => boolean);
|
|
100
|
+
cascadeRemove?: boolean;
|
|
99
101
|
};
|
|
100
102
|
|
|
101
103
|
declare type __VLS_Props_3 = {
|
|
@@ -133,6 +135,16 @@ declare function __VLS_template(): {
|
|
|
133
135
|
isDragging: boolean;
|
|
134
136
|
};
|
|
135
137
|
}) => VNode[];
|
|
138
|
+
'free-split-divider'?: (props: {
|
|
139
|
+
state: {
|
|
140
|
+
containerId: string;
|
|
141
|
+
nodeId: string;
|
|
142
|
+
dividerIndex: number;
|
|
143
|
+
direction: "horizontal" | "vertical";
|
|
144
|
+
rect: Rect;
|
|
145
|
+
isDragging: boolean;
|
|
146
|
+
};
|
|
147
|
+
}) => VNode[];
|
|
136
148
|
}> & {
|
|
137
149
|
default?: () => VNode[];
|
|
138
150
|
'canvas-overlay'?: (props: {
|
|
@@ -155,6 +167,16 @@ declare function __VLS_template(): {
|
|
|
155
167
|
isDragging: boolean;
|
|
156
168
|
};
|
|
157
169
|
}) => VNode[];
|
|
170
|
+
'free-split-divider'?: (props: {
|
|
171
|
+
state: {
|
|
172
|
+
containerId: string;
|
|
173
|
+
nodeId: string;
|
|
174
|
+
dividerIndex: number;
|
|
175
|
+
direction: "horizontal" | "vertical";
|
|
176
|
+
rect: Rect;
|
|
177
|
+
isDragging: boolean;
|
|
178
|
+
};
|
|
179
|
+
}) => VNode[];
|
|
158
180
|
};
|
|
159
181
|
refs: {
|
|
160
182
|
stageContainerEl: HTMLDivElement;
|
|
@@ -192,6 +214,16 @@ declare function __VLS_template_3(): {
|
|
|
192
214
|
isDragging: boolean;
|
|
193
215
|
};
|
|
194
216
|
}) => unknown;
|
|
217
|
+
'free-split-divider'?: (props: {
|
|
218
|
+
state: {
|
|
219
|
+
containerId: string;
|
|
220
|
+
nodeId: string;
|
|
221
|
+
dividerIndex: number;
|
|
222
|
+
direction: "horizontal" | "vertical";
|
|
223
|
+
rect: Rect;
|
|
224
|
+
isDragging: boolean;
|
|
225
|
+
};
|
|
226
|
+
}) => unknown;
|
|
195
227
|
}> & {
|
|
196
228
|
'reparent-ghost'?: (props: {
|
|
197
229
|
state: {
|
|
@@ -209,6 +241,16 @@ declare function __VLS_template_3(): {
|
|
|
209
241
|
isDragging: boolean;
|
|
210
242
|
};
|
|
211
243
|
}) => unknown;
|
|
244
|
+
'free-split-divider'?: (props: {
|
|
245
|
+
state: {
|
|
246
|
+
containerId: string;
|
|
247
|
+
nodeId: string;
|
|
248
|
+
dividerIndex: number;
|
|
249
|
+
direction: "horizontal" | "vertical";
|
|
250
|
+
rect: Rect;
|
|
251
|
+
isDragging: boolean;
|
|
252
|
+
};
|
|
253
|
+
}) => unknown;
|
|
212
254
|
};
|
|
213
255
|
refs: {
|
|
214
256
|
layerEl: HTMLDivElement;
|
|
@@ -242,11 +284,9 @@ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
|
242
284
|
|
|
243
285
|
export declare function applyEffectiveSplitRatiosToDocument(doc: PageDocument): PageDocument;
|
|
244
286
|
|
|
245
|
-
export declare function
|
|
246
|
-
|
|
247
|
-
export declare function assertNeverBindingSource(s: never): never;
|
|
287
|
+
export declare function applyFreeSplitResizeDrag(startSizes: readonly NodeSize[], dividerIndex: number, deltaPx: number, branchAxisPx: number, opts?: FreeSplitResizeOpts): NodeSize[];
|
|
248
288
|
|
|
249
|
-
export declare function
|
|
289
|
+
export declare function applySplitDividerDrag(startRatios: readonly number[], dividerIndex: number, deltaPx: number, parentAxisPx: number, gap?: number): number[];
|
|
250
290
|
|
|
251
291
|
export declare interface AssetRef {
|
|
252
292
|
id: string;
|
|
@@ -451,7 +491,7 @@ export declare const CANVAS_CONTEXT_KEY: InjectionKey<CanvasContext>;
|
|
|
451
491
|
|
|
452
492
|
export declare const CANVAS_REPARENT_BRIDGE_KEY: InjectionKey<ReparentBridge>;
|
|
453
493
|
|
|
454
|
-
export declare type CanvasAction = CanvasDocumentAction | CanvasSelectionAction;
|
|
494
|
+
export declare type CanvasAction = CanvasDocumentAction | CanvasSelectionAction | CanvasFreeSplitAction;
|
|
455
495
|
|
|
456
496
|
export declare interface CanvasActionHooks {
|
|
457
497
|
onBeforeAction?: (action: CanvasAction) => boolean | void;
|
|
@@ -502,6 +542,8 @@ export declare interface CanvasContext {
|
|
|
502
542
|
endBatch(batchType?: string): void;
|
|
503
543
|
registerHooks(hooks: CanvasActionHooks): () => void;
|
|
504
544
|
readonly isRecordingSuppressed: ComputedRef<boolean>;
|
|
545
|
+
readonly freeSplitEnabled: ComputedRef<boolean>;
|
|
546
|
+
readonly cascadeRemove: boolean;
|
|
505
547
|
suppressRecording<T>(fn: () => T): T;
|
|
506
548
|
readonly effectiveBehavior: ComputedRef<CanvasBehaviorConfig>;
|
|
507
549
|
readonly interactionOptions: ComputedRef<Readonly<Partial<InteractionOptions>>>;
|
|
@@ -535,6 +577,8 @@ export declare interface CanvasContextOptions {
|
|
|
535
577
|
adapters?: CanvasAdapters;
|
|
536
578
|
hooks?: CanvasActionHooks;
|
|
537
579
|
getMode?: () => CanvasMode;
|
|
580
|
+
freeSplitEnabled?: boolean | (() => boolean | undefined);
|
|
581
|
+
cascadeRemove?: boolean;
|
|
538
582
|
}
|
|
539
583
|
|
|
540
584
|
export declare type CanvasDocumentAction = {
|
|
@@ -598,7 +642,7 @@ export declare type CanvasDocumentAction = {
|
|
|
598
642
|
} | {
|
|
599
643
|
type: 'setRootLayout';
|
|
600
644
|
payload: {
|
|
601
|
-
rootLayout:
|
|
645
|
+
rootLayout: RootContainerLayoutConfig | null;
|
|
602
646
|
};
|
|
603
647
|
} | {
|
|
604
648
|
type: 'replaceDocument';
|
|
@@ -665,6 +709,8 @@ export declare interface CanvasFeatures {
|
|
|
665
709
|
enablePublish?: boolean;
|
|
666
710
|
}
|
|
667
711
|
|
|
712
|
+
declare type CanvasFreeSplitAction = FreeSplitMutateAction;
|
|
713
|
+
|
|
668
714
|
export declare interface CanvasGridConfig {
|
|
669
715
|
visible?: boolean;
|
|
670
716
|
size?: number;
|
|
@@ -687,14 +733,20 @@ export declare interface CanvasHandle {
|
|
|
687
733
|
endBatch(batchType?: string): void;
|
|
688
734
|
readonly isBatching: Readonly<Ref<boolean>>;
|
|
689
735
|
getSnapshot(): PageDocument;
|
|
736
|
+
getRemoveImpact(instanceId: string): RemoveImpact;
|
|
690
737
|
readonly selectedIds: Readonly<Ref<readonly string[]>>;
|
|
691
738
|
readonly selectedInstances: ComputedRef<readonly PageInstance[]>;
|
|
739
|
+
readonly freeSplitSelection: Readonly<Ref<FreeSplitSelection | null>>;
|
|
740
|
+
selectFreeSplitLeaf(containerId: string, leafId: string): void;
|
|
741
|
+
selectFreeSplitDivider(containerId: string, nodeId: string, dividerIndex: number): void;
|
|
742
|
+
clearFreeSplitSelection(): void;
|
|
692
743
|
readonly viewport: ViewportStore;
|
|
693
744
|
clientToCanvasPoint(point: Point): Point;
|
|
694
745
|
getInstanceAtClientPoint(point: Point): PageInstance | null;
|
|
695
746
|
getDropTarget(point: Point, root?: ParentNode | null, options?: {
|
|
696
747
|
excludeInstanceId?: string;
|
|
697
748
|
}): DropTarget | null;
|
|
749
|
+
getFreeSplitDropTarget(point: Point, root?: ParentNode | null): FreeSplitDropTarget | null;
|
|
698
750
|
duplicateInstance(instanceId: string, options?: DuplicateInstanceOptions): string | null;
|
|
699
751
|
undo(): void;
|
|
700
752
|
redo(): void;
|
|
@@ -708,7 +760,7 @@ export declare interface CanvasHandle {
|
|
|
708
760
|
updateCanvasBackground(bg: Partial<CanvasBackgroundConfig> | null): void;
|
|
709
761
|
updateBehavior(behavior: Partial<CanvasBehaviorConfig>): void;
|
|
710
762
|
setInteractionOptions(options: Partial<InteractionOptions>): void;
|
|
711
|
-
setRootLayout(mode:
|
|
763
|
+
setRootLayout(mode: RootContainerLayoutConfig | 'free' | 'split' | 'grid' | 'flex' | 'none' | null): void;
|
|
712
764
|
getEffectiveBehavior(): CanvasBehaviorConfig;
|
|
713
765
|
getInstanceTree(): PageInstanceTreeNode[];
|
|
714
766
|
getInstanceList(): PageInstance[];
|
|
@@ -723,11 +775,11 @@ export declare interface CanvasHandle {
|
|
|
723
775
|
readonly cannotReparentEvent: Readonly<Ref<CannotReparentEvent | null>>;
|
|
724
776
|
readonly cannotDragLayoutManagedChildEvent: Readonly<Ref<CannotDragLayoutManagedChildEvent | null>>;
|
|
725
777
|
getViewportState(): ViewportState;
|
|
726
|
-
getVisibleBounds():
|
|
727
|
-
getCanvasBounds():
|
|
728
|
-
getContentBounds():
|
|
729
|
-
getSelectionBounds():
|
|
730
|
-
getInstanceBounds(instanceId: string):
|
|
778
|
+
getVisibleBounds(): Rect;
|
|
779
|
+
getCanvasBounds(): Rect;
|
|
780
|
+
getContentBounds(): Rect | null;
|
|
781
|
+
getSelectionBounds(): Rect | null;
|
|
782
|
+
getInstanceBounds(instanceId: string): Rect | null;
|
|
731
783
|
panBy(dx: number, dy: number): void;
|
|
732
784
|
panTo(panX: number, panY: number): void;
|
|
733
785
|
zoomTo(scale: number, options?: {
|
|
@@ -740,7 +792,7 @@ export declare interface CanvasHandle {
|
|
|
740
792
|
resetViewport(): void;
|
|
741
793
|
fitToContent(options?: FitOptions): void;
|
|
742
794
|
fitToSelection(options?: FitOptions): void;
|
|
743
|
-
scrollToRect(rect:
|
|
795
|
+
scrollToRect(rect: Rect, options?: FitOptions): void;
|
|
744
796
|
readonly toolMode: ComputedRef<CanvasToolMode>;
|
|
745
797
|
getToolMode(): CanvasToolMode;
|
|
746
798
|
setToolMode(mode: CanvasToolMode): void;
|
|
@@ -796,6 +848,7 @@ export declare interface CanvasHandle {
|
|
|
796
848
|
status: DataSourceStatus;
|
|
797
849
|
} | undefined;
|
|
798
850
|
attachBindingDelegate(delegate: WirePageBindingsHandle | null, dataStore?: DataSourceStore | null): void;
|
|
851
|
+
readonly freeSplit: FreeSplitHandleApi;
|
|
799
852
|
}
|
|
800
853
|
|
|
801
854
|
export declare interface CanvasHandleOptions {
|
|
@@ -834,7 +887,7 @@ export declare interface CanvasLayoutConfig {
|
|
|
834
887
|
canvas: CanvasViewportConfig;
|
|
835
888
|
background?: CanvasBackgroundConfig;
|
|
836
889
|
behavior?: CanvasBehaviorConfig;
|
|
837
|
-
rootLayout?:
|
|
890
|
+
rootLayout?: RootContainerLayoutConfig;
|
|
838
891
|
guides?: {
|
|
839
892
|
grid?: CanvasGridConfig;
|
|
840
893
|
ruler?: CanvasRulerConfig;
|
|
@@ -850,6 +903,11 @@ export declare interface CanvasRulerConfig {
|
|
|
850
903
|
size?: number;
|
|
851
904
|
}
|
|
852
905
|
|
|
906
|
+
export declare type CanvasSelection = {
|
|
907
|
+
kind: 'instance';
|
|
908
|
+
instanceId: string;
|
|
909
|
+
} | FreeSplitSelection;
|
|
910
|
+
|
|
853
911
|
export declare type CanvasSelectionAction = {
|
|
854
912
|
type: 'select';
|
|
855
913
|
payload: {
|
|
@@ -1012,15 +1070,21 @@ export declare type ComponentVersionKey = string;
|
|
|
1012
1070
|
|
|
1013
1071
|
export declare type ComponentVersionStatus = 'ok' | 'unavailable' | 'missing' | 'broken';
|
|
1014
1072
|
|
|
1015
|
-
export declare function computeContentBounds(instances: readonly PageInstance[]):
|
|
1073
|
+
export declare function computeContentBounds(instances: readonly PageInstance[]): Rect | null;
|
|
1016
1074
|
|
|
1017
1075
|
export declare function computeEffectiveSplitRatios(rawRatios: readonly number[] | undefined, childrenRatios: readonly (number | undefined)[]): number[];
|
|
1018
1076
|
|
|
1019
|
-
export declare function computeFit(rect:
|
|
1077
|
+
export declare function computeFit(rect: Rect, container: {
|
|
1020
1078
|
w: number;
|
|
1021
1079
|
h: number;
|
|
1022
1080
|
}, options?: FitOptions): FitResult;
|
|
1023
1081
|
|
|
1082
|
+
export declare function computeFreeSplitDividers(root: SplitNode, getLeafRect: (leafId: string) => Rect | null, opts?: {
|
|
1083
|
+
thickness?: number;
|
|
1084
|
+
}): FreeSplitDivider[];
|
|
1085
|
+
|
|
1086
|
+
export declare function computeFreeSplitNodeRect(node: SplitNode, getLeafRect: (leafId: string) => Rect | null): Rect | null;
|
|
1087
|
+
|
|
1024
1088
|
export declare function computeInverse(action: CanvasAction, ctx: CanvasContext): CanvasAction[] | null;
|
|
1025
1089
|
|
|
1026
1090
|
export declare function computeNextAxisSize(startAxis: InstanceSizeAxis | undefined, newPxCanvas: number, outletPxCanvas: number | null): InstanceSizeAxis;
|
|
@@ -1032,7 +1096,7 @@ export declare function computeNextLayoutBoxAxis(startMode: LayoutBoxAxisMode |
|
|
|
1032
1096
|
|
|
1033
1097
|
export declare function computeParentLayoutMode(layout: CanvasLayoutConfig | undefined | null, instances: readonly PageInstance[], instanceId: string): ContainerLayoutConfig['mode'] | undefined;
|
|
1034
1098
|
|
|
1035
|
-
export declare function computeSelectionBounds(instances: readonly PageInstance[], selectedIds: readonly string[]):
|
|
1099
|
+
export declare function computeSelectionBounds(instances: readonly PageInstance[], selectedIds: readonly string[]): Rect | null;
|
|
1036
1100
|
|
|
1037
1101
|
export declare function computeSlotChildCanvasRect(instanceId: string, stageEl: HTMLElement | null, viewport: CanvasContext['viewport']): Rect | null;
|
|
1038
1102
|
|
|
@@ -1040,6 +1104,8 @@ export declare function computeSnap(input: SnapInput): SnapResult;
|
|
|
1040
1104
|
|
|
1041
1105
|
export declare function computeSplitDividers(parentRect: Rect, ratios: readonly number[], direction: 'horizontal' | 'vertical', gap?: number): SplitDivider[];
|
|
1042
1106
|
|
|
1107
|
+
export declare function computeSplitShare(leafRect: Rect, edge: Edge, pt: Point): number;
|
|
1108
|
+
|
|
1043
1109
|
export declare function computeVisibleBounds(viewport: {
|
|
1044
1110
|
scale: number;
|
|
1045
1111
|
panX: number;
|
|
@@ -1047,13 +1113,13 @@ export declare function computeVisibleBounds(viewport: {
|
|
|
1047
1113
|
}, container: {
|
|
1048
1114
|
w: number;
|
|
1049
1115
|
h: number;
|
|
1050
|
-
}):
|
|
1116
|
+
}): Rect;
|
|
1051
1117
|
|
|
1052
1118
|
export declare type ContainerLayoutConfig = {
|
|
1053
1119
|
mode: 'none';
|
|
1054
|
-
} | FreeContainerLayout | FlexContainerLayout | SplitContainerLayout | GridContainerLayout;
|
|
1120
|
+
} | FreeContainerLayout | FlexContainerLayout | SplitContainerLayout | GridContainerLayout | FreeSplitContainerLayout;
|
|
1055
1121
|
|
|
1056
|
-
export declare type ContainerLayoutMode = 'none' | 'free' | 'flex' | 'split' | 'grid';
|
|
1122
|
+
export declare type ContainerLayoutMode = 'none' | 'free' | 'flex' | 'split' | 'grid' | 'free-split';
|
|
1057
1123
|
|
|
1058
1124
|
export declare function containerLayoutToCss(cfg: ContainerLayoutConfig | undefined): Record<string, string> | null;
|
|
1059
1125
|
|
|
@@ -1080,12 +1146,14 @@ export declare function createDocumentStore(initial?: PageDocumentInput): Docume
|
|
|
1080
1146
|
|
|
1081
1147
|
export declare function createFreePageDocument(opts?: Omit<CreatePageDocumentOptions, 'rootLayout'>): PageDocument;
|
|
1082
1148
|
|
|
1149
|
+
export declare function createFreeSplitInteraction(ctx: CanvasContext): FreeSplitInteraction;
|
|
1150
|
+
|
|
1083
1151
|
export declare function createMinimalPageDocument(opts?: CreatePageDocumentOptions): PageDocument;
|
|
1084
1152
|
|
|
1085
1153
|
export declare interface CreatePageDocumentOptions {
|
|
1086
1154
|
canvasWidth?: number;
|
|
1087
1155
|
canvasHeight?: number;
|
|
1088
|
-
rootLayout?:
|
|
1156
|
+
rootLayout?: RootContainerLayoutMode | RootContainerLayoutConfig;
|
|
1089
1157
|
instances?: PageInstance[];
|
|
1090
1158
|
bindings?: NormalizedPageBinding[];
|
|
1091
1159
|
}
|
|
@@ -1275,6 +1343,8 @@ export declare interface DuplicateInstanceOptions {
|
|
|
1275
1343
|
};
|
|
1276
1344
|
}
|
|
1277
1345
|
|
|
1346
|
+
declare type Edge = 'left' | 'right' | 'top' | 'bottom';
|
|
1347
|
+
|
|
1278
1348
|
export declare const EFFECTIVE_DEFAULT_SLOT = "default";
|
|
1279
1349
|
|
|
1280
1350
|
export declare function effectiveSlot(inst: PageInstance): string;
|
|
@@ -1324,6 +1394,145 @@ export declare interface FreeContainerLayout {
|
|
|
1324
1394
|
mode: 'free';
|
|
1325
1395
|
}
|
|
1326
1396
|
|
|
1397
|
+
export declare interface FreeSplitContainerLayout {
|
|
1398
|
+
mode: 'free-split';
|
|
1399
|
+
root: SplitNode;
|
|
1400
|
+
structureLocked?: boolean;
|
|
1401
|
+
gap?: number;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
export declare interface FreeSplitDivider {
|
|
1405
|
+
nodeId: string;
|
|
1406
|
+
dividerIndex: number;
|
|
1407
|
+
rect: Rect;
|
|
1408
|
+
direction: 'horizontal' | 'vertical';
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
export declare interface FreeSplitDropTarget {
|
|
1412
|
+
containerId: string;
|
|
1413
|
+
leafId: string;
|
|
1414
|
+
leafEl: HTMLElement;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
declare type FreeSplitEdge = 'left' | 'right' | 'top' | 'bottom';
|
|
1418
|
+
|
|
1419
|
+
declare interface FreeSplitHandleApi {
|
|
1420
|
+
fill(containerId: string, leafId: string, instance: PageInstance): void;
|
|
1421
|
+
clear(containerId: string, leafId: string): void;
|
|
1422
|
+
swap(containerId: string, leafIdA: string, leafIdB: string): void;
|
|
1423
|
+
resize(containerId: string, nodeId: string, sizes: NodeSize[]): void;
|
|
1424
|
+
split(containerId: string, leafId: string, edge: FreeSplitEdge, newLeafShare: number): {
|
|
1425
|
+
leafId: string;
|
|
1426
|
+
nodeId: string;
|
|
1427
|
+
};
|
|
1428
|
+
merge(containerId: string, leafId: string): void;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
export declare interface FreeSplitInteraction {
|
|
1432
|
+
resizeDrag: Readonly<FreeSplitResizeDragState>;
|
|
1433
|
+
isResizing: Readonly<Ref<boolean>>;
|
|
1434
|
+
handleResizeStart(args: FreeSplitResizeStartArgs): {
|
|
1435
|
+
startTracking: boolean;
|
|
1436
|
+
};
|
|
1437
|
+
handleResizeMove(canvasPt: Point): void;
|
|
1438
|
+
handleResizeEnd(): void;
|
|
1439
|
+
cancelResize(): void;
|
|
1440
|
+
requestSplit(containerId: string, leafId: string, edge: Edge, newLeafShare: number): {
|
|
1441
|
+
leafId: string;
|
|
1442
|
+
nodeId: string;
|
|
1443
|
+
} | null;
|
|
1444
|
+
requestMerge(containerId: string, leafId: string): void;
|
|
1445
|
+
requestDelete(containerId: string, leafId: string): void;
|
|
1446
|
+
requestSwap(containerId: string, leafIdA: string, leafIdB: string): void;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
declare type FreeSplitMutateAction = {
|
|
1450
|
+
type: 'freeSplitFill';
|
|
1451
|
+
payload: {
|
|
1452
|
+
containerId: string;
|
|
1453
|
+
leafId: string;
|
|
1454
|
+
instance: PageInstance;
|
|
1455
|
+
};
|
|
1456
|
+
} | {
|
|
1457
|
+
type: 'freeSplitClear';
|
|
1458
|
+
payload: {
|
|
1459
|
+
containerId: string;
|
|
1460
|
+
leafId: string;
|
|
1461
|
+
};
|
|
1462
|
+
} | {
|
|
1463
|
+
type: 'freeSplitSwap';
|
|
1464
|
+
payload: {
|
|
1465
|
+
containerId: string;
|
|
1466
|
+
leafIdA: string;
|
|
1467
|
+
leafIdB: string;
|
|
1468
|
+
};
|
|
1469
|
+
} | {
|
|
1470
|
+
type: 'freeSplitResize';
|
|
1471
|
+
payload: {
|
|
1472
|
+
containerId: string;
|
|
1473
|
+
nodeId: string;
|
|
1474
|
+
sizes: NodeSize[];
|
|
1475
|
+
};
|
|
1476
|
+
} | {
|
|
1477
|
+
type: 'freeSplitSplit';
|
|
1478
|
+
payload: {
|
|
1479
|
+
containerId: string;
|
|
1480
|
+
leafId: string;
|
|
1481
|
+
edge: 'left' | 'right' | 'top' | 'bottom';
|
|
1482
|
+
newLeafShare: number;
|
|
1483
|
+
newLeafId: string;
|
|
1484
|
+
newNodeId: string;
|
|
1485
|
+
};
|
|
1486
|
+
} | {
|
|
1487
|
+
type: 'freeSplitMerge';
|
|
1488
|
+
payload: {
|
|
1489
|
+
containerId: string;
|
|
1490
|
+
leafId: string;
|
|
1491
|
+
};
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
export declare interface FreeSplitResizeDragState {
|
|
1495
|
+
status: 'idle' | 'active';
|
|
1496
|
+
containerId: string | null;
|
|
1497
|
+
nodeId: string | null;
|
|
1498
|
+
dividerIndex: number | null;
|
|
1499
|
+
startSizes: NodeSize[] | null;
|
|
1500
|
+
branchAxisPx: number;
|
|
1501
|
+
startPt: Point | null;
|
|
1502
|
+
direction: 'horizontal' | 'vertical' | null;
|
|
1503
|
+
snap: boolean;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
export declare interface FreeSplitResizeOpts {
|
|
1507
|
+
snap?: boolean;
|
|
1508
|
+
snapFractions?: number[];
|
|
1509
|
+
snapThreshold?: number;
|
|
1510
|
+
minRatioFraction?: number;
|
|
1511
|
+
minPx?: number;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
export declare interface FreeSplitResizeStartArgs {
|
|
1515
|
+
containerId: string;
|
|
1516
|
+
nodeId: string;
|
|
1517
|
+
dividerIndex: number;
|
|
1518
|
+
startSizes: NodeSize[];
|
|
1519
|
+
branchAxisPx: number;
|
|
1520
|
+
direction: 'horizontal' | 'vertical';
|
|
1521
|
+
canvasPt: Point;
|
|
1522
|
+
snap?: boolean;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
export declare type FreeSplitSelection = {
|
|
1526
|
+
kind: 'freeSplitLeaf';
|
|
1527
|
+
containerId: string;
|
|
1528
|
+
leafId: string;
|
|
1529
|
+
} | {
|
|
1530
|
+
kind: 'freeSplitDivider';
|
|
1531
|
+
containerId: string;
|
|
1532
|
+
nodeId: string;
|
|
1533
|
+
dividerIndex: number;
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1327
1536
|
export declare function getBindingInstanceRefs(binding: NormalizedPageBinding): BindingInstanceRef[];
|
|
1328
1537
|
|
|
1329
1538
|
export declare function getDefaultShortcuts(): CanvasShortcutBinding[];
|
|
@@ -1432,6 +1641,8 @@ export declare function isEditingText(target: EventTarget | null): boolean;
|
|
|
1432
1641
|
|
|
1433
1642
|
export declare function isFreePositionLayoutMode(mode: ContainerLayoutConfig['mode'] | undefined): boolean;
|
|
1434
1643
|
|
|
1644
|
+
export declare function isFreeSplitEnabled(): boolean;
|
|
1645
|
+
|
|
1435
1646
|
export declare function isInstanceEffectivelyLocked(inst: LockedSubset): boolean;
|
|
1436
1647
|
|
|
1437
1648
|
export declare function isInstancePositionLocked(inst: LockedSubset): boolean;
|
|
@@ -1460,7 +1671,7 @@ export declare interface LayoutIssue {
|
|
|
1460
1671
|
detail: string;
|
|
1461
1672
|
}
|
|
1462
1673
|
|
|
1463
|
-
export declare type LayoutIssueKind = 'cycle' | 'missing-parent' | 'cross-page-parent' | 'orphan-slot' | 'invalid-slot' | 'parent-not-layout' | 'slot-not-allowed-component' | 'slot-multiple-violated' | 'absolute-child-rejected' | 'depth-exceeded';
|
|
1674
|
+
export declare type LayoutIssueKind = 'cycle' | 'missing-parent' | 'cross-page-parent' | 'orphan-slot' | 'invalid-slot' | 'parent-not-layout' | 'slot-not-allowed-component' | 'slot-multiple-violated' | 'absolute-child-rejected' | 'depth-exceeded' | 'free-split-duplicate-id' | 'free-split-duplicate-instance' | 'free-split-depth-exceeded' | 'free-split-invalid-size';
|
|
1464
1675
|
|
|
1465
1676
|
export declare interface LayoutItem {
|
|
1466
1677
|
order?: number;
|
|
@@ -1519,6 +1730,8 @@ export declare function matchBinding(binding: CanvasShortcutBinding, ev: Keyboar
|
|
|
1519
1730
|
|
|
1520
1731
|
export declare const MAX_INSTANCE_TREE_DEPTH = 8;
|
|
1521
1732
|
|
|
1733
|
+
export declare const MAX_SPLIT_TREE_DEPTH = 8;
|
|
1734
|
+
|
|
1522
1735
|
declare interface MeasuredStageSize {
|
|
1523
1736
|
w: number;
|
|
1524
1737
|
h: number;
|
|
@@ -1564,6 +1777,13 @@ export declare interface ModifierKeys {
|
|
|
1564
1777
|
|
|
1565
1778
|
export declare type MountState = 'idle' | 'pending' | 'mounting' | 'mounted' | 'disposing';
|
|
1566
1779
|
|
|
1780
|
+
export declare interface NodeSize {
|
|
1781
|
+
mode: 'ratio' | 'px';
|
|
1782
|
+
value: number;
|
|
1783
|
+
min?: number;
|
|
1784
|
+
max?: number;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1567
1787
|
export declare function normalizeComponentOverrides(raw: PageDocument['componentOverrides'], instances: readonly PageInstance[]): Record<string, PageComponentOverride>;
|
|
1568
1788
|
|
|
1569
1789
|
export declare type NormalizedPageBinding = (PageBindingBase & {
|
|
@@ -1574,6 +1794,10 @@ export declare type NormalizedPageBinding = (PageBindingBase & {
|
|
|
1574
1794
|
type: 'data';
|
|
1575
1795
|
});
|
|
1576
1796
|
|
|
1797
|
+
export declare function normalizeFreeSplitContainersInDocument(instances: PageInstance[]): PageInstance[];
|
|
1798
|
+
|
|
1799
|
+
export declare function normalizeFreeSplitTreeShape(node: unknown): SplitNode;
|
|
1800
|
+
|
|
1577
1801
|
export declare function normalizeGridCells0Based(cells: NonNullable<GridContainerLayout['cells']>): NonNullable<GridContainerLayout['cells']>;
|
|
1578
1802
|
|
|
1579
1803
|
export declare function normalizeInstanceSlotFields(inst: PageInstance): PageInstance;
|
|
@@ -1771,13 +1995,6 @@ export declare interface Rect {
|
|
|
1771
1995
|
h: number;
|
|
1772
1996
|
}
|
|
1773
1997
|
|
|
1774
|
-
declare interface Rect_2 {
|
|
1775
|
-
x: number;
|
|
1776
|
-
y: number;
|
|
1777
|
-
w: number;
|
|
1778
|
-
h: number;
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
1998
|
export declare function registerDesignerHandle(canvasId: string, handle: CanvasHandle): void;
|
|
1782
1999
|
|
|
1783
2000
|
export declare function registerRendererDiagnostics(canvasId: string, handle: RendererDiagnosticsHandle): void;
|
|
@@ -1786,6 +2003,11 @@ declare type RegistryEvent = 'register' | 'unregister';
|
|
|
1786
2003
|
|
|
1787
2004
|
declare type RegistryListener = (event: RegistryEvent, canvasId: string) => void;
|
|
1788
2005
|
|
|
2006
|
+
export declare interface RemoveImpact {
|
|
2007
|
+
instanceIds: string[];
|
|
2008
|
+
descendantCount: number;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
1789
2011
|
export declare interface RendererDiagnosticsHandle {
|
|
1790
2012
|
readonly canvasId: string;
|
|
1791
2013
|
getSchedulerStats(): {
|
|
@@ -1857,8 +2079,20 @@ export declare interface ResizeState {
|
|
|
1857
2079
|
|
|
1858
2080
|
export declare function resolveCanvasSizePx(size: CanvasSizeValue, fallback?: number): number;
|
|
1859
2081
|
|
|
2082
|
+
export declare function resolveFreeSplitMergeTarget(root: SplitNode, nodeId: string, dividerIndex: number): string | null;
|
|
2083
|
+
|
|
1860
2084
|
export declare function resolveMeasuredCanvasSizePx(size: CanvasSizeValue, axisSize: number, fallback?: number): number;
|
|
1861
2085
|
|
|
2086
|
+
export declare function resolveSplitEdge(leafRect: Rect, pt: Point, opts?: {
|
|
2087
|
+
edgeZonePx?: number;
|
|
2088
|
+
}): {
|
|
2089
|
+
edge: Edge;
|
|
2090
|
+
} | null;
|
|
2091
|
+
|
|
2092
|
+
export declare type RootContainerLayoutConfig = Exclude<ContainerLayoutConfig, FreeSplitContainerLayout>;
|
|
2093
|
+
|
|
2094
|
+
export declare type RootContainerLayoutMode = Exclude<ContainerLayoutMode, 'free-split'>;
|
|
2095
|
+
|
|
1862
2096
|
export declare interface RuntimeInstanceSnapshot {
|
|
1863
2097
|
instanceId: string;
|
|
1864
2098
|
componentId: string;
|
|
@@ -1875,6 +2109,7 @@ export declare interface SelectionStore {
|
|
|
1875
2109
|
readonly selectedIds: ComputedRef<string[]>;
|
|
1876
2110
|
readonly size: ComputedRef<number>;
|
|
1877
2111
|
readonly primaryId: ComputedRef<string | undefined>;
|
|
2112
|
+
readonly freeSplitSelection: ComputedRef<FreeSplitSelection | null>;
|
|
1878
2113
|
select(instanceId: string): void;
|
|
1879
2114
|
toggleSelect(instanceId: string): void;
|
|
1880
2115
|
addToSelection(instanceId: string): void;
|
|
@@ -1883,6 +2118,9 @@ export declare interface SelectionStore {
|
|
|
1883
2118
|
selectAll(instanceIds: string[]): void;
|
|
1884
2119
|
purgeOrphans(validIds: string[]): void;
|
|
1885
2120
|
isSelected(instanceId: string): boolean;
|
|
2121
|
+
selectFreeSplitLeaf(containerId: string, leafId: string): void;
|
|
2122
|
+
selectFreeSplitDivider(containerId: string, nodeId: string, dividerIndex: number): void;
|
|
2123
|
+
clearFreeSplitSelection(): void;
|
|
1886
2124
|
}
|
|
1887
2125
|
|
|
1888
2126
|
export declare const SLOT_CHILD_RESIZE_HANDLES: readonly ["e", "s", "se"];
|
|
@@ -1934,6 +2172,14 @@ export declare interface Source {
|
|
|
1934
2172
|
css: string;
|
|
1935
2173
|
}
|
|
1936
2174
|
|
|
2175
|
+
export declare interface SplitBranch {
|
|
2176
|
+
type: 'split';
|
|
2177
|
+
nodeId: string;
|
|
2178
|
+
dir: 'row' | 'col';
|
|
2179
|
+
children: SplitNode[];
|
|
2180
|
+
sizes: NodeSize[];
|
|
2181
|
+
}
|
|
2182
|
+
|
|
1937
2183
|
export declare interface SplitContainerLayout {
|
|
1938
2184
|
mode: 'split';
|
|
1939
2185
|
direction: 'horizontal' | 'vertical';
|
|
@@ -1979,6 +2225,15 @@ export declare interface SplitDividerInteraction {
|
|
|
1979
2225
|
cancelSplitDividerDrag(): void;
|
|
1980
2226
|
}
|
|
1981
2227
|
|
|
2228
|
+
export declare interface SplitLeaf {
|
|
2229
|
+
type: 'leaf';
|
|
2230
|
+
leafId: string;
|
|
2231
|
+
instanceId: string | null;
|
|
2232
|
+
locked?: boolean;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
export declare type SplitNode = SplitBranch | SplitLeaf;
|
|
2236
|
+
|
|
1982
2237
|
export declare interface StaleComponentOverride {
|
|
1983
2238
|
instanceId: string;
|
|
1984
2239
|
baseVersionKey: ComponentVersionKey;
|
|
@@ -2011,7 +2266,7 @@ export declare interface TreeMoveTarget {
|
|
|
2011
2266
|
index?: number;
|
|
2012
2267
|
}
|
|
2013
2268
|
|
|
2014
|
-
export declare function unionRects(rects: readonly
|
|
2269
|
+
export declare function unionRects(rects: readonly Rect[]): Rect | null;
|
|
2015
2270
|
|
|
2016
2271
|
export declare function unregisterDesignerHandle(canvasId: string): void;
|
|
2017
2272
|
|