@witchcraft/layout 0.0.5 → 0.0.6

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 (117) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/LayoutDecos.d.vue.ts +8 -0
  3. package/dist/runtime/components/LayoutDecos.vue.d.ts +8 -0
  4. package/dist/runtime/components/LayoutEdges.d.vue.ts +27 -0
  5. package/dist/runtime/components/LayoutEdges.vue.d.ts +27 -0
  6. package/dist/runtime/components/LayoutFrame.d.vue.ts +36 -0
  7. package/dist/runtime/components/LayoutFrame.vue.d.ts +36 -0
  8. package/dist/runtime/components/LayoutShapeSquare.d.vue.ts +36 -0
  9. package/dist/runtime/components/LayoutShapeSquare.vue.d.ts +36 -0
  10. package/dist/runtime/components/LayoutWindow.d.vue.ts +108 -0
  11. package/dist/runtime/components/LayoutWindow.vue.d.ts +108 -0
  12. package/dist/runtime/composables/useFrames.d.ts +180 -0
  13. package/dist/runtime/demo/App.d.vue.ts +2 -0
  14. package/dist/runtime/demo/App.vue.d.ts +2 -0
  15. package/dist/runtime/demo/DemoControls.d.vue.ts +6 -0
  16. package/dist/runtime/demo/DemoControls.vue.d.ts +6 -0
  17. package/dist/runtime/demo/main.d.ts +2 -0
  18. package/dist/runtime/demo/sharedLayoutInstance.d.ts +6 -0
  19. package/dist/runtime/demo/tailwind.css +1 -1
  20. package/dist/runtime/drag/CloseAction.d.ts +33 -0
  21. package/dist/runtime/drag/DragActionHandler.d.ts +42 -0
  22. package/dist/runtime/drag/DragDirectionStore.d.ts +20 -0
  23. package/dist/runtime/drag/SplitAction.d.ts +32 -0
  24. package/dist/runtime/drag/types.d.ts +92 -0
  25. package/dist/runtime/helpers/addPointsToIntersection.d.ts +2 -0
  26. package/dist/runtime/helpers/assertEdgeSorted.d.ts +2 -0
  27. package/dist/runtime/helpers/assertItemIn.d.ts +1 -0
  28. package/dist/runtime/helpers/assertItemNotIn.d.ts +1 -0
  29. package/dist/runtime/helpers/assertLayoutHasActiveWindow.d.ts +4 -0
  30. package/dist/runtime/helpers/assertValidWinAndFrame.d.ts +5 -0
  31. package/dist/runtime/helpers/assertValidWinAndFrameIds.d.ts +2 -0
  32. package/dist/runtime/helpers/assertWindowHasActiveFrame.d.ts +4 -0
  33. package/dist/runtime/helpers/clampNumber.d.ts +1 -0
  34. package/dist/runtime/helpers/cloneFrame.d.ts +2 -0
  35. package/dist/runtime/helpers/cloneFrames.d.ts +2 -0
  36. package/dist/runtime/helpers/containsEdge.d.ts +2 -0
  37. package/dist/runtime/helpers/convertLayoutWindowToWorkspace.d.ts +2 -0
  38. package/dist/runtime/helpers/copySize.d.ts +2 -0
  39. package/dist/runtime/helpers/createEdge.d.ts +5 -0
  40. package/dist/runtime/helpers/dirToOrientation.d.ts +2 -0
  41. package/dist/runtime/helpers/dirToSide.d.ts +2 -0
  42. package/dist/runtime/helpers/doEdgesOverlap.d.ts +2 -0
  43. package/dist/runtime/helpers/doesEdgeContinueEdge.d.ts +2 -0
  44. package/dist/runtime/helpers/edgeToPoints.d.ts +2 -0
  45. package/dist/runtime/helpers/findDraggableEdge.d.ts +4 -0
  46. package/dist/runtime/helpers/findFrameDraggableEdges.d.ts +7 -0
  47. package/dist/runtime/helpers/frameToEdges.d.ts +2 -0
  48. package/dist/runtime/helpers/frameToPoints.d.ts +19 -0
  49. package/dist/runtime/helpers/getEdgeOrientation.d.ts +2 -0
  50. package/dist/runtime/helpers/getEdgeSharedDirection.d.ts +2 -0
  51. package/dist/runtime/helpers/getEdgeSide.d.ts +2 -0
  52. package/dist/runtime/helpers/getFrameById.d.ts +2 -0
  53. package/dist/runtime/helpers/getFrameConstant.d.ts +2 -0
  54. package/dist/runtime/helpers/getIntersections.d.ts +2 -0
  55. package/dist/runtime/helpers/getIntersectionsCss.d.ts +9 -0
  56. package/dist/runtime/helpers/getMoveEdgeInfo.d.ts +11 -0
  57. package/dist/runtime/helpers/getResizeLimit.d.ts +2 -0
  58. package/dist/runtime/helpers/getShapeSquareCss.d.ts +7 -0
  59. package/dist/runtime/helpers/getSideTouching.d.ts +2 -0
  60. package/dist/runtime/helpers/getVisualEdgeCss.d.ts +7 -0
  61. package/dist/runtime/helpers/getVisualEdges.d.ts +48 -0
  62. package/dist/runtime/helpers/getVisualEdgesCss.d.ts +3 -0
  63. package/dist/runtime/helpers/getWinAndFrameById.d.ts +10 -0
  64. package/dist/runtime/helpers/getWinByFrameUuid.d.ts +2 -0
  65. package/dist/runtime/helpers/getWinById.d.ts +2 -0
  66. package/dist/runtime/helpers/getWindowConstant.d.ts +2 -0
  67. package/dist/runtime/helpers/inRange.d.ts +1 -0
  68. package/dist/runtime/helpers/index.d.ts +62 -0
  69. package/dist/runtime/helpers/isEdgeEqual.d.ts +2 -0
  70. package/dist/runtime/helpers/isEdgeParallel.d.ts +2 -0
  71. package/dist/runtime/helpers/isPointEqual.d.ts +2 -0
  72. package/dist/runtime/helpers/isSizeAboveMin.d.ts +2 -0
  73. package/dist/runtime/helpers/isSizeEqual.d.ts +2 -0
  74. package/dist/runtime/helpers/isWindowEdge.d.ts +2 -0
  75. package/dist/runtime/helpers/isWindowEdgePoint.d.ts +2 -0
  76. package/dist/runtime/helpers/moveEdge.d.ts +4 -0
  77. package/dist/runtime/helpers/numberToScaledPercent.d.ts +13 -0
  78. package/dist/runtime/helpers/numberToScaledSize.d.ts +2 -0
  79. package/dist/runtime/helpers/oppositeSide.d.ts +2 -0
  80. package/dist/runtime/helpers/resizeByEdge.d.ts +2 -0
  81. package/dist/runtime/helpers/sideToDirection.d.ts +3 -0
  82. package/dist/runtime/helpers/sideToOrientation.d.ts +2 -0
  83. package/dist/runtime/helpers/splitEdge.d.ts +2 -0
  84. package/dist/runtime/helpers/toCoord.d.ts +3 -0
  85. package/dist/runtime/helpers/toId.d.ts +3 -0
  86. package/dist/runtime/helpers/toWindowCoord.d.ts +2 -0
  87. package/dist/runtime/helpers/unionEdges.d.ts +2 -0
  88. package/dist/runtime/helpers/updateWindowSizeWithEvent.d.ts +2 -0
  89. package/dist/runtime/index.d.ts +5 -0
  90. package/dist/runtime/layout/closeFrame.d.ts +5 -0
  91. package/dist/runtime/layout/closeFrames.d.ts +2 -0
  92. package/dist/runtime/layout/createSplitDecoEdge.d.ts +2 -0
  93. package/dist/runtime/layout/createSplitDecoFromDrag.d.ts +2 -0
  94. package/dist/runtime/layout/debugFrame.d.ts +2 -0
  95. package/dist/runtime/layout/findFramesTouchingEdge.d.ts +49 -0
  96. package/dist/runtime/layout/findSafeSplitEdge.d.ts +5 -0
  97. package/dist/runtime/layout/findVisualEdge.d.ts +2 -0
  98. package/dist/runtime/layout/frameCreate.d.ts +3 -0
  99. package/dist/runtime/layout/frameSplit.d.ts +16 -0
  100. package/dist/runtime/layout/getCloseFrameInfo.d.ts +73 -0
  101. package/dist/runtime/layout/getFrameSplitInfo.d.ts +16 -0
  102. package/dist/runtime/layout/getFrameTo.d.ts +2 -0
  103. package/dist/runtime/layout/index.d.ts +22 -0
  104. package/dist/runtime/layout/isPointInFrame.d.ts +2 -0
  105. package/dist/runtime/layout/layoutAddWindow.d.ts +2 -0
  106. package/dist/runtime/layout/layoutCreate.d.ts +3 -0
  107. package/dist/runtime/layout/layoutRemoveWindow.d.ts +2 -0
  108. package/dist/runtime/layout/resizeFrame.d.ts +6 -0
  109. package/dist/runtime/layout/windowAddFrame.d.ts +2 -0
  110. package/dist/runtime/layout/windowCreate.d.ts +4 -0
  111. package/dist/runtime/layout/windowRemoveFrame.d.ts +2 -0
  112. package/dist/runtime/layout/windowSetActiveFrame.d.ts +2 -0
  113. package/dist/runtime/settings.d.ts +23 -0
  114. package/dist/runtime/types/index.d.ts +459 -0
  115. package/dist/runtime/utils/KnownError.d.ts +10 -0
  116. package/package.json +1 -1
  117. package/src/runtime/demo/tailwind.css +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@witchcraft/layout",
3
3
  "configKey": "witchcraftLayout",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -0,0 +1,8 @@
1
+ import { type CloseDeco, type LayoutFrames, type SplitDeco } from "../types/index.js";
2
+ type __VLS_Props = {
3
+ frames: LayoutFrames;
4
+ splitDecos: SplitDeco[];
5
+ closeDecos: CloseDeco[];
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { type CloseDeco, type LayoutFrames, type SplitDeco } from "../types/index.js";
2
+ type __VLS_Props = {
3
+ frames: LayoutFrames;
4
+ splitDecos: SplitDeco[];
5
+ closeDecos: CloseDeco[];
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { type Edge, type IntersectionEntry, type LayoutFrame, type LayoutWindow } from "../types/index.js";
2
+ type __VLS_Props = {
3
+ edges: Edge[];
4
+ intersections: IntersectionEntry[];
5
+ /** The owning window, needed so we can correctly scale coordinates. */
6
+ win: LayoutWindow;
7
+ /** The active frame, used to render the active edges. Calculate it from the `frames` returned by `useFrames` composable because otherwise it will be the wrong size while dragging. */
8
+ activeFrame?: LayoutFrame;
9
+ draggingEdge?: Edge;
10
+ draggingIntersection?: IntersectionEntry;
11
+ };
12
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ dragStart: (e: PointerEvent, args_1: {
14
+ edge?: Edge;
15
+ intersection?: IntersectionEntry;
16
+ }) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onDragStart?: ((e: PointerEvent, args_1: {
19
+ edge?: Edge;
20
+ intersection?: IntersectionEntry;
21
+ }) => any) | undefined;
22
+ }>, {
23
+ activeFrame: LayoutFrame;
24
+ draggingEdge: Edge;
25
+ draggingIntersection: IntersectionEntry;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { type Edge, type IntersectionEntry, type LayoutFrame, type LayoutWindow } from "../types/index.js";
2
+ type __VLS_Props = {
3
+ edges: Edge[];
4
+ intersections: IntersectionEntry[];
5
+ /** The owning window, needed so we can correctly scale coordinates. */
6
+ win: LayoutWindow;
7
+ /** The active frame, used to render the active edges. Calculate it from the `frames` returned by `useFrames` composable because otherwise it will be the wrong size while dragging. */
8
+ activeFrame?: LayoutFrame;
9
+ draggingEdge?: Edge;
10
+ draggingIntersection?: IntersectionEntry;
11
+ };
12
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ dragStart: (e: PointerEvent, args_1: {
14
+ edge?: Edge;
15
+ intersection?: IntersectionEntry;
16
+ }) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onDragStart?: ((e: PointerEvent, args_1: {
19
+ edge?: Edge;
20
+ intersection?: IntersectionEntry;
21
+ }) => any) | undefined;
22
+ }>, {
23
+ activeFrame: LayoutFrame;
24
+ draggingEdge: Edge;
25
+ draggingIntersection: IntersectionEntry;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ export default _default;
@@ -0,0 +1,36 @@
1
+ import { type PropType } from "vue";
2
+ import { type LayoutFrame } from "../types/index.js";
3
+ declare var __VLS_8: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_8) => any;
6
+ };
7
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ frame: {
9
+ type: PropType<LayoutFrame>;
10
+ required: true;
11
+ };
12
+ isActiveFrame: {
13
+ type: BooleanConstructor;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
+ focus: () => any;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ frame: {
20
+ type: PropType<LayoutFrame>;
21
+ required: true;
22
+ };
23
+ isActiveFrame: {
24
+ type: BooleanConstructor;
25
+ required: true;
26
+ };
27
+ }>> & Readonly<{
28
+ onFocus?: (() => any) | undefined;
29
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,36 @@
1
+ import { type PropType } from "vue";
2
+ import { type LayoutFrame } from "../types/index.js";
3
+ declare var __VLS_8: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_8) => any;
6
+ };
7
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ frame: {
9
+ type: PropType<LayoutFrame>;
10
+ required: true;
11
+ };
12
+ isActiveFrame: {
13
+ type: BooleanConstructor;
14
+ required: true;
15
+ };
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
+ focus: () => any;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ frame: {
20
+ type: PropType<LayoutFrame>;
21
+ required: true;
22
+ };
23
+ isActiveFrame: {
24
+ type: BooleanConstructor;
25
+ required: true;
26
+ };
27
+ }>> & Readonly<{
28
+ onFocus?: (() => any) | undefined;
29
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,36 @@
1
+ import { type PropType } from "vue";
2
+ import type { BaseSquareCss } from "../types/index.js";
3
+ declare var __VLS_1: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_1) => any;
6
+ };
7
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ style: {
9
+ type: StringConstructor;
10
+ required: false;
11
+ default: string;
12
+ };
13
+ css: {
14
+ type: PropType<BaseSquareCss>;
15
+ required: true;
16
+ };
17
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
+ style: {
19
+ type: StringConstructor;
20
+ required: false;
21
+ default: string;
22
+ };
23
+ css: {
24
+ type: PropType<BaseSquareCss>;
25
+ required: true;
26
+ };
27
+ }>> & Readonly<{}>, {
28
+ style: string;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,36 @@
1
+ import { type PropType } from "vue";
2
+ import type { BaseSquareCss } from "../types/index.js";
3
+ declare var __VLS_1: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_1) => any;
6
+ };
7
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ style: {
9
+ type: StringConstructor;
10
+ required: false;
11
+ default: string;
12
+ };
13
+ css: {
14
+ type: PropType<BaseSquareCss>;
15
+ required: true;
16
+ };
17
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
+ style: {
19
+ type: StringConstructor;
20
+ required: false;
21
+ default: string;
22
+ };
23
+ css: {
24
+ type: PropType<BaseSquareCss>;
25
+ required: true;
26
+ };
27
+ }>> & Readonly<{}>, {
28
+ style: string;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,108 @@
1
+ import { type DragState, type IDragAction } from "../drag/types.js";
2
+ import { type LayoutWindow } from "../types/index.js";
3
+ type __VLS_Props = {
4
+ additionalDragActions?: IDragAction[];
5
+ splitKeyHandler?: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
6
+ closeKeyHandler?: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
7
+ usageInstructions?: Record<string, string | undefined>;
8
+ instructionsTeleportTo: string | undefined;
9
+ /**
10
+ * You might need to temporarily disable updating the window size while transitioning, depending on your layout.
11
+ *
12
+ * For example, if the component is in a flex container, during transition, there will be two components, and it will suddenly jump in size to being 1/2 the height. We can avoid this by using the known height (from win), but to do so, we can't let this component update the size while transitioning.
13
+ *
14
+ * When this is turned back on again, it will trigger an update. You can also trigger updates manually with the exposed updateWindowSize function.
15
+ */
16
+ allowWindowSizeUpdate?: boolean;
17
+ };
18
+ declare function updateWindowSize(): void;
19
+ type __VLS_PublicProps = __VLS_Props & {
20
+ "win": LayoutWindow;
21
+ };
22
+ declare var __VLS_9: any, __VLS_10: {
23
+ frame: any;
24
+ }, __VLS_22: {};
25
+ type __VLS_Slots = {} & {
26
+ [K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
27
+ } & {
28
+ 'extra-decos'?: (props: typeof __VLS_22) => any;
29
+ };
30
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
31
+ state: import("vue").ComputedRef<{
32
+ dragDirections: {
33
+ horizontal: "up" | "down" | "left" | "right" | undefined;
34
+ vertical: "up" | "down" | "left" | "right" | undefined;
35
+ };
36
+ dragPoint: {
37
+ x: number;
38
+ y: number;
39
+ } | undefined;
40
+ isDragging: boolean;
41
+ draggingEdges: {
42
+ startX: number;
43
+ startY: number;
44
+ endX: number;
45
+ endY: number;
46
+ }[];
47
+ draggingIntersection: {
48
+ point: {
49
+ x: number;
50
+ y: number;
51
+ };
52
+ count: number;
53
+ sharesEdge: boolean;
54
+ sharedEdges: {
55
+ horizontal: {
56
+ startX: number;
57
+ startY: number;
58
+ endX: number;
59
+ endY: number;
60
+ }[];
61
+ vertical: {
62
+ startX: number;
63
+ startY: number;
64
+ endX: number;
65
+ endY: number;
66
+ }[];
67
+ };
68
+ isWindowEdge: boolean;
69
+ } | undefined;
70
+ visualEdges: {
71
+ startX: number;
72
+ startY: number;
73
+ endX: number;
74
+ endY: number;
75
+ }[];
76
+ touchingFrames: Record<string, import("../types/index.js").LayoutFrame>[];
77
+ touchingFramesArrays: import("../types/index.js").LayoutFrame[][];
78
+ frames: import("../types/index.js").LayoutFrames;
79
+ dragHoveredFrame: import("../types/index.js").LayoutFrame | undefined;
80
+ intersections: import("../types/index.js").IntersectionEntry[];
81
+ isDraggingFromWindowEdge: boolean;
82
+ win: import("../types/index.js").BaseLayoutWindow;
83
+ }>;
84
+ win: import("vue").ModelRef<import("../types/index.js").BaseLayoutWindow, string, import("../types/index.js").BaseLayoutWindow, import("../types/index.js").BaseLayoutWindow>;
85
+ updateWindowSize: typeof updateWindowSize;
86
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
87
+ "update:win": (value: import("../types/index.js").BaseLayoutWindow) => any;
88
+ } & {
89
+ isShowingDrag: (value: boolean) => any;
90
+ dragState: (value: DragState) => any;
91
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
92
+ onIsShowingDrag?: ((value: boolean) => any) | undefined;
93
+ onDragState?: ((value: DragState) => any) | undefined;
94
+ "onUpdate:win"?: ((value: import("../types/index.js").BaseLayoutWindow) => any) | undefined;
95
+ }>, {
96
+ additionalDragActions: IDragAction[];
97
+ splitKeyHandler: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
98
+ closeKeyHandler: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
99
+ usageInstructions: Record<string, string | undefined>;
100
+ allowWindowSizeUpdate: boolean;
101
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
102
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
103
+ export default _default;
104
+ type __VLS_WithSlots<T, S> = T & {
105
+ new (): {
106
+ $slots: S;
107
+ };
108
+ };
@@ -0,0 +1,108 @@
1
+ import { type DragState, type IDragAction } from "../drag/types.js";
2
+ import { type LayoutWindow } from "../types/index.js";
3
+ type __VLS_Props = {
4
+ additionalDragActions?: IDragAction[];
5
+ splitKeyHandler?: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
6
+ closeKeyHandler?: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
7
+ usageInstructions?: Record<string, string | undefined>;
8
+ instructionsTeleportTo: string | undefined;
9
+ /**
10
+ * You might need to temporarily disable updating the window size while transitioning, depending on your layout.
11
+ *
12
+ * For example, if the component is in a flex container, during transition, there will be two components, and it will suddenly jump in size to being 1/2 the height. We can avoid this by using the known height (from win), but to do so, we can't let this component update the size while transitioning.
13
+ *
14
+ * When this is turned back on again, it will trigger an update. You can also trigger updates manually with the exposed updateWindowSize function.
15
+ */
16
+ allowWindowSizeUpdate?: boolean;
17
+ };
18
+ declare function updateWindowSize(): void;
19
+ type __VLS_PublicProps = __VLS_Props & {
20
+ "win": LayoutWindow;
21
+ };
22
+ declare var __VLS_9: any, __VLS_10: {
23
+ frame: any;
24
+ }, __VLS_22: {};
25
+ type __VLS_Slots = {} & {
26
+ [K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
27
+ } & {
28
+ 'extra-decos'?: (props: typeof __VLS_22) => any;
29
+ };
30
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
31
+ state: import("vue").ComputedRef<{
32
+ dragDirections: {
33
+ horizontal: "up" | "down" | "left" | "right" | undefined;
34
+ vertical: "up" | "down" | "left" | "right" | undefined;
35
+ };
36
+ dragPoint: {
37
+ x: number;
38
+ y: number;
39
+ } | undefined;
40
+ isDragging: boolean;
41
+ draggingEdges: {
42
+ startX: number;
43
+ startY: number;
44
+ endX: number;
45
+ endY: number;
46
+ }[];
47
+ draggingIntersection: {
48
+ point: {
49
+ x: number;
50
+ y: number;
51
+ };
52
+ count: number;
53
+ sharesEdge: boolean;
54
+ sharedEdges: {
55
+ horizontal: {
56
+ startX: number;
57
+ startY: number;
58
+ endX: number;
59
+ endY: number;
60
+ }[];
61
+ vertical: {
62
+ startX: number;
63
+ startY: number;
64
+ endX: number;
65
+ endY: number;
66
+ }[];
67
+ };
68
+ isWindowEdge: boolean;
69
+ } | undefined;
70
+ visualEdges: {
71
+ startX: number;
72
+ startY: number;
73
+ endX: number;
74
+ endY: number;
75
+ }[];
76
+ touchingFrames: Record<string, import("../types/index.js").LayoutFrame>[];
77
+ touchingFramesArrays: import("../types/index.js").LayoutFrame[][];
78
+ frames: import("../types/index.js").LayoutFrames;
79
+ dragHoveredFrame: import("../types/index.js").LayoutFrame | undefined;
80
+ intersections: import("../types/index.js").IntersectionEntry[];
81
+ isDraggingFromWindowEdge: boolean;
82
+ win: import("../types/index.js").BaseLayoutWindow;
83
+ }>;
84
+ win: import("vue").ModelRef<import("../types/index.js").BaseLayoutWindow, string, import("../types/index.js").BaseLayoutWindow, import("../types/index.js").BaseLayoutWindow>;
85
+ updateWindowSize: typeof updateWindowSize;
86
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
87
+ "update:win": (value: import("../types/index.js").BaseLayoutWindow) => any;
88
+ } & {
89
+ isShowingDrag: (value: boolean) => any;
90
+ dragState: (value: DragState) => any;
91
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
92
+ onIsShowingDrag?: ((value: boolean) => any) | undefined;
93
+ onDragState?: ((value: DragState) => any) | undefined;
94
+ "onUpdate:win"?: ((value: import("../types/index.js").BaseLayoutWindow) => any) | undefined;
95
+ }>, {
96
+ additionalDragActions: IDragAction[];
97
+ splitKeyHandler: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
98
+ closeKeyHandler: (e: PointerEvent | KeyboardEvent, state: DragState) => boolean;
99
+ usageInstructions: Record<string, string | undefined>;
100
+ allowWindowSizeUpdate: boolean;
101
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
102
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
103
+ export default _default;
104
+ type __VLS_WithSlots<T, S> = T & {
105
+ new (): {
106
+ $slots: S;
107
+ };
108
+ };
@@ -0,0 +1,180 @@
1
+ import type { Ref } from "vue";
2
+ import type { DragChangeHandler, DragState } from "../drag/types.js";
3
+ import type { Edge, IntersectionEntry, LayoutFrame, LayoutWindow } from "../types/index.js";
4
+ export declare function useFrames(win: Ref<LayoutWindow>,
5
+ /** Whether to show merged the moved frames while dragging. */
6
+ showDragging: Ref<boolean>, handler: {
7
+ eventHandler: (e: KeyboardEvent, state: DragState, forceRecalculateEdges: () => void) => void;
8
+ /**
9
+ * Called when the drag coordinates change (during any event). Should return true to allow the edges to be moved, or false to prevent it.
10
+ *
11
+ * Can be used to save some context/info to later apply safely during onDragApply.
12
+ */
13
+ onDragChange: DragChangeHandler;
14
+ /**
15
+ * Called when drag will be applied. If dragEnd was called with apply false, it will not be called.
16
+ * Return false to not apply the regular drag end changes (i.e. return false to reset to the position before dragging).
17
+ */
18
+ onDragApply: ((state: DragState, forceRecalculateEdges: () => void) => boolean);
19
+ }): {
20
+ dragStart: (e: PointerEvent, { edge, intersection }: {
21
+ edge?: Edge;
22
+ intersection?: IntersectionEntry;
23
+ }) => void;
24
+ dragEnd: (e?: PointerEvent, { apply }?: {
25
+ apply?: boolean;
26
+ }) => void;
27
+ cancel: () => void;
28
+ dragDirections: Ref<{
29
+ horizontal: "up" | "down" | "left" | "right" | undefined;
30
+ vertical: "up" | "down" | "left" | "right" | undefined;
31
+ }, Record<"horizontal" | "vertical", "up" | "down" | "left" | "right" | undefined> | {
32
+ horizontal: "up" | "down" | "left" | "right" | undefined;
33
+ vertical: "up" | "down" | "left" | "right" | undefined;
34
+ }>;
35
+ dragPoint: Ref<{
36
+ x: number;
37
+ y: number;
38
+ } | undefined, {
39
+ x: number;
40
+ y: number;
41
+ } | undefined>;
42
+ isDragging: Ref<boolean, boolean>;
43
+ draggingEdges: Ref<{
44
+ startX: number;
45
+ startY: number;
46
+ endX: number;
47
+ endY: number;
48
+ }[], {
49
+ startX: number;
50
+ startY: number;
51
+ endX: number;
52
+ endY: number;
53
+ }[] | {
54
+ startX: number;
55
+ startY: number;
56
+ endX: number;
57
+ endY: number;
58
+ }[]>;
59
+ draggingIntersection: Ref<{
60
+ point: {
61
+ x: number;
62
+ y: number;
63
+ };
64
+ count: number;
65
+ sharesEdge: boolean;
66
+ sharedEdges: {
67
+ horizontal: {
68
+ startX: number;
69
+ startY: number;
70
+ endX: number;
71
+ endY: number;
72
+ }[];
73
+ vertical: {
74
+ startX: number;
75
+ startY: number;
76
+ endX: number;
77
+ endY: number;
78
+ }[];
79
+ };
80
+ isWindowEdge: boolean;
81
+ } | undefined, IntersectionEntry | {
82
+ point: {
83
+ x: number;
84
+ y: number;
85
+ };
86
+ count: number;
87
+ sharesEdge: boolean;
88
+ sharedEdges: {
89
+ horizontal: {
90
+ startX: number;
91
+ startY: number;
92
+ endX: number;
93
+ endY: number;
94
+ }[];
95
+ vertical: {
96
+ startX: number;
97
+ startY: number;
98
+ endX: number;
99
+ endY: number;
100
+ }[];
101
+ };
102
+ isWindowEdge: boolean;
103
+ } | undefined>;
104
+ visualEdges: Ref<{
105
+ startX: number;
106
+ startY: number;
107
+ endX: number;
108
+ endY: number;
109
+ }[], {
110
+ startX: number;
111
+ startY: number;
112
+ endX: number;
113
+ endY: number;
114
+ }[] | {
115
+ startX: number;
116
+ startY: number;
117
+ endX: number;
118
+ endY: number;
119
+ }[]>;
120
+ touchingFrames: Ref<Record<string, LayoutFrame>[], Record<string, LayoutFrame>[]>;
121
+ touchingFramesArrays: import("vue").ComputedRef<LayoutFrame[][]>;
122
+ frames: import("vue").ComputedRef<import("../types/index.js").LayoutFrames>;
123
+ dragHoveredFrame: import("vue").ComputedRef<LayoutFrame | undefined>;
124
+ intersections: import("vue").ComputedRef<IntersectionEntry[]>;
125
+ isDraggingFromWindowEdge: Ref<boolean, boolean>;
126
+ forceRecalculateEdges: () => void;
127
+ state: import("vue").ComputedRef<{
128
+ dragDirections: {
129
+ horizontal: "up" | "down" | "left" | "right" | undefined;
130
+ vertical: "up" | "down" | "left" | "right" | undefined;
131
+ };
132
+ dragPoint: {
133
+ x: number;
134
+ y: number;
135
+ } | undefined;
136
+ isDragging: boolean;
137
+ draggingEdges: {
138
+ startX: number;
139
+ startY: number;
140
+ endX: number;
141
+ endY: number;
142
+ }[];
143
+ draggingIntersection: {
144
+ point: {
145
+ x: number;
146
+ y: number;
147
+ };
148
+ count: number;
149
+ sharesEdge: boolean;
150
+ sharedEdges: {
151
+ horizontal: {
152
+ startX: number;
153
+ startY: number;
154
+ endX: number;
155
+ endY: number;
156
+ }[];
157
+ vertical: {
158
+ startX: number;
159
+ startY: number;
160
+ endX: number;
161
+ endY: number;
162
+ }[];
163
+ };
164
+ isWindowEdge: boolean;
165
+ } | undefined;
166
+ visualEdges: {
167
+ startX: number;
168
+ startY: number;
169
+ endX: number;
170
+ endY: number;
171
+ }[];
172
+ touchingFrames: Record<string, LayoutFrame>[];
173
+ touchingFramesArrays: LayoutFrame[][];
174
+ frames: import("../types/index.js").LayoutFrames;
175
+ dragHoveredFrame: LayoutFrame | undefined;
176
+ intersections: IntersectionEntry[];
177
+ isDraggingFromWindowEdge: boolean;
178
+ win: import("../types/index.js").BaseLayoutWindow;
179
+ }>;
180
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import type { LayoutFrame } from "../types/index.js";
2
+ type __VLS_Props = {
3
+ frames: LayoutFrame[];
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import type { LayoutFrame } from "../types/index.js";
2
+ type __VLS_Props = {
3
+ frames: LayoutFrame[];
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ /** @private */
2
+ import "./tailwind.css";
@@ -0,0 +1,6 @@
1
+ export declare const app: {
2
+ layout: {
3
+ activeWindow?: string | undefined;
4
+ windows: import("../types/index.js").LayoutWindows;
5
+ };
6
+ };
@@ -1 +1 @@
1
- @import "tailwindcss" source("../");@import "../../../playground/.nuxt/witchcraft-ui.css";@import "../../../playground/.nuxt/witchcraft-layout.css";
1
+ @import "tailwindcss";@import "../../../playground/.nuxt/witchcraft-ui.css";@import "../../../playground/.nuxt/witchcraft-layout.css";