react-zeugma 6.3.0 → 6.4.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.
- package/README.md +149 -157
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -103
- package/dist/index.d.ts +81 -103
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-Diujkc-H.d.cts → types-BN5W7EvY.d.cts} +84 -168
- package/dist/{types-Diujkc-H.d.ts → types-BN5W7EvY.d.ts} +84 -168
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +17 -10
- package/dist/utils.d.ts +17 -10
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,55 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
import React__default, { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
declare const DEFAULT_SNAP_THRESHOLD = 8;
|
|
7
|
-
declare const DEFAULT_DRAG_ACTIVATION_DISTANCE = 8;
|
|
8
|
-
declare const DEFAULT_RESIZER_SIZE = 4;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Shared drag-session lifecycle utility.
|
|
12
|
-
*
|
|
13
|
-
* Handles the common boilerplate for pointer-based resize operations:
|
|
14
|
-
* - Adds `zeugma-resizing` class to `document.body`
|
|
15
|
-
* - Injects a global `cursor` style so the resize cursor stays active
|
|
16
|
-
* even when the pointer leaves the handle element
|
|
17
|
-
* - Sets `data-resizing` on the resizer element
|
|
18
|
-
* - Attaches `pointermove` / `pointerup` listeners to `document`
|
|
19
|
-
* - Cleans everything up on pointer-up
|
|
20
|
-
*
|
|
21
|
-
* Consumers provide domain-specific `onMove` and `onEnd` callbacks.
|
|
22
|
-
*/
|
|
23
|
-
interface DragSessionConfig {
|
|
24
|
-
/** CSS cursor to enforce globally during the drag */
|
|
25
|
-
cursor: 'col-resize' | 'row-resize';
|
|
26
|
-
/** The resizer DOM element (receives `data-resizing` attribute) */
|
|
27
|
-
resizerEl: HTMLElement;
|
|
28
|
-
/** Called on every `pointermove` during the drag */
|
|
29
|
-
onMove: (e: PointerEvent) => void;
|
|
30
|
-
/** Called once on `pointerup` — after cleanup has already run */
|
|
31
|
-
onEnd: () => void;
|
|
32
|
-
}
|
|
33
|
-
declare function createDragSession({ cursor, resizerEl, onMove, onEnd }: DragSessionConfig): void;
|
|
34
|
-
|
|
35
|
-
declare function safeJsonStringify(val: unknown): string;
|
|
36
|
-
|
|
37
|
-
declare const ZeugmaStateContext: React.Context<ZeugmaStateValue | undefined>;
|
|
38
|
-
declare const ZeugmaActionsContext: React.Context<ZeugmaActionsValue | undefined>;
|
|
39
|
-
declare const PortalRegistryContext: React.Context<PortalRegistryValue | undefined>;
|
|
40
|
-
declare const ZeugmaDragContext: React.Context<ZeugmaDragStateValue | undefined>;
|
|
41
|
-
declare const useZeugmaState: () => ZeugmaStateValue;
|
|
42
|
-
declare const useZeugmaActions: () => ZeugmaActionsValue;
|
|
43
|
-
declare const useZeugmaDrag: () => ZeugmaDragStateValue;
|
|
1
|
+
import { U as UseZeugmaOptions, Z as ZeugmaController, a as ZeugmaProps, b as ZeugmaProviderProps, S as SplitDirection, T as TreeNode, c as SplitNode, d as TabDetails } from './types-BN5W7EvY.cjs';
|
|
2
|
+
export { D as DragOverlayActiveItem, P as PaneNode, e as ZeugmaClassNames } from './types-BN5W7EvY.cjs';
|
|
3
|
+
import React from 'react';
|
|
44
4
|
|
|
45
5
|
declare function useZeugma(options: UseZeugmaOptions): ZeugmaController;
|
|
46
6
|
|
|
47
|
-
declare const useZeugmaContext: () =>
|
|
7
|
+
declare const useZeugmaContext: () => ZeugmaController;
|
|
48
8
|
|
|
49
|
-
declare const
|
|
9
|
+
declare const ZeugmaProvider: React.FC<ZeugmaProviderProps>;
|
|
10
|
+
declare const Zeugma: React.FC<ZeugmaProps>;
|
|
50
11
|
|
|
51
12
|
interface UseResizerProps {
|
|
52
|
-
containerRef:
|
|
13
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
53
14
|
isRow: boolean;
|
|
54
15
|
direction: SplitDirection;
|
|
55
16
|
splitPercentage: number;
|
|
@@ -65,9 +26,11 @@ interface UseResizerProps {
|
|
|
65
26
|
parentWidth: number;
|
|
66
27
|
parentHeight: number;
|
|
67
28
|
}
|
|
68
|
-
declare function useResizer({ containerRef, isRow, direction, splitPercentage, resizerSize, snapThreshold, layout, currentNode, onLayoutChange, onResizeStart: localOnResizeStart, onResizeEnd: localOnResizeEnd, parentLeft, parentTop, parentWidth, parentHeight, }: UseResizerProps): (e:
|
|
29
|
+
declare function useResizer({ containerRef, isRow, direction, splitPercentage, resizerSize, snapThreshold, layout, currentNode, onLayoutChange, onResizeStart: localOnResizeStart, onResizeEnd: localOnResizeEnd, parentLeft, parentTop, parentWidth, parentHeight, }: UseResizerProps): (e: React.PointerEvent<HTMLDivElement>) => void;
|
|
69
30
|
|
|
70
31
|
interface PaneTreeProps {
|
|
32
|
+
/** Render function mapping unique pane nodes to React elements. Usually renders a <Pane> wrapper. */
|
|
33
|
+
renderPane?: (paneId: string) => React.ReactNode;
|
|
71
34
|
/** The layout subtree node to render. If not specified, defaults to the root layout tree from the Zeugma context. */
|
|
72
35
|
tree?: TreeNode | null;
|
|
73
36
|
/** Size/thickness of the split handle resizer bars in pixels (default 4). */
|
|
@@ -75,7 +38,7 @@ interface PaneTreeProps {
|
|
|
75
38
|
/** Threshold distance in pixels to snap layout resizers to adjacent edges (default 8). */
|
|
76
39
|
snapThreshold?: number;
|
|
77
40
|
}
|
|
78
|
-
declare const PaneTree:
|
|
41
|
+
declare const PaneTree: React.FC<PaneTreeProps>;
|
|
79
42
|
|
|
80
43
|
interface BaseLeafRenderProps {
|
|
81
44
|
/** True if the leaf is actively being dragged. */
|
|
@@ -106,49 +69,49 @@ interface PaneRenderProps extends BaseLeafRenderProps {
|
|
|
106
69
|
tabsMetadata: Record<string, Record<string, unknown>> | undefined;
|
|
107
70
|
/** Updates the metadata of a specific tab. */
|
|
108
71
|
updateTabMetadata: (tabId: string, updater: (current: Record<string, unknown> | undefined) => Record<string, unknown> | undefined) => void;
|
|
109
|
-
/** Renders the target placeholder element for the currently active tab in the pane. */
|
|
110
|
-
renderActiveTab: () => ReactNode;
|
|
111
|
-
}
|
|
112
|
-
interface WidgetRenderProps extends BaseLeafRenderProps {
|
|
113
|
-
/** Renders the target placeholder element for the widget content. */
|
|
114
|
-
renderActiveWidget: () => ReactNode;
|
|
115
72
|
}
|
|
116
73
|
|
|
117
|
-
interface PaneProps {
|
|
118
|
-
/** The unique ID of the pane, matching a `paneId` in the layout tree schema. */
|
|
119
|
-
id: string;
|
|
120
|
-
/** Render prop function providing pane state (isDragging, isFullscreen, etc.) and handlers. */
|
|
121
|
-
children: (props: PaneRenderProps) => React__default.ReactNode;
|
|
122
|
-
/** Optional inline CSS styles applied to the pane outer container. */
|
|
123
|
-
style?: React__default.CSSProperties;
|
|
124
|
-
/** Optional override to lock this specific pane. */
|
|
125
|
-
locked?: boolean;
|
|
126
|
-
}
|
|
127
|
-
declare const Pane: React__default.FC<PaneProps>;
|
|
128
|
-
|
|
129
74
|
interface DragHandleProps {
|
|
130
75
|
/** The children elements that will trigger dragging when held and dragged. */
|
|
131
|
-
children?:
|
|
76
|
+
children?: React.ReactNode;
|
|
132
77
|
/** Custom CSS class applied to the drag handle element. */
|
|
133
78
|
className?: string;
|
|
134
79
|
/** Optional inline CSS styles applied to the drag handle. */
|
|
135
|
-
style?:
|
|
80
|
+
style?: React.CSSProperties;
|
|
81
|
+
}
|
|
82
|
+
declare const DragHandle: React.FC<DragHandleProps>;
|
|
83
|
+
|
|
84
|
+
interface TabRenderProps {
|
|
85
|
+
isDragging: boolean;
|
|
86
|
+
isOver: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface TabProps {
|
|
89
|
+
/** The unique ID of the tab, which corresponds to the pane/widget ID. */
|
|
90
|
+
id: string;
|
|
91
|
+
/** Whether dragging is locked on this tab. */
|
|
92
|
+
locked?: boolean;
|
|
93
|
+
/** Render prop child function. */
|
|
94
|
+
children: (props: TabRenderProps) => React.ReactNode;
|
|
95
|
+
/** Custom CSS class applied to the tab wrapper. */
|
|
96
|
+
className?: string;
|
|
97
|
+
/** Custom inline CSS style applied to the tab wrapper. */
|
|
98
|
+
style?: React.CSSProperties;
|
|
136
99
|
}
|
|
137
|
-
declare const
|
|
100
|
+
declare const Tab: React.FC<TabProps>;
|
|
138
101
|
|
|
139
102
|
interface TabsProps {
|
|
140
103
|
/** The list of tab IDs in this pane. */
|
|
141
|
-
tabs
|
|
104
|
+
tabs?: string[];
|
|
142
105
|
/** The currently active tab ID. */
|
|
143
|
-
activeTabId
|
|
106
|
+
activeTabId?: string;
|
|
144
107
|
/** Whether dragging is locked on these tabs. */
|
|
145
108
|
locked?: boolean;
|
|
146
109
|
/** Metadata for the tabs. */
|
|
147
110
|
tabsMetadata?: Record<string, Record<string, unknown>>;
|
|
148
111
|
/** Callback when a tab is selected. */
|
|
149
|
-
selectTab
|
|
112
|
+
selectTab?: (id: string) => void;
|
|
150
113
|
/** Callback when a tab is closed/removed. */
|
|
151
|
-
removeTab
|
|
114
|
+
removeTab?: (id: string) => void;
|
|
152
115
|
/** Render function for each individual tab content. */
|
|
153
116
|
renderTab: (props: {
|
|
154
117
|
tabId: string;
|
|
@@ -156,9 +119,9 @@ interface TabsProps {
|
|
|
156
119
|
isDragging: boolean;
|
|
157
120
|
isOver: boolean;
|
|
158
121
|
metadata?: Record<string, unknown>;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}) =>
|
|
122
|
+
onSelect: () => void;
|
|
123
|
+
onRemove: () => void;
|
|
124
|
+
}) => React.ReactNode;
|
|
162
125
|
/** Custom CSS classes for Tabs container and tab wrappers. */
|
|
163
126
|
classNames?: {
|
|
164
127
|
container?: string;
|
|
@@ -166,38 +129,53 @@ interface TabsProps {
|
|
|
166
129
|
};
|
|
167
130
|
/** Custom inline CSS styles for Tabs container and tab wrappers. */
|
|
168
131
|
styles?: {
|
|
169
|
-
container?:
|
|
170
|
-
tab?:
|
|
132
|
+
container?: React.CSSProperties;
|
|
133
|
+
tab?: React.CSSProperties | ((tabId: string) => React.CSSProperties);
|
|
171
134
|
};
|
|
172
135
|
}
|
|
173
|
-
declare const Tabs:
|
|
136
|
+
declare const Tabs: React.FC<TabsProps> & {
|
|
137
|
+
Tab: typeof Tab;
|
|
138
|
+
};
|
|
174
139
|
|
|
175
|
-
interface
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
selectTab: () => void;
|
|
183
|
-
removeTab: () => void;
|
|
184
|
-
}
|
|
185
|
-
declare const useTabContext: () => TabContextValue;
|
|
186
|
-
interface TabRenderProps {
|
|
187
|
-
isDragging: boolean;
|
|
188
|
-
isOver: boolean;
|
|
140
|
+
interface PaneControlsProps {
|
|
141
|
+
/** Custom CSS class applied to the controls container. */
|
|
142
|
+
className?: string;
|
|
143
|
+
/** Custom inline CSS style applied to the controls container. */
|
|
144
|
+
style?: React.CSSProperties;
|
|
145
|
+
/** The children elements (e.g. close and fullscreen buttons) to render inside the controls container. */
|
|
146
|
+
children?: React.ReactNode;
|
|
189
147
|
}
|
|
148
|
+
declare const PaneControls: React.FC<PaneControlsProps>;
|
|
190
149
|
|
|
191
|
-
interface
|
|
192
|
-
|
|
150
|
+
interface PaneContextValue extends PaneRenderProps {
|
|
151
|
+
id: string;
|
|
152
|
+
}
|
|
153
|
+
declare const usePaneContext: () => PaneContextValue;
|
|
154
|
+
interface PaneContentProps {
|
|
155
|
+
/** A render callback (tab) => ReactNode or static ReactNode content to render for the active tab. */
|
|
156
|
+
children?: React.ReactNode | ((tab: TabDetails) => React.ReactNode);
|
|
157
|
+
/** Custom CSS class applied to the tab content wrapper. */
|
|
158
|
+
className?: string;
|
|
159
|
+
/** Custom inline CSS style applied to the tab content wrapper. */
|
|
160
|
+
style?: React.CSSProperties;
|
|
161
|
+
}
|
|
162
|
+
declare const PaneContent: React.FC<PaneContentProps>;
|
|
163
|
+
interface PaneProps {
|
|
164
|
+
/** The unique ID of the pane, matching a `paneId` in the layout tree schema. */
|
|
193
165
|
id: string;
|
|
194
|
-
/**
|
|
195
|
-
children:
|
|
196
|
-
/** Optional inline CSS styles applied to the
|
|
197
|
-
style?:
|
|
198
|
-
/** Optional override to lock this specific
|
|
166
|
+
/** The children elements inside the pane (e.g. headers, tabs, content). */
|
|
167
|
+
children: React.ReactNode;
|
|
168
|
+
/** Optional inline CSS styles applied to the pane outer container. */
|
|
169
|
+
style?: React.CSSProperties;
|
|
170
|
+
/** Optional override to lock this specific pane. */
|
|
199
171
|
locked?: boolean;
|
|
200
172
|
}
|
|
201
|
-
declare const
|
|
202
|
-
|
|
203
|
-
|
|
173
|
+
declare const Pane: React.FC<PaneProps> & {
|
|
174
|
+
Content: typeof PaneContent;
|
|
175
|
+
DragHandle: typeof DragHandle;
|
|
176
|
+
Tabs: typeof Tabs;
|
|
177
|
+
Tab: typeof Tab;
|
|
178
|
+
Controls: typeof PaneControls;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export { type DragHandleProps, Pane, type PaneControlsProps, type PaneProps, type PaneRenderProps, PaneTree, SplitDirection, SplitNode, TabDetails, type TabsProps, TreeNode, UseZeugmaOptions, Zeugma, ZeugmaController, ZeugmaProps, ZeugmaProvider, ZeugmaProviderProps, usePaneContext, useResizer, useZeugma, useZeugmaContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,55 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
import React__default, { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
declare const DEFAULT_SNAP_THRESHOLD = 8;
|
|
7
|
-
declare const DEFAULT_DRAG_ACTIVATION_DISTANCE = 8;
|
|
8
|
-
declare const DEFAULT_RESIZER_SIZE = 4;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Shared drag-session lifecycle utility.
|
|
12
|
-
*
|
|
13
|
-
* Handles the common boilerplate for pointer-based resize operations:
|
|
14
|
-
* - Adds `zeugma-resizing` class to `document.body`
|
|
15
|
-
* - Injects a global `cursor` style so the resize cursor stays active
|
|
16
|
-
* even when the pointer leaves the handle element
|
|
17
|
-
* - Sets `data-resizing` on the resizer element
|
|
18
|
-
* - Attaches `pointermove` / `pointerup` listeners to `document`
|
|
19
|
-
* - Cleans everything up on pointer-up
|
|
20
|
-
*
|
|
21
|
-
* Consumers provide domain-specific `onMove` and `onEnd` callbacks.
|
|
22
|
-
*/
|
|
23
|
-
interface DragSessionConfig {
|
|
24
|
-
/** CSS cursor to enforce globally during the drag */
|
|
25
|
-
cursor: 'col-resize' | 'row-resize';
|
|
26
|
-
/** The resizer DOM element (receives `data-resizing` attribute) */
|
|
27
|
-
resizerEl: HTMLElement;
|
|
28
|
-
/** Called on every `pointermove` during the drag */
|
|
29
|
-
onMove: (e: PointerEvent) => void;
|
|
30
|
-
/** Called once on `pointerup` — after cleanup has already run */
|
|
31
|
-
onEnd: () => void;
|
|
32
|
-
}
|
|
33
|
-
declare function createDragSession({ cursor, resizerEl, onMove, onEnd }: DragSessionConfig): void;
|
|
34
|
-
|
|
35
|
-
declare function safeJsonStringify(val: unknown): string;
|
|
36
|
-
|
|
37
|
-
declare const ZeugmaStateContext: React.Context<ZeugmaStateValue | undefined>;
|
|
38
|
-
declare const ZeugmaActionsContext: React.Context<ZeugmaActionsValue | undefined>;
|
|
39
|
-
declare const PortalRegistryContext: React.Context<PortalRegistryValue | undefined>;
|
|
40
|
-
declare const ZeugmaDragContext: React.Context<ZeugmaDragStateValue | undefined>;
|
|
41
|
-
declare const useZeugmaState: () => ZeugmaStateValue;
|
|
42
|
-
declare const useZeugmaActions: () => ZeugmaActionsValue;
|
|
43
|
-
declare const useZeugmaDrag: () => ZeugmaDragStateValue;
|
|
1
|
+
import { U as UseZeugmaOptions, Z as ZeugmaController, a as ZeugmaProps, b as ZeugmaProviderProps, S as SplitDirection, T as TreeNode, c as SplitNode, d as TabDetails } from './types-BN5W7EvY.js';
|
|
2
|
+
export { D as DragOverlayActiveItem, P as PaneNode, e as ZeugmaClassNames } from './types-BN5W7EvY.js';
|
|
3
|
+
import React from 'react';
|
|
44
4
|
|
|
45
5
|
declare function useZeugma(options: UseZeugmaOptions): ZeugmaController;
|
|
46
6
|
|
|
47
|
-
declare const useZeugmaContext: () =>
|
|
7
|
+
declare const useZeugmaContext: () => ZeugmaController;
|
|
48
8
|
|
|
49
|
-
declare const
|
|
9
|
+
declare const ZeugmaProvider: React.FC<ZeugmaProviderProps>;
|
|
10
|
+
declare const Zeugma: React.FC<ZeugmaProps>;
|
|
50
11
|
|
|
51
12
|
interface UseResizerProps {
|
|
52
|
-
containerRef:
|
|
13
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
53
14
|
isRow: boolean;
|
|
54
15
|
direction: SplitDirection;
|
|
55
16
|
splitPercentage: number;
|
|
@@ -65,9 +26,11 @@ interface UseResizerProps {
|
|
|
65
26
|
parentWidth: number;
|
|
66
27
|
parentHeight: number;
|
|
67
28
|
}
|
|
68
|
-
declare function useResizer({ containerRef, isRow, direction, splitPercentage, resizerSize, snapThreshold, layout, currentNode, onLayoutChange, onResizeStart: localOnResizeStart, onResizeEnd: localOnResizeEnd, parentLeft, parentTop, parentWidth, parentHeight, }: UseResizerProps): (e:
|
|
29
|
+
declare function useResizer({ containerRef, isRow, direction, splitPercentage, resizerSize, snapThreshold, layout, currentNode, onLayoutChange, onResizeStart: localOnResizeStart, onResizeEnd: localOnResizeEnd, parentLeft, parentTop, parentWidth, parentHeight, }: UseResizerProps): (e: React.PointerEvent<HTMLDivElement>) => void;
|
|
69
30
|
|
|
70
31
|
interface PaneTreeProps {
|
|
32
|
+
/** Render function mapping unique pane nodes to React elements. Usually renders a <Pane> wrapper. */
|
|
33
|
+
renderPane?: (paneId: string) => React.ReactNode;
|
|
71
34
|
/** The layout subtree node to render. If not specified, defaults to the root layout tree from the Zeugma context. */
|
|
72
35
|
tree?: TreeNode | null;
|
|
73
36
|
/** Size/thickness of the split handle resizer bars in pixels (default 4). */
|
|
@@ -75,7 +38,7 @@ interface PaneTreeProps {
|
|
|
75
38
|
/** Threshold distance in pixels to snap layout resizers to adjacent edges (default 8). */
|
|
76
39
|
snapThreshold?: number;
|
|
77
40
|
}
|
|
78
|
-
declare const PaneTree:
|
|
41
|
+
declare const PaneTree: React.FC<PaneTreeProps>;
|
|
79
42
|
|
|
80
43
|
interface BaseLeafRenderProps {
|
|
81
44
|
/** True if the leaf is actively being dragged. */
|
|
@@ -106,49 +69,49 @@ interface PaneRenderProps extends BaseLeafRenderProps {
|
|
|
106
69
|
tabsMetadata: Record<string, Record<string, unknown>> | undefined;
|
|
107
70
|
/** Updates the metadata of a specific tab. */
|
|
108
71
|
updateTabMetadata: (tabId: string, updater: (current: Record<string, unknown> | undefined) => Record<string, unknown> | undefined) => void;
|
|
109
|
-
/** Renders the target placeholder element for the currently active tab in the pane. */
|
|
110
|
-
renderActiveTab: () => ReactNode;
|
|
111
|
-
}
|
|
112
|
-
interface WidgetRenderProps extends BaseLeafRenderProps {
|
|
113
|
-
/** Renders the target placeholder element for the widget content. */
|
|
114
|
-
renderActiveWidget: () => ReactNode;
|
|
115
72
|
}
|
|
116
73
|
|
|
117
|
-
interface PaneProps {
|
|
118
|
-
/** The unique ID of the pane, matching a `paneId` in the layout tree schema. */
|
|
119
|
-
id: string;
|
|
120
|
-
/** Render prop function providing pane state (isDragging, isFullscreen, etc.) and handlers. */
|
|
121
|
-
children: (props: PaneRenderProps) => React__default.ReactNode;
|
|
122
|
-
/** Optional inline CSS styles applied to the pane outer container. */
|
|
123
|
-
style?: React__default.CSSProperties;
|
|
124
|
-
/** Optional override to lock this specific pane. */
|
|
125
|
-
locked?: boolean;
|
|
126
|
-
}
|
|
127
|
-
declare const Pane: React__default.FC<PaneProps>;
|
|
128
|
-
|
|
129
74
|
interface DragHandleProps {
|
|
130
75
|
/** The children elements that will trigger dragging when held and dragged. */
|
|
131
|
-
children?:
|
|
76
|
+
children?: React.ReactNode;
|
|
132
77
|
/** Custom CSS class applied to the drag handle element. */
|
|
133
78
|
className?: string;
|
|
134
79
|
/** Optional inline CSS styles applied to the drag handle. */
|
|
135
|
-
style?:
|
|
80
|
+
style?: React.CSSProperties;
|
|
81
|
+
}
|
|
82
|
+
declare const DragHandle: React.FC<DragHandleProps>;
|
|
83
|
+
|
|
84
|
+
interface TabRenderProps {
|
|
85
|
+
isDragging: boolean;
|
|
86
|
+
isOver: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface TabProps {
|
|
89
|
+
/** The unique ID of the tab, which corresponds to the pane/widget ID. */
|
|
90
|
+
id: string;
|
|
91
|
+
/** Whether dragging is locked on this tab. */
|
|
92
|
+
locked?: boolean;
|
|
93
|
+
/** Render prop child function. */
|
|
94
|
+
children: (props: TabRenderProps) => React.ReactNode;
|
|
95
|
+
/** Custom CSS class applied to the tab wrapper. */
|
|
96
|
+
className?: string;
|
|
97
|
+
/** Custom inline CSS style applied to the tab wrapper. */
|
|
98
|
+
style?: React.CSSProperties;
|
|
136
99
|
}
|
|
137
|
-
declare const
|
|
100
|
+
declare const Tab: React.FC<TabProps>;
|
|
138
101
|
|
|
139
102
|
interface TabsProps {
|
|
140
103
|
/** The list of tab IDs in this pane. */
|
|
141
|
-
tabs
|
|
104
|
+
tabs?: string[];
|
|
142
105
|
/** The currently active tab ID. */
|
|
143
|
-
activeTabId
|
|
106
|
+
activeTabId?: string;
|
|
144
107
|
/** Whether dragging is locked on these tabs. */
|
|
145
108
|
locked?: boolean;
|
|
146
109
|
/** Metadata for the tabs. */
|
|
147
110
|
tabsMetadata?: Record<string, Record<string, unknown>>;
|
|
148
111
|
/** Callback when a tab is selected. */
|
|
149
|
-
selectTab
|
|
112
|
+
selectTab?: (id: string) => void;
|
|
150
113
|
/** Callback when a tab is closed/removed. */
|
|
151
|
-
removeTab
|
|
114
|
+
removeTab?: (id: string) => void;
|
|
152
115
|
/** Render function for each individual tab content. */
|
|
153
116
|
renderTab: (props: {
|
|
154
117
|
tabId: string;
|
|
@@ -156,9 +119,9 @@ interface TabsProps {
|
|
|
156
119
|
isDragging: boolean;
|
|
157
120
|
isOver: boolean;
|
|
158
121
|
metadata?: Record<string, unknown>;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}) =>
|
|
122
|
+
onSelect: () => void;
|
|
123
|
+
onRemove: () => void;
|
|
124
|
+
}) => React.ReactNode;
|
|
162
125
|
/** Custom CSS classes for Tabs container and tab wrappers. */
|
|
163
126
|
classNames?: {
|
|
164
127
|
container?: string;
|
|
@@ -166,38 +129,53 @@ interface TabsProps {
|
|
|
166
129
|
};
|
|
167
130
|
/** Custom inline CSS styles for Tabs container and tab wrappers. */
|
|
168
131
|
styles?: {
|
|
169
|
-
container?:
|
|
170
|
-
tab?:
|
|
132
|
+
container?: React.CSSProperties;
|
|
133
|
+
tab?: React.CSSProperties | ((tabId: string) => React.CSSProperties);
|
|
171
134
|
};
|
|
172
135
|
}
|
|
173
|
-
declare const Tabs:
|
|
136
|
+
declare const Tabs: React.FC<TabsProps> & {
|
|
137
|
+
Tab: typeof Tab;
|
|
138
|
+
};
|
|
174
139
|
|
|
175
|
-
interface
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
selectTab: () => void;
|
|
183
|
-
removeTab: () => void;
|
|
184
|
-
}
|
|
185
|
-
declare const useTabContext: () => TabContextValue;
|
|
186
|
-
interface TabRenderProps {
|
|
187
|
-
isDragging: boolean;
|
|
188
|
-
isOver: boolean;
|
|
140
|
+
interface PaneControlsProps {
|
|
141
|
+
/** Custom CSS class applied to the controls container. */
|
|
142
|
+
className?: string;
|
|
143
|
+
/** Custom inline CSS style applied to the controls container. */
|
|
144
|
+
style?: React.CSSProperties;
|
|
145
|
+
/** The children elements (e.g. close and fullscreen buttons) to render inside the controls container. */
|
|
146
|
+
children?: React.ReactNode;
|
|
189
147
|
}
|
|
148
|
+
declare const PaneControls: React.FC<PaneControlsProps>;
|
|
190
149
|
|
|
191
|
-
interface
|
|
192
|
-
|
|
150
|
+
interface PaneContextValue extends PaneRenderProps {
|
|
151
|
+
id: string;
|
|
152
|
+
}
|
|
153
|
+
declare const usePaneContext: () => PaneContextValue;
|
|
154
|
+
interface PaneContentProps {
|
|
155
|
+
/** A render callback (tab) => ReactNode or static ReactNode content to render for the active tab. */
|
|
156
|
+
children?: React.ReactNode | ((tab: TabDetails) => React.ReactNode);
|
|
157
|
+
/** Custom CSS class applied to the tab content wrapper. */
|
|
158
|
+
className?: string;
|
|
159
|
+
/** Custom inline CSS style applied to the tab content wrapper. */
|
|
160
|
+
style?: React.CSSProperties;
|
|
161
|
+
}
|
|
162
|
+
declare const PaneContent: React.FC<PaneContentProps>;
|
|
163
|
+
interface PaneProps {
|
|
164
|
+
/** The unique ID of the pane, matching a `paneId` in the layout tree schema. */
|
|
193
165
|
id: string;
|
|
194
|
-
/**
|
|
195
|
-
children:
|
|
196
|
-
/** Optional inline CSS styles applied to the
|
|
197
|
-
style?:
|
|
198
|
-
/** Optional override to lock this specific
|
|
166
|
+
/** The children elements inside the pane (e.g. headers, tabs, content). */
|
|
167
|
+
children: React.ReactNode;
|
|
168
|
+
/** Optional inline CSS styles applied to the pane outer container. */
|
|
169
|
+
style?: React.CSSProperties;
|
|
170
|
+
/** Optional override to lock this specific pane. */
|
|
199
171
|
locked?: boolean;
|
|
200
172
|
}
|
|
201
|
-
declare const
|
|
202
|
-
|
|
203
|
-
|
|
173
|
+
declare const Pane: React.FC<PaneProps> & {
|
|
174
|
+
Content: typeof PaneContent;
|
|
175
|
+
DragHandle: typeof DragHandle;
|
|
176
|
+
Tabs: typeof Tabs;
|
|
177
|
+
Tab: typeof Tab;
|
|
178
|
+
Controls: typeof PaneControls;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export { type DragHandleProps, Pane, type PaneControlsProps, type PaneProps, type PaneRenderProps, PaneTree, SplitDirection, SplitNode, TabDetails, type TabsProps, TreeNode, UseZeugmaOptions, Zeugma, ZeugmaController, ZeugmaProps, ZeugmaProvider, ZeugmaProviderProps, usePaneContext, useResizer, useZeugma, useZeugmaContext };
|