@dxos/react-ui-list 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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/lib/browser/index.mjs +684 -706
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +684 -706
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts +7 -4
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +8 -6
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +14 -5
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListItem.d.ts +8 -6
- package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
- package/dist/types/src/components/List/ListRoot.d.ts +2 -2
- package/dist/types/src/components/List/ListRoot.d.ts.map +1 -1
- package/dist/types/src/components/List/testing.d.ts +1 -1
- package/dist/types/src/components/List/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts +10 -6
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +18 -7
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeContext.d.ts +24 -10
- package/dist/types/src/components/Tree/TreeContext.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItem.d.ts +25 -4
- package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts +4 -3
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemToggle.d.ts +3 -3
- package/dist/types/src/components/Tree/TreeItemToggle.d.ts.map +1 -1
- package/dist/types/src/components/Tree/index.d.ts +2 -0
- package/dist/types/src/components/Tree/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing.d.ts +3 -3
- package/dist/types/src/components/Tree/testing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -28
- package/src/components/Accordion/Accordion.stories.tsx +7 -9
- package/src/components/Accordion/AccordionItem.tsx +6 -5
- package/src/components/Accordion/AccordionRoot.tsx +1 -1
- package/src/components/List/List.stories.tsx +44 -30
- package/src/components/List/List.tsx +4 -9
- package/src/components/List/ListItem.tsx +58 -43
- package/src/components/List/ListRoot.tsx +3 -3
- package/src/components/List/testing.ts +7 -7
- package/src/components/Tree/Tree.stories.tsx +179 -88
- package/src/components/Tree/Tree.tsx +43 -40
- package/src/components/Tree/TreeContext.tsx +21 -9
- package/src/components/Tree/TreeItem.tsx +214 -127
- package/src/components/Tree/TreeItemHeading.tsx +10 -8
- package/src/components/Tree/TreeItemToggle.tsx +29 -18
- package/src/components/Tree/index.ts +2 -0
- package/src/components/Tree/testing.ts +10 -9
|
@@ -1,87 +1,65 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/components/Accordion/AccordionItem.tsx
|
|
4
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
5
4
|
import * as AccordionPrimitive2 from "@radix-ui/react-accordion";
|
|
6
5
|
import { createContext as createContext2 } from "@radix-ui/react-context";
|
|
7
6
|
import React2 from "react";
|
|
8
7
|
import { Icon } from "@dxos/react-ui";
|
|
9
|
-
import { mx as mx2 } from "@dxos/
|
|
8
|
+
import { mx as mx2 } from "@dxos/ui-theme";
|
|
10
9
|
|
|
11
10
|
// src/components/Accordion/AccordionRoot.tsx
|
|
12
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
13
11
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
14
12
|
import { createContext } from "@radix-ui/react-context";
|
|
15
13
|
import React from "react";
|
|
16
|
-
import { mx } from "@dxos/
|
|
14
|
+
import { mx } from "@dxos/ui-theme";
|
|
17
15
|
var ACCORDION_NAME = "Accordion";
|
|
18
16
|
var [AccordionProvider, useAccordionContext] = createContext(ACCORDION_NAME);
|
|
19
17
|
var defaultGetId = (item) => item?.id;
|
|
20
18
|
var AccordionRoot = ({ classNames, items, getId = defaultGetId, children, value, defaultValue, onValueChange }) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
items: items ?? []
|
|
33
|
-
})));
|
|
34
|
-
} finally {
|
|
35
|
-
_effect.f();
|
|
36
|
-
}
|
|
19
|
+
return /* @__PURE__ */ React.createElement(AccordionProvider, {
|
|
20
|
+
getId
|
|
21
|
+
}, /* @__PURE__ */ React.createElement(AccordionPrimitive.Root, {
|
|
22
|
+
type: "multiple",
|
|
23
|
+
value,
|
|
24
|
+
defaultValue,
|
|
25
|
+
onValueChange,
|
|
26
|
+
className: mx(classNames)
|
|
27
|
+
}, children?.({
|
|
28
|
+
items: items ?? []
|
|
29
|
+
})));
|
|
37
30
|
};
|
|
38
31
|
|
|
39
32
|
// src/components/Accordion/AccordionItem.tsx
|
|
40
33
|
var ACCORDION_ITEM_NAME = "AccordionItem";
|
|
41
|
-
var [AccordionItemProvider,
|
|
34
|
+
var [AccordionItemProvider, useDxAccordionItemContext] = createContext2(ACCORDION_ITEM_NAME);
|
|
42
35
|
var AccordionItem = ({ children, classNames, item }) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
className: mx2("overflow-hidden", classNames)
|
|
51
|
-
}, children));
|
|
52
|
-
} finally {
|
|
53
|
-
_effect.f();
|
|
54
|
-
}
|
|
36
|
+
const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);
|
|
37
|
+
return /* @__PURE__ */ React2.createElement(AccordionItemProvider, {
|
|
38
|
+
item
|
|
39
|
+
}, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Item, {
|
|
40
|
+
value: getId(item),
|
|
41
|
+
className: mx2("overflow-hidden", classNames)
|
|
42
|
+
}, children));
|
|
55
43
|
};
|
|
56
44
|
var AccordionItemHeader = ({ classNames, children, ...props }) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
classNames: "transition-transform duration-200 group-data-[state=open]:rotate-90"
|
|
68
|
-
})));
|
|
69
|
-
} finally {
|
|
70
|
-
_effect.f();
|
|
71
|
-
}
|
|
45
|
+
return /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Header, {
|
|
46
|
+
...props,
|
|
47
|
+
className: mx2(classNames)
|
|
48
|
+
}, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Trigger, {
|
|
49
|
+
className: "group flex items-center p-2 dx-focus-ring-inset w-full text-start"
|
|
50
|
+
}, children, /* @__PURE__ */ React2.createElement(Icon, {
|
|
51
|
+
icon: "ph--caret-right--regular",
|
|
52
|
+
size: 4,
|
|
53
|
+
classNames: "transition-transform duration-200 group-data-[state=open]:rotate-90"
|
|
54
|
+
})));
|
|
72
55
|
};
|
|
73
56
|
var AccordionItemBody = ({ children, classNames }) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
className: mx2("p-2", classNames)
|
|
81
|
-
}, children));
|
|
82
|
-
} finally {
|
|
83
|
-
_effect.f();
|
|
84
|
-
}
|
|
57
|
+
return /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Content, {
|
|
58
|
+
className: "overflow-hidden data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down"
|
|
59
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
60
|
+
role: "none",
|
|
61
|
+
className: mx2("p-2", classNames)
|
|
62
|
+
}, children));
|
|
85
63
|
};
|
|
86
64
|
|
|
87
65
|
// src/components/Accordion/Accordion.tsx
|
|
@@ -93,91 +71,85 @@ var Accordion = {
|
|
|
93
71
|
};
|
|
94
72
|
|
|
95
73
|
// src/components/List/ListItem.tsx
|
|
96
|
-
import {
|
|
74
|
+
import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
97
75
|
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
98
76
|
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
99
77
|
import { setCustomNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
|
|
100
|
-
import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
101
78
|
import { createContext as createContext4 } from "@radix-ui/react-context";
|
|
79
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
102
80
|
import React4, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
103
81
|
import { createPortal } from "react-dom";
|
|
104
82
|
import { invariant } from "@dxos/invariant";
|
|
105
83
|
import { IconButton, ListItem as NaturalListItem, useTranslation } from "@dxos/react-ui";
|
|
106
|
-
import { mx as mx3 } from "@dxos/
|
|
84
|
+
import { mx as mx3, osTranslations } from "@dxos/ui-theme";
|
|
107
85
|
|
|
108
86
|
// src/components/List/ListRoot.tsx
|
|
109
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
110
|
-
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
111
87
|
import { extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
112
88
|
import { getReorderDestinationIndex } from "@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index";
|
|
89
|
+
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
113
90
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
114
91
|
import React3, { useCallback, useEffect, useState } from "react";
|
|
115
92
|
var LIST_NAME = "List";
|
|
116
93
|
var [ListProvider, useListContext] = createContext3(LIST_NAME);
|
|
117
94
|
var defaultGetId2 = (item) => item?.id;
|
|
118
95
|
var ListRoot = ({ children, items, isItem, getId = defaultGetId2, onMove, ...props }) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (!target) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const sourceData = source.data;
|
|
145
|
-
const targetData = target.data;
|
|
146
|
-
if (!isItem?.(sourceData) || !isItem?.(targetData)) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const sourceIdx = items.findIndex((item) => isEqual(item, sourceData));
|
|
150
|
-
const targetIdx = items.findIndex((item) => isEqual(item, targetData));
|
|
151
|
-
if (targetIdx < 0 || sourceIdx < 0) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const closestEdgeOfTarget = extractClosestEdge(targetData);
|
|
155
|
-
const destinationIndex = getReorderDestinationIndex({
|
|
156
|
-
closestEdgeOfTarget,
|
|
157
|
-
startIndex: sourceIdx,
|
|
158
|
-
indexOfTarget: targetIdx,
|
|
159
|
-
axis: "vertical"
|
|
160
|
-
});
|
|
161
|
-
onMove?.(sourceIdx, destinationIndex);
|
|
96
|
+
const isEqual = useCallback((a, b) => {
|
|
97
|
+
const idA = getId?.(a);
|
|
98
|
+
const idB = getId?.(b);
|
|
99
|
+
if (idA !== void 0 && idB !== void 0) {
|
|
100
|
+
return idA === idB;
|
|
101
|
+
} else {
|
|
102
|
+
return a === b;
|
|
103
|
+
}
|
|
104
|
+
}, [
|
|
105
|
+
getId
|
|
106
|
+
]);
|
|
107
|
+
const [state, setState] = useState(idle);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (!items) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
return monitorForElements({
|
|
113
|
+
canMonitor: ({ source }) => isItem?.(source.data) ?? false,
|
|
114
|
+
onDrop: ({ location, source }) => {
|
|
115
|
+
const target = location.current.dropTargets[0];
|
|
116
|
+
if (!target) {
|
|
117
|
+
return;
|
|
162
118
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
119
|
+
const sourceData = source.data;
|
|
120
|
+
const targetData = target.data;
|
|
121
|
+
if (!isItem?.(sourceData) || !isItem?.(targetData)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const sourceIdx = items.findIndex((item) => isEqual(item, sourceData));
|
|
125
|
+
const targetIdx = items.findIndex((item) => isEqual(item, targetData));
|
|
126
|
+
if (targetIdx < 0 || sourceIdx < 0) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const closestEdgeOfTarget = extractClosestEdge(targetData);
|
|
130
|
+
const destinationIndex = getReorderDestinationIndex({
|
|
131
|
+
closestEdgeOfTarget,
|
|
132
|
+
startIndex: sourceIdx,
|
|
133
|
+
indexOfTarget: targetIdx,
|
|
134
|
+
axis: "vertical"
|
|
135
|
+
});
|
|
136
|
+
onMove?.(sourceIdx, destinationIndex);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}, [
|
|
140
|
+
items,
|
|
141
|
+
isEqual,
|
|
142
|
+
onMove
|
|
143
|
+
]);
|
|
144
|
+
return /* @__PURE__ */ React3.createElement(ListProvider, {
|
|
145
|
+
state,
|
|
146
|
+
setState,
|
|
147
|
+
isItem,
|
|
148
|
+
...props
|
|
149
|
+
}, children?.({
|
|
150
|
+
state,
|
|
151
|
+
items: items ?? []
|
|
152
|
+
}));
|
|
181
153
|
};
|
|
182
154
|
|
|
183
155
|
// src/components/List/ListItem.tsx
|
|
@@ -191,195 +163,177 @@ var stateStyles = {
|
|
|
191
163
|
var defaultContext = {};
|
|
192
164
|
var LIST_ITEM_NAME = "ListItem";
|
|
193
165
|
var [ListItemProvider, useListItemContext] = createContext4(LIST_ITEM_NAME, defaultContext);
|
|
194
|
-
var ListItem = ({ children, classNames, item, ...props }) => {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const { height } = container.getBoundingClientRect();
|
|
227
|
-
return {
|
|
228
|
-
x: 20,
|
|
229
|
-
y: height / 2
|
|
230
|
-
};
|
|
231
|
-
},
|
|
232
|
-
render: ({ container }) => {
|
|
233
|
-
container.style.width = rect.width + "px";
|
|
234
|
-
setState({
|
|
235
|
-
type: "preview",
|
|
236
|
-
container
|
|
237
|
-
});
|
|
238
|
-
setRootState({
|
|
239
|
-
type: "preview",
|
|
240
|
-
container,
|
|
241
|
-
item
|
|
242
|
-
});
|
|
243
|
-
return () => {
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
} : void 0,
|
|
248
|
-
onDragStart: () => {
|
|
249
|
-
setState({
|
|
250
|
-
type: "is-dragging"
|
|
251
|
-
});
|
|
252
|
-
setRootState({
|
|
253
|
-
type: "is-dragging",
|
|
254
|
-
item
|
|
255
|
-
});
|
|
256
|
-
},
|
|
257
|
-
onDrop: () => {
|
|
258
|
-
setState(idle);
|
|
259
|
-
setRootState(idle);
|
|
260
|
-
}
|
|
261
|
-
}),
|
|
262
|
-
//
|
|
263
|
-
// https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements
|
|
264
|
-
//
|
|
265
|
-
dropTargetForElements({
|
|
266
|
-
element,
|
|
267
|
-
canDrop: ({ source }) => {
|
|
268
|
-
return (source.element !== element && isItem?.(source.data)) ?? false;
|
|
269
|
-
},
|
|
270
|
-
getData: ({ input }) => {
|
|
271
|
-
return attachClosestEdge(item, {
|
|
272
|
-
element,
|
|
273
|
-
input,
|
|
274
|
-
allowedEdges: [
|
|
275
|
-
"top",
|
|
276
|
-
"bottom"
|
|
277
|
-
]
|
|
278
|
-
});
|
|
279
|
-
},
|
|
280
|
-
getIsSticky: () => true,
|
|
281
|
-
onDragEnter: ({ self }) => {
|
|
282
|
-
const closestEdge = extractClosestEdge2(self.data);
|
|
283
|
-
setState({
|
|
284
|
-
type: "is-dragging-over",
|
|
285
|
-
closestEdge
|
|
286
|
-
});
|
|
287
|
-
},
|
|
288
|
-
onDragLeave: () => {
|
|
289
|
-
setState(idle);
|
|
290
|
-
},
|
|
291
|
-
onDrag: ({ self }) => {
|
|
292
|
-
const closestEdge = extractClosestEdge2(self.data);
|
|
293
|
-
setState((current) => {
|
|
294
|
-
if (current.type === "is-dragging-over" && current.closestEdge === closestEdge) {
|
|
295
|
-
return current;
|
|
296
|
-
}
|
|
166
|
+
var ListItem = ({ children, classNames, item, asChild, selected, ...props }) => {
|
|
167
|
+
const Comp = asChild ? Slot : "div";
|
|
168
|
+
const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);
|
|
169
|
+
const rootRef = useRef(null);
|
|
170
|
+
const dragHandleRef = useRef(null);
|
|
171
|
+
const [state, setState] = useState2(idle);
|
|
172
|
+
useEffect2(() => {
|
|
173
|
+
const element = rootRef.current;
|
|
174
|
+
invariant(element, void 0, {
|
|
175
|
+
F: __dxlog_file,
|
|
176
|
+
L: 109,
|
|
177
|
+
S: void 0,
|
|
178
|
+
A: [
|
|
179
|
+
"element",
|
|
180
|
+
""
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
return combine(
|
|
184
|
+
//
|
|
185
|
+
// https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable
|
|
186
|
+
//
|
|
187
|
+
draggable({
|
|
188
|
+
element,
|
|
189
|
+
dragHandle: dragHandleRef.current,
|
|
190
|
+
canDrag: () => !readonly,
|
|
191
|
+
getInitialData: () => item,
|
|
192
|
+
onGenerateDragPreview: dragPreview ? ({ nativeSetDragImage, source }) => {
|
|
193
|
+
const rect = source.element.getBoundingClientRect();
|
|
194
|
+
setCustomNativeDragPreview({
|
|
195
|
+
nativeSetDragImage,
|
|
196
|
+
getOffset: ({ container }) => {
|
|
197
|
+
const { height } = container.getBoundingClientRect();
|
|
297
198
|
return {
|
|
298
|
-
|
|
299
|
-
|
|
199
|
+
x: 20,
|
|
200
|
+
y: height / 2
|
|
300
201
|
};
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
202
|
+
},
|
|
203
|
+
render: ({ container }) => {
|
|
204
|
+
container.style.width = rect.width + "px";
|
|
205
|
+
setState({
|
|
206
|
+
type: "preview",
|
|
207
|
+
container
|
|
208
|
+
});
|
|
209
|
+
setRootState({
|
|
210
|
+
type: "preview",
|
|
211
|
+
container,
|
|
212
|
+
item
|
|
213
|
+
});
|
|
214
|
+
return () => {
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
} : void 0,
|
|
219
|
+
onDragStart: () => {
|
|
220
|
+
setState({
|
|
221
|
+
type: "is-dragging"
|
|
222
|
+
});
|
|
223
|
+
setRootState({
|
|
224
|
+
type: "is-dragging",
|
|
225
|
+
item
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
onDrop: () => {
|
|
229
|
+
setState(idle);
|
|
230
|
+
setRootState(idle);
|
|
231
|
+
}
|
|
232
|
+
}),
|
|
233
|
+
//
|
|
234
|
+
// https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements
|
|
235
|
+
//
|
|
236
|
+
dropTargetForElements({
|
|
237
|
+
element,
|
|
238
|
+
canDrop: ({ source }) => {
|
|
239
|
+
return (source.element !== element && isItem?.(source.data)) ?? false;
|
|
240
|
+
},
|
|
241
|
+
getData: ({ input }) => {
|
|
242
|
+
return attachClosestEdge(item, {
|
|
243
|
+
element,
|
|
244
|
+
input,
|
|
245
|
+
allowedEdges: [
|
|
246
|
+
"top",
|
|
247
|
+
"bottom"
|
|
248
|
+
]
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
getIsSticky: () => true,
|
|
252
|
+
onDragEnter: ({ self }) => {
|
|
253
|
+
const closestEdge = extractClosestEdge2(self.data);
|
|
254
|
+
setState({
|
|
255
|
+
type: "is-dragging-over",
|
|
256
|
+
closestEdge
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
onDragLeave: () => {
|
|
260
|
+
setState(idle);
|
|
261
|
+
},
|
|
262
|
+
onDrag: ({ self }) => {
|
|
263
|
+
const closestEdge = extractClosestEdge2(self.data);
|
|
264
|
+
setState((current) => {
|
|
265
|
+
if (current.type === "is-dragging-over" && current.closestEdge === closestEdge) {
|
|
266
|
+
return current;
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
type: "is-dragging-over",
|
|
270
|
+
closestEdge
|
|
271
|
+
};
|
|
272
|
+
});
|
|
273
|
+
},
|
|
274
|
+
onDrop: () => {
|
|
275
|
+
setState(idle);
|
|
276
|
+
}
|
|
277
|
+
})
|
|
278
|
+
);
|
|
279
|
+
}, [
|
|
280
|
+
item
|
|
281
|
+
]);
|
|
282
|
+
return /* @__PURE__ */ React4.createElement(ListItemProvider, {
|
|
283
|
+
item,
|
|
284
|
+
dragHandleRef
|
|
285
|
+
}, /* @__PURE__ */ React4.createElement(Comp, {
|
|
286
|
+
...props,
|
|
287
|
+
role: "listitem",
|
|
288
|
+
"aria-selected": selected,
|
|
289
|
+
className: mx3("relative p-1 dx-selected dx-hover", classNames, stateStyles[state.type]),
|
|
290
|
+
ref: rootRef
|
|
291
|
+
}, children), state.type === "is-dragging-over" && state.closestEdge && /* @__PURE__ */ React4.createElement(NaturalListItem.DropIndicator, {
|
|
292
|
+
edge: state.closestEdge
|
|
293
|
+
}));
|
|
325
294
|
};
|
|
326
|
-
var
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
classNames: [
|
|
340
|
-
classNames,
|
|
341
|
-
autoHide && disabled && "hidden"
|
|
342
|
-
]
|
|
343
|
-
});
|
|
344
|
-
} finally {
|
|
345
|
-
_effect.f();
|
|
346
|
-
}
|
|
295
|
+
var ListItemIconButton = ({ autoHide = true, iconOnly = true, variant = "ghost", classNames, disabled, ...props }) => {
|
|
296
|
+
const { state } = useListContext("ITEM_BUTTON");
|
|
297
|
+
const isDisabled = state.type !== "idle" || disabled;
|
|
298
|
+
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
299
|
+
...props,
|
|
300
|
+
disabled: isDisabled,
|
|
301
|
+
iconOnly,
|
|
302
|
+
variant,
|
|
303
|
+
classNames: [
|
|
304
|
+
classNames,
|
|
305
|
+
autoHide && disabled && "hidden"
|
|
306
|
+
]
|
|
307
|
+
});
|
|
347
308
|
};
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
_effect.f();
|
|
365
|
-
}
|
|
309
|
+
var ListItemDeleteButton = ({ autoHide = true, classNames, disabled, icon = "ph--x--regular", label, ...props }) => {
|
|
310
|
+
const { state } = useListContext("DELETE_BUTTON");
|
|
311
|
+
const isDisabled = state.type !== "idle" || disabled;
|
|
312
|
+
const { t } = useTranslation(osTranslations);
|
|
313
|
+
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
314
|
+
...props,
|
|
315
|
+
variant: "ghost",
|
|
316
|
+
disabled: isDisabled,
|
|
317
|
+
icon,
|
|
318
|
+
iconOnly: true,
|
|
319
|
+
label: label ?? t("delete.label"),
|
|
320
|
+
classNames: [
|
|
321
|
+
classNames,
|
|
322
|
+
autoHide && disabled && "hidden"
|
|
323
|
+
]
|
|
324
|
+
});
|
|
366
325
|
};
|
|
367
326
|
var ListItemDragHandle = ({ disabled }) => {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
disabled
|
|
379
|
-
});
|
|
380
|
-
} finally {
|
|
381
|
-
_effect.f();
|
|
382
|
-
}
|
|
327
|
+
const { dragHandleRef } = useListItemContext("DRAG_HANDLE");
|
|
328
|
+
const { t } = useTranslation(osTranslations);
|
|
329
|
+
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
330
|
+
variant: "ghost",
|
|
331
|
+
disabled,
|
|
332
|
+
icon: "ph--dots-six-vertical--regular",
|
|
333
|
+
iconOnly: true,
|
|
334
|
+
label: t("drag-handle.label"),
|
|
335
|
+
ref: dragHandleRef
|
|
336
|
+
});
|
|
383
337
|
};
|
|
384
338
|
var ListItemDragPreview = ({ children }) => {
|
|
385
339
|
const { state } = useListContext("DRAG_PREVIEW");
|
|
@@ -387,27 +341,15 @@ var ListItemDragPreview = ({ children }) => {
|
|
|
387
341
|
item: state.item
|
|
388
342
|
}), state.container) : null;
|
|
389
343
|
};
|
|
390
|
-
var ListItemWrapper = ({ classNames, children }) => {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
};
|
|
400
|
-
var ListItemTitle = ({ classNames, children, ...props }) => {
|
|
401
|
-
var _effect = _useSignals4();
|
|
402
|
-
try {
|
|
403
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
404
|
-
className: mx3("flex grow items-center truncate", classNames),
|
|
405
|
-
...props
|
|
406
|
-
}, children);
|
|
407
|
-
} finally {
|
|
408
|
-
_effect.f();
|
|
409
|
-
}
|
|
410
|
-
};
|
|
344
|
+
var ListItemWrapper = ({ classNames, children }) => /* @__PURE__ */ React4.createElement("div", {
|
|
345
|
+
role: "none",
|
|
346
|
+
className: mx3("flex w-full gap-2", classNames)
|
|
347
|
+
}, children);
|
|
348
|
+
var ListItemTitle = ({ classNames, children, ...props }) => /* @__PURE__ */ React4.createElement("div", {
|
|
349
|
+
role: "none",
|
|
350
|
+
className: mx3("flex grow items-center truncate", classNames),
|
|
351
|
+
...props
|
|
352
|
+
}, children);
|
|
411
353
|
|
|
412
354
|
// src/components/List/List.tsx
|
|
413
355
|
var List = {
|
|
@@ -416,13 +358,13 @@ var List = {
|
|
|
416
358
|
ItemDragPreview: ListItemDragPreview,
|
|
417
359
|
ItemWrapper: ListItemWrapper,
|
|
418
360
|
ItemDragHandle: ListItemDragHandle,
|
|
361
|
+
ItemIconButton: ListItemIconButton,
|
|
419
362
|
ItemDeleteButton: ListItemDeleteButton,
|
|
420
|
-
ItemButton: ListItemButton,
|
|
421
363
|
ItemTitle: ListItemTitle
|
|
422
364
|
};
|
|
423
365
|
|
|
424
366
|
// src/components/Tree/Tree.tsx
|
|
425
|
-
import {
|
|
367
|
+
import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
|
|
426
368
|
import React8, { useMemo as useMemo2 } from "react";
|
|
427
369
|
import { Treegrid as Treegrid2 } from "@dxos/react-ui";
|
|
428
370
|
|
|
@@ -434,15 +376,15 @@ var TreeProvider = TreeContext.Provider;
|
|
|
434
376
|
var useTree = () => useContext(TreeContext) ?? raise(new Error("TreeContext not found"));
|
|
435
377
|
|
|
436
378
|
// src/components/Tree/TreeItem.tsx
|
|
437
|
-
import {
|
|
379
|
+
import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
438
380
|
import { combine as combine2 } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
439
381
|
import { draggable as draggable2, dropTargetForElements as dropTargetForElements2 } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
440
|
-
import {
|
|
441
|
-
import
|
|
382
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
383
|
+
import * as Schema from "effect/Schema";
|
|
442
384
|
import React7, { memo as memo3, useCallback as useCallback3, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
443
385
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
444
|
-
import { TreeItem as NaturalTreeItem, Treegrid } from "@dxos/react-ui";
|
|
445
|
-
import { ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls } from "@dxos/
|
|
386
|
+
import { TreeItem as NaturalTreeItem, Treegrid, TREEGRID_PARENT_OF_SEPARATOR } from "@dxos/react-ui";
|
|
387
|
+
import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, mx as mx4 } from "@dxos/ui-theme";
|
|
446
388
|
|
|
447
389
|
// src/components/Tree/helpers.ts
|
|
448
390
|
var DEFAULT_INDENTATION = 8;
|
|
@@ -451,92 +393,85 @@ var paddingIndentation = (level, indentation = DEFAULT_INDENTATION) => ({
|
|
|
451
393
|
});
|
|
452
394
|
|
|
453
395
|
// src/components/Tree/TreeItemHeading.tsx
|
|
454
|
-
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
455
396
|
import React5, { forwardRef, memo, useCallback as useCallback2 } from "react";
|
|
456
397
|
import { Button, Icon as Icon2, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
457
398
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
399
|
+
import { getStyles } from "@dxos/ui-theme";
|
|
400
|
+
var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label, className, icon, iconHue, disabled, current, onSelect }, forwardedRef) => {
|
|
401
|
+
const { t } = useTranslation2();
|
|
402
|
+
const styles = iconHue ? getStyles(iconHue) : void 0;
|
|
403
|
+
const handleSelect = useCallback2((event) => {
|
|
404
|
+
onSelect?.(event.altKey);
|
|
405
|
+
}, [
|
|
406
|
+
onSelect
|
|
407
|
+
]);
|
|
408
|
+
const handleButtonKeydown = useCallback2((event) => {
|
|
409
|
+
if (event.key === " " || event.key === "Enter") {
|
|
410
|
+
event.preventDefault();
|
|
411
|
+
event.stopPropagation();
|
|
463
412
|
onSelect?.(event.altKey);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
icon: icon ?? "ph--placeholder--regular",
|
|
500
|
-
size: 5,
|
|
501
|
-
classNames: "mlb-1"
|
|
502
|
-
}), /* @__PURE__ */ React5.createElement("span", {
|
|
503
|
-
className: "flex-1 is-0 truncate text-start text-sm font-normal",
|
|
504
|
-
"data-tooltip": true
|
|
505
|
-
}, toLocalizedString(label, t))));
|
|
506
|
-
} finally {
|
|
507
|
-
_effect.f();
|
|
508
|
-
}
|
|
413
|
+
}
|
|
414
|
+
}, [
|
|
415
|
+
onSelect
|
|
416
|
+
]);
|
|
417
|
+
return /* @__PURE__ */ React5.createElement(TextTooltip, {
|
|
418
|
+
text: toLocalizedString(label, t),
|
|
419
|
+
side: "bottom",
|
|
420
|
+
truncateQuery: "span[data-tooltip]",
|
|
421
|
+
onlyWhenTruncating: true,
|
|
422
|
+
asChild: true,
|
|
423
|
+
ref: forwardedRef
|
|
424
|
+
}, /* @__PURE__ */ React5.createElement(Button, {
|
|
425
|
+
"data-testid": "treeItem.heading",
|
|
426
|
+
variant: "ghost",
|
|
427
|
+
classNames: [
|
|
428
|
+
"grow gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent",
|
|
429
|
+
"disabled:cursor-default disabled:opacity-100",
|
|
430
|
+
className
|
|
431
|
+
],
|
|
432
|
+
disabled,
|
|
433
|
+
onClick: handleSelect,
|
|
434
|
+
onKeyDown: handleButtonKeydown,
|
|
435
|
+
...current && {
|
|
436
|
+
"aria-current": "location"
|
|
437
|
+
}
|
|
438
|
+
}, icon && /* @__PURE__ */ React5.createElement(Icon2, {
|
|
439
|
+
icon: icon ?? "ph--placeholder--regular",
|
|
440
|
+
classNames: [
|
|
441
|
+
"my-1",
|
|
442
|
+
styles?.surfaceText
|
|
443
|
+
]
|
|
444
|
+
}), /* @__PURE__ */ React5.createElement("span", {
|
|
445
|
+
className: "flex-1 w-0 truncate text-start font-normal",
|
|
446
|
+
"data-tooltip": true
|
|
447
|
+
}, toLocalizedString(label, t))));
|
|
509
448
|
}));
|
|
510
449
|
|
|
511
450
|
// src/components/Tree/TreeItemToggle.tsx
|
|
512
|
-
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
513
451
|
import React6, { forwardRef as forwardRef2, memo as memo2 } from "react";
|
|
514
|
-
import {
|
|
515
|
-
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open, isBranch, hidden,
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
} finally {
|
|
538
|
-
_effect.f();
|
|
539
|
-
}
|
|
452
|
+
import { IconButton as IconButton2 } from "@dxos/react-ui";
|
|
453
|
+
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ classNames, open, isBranch, hidden, ...props }, forwardedRef) => {
|
|
454
|
+
return /* @__PURE__ */ React6.createElement(IconButton2, {
|
|
455
|
+
ref: forwardedRef,
|
|
456
|
+
"data-testid": "treeItem.toggle",
|
|
457
|
+
"aria-expanded": open,
|
|
458
|
+
variant: "ghost",
|
|
459
|
+
density: "fine",
|
|
460
|
+
classNames: [
|
|
461
|
+
"h-full w-6 px-0",
|
|
462
|
+
"[&_svg]:transition-transform [&_svg]:duration-200",
|
|
463
|
+
open ? "[&_svg]:rotate-90" : "[&_svg]:rotate-0",
|
|
464
|
+
hidden ? "hidden" : !isBranch && "invisible",
|
|
465
|
+
classNames
|
|
466
|
+
],
|
|
467
|
+
size: 3,
|
|
468
|
+
icon: "ph--caret-right--bold",
|
|
469
|
+
iconOnly: true,
|
|
470
|
+
noTooltip: true,
|
|
471
|
+
label: open ? "Click to close" : "Click to open",
|
|
472
|
+
tabIndex: -1,
|
|
473
|
+
...props
|
|
474
|
+
});
|
|
540
475
|
}));
|
|
541
476
|
|
|
542
477
|
// src/components/Tree/TreeItem.tsx
|
|
@@ -548,312 +483,351 @@ var TreeDataSchema = Schema.Struct({
|
|
|
548
483
|
item: Schema.Any
|
|
549
484
|
});
|
|
550
485
|
var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
|
|
551
|
-
var RawTreeItem = ({ item, path:
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
486
|
+
var RawTreeItem = ({ item, path: pathProp, levelOffset = 2, last, draggable: draggableProp, renderColumns: Columns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover }) => {
|
|
487
|
+
const rowRef = useRef2(null);
|
|
488
|
+
const buttonRef = useRef2(null);
|
|
489
|
+
const openRef = useRef2(false);
|
|
490
|
+
const cancelExpandRef = useRef2(null);
|
|
491
|
+
const [_state, setState] = useState3("idle");
|
|
492
|
+
const [instruction, setInstruction] = useState3(null);
|
|
493
|
+
const [menuOpen, setMenuOpen] = useState3(false);
|
|
494
|
+
const { itemProps: itemPropsAtom, childIds: childIdsAtom, itemOpen: itemOpenAtom, itemCurrent: itemCurrentAtom } = useTree();
|
|
495
|
+
const path = useMemo(() => [
|
|
496
|
+
...pathProp,
|
|
497
|
+
item.id
|
|
498
|
+
], [
|
|
499
|
+
pathProp,
|
|
500
|
+
item.id
|
|
501
|
+
]);
|
|
502
|
+
const { id, parentOf, draggable: itemDraggable, droppable: itemDroppable, label, className, headingClassName, icon, iconHue, disabled, testId } = useAtomValue(itemPropsAtom(path));
|
|
503
|
+
const childIds = useAtomValue(childIdsAtom(item.id));
|
|
504
|
+
const open = useAtomValue(itemOpenAtom(path));
|
|
505
|
+
const current = useAtomValue(itemCurrentAtom(path));
|
|
506
|
+
const level = path.length - levelOffset;
|
|
507
|
+
const isBranch = !!parentOf;
|
|
508
|
+
const mode = last ? "last-in-group" : open ? "expanded" : "standard";
|
|
509
|
+
const canSelectItem = canSelect?.({
|
|
510
|
+
item,
|
|
511
|
+
path
|
|
512
|
+
}) ?? true;
|
|
513
|
+
const data = {
|
|
514
|
+
id,
|
|
515
|
+
path,
|
|
516
|
+
item
|
|
517
|
+
};
|
|
518
|
+
const shouldSeedNativeDragData = typeof document !== "undefined" && document.body.hasAttribute("data-platform");
|
|
519
|
+
const cancelExpand = useCallback3(() => {
|
|
520
|
+
if (cancelExpandRef.current) {
|
|
521
|
+
clearTimeout(cancelExpandRef.current);
|
|
522
|
+
cancelExpandRef.current = null;
|
|
523
|
+
}
|
|
524
|
+
}, []);
|
|
525
|
+
const isItemDraggable = draggableProp && itemDraggable !== false;
|
|
526
|
+
const isItemDroppable = itemDroppable !== false;
|
|
527
|
+
const nativeDragText = id;
|
|
528
|
+
useEffect3(() => {
|
|
529
|
+
if (!draggableProp) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
invariant2(buttonRef.current, void 0, {
|
|
533
|
+
F: __dxlog_file2,
|
|
534
|
+
L: 150,
|
|
535
|
+
S: void 0,
|
|
536
|
+
A: [
|
|
537
|
+
"buttonRef.current",
|
|
538
|
+
""
|
|
539
|
+
]
|
|
540
|
+
});
|
|
541
|
+
const makeDraggable = () => draggable2({
|
|
542
|
+
element: buttonRef.current,
|
|
543
|
+
getInitialData: () => data,
|
|
544
|
+
getInitialDataForExternal: () => {
|
|
545
|
+
if (!shouldSeedNativeDragData) {
|
|
546
|
+
return {};
|
|
547
|
+
}
|
|
548
|
+
return {
|
|
549
|
+
"text/plain": nativeDragText
|
|
550
|
+
};
|
|
551
|
+
},
|
|
552
|
+
onDragStart: () => {
|
|
553
|
+
setState("dragging");
|
|
554
|
+
if (open) {
|
|
555
|
+
openRef.current = true;
|
|
556
|
+
onOpenChange?.({
|
|
557
|
+
item,
|
|
558
|
+
path,
|
|
559
|
+
open: false
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
onDrop: () => {
|
|
564
|
+
setState("idle");
|
|
565
|
+
if (openRef.current) {
|
|
566
|
+
onOpenChange?.({
|
|
567
|
+
item,
|
|
568
|
+
path,
|
|
569
|
+
open: true
|
|
570
|
+
});
|
|
571
|
+
}
|
|
585
572
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
573
|
+
});
|
|
574
|
+
if (!isItemDroppable) {
|
|
575
|
+
return isItemDraggable ? makeDraggable() : void 0;
|
|
576
|
+
}
|
|
577
|
+
const dropTarget = dropTargetForElements2({
|
|
578
|
+
element: buttonRef.current,
|
|
579
|
+
getData: ({ input, element }) => {
|
|
580
|
+
return attachInstruction(data, {
|
|
581
|
+
input,
|
|
582
|
+
element,
|
|
583
|
+
indentPerLevel: DEFAULT_INDENTATION,
|
|
584
|
+
currentLevel: level,
|
|
585
|
+
mode,
|
|
586
|
+
block: isBranch ? [] : [
|
|
587
|
+
"make-child"
|
|
588
|
+
]
|
|
589
|
+
});
|
|
590
|
+
},
|
|
591
|
+
canDrop: ({ source }) => {
|
|
592
|
+
const _canDrop = canDrop ?? (() => true);
|
|
593
|
+
return source.element !== buttonRef.current && _canDrop({
|
|
594
|
+
source: source.data,
|
|
595
|
+
target: data
|
|
596
|
+
});
|
|
597
|
+
},
|
|
598
|
+
getIsSticky: () => true,
|
|
599
|
+
onDrag: ({ self, source }) => {
|
|
600
|
+
const desired = extractInstruction(self.data);
|
|
601
|
+
const block = desired && blockInstruction?.({
|
|
602
|
+
instruction: desired,
|
|
603
|
+
source: source.data,
|
|
604
|
+
target: data
|
|
605
|
+
});
|
|
606
|
+
const instruction2 = block && desired.type !== "instruction-blocked" ? {
|
|
607
|
+
type: "instruction-blocked",
|
|
608
|
+
desired
|
|
609
|
+
} : desired;
|
|
610
|
+
if (source.data.id !== id) {
|
|
611
|
+
if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
|
|
612
|
+
cancelExpandRef.current = setTimeout(() => {
|
|
618
613
|
onOpenChange?.({
|
|
619
614
|
item,
|
|
620
615
|
path,
|
|
621
616
|
open: true
|
|
622
617
|
});
|
|
623
|
-
}
|
|
618
|
+
}, 500);
|
|
624
619
|
}
|
|
625
|
-
|
|
626
|
-
// https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx
|
|
627
|
-
dropTargetForElements2({
|
|
628
|
-
element: buttonRef.current,
|
|
629
|
-
getData: ({ input, element }) => {
|
|
630
|
-
return attachInstruction(data, {
|
|
631
|
-
input,
|
|
632
|
-
element,
|
|
633
|
-
indentPerLevel: DEFAULT_INDENTATION,
|
|
634
|
-
currentLevel: level,
|
|
635
|
-
mode,
|
|
636
|
-
block: isBranch ? [] : [
|
|
637
|
-
"make-child"
|
|
638
|
-
]
|
|
639
|
-
});
|
|
640
|
-
},
|
|
641
|
-
canDrop: ({ source }) => {
|
|
642
|
-
const _canDrop = canDrop ?? (() => true);
|
|
643
|
-
return source.element !== buttonRef.current && _canDrop({
|
|
644
|
-
source: source.data,
|
|
645
|
-
target: data
|
|
646
|
-
});
|
|
647
|
-
},
|
|
648
|
-
getIsSticky: () => true,
|
|
649
|
-
onDrag: ({ self, source }) => {
|
|
650
|
-
const instruction2 = extractInstruction(self.data);
|
|
651
|
-
if (source.data.id !== id) {
|
|
652
|
-
if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
|
|
653
|
-
cancelExpandRef.current = setTimeout(() => {
|
|
654
|
-
onOpenChange?.({
|
|
655
|
-
item,
|
|
656
|
-
path,
|
|
657
|
-
open: true
|
|
658
|
-
});
|
|
659
|
-
}, 500);
|
|
660
|
-
}
|
|
661
|
-
if (instruction2?.type !== "make-child") {
|
|
662
|
-
cancelExpand();
|
|
663
|
-
}
|
|
664
|
-
setInstruction(instruction2);
|
|
665
|
-
} else if (instruction2?.type === "reparent") {
|
|
666
|
-
setInstruction(instruction2);
|
|
667
|
-
} else {
|
|
668
|
-
setInstruction(null);
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
onDragLeave: () => {
|
|
620
|
+
if (instruction2?.type !== "make-child") {
|
|
672
621
|
cancelExpand();
|
|
673
|
-
setInstruction(null);
|
|
674
|
-
},
|
|
675
|
-
onDrop: () => {
|
|
676
|
-
cancelExpand();
|
|
677
|
-
setInstruction(null);
|
|
678
622
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
const handleOpenChange = useCallback3(() => onOpenChange?.({
|
|
694
|
-
item,
|
|
695
|
-
path,
|
|
696
|
-
open: !open
|
|
697
|
-
}), [
|
|
698
|
-
onOpenChange,
|
|
699
|
-
item,
|
|
700
|
-
path,
|
|
701
|
-
open
|
|
702
|
-
]);
|
|
703
|
-
const handleSelect = useCallback3((option = false) => {
|
|
704
|
-
if (isBranch) {
|
|
705
|
-
handleOpenChange();
|
|
706
|
-
} else {
|
|
707
|
-
rowRef.current?.focus();
|
|
708
|
-
onSelect?.({
|
|
709
|
-
item,
|
|
710
|
-
path,
|
|
711
|
-
current: !current,
|
|
712
|
-
option
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
}, [
|
|
716
|
-
item,
|
|
717
|
-
path,
|
|
718
|
-
current,
|
|
719
|
-
isBranch,
|
|
720
|
-
handleOpenChange,
|
|
721
|
-
onSelect
|
|
722
|
-
]);
|
|
723
|
-
const handleKeyDown = useCallback3((event) => {
|
|
724
|
-
switch (event.key) {
|
|
725
|
-
case "ArrowRight":
|
|
726
|
-
isBranch && !open && handleOpenChange();
|
|
727
|
-
break;
|
|
728
|
-
case "ArrowLeft":
|
|
729
|
-
isBranch && open && handleOpenChange();
|
|
730
|
-
break;
|
|
731
|
-
case " ":
|
|
732
|
-
handleSelect(event.altKey);
|
|
733
|
-
break;
|
|
734
|
-
}
|
|
735
|
-
}, [
|
|
736
|
-
isBranch,
|
|
737
|
-
open,
|
|
738
|
-
handleOpenChange,
|
|
739
|
-
handleSelect
|
|
740
|
-
]);
|
|
741
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Treegrid.Row, {
|
|
742
|
-
ref: rowRef,
|
|
743
|
-
key: id,
|
|
744
|
-
id,
|
|
745
|
-
"aria-labelledby": `${id}__label`,
|
|
746
|
-
parentOf: parentOf?.join(Treegrid.PARENT_OF_SEPARATOR),
|
|
747
|
-
classNames: [
|
|
748
|
-
"grid grid-cols-subgrid col-[tree-row] mbs-0.5 aria-[current]:bg-activeSurface",
|
|
749
|
-
hoverableControls,
|
|
750
|
-
hoverableFocusedKeyboardControls,
|
|
751
|
-
hoverableFocusedWithinControls,
|
|
752
|
-
hoverableDescriptionIcons,
|
|
753
|
-
ghostHover,
|
|
754
|
-
className
|
|
755
|
-
],
|
|
756
|
-
"data-itemid": id,
|
|
757
|
-
"data-testid": testId,
|
|
758
|
-
// NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
|
|
759
|
-
// without alerting the user (except for in the correct link element). See also:
|
|
760
|
-
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description
|
|
761
|
-
"aria-current": current ? "" : void 0,
|
|
762
|
-
onKeyDown: handleKeyDown,
|
|
763
|
-
onContextMenu: (event) => {
|
|
764
|
-
event.preventDefault();
|
|
765
|
-
setMenuOpen(true);
|
|
623
|
+
setInstruction(instruction2);
|
|
624
|
+
} else if (instruction2?.type === "reparent") {
|
|
625
|
+
setInstruction(instruction2);
|
|
626
|
+
} else {
|
|
627
|
+
setInstruction(null);
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
onDragLeave: () => {
|
|
631
|
+
cancelExpand();
|
|
632
|
+
setInstruction(null);
|
|
633
|
+
},
|
|
634
|
+
onDrop: () => {
|
|
635
|
+
cancelExpand();
|
|
636
|
+
setInstruction(null);
|
|
766
637
|
}
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
638
|
+
});
|
|
639
|
+
if (!isItemDraggable) {
|
|
640
|
+
return dropTarget;
|
|
641
|
+
}
|
|
642
|
+
return combine2(makeDraggable(), dropTarget);
|
|
643
|
+
}, [
|
|
644
|
+
draggableProp,
|
|
645
|
+
isItemDraggable,
|
|
646
|
+
isItemDroppable,
|
|
647
|
+
item,
|
|
648
|
+
id,
|
|
649
|
+
mode,
|
|
650
|
+
path,
|
|
651
|
+
open,
|
|
652
|
+
blockInstruction,
|
|
653
|
+
canDrop
|
|
654
|
+
]);
|
|
655
|
+
useEffect3(() => () => cancelExpand(), [
|
|
656
|
+
cancelExpand
|
|
657
|
+
]);
|
|
658
|
+
const handleOpenToggle = useCallback3(() => onOpenChange?.({
|
|
659
|
+
item,
|
|
660
|
+
path,
|
|
661
|
+
open: !open
|
|
662
|
+
}), [
|
|
663
|
+
onOpenChange,
|
|
664
|
+
item,
|
|
665
|
+
path,
|
|
666
|
+
open
|
|
667
|
+
]);
|
|
668
|
+
const handleSelect = useCallback3((option = false) => {
|
|
669
|
+
if (isBranch && (option || current)) {
|
|
670
|
+
handleOpenToggle();
|
|
671
|
+
} else if (canSelectItem) {
|
|
672
|
+
canSelect?.({
|
|
673
|
+
item,
|
|
674
|
+
path
|
|
675
|
+
});
|
|
676
|
+
rowRef.current?.focus();
|
|
677
|
+
onSelect?.({
|
|
678
|
+
item,
|
|
679
|
+
path,
|
|
680
|
+
current: !current,
|
|
681
|
+
option
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
}, [
|
|
685
|
+
item,
|
|
686
|
+
path,
|
|
687
|
+
current,
|
|
688
|
+
isBranch,
|
|
689
|
+
canSelectItem,
|
|
690
|
+
handleOpenToggle,
|
|
691
|
+
onSelect
|
|
692
|
+
]);
|
|
693
|
+
const handleKeyDown = useCallback3((event) => {
|
|
694
|
+
switch (event.key) {
|
|
695
|
+
case "ArrowRight":
|
|
696
|
+
case "ArrowLeft":
|
|
697
|
+
isBranch && handleOpenToggle();
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
}, [
|
|
701
|
+
isBranch,
|
|
702
|
+
open,
|
|
703
|
+
handleOpenToggle,
|
|
704
|
+
handleSelect
|
|
705
|
+
]);
|
|
706
|
+
const handleItemHover = useCallback3(() => {
|
|
707
|
+
onItemHover?.({
|
|
708
|
+
item
|
|
709
|
+
});
|
|
710
|
+
}, [
|
|
711
|
+
onItemHover,
|
|
712
|
+
item
|
|
713
|
+
]);
|
|
714
|
+
const handleContextMenu = useCallback3((event) => {
|
|
715
|
+
event.preventDefault();
|
|
716
|
+
setMenuOpen(true);
|
|
717
|
+
}, [
|
|
718
|
+
setMenuOpen
|
|
719
|
+
]);
|
|
720
|
+
const childProps = {
|
|
721
|
+
draggable: draggableProp,
|
|
722
|
+
renderColumns: Columns,
|
|
723
|
+
blockInstruction,
|
|
724
|
+
canDrop,
|
|
725
|
+
canSelect,
|
|
726
|
+
onItemHover,
|
|
727
|
+
onOpenChange,
|
|
728
|
+
onSelect
|
|
729
|
+
};
|
|
730
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Treegrid.Row, {
|
|
731
|
+
ref: rowRef,
|
|
732
|
+
key: id,
|
|
733
|
+
id,
|
|
734
|
+
"aria-labelledby": `${id}__label`,
|
|
735
|
+
parentOf: parentOf?.join(TREEGRID_PARENT_OF_SEPARATOR),
|
|
736
|
+
"data-object-id": id,
|
|
737
|
+
"data-testid": testId,
|
|
738
|
+
// NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
|
|
739
|
+
// without alerting the user (except for in the correct link element). See also:
|
|
740
|
+
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description
|
|
741
|
+
"aria-current": current ? "" : void 0,
|
|
742
|
+
classNames: mx4("grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-active-surface", hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, hoverableDescriptionIcons, ghostFocusWithin, ghostHover, className),
|
|
743
|
+
onKeyDown: handleKeyDown,
|
|
744
|
+
onMouseEnter: handleItemHover,
|
|
745
|
+
onContextMenu: handleContextMenu
|
|
746
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
747
|
+
role: "none",
|
|
748
|
+
className: "indent relative grid grid-cols-subgrid col-[tree-row]",
|
|
749
|
+
style: paddingIndentation(level)
|
|
750
|
+
}, /* @__PURE__ */ React7.createElement(Treegrid.Cell, {
|
|
751
|
+
classNames: "flex items-center"
|
|
752
|
+
}, /* @__PURE__ */ React7.createElement(TreeItemToggle, {
|
|
753
|
+
isBranch,
|
|
754
|
+
open,
|
|
755
|
+
onClick: handleOpenToggle
|
|
756
|
+
}), /* @__PURE__ */ React7.createElement(TreeItemHeading, {
|
|
757
|
+
disabled,
|
|
758
|
+
current,
|
|
759
|
+
label,
|
|
760
|
+
className: headingClassName,
|
|
761
|
+
icon,
|
|
762
|
+
iconHue,
|
|
763
|
+
onSelect: handleSelect,
|
|
764
|
+
ref: buttonRef
|
|
765
|
+
})), Columns && /* @__PURE__ */ React7.createElement(Columns, {
|
|
766
|
+
item,
|
|
767
|
+
path,
|
|
768
|
+
open,
|
|
769
|
+
menuOpen,
|
|
770
|
+
setMenuOpen
|
|
771
|
+
}), instruction && /* @__PURE__ */ React7.createElement(NaturalTreeItem.DropIndicator, {
|
|
772
|
+
instruction,
|
|
773
|
+
gap: 2
|
|
774
|
+
}))), open && childIds.map((childId, index) => /* @__PURE__ */ React7.createElement(TreeItemById, {
|
|
775
|
+
key: childId,
|
|
776
|
+
id: childId,
|
|
777
|
+
path,
|
|
778
|
+
last: index === childIds.length - 1,
|
|
779
|
+
...childProps
|
|
780
|
+
})));
|
|
809
781
|
};
|
|
810
782
|
var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
|
|
783
|
+
var RawTreeItemById = ({ id, ...props }) => {
|
|
784
|
+
const { item: itemAtom } = useTree();
|
|
785
|
+
const item = useAtomValue(itemAtom(id));
|
|
786
|
+
if (!item) {
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
789
|
+
return /* @__PURE__ */ React7.createElement(TreeItem, {
|
|
790
|
+
item,
|
|
791
|
+
...props
|
|
792
|
+
});
|
|
793
|
+
};
|
|
794
|
+
var TreeItemById = /* @__PURE__ */ memo3(RawTreeItemById);
|
|
811
795
|
|
|
812
796
|
// src/components/Tree/Tree.tsx
|
|
813
|
-
var Tree = ({
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
levelOffset,
|
|
848
|
-
draggable: draggable3,
|
|
849
|
-
renderColumns,
|
|
850
|
-
canDrop,
|
|
851
|
-
onOpenChange,
|
|
852
|
-
onSelect
|
|
853
|
-
}))));
|
|
854
|
-
} finally {
|
|
855
|
-
_effect.f();
|
|
856
|
-
}
|
|
797
|
+
var Tree = ({ model, rootId, path, id, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover }) => {
|
|
798
|
+
const childIds = useAtomValue2(model.childIds(rootId));
|
|
799
|
+
const treePath = useMemo2(() => path ? [
|
|
800
|
+
...path,
|
|
801
|
+
id
|
|
802
|
+
] : [
|
|
803
|
+
id
|
|
804
|
+
], [
|
|
805
|
+
id,
|
|
806
|
+
path
|
|
807
|
+
]);
|
|
808
|
+
const childProps = {
|
|
809
|
+
path: treePath,
|
|
810
|
+
levelOffset,
|
|
811
|
+
draggable: draggable3,
|
|
812
|
+
renderColumns,
|
|
813
|
+
blockInstruction,
|
|
814
|
+
canDrop,
|
|
815
|
+
canSelect,
|
|
816
|
+
onOpenChange,
|
|
817
|
+
onSelect,
|
|
818
|
+
onItemHover
|
|
819
|
+
};
|
|
820
|
+
return /* @__PURE__ */ React8.createElement(Treegrid2.Root, {
|
|
821
|
+
gridTemplateColumns,
|
|
822
|
+
classNames
|
|
823
|
+
}, /* @__PURE__ */ React8.createElement(TreeProvider, {
|
|
824
|
+
value: model
|
|
825
|
+
}, childIds.map((childId, index) => /* @__PURE__ */ React8.createElement(TreeItemById, {
|
|
826
|
+
key: childId,
|
|
827
|
+
id: childId,
|
|
828
|
+
last: index === childIds.length - 1,
|
|
829
|
+
...childProps
|
|
830
|
+
}))));
|
|
857
831
|
};
|
|
858
832
|
|
|
859
833
|
// src/util/path.ts
|
|
@@ -873,13 +847,17 @@ var Path = {
|
|
|
873
847
|
};
|
|
874
848
|
export {
|
|
875
849
|
Accordion,
|
|
850
|
+
DEFAULT_INDENTATION,
|
|
876
851
|
List,
|
|
877
852
|
Path,
|
|
878
853
|
Tree,
|
|
879
854
|
TreeDataSchema,
|
|
880
855
|
TreeItem,
|
|
856
|
+
TreeItemById,
|
|
857
|
+
TreeItemToggle,
|
|
881
858
|
TreeProvider,
|
|
882
859
|
isTreeData,
|
|
860
|
+
paddingIndentation,
|
|
883
861
|
useTree
|
|
884
862
|
};
|
|
885
863
|
//# sourceMappingURL=index.mjs.map
|