@dynamix-layout/solid 1.0.1 → 1.0.3
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 +46 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +1 -1
- package/dist/index.es.js +460 -486
- package/dist/types/index.d.cts +190 -0
- package/dist/types/index.d.ts +190 -4
- package/package.json +27 -18
- package/dist/index.cjs.js +0 -1
- package/dist/types/components/Default.d.ts +0 -23
- package/dist/types/components/Layout.d.ts +0 -4
- package/dist/types/hooks/useLayout.d.ts +0 -34
- package/dist/types/types/index.d.ts +0 -100
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { Dimension } from '@dynamix-layout/core';
|
|
3
|
+
import { DynamixLayoutCore } from '@dynamix-layout/core';
|
|
4
|
+
import { JSX } from 'solid-js';
|
|
5
|
+
import { LayoutTree } from '@dynamix-layout/core';
|
|
6
|
+
import { NodeOptions } from '@dynamix-layout/core';
|
|
7
|
+
import { ParentComponent } from 'solid-js';
|
|
8
|
+
import { Setter } from 'solid-js';
|
|
9
|
+
|
|
10
|
+
export declare const DefaultHoverElement: (props: DivProps) => JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare const DefaultSliderElement: (props: {
|
|
13
|
+
direction?: boolean;
|
|
14
|
+
children?: JSX.Element;
|
|
15
|
+
} & DivProps) => JSX.Element;
|
|
16
|
+
|
|
17
|
+
export declare const DefaultWrapTabBody: (props: DivProps) => JSX.Element;
|
|
18
|
+
|
|
19
|
+
export declare const DefaultWrapTabHead: (props: DivProps) => JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare const DefaultWrapTabLabel: (props: DivProps) => JSX.Element;
|
|
22
|
+
|
|
23
|
+
export declare const DefaultWrapTabPanel: (props: DivProps) => JSX.Element;
|
|
24
|
+
|
|
25
|
+
export declare type DivFC = (props: {
|
|
26
|
+
children?: JSX.Element;
|
|
27
|
+
} & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
28
|
+
|
|
29
|
+
declare type DivProps = {
|
|
30
|
+
children?: JSX.Element;
|
|
31
|
+
active?: boolean;
|
|
32
|
+
} & JSX.HTMLAttributes<HTMLDivElement>;
|
|
33
|
+
|
|
34
|
+
export declare const DynamixLayout: ParentComponent<LayoutProps>;
|
|
35
|
+
|
|
36
|
+
export declare interface DynamixLayoutProps {
|
|
37
|
+
children?: JSX.Element;
|
|
38
|
+
layoutTree?: LayoutTree;
|
|
39
|
+
tabs?: string[];
|
|
40
|
+
class?: string;
|
|
41
|
+
style?: JSX.CSSProperties;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare const getTabOutput: (input: TabInput) => TabOutput;
|
|
45
|
+
|
|
46
|
+
export declare interface LayoutProps {
|
|
47
|
+
tabs: [string, JSX.Element][];
|
|
48
|
+
enableTabbar?: boolean;
|
|
49
|
+
WrapTabPanel?: DivFC;
|
|
50
|
+
WrapTabLabel?: (props: {
|
|
51
|
+
children?: JSX.Element;
|
|
52
|
+
active?: boolean;
|
|
53
|
+
} & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
54
|
+
WrapTabHead?: DivFC;
|
|
55
|
+
WrapTabBody?: DivFC;
|
|
56
|
+
HoverElement?: DivFC;
|
|
57
|
+
SliderElement?: (props: {
|
|
58
|
+
children?: JSX.Element;
|
|
59
|
+
direction?: boolean;
|
|
60
|
+
} & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
61
|
+
tabHeadHeight?: number;
|
|
62
|
+
layoutTree?: LayoutTree;
|
|
63
|
+
pad?: {
|
|
64
|
+
t: number;
|
|
65
|
+
b: number;
|
|
66
|
+
l: number;
|
|
67
|
+
r: number;
|
|
68
|
+
};
|
|
69
|
+
class?: string;
|
|
70
|
+
style?: JSX.CSSProperties;
|
|
71
|
+
bondWidth?: number;
|
|
72
|
+
/** In 2.0 this receives the v2 `LayoutJSON` format instead of `LayoutTree` (v1 layouts passed to `layoutTree` keep loading). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
|
|
73
|
+
updateJSON?: (layoutTree: LayoutTree) => void;
|
|
74
|
+
minTabHeight?: number;
|
|
75
|
+
minTabWidth?: number;
|
|
76
|
+
/** @deprecated No effect in 2.0: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
|
|
77
|
+
sliderUpdateTimeout?: number;
|
|
78
|
+
windowResizeTimeout?: number;
|
|
79
|
+
/** @deprecated No effect in 2.0: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
|
|
80
|
+
disableSliderTimeout?: boolean;
|
|
81
|
+
disableResizeTimeout?: boolean;
|
|
82
|
+
hoverElementStyles?: JSX.CSSProperties;
|
|
83
|
+
sliderElementStyles?: JSX.CSSProperties;
|
|
84
|
+
tabPanelElementStyles?: JSX.CSSProperties;
|
|
85
|
+
tabBodyElementStyles?: JSX.CSSProperties;
|
|
86
|
+
tabHeadElementStyles?: JSX.CSSProperties;
|
|
87
|
+
tabLabelElementStyles?: JSX.CSSProperties;
|
|
88
|
+
RootSplitterHoverElStyles?: JSX.CSSProperties;
|
|
89
|
+
hoverElementClass?: string;
|
|
90
|
+
sliderElementClass?: string;
|
|
91
|
+
tabPanelElementClass?: string;
|
|
92
|
+
tabBodyElementClass?: string;
|
|
93
|
+
tabHeadElementClass?: string;
|
|
94
|
+
tabLabelElementClass?: string;
|
|
95
|
+
RootSplitterHoverElClass?: string;
|
|
96
|
+
rootId?: string;
|
|
97
|
+
tabNames?: Map<string, string | JSX.Element>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare const RootSplitterHoverEl: (props: {
|
|
101
|
+
area: "left" | "right" | "top" | "bottom";
|
|
102
|
+
size?: {
|
|
103
|
+
w: string;
|
|
104
|
+
h: string;
|
|
105
|
+
};
|
|
106
|
+
gap?: string;
|
|
107
|
+
} & DivProps) => JSX.Element;
|
|
108
|
+
|
|
109
|
+
export declare type TabEntry = {
|
|
110
|
+
uqid: string;
|
|
111
|
+
name: string;
|
|
112
|
+
node: JSX.Element;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export declare type TabInput = [string, JSX.Element][];
|
|
116
|
+
|
|
117
|
+
export declare type TabOutput = {
|
|
118
|
+
keys: string[];
|
|
119
|
+
maps: Map<string, TabEntry>;
|
|
120
|
+
name: Map<string, string>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export declare const useDynamixLayout: ({ tabOutput, rootId, layoutTree, updateJSON, dimensions, tabHeadHeight, enableTabbar, bondWidth, minTabHeight, minTabWidth, sliderUpdateTimeout, windowResizeTimeout, disableSliderTimeout, disableResizeTimeout, }: useDynamixLayoutOptions) => {
|
|
124
|
+
tabsets: Accessor<Map<string, NodeOptions>>;
|
|
125
|
+
sliders: Accessor<Map<string, NodeOptions>>;
|
|
126
|
+
tabsetsRef: Map<string, HTMLDivElement>;
|
|
127
|
+
panelsRef: Map<string, HTMLDivElement>;
|
|
128
|
+
tabsRef: Map<string, HTMLDivElement>;
|
|
129
|
+
slidersRef: Map<string, HTMLDivElement>;
|
|
130
|
+
layoutJSON: Accessor<LayoutTree | undefined>;
|
|
131
|
+
layoutInstance: DynamixLayoutCore;
|
|
132
|
+
hoverElementRef: {
|
|
133
|
+
current: HTMLDivElement | undefined;
|
|
134
|
+
};
|
|
135
|
+
rootSplitHoverEl: HTMLDivElement[];
|
|
136
|
+
dragging: Accessor<boolean>;
|
|
137
|
+
isUpdating: Accessor<boolean>;
|
|
138
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
139
|
+
setIsUpdating: Setter<boolean>;
|
|
140
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
141
|
+
setDragging: Setter<boolean>;
|
|
142
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
143
|
+
setTabsets: Setter<Map<string, NodeOptions>>;
|
|
144
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
145
|
+
setSliders: Setter<Map<string, NodeOptions>>;
|
|
146
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
147
|
+
setLayoutJSON: Setter<LayoutTree | undefined>;
|
|
148
|
+
onDragStart: (e: DragEvent) => void;
|
|
149
|
+
onDragOver: (e: DragEvent) => void;
|
|
150
|
+
onDragEnd: () => void;
|
|
151
|
+
onDragEnter: (e: DragEvent) => void;
|
|
152
|
+
onDragLeave: (e: DragEvent) => void;
|
|
153
|
+
onDrop: (e: DragEvent) => void;
|
|
154
|
+
onPointerDown: (e: PointerEvent) => void;
|
|
155
|
+
updateActiveTab: (e: MouseEvent) => void;
|
|
156
|
+
handleRootSplit: (e: DragEvent) => void;
|
|
157
|
+
handleNavbarDragOver: (e: DragEvent) => void;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export declare interface UseDynamixLayoutOptions {
|
|
161
|
+
initialLayoutTree?: LayoutTree;
|
|
162
|
+
tabs?: string[];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare interface useDynamixLayoutOptions {
|
|
166
|
+
tabOutput: TabOutput;
|
|
167
|
+
rootId: string;
|
|
168
|
+
layoutTree?: LayoutTree;
|
|
169
|
+
updateJSON?: (layoutTree: LayoutTree) => void;
|
|
170
|
+
enableTabbar: boolean;
|
|
171
|
+
dimensions: () => Dimension;
|
|
172
|
+
sliderUpdateTimeout: number;
|
|
173
|
+
windowResizeTimeout: number;
|
|
174
|
+
disableSliderTimeout: boolean;
|
|
175
|
+
disableResizeTimeout: boolean;
|
|
176
|
+
hoverElementStyles?: JSX.CSSProperties;
|
|
177
|
+
bondWidth: number;
|
|
178
|
+
minTabHeight: number;
|
|
179
|
+
minTabWidth: number;
|
|
180
|
+
tabHeadHeight: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export declare interface UseDynamixLayoutResult {
|
|
184
|
+
layoutTree: LayoutTree | undefined;
|
|
185
|
+
tabs: string[];
|
|
186
|
+
setTabs: (tabs: string[]) => void;
|
|
187
|
+
setLayoutTree: (layoutTree: LayoutTree) => void;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { }
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,190 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { Dimension } from '@dynamix-layout/core';
|
|
3
|
+
import { DynamixLayoutCore } from '@dynamix-layout/core';
|
|
4
|
+
import { JSX } from 'solid-js';
|
|
5
|
+
import { LayoutTree } from '@dynamix-layout/core';
|
|
6
|
+
import { NodeOptions } from '@dynamix-layout/core';
|
|
7
|
+
import { ParentComponent } from 'solid-js';
|
|
8
|
+
import { Setter } from 'solid-js';
|
|
9
|
+
|
|
10
|
+
export declare const DefaultHoverElement: (props: DivProps) => JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare const DefaultSliderElement: (props: {
|
|
13
|
+
direction?: boolean;
|
|
14
|
+
children?: JSX.Element;
|
|
15
|
+
} & DivProps) => JSX.Element;
|
|
16
|
+
|
|
17
|
+
export declare const DefaultWrapTabBody: (props: DivProps) => JSX.Element;
|
|
18
|
+
|
|
19
|
+
export declare const DefaultWrapTabHead: (props: DivProps) => JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare const DefaultWrapTabLabel: (props: DivProps) => JSX.Element;
|
|
22
|
+
|
|
23
|
+
export declare const DefaultWrapTabPanel: (props: DivProps) => JSX.Element;
|
|
24
|
+
|
|
25
|
+
export declare type DivFC = (props: {
|
|
26
|
+
children?: JSX.Element;
|
|
27
|
+
} & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
28
|
+
|
|
29
|
+
declare type DivProps = {
|
|
30
|
+
children?: JSX.Element;
|
|
31
|
+
active?: boolean;
|
|
32
|
+
} & JSX.HTMLAttributes<HTMLDivElement>;
|
|
33
|
+
|
|
34
|
+
export declare const DynamixLayout: ParentComponent<LayoutProps>;
|
|
35
|
+
|
|
36
|
+
export declare interface DynamixLayoutProps {
|
|
37
|
+
children?: JSX.Element;
|
|
38
|
+
layoutTree?: LayoutTree;
|
|
39
|
+
tabs?: string[];
|
|
40
|
+
class?: string;
|
|
41
|
+
style?: JSX.CSSProperties;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare const getTabOutput: (input: TabInput) => TabOutput;
|
|
45
|
+
|
|
46
|
+
export declare interface LayoutProps {
|
|
47
|
+
tabs: [string, JSX.Element][];
|
|
48
|
+
enableTabbar?: boolean;
|
|
49
|
+
WrapTabPanel?: DivFC;
|
|
50
|
+
WrapTabLabel?: (props: {
|
|
51
|
+
children?: JSX.Element;
|
|
52
|
+
active?: boolean;
|
|
53
|
+
} & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
54
|
+
WrapTabHead?: DivFC;
|
|
55
|
+
WrapTabBody?: DivFC;
|
|
56
|
+
HoverElement?: DivFC;
|
|
57
|
+
SliderElement?: (props: {
|
|
58
|
+
children?: JSX.Element;
|
|
59
|
+
direction?: boolean;
|
|
60
|
+
} & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
61
|
+
tabHeadHeight?: number;
|
|
62
|
+
layoutTree?: LayoutTree;
|
|
63
|
+
pad?: {
|
|
64
|
+
t: number;
|
|
65
|
+
b: number;
|
|
66
|
+
l: number;
|
|
67
|
+
r: number;
|
|
68
|
+
};
|
|
69
|
+
class?: string;
|
|
70
|
+
style?: JSX.CSSProperties;
|
|
71
|
+
bondWidth?: number;
|
|
72
|
+
/** In 2.0 this receives the v2 `LayoutJSON` format instead of `LayoutTree` (v1 layouts passed to `layoutTree` keep loading). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
|
|
73
|
+
updateJSON?: (layoutTree: LayoutTree) => void;
|
|
74
|
+
minTabHeight?: number;
|
|
75
|
+
minTabWidth?: number;
|
|
76
|
+
/** @deprecated No effect in 2.0: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
|
|
77
|
+
sliderUpdateTimeout?: number;
|
|
78
|
+
windowResizeTimeout?: number;
|
|
79
|
+
/** @deprecated No effect in 2.0: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
|
|
80
|
+
disableSliderTimeout?: boolean;
|
|
81
|
+
disableResizeTimeout?: boolean;
|
|
82
|
+
hoverElementStyles?: JSX.CSSProperties;
|
|
83
|
+
sliderElementStyles?: JSX.CSSProperties;
|
|
84
|
+
tabPanelElementStyles?: JSX.CSSProperties;
|
|
85
|
+
tabBodyElementStyles?: JSX.CSSProperties;
|
|
86
|
+
tabHeadElementStyles?: JSX.CSSProperties;
|
|
87
|
+
tabLabelElementStyles?: JSX.CSSProperties;
|
|
88
|
+
RootSplitterHoverElStyles?: JSX.CSSProperties;
|
|
89
|
+
hoverElementClass?: string;
|
|
90
|
+
sliderElementClass?: string;
|
|
91
|
+
tabPanelElementClass?: string;
|
|
92
|
+
tabBodyElementClass?: string;
|
|
93
|
+
tabHeadElementClass?: string;
|
|
94
|
+
tabLabelElementClass?: string;
|
|
95
|
+
RootSplitterHoverElClass?: string;
|
|
96
|
+
rootId?: string;
|
|
97
|
+
tabNames?: Map<string, string | JSX.Element>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare const RootSplitterHoverEl: (props: {
|
|
101
|
+
area: "left" | "right" | "top" | "bottom";
|
|
102
|
+
size?: {
|
|
103
|
+
w: string;
|
|
104
|
+
h: string;
|
|
105
|
+
};
|
|
106
|
+
gap?: string;
|
|
107
|
+
} & DivProps) => JSX.Element;
|
|
108
|
+
|
|
109
|
+
export declare type TabEntry = {
|
|
110
|
+
uqid: string;
|
|
111
|
+
name: string;
|
|
112
|
+
node: JSX.Element;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export declare type TabInput = [string, JSX.Element][];
|
|
116
|
+
|
|
117
|
+
export declare type TabOutput = {
|
|
118
|
+
keys: string[];
|
|
119
|
+
maps: Map<string, TabEntry>;
|
|
120
|
+
name: Map<string, string>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export declare const useDynamixLayout: ({ tabOutput, rootId, layoutTree, updateJSON, dimensions, tabHeadHeight, enableTabbar, bondWidth, minTabHeight, minTabWidth, sliderUpdateTimeout, windowResizeTimeout, disableSliderTimeout, disableResizeTimeout, }: useDynamixLayoutOptions) => {
|
|
124
|
+
tabsets: Accessor<Map<string, NodeOptions>>;
|
|
125
|
+
sliders: Accessor<Map<string, NodeOptions>>;
|
|
126
|
+
tabsetsRef: Map<string, HTMLDivElement>;
|
|
127
|
+
panelsRef: Map<string, HTMLDivElement>;
|
|
128
|
+
tabsRef: Map<string, HTMLDivElement>;
|
|
129
|
+
slidersRef: Map<string, HTMLDivElement>;
|
|
130
|
+
layoutJSON: Accessor<LayoutTree | undefined>;
|
|
131
|
+
layoutInstance: DynamixLayoutCore;
|
|
132
|
+
hoverElementRef: {
|
|
133
|
+
current: HTMLDivElement | undefined;
|
|
134
|
+
};
|
|
135
|
+
rootSplitHoverEl: HTMLDivElement[];
|
|
136
|
+
dragging: Accessor<boolean>;
|
|
137
|
+
isUpdating: Accessor<boolean>;
|
|
138
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
139
|
+
setIsUpdating: Setter<boolean>;
|
|
140
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
141
|
+
setDragging: Setter<boolean>;
|
|
142
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
143
|
+
setTabsets: Setter<Map<string, NodeOptions>>;
|
|
144
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
145
|
+
setSliders: Setter<Map<string, NodeOptions>>;
|
|
146
|
+
/** @deprecated Internal state setter; will be removed in v2. */
|
|
147
|
+
setLayoutJSON: Setter<LayoutTree | undefined>;
|
|
148
|
+
onDragStart: (e: DragEvent) => void;
|
|
149
|
+
onDragOver: (e: DragEvent) => void;
|
|
150
|
+
onDragEnd: () => void;
|
|
151
|
+
onDragEnter: (e: DragEvent) => void;
|
|
152
|
+
onDragLeave: (e: DragEvent) => void;
|
|
153
|
+
onDrop: (e: DragEvent) => void;
|
|
154
|
+
onPointerDown: (e: PointerEvent) => void;
|
|
155
|
+
updateActiveTab: (e: MouseEvent) => void;
|
|
156
|
+
handleRootSplit: (e: DragEvent) => void;
|
|
157
|
+
handleNavbarDragOver: (e: DragEvent) => void;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export declare interface UseDynamixLayoutOptions {
|
|
161
|
+
initialLayoutTree?: LayoutTree;
|
|
162
|
+
tabs?: string[];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare interface useDynamixLayoutOptions {
|
|
166
|
+
tabOutput: TabOutput;
|
|
167
|
+
rootId: string;
|
|
168
|
+
layoutTree?: LayoutTree;
|
|
169
|
+
updateJSON?: (layoutTree: LayoutTree) => void;
|
|
170
|
+
enableTabbar: boolean;
|
|
171
|
+
dimensions: () => Dimension;
|
|
172
|
+
sliderUpdateTimeout: number;
|
|
173
|
+
windowResizeTimeout: number;
|
|
174
|
+
disableSliderTimeout: boolean;
|
|
175
|
+
disableResizeTimeout: boolean;
|
|
176
|
+
hoverElementStyles?: JSX.CSSProperties;
|
|
177
|
+
bondWidth: number;
|
|
178
|
+
minTabHeight: number;
|
|
179
|
+
minTabWidth: number;
|
|
180
|
+
tabHeadHeight: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export declare interface UseDynamixLayoutResult {
|
|
184
|
+
layoutTree: LayoutTree | undefined;
|
|
185
|
+
tabs: string[];
|
|
186
|
+
setTabs: (tabs: string[]) => void;
|
|
187
|
+
setLayoutTree: (layoutTree: LayoutTree) => void;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamix-layout/solid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A powerful SolidJS component for creating dynamic, resizable, and draggable layouts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"solid",
|
|
@@ -26,25 +26,32 @@
|
|
|
26
26
|
],
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/xcode-studio/dynamix-layout",
|
|
29
|
+
"url": "git+https://github.com/xcode-studio/dynamix-layout.git",
|
|
30
30
|
"directory": "packages/solid"
|
|
31
31
|
},
|
|
32
32
|
"bugs": {
|
|
33
33
|
"url": "https://github.com/xcode-studio/dynamix-layout/issues"
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/xcode-studio/dynamix-layout#readme",
|
|
36
|
-
"main": "./dist/index.cjs
|
|
36
|
+
"main": "./dist/index.cjs",
|
|
37
37
|
"module": "./dist/index.es.js",
|
|
38
38
|
"types": "./dist/types/index.d.ts",
|
|
39
39
|
"typings": "./dist/types/index.d.ts",
|
|
40
40
|
"style": "./dist/index.css",
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/types/index.d.ts",
|
|
45
|
+
"default": "./dist/index.es.js"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/types/index.d.cts",
|
|
49
|
+
"default": "./dist/index.cjs"
|
|
50
|
+
}
|
|
46
51
|
},
|
|
47
|
-
"./style.css": "./dist/index.css"
|
|
52
|
+
"./style.css": "./dist/index.css",
|
|
53
|
+
"./styles.css": "./dist/index.css",
|
|
54
|
+
"./package.json": "./package.json"
|
|
48
55
|
},
|
|
49
56
|
"files": [
|
|
50
57
|
"dist",
|
|
@@ -61,24 +68,26 @@
|
|
|
61
68
|
},
|
|
62
69
|
"type": "module",
|
|
63
70
|
"engines": {
|
|
64
|
-
"node": ">=
|
|
65
|
-
"pnpm": ">=10.13.1"
|
|
71
|
+
"node": ">=18"
|
|
66
72
|
},
|
|
67
73
|
"license": "MIT",
|
|
68
74
|
"devDependencies": {
|
|
69
75
|
"@solidjs/testing-library": "^0.8.10",
|
|
70
|
-
"@testing-library/jest-dom": "^6.
|
|
76
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
71
77
|
"jsdom": "^26.1.0",
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"vite": "^7.
|
|
74
|
-
"vite-plugin-solid": "2.11.
|
|
75
|
-
"vitest": "^
|
|
76
|
-
"
|
|
77
|
-
"@repo/typescript-config": "0.0.0"
|
|
78
|
+
"typescript": "^5.9.3",
|
|
79
|
+
"vite": "^7.3.6",
|
|
80
|
+
"vite-plugin-solid": "2.11.14",
|
|
81
|
+
"vitest": "^4.1.11",
|
|
82
|
+
"solid-js": "^1.9.15",
|
|
83
|
+
"@repo/typescript-config": "0.0.0",
|
|
84
|
+
"@repo/eslint-config": "0.0.0"
|
|
78
85
|
},
|
|
79
86
|
"dependencies": {
|
|
80
|
-
"
|
|
81
|
-
|
|
87
|
+
"@dynamix-layout/core": "1.1.1"
|
|
88
|
+
},
|
|
89
|
+
"peerDependencies": {
|
|
90
|
+
"solid-js": "^1.8.0"
|
|
82
91
|
},
|
|
83
92
|
"scripts": {
|
|
84
93
|
"dev": "vite build --watch",
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("solid-js/web"),m=require("@dynamix-layout/core"),T=require("solid-js");var M=a.template("<div>"),ze=a.template("<div><div>"),We=a.template('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="lucide lucide-grip-vertical size-2.5"><circle cx=9 cy=12 r=1></circle><circle cx=9 cy=5 r=1></circle><circle cx=9 cy=19 r=1></circle><circle cx=15 cy=12 r=1></circle><circle cx=15 cy=5 r=1></circle><circle cx=15 cy=19 r=1>'),Ie=a.template('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><circle cx=9 cy=12 r=1></circle><circle cx=9 cy=5 r=1></circle><circle cx=9 cy=19 r=1></circle><circle cx=15 cy=12 r=1></circle><circle cx=15 cy=5 r=1></circle><circle cx=15 cy=19 r=1>');const fe=r=>(()=>{var i=M();return a.spread(i,a.mergeProps(r,{get class(){return`DefaultWrapTabLabel ${r.class||""}`},get"data-state"(){return r.active?"active":"inactive"},get style(){return{"align-self":"center",padding:"4px 6px","box-sizing":"border-box","font-size":"14px","border-radius":"4px",...r.style}}}),!1,!0),a.insert(i,()=>r.children),i})(),he=r=>(()=>{var i=M();return a.spread(i,a.mergeProps(r,{get class(){return`DefaultWrapTabBody hide-scrollbar ${r.class||""}`},get style(){return{"box-sizing":"border-box",height:"100%",width:"100%",display:"grid",overflow:"auto","scrollbar-width":"none","-ms-overflow-style":"none",...r.style}}}),!1,!0),a.insert(i,()=>r.children),i})(),me=r=>(()=>{var i=M();return a.spread(i,a.mergeProps(r,{get class(){return`DefaultWrapTabHead hide-scrollbar ${r.class||""}`},get style(){return{display:"grid","grid-auto-flow":"column","justify-content":"start","align-items":"center",gap:"6px","padding-left":"8px",width:"100%","box-sizing":"border-box",height:"100%","place-items":"self-start",overflow:"auto","background-color":"#dfdfdf","scrollbar-width":"none","-ms-overflow-style":"none",...r.style}}}),!1,!0),a.insert(i,()=>r.children),i})(),ye=r=>(()=>{var i=M();return a.spread(i,a.mergeProps(r,{get class(){return`DefaultWrapTabPanel ${r.class||""}`},get style(){return{display:"grid","align-items":"center","place-items":"self-start","box-sizing":"border-box",position:"absolute","border-radius":"8px",...r.style}}}),!1,!0),a.insert(i,()=>r.children),i})(),pe=r=>(()=>{var i=M();return a.spread(i,a.mergeProps(r,{get class(){return`DefaultHoverElement ${r.class||""}`},get style(){return{display:"flex","justify-content":"center","align-items":"center",opacity:.7,position:"absolute","box-sizing":"border-box","font-weight":"bold","pointer-events":"none","background-color":"rgba(0, 175, 249, 0.5)","border-radius":"10px",transition:"all 0.2s ease",border:"2px dashed rgb(0, 196, 42)",...r.style}}}),!1,!0),a.insert(i,()=>r.children),i})(),be=r=>(()=>{var i=ze(),p=i.firstChild;return a.spread(i,a.mergeProps(r,{get class(){return`DefaultSliderElement ${r.class||""}`},get style(){return{width:"100%",height:"100%",position:"absolute","box-sizing":"border-box","background-color":"white","z-index":9,cursor:"grab",...r.style}}}),!1,!0),p.style.setProperty("display","flex"),p.style.setProperty("align-items","center"),p.style.setProperty("gap","4px"),p.style.setProperty("height","100%"),a.insert(p,(()=>{var b=a.memo(()=>!r.direction);return()=>b()?We():(()=>{var c=Ie();return c.style.setProperty("transform","rotate(90deg)"),c})()})()),a.insert(i,()=>r.children,null),a.effect(b=>(b=r.direction?"column":"row")!=null?p.style.setProperty("flex-direction",b):p.style.removeProperty("flex-direction")),i})(),xe=r=>{const[i,p]=T.splitProps(r,["area","size","gap","class","style","children"]),b=T.createMemo(()=>{const c=i.size||{h:"20%",w:"6px"},C=i.gap||"0px",y={};return i.area==="left"?(Object.assign(y,{"border-top-right-radius":"16px","border-bottom-right-radius":"16px",height:c.h,left:C,width:c.w}),y.top=`calc(50% - ${c.h} / 2)`):i.area==="top"?(Object.assign(y,{"border-bottom-left-radius":"16px","border-bottom-right-radius":"16px",width:c.h,top:C,height:c.w}),y.left=`calc(50% - ${c.h} / 2)`):i.area==="right"?(Object.assign(y,{"border-top-left-radius":"16px","border-bottom-left-radius":"16px",height:c.h,right:C,width:c.w}),y.top=`calc(50% - ${c.h} / 2)`):i.area==="bottom"&&(Object.assign(y,{"border-top-left-radius":"16px","border-top-right-radius":"16px",width:c.h,bottom:C,height:c.w}),y.left=`calc(50% - ${c.h} / 2)`),y});return(()=>{var c=M();return a.spread(c,a.mergeProps(p,{get class(){return`RootSplitterHoverEl ${i.class||""}`},get style(){return{position:"absolute","z-index":-1,display:"none","box-sizing":"border-box","background-color":"#0081f9",cursor:"grab",...i.style,...b()}}}),!1,!0),a.insert(c,()=>i.children),c})()},ve=({tabOutput:r,rootId:i,layoutTree:p,updateJSON:b,dimensions:c,tabHeadHeight:C,enableTabbar:y,bondWidth:te,minTabHeight:re,minTabWidth:k,sliderUpdateTimeout:ne,windowResizeTimeout:K,disableSliderTimeout:j,disableResizeTimeout:F})=>{const B=new Map,U=new Map,A=new Map,G=new Map,R={current:void 0},q=[],[V,ae]=T.createSignal(p),[Q,I]=T.createSignal(new Map),[oe,Z]=T.createSignal(new Map),[ie,H]=T.createSignal(!1);let L=null;const[se,E]=T.createSignal(!1),s={src:void 0,des:void 0,area:void 0,drag:!1},o={sliderId:void 0,isSliding:!1},u=new m.DynamixLayoutCore({tabs:r.keys,tree:V(),minW:k,minH:re,bond:te,uqid:i,tabsIds:r.name}),x=n=>{const e=new Map(n);I(e)},de=n=>{const e=new Map(n);Z(e)},X=()=>{m.Node.cache.tabOpts.get().forEach((e,l)=>{const t=G.get(l);t&&(t.style.width=`${e.nodDims.w}px`,t.style.height=y?`${e.nodDims.h-C}px`:`${e.nodDims.h}px`,t.style.left=`${e.nodDims.x}px`,t.style.top=y?`${e.nodDims.y+C}px`:`${e.nodDims.y}px`,t.style.display=e.nodOpen?"block":"none")})},De=()=>{m.Node.cache.bndOpts.get().forEach((e,l)=>{const t=U.get(l);t&&(t.style.width=`${e.nodDims.w}px`,t.style.height=`${e.nodDims.h}px`,t.style.left=`${e.nodDims.x}px`,t.style.top=`${e.nodDims.y}px`)})};m.Node.cache.nodOpts.onChange(n=>{n.forEach((e,l)=>{const t=A.get(l);t&&(t.style.width=`${e.nodDims.w}px`,t.style.height=`${e.nodDims.h}px`,t.style.left=`${e.nodDims.x}px`,t.style.top=`${e.nodDims.y}px`);const d=B.get(l);d&&y&&(d.style.width=`${e.nodDims.w}px`,d.style.height=y?`${C}px`:"0px",d.style.left=`${e.nodDims.x}px`,d.style.top=`${e.nodDims.y}px`)})}),m.Node.cache.bndOpts.onChange(n=>{n.forEach((e,l)=>{const t=U.get(l);t&&(t.style.width=`${e.nodDims.w}px`,t.style.height=`${e.nodDims.h}px`,t.style.left=`${e.nodDims.x}px`,t.style.top=`${e.nodDims.y}px`)})});const ce=n=>{o.isSliding&&(u.updateSlider(o.sliderId,{x:n.clientX,y:n.clientY},j,ne),De(),X())},ee=n=>{if(!o.isSliding)return;const e=n.currentTarget;o.isSliding=!1,o.sliderId=void 0,b&&b(m.DynamixLayoutCore._root.toJSON()),e.releasePointerCapture(n.pointerId),e.removeEventListener("pointermove",ce),e.removeEventListener("pointerup",ee),e.removeEventListener("pointercancel",ee)},Te=n=>{n.preventDefault();const e=n.currentTarget;o.isSliding=!0,o.sliderId=e.id,e.setPointerCapture(n.pointerId),e.addEventListener("pointermove",ce),e.addEventListener("pointerup",ee),e.addEventListener("pointercancel",ee)},h={},Ee=(n,e,l)=>{if(!R.current||!s||!l)return null;s.des=l;const t=l.getBoundingClientRect();if(!t)return null;const d=t.width,g=t.height,f=n-t.left,w=e-t.top;let v,$,N,D,P;f<d/3?(v="left",$=t.left,N=t.top,D=d/2,P=g):f>2*d/3?(v="right",$=t.left+d/2,N=t.top,D=d/2,P=g):w<g/3?(v="top",$=t.left,N=t.top,D=d,P=g/2):w>2*g/3?(v="bottom",$=t.left,N=t.top+g/2,D=d,P=g/2):(v="contain",$=t.left+d*.1,N=t.top+g*.1,D=d*.8,P=g*.8),(h.area!==v||h.left!==$||h.top!==N||h.width!==D||h.height!==P)&&(Y($,N,D,P,v),h.area=v,h.left=$,h.top=N,h.width=D,h.height=P),s.area=v},$e=n=>{n.preventDefault(),n.stopPropagation(),n.dataTransfer&&(n.dataTransfer.dropEffect="move");const e=n.currentTarget,l=Array.from(e.childNodes),t=n.clientX,d=n.clientY;if(!R.current||!s||l.length===0)return;const g=l[0].parentElement;if(!g)return;const f=g.getBoundingClientRect(),w=l[0],v=l[l.length-1],$=w.getBoundingClientRect(),N=v.getBoundingClientRect();let D=6;if(d<f.top||d>f.bottom)return;if(t>N.right){const S=N.right+1,O=N.top,z=D-2,W=N.height,_="right";Y(S,O,z,W,_),s.des=v,s.area=_;return}if(t<$.left){const S=$.left-D+1,O=$.top,z=D-2,W=$.height,_="left";Y(S,O,z,W,_),s.des=w,s.area=_;return}let P=null,ue=1/0,J=!1,le=0;for(let S=0;S<l.length;S++){const O=l[S].getBoundingClientRect(),z=O.left+O.width/2,W=Math.abs(t-z);W<ue&&(ue=W,P=l[S],J=t<z,le=S)}if(l.length>1&&(J&&le>0||!J&&le<l.length-1)&&(D=l[1].getBoundingClientRect().left-$.right),P){const S=P.getBoundingClientRect(),O=J?S.left-D+1:S.right+1,z=S.top,W=D-2,_=S.height,ge=J?"left":"right";Y(O,z,W,_,ge),s.des=P,s.area=ge}},Se=n=>{n.preventDefault(),n.stopPropagation(),n.dataTransfer&&(n.dataTransfer.dropEffect="move");const e=n.currentTarget.dataset.area,l=n.currentTarget.dataset.uid;if(!e||!l||!R.current||!s)return;s.des=n.currentTarget,s.area=e;const t=c();let d=t.x,g=t.y,f=t.w,w=t.h;e==="left"?(d=t.x,g=t.y,f=t.w/2,w=t.h):e==="right"?(d=t.x+t.w/2,g=t.y,f=t.w/2,w=t.h):e==="top"?(d=t.x,g=t.y,f=t.w,w=t.h/2):e==="bottom"&&(d=t.x,g=t.y+t.h/2,f=t.w,w=t.h/2),Y(d,g,f,w,e)},Y=(n,e,l,t,d)=>{if(h.area!==d||h.left!==n||h.top!==e||h.width!==l||h.height!==t){const g=R.current;if(g){const f={};for(let w=0;w<g.style.length;w++){const v=g.style[w];v&&(f[v]=g.style.getPropertyValue(v))}Object.assign(g.style,f,{left:`${n}px`,top:`${e}px`,width:`${l}px`,height:`${t}px`,display:"block","z-index":"100"}),h.area=d,h.left=n,h.top=e,h.width=l,h.height=t}}},Ce=n=>{if(n.stopPropagation(),H(!0),document.body.style.cursor="move",n.currentTarget){if(n.dataTransfer){n.dataTransfer.effectAllowed="move";const e=document.createElement("div");e.style.width="1px",e.style.height="1px",e.style.backgroundColor="transparent",e.style.position="absolute",e.style.top="-1000px",document.body.appendChild(e),n.dataTransfer.setDragImage(e,0,0),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},0)}q.forEach(e=>{e&&(e.style.display="block",e.style.zIndex="99")}),A.forEach(e=>{e&&(e.style.display="block",e.style.zIndex="95")}),s.src=n.currentTarget,s.drag=!0}},Ne=n=>{if(n.preventDefault(),n.stopPropagation(),document.body.style.cursor="move",n.dataTransfer&&(n.dataTransfer.dropEffect="move"),!s?.src)return;const e=n.currentTarget,l=n.clientX,t=n.clientY;L&&cancelAnimationFrame(L),L=requestAnimationFrame(()=>{Ee(l,t,e)})},Pe=n=>{if(document.body.style.cursor="default",q.forEach(e=>{e&&(e.style.display="none",e.style.zIndex="-1")}),L&&(cancelAnimationFrame(L),L=null),R.current&&(R.current.style.display="none",R.current.style.zIndex="-1"),Object.assign(h,{}),s.drag=!1,!s?.src||!s?.des){s.area=void 0,s.src=void 0,s.des=void 0,H(!1);return}if(s.src===s.des){s.area=void 0,s.src=void 0,s.des=void 0,H(!1);return}if(s.src&&s.des){if(!s.area){console.warn("No area specified for drag and drop"),H(!1);return}if(!u.updateTree(s.src.dataset.uid,s.des.dataset.uid,s.area||"contain")){console.warn("Failed to update layout tree"),H(!1);return}requestAnimationFrame(()=>{x(m.Node.cache.nodOpts.get()),de(m.Node.cache.bndOpts.get()),X(),b&&b(m.DynamixLayoutCore._root.toJSON())})}s.area=void 0,s.src=void 0,s.des=void 0,H(!1)},Re=n=>{n.preventDefault(),n.stopPropagation(),n.dataTransfer&&(n.dataTransfer.dropEffect="move")},Le=n=>{n.preventDefault(),n.stopPropagation()},He=n=>{n.preventDefault(),n.stopPropagation(),n.dataTransfer&&n.dataTransfer.getData("text/plain")},Oe=n=>{const e=n.currentTarget,l=e.dataset.uid;if(!l)return;const t=m.Node.cache.mapElem.get(l);if(!(t instanceof m.Node)){console.warn(`Element with uid ${l} is not a Node instance`);return}if(!t||!t.host||!t.host.unId){console.warn(`Node with uid ${l} not found in mapNode`);return}if(t.host.open==t.name){console.warn(`Node ${t.name} is already open`);return}const d=m.Node.cache.nodOpts.get().get(t.host.unId);if(!d||d.nodOpen&&t?.open)return;t.host.open=t.name,d.nodOpen=t.name,d.nodKids?.forEach(f=>{f.nodOpen=f.nodName===t.name}),e?.parentElement?.childNodes?.forEach(f=>{f instanceof HTMLDivElement&&f.dataset.uid!==l?f.dataset.state="inactive":f.dataset.state="active"}),X()};return T.onMount(()=>{const n=l=>{u.updateDimension(c(),l,K),X()};n(!0);const e=()=>n(F??!1);window.addEventListener("resize",e),x(m.Node.cache.nodOpts.get()),de(m.Node.cache.bndOpts.get()),X(),b&&b(m.DynamixLayoutCore._root.toJSON()),T.onCleanup(()=>{window.removeEventListener("resize",e),L&&cancelAnimationFrame(L)})}),{tabsets:Q,sliders:oe,tabsetsRef:B,panelsRef:A,tabsRef:G,slidersRef:U,layoutJSON:V,layoutInstance:u,hoverElementRef:R,rootSplitHoverEl:q,dragging:ie,isUpdating:se,setIsUpdating:E,setDragging:H,setTabsets:I,setSliders:Z,setLayoutJSON:ae,onDragStart:Ce,onDragOver:Ne,onDragEnd:Pe,onDragEnter:Re,onDragLeave:Le,onDrop:He,onPointerDown:Te,updateActiveTab:Oe,handleRootSplit:Se,handleNavbarDragOver:$e}};var _e=a.template("<div>"),ke=a.template('<div class="flex items-center justify-center h-full"><span class=text-gray-500>No content');const we=r=>{const i=[],p=new Map,b=new Map;for(const[c,C]of r){const y=crypto.randomUUID();i.push(c),p.set(c,{uqid:y,name:c,node:C}),b.set(c,y)}return{keys:i,maps:p,name:b}},Be=r=>{const i=T.createMemo(()=>we(r.tabs));let p;const b=()=>{const E=p;if(!E)return{w:0,h:0,x:0,y:0};const s=E.getBoundingClientRect(),o=r.pad||{t:0,b:0,l:0,r:0};return{w:s.width-(o.l+o.r),h:s.height-(o.t+o.b),x:s.left+o.l,y:s.top+o.t}},{tabsetsRef:c,slidersRef:C,sliders:y,tabsets:te,hoverElementRef:re,onDragEnd:k,onDragOver:ne,onDragStart:K,onDragEnter:j,onDragLeave:F,onDrop:B,dragging:U,panelsRef:A,onPointerDown:G,handleNavbarDragOver:R,updateActiveTab:q,rootSplitHoverEl:V,handleRootSplit:ae,tabsRef:Q,isUpdating:I}=ve({tabOutput:i(),rootId:r.rootId||"dynamix-layout-root",updateJSON:r.updateJSON,enableTabbar:r.enableTabbar===void 0?!0:r.enableTabbar,layoutTree:r.layoutTree,tabHeadHeight:r.tabHeadHeight||m.DynamixLayoutCore._minH,dimensions:b,sliderUpdateTimeout:r.sliderUpdateTimeout||2,windowResizeTimeout:r.windowResizeTimeout||2,bondWidth:r.bondWidth||m.DynamixLayoutCore._bond,minTabHeight:r.minTabHeight||m.DynamixLayoutCore._minH,minTabWidth:r.minTabWidth||m.DynamixLayoutCore._minW,disableSliderTimeout:r.disableSliderTimeout===void 0?!0:r.disableSliderTimeout,disableResizeTimeout:r.disableResizeTimeout===void 0?!0:r.disableResizeTimeout,hoverElementStyles:r.hoverElementStyles}),oe=r.WrapTabPanel||ye,Z=r.WrapTabHead||me,ie=r.WrapTabLabel||fe,H=r.WrapTabBody||he,L=r.SliderElement||be,se=r.HoverElement||pe;return(()=>{var E=_e(),s=p;return typeof s=="function"?a.use(s,E):p=E,a.spread(E,a.mergeProps({get id(){return r.rootId||"dynamix-layout-root"}},r,{get"data-testid"(){return r.rootId||"dynamix-layout-root"},get class(){return U()?"is-dragging":""},get style(){return{position:"relative",width:"100%",height:"100%",overflow:"hidden",...r.style}}}),!1,!0),a.insert(E,a.createComponent(T.For,{get each(){return Array.from(te().values())},children:o=>[a.createComponent(oe,{ref:u=>{const x=o.uidNode;u?A.set(x,u):A.delete(x)},onDragEnd:k,onDragOver:ne,onDragEnter:j,onDragLeave:F,onDrop:B,get"data-uid"(){return o.uidNode},get"data-type"(){return o.typNode},get class(){return"hide-scrollbar DefaultWrapTabPanel "+(r.tabPanelElementClass||"")},get style(){return{position:"absolute",...r.tabPanelElementStyles,width:`${o.nodDims.w}px`,height:`${o.nodDims.h}px`,left:`${o.nodDims.x}px`,top:`${o.nodDims.y}px`,"background-color":"transparent"}}}),a.createComponent(Z,{get draggable(){return!I()},get"data-uid"(){return o.uidNode},"data-type":"tabset",onDragOver:R,onDragStart:K,onDragEnd:k,onDragEnter:j,onDragLeave:F,onDrop:B,ref:u=>{const x=o.uidNode;u?c.set(x,u):c.delete(x)},get class(){return"hide-scrollbar "+(r.tabHeadElementClass||"")},get style(){return{...r.tabHeadElementStyles,position:"absolute","z-index":99,width:`${o.nodDims.w}px`,height:`${r.tabHeadHeight||m.DynamixLayoutCore._minH}px`,left:`${o.nodDims.x}px`,top:`${o.nodDims.y}px`,cursor:I()?"wait":"pointer"}},get children(){return a.createComponent(T.For,{get each(){return o.nodKids},children:u=>a.createComponent(ie,{get"data-uid"(){return u.uidNode},"data-type":"tab",onDragStart:K,onDragEnd:k,get draggable(){return!I()},get active(){return!!u.nodOpen},get class(){return"hide-scrollbar "+(r.tabLabelElementClass||"")},get style(){return{cursor:I()?"wait":"pointer",...r.tabLabelElementStyles}},onClick:q,get children(){return a.memo(()=>!!r.tabNames)()&&r.tabNames.get(u.nodName)||u.nodName}})})}})]}),null),a.insert(E,a.createComponent(T.For,{get each(){return i().keys},children:o=>{const u=i().maps.get(o)?.uqid;return a.createComponent(H,{id:u,draggable:!1,"data-uid":u,get class(){return"hide-scrollbar "+(r.tabBodyElementClass||"")},get style(){return{position:"absolute","z-index":90,"overscroll-behavior":"contain",...r.tabBodyElementStyles}},ref:x=>{u&&(x?Q.set(u,x):Q.delete(u))},get children(){return i().maps.get(o)?.node||ke()}})}}),null),a.insert(E,a.createComponent(T.For,{get each(){return Array.from(y().values())},children:o=>a.createComponent(L,{get id(){return o.uidNode},get"data-uid"(){return o.uidNode},get direction(){return o.nodeDir},onPointerDown:G,get class(){return"hide-scrollbar "+(r.sliderElementClass||"")},ref:u=>{const x=o.uidNode;u?C.set(x,u):C.delete(x)},get style(){return{width:`${o.nodDims.w}px`,height:`${o.nodDims.h}px`,left:`${o.nodDims.x}px`,top:`${o.nodDims.y}px`,cursor:o.nodeDir?"ns-resize":"ew-resize",...r.sliderElementStyles}}})}),null),a.insert(E,a.createComponent(se,{get class(){return"hide-scrollbar "+(r.hoverElementClass||"")},get style(){return{...r.hoverElementStyles}},ref:o=>re.current=o}),null),a.insert(E,a.createComponent(T.For,{each:["left","right","top","bottom"],children:(o,u)=>a.createComponent(xe,{onDragOver:ae,onDragEnd:k,onDragEnter:j,onDragLeave:F,onDrop:B,get"data-uid"(){return r.rootId||"dynamix-layout-root"},"data-area":o,get class(){return"hide-scrollbar "+(r.RootSplitterHoverElClass||"")},ref:x=>{x&&(V[u()]=x)},get style(){return{...r.RootSplitterHoverElStyles}},area:o,size:{h:"25%",w:"8px"}})}),null),E})()};exports.DefaultHoverElement=pe;exports.DefaultSliderElement=be;exports.DefaultWrapTabBody=he;exports.DefaultWrapTabHead=me;exports.DefaultWrapTabLabel=fe;exports.DefaultWrapTabPanel=ye;exports.DynamixLayout=Be;exports.RootSplitterHoverEl=xe;exports.getTabOutput=we;exports.useDynamixLayout=ve;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'solid-js';
|
|
2
|
-
type DivProps = {
|
|
3
|
-
children?: JSX.Element;
|
|
4
|
-
active?: boolean;
|
|
5
|
-
} & JSX.HTMLAttributes<HTMLDivElement>;
|
|
6
|
-
export declare const DefaultWrapTabLabel: (props: DivProps) => JSX.Element;
|
|
7
|
-
export declare const DefaultWrapTabBody: (props: DivProps) => JSX.Element;
|
|
8
|
-
export declare const DefaultWrapTabHead: (props: DivProps) => JSX.Element;
|
|
9
|
-
export declare const DefaultWrapTabPanel: (props: DivProps) => JSX.Element;
|
|
10
|
-
export declare const DefaultHoverElement: (props: DivProps) => JSX.Element;
|
|
11
|
-
export declare const DefaultSliderElement: (props: {
|
|
12
|
-
direction?: boolean;
|
|
13
|
-
children?: JSX.Element;
|
|
14
|
-
} & DivProps) => JSX.Element;
|
|
15
|
-
export declare const RootSplitterHoverEl: (props: {
|
|
16
|
-
area: "left" | "right" | "top" | "bottom";
|
|
17
|
-
size?: {
|
|
18
|
-
w: string;
|
|
19
|
-
h: string;
|
|
20
|
-
};
|
|
21
|
-
gap?: string;
|
|
22
|
-
} & DivProps) => JSX.Element;
|
|
23
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { LayoutTree, DynamixLayoutCore, NodeOptions } from '../../../core/src';
|
|
2
|
-
import { useDynamixLayoutOptions } from '../types';
|
|
3
|
-
import { Accessor, Setter } from 'solid-js';
|
|
4
|
-
export declare const useDynamixLayout: ({ tabOutput, rootId, layoutTree, updateJSON, dimensions, tabHeadHeight, enableTabbar, bondWidth, minTabHeight, minTabWidth, sliderUpdateTimeout, windowResizeTimeout, disableSliderTimeout, disableResizeTimeout, }: useDynamixLayoutOptions) => {
|
|
5
|
-
tabsets: Accessor<Map<string, NodeOptions>>;
|
|
6
|
-
sliders: Accessor<Map<string, NodeOptions>>;
|
|
7
|
-
tabsetsRef: Map<string, HTMLDivElement>;
|
|
8
|
-
panelsRef: Map<string, HTMLDivElement>;
|
|
9
|
-
tabsRef: Map<string, HTMLDivElement>;
|
|
10
|
-
slidersRef: Map<string, HTMLDivElement>;
|
|
11
|
-
layoutJSON: Accessor<LayoutTree | undefined>;
|
|
12
|
-
layoutInstance: DynamixLayoutCore;
|
|
13
|
-
hoverElementRef: {
|
|
14
|
-
current: HTMLDivElement | undefined;
|
|
15
|
-
};
|
|
16
|
-
rootSplitHoverEl: HTMLDivElement[];
|
|
17
|
-
dragging: Accessor<boolean>;
|
|
18
|
-
isUpdating: Accessor<boolean>;
|
|
19
|
-
setIsUpdating: Setter<boolean>;
|
|
20
|
-
setDragging: Setter<boolean>;
|
|
21
|
-
setTabsets: Setter<Map<string, NodeOptions>>;
|
|
22
|
-
setSliders: Setter<Map<string, NodeOptions>>;
|
|
23
|
-
setLayoutJSON: Setter<LayoutTree | undefined>;
|
|
24
|
-
onDragStart: (e: DragEvent) => void;
|
|
25
|
-
onDragOver: (e: DragEvent) => void;
|
|
26
|
-
onDragEnd: (e: DragEvent) => void;
|
|
27
|
-
onDragEnter: (e: DragEvent) => void;
|
|
28
|
-
onDragLeave: (e: DragEvent) => void;
|
|
29
|
-
onDrop: (e: DragEvent) => void;
|
|
30
|
-
onPointerDown: (e: PointerEvent) => void;
|
|
31
|
-
updateActiveTab: (e: MouseEvent) => void;
|
|
32
|
-
handleRootSplit: (e: DragEvent) => void;
|
|
33
|
-
handleNavbarDragOver: (e: DragEvent) => void;
|
|
34
|
-
};
|