@dashfoo/react 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +20 -108
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -40
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Action, Dashfoo, DockLocation, DragSubject, DropIntent, FloatNode, GlobalAttributes, Orientation, RowNode, SnapConfig, TabNode, TabsetNode } from "@dashfoo/core";
|
|
2
2
|
import { ComponentProps, ComponentType, ReactNode, Ref } from "react";
|
|
3
3
|
import { DragDropManager } from "@dnd-kit/dom";
|
|
4
|
+
import "zustand";
|
|
4
5
|
//#region src/hooks/persistence.d.ts
|
|
5
6
|
type StorageAdapter = {
|
|
6
7
|
getItem: (key: string) => string | null;
|
|
@@ -80,9 +81,7 @@ type DashfooLayoutProps = {
|
|
|
80
81
|
declare const DashfooLayout: import("react").ForwardRefExoticComponent<DashfooLayoutProps & import("react").RefAttributes<DashfooHandle>>;
|
|
81
82
|
//#endregion
|
|
82
83
|
//#region src/components/drag-root.d.ts
|
|
83
|
-
declare const DashfooDragProvider: ({
|
|
84
|
-
children
|
|
85
|
-
}: {
|
|
84
|
+
declare const DashfooDragProvider: ({ children }: {
|
|
86
85
|
children: ReactNode;
|
|
87
86
|
}) => ReactNode;
|
|
88
87
|
//#endregion
|
|
@@ -92,11 +91,7 @@ type ExternalTabSourceOptions = {
|
|
|
92
91
|
disabled?: boolean;
|
|
93
92
|
label?: string;
|
|
94
93
|
};
|
|
95
|
-
declare const useExternalTabSource: ({
|
|
96
|
-
createTab,
|
|
97
|
-
disabled,
|
|
98
|
-
label
|
|
99
|
-
}: ExternalTabSourceOptions) => {
|
|
94
|
+
declare const useExternalTabSource: ({ createTab, disabled, label }: ExternalTabSourceOptions) => {
|
|
100
95
|
ref: (element: Element | null) => void;
|
|
101
96
|
};
|
|
102
97
|
declare const useDragSubject: () => DragSubject | null;
|
|
@@ -150,44 +145,11 @@ type TabsetViewProps = {
|
|
|
150
145
|
//#endregion
|
|
151
146
|
//#region src/components/layout.d.ts
|
|
152
147
|
declare const Layout: {
|
|
153
|
-
readonly DragLayer: ({
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}:
|
|
158
|
-
readonly FloatLayer: ({
|
|
159
|
-
children,
|
|
160
|
-
floats,
|
|
161
|
-
global
|
|
162
|
-
}: FloatLayerProps) => import("react").ReactNode;
|
|
163
|
-
readonly Root: ({
|
|
164
|
-
children,
|
|
165
|
-
closableTabs,
|
|
166
|
-
dispatch,
|
|
167
|
-
draggableTabs,
|
|
168
|
-
draggableTabsets,
|
|
169
|
-
editable,
|
|
170
|
-
floatable,
|
|
171
|
-
keepMounted,
|
|
172
|
-
maximizable,
|
|
173
|
-
model,
|
|
174
|
-
renamableTabs,
|
|
175
|
-
renderTab,
|
|
176
|
-
renderTabLabel,
|
|
177
|
-
renderTabsetToolbar,
|
|
178
|
-
resizableSplits,
|
|
179
|
-
rootRef,
|
|
180
|
-
snap,
|
|
181
|
-
style,
|
|
182
|
-
...props
|
|
183
|
-
}: LayoutRootProps) => import("react").ReactNode;
|
|
184
|
-
readonly Rows: ({
|
|
185
|
-
node,
|
|
186
|
-
renderTabset
|
|
187
|
-
}: RowViewProps) => import("react").ReactNode;
|
|
188
|
-
readonly Tabset: ({
|
|
189
|
-
node
|
|
190
|
-
}: TabsetViewProps) => import("react").ReactNode;
|
|
148
|
+
readonly DragLayer: ({ children, onCommit, splitDock }: DragProviderProps) => import("react").ReactNode;
|
|
149
|
+
readonly FloatLayer: ({ children, floats, global }: FloatLayerProps) => import("react").ReactNode;
|
|
150
|
+
readonly Root: ({ children, closableTabs, dispatch, draggableTabs, draggableTabsets, editable, floatable, keepMounted, maximizable, model, renamableTabs, renderTab, renderTabLabel, renderTabsetToolbar, resizableSplits, rootRef, snap, style, ...props }: LayoutRootProps) => import("react").ReactNode;
|
|
151
|
+
readonly Rows: ({ node, renderTabset }: RowViewProps) => import("react").ReactNode;
|
|
152
|
+
readonly Tabset: ({ node }: TabsetViewProps) => import("react").ReactNode;
|
|
191
153
|
};
|
|
192
154
|
//#endregion
|
|
193
155
|
//#region src/components/panel.d.ts
|
|
@@ -238,67 +200,19 @@ type TabsetTablistProps = ComponentProps<"div">;
|
|
|
238
200
|
//#endregion
|
|
239
201
|
//#region src/components/tabset/tabset.d.ts
|
|
240
202
|
declare const Tabset: {
|
|
241
|
-
readonly CloseButton: ({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}:
|
|
246
|
-
readonly Content: ({
|
|
247
|
-
children,
|
|
248
|
-
style,
|
|
249
|
-
...props
|
|
250
|
-
}: TabsetContentProps) => import("react").ReactNode;
|
|
251
|
-
readonly FloatButton: ({
|
|
252
|
-
children,
|
|
253
|
-
onClick,
|
|
254
|
-
...props
|
|
255
|
-
}: TabsetFloatButtonProps) => import("react").ReactNode;
|
|
256
|
-
readonly Grip: ({
|
|
257
|
-
children,
|
|
258
|
-
ref: userRef,
|
|
259
|
-
...props
|
|
260
|
-
}: TabsetGripProps) => import("react").ReactNode;
|
|
261
|
-
readonly MaximizeButton: ({
|
|
262
|
-
children,
|
|
263
|
-
onClick,
|
|
264
|
-
...props
|
|
265
|
-
}: TabsetMaximizeButtonProps) => import("react").ReactNode;
|
|
203
|
+
readonly CloseButton: ({ children, onClick, ...props }: TabsetCloseButtonProps) => import("react").ReactNode;
|
|
204
|
+
readonly Content: ({ children, style, ...props }: TabsetContentProps) => import("react").ReactNode;
|
|
205
|
+
readonly FloatButton: ({ children, onClick, ...props }: TabsetFloatButtonProps) => import("react").ReactNode;
|
|
206
|
+
readonly Grip: ({ children, ref: userRef, ...props }: TabsetGripProps) => import("react").ReactNode;
|
|
207
|
+
readonly MaximizeButton: ({ children, onClick, ...props }: TabsetMaximizeButtonProps) => import("react").ReactNode;
|
|
266
208
|
readonly OverflowMenu: () => import("react").ReactNode;
|
|
267
209
|
readonly RenameInput: (props: TabsetRenameInputProps) => import("react").ReactNode;
|
|
268
|
-
readonly Root: ({
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}: TabsetRootProps) => import("react").ReactNode;
|
|
275
|
-
readonly Tab: ({
|
|
276
|
-
children,
|
|
277
|
-
ref: userRef,
|
|
278
|
-
tab,
|
|
279
|
-
...props
|
|
280
|
-
}: TabsetTabProps) => import("react").ReactNode;
|
|
281
|
-
readonly Tablist: ({
|
|
282
|
-
onKeyDown,
|
|
283
|
-
ref: userRef,
|
|
284
|
-
style,
|
|
285
|
-
...props
|
|
286
|
-
}: TabsetTablistProps) => import("react").ReactNode;
|
|
287
|
-
readonly TabStrip: ({
|
|
288
|
-
style,
|
|
289
|
-
...props
|
|
290
|
-
}: TabsetTabStripProps) => import("react").ReactNode;
|
|
291
|
-
readonly Toolbar: ({
|
|
292
|
-
style,
|
|
293
|
-
...props
|
|
294
|
-
}: TabsetToolbarProps) => import("react").ReactNode;
|
|
295
|
-
readonly Trigger: ({
|
|
296
|
-
children,
|
|
297
|
-
onClick,
|
|
298
|
-
onDoubleClick,
|
|
299
|
-
ref: userRef,
|
|
300
|
-
...props
|
|
301
|
-
}: TabsetTriggerProps) => import("react").ReactNode;
|
|
210
|
+
readonly Root: ({ children, node, ref: userRef, style, ...props }: TabsetRootProps) => import("react").ReactNode;
|
|
211
|
+
readonly Tab: ({ children, ref: userRef, tab, ...props }: TabsetTabProps) => import("react").ReactNode;
|
|
212
|
+
readonly Tablist: ({ onKeyDown, ref: userRef, style, ...props }: TabsetTablistProps) => import("react").ReactNode;
|
|
213
|
+
readonly TabStrip: ({ style, ...props }: TabsetTabStripProps) => import("react").ReactNode;
|
|
214
|
+
readonly Toolbar: ({ style, ...props }: TabsetToolbarProps) => import("react").ReactNode;
|
|
215
|
+
readonly Trigger: ({ children, onClick, onDoubleClick, ref: userRef, ...props }: TabsetTriggerProps) => import("react").ReactNode;
|
|
302
216
|
};
|
|
303
217
|
//#endregion
|
|
304
218
|
//#region src/components/tab-overflow.d.ts
|
|
@@ -392,9 +306,7 @@ type ResponsiveModel = {
|
|
|
392
306
|
declare const matchBreakpoint: (breakpoint: Breakpoint, width: number) => boolean;
|
|
393
307
|
declare const activeBreakpoint: (breakpoints: Array<Breakpoint>, width: number) => Breakpoint;
|
|
394
308
|
declare const useContainerWidth: () => [(element: HTMLElement | null) => void, number];
|
|
395
|
-
declare const useResponsiveModel: ({
|
|
396
|
-
breakpoints
|
|
397
|
-
}: UseResponsiveModelOptions) => ResponsiveModel;
|
|
309
|
+
declare const useResponsiveModel: ({ breakpoints }: UseResponsiveModelOptions) => ResponsiveModel;
|
|
398
310
|
//#endregion
|
|
399
311
|
//#region src/hooks/store.d.ts
|
|
400
312
|
type DashfooStore = {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hooks/persistence.ts","../src/components/dashfoo-layout.tsx","../src/components/drag-root.tsx","../src/hooks/drag-hooks.tsx","../src/components/drag-adapter.tsx","../src/components/float-layer.tsx","../src/components/layout-root.tsx","../src/components/row-view.tsx","../src/components/tabset/tabset-view.tsx","../src/components/layout.tsx","../src/components/panel.tsx","../src/components/tabset/tabset-tab-controls.tsx","../src/components/tabset/tabset-content.tsx","../src/components/tabset/tabset-toolbar.tsx","../src/components/tabset/tabset-root.tsx","../src/components/tabset/tabset-tab.tsx","../src/components/tabset/tabset-tablist.tsx","../src/components/tabset/tabset.ts","../src/components/tab-overflow.tsx","../src/components/tabset/tabset-store.ts","../src/hooks/layout-store.ts","../src/hooks/responsive.ts","../src/hooks/store.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hooks/persistence.ts","../src/components/dashfoo-layout.tsx","../src/components/drag-root.tsx","../src/hooks/drag-hooks.tsx","../src/components/drag-adapter.tsx","../src/components/float-layer.tsx","../src/components/layout-root.tsx","../src/components/row-view.tsx","../src/components/tabset/tabset-view.tsx","../src/components/layout.tsx","../src/components/panel.tsx","../src/components/tabset/tabset-tab-controls.tsx","../src/components/tabset/tabset-content.tsx","../src/components/tabset/tabset-toolbar.tsx","../src/components/tabset/tabset-root.tsx","../src/components/tabset/tabset-tab.tsx","../src/components/tabset/tabset-tablist.tsx","../src/components/tabset/tabset.ts","../src/components/tab-overflow.tsx","../src/components/tabset/tabset-store.ts","../src/hooks/layout-store.ts","../src/hooks/responsive.ts","../src/hooks/store.ts"],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { canRedo, canUndo, dashfooMachine, dragDockMachine, findTabset, fromJSON, normalize, reducer, resolveDockTarget, snapEnabled, snapSizes, stackModel, tabNodeSchema, toJSON, zoneRect } from "@dashfoo/core";
|
|
4
|
-
import { Fragment, createContext, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { Fragment, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { Accessibility, DragDropManager, Draggable, Droppable, Feedback, PointerSensor } from "@dnd-kit/dom";
|
|
6
6
|
import { createStore, useStore } from "zustand";
|
|
7
7
|
import { CollisionPriority, CollisionType } from "@dnd-kit/abstract";
|
|
@@ -126,20 +126,22 @@ const useDraggableEntity = (descriptor, disabled, label) => {
|
|
|
126
126
|
draggableRef,
|
|
127
127
|
label
|
|
128
128
|
]);
|
|
129
|
-
return { ref };
|
|
129
|
+
return useMemo(() => ({ ref }), [ref]);
|
|
130
130
|
};
|
|
131
131
|
const useTabDraggable = (tabId, disabled = false, label = "") => {
|
|
132
|
+
const data = useMemo(() => ({ type: "tab" }), []);
|
|
132
133
|
return useDraggableEntity({
|
|
133
|
-
data
|
|
134
|
+
data,
|
|
134
135
|
id: tabId
|
|
135
136
|
}, disabled, label);
|
|
136
137
|
};
|
|
137
138
|
const useTabsetDraggable = (tabsetId, disabled = false, label = "") => {
|
|
139
|
+
const data = useMemo(() => ({
|
|
140
|
+
tabsetId,
|
|
141
|
+
type: "tabset"
|
|
142
|
+
}), [tabsetId]);
|
|
138
143
|
return useDraggableEntity({
|
|
139
|
-
data
|
|
140
|
-
tabsetId,
|
|
141
|
-
type: "tabset"
|
|
142
|
-
}), [tabsetId]),
|
|
144
|
+
data,
|
|
143
145
|
id: `grip-${tabsetId}`
|
|
144
146
|
}, disabled, label);
|
|
145
147
|
};
|
|
@@ -175,7 +177,7 @@ const useTabsetDroppable = (tabsetId) => {
|
|
|
175
177
|
manager,
|
|
176
178
|
tabsetId
|
|
177
179
|
]);
|
|
178
|
-
return { ref };
|
|
180
|
+
return useMemo(() => ({ ref }), [ref]);
|
|
179
181
|
};
|
|
180
182
|
const useExternalTabSource = ({ createTab, disabled = false, label = "" }) => {
|
|
181
183
|
const id = useId();
|
|
@@ -183,11 +185,12 @@ const useExternalTabSource = ({ createTab, disabled = false, label = "" }) => {
|
|
|
183
185
|
useEffect(() => {
|
|
184
186
|
createTabRef.current = createTab;
|
|
185
187
|
});
|
|
188
|
+
const data = useMemo(() => ({
|
|
189
|
+
createTab: () => createTabRef.current(),
|
|
190
|
+
type: "external"
|
|
191
|
+
}), []);
|
|
186
192
|
return useDraggableEntity({
|
|
187
|
-
data
|
|
188
|
-
createTab: () => createTabRef.current(),
|
|
189
|
-
type: "external"
|
|
190
|
-
}), []),
|
|
193
|
+
data,
|
|
191
194
|
id: `external-${id}`
|
|
192
195
|
}, disabled, label);
|
|
193
196
|
};
|
|
@@ -376,16 +379,18 @@ const useResponsiveModel = ({ breakpoints }) => {
|
|
|
376
379
|
};
|
|
377
380
|
}, [breakpoints]);
|
|
378
381
|
const active = activeBreakpoint(breakpoints, width);
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
382
|
+
return useMemo(() => {
|
|
383
|
+
const isCompact = active.compact === true;
|
|
384
|
+
return {
|
|
385
|
+
breakpoint: active.id,
|
|
386
|
+
containerRef,
|
|
387
|
+
draggableTabs: !isCompact,
|
|
388
|
+
draggableTabsets: !isCompact,
|
|
389
|
+
isCompact,
|
|
390
|
+
model: active.model,
|
|
391
|
+
resizableSplits: !isCompact
|
|
392
|
+
};
|
|
393
|
+
}, [active, containerRef]);
|
|
389
394
|
};
|
|
390
395
|
|
|
391
396
|
//#endregion
|
|
@@ -544,18 +549,22 @@ const DockIndicator = ({ actorRef, getTabsetElement }) => {
|
|
|
544
549
|
const zIndex = element.closest("[data-dashfoo=\"float\"]") ? overlayBase.zIndex : "auto";
|
|
545
550
|
if (intent.location === "center") {
|
|
546
551
|
const strip = element.querySelector("[data-dashfoo=\"tabstrip\"]");
|
|
547
|
-
if (strip)
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
if (strip) {
|
|
553
|
+
const line = insertionLineRect(strip.getBoundingClientRect(), tabItemRects(strip, draggedId), intent.index ?? 0);
|
|
554
|
+
return /* @__PURE__ */ jsx("div", {
|
|
555
|
+
"data-dashfoo": "dock-indicator",
|
|
556
|
+
style: {
|
|
557
|
+
...lineStyle(line),
|
|
558
|
+
zIndex
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
554
562
|
}
|
|
563
|
+
const zone = zoneRect(element.getBoundingClientRect(), intent.location);
|
|
555
564
|
return /* @__PURE__ */ jsx("div", {
|
|
556
565
|
"data-dashfoo": "dock-indicator",
|
|
557
566
|
style: {
|
|
558
|
-
...paneStyle(
|
|
567
|
+
...paneStyle(zone),
|
|
559
568
|
zIndex
|
|
560
569
|
}
|
|
561
570
|
});
|
|
@@ -860,12 +869,13 @@ const clampToBounds = (rect, bounds, size = rect) => ({
|
|
|
860
869
|
});
|
|
861
870
|
const measureFloatRect = (element) => {
|
|
862
871
|
const rect = (element.closest("[data-dashfoo=\"tabset\"]") ?? element).getBoundingClientRect();
|
|
863
|
-
|
|
872
|
+
const seeded = {
|
|
864
873
|
height: Math.max(MIN_HEIGHT, Math.min(Math.round(rect.height), DEFAULT_HEIGHT)),
|
|
865
874
|
left: Math.round(rect.left) + LIFT_OFFSET,
|
|
866
875
|
top: Math.round(rect.top) + LIFT_OFFSET,
|
|
867
876
|
width: Math.max(MIN_WIDTH, Math.min(Math.round(rect.width), DEFAULT_WIDTH))
|
|
868
|
-
}
|
|
877
|
+
};
|
|
878
|
+
return clampToBounds(seeded, {
|
|
869
879
|
height: window.innerHeight,
|
|
870
880
|
width: window.innerWidth
|
|
871
881
|
});
|
|
@@ -1189,20 +1199,20 @@ const TabsetContent = ({ children, style, ...props }) => {
|
|
|
1189
1199
|
...contentStyle,
|
|
1190
1200
|
...style
|
|
1191
1201
|
};
|
|
1192
|
-
if (keepMounted && node.children.length > 0) return node.children.map((tab, index) => /* @__PURE__ */
|
|
1202
|
+
if (keepMounted && node.children.length > 0) return node.children.map((tab, index) => /* @__PURE__ */ createElement("div", {
|
|
1193
1203
|
...props,
|
|
1194
1204
|
"aria-labelledby": tabDomId(node.id, tab.id),
|
|
1195
1205
|
"data-dashfoo": "tabcontent",
|
|
1196
1206
|
hidden: index !== visualSelected || void 0,
|
|
1197
1207
|
id: index === visualSelected ? panelDomId(node.id) : void 0,
|
|
1208
|
+
key: tab.id,
|
|
1198
1209
|
role: index === visualSelected ? "tabpanel" : void 0,
|
|
1199
1210
|
style: mergedStyle,
|
|
1200
|
-
tabIndex: index === visualSelected ? 0 : void 0
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
}, tab.id));
|
|
1211
|
+
tabIndex: index === visualSelected ? 0 : void 0
|
|
1212
|
+
}, /* @__PURE__ */ jsx(TabPanel, {
|
|
1213
|
+
render: children,
|
|
1214
|
+
tab
|
|
1215
|
+
})));
|
|
1206
1216
|
const active = node.children[visualSelected];
|
|
1207
1217
|
if (active) return /* @__PURE__ */ jsx("div", {
|
|
1208
1218
|
...props,
|
|
@@ -1865,8 +1875,9 @@ const TabsetFloatButton = ({ children, onClick, ...props }) => {
|
|
|
1865
1875
|
}
|
|
1866
1876
|
const handleClick = (event) => {
|
|
1867
1877
|
onClick?.(event);
|
|
1878
|
+
const geometry = measureFloatRect(event.currentTarget);
|
|
1868
1879
|
dispatch({
|
|
1869
|
-
geometry
|
|
1880
|
+
geometry,
|
|
1870
1881
|
tabsetId: node.id,
|
|
1871
1882
|
type: "floatTabset"
|
|
1872
1883
|
});
|