@witchcraft/layout 0.1.3 → 0.2.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.
Files changed (189) hide show
  1. package/README.md +27 -24
  2. package/dist/module.json +1 -1
  3. package/dist/runtime/components/FrameDragHandle.d.vue.ts +15 -0
  4. package/dist/runtime/components/FrameDragHandle.vue +28 -0
  5. package/dist/runtime/components/FrameDragHandle.vue.d.ts +15 -0
  6. package/dist/runtime/components/LayoutDecos.d.vue.ts +2 -4
  7. package/dist/runtime/components/LayoutDecos.vue +10 -29
  8. package/dist/runtime/components/LayoutDecos.vue.d.ts +2 -4
  9. package/dist/runtime/components/LayoutEdges.d.vue.ts +3 -3
  10. package/dist/runtime/components/LayoutEdges.vue +8 -8
  11. package/dist/runtime/components/LayoutEdges.vue.d.ts +3 -3
  12. package/dist/runtime/components/LayoutFrame.d.vue.ts +1 -1
  13. package/dist/runtime/components/LayoutFrame.vue +0 -1
  14. package/dist/runtime/components/LayoutFrame.vue.d.ts +1 -1
  15. package/dist/runtime/components/LayoutShapeSquare.d.vue.ts +3 -1
  16. package/dist/runtime/components/LayoutShapeSquare.vue.d.ts +3 -1
  17. package/dist/runtime/components/LayoutWindow.d.vue.ts +26 -12
  18. package/dist/runtime/components/LayoutWindow.vue +95 -84
  19. package/dist/runtime/components/LayoutWindow.vue.d.ts +26 -12
  20. package/dist/runtime/composables/useFrames.d.ts +15 -13
  21. package/dist/runtime/composables/useFrames.js +59 -39
  22. package/dist/runtime/demo/App.vue +116 -30
  23. package/dist/runtime/demo/DemoControls.d.vue.ts +4 -1
  24. package/dist/runtime/demo/DemoControls.vue +98 -4
  25. package/dist/runtime/demo/DemoControls.vue.d.ts +4 -1
  26. package/dist/runtime/drag/CloseAction.d.ts +26 -5
  27. package/dist/runtime/drag/CloseAction.js +87 -40
  28. package/dist/runtime/drag/DragActionHandler.d.ts +20 -8
  29. package/dist/runtime/drag/DragActionHandler.js +47 -12
  30. package/dist/runtime/drag/FrameDragAction.d.ts +45 -0
  31. package/dist/runtime/drag/FrameDragAction.js +143 -0
  32. package/dist/runtime/drag/SplitAction.d.ts +32 -11
  33. package/dist/runtime/drag/SplitAction.js +82 -24
  34. package/dist/runtime/drag/createDefaultHandlers.d.ts +9 -0
  35. package/dist/runtime/drag/createDefaultHandlers.js +10 -0
  36. package/dist/runtime/drag/defaultDragActions.d.ts +9 -0
  37. package/dist/runtime/drag/defaultDragActions.js +10 -0
  38. package/dist/runtime/drag/types.d.ts +82 -13
  39. package/dist/runtime/drag/types.js +1 -0
  40. package/dist/runtime/helpers/createZoneSideClipPath.d.ts +12 -0
  41. package/dist/runtime/helpers/createZoneSideClipPath.js +17 -0
  42. package/dist/runtime/helpers/doEdgesOverlap.d.ts +3 -1
  43. package/dist/runtime/helpers/doEdgesOverlap.js +5 -5
  44. package/dist/runtime/helpers/getDockBoundaries.d.ts +19 -0
  45. package/dist/runtime/helpers/getDockBoundaries.js +14 -0
  46. package/dist/runtime/helpers/getEdgeLength.d.ts +2 -0
  47. package/dist/runtime/helpers/getEdgeLength.js +5 -0
  48. package/dist/runtime/helpers/getIntersections.js +2 -2
  49. package/dist/runtime/helpers/getIntersectionsCss.js +2 -2
  50. package/dist/runtime/helpers/getMoveEdgeInfo.js +2 -2
  51. package/dist/runtime/helpers/getResizeLimit.js +2 -2
  52. package/dist/runtime/helpers/getShapeSquareCss.js +2 -2
  53. package/dist/runtime/helpers/getVisualEdgeCss.js +2 -2
  54. package/dist/runtime/helpers/getVisualEdges.d.ts +1 -1
  55. package/dist/runtime/helpers/getVisualEdges.js +4 -3
  56. package/dist/runtime/helpers/index.d.ts +4 -0
  57. package/dist/runtime/helpers/index.js +4 -0
  58. package/dist/runtime/helpers/isEdgeEqual.js +2 -4
  59. package/dist/runtime/helpers/isWindowEdge.js +2 -2
  60. package/dist/runtime/helpers/isWindowEdgePoint.js +2 -2
  61. package/dist/runtime/helpers/moveEdge.js +2 -2
  62. package/dist/runtime/helpers/numberToScaledPercent.d.ts +1 -1
  63. package/dist/runtime/helpers/numberToScaledPercent.js +2 -2
  64. package/dist/runtime/helpers/numberToScaledSize.js +2 -2
  65. package/dist/runtime/helpers/rotateFrames.d.ts +7 -0
  66. package/dist/runtime/helpers/rotateFrames.js +36 -0
  67. package/dist/runtime/helpers/scaledPointToPx.d.ts +13 -0
  68. package/dist/runtime/helpers/scaledPointToPx.js +7 -0
  69. package/dist/runtime/helpers/toWindowCoord.js +2 -2
  70. package/dist/runtime/layout/applyFrameChanges.d.ts +10 -0
  71. package/dist/runtime/layout/applyFrameChanges.js +29 -0
  72. package/dist/runtime/layout/createSplitDecoFromDrag.d.ts +6 -1
  73. package/dist/runtime/layout/createSplitDecoFromDrag.js +4 -4
  74. package/dist/runtime/layout/createSplitDecoShapes.d.ts +7 -0
  75. package/dist/runtime/layout/{createSplitDecoEdge.js → createSplitDecoShapes.js} +6 -3
  76. package/dist/runtime/layout/debugFrame.js +2 -1
  77. package/dist/runtime/layout/findSafeSplitEdge.js +2 -2
  78. package/dist/runtime/layout/frameCreate.js +2 -2
  79. package/dist/runtime/layout/getCloseFrameInfo.d.ts +7 -6
  80. package/dist/runtime/layout/getCloseFrameInfo.js +10 -3
  81. package/dist/runtime/layout/getDragZones.d.ts +8 -0
  82. package/dist/runtime/layout/getDragZones.js +32 -0
  83. package/dist/runtime/layout/getFillEmptySpaceInfo.d.ts +65 -0
  84. package/dist/runtime/layout/getFillEmptySpaceInfo.js +69 -0
  85. package/dist/runtime/layout/getFrameCollapseInfo.d.ts +13 -0
  86. package/dist/runtime/layout/getFrameCollapseInfo.js +93 -0
  87. package/dist/runtime/layout/getFrameDockInfo.d.ts +9 -0
  88. package/dist/runtime/layout/getFrameDockInfo.js +82 -0
  89. package/dist/runtime/layout/getFrameDragZones.d.ts +16 -0
  90. package/dist/runtime/layout/getFrameDragZones.js +74 -0
  91. package/dist/runtime/layout/getFrameRearrangeInfo.d.ts +139 -0
  92. package/dist/runtime/layout/getFrameRearrangeInfo.js +87 -0
  93. package/dist/runtime/layout/getFrameSplitInfo.d.ts +7 -5
  94. package/dist/runtime/layout/getFrameSplitInfo.js +10 -3
  95. package/dist/runtime/layout/getFrameSwapInfo.d.ts +9 -0
  96. package/dist/runtime/layout/getFrameSwapInfo.js +27 -0
  97. package/dist/runtime/layout/getFrameTo.js +2 -2
  98. package/dist/runtime/layout/getFrameUncollapseInfo.d.ts +12 -0
  99. package/dist/runtime/layout/getFrameUncollapseInfo.js +88 -0
  100. package/dist/runtime/layout/getFrameUndockInfo.d.ts +13 -0
  101. package/dist/runtime/layout/getFrameUndockInfo.js +51 -0
  102. package/dist/runtime/layout/getFramesRedistributeInfo.d.ts +29 -0
  103. package/dist/runtime/layout/getFramesRedistributeInfo.js +53 -0
  104. package/dist/runtime/layout/getWindowDragZones.d.ts +6 -0
  105. package/dist/runtime/layout/getWindowDragZones.js +49 -0
  106. package/dist/runtime/layout/index.d.ts +14 -5
  107. package/dist/runtime/layout/index.js +14 -5
  108. package/dist/runtime/layout/isPointInRect.d.ts +7 -0
  109. package/dist/runtime/layout/{isPointInFrame.js → isPointInRect.js} +1 -1
  110. package/dist/runtime/layout/resizeFrame.js +2 -2
  111. package/dist/runtime/settings.d.ts +41 -16
  112. package/dist/runtime/settings.js +95 -53
  113. package/dist/runtime/types/index.d.ts +324 -54
  114. package/dist/runtime/types/index.js +54 -20
  115. package/package.json +28 -29
  116. package/src/runtime/components/FrameDragHandle.vue +30 -0
  117. package/src/runtime/components/LayoutDecos.vue +12 -36
  118. package/src/runtime/components/LayoutEdges.vue +27 -23
  119. package/src/runtime/components/LayoutFrame.vue +6 -5
  120. package/src/runtime/components/LayoutShapeSquare.vue +9 -3
  121. package/src/runtime/components/LayoutWindow.vue +110 -101
  122. package/src/runtime/composables/useFrames.ts +80 -50
  123. package/src/runtime/demo/App.vue +126 -36
  124. package/src/runtime/demo/DemoControls.vue +115 -6
  125. package/src/runtime/drag/CloseAction.ts +106 -44
  126. package/src/runtime/drag/DragActionHandler.ts +71 -20
  127. package/src/runtime/drag/FrameDragAction.ts +202 -0
  128. package/src/runtime/drag/SplitAction.ts +106 -34
  129. package/src/runtime/drag/createDefaultHandlers.ts +19 -0
  130. package/src/runtime/drag/defaultDragActions.ts +19 -0
  131. package/src/runtime/drag/types.ts +90 -20
  132. package/src/runtime/helpers/createZoneSideClipPath.ts +41 -0
  133. package/src/runtime/helpers/doEdgesOverlap.ts +11 -5
  134. package/src/runtime/helpers/getDockBoundaries.ts +36 -0
  135. package/src/runtime/helpers/getEdgeLength.ts +10 -0
  136. package/src/runtime/helpers/getIntersections.ts +2 -2
  137. package/src/runtime/helpers/getIntersectionsCss.ts +2 -2
  138. package/src/runtime/helpers/getMoveEdgeInfo.ts +2 -2
  139. package/src/runtime/helpers/getResizeLimit.ts +2 -2
  140. package/src/runtime/helpers/getShapeSquareCss.ts +2 -2
  141. package/src/runtime/helpers/getVisualEdgeCss.ts +2 -2
  142. package/src/runtime/helpers/getVisualEdges.ts +5 -4
  143. package/src/runtime/helpers/index.ts +4 -0
  144. package/src/runtime/helpers/isEdgeEqual.ts +2 -4
  145. package/src/runtime/helpers/isWindowEdge.ts +2 -2
  146. package/src/runtime/helpers/isWindowEdgePoint.ts +2 -2
  147. package/src/runtime/helpers/moveEdge.ts +2 -2
  148. package/src/runtime/helpers/numberToScaledPercent.ts +3 -3
  149. package/src/runtime/helpers/numberToScaledSize.ts +2 -2
  150. package/src/runtime/helpers/rotateFrames.ts +45 -0
  151. package/src/runtime/helpers/scaledPointToPx.ts +13 -0
  152. package/src/runtime/helpers/toWindowCoord.ts +2 -2
  153. package/src/runtime/layout/applyFrameChanges.ts +39 -0
  154. package/src/runtime/layout/createSplitDecoFromDrag.ts +12 -6
  155. package/src/runtime/layout/{createSplitDecoEdge.ts → createSplitDecoShapes.ts} +17 -7
  156. package/src/runtime/layout/debugFrame.ts +1 -1
  157. package/src/runtime/layout/findSafeSplitEdge.ts +3 -3
  158. package/src/runtime/layout/frameCreate.ts +2 -2
  159. package/src/runtime/layout/getCloseFrameInfo.ts +21 -8
  160. package/src/runtime/layout/getDragZones.ts +48 -0
  161. package/src/runtime/layout/getFillEmptySpaceInfo.ts +177 -0
  162. package/src/runtime/layout/getFrameCollapseInfo.ts +164 -0
  163. package/src/runtime/layout/getFrameDockInfo.ts +126 -0
  164. package/src/runtime/layout/getFrameDragZones.ts +100 -0
  165. package/src/runtime/layout/getFrameRearrangeInfo.ts +261 -0
  166. package/src/runtime/layout/getFrameSplitInfo.ts +21 -8
  167. package/src/runtime/layout/getFrameSwapInfo.ts +45 -0
  168. package/src/runtime/layout/getFrameTo.ts +2 -2
  169. package/src/runtime/layout/getFrameUncollapseInfo.ts +160 -0
  170. package/src/runtime/layout/getFrameUndockInfo.ts +97 -0
  171. package/src/runtime/layout/getFramesRedistributeInfo.ts +98 -0
  172. package/src/runtime/layout/getWindowDragZones.ts +59 -0
  173. package/src/runtime/layout/index.ts +14 -5
  174. package/src/runtime/layout/isPointInRect.ts +7 -0
  175. package/src/runtime/layout/resizeFrame.ts +2 -2
  176. package/src/runtime/settings.ts +69 -49
  177. package/src/runtime/types/index.ts +143 -28
  178. package/dist/runtime/layout/closeFrame.d.ts +0 -5
  179. package/dist/runtime/layout/closeFrame.js +0 -13
  180. package/dist/runtime/layout/closeFrames.d.ts +0 -2
  181. package/dist/runtime/layout/closeFrames.js +0 -8
  182. package/dist/runtime/layout/createSplitDecoEdge.d.ts +0 -2
  183. package/dist/runtime/layout/frameSplit.d.ts +0 -16
  184. package/dist/runtime/layout/frameSplit.js +0 -9
  185. package/dist/runtime/layout/isPointInFrame.d.ts +0 -2
  186. package/src/runtime/layout/closeFrame.ts +0 -33
  187. package/src/runtime/layout/closeFrames.ts +0 -14
  188. package/src/runtime/layout/frameSplit.ts +0 -31
  189. package/src/runtime/layout/isPointInFrame.ts +0 -7
@@ -0,0 +1,139 @@
1
+ import type { DragZone, LayoutChange, LayoutWindow } from "../types/index.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ /**
5
+ * Returns a {@link LayoutChange} with the information necessary to rearrange a frame relative to another.
6
+ *
7
+ * Changes can be applied to a window with {@link applyFrameChanges}.
8
+ *
9
+ * Rearrangement is usually done by dragging a frame onto another frame's zone.
10
+ *
11
+ * The action taken depends on their placement relative to each other, see examples below.
12
+ *
13
+ * ## Examples
14
+ *
15
+ * Dragging a frame onto itself in the left/right/top/bottom zones splits it and creates a new frame. Center returns an error.
16
+ *
17
+ * Then there are the more typical cases:
18
+ *
19
+ * Shared Edge Case:
20
+ *
21
+ * ┌─────┬─────┬─────┐
22
+ * │A │B │C │
23
+ * │ │ ├─────┤
24
+ * │ │ │D │
25
+ * └─────┴─────┴─────┘
26
+ *
27
+ * A and B here are on the same edge, with A on the left of B.
28
+ *
29
+ * Dragging A onto B will result in the following depending on what drop zone of B the dragged frame lands on:
30
+ *
31
+ * Left - Error that can be safely ignored - A is already on the left of B
32
+ * Right - Swap A and B
33
+ * Top
34
+ * - B is "split" up (we only simulate it to get the positions). The position of the new split frame is taken and applied to A to move it above B.
35
+ * - The gap left behind by A is filled however possible using {@link getFillEmptySpaceInfo}.
36
+ *
37
+ * The result looks like this:
38
+ *
39
+ * ┌───────────┬─────┐
40
+ * │A │C │
41
+ * ├───────────┼─────┤
42
+ * │B │D │
43
+ * └───────────┴─────┘
44
+ *
45
+ * Bottom - Like top, but A ends up on the bottom of B.
46
+ *
47
+ *
48
+ * Partially Shared Edge Case:
49
+ *
50
+ * ┌─────┬─────┬─────┐
51
+ * │A │B │C │
52
+ * │ │ │ │
53
+ * │ │ │ │
54
+ * │ │ ├─────┤
55
+ * │ │ │D │
56
+ * │ │ │ │
57
+ * └─────┴─────┴─────┘
58
+ *
59
+ * Same case but we'll be using B and C here as they share part of an edge but not the whole edge. Dragging B onto C will result in the following:
60
+ *
61
+ * Left
62
+ * - C will be "split" to the left. The position of the new split frame is taken and applied to B. The space left behind is filled resulting in this.
63
+ * - Note how c has shrunk due to the initial location of the split.
64
+ *
65
+ * ┌─────┬────────┬──┐
66
+ * │A │B │C │
67
+ * │ │ │ │
68
+ * │ │ │ │
69
+ * │ ├────────┴──┤
70
+ * │ │D │
71
+ * │ │ │
72
+ * └─────┴───────────┘
73
+ *
74
+ * Right - Like left but C ends up on the right of B.
75
+ *
76
+ * Top
77
+ * ┌─────┬───────────┐
78
+ * │A │B │
79
+ * │ ├───────────┤
80
+ * │ │C │
81
+ * │ ├───────────┤
82
+ * │ │D │
83
+ * │ │ │
84
+ * └─────┴───────────┘
85
+ *
86
+ * Bottom - Like top, but B ends up on the bottom of C.
87
+ *
88
+ * None-Shared Edge Case:
89
+ *
90
+ * Same case but we'll be dragging A over C.
91
+ * ┌─────┬─────┬─────┐
92
+ * │A │B │C │
93
+ * │ │ │ │
94
+ * │ │ │ │
95
+ * │ │ ├─────┤
96
+ * │ │ │D │
97
+ * │ │ │ │
98
+ * └─────┴─────┴─────┘
99
+ *
100
+ * These are a bit easier to reason about because the frame usually ends up at the split location exactly.
101
+ *
102
+ * Left
103
+ * ┌───────────┬──┬──┐
104
+ * │B │A │C │
105
+ * │ │ │ │
106
+ * │ │ │ │
107
+ * │ ├──┴──┤
108
+ * │ │D │
109
+ * │ │ │
110
+ * └───────────┴─────┘
111
+ * Right
112
+ * ┌───────────┬──┬──┐
113
+ * │B │C │A │
114
+ * │ │ │ │
115
+ * │ │ │ │
116
+ * │ ├──┴──┤
117
+ * │ │D │
118
+ * │ │ │
119
+ * └───────────┴─────┘
120
+ * Top
121
+ * ┌───────────┬─────┐
122
+ * │B │A │
123
+ * │ ├─────┤
124
+ * │ │C │
125
+ * │ ├─────┤
126
+ * │ │D │
127
+ * │ │ │
128
+ * └───────────┴─────┘
129
+ * Bottom
130
+ * ┌───────────┬─────┐
131
+ * │B │C │
132
+ * │ ├─────┤
133
+ * │ │A │
134
+ * │ ├─────┤
135
+ * │ │D │
136
+ * │ │ │
137
+ * └───────────┴─────┘
138
+ */
139
+ export declare function getFrameRearrangeInfo(win: LayoutWindow, draggingFrameId: string, hoveredFrameId: string, zoneSide: DragZone["side"]): LayoutChange<"split" | "swap" | "rearrange"> | KnownError<typeof LAYOUT_ERROR.CANT_SWAP_WITH_SELF> | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_FRAME_TOO_SMALL> | KnownError<typeof LAYOUT_ERROR.CANT_REARRANGE_TO_SAME_RELATIVE_POSITION> | KnownError<typeof LAYOUT_ERROR.CANT_REARRANGE_WITH_DOCKED_EDGES> | KnownError<typeof LAYOUT_ERROR.CANT_REARRANGE_DOCKED_WITH_NON_DOCKED> | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_DOCKED_FRAME> | KnownError<typeof LAYOUT_ERROR.NO_FILL_CANDIDATES>;
@@ -0,0 +1,87 @@
1
+ import { getFillEmptySpaceInfo } from "./getFillEmptySpaceInfo.js";
2
+ import { getFrameSplitInfo } from "./getFrameSplitInfo.js";
3
+ import { getFrameSwapInfo } from "./getFrameSwapInfo.js";
4
+ import { frameToEdges } from "../helpers/frameToEdges.js";
5
+ import { getSideTouching } from "../helpers/getSideTouching.js";
6
+ import { isEdgeEqual } from "../helpers/isEdgeEqual.js";
7
+ import { oppositeSide } from "../helpers/oppositeSide.js";
8
+ import { sideToDirection } from "../helpers/sideToDirection.js";
9
+ import { LAYOUT_ERROR } from "../types/index.js";
10
+ import { KnownError } from "../utils/KnownError.js";
11
+ export function getFrameRearrangeInfo(win, draggingFrameId, hoveredFrameId, zoneSide) {
12
+ const draggingFrame = { ...win.frames[draggingFrameId] };
13
+ const hoveredFrame = { ...win.frames[hoveredFrameId] };
14
+ if (draggingFrameId === hoveredFrameId) {
15
+ if (zoneSide === "center") return new KnownError(LAYOUT_ERROR.CANT_SWAP_WITH_SELF, `Can't swap frame with self.`, { frame: hoveredFrame, zoneSide });
16
+ }
17
+ if (zoneSide === "center") {
18
+ const res = getFrameSwapInfo(win, draggingFrame.id, hoveredFrame.id);
19
+ if (res instanceof KnownError) return res;
20
+ return {
21
+ modified: res.modified,
22
+ created: res.created,
23
+ deleted: res.deleted,
24
+ info: "swap"
25
+ };
26
+ }
27
+ if (draggingFrame.docked && !hoveredFrame.docked) {
28
+ return new KnownError(LAYOUT_ERROR.CANT_REARRANGE_DOCKED_WITH_NON_DOCKED, `Can't rearrange docked frame ${draggingFrameId} with non-docked frame ${hoveredFrameId}, can only swap.`, { draggingFrameId, hoveredFrameId, zoneSide });
29
+ }
30
+ if (hoveredFrame.docked) {
31
+ return new KnownError(LAYOUT_ERROR.CANT_REARRANGE_WITH_DOCKED_EDGES, `Can't rearrange with docked frame ${hoveredFrameId} edge, can only swap.`, { draggingFrameId, hoveredFrameId, zoneSide });
32
+ }
33
+ const touchingSide = getSideTouching(draggingFrame, hoveredFrame);
34
+ if (touchingSide) {
35
+ const dragEdges = frameToEdges(draggingFrame);
36
+ const hoverEdges = frameToEdges(hoveredFrame);
37
+ const hoverOppositeSide = oppositeSide(touchingSide);
38
+ if (isEdgeEqual(dragEdges[touchingSide], hoverEdges[hoverOppositeSide])) {
39
+ if (touchingSide === zoneSide) {
40
+ const res = getFrameSwapInfo(win, draggingFrame.id, hoveredFrame.id);
41
+ if (res instanceof KnownError) return res;
42
+ return {
43
+ modified: res.modified,
44
+ created: res.created,
45
+ deleted: res.deleted,
46
+ info: "swap"
47
+ };
48
+ }
49
+ if (hoverOppositeSide === zoneSide) {
50
+ return new KnownError(LAYOUT_ERROR.CANT_REARRANGE_TO_SAME_RELATIVE_POSITION, `Frame ${draggingFrameId} is already on the ${zoneSide} of ${hoveredFrameId}`, { draggingFrameId, hoveredFrameId, zoneSide });
51
+ }
52
+ }
53
+ }
54
+ const emptySpace = { ...draggingFrame };
55
+ const dir = sideToDirection(zoneSide);
56
+ const splitResult = getFrameSplitInfo(hoveredFrame, dir, "midpoint", void 0, { x: 1e-3, y: 1e-3 });
57
+ if (splitResult instanceof KnownError) {
58
+ return splitResult;
59
+ }
60
+ const splitFrame = splitResult.modified[0];
61
+ const newFrame = splitResult.created[0];
62
+ if (draggingFrameId === hoveredFrameId) {
63
+ return { ...splitResult, deleted: [], info: "split" };
64
+ }
65
+ hoveredFrame.x = splitFrame.x;
66
+ hoveredFrame.y = splitFrame.y;
67
+ hoveredFrame.width = splitFrame.width;
68
+ hoveredFrame.height = splitFrame.height;
69
+ draggingFrame.x = newFrame.x;
70
+ draggingFrame.y = newFrame.y;
71
+ draggingFrame.width = newFrame.width;
72
+ draggingFrame.height = newFrame.height;
73
+ const winCopy = {
74
+ ...win,
75
+ frames: {
76
+ ...win.frames,
77
+ [hoveredFrame.id]: hoveredFrame,
78
+ [draggingFrame.id]: draggingFrame
79
+ }
80
+ };
81
+ const changes = getFillEmptySpaceInfo(winCopy, emptySpace, [hoveredFrameId, draggingFrameId]);
82
+ if (changes instanceof KnownError) return changes;
83
+ const notMissing = changes.modified.map((_) => _.id).filter((id) => id === hoveredFrame.id || draggingFrame.id);
84
+ if (!notMissing.includes(hoveredFrame.id)) changes.modified.push(hoveredFrame);
85
+ if (!notMissing.includes(draggingFrame.id)) changes.modified.push(draggingFrame);
86
+ return { ...changes, info: "split" };
87
+ }
@@ -1,6 +1,8 @@
1
- import { type Direction, LAYOUT_ERROR, type LayoutFrame, type Point, type Size } from "../types/index.js";
1
+ import { type Direction, LAYOUT_ERROR, type LayoutChange, type LayoutFrame, type Point, type Size } from "../types/index.js";
2
2
  import { KnownError } from "../utils/KnownError.js";
3
- export declare function getFrameSplitInfo(frame: LayoutFrame, dir: Direction, dragPointOrPosition?: Point | number | "midpoint", minSize?: Size, snapAmount?: Point): {
4
- splitFrame: LayoutFrame;
5
- newFrame: LayoutFrame;
6
- } | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_FRAME_TOO_SMALL>;
3
+ /**
4
+ * Returns a {@link LayoutChange} with the information necessary to split a frame in the given direction.
5
+ *
6
+ * Changes can be applied to a window with {@link applyFrameChanges}.
7
+ */
8
+ export declare function getFrameSplitInfo(frame: LayoutFrame, dir: Direction, dragPointOrPosition?: Point | number | "midpoint", minSize?: Size, snapAmount?: Point): LayoutChange | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_FRAME_TOO_SMALL> | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_DOCKED_FRAME>;
@@ -1,12 +1,19 @@
1
1
  import { findSafeSplitEdgeAndPosition } from "./findSafeSplitEdge.js";
2
2
  import { frameCreate } from "./frameCreate.js";
3
3
  import { cloneFrame } from "../helpers/cloneFrame.js";
4
- import { getMarginSize, getSnapPoint } from "../settings.js";
4
+ import { settings } from "../settings.js";
5
5
  import {
6
6
  LAYOUT_ERROR
7
7
  } from "../types/index.js";
8
8
  import { KnownError } from "../utils/KnownError.js";
9
- export function getFrameSplitInfo(frame, dir, dragPointOrPosition = "midpoint", minSize = getMarginSize(), snapAmount = getSnapPoint()) {
9
+ export function getFrameSplitInfo(frame, dir, dragPointOrPosition = "midpoint", minSize = settings.minSizeScaled, snapAmount = settings.snapPointScaled) {
10
+ if (frame.docked) {
11
+ return new KnownError(
12
+ LAYOUT_ERROR.CANT_SPLIT_DOCKED_FRAME,
13
+ `Can't split docked frame ${frame.id}.`,
14
+ { frame }
15
+ );
16
+ }
10
17
  frame = cloneFrame(frame);
11
18
  let newFrame = { ...frame };
12
19
  const isHorz = dir === "left" || dir === "right";
@@ -36,5 +43,5 @@ export function getFrameSplitInfo(frame, dir, dragPointOrPosition = "midpoint",
36
43
  frame[posKey] = safePosition.position;
37
44
  }
38
45
  newFrame = frameCreate({ ...newFrame, id: void 0 });
39
- return { splitFrame: frame, newFrame };
46
+ return { modified: [frame], created: [newFrame], deleted: [] };
40
47
  }
@@ -0,0 +1,9 @@
1
+ import type { LayoutChange, LayoutWindow } from "../types/index.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ /**
5
+ * Returns a {@link LayoutChange} with the information necessary to swap two frames within the same window.
6
+ *
7
+ * Changes can be applied to a window with {@link applyFrameChanges}.
8
+ */
9
+ export declare function getFrameSwapInfo(window: LayoutWindow, frameIdA: string, frameIdB: string): LayoutChange | KnownError<typeof LAYOUT_ERROR.CANT_SWAP_WITH_SELF>;
@@ -0,0 +1,27 @@
1
+ import { LAYOUT_ERROR } from "../types/index.js";
2
+ import { KnownError } from "../utils/KnownError.js";
3
+ export function getFrameSwapInfo(window, frameIdA, frameIdB) {
4
+ const frameA = { ...window.frames[frameIdA] };
5
+ const frameB = { ...window.frames[frameIdB] };
6
+ if (frameA.id === frameB.id) {
7
+ return new KnownError(LAYOUT_ERROR.CANT_SWAP_WITH_SELF, `Cannot swap frames with the same id`, { frame: frameA });
8
+ }
9
+ const temp = { x: frameA.x, y: frameA.y, width: frameA.width, height: frameA.height };
10
+ frameA.x = frameB.x;
11
+ frameA.y = frameB.y;
12
+ frameA.width = frameB.width;
13
+ frameA.height = frameB.height;
14
+ frameB.x = temp.x;
15
+ frameB.y = temp.y;
16
+ frameB.width = temp.width;
17
+ frameB.height = temp.height;
18
+ const dockedA = frameA.docked;
19
+ const dockedB = frameB.docked;
20
+ frameA.docked = dockedB;
21
+ frameB.docked = dockedA;
22
+ const collapsedA = frameA.collapsed;
23
+ const collapsedB = frameB.collapsed;
24
+ frameA.collapsed = collapsedB;
25
+ frameB.collapsed = collapsedA;
26
+ return { modified: [frameA, frameB], created: [], deleted: [] };
27
+ }
@@ -1,6 +1,6 @@
1
- import { getMaxInt } from "../settings.js";
1
+ import { settings } from "../settings.js";
2
2
  export function getFrameTo(side, frame, frames) {
3
- const max = getMaxInt();
3
+ const max = settings.maxInt;
4
4
  if (side === "top" && frame.y === 0 || side === "left" && frame.y === 0 || side === "right" && frame.x + frame.width === max || side === "bottom" && frame.x + frame.height === max) return void 0;
5
5
  let candidate;
6
6
  let candidateDistance = Infinity;
@@ -0,0 +1,12 @@
1
+ import type { LayoutChange, LayoutWindow } from "../types/index.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ /**
5
+ * Returns a {@link LayoutChange} with the information necessary to uncollapse a docked frame.
6
+ *
7
+ * Changes can be applied to a window with {@link applyFrameChanges}.
8
+ *
9
+ * Uncollapsing restores the frame to its pre-collapse size, shrinking neighboring
10
+ * frames to make room.
11
+ */
12
+ export declare function getFrameUncollapseInfo(win: LayoutWindow, frameId: string): LayoutChange | KnownError<typeof LAYOUT_ERROR.CANT_UNCOLLAPSE_NOT_COLLAPSED> | KnownError<typeof LAYOUT_ERROR.REDISTRIBUTE_OUT_OF_BOUNDS> | KnownError<typeof LAYOUT_ERROR.NO_SPACE_TO_REDISTRIBUTE>;
@@ -0,0 +1,88 @@
1
+ import { pushIfNotIn } from "@alanscodelog/utils/pushIfNotIn";
2
+ import { walk } from "@alanscodelog/utils/walk";
3
+ import { applyFrameChanges } from "./applyFrameChanges.js";
4
+ import { getFramesRedistributeInfo } from "./getFramesRedistributeInfo.js";
5
+ import { oppositeSide } from "../helpers/oppositeSide.js";
6
+ import { settings } from "../settings.js";
7
+ import { LAYOUT_ERROR } from "../types/index.js";
8
+ import { KnownError } from "../utils/KnownError.js";
9
+ export function getFrameUncollapseInfo(win, frameId) {
10
+ win = walk(win, void 0, { save: true });
11
+ const frame = win.frames[frameId];
12
+ if (!frame) {
13
+ throw new Error(`Unknown frame ${frameId}`);
14
+ }
15
+ if (!frame.docked) {
16
+ throw new Error(`Frame ${frameId} is not docked.`);
17
+ }
18
+ const toExtract = [frame.id];
19
+ const storedSize = frame.collapsed;
20
+ if (storedSize === void 0) {
21
+ return new KnownError(
22
+ LAYOUT_ERROR.CANT_UNCOLLAPSE_NOT_COLLAPSED,
23
+ `Frame ${frameId} is not collapsed.`,
24
+ { frame }
25
+ );
26
+ }
27
+ const isVertical = frame.docked === "left" || frame.docked === "right";
28
+ const sizeKey = isVertical ? "width" : "height";
29
+ const posKey = isVertical ? "x" : "y";
30
+ const currentSize = frame[sizeKey];
31
+ const expandAmount = storedSize - currentSize;
32
+ const dockedSide = frame.docked;
33
+ const framesToFix = [];
34
+ const opposite = oppositeSide(dockedSide);
35
+ if (frame[sizeKey] !== 0) {
36
+ for (const other of Object.values(win.frames)) {
37
+ if (frame.id === other.id || !other.docked) continue;
38
+ if (other.width === 0 || other.height === 0) continue;
39
+ if (other.docked === opposite) continue;
40
+ if (dockedSide === "left" || dockedSide === "top") {
41
+ if (other[posKey] !== 0) continue;
42
+ other[posKey] = frame[posKey] + frame[sizeKey];
43
+ other[sizeKey] -= frame[sizeKey];
44
+ framesToFix.push({
45
+ id: other.id,
46
+ posKey,
47
+ sizeKey,
48
+ type: "start"
49
+ });
50
+ } else {
51
+ if (other[posKey] + other[sizeKey] !== settings.maxInt) continue;
52
+ other[sizeKey] -= frame[sizeKey];
53
+ framesToFix.push({
54
+ id: other.id,
55
+ posKey,
56
+ sizeKey,
57
+ type: "end"
58
+ });
59
+ }
60
+ }
61
+ }
62
+ const otherFrameIds = Object.keys(win.frames).filter((id) => id !== frameId);
63
+ const redistributeSide = oppositeSide(frame.docked);
64
+ const changes = getFramesRedistributeInfo(win, redistributeSide, otherFrameIds, expandAmount);
65
+ if (changes instanceof KnownError) {
66
+ return changes;
67
+ }
68
+ applyFrameChanges(win, changes);
69
+ pushIfNotIn(toExtract, changes.modified.map((_) => _.id));
70
+ for (const fix of framesToFix) {
71
+ const other = win.frames[fix.id];
72
+ if (fix.type === "start") {
73
+ const sizeDiff = other[fix.posKey];
74
+ other[fix.posKey] = 0;
75
+ other[fix.sizeKey] += sizeDiff;
76
+ } else {
77
+ const sizeDiff = settings.maxInt - (other[fix.posKey] + other[fix.sizeKey]);
78
+ other[fix.sizeKey] += sizeDiff;
79
+ }
80
+ }
81
+ pushIfNotIn(toExtract, framesToFix.map((_) => _.id));
82
+ frame[sizeKey] = storedSize;
83
+ frame.collapsed = void 0;
84
+ if (frame.docked === "right" || frame.docked === "bottom") {
85
+ frame[posKey] -= expandAmount;
86
+ }
87
+ return { modified: toExtract.map((_) => win.frames[_]), created: [], deleted: [] };
88
+ }
@@ -0,0 +1,13 @@
1
+ import type { LayoutChange, LayoutWindow } from "../types/index.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ /**
5
+ * Returns a {@link LayoutChange} with the information necessary to undock a frame.
6
+ *
7
+ * Changes can be applied to a window with {@link applyFrameChanges}.
8
+ *
9
+ * If a frame is not docked it will throw.
10
+ *
11
+ * If the frame was collapsed it will be uncollapsed.
12
+ */
13
+ export declare function getFrameUndockInfo(win: LayoutWindow, frameId: string): LayoutChange | KnownError<typeof LAYOUT_ERROR.CANT_UNDOCK_COLLAPSED_FRAME>;
@@ -0,0 +1,51 @@
1
+ import { settings } from "../settings.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ export function getFrameUndockInfo(win, frameId) {
5
+ const frame = win.frames[frameId];
6
+ if (!frame) {
7
+ throw new Error(`Unknown frame ${frameId}`);
8
+ }
9
+ if (!frame.docked) throw new Error("Can't undock frame that is not docked.");
10
+ const frameSide = frame.docked;
11
+ const isVertical = frameSide === "left" || frameSide === "right";
12
+ const sizeKey = isVertical ? "height" : "width";
13
+ const posKey = isVertical ? "y" : "x";
14
+ const maxInt = settings.maxInt;
15
+ const shrinkStartKey = isVertical ? "top" : "left";
16
+ const shrinkEndKey = isVertical ? "bottom" : "right";
17
+ if (frame.collapsed) {
18
+ return new KnownError(LAYOUT_ERROR.CANT_UNDOCK_COLLAPSED_FRAME, `Can't undock collapsed frame ${frame.id}.`, { frame: frame.id });
19
+ }
20
+ const frameClone = { ...frame, docked: void 0, collapsed: void 0 };
21
+ const otherDockedFramesToResize = [];
22
+ const dockedSidesToSearch = [
23
+ ...frame[posKey] === 0 ? [shrinkStartKey] : [],
24
+ ...frame[posKey] + frame[sizeKey] === maxInt ? [shrinkEndKey] : []
25
+ ];
26
+ for (const other of Object.values(win.frames)) {
27
+ if (other.id !== frame.id && other.docked && dockedSidesToSearch.includes(other.docked)) {
28
+ otherDockedFramesToResize.push(other);
29
+ }
30
+ }
31
+ if (otherDockedFramesToResize.length === 0) {
32
+ return { modified: [frameClone], created: [], deleted: [] };
33
+ }
34
+ const adjustmentKey = frameSide === "left" ? "x" : frameSide === "top" ? "y" : frameSide === "right" ? "width" : "height";
35
+ const secondaryAdjustmentKey = frameSide === "left" ? "width" : frameSide === "top" ? "height" : frameSide === "right" ? "x" : "y";
36
+ const adjustmentValue = frameSide === "left" || frameSide === "top" ? 0 : maxInt;
37
+ const otherChanges = otherDockedFramesToResize.map((other) => {
38
+ if (other.docked === shrinkStartKey) {
39
+ frameClone[posKey] += other[sizeKey];
40
+ frameClone[sizeKey] -= other[sizeKey];
41
+ } else if (other.docked === shrinkEndKey) {
42
+ frameClone[sizeKey] -= other[sizeKey];
43
+ }
44
+ return {
45
+ ...other,
46
+ [adjustmentKey]: adjustmentValue,
47
+ [secondaryAdjustmentKey]: other[secondaryAdjustmentKey] + other[adjustmentKey]
48
+ };
49
+ });
50
+ return { modified: [frameClone, ...otherChanges], created: [], deleted: [] };
51
+ }
@@ -0,0 +1,29 @@
1
+ import type { EdgeSide, LayoutChange, LayoutWindow } from "../types/index.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ /**
5
+ * Returns a {@link LayoutChange} with the information necessary to redistribute frames to expand/shrink a certain amount towards the given side.
6
+ *
7
+ * Changes can be applied to a window with {@link applyFrameChanges}.
8
+ *
9
+ * While it checks for bounds/space issues (unless allowOutOfBounds is true), it does not check that all the frames correctly share/fill the start/end edges.
10
+ *
11
+ * If you try to resize a layout like this to the right, you will get issues with frame edges not lining up as frame B would be resized less than A. If you had a frame at the empty space that you excluded, it's right edge would no longer align with B's.
12
+ *
13
+ * See {@link getFrameCollapseInfo} and {@link getFrameUncollapseInfo} for how to work around this (you must move frames like A to share the edge then move them back). Excluding them from the calcuation usually leads to subtler errors. Such as if there are frames after A and B to the right, excluding A would mean A's right edge would stop aligning with those other frames.
14
+ *
15
+ * ┌────────────┐
16
+ * │A │
17
+ * └──┬─────────┤
18
+ * │B │
19
+ * └─────────┘
20
+ *
21
+ * Also note that it automatically excludes all collapsed frames without an area (height or width === 0).
22
+ */
23
+ export declare function getFramesRedistributeInfo(win: LayoutWindow,
24
+ /** Side to expand/shrink to. */
25
+ side: EdgeSide, frameIds: string[],
26
+ /** This can be negative to expand the frames instead (e.g. when collapsing a docked frame). */
27
+ amountScaled: number,
28
+ /** Allow the resize span to exceed window bounds. */
29
+ allowOutOfBounds?: boolean): LayoutChange | KnownError<typeof LAYOUT_ERROR.REDISTRIBUTE_OUT_OF_BOUNDS> | KnownError<typeof LAYOUT_ERROR.NO_SPACE_TO_REDISTRIBUTE>;
@@ -0,0 +1,53 @@
1
+ import { settings } from "../settings.js";
2
+ import { LAYOUT_ERROR } from "../types/index.js";
3
+ import { KnownError } from "../utils/KnownError.js";
4
+ export function getFramesRedistributeInfo(win, side, frameIds, amountScaled, allowOutOfBounds = false) {
5
+ const isLeftOrTop = side === "left" || side === "top";
6
+ const isHorizontalSide = side === "left" || side === "right";
7
+ const posKey = isHorizontalSide ? "x" : "y";
8
+ const sizeKey = isHorizontalSide ? "width" : "height";
9
+ const frames = frameIds.map((id) => win.frames[id]);
10
+ const edgeSet = /* @__PURE__ */ new Set();
11
+ for (const frame of frames) {
12
+ edgeSet.add(frame[posKey]);
13
+ edgeSet.add(frame[posKey] + frame[sizeKey]);
14
+ }
15
+ const uniqueEdges = [...edgeSet].sort((a, b) => a - b);
16
+ const maxInt = settings.maxInt;
17
+ const resizeSpan = uniqueEdges[uniqueEdges.length - 1] - uniqueEdges[0];
18
+ const newSpan = resizeSpan - amountScaled;
19
+ if (!allowOutOfBounds && (newSpan > maxInt || newSpan < 0)) {
20
+ return new KnownError(LAYOUT_ERROR.REDISTRIBUTE_OUT_OF_BOUNDS, `Not enough space to resize frames, needed ${newSpan} but min/max as 0/${maxInt}.`, { max: maxInt, min: 0, wanted: newSpan });
21
+ }
22
+ const anchorEdge = isLeftOrTop ? uniqueEdges[0] : uniqueEdges[uniqueEdges.length - 1];
23
+ const dirMultiplier = isLeftOrTop ? -1 : 1;
24
+ const newEdges = [];
25
+ for (let i = 0; i < uniqueEdges.length; i++) {
26
+ const edge = uniqueEdges[i];
27
+ const distFromAnchor = anchorEdge === uniqueEdges[0] ? edge - anchorEdge : anchorEdge - edge;
28
+ const rawMovement = dirMultiplier * distFromAnchor / resizeSpan * amountScaled;
29
+ const newEdge = edge + Math.trunc(rawMovement);
30
+ newEdges.push(newEdge);
31
+ }
32
+ const oppositeEdgeIndex = isLeftOrTop ? uniqueEdges.length - 1 : 0;
33
+ newEdges[oppositeEdgeIndex] = isLeftOrTop ? anchorEdge + newSpan : anchorEdge - newSpan;
34
+ const minSize = settings.minSizeScaled[sizeKey];
35
+ const result = [];
36
+ for (const frame of frames) {
37
+ if (frame.collapsed && (frame.width === 0 || frame.height === 0)) continue;
38
+ const startEdge = frame[posKey];
39
+ const endEdge = frame[posKey] + frame[sizeKey];
40
+ const newStart = newEdges[uniqueEdges.indexOf(startEdge)];
41
+ const newEnd = newEdges[uniqueEdges.indexOf(endEdge)];
42
+ const newSize = newEnd - newStart;
43
+ if (newSize < minSize) {
44
+ return new KnownError(LAYOUT_ERROR.NO_SPACE_TO_REDISTRIBUTE, `Redistribute would cause frame ${frame.id} to shrink to ${newSize} which is below minimum ${minSize}.`, { frameSizeNeeded: newSize, minFrameSize: minSize });
45
+ }
46
+ result.push({
47
+ ...frame,
48
+ [posKey]: newStart,
49
+ [sizeKey]: newSize
50
+ });
51
+ }
52
+ return { modified: result, created: [], deleted: [] };
53
+ }
@@ -0,0 +1,6 @@
1
+ import type { LayoutWindow, WindowEdgeZone } from "../types/index.js";
2
+ /**
3
+ * Returns window edge drag zones (in scaled coordinates)
4
+ *
5
+ */
6
+ export declare function getWindowDragZones(win: LayoutWindow, thresholdPx: number): WindowEdgeZone[];
@@ -0,0 +1,49 @@
1
+ import { numberToScaledPercent } from "../helpers/numberToScaledPercent.js";
2
+ import { settings } from "../settings.js";
3
+ export function getWindowDragZones(win, thresholdPx) {
4
+ const thX = numberToScaledPercent(thresholdPx, win.pxWidth);
5
+ const thY = numberToScaledPercent(thresholdPx, win.pxHeight);
6
+ const maxInt = settings.maxInt;
7
+ return [
8
+ {
9
+ type: "window",
10
+ side: "top",
11
+ x: 0,
12
+ y: 0,
13
+ width: maxInt,
14
+ height: thY,
15
+ pxWidth: win.pxWidth,
16
+ pxHeight: thresholdPx
17
+ },
18
+ {
19
+ type: "window",
20
+ side: "bottom",
21
+ x: 0,
22
+ y: maxInt - thY,
23
+ width: maxInt,
24
+ height: thY,
25
+ pxWidth: win.pxWidth,
26
+ pxHeight: thresholdPx
27
+ },
28
+ {
29
+ type: "window",
30
+ side: "left",
31
+ x: 0,
32
+ y: 0,
33
+ width: thX,
34
+ height: maxInt,
35
+ pxWidth: thresholdPx,
36
+ pxHeight: win.pxHeight
37
+ },
38
+ {
39
+ type: "window",
40
+ side: "right",
41
+ x: maxInt - thX,
42
+ y: 0,
43
+ width: thX,
44
+ height: maxInt,
45
+ pxWidth: thresholdPx,
46
+ pxHeight: win.pxHeight
47
+ }
48
+ ];
49
+ }
@@ -1,17 +1,26 @@
1
- export { closeFrame } from "./closeFrame.js";
2
- export { closeFrames } from "./closeFrames.js";
3
- export { createSplitDecoEdge } from "./createSplitDecoEdge.js";
1
+ export { applyFrameChanges } from "./applyFrameChanges.js";
4
2
  export { createSplitDecoFromDrag } from "./createSplitDecoFromDrag.js";
3
+ export { createSplitDecoShapes } from "./createSplitDecoShapes.js";
5
4
  export { debugFrame } from "./debugFrame.js";
6
5
  export { findFramesTouchingEdge } from "./findFramesTouchingEdge.js";
7
6
  export { findSafeSplitEdgeAndPosition } from "./findSafeSplitEdge.js";
8
7
  export { findVisualEdge } from "./findVisualEdge.js";
9
8
  export { frameCreate } from "./frameCreate.js";
10
- export { frameSplit } from "./frameSplit.js";
11
9
  export { getCloseFrameInfo } from "./getCloseFrameInfo.js";
10
+ export { getDragZones } from "./getDragZones.js";
11
+ export { getFillEmptySpaceInfo } from "./getFillEmptySpaceInfo.js";
12
+ export { getFrameCollapseInfo } from "./getFrameCollapseInfo.js";
13
+ export { getFrameDockInfo } from "./getFrameDockInfo.js";
14
+ export { getFrameDragZones } from "./getFrameDragZones.js";
15
+ export { getFrameRearrangeInfo } from "./getFrameRearrangeInfo.js";
12
16
  export { getFrameSplitInfo } from "./getFrameSplitInfo.js";
17
+ export { getFramesRedistributeInfo } from "./getFramesRedistributeInfo.js";
18
+ export { getFrameSwapInfo } from "./getFrameSwapInfo.js";
13
19
  export { getFrameTo } from "./getFrameTo.js";
14
- export { isPointInFrame } from "./isPointInFrame.js";
20
+ export { getFrameUncollapseInfo } from "./getFrameUncollapseInfo.js";
21
+ export { getFrameUndockInfo } from "./getFrameUndockInfo.js";
22
+ export { getWindowDragZones } from "./getWindowDragZones.js";
23
+ export { isPointInRect } from "./isPointInRect.js";
15
24
  export { layoutAddWindow } from "./layoutAddWindow.js";
16
25
  export { layoutCreate } from "./layoutCreate.js";
17
26
  export { layoutRemoveWindow } from "./layoutRemoveWindow.js";