@witchcraft/layout 0.4.3 → 0.5.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/module.json +1 -1
- package/dist/runtime/components/FrameDragHandle.vue +3 -3
- package/dist/runtime/components/LayoutDragEdgeGrabbed.vue +3 -3
- package/dist/runtime/components/LayoutDragEdgeHandle.d.vue.ts +2 -2
- package/dist/runtime/components/LayoutDragEdgeHandle.vue +2 -2
- package/dist/runtime/components/LayoutDragEdgeHandle.vue.d.ts +2 -2
- package/dist/runtime/components/LayoutDragEdges.vue +5 -5
- package/dist/runtime/components/LayoutEdgesActiveFrame.vue +2 -2
- package/dist/runtime/components/LayoutFrame.vue +2 -2
- package/dist/runtime/components/LayoutIntersectionHandle.d.vue.ts +2 -2
- package/dist/runtime/components/LayoutIntersectionHandle.vue +2 -2
- package/dist/runtime/components/LayoutIntersectionHandle.vue.d.ts +2 -2
- package/dist/runtime/components/LayoutIntersections.vue +4 -4
- package/dist/runtime/components/LayoutWindow.d.vue.ts +54 -45
- package/dist/runtime/components/LayoutWindow.vue +29 -29
- package/dist/runtime/components/LayoutWindow.vue.d.ts +54 -45
- package/dist/runtime/composables/useFrames.d.ts +142 -129
- package/dist/runtime/composables/useFrames.js +122 -94
- package/dist/runtime/demo/App.vue +16 -16
- package/dist/runtime/demo/DemoControls.d.vue.ts +2 -2
- package/dist/runtime/demo/DemoControls.vue +4 -4
- package/dist/runtime/demo/DemoControls.vue.d.ts +2 -2
- package/dist/runtime/demo/tailwind.css +1 -1
- package/dist/runtime/helpers/createZoneSideClipPath.d.ts +2 -2
- package/dist/runtime/helpers/findEdgesTouchingWindow.d.ts +7 -0
- package/dist/runtime/helpers/findEdgesTouchingWindow.js +20 -0
- package/dist/runtime/helpers/{findFrameDraggableEdges.d.ts → findFrameMoveableEdges.d.ts} +2 -2
- package/dist/runtime/helpers/{findFrameDraggableEdges.js → findFrameMoveableEdges.js} +3 -3
- package/dist/runtime/helpers/{findDraggableEdge.d.ts → findMoveableEdge.d.ts} +1 -1
- package/dist/runtime/helpers/{findDraggableEdge.js → findMoveableEdge.js} +1 -1
- package/dist/runtime/helpers/index.d.ts +10 -3
- package/dist/runtime/helpers/index.js +10 -3
- package/dist/runtime/layout/createSplitDecoFromDrag.d.ts +1 -1
- package/dist/runtime/layout/createSplitDecoFromDrag.js +2 -2
- package/dist/runtime/layout/debugFrame.js +5 -1
- package/dist/runtime/layout/findSafeSplitEdge.d.ts +1 -1
- package/dist/runtime/layout/findSafeSplitEdge.js +2 -2
- package/dist/runtime/layout/getCloseFrameInfo.js +4 -4
- package/dist/runtime/layout/getFrameCollapseInfo.d.ts +1 -1
- package/dist/runtime/layout/getFrameCollapseInfo.js +9 -29
- package/dist/runtime/layout/getFrameDockInfo.d.ts +1 -1
- package/dist/runtime/layout/getFrameDockInfo.js +61 -44
- package/dist/runtime/layout/getFrameExpandInfo.d.ts +11 -0
- package/dist/runtime/layout/getFrameExpandInfo.js +49 -0
- package/dist/runtime/layout/getFrameRearrangeInfo.d.ts +2 -2
- package/dist/runtime/layout/getFrameRearrangeInfo.js +8 -8
- package/dist/runtime/layout/getFrameShrinkInfo.d.ts +14 -0
- package/dist/runtime/layout/getFrameShrinkInfo.js +48 -0
- package/dist/runtime/layout/getFrameSplitInfo.d.ts +1 -1
- package/dist/runtime/layout/getFrameSplitInfo.js +2 -2
- package/dist/runtime/layout/getFrameUncollapseInfo.d.ts +1 -1
- package/dist/runtime/layout/getFrameUncollapseInfo.js +6 -20
- package/dist/runtime/layout/{getFrameDragZones.d.ts → getFrameZones.d.ts} +3 -3
- package/dist/runtime/layout/{getFrameDragZones.js → getFrameZones.js} +1 -1
- package/dist/runtime/layout/getUpdateWindowSizeInfo.js +10 -12
- package/dist/runtime/layout/{getWindowDragZones.d.ts → getWindowZones.d.ts} +1 -1
- package/dist/runtime/layout/{getWindowDragZones.js → getWindowZones.js} +1 -1
- package/dist/runtime/layout/getZones.d.ts +8 -0
- package/dist/runtime/layout/getZones.js +32 -0
- package/dist/runtime/layout/index.d.ts +6 -3
- package/dist/runtime/layout/index.js +6 -3
- package/dist/runtime/{drag/DragActionHandler.d.ts → move/ActionHandler.d.ts} +18 -18
- package/dist/runtime/{drag/DragActionHandler.js → move/ActionHandler.js} +19 -19
- package/dist/runtime/{drag → move}/CloseAction.d.ts +8 -8
- package/dist/runtime/{drag → move}/CloseAction.js +29 -26
- package/dist/runtime/{drag → move}/FrameDragAction.d.ts +8 -8
- package/dist/runtime/{drag → move}/FrameDragAction.js +23 -21
- package/dist/runtime/{drag/DragDirectionStore.d.ts → move/MoveDirectionStore.d.ts} +4 -4
- package/dist/runtime/{drag/DragDirectionStore.js → move/MoveDirectionStore.js} +9 -9
- package/dist/runtime/{drag → move}/SplitAction.d.ts +9 -9
- package/dist/runtime/{drag → move}/SplitAction.js +46 -43
- package/dist/runtime/{drag → move}/createDefaultHandlers.d.ts +2 -2
- package/dist/runtime/types/index.d.ts +242 -158
- package/dist/runtime/types/index.js +4 -3
- package/dist/runtime/types/vue.d.ts +25 -18
- package/dist/runtime/types/vue.js +1 -1
- package/package.json +3 -2
- package/src/runtime/components/FrameDragHandle.vue +3 -3
- package/src/runtime/components/LayoutDragEdgeGrabbed.vue +3 -3
- package/src/runtime/components/LayoutDragEdgeHandle.vue +4 -4
- package/src/runtime/components/LayoutDragEdges.vue +5 -5
- package/src/runtime/components/LayoutEdgesActiveFrame.vue +2 -2
- package/src/runtime/components/LayoutFrame.vue +2 -2
- package/src/runtime/components/LayoutIntersectionHandle.vue +4 -4
- package/src/runtime/components/LayoutIntersections.vue +4 -4
- package/src/runtime/components/LayoutWindow.vue +35 -35
- package/src/runtime/composables/useFrames.ts +141 -121
- package/src/runtime/demo/App.vue +18 -18
- package/src/runtime/demo/DemoControls.vue +5 -5
- package/src/runtime/demo/tailwind.css +4 -0
- package/src/runtime/helpers/createZoneSideClipPath.ts +2 -2
- package/src/runtime/helpers/findEdgesTouchingWindow.ts +30 -0
- package/src/runtime/helpers/{findFrameDraggableEdges.ts → findFrameMoveableEdges.ts} +4 -4
- package/src/runtime/helpers/{findDraggableEdge.ts → findMoveableEdge.ts} +1 -1
- package/src/runtime/helpers/index.ts +10 -3
- package/src/runtime/layout/createSplitDecoFromDrag.ts +2 -2
- package/src/runtime/layout/debugFrame.ts +6 -1
- package/src/runtime/layout/findSafeSplitEdge.ts +4 -4
- package/src/runtime/layout/getCloseFrameInfo.ts +4 -4
- package/src/runtime/layout/getFrameCollapseInfo.ts +12 -41
- package/src/runtime/layout/getFrameDockInfo.ts +77 -57
- package/src/runtime/layout/getFrameExpandInfo.ts +84 -0
- package/src/runtime/layout/getFrameRearrangeInfo.ts +10 -10
- package/src/runtime/layout/getFrameShrinkInfo.ts +87 -0
- package/src/runtime/layout/getFrameSplitInfo.ts +5 -5
- package/src/runtime/layout/getFrameUncollapseInfo.ts +8 -30
- package/src/runtime/layout/{getFrameDragZones.ts → getFrameZones.ts} +4 -4
- package/src/runtime/layout/getUpdateWindowSizeInfo.ts +16 -22
- package/src/runtime/layout/{getWindowDragZones.ts → getWindowZones.ts} +1 -1
- package/src/runtime/layout/getZones.ts +48 -0
- package/src/runtime/layout/index.ts +6 -3
- package/src/runtime/{drag/DragActionHandler.ts → move/ActionHandler.ts} +44 -42
- package/src/runtime/{drag → move}/CloseAction.ts +39 -36
- package/src/runtime/{drag → move}/FrameDragAction.ts +36 -35
- package/src/runtime/{drag/DragDirectionStore.ts → move/MoveDirectionStore.ts} +10 -10
- package/src/runtime/{drag → move}/SplitAction.ts +56 -53
- package/src/runtime/{drag/defaultDragActions.ts → move/createDefaultHandlers.ts} +2 -2
- package/src/runtime/types/index.ts +104 -55
- package/src/runtime/types/vue.ts +18 -16
- package/dist/runtime/drag/defaultDragActions.d.ts +0 -9
- package/dist/runtime/drag/defaultDragActions.js +0 -10
- package/dist/runtime/layout/getDragZones.d.ts +0 -8
- package/dist/runtime/layout/getDragZones.js +0 -32
- package/src/runtime/drag/createDefaultHandlers.ts +0 -20
- package/src/runtime/layout/getDragZones.ts +0 -48
- /package/dist/runtime/{drag → move}/createDefaultHandlers.js +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
1
|
+
import { ActionHandler } from "../move/ActionHandler";
|
|
2
|
+
import { type MoveState, type IAction } from "../types/index.js";
|
|
3
3
|
import { getUpdateWindowSizeInfo } from "../layout/getUpdateWindowSizeInfo.js";
|
|
4
4
|
import { type LayoutWindow } from "../types/index.js";
|
|
5
5
|
type __VLS_Props = {
|
|
6
|
-
/** If you really need it, you can provide your own drag action handler, note the actionHandler's prop will no longer have any effect.*/
|
|
7
|
-
|
|
6
|
+
/** If you really need it, you can provide your own drag action handler (remember to markRaw it), note the actionHandler's prop will no longer have any effect.*/
|
|
7
|
+
actionHandler?: ActionHandler<any, any>;
|
|
8
8
|
/** Custom drag action handlers. Falls back to default split/close/frame handlers if not provided. */
|
|
9
|
-
actionHandlers?:
|
|
9
|
+
actionHandlers?: IAction[];
|
|
10
10
|
textHints?: {
|
|
11
11
|
text: string;
|
|
12
12
|
classes?: string;
|
|
@@ -35,19 +35,19 @@ type __VLS_Slots = {} & {
|
|
|
35
35
|
};
|
|
36
36
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
37
37
|
state: import("vue").ComputedRef<{
|
|
38
|
-
|
|
38
|
+
moveDirections: {
|
|
39
39
|
horizontal: "up" | "down" | "left" | "right" | undefined;
|
|
40
40
|
vertical: "up" | "down" | "left" | "right" | undefined;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
movePoint: {
|
|
43
43
|
x: number;
|
|
44
44
|
y: number;
|
|
45
45
|
} | undefined;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
moveDistance: number;
|
|
47
|
+
isMoving: false | "edge" | "frame";
|
|
48
|
+
showMoving: boolean;
|
|
49
|
+
movingFrameId: string | undefined;
|
|
50
|
+
movingEdges: {
|
|
51
51
|
startX: number;
|
|
52
52
|
startY: number;
|
|
53
53
|
endX: number;
|
|
@@ -76,17 +76,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
76
76
|
} | {
|
|
77
77
|
frame: import("../types/index.js").LayoutFrame;
|
|
78
78
|
} | {
|
|
79
|
-
|
|
79
|
+
movingFrameId: string;
|
|
80
80
|
hoveredFrameId: string;
|
|
81
|
-
zoneSide: import("../types/index.js").
|
|
81
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
82
82
|
} | {
|
|
83
|
-
|
|
83
|
+
movingFrameId: string;
|
|
84
84
|
hoveredFrameId: string;
|
|
85
|
-
zoneSide: import("../types/index.js").
|
|
85
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
86
86
|
} | {
|
|
87
|
-
|
|
87
|
+
movingFrameId: string;
|
|
88
88
|
hoveredFrameId: string;
|
|
89
|
-
zoneSide: import("../types/index.js").
|
|
89
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
90
90
|
} | {
|
|
91
91
|
frame: import("../types/index.js").LayoutFrame;
|
|
92
92
|
} | {
|
|
@@ -109,12 +109,14 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
109
109
|
frame: import("../types/index.js").LayoutFrame;
|
|
110
110
|
} | {
|
|
111
111
|
frame: import("../types/index.js").LayoutFrame;
|
|
112
|
+
} | {
|
|
113
|
+
frame: import("../types/index.js").LayoutFrame;
|
|
112
114
|
}> | {
|
|
113
115
|
code: string;
|
|
114
116
|
message: string;
|
|
115
117
|
} | undefined;
|
|
116
118
|
}[];
|
|
117
|
-
|
|
119
|
+
movingIntersection: {
|
|
118
120
|
point: {
|
|
119
121
|
x: number;
|
|
120
122
|
y: number;
|
|
@@ -151,17 +153,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
151
153
|
} | {
|
|
152
154
|
frame: import("../types/index.js").LayoutFrame;
|
|
153
155
|
} | {
|
|
154
|
-
|
|
156
|
+
movingFrameId: string;
|
|
155
157
|
hoveredFrameId: string;
|
|
156
|
-
zoneSide: import("../types/index.js").
|
|
158
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
157
159
|
} | {
|
|
158
|
-
|
|
160
|
+
movingFrameId: string;
|
|
159
161
|
hoveredFrameId: string;
|
|
160
|
-
zoneSide: import("../types/index.js").
|
|
162
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
161
163
|
} | {
|
|
162
|
-
|
|
164
|
+
movingFrameId: string;
|
|
163
165
|
hoveredFrameId: string;
|
|
164
|
-
zoneSide: import("../types/index.js").
|
|
166
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
165
167
|
} | {
|
|
166
168
|
frame: import("../types/index.js").LayoutFrame;
|
|
167
169
|
} | {
|
|
@@ -184,6 +186,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
184
186
|
frame: import("../types/index.js").LayoutFrame;
|
|
185
187
|
} | {
|
|
186
188
|
frame: import("../types/index.js").LayoutFrame;
|
|
189
|
+
} | {
|
|
190
|
+
frame: import("../types/index.js").LayoutFrame;
|
|
187
191
|
}> | {
|
|
188
192
|
code: string;
|
|
189
193
|
message: string;
|
|
@@ -218,17 +222,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
218
222
|
} | {
|
|
219
223
|
frame: import("../types/index.js").LayoutFrame;
|
|
220
224
|
} | {
|
|
221
|
-
|
|
225
|
+
movingFrameId: string;
|
|
222
226
|
hoveredFrameId: string;
|
|
223
|
-
zoneSide: import("../types/index.js").
|
|
227
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
224
228
|
} | {
|
|
225
|
-
|
|
229
|
+
movingFrameId: string;
|
|
226
230
|
hoveredFrameId: string;
|
|
227
|
-
zoneSide: import("../types/index.js").
|
|
231
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
228
232
|
} | {
|
|
229
|
-
|
|
233
|
+
movingFrameId: string;
|
|
230
234
|
hoveredFrameId: string;
|
|
231
|
-
zoneSide: import("../types/index.js").
|
|
235
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
232
236
|
} | {
|
|
233
237
|
frame: import("../types/index.js").LayoutFrame;
|
|
234
238
|
} | {
|
|
@@ -251,6 +255,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
251
255
|
frame: import("../types/index.js").LayoutFrame;
|
|
252
256
|
} | {
|
|
253
257
|
frame: import("../types/index.js").LayoutFrame;
|
|
258
|
+
} | {
|
|
259
|
+
frame: import("../types/index.js").LayoutFrame;
|
|
254
260
|
}> | {
|
|
255
261
|
code: string;
|
|
256
262
|
message: string;
|
|
@@ -288,17 +294,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
288
294
|
} | {
|
|
289
295
|
frame: import("../types/index.js").LayoutFrame;
|
|
290
296
|
} | {
|
|
291
|
-
|
|
297
|
+
movingFrameId: string;
|
|
292
298
|
hoveredFrameId: string;
|
|
293
|
-
zoneSide: import("../types/index.js").
|
|
299
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
294
300
|
} | {
|
|
295
|
-
|
|
301
|
+
movingFrameId: string;
|
|
296
302
|
hoveredFrameId: string;
|
|
297
|
-
zoneSide: import("../types/index.js").
|
|
303
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
298
304
|
} | {
|
|
299
|
-
|
|
305
|
+
movingFrameId: string;
|
|
300
306
|
hoveredFrameId: string;
|
|
301
|
-
zoneSide: import("../types/index.js").
|
|
307
|
+
zoneSide: import("../types/index.js").Zone["side"];
|
|
302
308
|
} | {
|
|
303
309
|
frame: import("../types/index.js").LayoutFrame;
|
|
304
310
|
} | {
|
|
@@ -321,6 +327,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
321
327
|
frame: import("../types/index.js").LayoutFrame;
|
|
322
328
|
} | {
|
|
323
329
|
frame: import("../types/index.js").LayoutFrame;
|
|
330
|
+
} | {
|
|
331
|
+
frame: import("../types/index.js").LayoutFrame;
|
|
324
332
|
}> | {
|
|
325
333
|
code: string;
|
|
326
334
|
message: string;
|
|
@@ -329,25 +337,26 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
|
329
337
|
touchingFrames: Record<string, import("../types/index.js").LayoutFrame>[];
|
|
330
338
|
touchingFramesArrays: import("../types/index.js").LayoutFrame[][];
|
|
331
339
|
frames: import("../types/index.js").LayoutFrames;
|
|
332
|
-
|
|
340
|
+
moveHoveredFrame: import("../types/index.js").LayoutFrame | undefined;
|
|
333
341
|
intersections: import("../types/index.js").IntersectionEntry[];
|
|
334
|
-
|
|
342
|
+
isMovingFromWindowEdge: boolean;
|
|
343
|
+
eventContext: Record<string, unknown> | undefined;
|
|
335
344
|
win: import("../types/index.js").BaseLayoutWindow;
|
|
336
345
|
}>;
|
|
337
346
|
win: import("vue").ModelRef<import("../types/index.js").BaseLayoutWindow, string, import("../types/index.js").BaseLayoutWindow, import("../types/index.js").BaseLayoutWindow>;
|
|
338
347
|
getUpdateWindowSizeInfo: typeof getUpdateWindowSizeInfo;
|
|
339
|
-
|
|
348
|
+
actionHandler: ActionHandler<any, any>;
|
|
340
349
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
341
350
|
"update:win": (value: import("../types/index.js").BaseLayoutWindow) => any;
|
|
342
351
|
} & {
|
|
343
|
-
|
|
344
|
-
|
|
352
|
+
isShowingMove: (value: boolean) => any;
|
|
353
|
+
moveState: (value: MoveState) => any;
|
|
345
354
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
346
|
-
|
|
347
|
-
|
|
355
|
+
onIsShowingMove?: ((value: boolean) => any) | undefined;
|
|
356
|
+
onMoveState?: ((value: MoveState) => any) | undefined;
|
|
348
357
|
"onUpdate:win"?: ((value: import("../types/index.js").BaseLayoutWindow) => any) | undefined;
|
|
349
358
|
}>, {
|
|
350
|
-
actionHandlers:
|
|
359
|
+
actionHandlers: IAction[];
|
|
351
360
|
textHints: {
|
|
352
361
|
text: string;
|
|
353
362
|
classes?: string;
|