@dxos/react-ui-list 0.8.4-main.d05673bc65 → 0.8.4-main.e00bdcdb52
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 +42 -48
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +42 -48
- 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.d.ts +1 -1
- package/dist/types/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/AccordionRoot.d.ts +1 -1
- package/dist/types/src/components/Accordion/AccordionRoot.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +5 -3
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +2 -2
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListItem.d.ts +7 -7
- package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
- package/dist/types/src/components/List/ListRoot.d.ts.map +1 -1
- package/dist/types/src/components/List/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
- package/dist/types/src/components/Tree/helpers.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing.d.ts.map +1 -1
- package/dist/types/src/util/path.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -20
- package/src/components/Accordion/Accordion.stories.tsx +3 -3
- package/src/components/Accordion/AccordionItem.tsx +0 -1
- package/src/components/List/List.stories.tsx +3 -3
- package/src/components/List/List.tsx +2 -7
- package/src/components/List/ListItem.tsx +32 -30
- package/src/components/List/ListRoot.tsx +1 -1
- package/src/components/List/testing.ts +4 -4
- package/src/components/Tree/Tree.stories.tsx +4 -5
- package/src/components/Tree/TreeItem.tsx +12 -4
- package/src/components/Tree/TreeItemHeading.tsx +1 -4
- package/src/components/Tree/TreeItemToggle.tsx +3 -3
- package/src/components/Tree/testing.ts +5 -5
|
@@ -69,10 +69,10 @@ var Accordion = {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
// src/components/List/ListItem.tsx
|
|
72
|
+
import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
72
73
|
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
73
74
|
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
74
75
|
import { setCustomNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
|
|
75
|
-
import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
76
76
|
import { createContext as createContext4 } from "@radix-ui/react-context";
|
|
77
77
|
import { Slot } from "@radix-ui/react-slot";
|
|
78
78
|
import React4, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
@@ -82,9 +82,9 @@ import { IconButton, ListItem as NaturalListItem, useTranslation } from "@dxos/r
|
|
|
82
82
|
import { mx as mx3, osTranslations } from "@dxos/ui-theme";
|
|
83
83
|
|
|
84
84
|
// src/components/List/ListRoot.tsx
|
|
85
|
-
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
86
85
|
import { extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
87
86
|
import { getReorderDestinationIndex } from "@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index";
|
|
87
|
+
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
88
88
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
89
89
|
import React3, { useCallback, useEffect, useState } from "react";
|
|
90
90
|
var LIST_NAME = "List";
|
|
@@ -156,7 +156,7 @@ var idle = {
|
|
|
156
156
|
type: "idle"
|
|
157
157
|
};
|
|
158
158
|
var stateStyles = {
|
|
159
|
-
"
|
|
159
|
+
"is-dragging": "opacity-50"
|
|
160
160
|
};
|
|
161
161
|
var defaultContext = {};
|
|
162
162
|
var LIST_ITEM_NAME = "ListItem";
|
|
@@ -164,20 +164,12 @@ var [ListItemProvider, useListItemContext] = createContext4(LIST_ITEM_NAME, defa
|
|
|
164
164
|
var ListItem = ({ children, classNames, item, asChild, selected, ...props }) => {
|
|
165
165
|
const Comp = asChild ? Slot : "div";
|
|
166
166
|
const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);
|
|
167
|
-
const
|
|
167
|
+
const rootRef = useRef(null);
|
|
168
168
|
const dragHandleRef = useRef(null);
|
|
169
169
|
const [state, setState] = useState2(idle);
|
|
170
170
|
useEffect2(() => {
|
|
171
|
-
const element =
|
|
172
|
-
invariant(element, void 0, {
|
|
173
|
-
F: __dxlog_file,
|
|
174
|
-
L: 109,
|
|
175
|
-
S: void 0,
|
|
176
|
-
A: [
|
|
177
|
-
"element",
|
|
178
|
-
""
|
|
179
|
-
]
|
|
180
|
-
});
|
|
171
|
+
const element = rootRef.current;
|
|
172
|
+
invariant(element, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 37, S: void 0, A: ["element", ""] });
|
|
181
173
|
return combine(
|
|
182
174
|
//
|
|
183
175
|
// https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable
|
|
@@ -216,10 +208,10 @@ var ListItem = ({ children, classNames, item, asChild, selected, ...props }) =>
|
|
|
216
208
|
} : void 0,
|
|
217
209
|
onDragStart: () => {
|
|
218
210
|
setState({
|
|
219
|
-
type: "
|
|
211
|
+
type: "is-dragging"
|
|
220
212
|
});
|
|
221
213
|
setRootState({
|
|
222
|
-
type: "
|
|
214
|
+
type: "is-dragging",
|
|
223
215
|
item
|
|
224
216
|
});
|
|
225
217
|
},
|
|
@@ -250,7 +242,7 @@ var ListItem = ({ children, classNames, item, asChild, selected, ...props }) =>
|
|
|
250
242
|
onDragEnter: ({ self }) => {
|
|
251
243
|
const closestEdge = extractClosestEdge2(self.data);
|
|
252
244
|
setState({
|
|
253
|
-
type: "
|
|
245
|
+
type: "is-dragging-over",
|
|
254
246
|
closestEdge
|
|
255
247
|
});
|
|
256
248
|
},
|
|
@@ -260,11 +252,11 @@ var ListItem = ({ children, classNames, item, asChild, selected, ...props }) =>
|
|
|
260
252
|
onDrag: ({ self }) => {
|
|
261
253
|
const closestEdge = extractClosestEdge2(self.data);
|
|
262
254
|
setState((current) => {
|
|
263
|
-
if (current.type === "
|
|
255
|
+
if (current.type === "is-dragging-over" && current.closestEdge === closestEdge) {
|
|
264
256
|
return current;
|
|
265
257
|
}
|
|
266
258
|
return {
|
|
267
|
-
type: "
|
|
259
|
+
type: "is-dragging-over",
|
|
268
260
|
closestEdge
|
|
269
261
|
};
|
|
270
262
|
});
|
|
@@ -281,12 +273,12 @@ var ListItem = ({ children, classNames, item, asChild, selected, ...props }) =>
|
|
|
281
273
|
item,
|
|
282
274
|
dragHandleRef
|
|
283
275
|
}, /* @__PURE__ */ React4.createElement(Comp, {
|
|
284
|
-
|
|
276
|
+
...props,
|
|
285
277
|
role: "listitem",
|
|
286
278
|
"aria-selected": selected,
|
|
287
|
-
className: mx3("relative dx-selected", classNames, stateStyles[state.type]),
|
|
288
|
-
|
|
289
|
-
}, children), state.type === "
|
|
279
|
+
className: mx3("relative p-1 dx-selected dx-hover", classNames, stateStyles[state.type]),
|
|
280
|
+
ref: rootRef
|
|
281
|
+
}, children), state.type === "is-dragging-over" && state.closestEdge && /* @__PURE__ */ React4.createElement(NaturalListItem.DropIndicator, {
|
|
290
282
|
edge: state.closestEdge
|
|
291
283
|
}));
|
|
292
284
|
};
|
|
@@ -309,12 +301,12 @@ var ListItemDeleteButton = ({ autoHide = true, classNames, disabled, icon = "ph-
|
|
|
309
301
|
const isDisabled = state.type !== "idle" || disabled;
|
|
310
302
|
const { t } = useTranslation(osTranslations);
|
|
311
303
|
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
312
|
-
iconOnly: true,
|
|
313
|
-
variant: "ghost",
|
|
314
304
|
...props,
|
|
315
|
-
|
|
305
|
+
variant: "ghost",
|
|
316
306
|
disabled: isDisabled,
|
|
317
|
-
|
|
307
|
+
icon,
|
|
308
|
+
iconOnly: true,
|
|
309
|
+
label: label ?? t("delete.label"),
|
|
318
310
|
classNames: [
|
|
319
311
|
classNames,
|
|
320
312
|
autoHide && disabled && "hidden"
|
|
@@ -325,12 +317,12 @@ var ListItemDragHandle = ({ disabled }) => {
|
|
|
325
317
|
const { dragHandleRef } = useListItemContext("DRAG_HANDLE");
|
|
326
318
|
const { t } = useTranslation(osTranslations);
|
|
327
319
|
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
328
|
-
iconOnly: true,
|
|
329
320
|
variant: "ghost",
|
|
330
|
-
|
|
331
|
-
ref: dragHandleRef,
|
|
321
|
+
disabled,
|
|
332
322
|
icon: "ph--dots-six-vertical--regular",
|
|
333
|
-
|
|
323
|
+
iconOnly: true,
|
|
324
|
+
label: t("drag-handle.label"),
|
|
325
|
+
ref: dragHandleRef
|
|
334
326
|
});
|
|
335
327
|
};
|
|
336
328
|
var ListItemDragPreview = ({ children }) => {
|
|
@@ -340,9 +332,11 @@ var ListItemDragPreview = ({ children }) => {
|
|
|
340
332
|
}), state.container) : null;
|
|
341
333
|
};
|
|
342
334
|
var ListItemWrapper = ({ classNames, children }) => /* @__PURE__ */ React4.createElement("div", {
|
|
335
|
+
role: "none",
|
|
343
336
|
className: mx3("flex w-full gap-2", classNames)
|
|
344
337
|
}, children);
|
|
345
338
|
var ListItemTitle = ({ classNames, children, ...props }) => /* @__PURE__ */ React4.createElement("div", {
|
|
339
|
+
role: "none",
|
|
346
340
|
className: mx3("flex grow items-center truncate", classNames),
|
|
347
341
|
...props
|
|
348
342
|
}, children);
|
|
@@ -372,14 +366,14 @@ var TreeProvider = TreeContext.Provider;
|
|
|
372
366
|
var useTree = () => useContext(TreeContext) ?? raise(new Error("TreeContext not found"));
|
|
373
367
|
|
|
374
368
|
// src/components/Tree/TreeItem.tsx
|
|
369
|
+
import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
375
370
|
import { combine as combine2 } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
376
371
|
import { draggable as draggable2, dropTargetForElements as dropTargetForElements2 } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
377
|
-
import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
378
372
|
import { useAtomValue } from "@effect-atom/atom-react";
|
|
379
373
|
import * as Schema from "effect/Schema";
|
|
380
374
|
import React7, { memo as memo3, useCallback as useCallback3, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
381
375
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
382
|
-
import { TreeItem as NaturalTreeItem, Treegrid } from "@dxos/react-ui";
|
|
376
|
+
import { TreeItem as NaturalTreeItem, Treegrid, TREEGRID_PARENT_OF_SEPARATOR } from "@dxos/react-ui";
|
|
383
377
|
import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, mx as mx4 } from "@dxos/ui-theme";
|
|
384
378
|
|
|
385
379
|
// src/components/Tree/helpers.ts
|
|
@@ -420,7 +414,6 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label,
|
|
|
420
414
|
}, /* @__PURE__ */ React5.createElement(Button, {
|
|
421
415
|
"data-testid": "treeItem.heading",
|
|
422
416
|
variant: "ghost",
|
|
423
|
-
density: "fine",
|
|
424
417
|
classNames: [
|
|
425
418
|
"grow gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent",
|
|
426
419
|
"disabled:cursor-default disabled:opacity-100",
|
|
@@ -434,7 +427,6 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label,
|
|
|
434
427
|
}
|
|
435
428
|
}, icon && /* @__PURE__ */ React5.createElement(Icon2, {
|
|
436
429
|
icon: icon ?? "ph--placeholder--regular",
|
|
437
|
-
size: 5,
|
|
438
430
|
classNames: [
|
|
439
431
|
"my-1",
|
|
440
432
|
styles?.surfaceText
|
|
@@ -448,7 +440,7 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label,
|
|
|
448
440
|
// src/components/Tree/TreeItemToggle.tsx
|
|
449
441
|
import React6, { forwardRef as forwardRef2, memo as memo2 } from "react";
|
|
450
442
|
import { IconButton as IconButton2 } from "@dxos/react-ui";
|
|
451
|
-
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open, isBranch, hidden,
|
|
443
|
+
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ classNames, open, isBranch, hidden, ...props }, forwardedRef) => {
|
|
452
444
|
return /* @__PURE__ */ React6.createElement(IconButton2, {
|
|
453
445
|
ref: forwardedRef,
|
|
454
446
|
"data-testid": "treeItem.toggle",
|
|
@@ -457,8 +449,8 @@ var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open,
|
|
|
457
449
|
density: "fine",
|
|
458
450
|
classNames: [
|
|
459
451
|
"h-full w-6 px-0",
|
|
460
|
-
"[&_svg]:transition-
|
|
461
|
-
open
|
|
452
|
+
"[&_svg]:transition-transform [&_svg]:duration-200",
|
|
453
|
+
open ? "[&_svg]:rotate-90" : "[&_svg]:rotate-0",
|
|
462
454
|
hidden ? "hidden" : !isBranch && "invisible",
|
|
463
455
|
classNames
|
|
464
456
|
],
|
|
@@ -513,6 +505,7 @@ var RawTreeItem = ({ item, path: pathProp, levelOffset = 2, last, draggable: dra
|
|
|
513
505
|
path,
|
|
514
506
|
item
|
|
515
507
|
};
|
|
508
|
+
const shouldSeedNativeDragData = typeof document !== "undefined" && document.body.hasAttribute("data-platform");
|
|
516
509
|
const cancelExpand = useCallback3(() => {
|
|
517
510
|
if (cancelExpandRef.current) {
|
|
518
511
|
clearTimeout(cancelExpandRef.current);
|
|
@@ -521,22 +514,23 @@ var RawTreeItem = ({ item, path: pathProp, levelOffset = 2, last, draggable: dra
|
|
|
521
514
|
}, []);
|
|
522
515
|
const isItemDraggable = draggableProp && itemDraggable !== false;
|
|
523
516
|
const isItemDroppable = itemDroppable !== false;
|
|
517
|
+
const nativeDragText = id;
|
|
524
518
|
useEffect3(() => {
|
|
525
519
|
if (!draggableProp) {
|
|
526
520
|
return;
|
|
527
521
|
}
|
|
528
|
-
invariant2(buttonRef.current, void 0, {
|
|
529
|
-
F: __dxlog_file2,
|
|
530
|
-
L: 148,
|
|
531
|
-
S: void 0,
|
|
532
|
-
A: [
|
|
533
|
-
"buttonRef.current",
|
|
534
|
-
""
|
|
535
|
-
]
|
|
536
|
-
});
|
|
522
|
+
invariant2(buttonRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 70, S: void 0, A: ["buttonRef.current", ""] });
|
|
537
523
|
const makeDraggable = () => draggable2({
|
|
538
524
|
element: buttonRef.current,
|
|
539
525
|
getInitialData: () => data,
|
|
526
|
+
getInitialDataForExternal: () => {
|
|
527
|
+
if (!shouldSeedNativeDragData) {
|
|
528
|
+
return {};
|
|
529
|
+
}
|
|
530
|
+
return {
|
|
531
|
+
"text/plain": nativeDragText
|
|
532
|
+
};
|
|
533
|
+
},
|
|
540
534
|
onDragStart: () => {
|
|
541
535
|
setState("dragging");
|
|
542
536
|
if (open) {
|
|
@@ -720,7 +714,7 @@ var RawTreeItem = ({ item, path: pathProp, levelOffset = 2, last, draggable: dra
|
|
|
720
714
|
key: id,
|
|
721
715
|
id,
|
|
722
716
|
"aria-labelledby": `${id}__label`,
|
|
723
|
-
parentOf: parentOf?.join(
|
|
717
|
+
parentOf: parentOf?.join(TREEGRID_PARENT_OF_SEPARATOR),
|
|
724
718
|
"data-object-id": id,
|
|
725
719
|
"data-testid": testId,
|
|
726
720
|
// NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Accordion/AccordionItem.tsx", "../../../src/components/Accordion/AccordionRoot.tsx", "../../../src/components/Accordion/Accordion.tsx", "../../../src/components/List/ListItem.tsx", "../../../src/components/List/ListRoot.tsx", "../../../src/components/List/List.tsx", "../../../src/components/Tree/Tree.tsx", "../../../src/components/Tree/TreeContext.tsx", "../../../src/components/Tree/TreeItem.tsx", "../../../src/components/Tree/helpers.ts", "../../../src/components/Tree/TreeItemHeading.tsx", "../../../src/components/Tree/TreeItemToggle.tsx", "../../../src/util/path.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { type ListItemRecord } from '../List';\n\nimport { useAccordionContext } from './AccordionRoot';\n\nconst ACCORDION_ITEM_NAME = 'AccordionItem';\n\ntype AccordionItemContext<T extends ListItemRecord> = {\n item: T;\n};\n\n// TODO(wittjosiah): This seems to be conflicting with something in the bundle.\n// Perhaps @radix-ui/react-accordion?\nexport const [AccordionItemProvider, useDxAccordionItemContext] =\n createContext<AccordionItemContext<any>>(ACCORDION_ITEM_NAME);\n\nexport type AccordionItemProps<T extends ListItemRecord> = ThemedClassName<PropsWithChildren<{ item: T }>>;\n\nexport const AccordionItem = <T extends ListItemRecord>({ children, classNames, item }: AccordionItemProps<T>) => {\n const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);\n\n return (\n <AccordionItemProvider {...{ item }}>\n <AccordionPrimitive.Item value={getId(item)} className={mx('overflow-hidden', classNames)}>\n {children}\n </AccordionPrimitive.Item>\n </AccordionItemProvider>\n );\n};\n\nexport type AccordionItemHeaderProps = ThemedClassName<AccordionPrimitive.AccordionHeaderProps>;\n\nexport const AccordionItemHeader = ({ classNames, children, ...props }: AccordionItemHeaderProps) => {\n return (\n <AccordionPrimitive.Header {...props} className={mx(classNames)}>\n <AccordionPrimitive.Trigger className='group flex items-center p-2 dx-focus-ring-inset w-full text-start'>\n {children}\n <Icon\n icon='ph--caret-right--regular'\n size={4}\n classNames='transition-transform duration-200 group-data-[state=open]:rotate-90'\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n};\n\nexport type AccordionItemBodyProps = ThemedClassName<PropsWithChildren>;\n\nexport const AccordionItemBody = ({ children, classNames }: AccordionItemBodyProps) => {\n return (\n <AccordionPrimitive.Content className='overflow-hidden data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down'>\n <div role='none' className={mx('p-2', classNames)}>\n {children}\n </div>\n </AccordionPrimitive.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { type ListItemRecord } from '../List';\n\ntype AccordionContext<T extends ListItemRecord> = {\n getId: (item: T) => string;\n};\n\nconst ACCORDION_NAME = 'Accordion';\n\nexport const [AccordionProvider, useAccordionContext] = createContext<AccordionContext<any>>(ACCORDION_NAME);\n\nexport type AccordionRendererProps<T extends ListItemRecord> = {\n items: T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type AccordionRootProps<T extends ListItemRecord> = ThemedClassName<\n {\n children?: (props: AccordionRendererProps<T>) => ReactNode;\n items?: T[];\n } & Partial<Pick<AccordionContext<T>, 'getId'>>\n>;\n\nexport const AccordionRoot = <T extends ListItemRecord>({\n classNames,\n items,\n getId = defaultGetId,\n children,\n value,\n defaultValue,\n onValueChange,\n}: AccordionRootProps<T> &\n Pick<AccordionPrimitive.AccordionMultipleProps, 'value' | 'defaultValue' | 'onValueChange'>) => {\n return (\n <AccordionProvider {...{ getId }}>\n <AccordionPrimitive.Root\n type='multiple'\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n className={mx(classNames)}\n >\n {children?.({ items: items ?? [] })}\n </AccordionPrimitive.Root>\n </AccordionProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AccordionItem, AccordionItemBody, AccordionItemHeader } from './AccordionItem';\nimport { AccordionRoot } from './AccordionRoot';\n\n// TODO(burdon): Next iteration should be based on Radix UI Accordion:\n// https://www.radix-ui.com/primitives/docs/components/accordion\n// TODO(burdon): Support key navigation.\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n ItemHeader: AccordionItemHeader,\n ItemBody: AccordionItemBody,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { createContext } from '@radix-ui/react-context';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type ComponentProps,\n type HTMLAttributes,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { invariant } from '@dxos/invariant';\nimport {\n IconButton,\n type IconButtonProps,\n ListItem as NaturalListItem,\n type ThemedClassName,\n useTranslation,\n} from '@dxos/react-ui';\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useListContext } from './ListRoot';\n\nexport type ListItemRecord = any;\n\nexport type ItemDragState =\n | {\n type: 'idle';\n }\n | {\n type: 'preview';\n container: HTMLElement;\n }\n | {\n type: 'w-dragging';\n }\n | {\n type: 'w-dragging-over';\n closestEdge: Edge | null;\n };\n\nexport const idle: ItemDragState = { type: 'idle' };\n\nconst stateStyles: { [Key in ItemDragState['type']]?: HTMLAttributes<HTMLDivElement>['className'] } = {\n 'w-dragging': 'opacity-50',\n};\n\ntype ListItemContext<T extends ListItemRecord> = {\n item: T;\n dragHandleRef: MutableRefObject<HTMLElement | null>;\n};\n\n/**\n * Default context defined for ListItemDragPreview, which is defined outside of ListItem.\n */\nconst defaultContext: ListItemContext<any> = {} as any;\n\nconst LIST_ITEM_NAME = 'ListItem';\n\nexport const [ListItemProvider, useListItemContext] = createContext<ListItemContext<any>>(\n LIST_ITEM_NAME,\n defaultContext,\n);\n\nexport type ListItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<\n {\n item: T;\n asChild?: boolean;\n selected?: boolean;\n } & HTMLAttributes<HTMLDivElement>\n >\n>;\n\n/**\n * Draggable list item.\n */\nexport const ListItem = <T extends ListItemRecord>({\n children,\n classNames,\n item,\n asChild,\n selected,\n ...props\n}: ListItemProps<T>) => {\n const Comp = asChild ? Slot : 'div';\n const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);\n const ref = useRef<HTMLDivElement | null>(null);\n const dragHandleRef = useRef<HTMLElement | null>(null);\n const [state, setState] = useState<ItemDragState>(idle);\n\n useEffect(() => {\n const element = ref.current;\n invariant(element);\n return combine(\n //\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable\n //\n draggable({\n element,\n dragHandle: dragHandleRef.current!,\n canDrag: () => !readonly,\n getInitialData: () => item as any,\n onGenerateDragPreview: dragPreview\n ? ({ nativeSetDragImage, source }) => {\n const rect = source.element.getBoundingClientRect();\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: ({ container }) => {\n const { height } = container.getBoundingClientRect();\n return { x: 20, y: height / 2 };\n },\n render: ({ container }) => {\n container.style.width = rect.width + 'px';\n setState({ type: 'preview', container });\n setRootState({ type: 'preview', container, item });\n return () => {}; // TODO(burdon): Cleanup.\n },\n });\n }\n : undefined,\n onDragStart: () => {\n setState({ type: 'w-dragging' });\n setRootState({ type: 'w-dragging', item });\n },\n onDrop: () => {\n setState(idle);\n setRootState(idle);\n },\n }),\n\n //\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements\n //\n dropTargetForElements({\n element,\n canDrop: ({ source }) => {\n return (source.element !== element && isItem?.(source.data)) ?? false;\n },\n getData: ({ input }) => {\n return attachClosestEdge(item as any, { element, input, allowedEdges: ['top', 'bottom'] });\n },\n getIsSticky: () => true,\n onDragEnter: ({ self }) => {\n const closestEdge = extractClosestEdge(self.data);\n setState({ type: 'w-dragging-over', closestEdge });\n },\n onDragLeave: () => {\n setState(idle);\n },\n onDrag: ({ self }) => {\n const closestEdge = extractClosestEdge(self.data);\n setState((current) => {\n if (current.type === 'w-dragging-over' && current.closestEdge === closestEdge) {\n return current;\n }\n return { type: 'w-dragging-over', closestEdge };\n });\n },\n onDrop: () => {\n setState(idle);\n },\n }),\n );\n }, [item]);\n\n return (\n <ListItemProvider item={item} dragHandleRef={dragHandleRef}>\n <Comp\n ref={ref}\n role='listitem'\n aria-selected={selected}\n className={mx('relative dx-selected', classNames, stateStyles[state.type])}\n {...props}\n >\n {children}\n </Comp>\n {state.type === 'w-dragging-over' && state.closestEdge && (\n <NaturalListItem.DropIndicator edge={state.closestEdge} />\n )}\n </ListItemProvider>\n );\n};\n\n//\n// List item components\n//\n\nexport const ListItemIconButton = ({\n autoHide = true,\n iconOnly = true,\n variant = 'ghost',\n classNames,\n disabled,\n ...props\n}: IconButtonProps & { autoHide?: boolean }) => {\n const { state } = useListContext('ITEM_BUTTON');\n const isDisabled = state.type !== 'idle' || disabled;\n return (\n <IconButton\n {...props}\n disabled={isDisabled}\n iconOnly={iconOnly}\n variant={variant}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n );\n};\n\n// TODO(burdon): Generalize to action button.\nexport const ListItemDeleteButton = ({\n autoHide = true,\n classNames,\n disabled,\n icon = 'ph--x--regular',\n label,\n ...props\n}: Partial<Pick<IconButtonProps, 'icon'>> &\n Omit<IconButtonProps, 'icon' | 'label'> & { autoHide?: boolean; label?: string }) => {\n const { state } = useListContext('DELETE_BUTTON');\n const isDisabled = state.type !== 'idle' || disabled;\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n iconOnly\n variant='ghost'\n {...props}\n icon={icon}\n disabled={isDisabled}\n label={label ?? t('delete label')}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n );\n};\n\nexport const ListItemDragHandle = ({ disabled }: Pick<IconButtonProps, 'disabled'>) => {\n const { dragHandleRef } = useListItemContext('DRAG_HANDLE');\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n iconOnly\n variant='ghost'\n label={t('drag handle label')}\n ref={dragHandleRef as any}\n icon='ph--dots-six-vertical--regular'\n disabled={disabled}\n />\n );\n};\n\nexport const ListItemDragPreview = <T extends ListItemRecord>({\n children,\n}: {\n children: ({ item }: { item: T }) => ReactNode;\n}) => {\n const { state } = useListContext('DRAG_PREVIEW');\n return state?.type === 'preview' ? createPortal(children({ item: state.item }), state.container) : null;\n};\n\nexport const ListItemWrapper = ({ classNames, children }: ThemedClassName<PropsWithChildren>) => (\n <div className={mx('flex w-full gap-2', classNames)}>{children}</div>\n);\n\nexport const ListItemTitle = ({\n classNames,\n children,\n ...props\n}: ThemedClassName<PropsWithChildren<ComponentProps<'div'>>>) => (\n <div className={mx('flex grow items-center truncate', classNames)} {...props}>\n {children}\n </div>\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode, useCallback, useEffect, useState } from 'react';\n\nimport { type ItemDragState, type ListItemRecord, idle } from './ListItem';\n\ntype ListContext<T extends ListItemRecord> = {\n // TODO(burdon): Rename drag state.\n state: ItemDragState & { item?: T };\n setState: (state: ItemDragState & { item?: T }) => void;\n readonly?: boolean;\n dragPreview?: boolean;\n isItem?: (item: any) => boolean;\n getId?: (item: T) => string; // TODO(burdon): Require if T doesn't conform to type.\n};\n\nconst LIST_NAME = 'List';\n\nexport const [ListProvider, useListContext] = createContext<ListContext<any>>(LIST_NAME);\n\nexport type ListRendererProps<T extends ListItemRecord> = {\n state: ListContext<T>['state'];\n items: readonly T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type ListRootProps<T extends ListItemRecord> = {\n children?: (props: ListRendererProps<T>) => ReactNode;\n items?: readonly T[];\n onMove?: (fromIndex: number, toIndex: number) => void;\n} & Pick<ListContext<T>, 'isItem' | 'getId' | 'readonly' | 'dragPreview'>;\n\nexport const ListRoot = <T extends ListItemRecord>({\n children,\n items,\n isItem,\n getId = defaultGetId,\n onMove,\n ...props\n}: ListRootProps<T>) => {\n const isEqual = useCallback(\n (a: T, b: T) => {\n const idA = getId?.(a);\n const idB = getId?.(b);\n\n if (idA !== undefined && idB !== undefined) {\n return idA === idB;\n } else {\n // Fallback for primitive values or when getId fails.\n // NOTE(ZaymonFC): After drag and drop, pragmatic internally serializes drop targets which breaks reference equality.\n // You must provide an `getId` function that returns a stable identifier for your items.\n return a === b;\n }\n },\n [getId],\n );\n\n const [state, setState] = useState<ListContext<T>['state']>(idle);\n useEffect(() => {\n if (!items) {\n return;\n }\n\n return monitorForElements({\n canMonitor: ({ source }) => isItem?.(source.data) ?? false,\n onDrop: ({ location, source }) => {\n const target = location.current.dropTargets[0];\n if (!target) {\n return;\n }\n\n const sourceData = source.data;\n const targetData = target.data;\n if (!isItem?.(sourceData) || !isItem?.(targetData)) {\n return;\n }\n\n const sourceIdx = items.findIndex((item) => isEqual(item, sourceData as T));\n const targetIdx = items.findIndex((item) => isEqual(item, targetData as T));\n if (targetIdx < 0 || sourceIdx < 0) {\n return;\n }\n const closestEdgeOfTarget = extractClosestEdge(targetData);\n const destinationIndex = getReorderDestinationIndex({\n closestEdgeOfTarget,\n startIndex: sourceIdx,\n indexOfTarget: targetIdx,\n axis: 'vertical',\n });\n\n onMove?.(sourceIdx, destinationIndex);\n },\n });\n }, [items, isEqual, onMove]);\n\n return (\n <ListProvider {...{ state, setState, isItem, ...props }}>{children?.({ state, items: items ?? [] })}</ListProvider>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n ListItem,\n ListItemIconButton,\n ListItemDeleteButton,\n ListItemDragHandle,\n ListItemDragPreview,\n type ListItemProps,\n type ListItemRecord,\n ListItemTitle,\n ListItemWrapper,\n} from './ListItem';\nimport { ListRoot, type ListRootProps } from './ListRoot';\n\n// TODO(burdon): Multi-select model.\n// TODO(burdon): Key nav.\n// TODO(burdon): Animation.\n// TODO(burdon): Constrain axis.\n// TODO(burdon): Tree view.\n// TODO(burdon): Fix autoscroll while dragging.\n\n/**\n * Draggable list.\n * Ref: https://github.com/atlassian/pragmatic-drag-and-drop\n * Ref: https://github.com/alexreardon/pdnd-react-tailwind/blob/main/src/task.tsx\n */\nexport const List = {\n Root: ListRoot,\n Item: ListItem,\n ItemDragPreview: ListItemDragPreview,\n ItemWrapper: ListItemWrapper,\n ItemDragHandle: ListItemDragHandle,\n ItemIconButton: ListItemIconButton,\n ItemDeleteButton: ListItemDeleteButton,\n ItemTitle: ListItemTitle,\n};\n\ntype ListItem = ListItemRecord;\n\nexport type { ListRootProps, ListItemProps, ListItem, ListItemRecord };\n", "//\n// Copyright 2024 DXOS.org\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { useMemo } from 'react';\n\nimport { Treegrid, type TreegridRootProps } from '@dxos/react-ui';\n\nimport { type TreeModel, TreeProvider } from './TreeContext';\nimport { TreeItemById, type TreeItemByIdProps, type TreeItemProps } from './TreeItem';\n\nexport type TreeProps<T extends { id: string } = any> = {\n model: TreeModel<T>;\n rootId?: string;\n path?: string[];\n id: string;\n} & Partial<Pick<TreegridRootProps, 'gridTemplateColumns' | 'classNames'>> &\n Pick<\n TreeItemProps<T>,\n | 'draggable'\n | 'renderColumns'\n | 'blockInstruction'\n | 'canDrop'\n | 'canSelect'\n | 'onOpenChange'\n | 'onSelect'\n | 'onItemHover'\n | 'levelOffset'\n >;\n\nexport const Tree = <T extends { id: string } = any>({\n model,\n rootId,\n path,\n id,\n draggable = false,\n gridTemplateColumns = '[tree-row-start] 1fr min-content [tree-row-end]',\n classNames,\n levelOffset,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeProps<T>) => {\n const childIds = useAtomValue(model.childIds(rootId));\n const treePath = useMemo(() => (path ? [...path, id] : [id]), [id, path]);\n\n const childProps: Omit<TreeItemByIdProps, 'id' | 'last'> = {\n path: treePath,\n levelOffset,\n draggable,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n };\n\n return (\n <Treegrid.Root gridTemplateColumns={gridTemplateColumns} classNames={classNames}>\n <TreeProvider value={model}>\n {childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} last={index === childIds.length - 1} {...childProps} />\n ))}\n </TreeProvider>\n </Treegrid.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { type Label } from '@dxos/react-ui';\n\nexport type TreeItemDataProps = {\n id: string;\n label: Label;\n parentOf?: string[];\n /** When `false`, the item cannot be dragged (overrides tree-level `draggable`). */\n draggable?: boolean;\n /** When `false`, the item does not participate as a drop target. */\n droppable?: boolean;\n className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n testId?: string;\n};\n\nexport interface TreeModel<T extends { id: string } = any> {\n /** Atom family: resolve item by ID (content). */\n item: (id: string) => Atom.Atom<T | undefined>;\n /** Atom family: open state keyed by path. */\n itemOpen: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: current (selected) state keyed by path. */\n itemCurrent: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: display props for an item at a given path (path includes item's own ID at end). */\n itemProps: (path: string[]) => Atom.Atom<TreeItemDataProps>;\n /** Atom family: outbound child IDs for a parent ID (topology). Undefined = root. */\n childIds: (parentId?: string) => Atom.Atom<string[]>;\n}\n\nconst TreeContext = createContext<TreeModel | null>(null);\n\nexport const TreeProvider = TreeContext.Provider;\n\nexport const useTree = () => useContext(TreeContext) ?? raise(new Error('TreeContext not found'));\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport {\n type Instruction,\n type ItemMode,\n attachInstruction,\n extractInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\nimport React, {\n type FC,\n type KeyboardEvent,\n type MouseEvent,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { TreeItem as NaturalTreeItem, Treegrid } from '@dxos/react-ui';\nimport {\n ghostFocusWithin,\n ghostHover,\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/ui-theme';\n\nimport { DEFAULT_INDENTATION, paddingIndentation } from './helpers';\nimport { useTree } from './TreeContext';\nimport { TreeItemHeading } from './TreeItemHeading';\nimport { TreeItemToggle } from './TreeItemToggle';\n\nconst hoverableDescriptionIcons =\n '[--icons-color:inherit] hover-hover:[--icons-color:var(--description-text)] hover-hover:hover:[--icons-color:inherit] focus-within:[--icons-color:inherit]';\n\ntype TreeItemDragState = 'idle' | 'dragging' | 'preview' | 'parent-of-instruction';\n\nexport const TreeDataSchema = Schema.Struct({\n id: Schema.String,\n path: Schema.Array(Schema.String),\n item: Schema.Any,\n});\n\nexport type TreeData = Schema.Schema.Type<typeof TreeDataSchema>;\nexport const isTreeData = (data: unknown): data is TreeData => Schema.is(TreeDataSchema)(data);\n\nexport type ColumnRenderer<T extends { id: string } = any> = FC<{\n item: T;\n path: string[];\n open: boolean;\n menuOpen: boolean;\n setMenuOpen: (open: boolean) => void;\n}>;\n\nexport type TreeItemProps<T extends { id: string } = any> = {\n item: T;\n path: string[];\n levelOffset?: number;\n last: boolean;\n draggable?: boolean;\n renderColumns?: ColumnRenderer<T>;\n blockInstruction?: (params: { instruction: Instruction; source: TreeData; target: TreeData }) => boolean;\n canDrop?: (params: { source: TreeData; target: TreeData }) => boolean;\n canSelect?: (params: { item: T; path: string[] }) => boolean;\n onOpenChange?: (params: { item: T; path: string[]; open: boolean }) => void;\n onSelect?: (params: { item: T; path: string[]; current: boolean; option: boolean }) => void;\n onItemHover?: (params: { item: T }) => void;\n};\n\nconst RawTreeItem = <T extends { id: string } = any>({\n item,\n path: pathProp,\n levelOffset = 2,\n last,\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeItemProps<T>) => {\n const rowRef = useRef<HTMLDivElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const openRef = useRef(false);\n const cancelExpandRef = useRef<NodeJS.Timeout | null>(null);\n const [_state, setState] = useState<TreeItemDragState>('idle');\n const [instruction, setInstruction] = useState<Instruction | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const {\n itemProps: itemPropsAtom,\n childIds: childIdsAtom,\n itemOpen: itemOpenAtom,\n itemCurrent: itemCurrentAtom,\n } = useTree();\n const path = useMemo(() => [...pathProp, item.id], [pathProp, item.id]);\n\n const {\n id,\n parentOf,\n draggable: itemDraggable,\n droppable: itemDroppable,\n label,\n className,\n headingClassName,\n icon,\n iconHue,\n disabled,\n testId,\n } = useAtomValue(itemPropsAtom(path));\n const childIds = useAtomValue(childIdsAtom(item.id));\n const open = useAtomValue(itemOpenAtom(path));\n const current = useAtomValue(itemCurrentAtom(path));\n\n const level = path.length - levelOffset;\n const isBranch = !!parentOf;\n const mode: ItemMode = last ? 'last-in-group' : open ? 'expanded' : 'standard';\n const canSelectItem = canSelect?.({ item, path }) ?? true;\n const data = { id, path, item } satisfies TreeData;\n\n const cancelExpand = useCallback(() => {\n if (cancelExpandRef.current) {\n clearTimeout(cancelExpandRef.current);\n cancelExpandRef.current = null;\n }\n }, []);\n\n const isItemDraggable = draggableProp && itemDraggable !== false;\n const isItemDroppable = itemDroppable !== false;\n\n useEffect(() => {\n if (!draggableProp) {\n return;\n }\n\n invariant(buttonRef.current);\n\n const makeDraggable = () =>\n draggable({\n element: buttonRef.current!,\n getInitialData: () => data,\n onDragStart: () => {\n setState('dragging');\n if (open) {\n openRef.current = true;\n onOpenChange?.({ item, path, open: false });\n }\n },\n onDrop: () => {\n setState('idle');\n if (openRef.current) {\n onOpenChange?.({ item, path, open: true });\n }\n },\n });\n\n if (!isItemDroppable) {\n return isItemDraggable ? makeDraggable() : undefined;\n }\n\n const dropTarget = dropTargetForElements({\n element: buttonRef.current,\n getData: ({ input, element }) => {\n return attachInstruction(data, {\n input,\n element,\n indentPerLevel: DEFAULT_INDENTATION,\n currentLevel: level,\n mode,\n block: isBranch ? [] : ['make-child'],\n });\n },\n canDrop: ({ source }) => {\n const _canDrop = canDrop ?? (() => true);\n return source.element !== buttonRef.current && _canDrop({ source: source.data as TreeData, target: data });\n },\n getIsSticky: () => true,\n onDrag: ({ self, source }) => {\n const desired = extractInstruction(self.data);\n const block =\n desired && blockInstruction?.({ instruction: desired, source: source.data as TreeData, target: data });\n const instruction: Instruction | null =\n block && desired.type !== 'instruction-blocked' ? { type: 'instruction-blocked', desired } : desired;\n\n if (source.data.id !== id) {\n if (instruction?.type === 'make-child' && isBranch && !open && !cancelExpandRef.current) {\n cancelExpandRef.current = setTimeout(() => {\n onOpenChange?.({ item, path, open: true });\n }, 500);\n }\n\n if (instruction?.type !== 'make-child') {\n cancelExpand();\n }\n\n setInstruction(instruction);\n } else if (instruction?.type === 'reparent') {\n // TODO(wittjosiah): This is not occurring in the current implementation.\n setInstruction(instruction);\n } else {\n setInstruction(null);\n }\n },\n onDragLeave: () => {\n cancelExpand();\n setInstruction(null);\n },\n onDrop: () => {\n cancelExpand();\n setInstruction(null);\n },\n });\n\n if (!isItemDraggable) {\n return dropTarget;\n }\n\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about\n return combine(makeDraggable(), dropTarget);\n }, [draggableProp, isItemDraggable, isItemDroppable, item, id, mode, path, open, blockInstruction, canDrop]);\n\n // Cancel expand on unmount.\n useEffect(() => () => cancelExpand(), [cancelExpand]);\n\n const handleOpenToggle = useCallback(\n () => onOpenChange?.({ item, path, open: !open }),\n [onOpenChange, item, path, open],\n );\n\n const handleSelect = useCallback(\n (option = false) => {\n // If the item is a branch, toggle it if:\n // - also holding down the option key\n // - or the item is currently selected\n if (isBranch && (option || current)) {\n handleOpenToggle();\n } else if (canSelectItem) {\n canSelect?.({ item, path });\n rowRef.current?.focus();\n onSelect?.({ item, path, current: !current, option });\n }\n },\n [item, path, current, isBranch, canSelectItem, handleOpenToggle, onSelect],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowLeft':\n isBranch && handleOpenToggle();\n break;\n }\n },\n [isBranch, open, handleOpenToggle, handleSelect],\n );\n\n const handleItemHover = useCallback(() => {\n onItemHover?.({ item });\n }, [onItemHover, item]);\n\n const handleContextMenu = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n setMenuOpen(true);\n },\n [setMenuOpen],\n );\n\n const childProps = {\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onItemHover,\n onOpenChange,\n onSelect,\n };\n\n return (\n <>\n <Treegrid.Row\n ref={rowRef}\n key={id}\n id={id}\n aria-labelledby={`${id}__label`}\n parentOf={parentOf?.join(Treegrid.PARENT_OF_SEPARATOR)}\n data-object-id={id}\n data-testid={testId}\n // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS\n // without alerting the user (except for in the correct link element). See also:\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description\n aria-current={current ? ('' as 'page') : undefined}\n classNames={mx(\n 'grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-active-surface',\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n hoverableDescriptionIcons,\n ghostFocusWithin,\n ghostHover,\n className,\n )}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleItemHover}\n onContextMenu={handleContextMenu}\n >\n <div\n role='none'\n className='indent relative grid grid-cols-subgrid col-[tree-row]'\n style={paddingIndentation(level)}\n >\n <Treegrid.Cell classNames='flex items-center'>\n <TreeItemToggle isBranch={isBranch} open={open} onClick={handleOpenToggle} />\n <TreeItemHeading\n disabled={disabled}\n current={current}\n label={label}\n className={headingClassName}\n icon={icon}\n iconHue={iconHue}\n onSelect={handleSelect}\n ref={buttonRef}\n />\n </Treegrid.Cell>\n {Columns && <Columns item={item} path={path} open={open} menuOpen={menuOpen} setMenuOpen={setMenuOpen} />}\n {instruction && <NaturalTreeItem.DropIndicator instruction={instruction} gap={2} />}\n </div>\n </Treegrid.Row>\n {open &&\n childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} path={path} last={index === childIds.length - 1} {...childProps} />\n ))}\n </>\n );\n};\n\nexport const TreeItem = memo(RawTreeItem) as FC<TreeItemProps>;\n\n/** Resolves a child ID to an item via the `item` atom and renders a TreeItem. */\nexport type TreeItemByIdProps = Omit<TreeItemProps, 'item'> & { id: string };\n\nconst RawTreeItemById = <T extends { id: string } = any>({ id, ...props }: TreeItemByIdProps) => {\n const { item: itemAtom } = useTree();\n const item = useAtomValue(itemAtom(id)) as T | undefined;\n if (!item) {\n return null;\n }\n return <TreeItem item={item} {...props} />;\n};\n\nexport const TreeItemById = memo(RawTreeItemById) as FC<TreeItemByIdProps>;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const DEFAULT_INDENTATION = 8;\n\nexport const paddingIndentation = (level: number, indentation = DEFAULT_INDENTATION) => ({\n paddingInlineStart: `${(level - 1) * indentation}px`,\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type KeyboardEvent, type MouseEvent, forwardRef, memo, useCallback } from 'react';\n\nimport { Button, Icon, type Label, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { TextTooltip } from '@dxos/react-ui-text-tooltip';\nimport { getStyles } from '@dxos/ui-theme';\n\n// TODO(wittjosiah): Consider whether there should be a separate disabled prop which was visually distinct\n// rather than just making the item unselectable.\nexport type TreeItemHeadingProps = {\n label: Label;\n className?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n current?: boolean;\n onSelect?: (option: boolean) => void;\n};\n\nexport const TreeItemHeading = memo(\n forwardRef<HTMLButtonElement, TreeItemHeadingProps>(\n ({ label, className, icon, iconHue, disabled, current, onSelect }, forwardedRef) => {\n const { t } = useTranslation();\n const styles = iconHue ? getStyles(iconHue) : undefined;\n\n const handleSelect = useCallback(\n (event: MouseEvent) => {\n onSelect?.(event.altKey);\n },\n [onSelect],\n );\n\n const handleButtonKeydown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n onSelect?.(event.altKey);\n }\n },\n [onSelect],\n );\n\n return (\n <TextTooltip\n text={toLocalizedString(label, t)}\n side='bottom'\n truncateQuery='span[data-tooltip]'\n onlyWhenTruncating\n asChild\n ref={forwardedRef}\n >\n <Button\n data-testid='treeItem.heading'\n variant='ghost'\n density='fine'\n classNames={[\n 'grow gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent',\n 'disabled:cursor-default disabled:opacity-100',\n className,\n ]}\n disabled={disabled}\n onClick={handleSelect}\n onKeyDown={handleButtonKeydown}\n {...(current && { 'aria-current': 'location' })}\n >\n {icon && (\n <Icon icon={icon ?? 'ph--placeholder--regular'} size={5} classNames={['my-1', styles?.surfaceText]} />\n )}\n <span className='flex-1 w-0 truncate text-start font-normal' data-tooltip>\n {toLocalizedString(label, t)}\n </span>\n </Button>\n </TextTooltip>\n );\n },\n ),\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { forwardRef, memo } from 'react';\n\nimport { IconButton, type IconButtonProps } from '@dxos/react-ui';\n\nexport type TreeItemToggleProps = Omit<IconButtonProps, 'icon' | 'size' | 'label'> & {\n open?: boolean;\n isBranch?: boolean;\n hidden?: boolean;\n};\n\nexport const TreeItemToggle = memo(\n forwardRef<HTMLButtonElement, TreeItemToggleProps>(\n ({ open, isBranch, hidden, classNames, ...props }, forwardedRef) => {\n return (\n <IconButton\n ref={forwardedRef}\n data-testid='treeItem.toggle'\n aria-expanded={open}\n variant='ghost'\n density='fine'\n classNames={[\n 'h-full w-6 px-0',\n '[&_svg]:transition-[transform] [&_svg]:duration-200',\n open && '[&_svg]:rotate-90',\n hidden ? 'hidden' : !isBranch && 'invisible',\n classNames,\n ]}\n size={3}\n icon='ph--caret-right--bold'\n iconOnly\n noTooltip\n label={open ? 'Click to close' : 'Click to open'}\n tabIndex={-1}\n {...props}\n />\n );\n },\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nconst SEPARATOR = '+';\n\nexport const Path = {\n create: (...args: string[]) => args.join(SEPARATOR),\n\n parts: (path: string) => path.split(SEPARATOR),\n length: (path: string) => path.split(SEPARATOR).length,\n first: (path: string) => path.split(SEPARATOR)[0] ?? path,\n last: (path: string) => path.split(SEPARATOR).at(-1) ?? path,\n parent: (path: string) => path.split(SEPARATOR).slice(0, -1).join(SEPARATOR),\n\n hasRoot: (path: string, id: string) => Path.first(path) === id,\n hasChild: (path: string, compare: string) => Path.parent(compare) === path,\n hasDescendent: (path: string, compare: string) => compare !== path && compare.startsWith(path),\n siblings: (path: string, compare: string) => Path.parent(path) === Path.parent(compare),\n onPath: (path: string, id: string) => Path.parts(path).includes(id),\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,yBAAwB;AACpC,SAASC,iBAAAA,sBAAqB;AAC9B,OAAOC,YAAuC;AAE9C,SAASC,YAAkC;AAC3C,SAASC,MAAAA,WAAU;;;ACLnB,YAAYC,wBAAwB;AACpC,SAASC,qBAAqB;AAC9B,OAAOC,WAA+B;AAGtC,SAASC,UAAU;AAQnB,IAAMC,iBAAiB;AAEhB,IAAM,CAACC,mBAAmBC,mBAAAA,IAAuBC,cAAqCH,cAAAA;AAM7F,IAAMI,eAAe,CAA2BC,SAAaA,MAAcC;AASpE,IAAMC,gBAAgB,CAA2B,EACtDC,YACAC,OACAC,QAAQN,cACRO,UACAC,OACAC,cACAC,cAAa,MAE8E;AAC3F,SACE,sBAAA,cAACb,mBAAsB;IAAES;EAAM,GAC7B,sBAAA,cAAoBK,yBAAI;IACtBC,MAAK;IACLJ;IACAC;IACAC;IACAG,WAAWC,GAAGV,UAAAA;KAEbG,WAAW;IAAEF,OAAOA,SAAS,CAAA;EAAG,CAAA,CAAA,CAAA;AAI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AAQE,WAAWb,IAAAA;EACzFc,UAAU,CAACd,MAAcW,YAAoBhB,KAAKW,OAAON,IAAAA,MAAUL,KAAKW,OAAOK,OAAAA;EAC/EI,QAAQ,CAACf,MAAcS,OAAed,KAAKI,MAAMC,IAAAA,EAAMgB,SAASP,EAAAA;AAClE;",
|
|
6
|
-
"names": ["AccordionPrimitive", "createContext", "React", "Icon", "mx", "AccordionPrimitive", "createContext", "React", "mx", "ACCORDION_NAME", "AccordionProvider", "useAccordionContext", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { type ListItemRecord } from '../List';\nimport { useAccordionContext } from './AccordionRoot';\n\nconst ACCORDION_ITEM_NAME = 'AccordionItem';\n\ntype AccordionItemContext<T extends ListItemRecord> = {\n item: T;\n};\n\n// TODO(wittjosiah): This seems to be conflicting with something in the bundle.\n// Perhaps @radix-ui/react-accordion?\nexport const [AccordionItemProvider, useDxAccordionItemContext] =\n createContext<AccordionItemContext<any>>(ACCORDION_ITEM_NAME);\n\nexport type AccordionItemProps<T extends ListItemRecord> = ThemedClassName<PropsWithChildren<{ item: T }>>;\n\nexport const AccordionItem = <T extends ListItemRecord>({ children, classNames, item }: AccordionItemProps<T>) => {\n const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);\n\n return (\n <AccordionItemProvider {...{ item }}>\n <AccordionPrimitive.Item value={getId(item)} className={mx('overflow-hidden', classNames)}>\n {children}\n </AccordionPrimitive.Item>\n </AccordionItemProvider>\n );\n};\n\nexport type AccordionItemHeaderProps = ThemedClassName<AccordionPrimitive.AccordionHeaderProps>;\n\nexport const AccordionItemHeader = ({ classNames, children, ...props }: AccordionItemHeaderProps) => {\n return (\n <AccordionPrimitive.Header {...props} className={mx(classNames)}>\n <AccordionPrimitive.Trigger className='group flex items-center p-2 dx-focus-ring-inset w-full text-start'>\n {children}\n <Icon\n icon='ph--caret-right--regular'\n size={4}\n classNames='transition-transform duration-200 group-data-[state=open]:rotate-90'\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n};\n\nexport type AccordionItemBodyProps = ThemedClassName<PropsWithChildren>;\n\nexport const AccordionItemBody = ({ children, classNames }: AccordionItemBodyProps) => {\n return (\n <AccordionPrimitive.Content className='overflow-hidden data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down'>\n <div role='none' className={mx('p-2', classNames)}>\n {children}\n </div>\n </AccordionPrimitive.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { type ListItemRecord } from '../List';\n\ntype AccordionContext<T extends ListItemRecord> = {\n getId: (item: T) => string;\n};\n\nconst ACCORDION_NAME = 'Accordion';\n\nexport const [AccordionProvider, useAccordionContext] = createContext<AccordionContext<any>>(ACCORDION_NAME);\n\nexport type AccordionRendererProps<T extends ListItemRecord> = {\n items: T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type AccordionRootProps<T extends ListItemRecord> = ThemedClassName<\n {\n children?: (props: AccordionRendererProps<T>) => ReactNode;\n items?: T[];\n } & Partial<Pick<AccordionContext<T>, 'getId'>>\n>;\n\nexport const AccordionRoot = <T extends ListItemRecord>({\n classNames,\n items,\n getId = defaultGetId,\n children,\n value,\n defaultValue,\n onValueChange,\n}: AccordionRootProps<T> &\n Pick<AccordionPrimitive.AccordionMultipleProps, 'value' | 'defaultValue' | 'onValueChange'>) => {\n return (\n <AccordionProvider {...{ getId }}>\n <AccordionPrimitive.Root\n type='multiple'\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n className={mx(classNames)}\n >\n {children?.({ items: items ?? [] })}\n </AccordionPrimitive.Root>\n </AccordionProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AccordionItem, AccordionItemBody, AccordionItemHeader } from './AccordionItem';\nimport { AccordionRoot } from './AccordionRoot';\n\n// TODO(burdon): Next iteration should be based on Radix UI Accordion:\n// https://www.radix-ui.com/primitives/docs/components/accordion\n// TODO(burdon): Support key navigation.\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n ItemHeader: AccordionItemHeader,\n ItemBody: AccordionItemBody,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { createContext } from '@radix-ui/react-context';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, {\n type ComponentProps,\n type HTMLAttributes,\n type PropsWithChildren,\n type ReactNode,\n RefObject,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { invariant } from '@dxos/invariant';\nimport {\n IconButton,\n type IconButtonProps,\n ListItem as NaturalListItem,\n type ThemedClassName,\n useTranslation,\n} from '@dxos/react-ui';\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useListContext } from './ListRoot';\n\nexport type ListItemRecord = any;\n\nexport type ItemDragState =\n | {\n type: 'idle';\n }\n | {\n type: 'preview';\n container: HTMLElement;\n }\n | {\n type: 'is-dragging';\n }\n | {\n type: 'is-dragging-over';\n closestEdge: Edge | null;\n };\n\nexport const idle: ItemDragState = { type: 'idle' };\n\nconst stateStyles: { [Key in ItemDragState['type']]?: HTMLAttributes<HTMLDivElement>['className'] } = {\n 'is-dragging': 'opacity-50',\n};\n\ntype ListItemContext<T extends ListItemRecord> = {\n item: T;\n dragHandleRef: RefObject<HTMLButtonElement | null>;\n};\n\n/**\n * Default context defined for ListItemDragPreview, which is defined outside of ListItem.\n */\nconst defaultContext: ListItemContext<any> = {} as any;\n\nconst LIST_ITEM_NAME = 'ListItem';\n\nexport const [ListItemProvider, useListItemContext] = createContext<ListItemContext<any>>(\n LIST_ITEM_NAME,\n defaultContext,\n);\n\nexport type ListItemProps<T extends ListItemRecord> = ThemedClassName<\n PropsWithChildren<\n {\n item: T;\n asChild?: boolean;\n selected?: boolean;\n } & HTMLAttributes<HTMLDivElement>\n >\n>;\n\n/**\n * Draggable list item.\n */\nexport const ListItem = <T extends ListItemRecord>({\n children,\n classNames,\n item,\n asChild,\n selected,\n ...props\n}: ListItemProps<T>) => {\n const Comp = asChild ? Slot : 'div';\n const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const dragHandleRef = useRef<HTMLButtonElement | null>(null);\n const [state, setState] = useState<ItemDragState>(idle);\n\n useEffect(() => {\n const element = rootRef.current;\n invariant(element);\n return combine(\n //\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable\n //\n draggable({\n element,\n dragHandle: dragHandleRef.current!,\n canDrag: () => !readonly,\n getInitialData: () => item as any,\n onGenerateDragPreview: dragPreview\n ? ({ nativeSetDragImage, source }) => {\n const rect = source.element.getBoundingClientRect();\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: ({ container }) => {\n const { height } = container.getBoundingClientRect();\n return { x: 20, y: height / 2 };\n },\n render: ({ container }) => {\n container.style.width = rect.width + 'px';\n setState({ type: 'preview', container });\n setRootState({ type: 'preview', container, item });\n return () => {}; // TODO(burdon): Cleanup.\n },\n });\n }\n : undefined,\n onDragStart: () => {\n setState({ type: 'is-dragging' });\n setRootState({ type: 'is-dragging', item });\n },\n onDrop: () => {\n setState(idle);\n setRootState(idle);\n },\n }),\n\n //\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements\n //\n dropTargetForElements({\n element,\n canDrop: ({ source }) => {\n return (source.element !== element && isItem?.(source.data)) ?? false;\n },\n getData: ({ input }) => {\n return attachClosestEdge(item as any, { element, input, allowedEdges: ['top', 'bottom'] });\n },\n getIsSticky: () => true,\n onDragEnter: ({ self }) => {\n const closestEdge = extractClosestEdge(self.data);\n setState({ type: 'is-dragging-over', closestEdge });\n },\n onDragLeave: () => {\n setState(idle);\n },\n onDrag: ({ self }) => {\n const closestEdge = extractClosestEdge(self.data);\n setState((current) => {\n if (current.type === 'is-dragging-over' && current.closestEdge === closestEdge) {\n return current;\n }\n return { type: 'is-dragging-over', closestEdge };\n });\n },\n onDrop: () => {\n setState(idle);\n },\n }),\n );\n }, [item]);\n\n return (\n <ListItemProvider item={item} dragHandleRef={dragHandleRef}>\n <Comp\n {...props}\n role='listitem'\n aria-selected={selected}\n className={mx('relative p-1 dx-selected dx-hover', classNames, stateStyles[state.type])}\n ref={rootRef}\n >\n {children}\n </Comp>\n {state.type === 'is-dragging-over' && state.closestEdge && (\n <NaturalListItem.DropIndicator edge={state.closestEdge} />\n )}\n </ListItemProvider>\n );\n};\n\n//\n// List item components\n//\n\nexport const ListItemIconButton = ({\n autoHide = true,\n iconOnly = true,\n variant = 'ghost',\n classNames,\n disabled,\n ...props\n}: IconButtonProps & { autoHide?: boolean }) => {\n const { state } = useListContext('ITEM_BUTTON');\n const isDisabled = state.type !== 'idle' || disabled;\n return (\n <IconButton\n {...props}\n disabled={isDisabled}\n iconOnly={iconOnly}\n variant={variant}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n );\n};\n\n// TODO(burdon): Generalize to action button.\nexport const ListItemDeleteButton = ({\n autoHide = true,\n classNames,\n disabled,\n icon = 'ph--x--regular',\n label,\n ...props\n}: Partial<Pick<IconButtonProps, 'icon'>> &\n Omit<IconButtonProps, 'icon' | 'label'> & { autoHide?: boolean; label?: string }) => {\n const { state } = useListContext('DELETE_BUTTON');\n const isDisabled = state.type !== 'idle' || disabled;\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n {...props}\n variant='ghost'\n disabled={isDisabled}\n icon={icon}\n iconOnly\n label={label ?? t('delete.label')}\n classNames={[classNames, autoHide && disabled && 'hidden']}\n />\n );\n};\n\nexport const ListItemDragHandle = ({ disabled }: Pick<IconButtonProps, 'disabled'>) => {\n const { dragHandleRef } = useListItemContext('DRAG_HANDLE');\n const { t } = useTranslation(osTranslations);\n return (\n <IconButton\n variant='ghost'\n disabled={disabled}\n icon='ph--dots-six-vertical--regular'\n iconOnly\n label={t('drag-handle.label')}\n ref={dragHandleRef}\n />\n );\n};\n\nexport const ListItemDragPreview = <T extends ListItemRecord>({\n children,\n}: {\n children: ({ item }: { item: T }) => ReactNode;\n}) => {\n const { state } = useListContext('DRAG_PREVIEW');\n return state?.type === 'preview' ? createPortal(children({ item: state.item }), state.container) : null;\n};\n\nexport const ListItemWrapper = ({ classNames, children }: ThemedClassName<PropsWithChildren>) => (\n <div role='none' className={mx('flex w-full gap-2', classNames)}>\n {children}\n </div>\n);\n\nexport const ListItemTitle = ({\n classNames,\n children,\n ...props\n}: ThemedClassName<PropsWithChildren<ComponentProps<'div'>>>) => (\n <div role='none' className={mx('flex grow items-center truncate', classNames)} {...props}>\n {children}\n </div>\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactNode, useCallback, useEffect, useState } from 'react';\n\nimport { type ItemDragState, type ListItemRecord, idle } from './ListItem';\n\ntype ListContext<T extends ListItemRecord> = {\n // TODO(burdon): Rename drag state.\n state: ItemDragState & { item?: T };\n setState: (state: ItemDragState & { item?: T }) => void;\n readonly?: boolean;\n dragPreview?: boolean;\n isItem?: (item: any) => boolean;\n getId?: (item: T) => string; // TODO(burdon): Require if T doesn't conform to type.\n};\n\nconst LIST_NAME = 'List';\n\nexport const [ListProvider, useListContext] = createContext<ListContext<any>>(LIST_NAME);\n\nexport type ListRendererProps<T extends ListItemRecord> = {\n state: ListContext<T>['state'];\n items: readonly T[];\n};\n\nconst defaultGetId = <T extends ListItemRecord>(item: T) => (item as any)?.id;\n\nexport type ListRootProps<T extends ListItemRecord> = {\n children?: (props: ListRendererProps<T>) => ReactNode;\n items?: readonly T[];\n onMove?: (fromIndex: number, toIndex: number) => void;\n} & Pick<ListContext<T>, 'isItem' | 'getId' | 'readonly' | 'dragPreview'>;\n\nexport const ListRoot = <T extends ListItemRecord>({\n children,\n items,\n isItem,\n getId = defaultGetId,\n onMove,\n ...props\n}: ListRootProps<T>) => {\n const isEqual = useCallback(\n (a: T, b: T) => {\n const idA = getId?.(a);\n const idB = getId?.(b);\n\n if (idA !== undefined && idB !== undefined) {\n return idA === idB;\n } else {\n // Fallback for primitive values or when getId fails.\n // NOTE(ZaymonFC): After drag and drop, pragmatic internally serializes drop targets which breaks reference equality.\n // You must provide an `getId` function that returns a stable identifier for your items.\n return a === b;\n }\n },\n [getId],\n );\n\n const [state, setState] = useState<ListContext<T>['state']>(idle);\n useEffect(() => {\n if (!items) {\n return;\n }\n\n return monitorForElements({\n canMonitor: ({ source }) => isItem?.(source.data) ?? false,\n onDrop: ({ location, source }) => {\n const target = location.current.dropTargets[0];\n if (!target) {\n return;\n }\n\n const sourceData = source.data;\n const targetData = target.data;\n if (!isItem?.(sourceData) || !isItem?.(targetData)) {\n return;\n }\n\n const sourceIdx = items.findIndex((item) => isEqual(item, sourceData as T));\n const targetIdx = items.findIndex((item) => isEqual(item, targetData as T));\n if (targetIdx < 0 || sourceIdx < 0) {\n return;\n }\n const closestEdgeOfTarget = extractClosestEdge(targetData);\n const destinationIndex = getReorderDestinationIndex({\n closestEdgeOfTarget,\n startIndex: sourceIdx,\n indexOfTarget: targetIdx,\n axis: 'vertical',\n });\n\n onMove?.(sourceIdx, destinationIndex);\n },\n });\n }, [items, isEqual, onMove]);\n\n return (\n <ListProvider {...{ state, setState, isItem, ...props }}>{children?.({ state, items: items ?? [] })}</ListProvider>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n ListItem,\n ListItemIconButton,\n ListItemDeleteButton,\n ListItemDragHandle,\n ListItemDragPreview,\n type ListItemProps,\n type ListItemRecord,\n ListItemTitle,\n ListItemWrapper,\n} from './ListItem';\nimport { ListRoot, type ListRootProps } from './ListRoot';\n\n/**\n * Draggable list.\n * Ref: https://github.com/atlassian/pragmatic-drag-and-drop\n * Ref: https://github.com/alexreardon/pdnd-react-tailwind/blob/main/src/task.tsx\n *\n * @deprecated Use react-ui-mosaic.\n */\nexport const List = {\n Root: ListRoot,\n Item: ListItem,\n ItemDragPreview: ListItemDragPreview,\n ItemWrapper: ListItemWrapper,\n ItemDragHandle: ListItemDragHandle,\n ItemIconButton: ListItemIconButton,\n ItemDeleteButton: ListItemDeleteButton,\n ItemTitle: ListItemTitle,\n};\n\ntype ListItem = ListItemRecord;\n\nexport type { ListRootProps, ListItemProps, ListItem, ListItemRecord };\n", "//\n// Copyright 2024 DXOS.org\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { useMemo } from 'react';\n\nimport { Treegrid, type TreegridRootProps } from '@dxos/react-ui';\n\nimport { type TreeModel, TreeProvider } from './TreeContext';\nimport { TreeItemById, type TreeItemByIdProps, type TreeItemProps } from './TreeItem';\n\nexport type TreeProps<T extends { id: string } = any> = {\n model: TreeModel<T>;\n rootId?: string;\n path?: string[];\n id: string;\n} & Partial<Pick<TreegridRootProps, 'gridTemplateColumns' | 'classNames'>> &\n Pick<\n TreeItemProps<T>,\n | 'draggable'\n | 'renderColumns'\n | 'blockInstruction'\n | 'canDrop'\n | 'canSelect'\n | 'onOpenChange'\n | 'onSelect'\n | 'onItemHover'\n | 'levelOffset'\n >;\n\nexport const Tree = <T extends { id: string } = any>({\n model,\n rootId,\n path,\n id,\n draggable = false,\n gridTemplateColumns = '[tree-row-start] 1fr min-content [tree-row-end]',\n classNames,\n levelOffset,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeProps<T>) => {\n const childIds = useAtomValue(model.childIds(rootId));\n const treePath = useMemo(() => (path ? [...path, id] : [id]), [id, path]);\n\n const childProps: Omit<TreeItemByIdProps, 'id' | 'last'> = {\n path: treePath,\n levelOffset,\n draggable,\n renderColumns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n };\n\n return (\n <Treegrid.Root gridTemplateColumns={gridTemplateColumns} classNames={classNames}>\n <TreeProvider value={model}>\n {childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} last={index === childIds.length - 1} {...childProps} />\n ))}\n </TreeProvider>\n </Treegrid.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\nimport { type Label } from '@dxos/react-ui';\n\nexport type TreeItemDataProps = {\n id: string;\n label: Label;\n parentOf?: string[];\n /** When `false`, the item cannot be dragged (overrides tree-level `draggable`). */\n draggable?: boolean;\n /** When `false`, the item does not participate as a drop target. */\n droppable?: boolean;\n className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n testId?: string;\n};\n\nexport interface TreeModel<T extends { id: string } = any> {\n /** Atom family: resolve item by ID (content). */\n item: (id: string) => Atom.Atom<T | undefined>;\n /** Atom family: open state keyed by path. */\n itemOpen: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: current (selected) state keyed by path. */\n itemCurrent: (path: string[]) => Atom.Atom<boolean>;\n /** Atom family: display props for an item at a given path (path includes item's own ID at end). */\n itemProps: (path: string[]) => Atom.Atom<TreeItemDataProps>;\n /** Atom family: outbound child IDs for a parent ID (topology). Undefined = root. */\n childIds: (parentId?: string) => Atom.Atom<string[]>;\n}\n\nconst TreeContext = createContext<TreeModel | null>(null);\n\nexport const TreeProvider = TreeContext.Provider;\n\nexport const useTree = () => useContext(TreeContext) ?? raise(new Error('TreeContext not found'));\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type Instruction,\n type ItemMode,\n attachInstruction,\n extractInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\nimport React, {\n type FC,\n type KeyboardEvent,\n type MouseEvent,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { TreeItem as NaturalTreeItem, Treegrid, TREEGRID_PARENT_OF_SEPARATOR } from '@dxos/react-ui';\nimport {\n ghostFocusWithin,\n ghostHover,\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/ui-theme';\n\nimport { DEFAULT_INDENTATION, paddingIndentation } from './helpers';\nimport { useTree } from './TreeContext';\nimport { TreeItemHeading } from './TreeItemHeading';\nimport { TreeItemToggle } from './TreeItemToggle';\n\nconst hoverableDescriptionIcons =\n '[--icons-color:inherit] hover-hover:[--icons-color:var(--description-text)] hover-hover:hover:[--icons-color:inherit] focus-within:[--icons-color:inherit]';\n\ntype TreeItemDragState = 'idle' | 'dragging' | 'preview' | 'parent-of-instruction';\n\nexport const TreeDataSchema = Schema.Struct({\n id: Schema.String,\n path: Schema.Array(Schema.String),\n item: Schema.Any,\n});\n\nexport type TreeData = Schema.Schema.Type<typeof TreeDataSchema>;\nexport const isTreeData = (data: unknown): data is TreeData => Schema.is(TreeDataSchema)(data);\n\nexport type ColumnRenderer<T extends { id: string } = any> = FC<{\n item: T;\n path: string[];\n open: boolean;\n menuOpen: boolean;\n setMenuOpen: (open: boolean) => void;\n}>;\n\nexport type TreeItemProps<T extends { id: string } = any> = {\n item: T;\n path: string[];\n levelOffset?: number;\n last: boolean;\n draggable?: boolean;\n renderColumns?: ColumnRenderer<T>;\n blockInstruction?: (params: { instruction: Instruction; source: TreeData; target: TreeData }) => boolean;\n canDrop?: (params: { source: TreeData; target: TreeData }) => boolean;\n canSelect?: (params: { item: T; path: string[] }) => boolean;\n onOpenChange?: (params: { item: T; path: string[]; open: boolean }) => void;\n onSelect?: (params: { item: T; path: string[]; current: boolean; option: boolean }) => void;\n onItemHover?: (params: { item: T }) => void;\n};\n\nconst RawTreeItem = <T extends { id: string } = any>({\n item,\n path: pathProp,\n levelOffset = 2,\n last,\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n onItemHover,\n}: TreeItemProps<T>) => {\n const rowRef = useRef<HTMLDivElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const openRef = useRef(false);\n const cancelExpandRef = useRef<NodeJS.Timeout | null>(null);\n const [_state, setState] = useState<TreeItemDragState>('idle');\n const [instruction, setInstruction] = useState<Instruction | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const {\n itemProps: itemPropsAtom,\n childIds: childIdsAtom,\n itemOpen: itemOpenAtom,\n itemCurrent: itemCurrentAtom,\n } = useTree();\n const path = useMemo(() => [...pathProp, item.id], [pathProp, item.id]);\n\n const {\n id,\n parentOf,\n draggable: itemDraggable,\n droppable: itemDroppable,\n label,\n className,\n headingClassName,\n icon,\n iconHue,\n disabled,\n testId,\n } = useAtomValue(itemPropsAtom(path));\n const childIds = useAtomValue(childIdsAtom(item.id));\n const open = useAtomValue(itemOpenAtom(path));\n const current = useAtomValue(itemCurrentAtom(path));\n\n const level = path.length - levelOffset;\n const isBranch = !!parentOf;\n const mode: ItemMode = last ? 'last-in-group' : open ? 'expanded' : 'standard';\n const canSelectItem = canSelect?.({ item, path }) ?? true;\n const data = { id, path, item } satisfies TreeData;\n const shouldSeedNativeDragData = typeof document !== 'undefined' && document.body.hasAttribute('data-platform');\n\n const cancelExpand = useCallback(() => {\n if (cancelExpandRef.current) {\n clearTimeout(cancelExpandRef.current);\n cancelExpandRef.current = null;\n }\n }, []);\n\n const isItemDraggable = draggableProp && itemDraggable !== false;\n const isItemDroppable = itemDroppable !== false;\n const nativeDragText = id;\n\n useEffect(() => {\n if (!draggableProp) {\n return;\n }\n\n invariant(buttonRef.current);\n\n const makeDraggable = () =>\n draggable({\n element: buttonRef.current!,\n getInitialData: () => data,\n getInitialDataForExternal: () => {\n if (!shouldSeedNativeDragData) {\n return {};\n }\n return { 'text/plain': nativeDragText };\n },\n onDragStart: () => {\n setState('dragging');\n if (open) {\n openRef.current = true;\n onOpenChange?.({ item, path, open: false });\n }\n },\n onDrop: () => {\n setState('idle');\n if (openRef.current) {\n onOpenChange?.({ item, path, open: true });\n }\n },\n });\n\n if (!isItemDroppable) {\n return isItemDraggable ? makeDraggable() : undefined;\n }\n\n const dropTarget = dropTargetForElements({\n element: buttonRef.current,\n getData: ({ input, element }) => {\n return attachInstruction(data, {\n input,\n element,\n indentPerLevel: DEFAULT_INDENTATION,\n currentLevel: level,\n mode,\n block: isBranch ? [] : ['make-child'],\n });\n },\n canDrop: ({ source }) => {\n const _canDrop = canDrop ?? (() => true);\n return source.element !== buttonRef.current && _canDrop({ source: source.data as TreeData, target: data });\n },\n getIsSticky: () => true,\n onDrag: ({ self, source }) => {\n const desired = extractInstruction(self.data);\n const block =\n desired && blockInstruction?.({ instruction: desired, source: source.data as TreeData, target: data });\n const instruction: Instruction | null =\n block && desired.type !== 'instruction-blocked' ? { type: 'instruction-blocked', desired } : desired;\n\n if (source.data.id !== id) {\n if (instruction?.type === 'make-child' && isBranch && !open && !cancelExpandRef.current) {\n cancelExpandRef.current = setTimeout(() => {\n onOpenChange?.({ item, path, open: true });\n }, 500);\n }\n\n if (instruction?.type !== 'make-child') {\n cancelExpand();\n }\n\n setInstruction(instruction);\n } else if (instruction?.type === 'reparent') {\n // TODO(wittjosiah): This is not occurring in the current implementation.\n setInstruction(instruction);\n } else {\n setInstruction(null);\n }\n },\n onDragLeave: () => {\n cancelExpand();\n setInstruction(null);\n },\n onDrop: () => {\n cancelExpand();\n setInstruction(null);\n },\n });\n\n if (!isItemDraggable) {\n return dropTarget;\n }\n\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about\n return combine(makeDraggable(), dropTarget);\n }, [draggableProp, isItemDraggable, isItemDroppable, item, id, mode, path, open, blockInstruction, canDrop]);\n\n // Cancel expand on unmount.\n useEffect(() => () => cancelExpand(), [cancelExpand]);\n\n const handleOpenToggle = useCallback(\n () => onOpenChange?.({ item, path, open: !open }),\n [onOpenChange, item, path, open],\n );\n\n const handleSelect = useCallback(\n (option = false) => {\n // If the item is a branch, toggle it if:\n // - also holding down the option key\n // - or the item is currently selected\n if (isBranch && (option || current)) {\n handleOpenToggle();\n } else if (canSelectItem) {\n canSelect?.({ item, path });\n rowRef.current?.focus();\n onSelect?.({ item, path, current: !current, option });\n }\n },\n [item, path, current, isBranch, canSelectItem, handleOpenToggle, onSelect],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowLeft':\n isBranch && handleOpenToggle();\n break;\n }\n },\n [isBranch, open, handleOpenToggle, handleSelect],\n );\n\n const handleItemHover = useCallback(() => {\n onItemHover?.({ item });\n }, [onItemHover, item]);\n\n const handleContextMenu = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n setMenuOpen(true);\n },\n [setMenuOpen],\n );\n\n const childProps = {\n draggable: draggableProp,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onItemHover,\n onOpenChange,\n onSelect,\n };\n\n return (\n <>\n <Treegrid.Row\n ref={rowRef}\n key={id}\n id={id}\n aria-labelledby={`${id}__label`}\n parentOf={parentOf?.join(TREEGRID_PARENT_OF_SEPARATOR)}\n data-object-id={id}\n data-testid={testId}\n // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS\n // without alerting the user (except for in the correct link element). See also:\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description\n aria-current={current ? ('' as 'page') : undefined}\n classNames={mx(\n 'grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-active-surface',\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n hoverableDescriptionIcons,\n ghostFocusWithin,\n ghostHover,\n className,\n )}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleItemHover}\n onContextMenu={handleContextMenu}\n >\n <div\n role='none'\n className='indent relative grid grid-cols-subgrid col-[tree-row]'\n style={paddingIndentation(level)}\n >\n <Treegrid.Cell classNames='flex items-center'>\n <TreeItemToggle isBranch={isBranch} open={open} onClick={handleOpenToggle} />\n <TreeItemHeading\n disabled={disabled}\n current={current}\n label={label}\n className={headingClassName}\n icon={icon}\n iconHue={iconHue}\n onSelect={handleSelect}\n ref={buttonRef}\n />\n </Treegrid.Cell>\n {Columns && <Columns item={item} path={path} open={open} menuOpen={menuOpen} setMenuOpen={setMenuOpen} />}\n {instruction && <NaturalTreeItem.DropIndicator instruction={instruction} gap={2} />}\n </div>\n </Treegrid.Row>\n {open &&\n childIds.map((childId, index) => (\n <TreeItemById key={childId} id={childId} path={path} last={index === childIds.length - 1} {...childProps} />\n ))}\n </>\n );\n};\n\nexport const TreeItem = memo(RawTreeItem) as FC<TreeItemProps>;\n\n/** Resolves a child ID to an item via the `item` atom and renders a TreeItem. */\nexport type TreeItemByIdProps = Omit<TreeItemProps, 'item'> & { id: string };\n\nconst RawTreeItemById = <T extends { id: string } = any>({ id, ...props }: TreeItemByIdProps) => {\n const { item: itemAtom } = useTree();\n const item = useAtomValue(itemAtom(id)) as T | undefined;\n if (!item) {\n return null;\n }\n return <TreeItem item={item} {...props} />;\n};\n\nexport const TreeItemById = memo(RawTreeItemById) as FC<TreeItemByIdProps>;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const DEFAULT_INDENTATION = 8;\n\nexport const paddingIndentation = (level: number, indentation = DEFAULT_INDENTATION) => ({\n paddingInlineStart: `${(level - 1) * indentation}px`,\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type KeyboardEvent, type MouseEvent, forwardRef, memo, useCallback } from 'react';\n\nimport { Button, Icon, type Label, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { TextTooltip } from '@dxos/react-ui-text-tooltip';\nimport { getStyles } from '@dxos/ui-theme';\n\n// TODO(wittjosiah): Consider whether there should be a separate disabled prop which was visually distinct\n// rather than just making the item unselectable.\nexport type TreeItemHeadingProps = {\n label: Label;\n className?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n current?: boolean;\n onSelect?: (option: boolean) => void;\n};\n\nexport const TreeItemHeading = memo(\n forwardRef<HTMLButtonElement, TreeItemHeadingProps>(\n ({ label, className, icon, iconHue, disabled, current, onSelect }, forwardedRef) => {\n const { t } = useTranslation();\n const styles = iconHue ? getStyles(iconHue) : undefined;\n\n const handleSelect = useCallback(\n (event: MouseEvent) => {\n onSelect?.(event.altKey);\n },\n [onSelect],\n );\n\n const handleButtonKeydown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n onSelect?.(event.altKey);\n }\n },\n [onSelect],\n );\n\n return (\n <TextTooltip\n text={toLocalizedString(label, t)}\n side='bottom'\n truncateQuery='span[data-tooltip]'\n onlyWhenTruncating\n asChild\n ref={forwardedRef}\n >\n <Button\n data-testid='treeItem.heading'\n variant='ghost'\n classNames={[\n 'grow gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent',\n 'disabled:cursor-default disabled:opacity-100',\n className,\n ]}\n disabled={disabled}\n onClick={handleSelect}\n onKeyDown={handleButtonKeydown}\n {...(current && { 'aria-current': 'location' })}\n >\n {icon && <Icon icon={icon ?? 'ph--placeholder--regular'} classNames={['my-1', styles?.surfaceText]} />}\n <span className='flex-1 w-0 truncate text-start font-normal' data-tooltip>\n {toLocalizedString(label, t)}\n </span>\n </Button>\n </TextTooltip>\n );\n },\n ),\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { forwardRef, memo } from 'react';\n\nimport { IconButton, type IconButtonProps } from '@dxos/react-ui';\n\nexport type TreeItemToggleProps = Omit<IconButtonProps, 'icon' | 'size' | 'label'> & {\n open?: boolean;\n isBranch?: boolean;\n hidden?: boolean;\n};\n\nexport const TreeItemToggle = memo(\n forwardRef<HTMLButtonElement, TreeItemToggleProps>(\n ({ classNames, open, isBranch, hidden, ...props }, forwardedRef) => {\n return (\n <IconButton\n ref={forwardedRef}\n data-testid='treeItem.toggle'\n aria-expanded={open}\n variant='ghost'\n density='fine'\n classNames={[\n 'h-full w-6 px-0',\n '[&_svg]:transition-transform [&_svg]:duration-200',\n open ? '[&_svg]:rotate-90' : '[&_svg]:rotate-0',\n hidden ? 'hidden' : !isBranch && 'invisible',\n classNames,\n ]}\n size={3}\n icon='ph--caret-right--bold'\n iconOnly\n noTooltip\n label={open ? 'Click to close' : 'Click to open'}\n tabIndex={-1}\n {...props}\n />\n );\n },\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nconst SEPARATOR = '+';\n\nexport const Path = {\n create: (...args: string[]) => args.join(SEPARATOR),\n\n parts: (path: string) => path.split(SEPARATOR),\n length: (path: string) => path.split(SEPARATOR).length,\n first: (path: string) => path.split(SEPARATOR)[0] ?? path,\n last: (path: string) => path.split(SEPARATOR).at(-1) ?? path,\n parent: (path: string) => path.split(SEPARATOR).slice(0, -1).join(SEPARATOR),\n\n hasRoot: (path: string, id: string) => Path.first(path) === id,\n hasChild: (path: string, compare: string) => Path.parent(compare) === path,\n hasDescendent: (path: string, compare: string) => compare !== path && compare.startsWith(path),\n siblings: (path: string, compare: string) => Path.parent(path) === Path.parent(compare),\n onPath: (path: string, id: string) => Path.parts(path).includes(id),\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,yBAAwB;AACpC,SAASC,iBAAAA,sBAAqB;AAC9B,OAAOC,YAAuC;AAE9C,SAASC,YAAkC;AAC3C,SAASC,MAAAA,WAAU;;;ACLnB,YAAYC,wBAAwB;AACpC,SAASC,qBAAqB;AAC9B,OAAOC,WAA+B;AAGtC,SAASC,UAAU;AAQnB,IAAMC,iBAAiB;AAEhB,IAAM,CAACC,mBAAmBC,mBAAAA,IAAuBL,cAAqCG,cAAAA;AAM7F,IAAMG,eAAe,CAA2BC,SAAaA,MAAcC;AASpE,IAAMC,gBAAgB,CAA2B,EACtDC,YACAC,OACAC,QAAQN,cACRO,UACAC,OACAC,cACAC,cAAa,MAE8E;AAC3F,SACE,sBAAA,cAACZ,mBAAsB;IAAEQ;EAAM,GAC7B,sBAAA,cAAoBK,yBAAI;IACtBC,MAAK;IACLJ;IACAC;IACAC;IACAG,WAAWjB,GAAGQ,UAAAA;KAEbG,WAAW;IAAEF,OAAOA,SAAS,CAAA;EAAG,CAAA,CAAA,CAAA;AAIzC;;;AD3CA,IAAMS,sBAAsB;AAQrB,IAAM,CAACC,uBAAuBC,yBAAAA,IACnCC,eAAyCH,mBAAAA;AAIpC,IAAMI,gBAAgB,CAA2B,EAAEC,UAAUC,YAAYC,KAAI,MAAyB;AAC3G,QAAM,EAAEC,MAAK,IAAKC,oBAAoBT,mBAAAA;AAEtC,SACE,gBAAAU,OAAA,cAACT,uBAA0B;IAAEM;EAAK,GAChC,gBAAAG,OAAA,cAAoBC,0BAAI;IAACC,OAAOJ,MAAMD,IAAAA;IAAOM,WAAW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IACAI;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;EACF;AAEA,SACE,gBAAAM,OAAA,cAACC,UAASC,MAAI;IAACjB;IAA0CC;KACvD,gBAAAc,OAAA,cAACG,cAAAA;IAAaC,OAAOxB;KAClBe,SAASU,IAAI,CAACC,SAASC,UACtB,gBAAAP,OAAA,cAACQ,cAAAA;IAAaC,KAAKH;IAASvB,IAAIuB;IAASI,MAAMH,UAAUZ,SAASgB,SAAS;IAAI,GAAGZ;;AAK5F;;;AMpEA,IAAMa,YAAY;AAEX,IAAMC,OAAO;EAClBC,QAAQ,IAAIC,SAAmBA,KAAKC,KAAKJ,SAAAA;EAEzCK,OAAO,CAACC,SAAiBA,KAAKC,MAAMP,SAAAA;EACpCQ,QAAQ,CAACF,SAAiBA,KAAKC,MAAMP,SAAAA,EAAWQ;EAChDC,OAAO,CAACH,SAAiBA,KAAKC,MAAMP,SAAAA,EAAW,CAAA,KAAMM;EACrDI,MAAM,CAACJ,SAAiBA,KAAKC,MAAMP,SAAAA,EAAWW,GAAG,EAAC,KAAML;EACxDM,QAAQ,CAACN,SAAiBA,KAAKC,MAAMP,SAAAA,EAAWa,MAAM,GAAG,EAAC,EAAGT,KAAKJ,SAAAA;EAElEc,SAAS,CAACR,MAAcS,OAAed,KAAKQ,MAAMH,IAAAA,MAAUS;EAC5DC,UAAU,CAACV,MAAcW,YAAoBhB,KAAKW,OAAOK,OAAAA,MAAaX;EACtEY,eAAe,CAACZ,MAAcW,YAAoBA,YAAYX,QAAQW,QAAQE,WAAWb,IAAAA;EACzFc,UAAU,CAACd,MAAcW,YAAoBhB,KAAKW,OAAON,IAAAA,MAAUL,KAAKW,OAAOK,OAAAA;EAC/EI,QAAQ,CAACf,MAAcS,OAAed,KAAKI,MAAMC,IAAAA,EAAMgB,SAASP,EAAAA;AAClE;",
|
|
6
|
+
"names": ["AccordionPrimitive", "createContext", "React", "Icon", "mx", "AccordionPrimitive", "createContext", "React", "mx", "ACCORDION_NAME", "AccordionProvider", "useAccordionContext", "defaultGetId", "item", "id", "AccordionRoot", "classNames", "items", "getId", "children", "value", "defaultValue", "onValueChange", "Root", "type", "className", "ACCORDION_ITEM_NAME", "AccordionItemProvider", "useDxAccordionItemContext", "createContext", "AccordionItem", "children", "classNames", "item", "getId", "useAccordionContext", "React", "Item", "value", "className", "mx", "AccordionItemHeader", "props", "Header", "Trigger", "Icon", "icon", "size", "AccordionItemBody", "Content", "div", "role", "Accordion", "Root", "AccordionRoot", "Item", "AccordionItem", "ItemHeader", "AccordionItemHeader", "ItemBody", "AccordionItemBody", "attachClosestEdge", "extractClosestEdge", "combine", "draggable", "dropTargetForElements", "setCustomNativeDragPreview", "createContext", "Slot", "React", "useEffect", "useRef", "useState", "createPortal", "invariant", "IconButton", "ListItem", "NaturalListItem", "useTranslation", "mx", "osTranslations", "extractClosestEdge", "getReorderDestinationIndex", "monitorForElements", "createContext", "React", "useCallback", "useEffect", "useState", "LIST_NAME", "ListProvider", "useListContext", "createContext", "defaultGetId", "item", "id", "ListRoot", "children", "items", "isItem", "getId", "onMove", "props", "isEqual", "useCallback", "a", "b", "idA", "idB", "undefined", "state", "setState", "useState", "idle", "useEffect", "monitorForElements", "canMonitor", "source", "data", "onDrop", "location", "target", "current", "dropTargets", "sourceData", "targetData", "sourceIdx", "findIndex", "targetIdx", "closestEdgeOfTarget", "extractClosestEdge", "destinationIndex", "getReorderDestinationIndex", "startIndex", "indexOfTarget", "axis", "React", "idle", "stateStyles", "ListItemProvider", "isItem", "dragPreview", "setRootState", "useListContext", "LIST_ITEM_NAME", "rootRef", "dragHandleRef", "useRef", "setState", "useState", "useEffect", "element", "invariant", "dragHandle", "canDrag", "getInitialData", "item", "onGenerateDragPreview", "rect", "source", "setCustomNativeDragPreview", "nativeSetDragImage", "x", "height", "render", "container", "undefined", "onDragStart", "type", "onDrop", "getData", "input", "allowedEdges", "getIsSticky", "onDragEnter", "closestEdge", "extractClosestEdge", "onDragLeave", "onDrag", "self", "current", "React", "aria-selected", "className", "ref", "children", "state", "edge", "isDisabled", "disabled", "IconButton", "iconOnly", "variant", "classNames", "autoHide", "t", "useTranslation", "osTranslations", "props", "icon", "label", "ListItemWrapper", "ListItemTitle", "mx", "List", "Root", "ListRoot", "Item", "ListItem", "ItemDragPreview", "ListItemDragPreview", "ItemWrapper", "ListItemWrapper", "ItemDragHandle", "ListItemDragHandle", "ItemIconButton", "ListItemIconButton", "ItemDeleteButton", "ListItemDeleteButton", "ItemTitle", "ListItemTitle", "useAtomValue", "React", "useMemo", "Treegrid", "createContext", "useContext", "raise", "TreeContext", "TreeProvider", "Provider", "useTree", "Error", "attachInstruction", "extractInstruction", "combine", "draggable", "dropTargetForElements", "useAtomValue", "Schema", "React", "memo", "useCallback", "useEffect", "useMemo", "useRef", "useState", "invariant", "TreeItem", "NaturalTreeItem", "Treegrid", "TREEGRID_PARENT_OF_SEPARATOR", "ghostFocusWithin", "ghostHover", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "mx", "DEFAULT_INDENTATION", "paddingIndentation", "level", "indentation", "paddingInlineStart", "React", "forwardRef", "memo", "useCallback", "Button", "Icon", "toLocalizedString", "useTranslation", "TextTooltip", "getStyles", "TreeItemHeading", "label", "className", "icon", "iconHue", "disabled", "current", "onSelect", "forwardedRef", "t", "styles", "undefined", "handleSelect", "event", "altKey", "handleButtonKeydown", "key", "preventDefault", "stopPropagation", "text", "side", "truncateQuery", "onlyWhenTruncating", "asChild", "ref", "data-testid", "variant", "classNames", "onClick", "onKeyDown", "surfaceText", "span", "data-tooltip", "React", "forwardRef", "memo", "IconButton", "TreeItemToggle", "classNames", "open", "isBranch", "hidden", "props", "forwardedRef", "ref", "data-testid", "aria-expanded", "variant", "density", "size", "icon", "iconOnly", "noTooltip", "label", "tabIndex", "__dxlog_file", "hoverableDescriptionIcons", "id", "path", "Schema", "item", "isTreeData", "rowRef", "buttonRef", "useRef", "openRef", "cancelExpandRef", "setState", "useState", "setInstruction", "menuOpen", "setMenuOpen", "itemPropsAtom", "childIds", "childIdsAtom", "useMemo", "pathProp", "open", "useAtomValue", "itemOpenAtom", "current", "itemCurrentAtom", "level", "levelOffset", "isBranch", "parentOf", "mode", "last", "canSelectItem", "nativeDragText", "useEffect", "draggableProp", "invariant", "element", "getInitialData", "draggable", "data", "getInitialDataForExternal", "shouldSeedNativeDragData", "onDragStart", "onOpenChange", "onDrop", "isItemDroppable", "dropTarget", "dropTargetForElements", "getData", "input", "attachInstruction", "indentPerLevel", "currentLevel", "block", "canDrop", "source", "target", "getIsSticky", "onDrag", "desired", "instruction", "onDragLeave", "blockInstruction", "useCallback", "canSelect", "onSelect", "option", "handleOpenToggle", "handleSelect", "onItemHover", "renderColumns", "Columns", "aria-labelledby", "data-object-id", "data-testid", "testId", "onKeyDown", "handleKeyDown", "onMouseEnter", "handleItemHover", "onContextMenu", "role", "React", "style", "classNames", "TreeItemToggle", "onClick", "disabled", "label", "className", "icon", "iconHue", "ref", "gap", "key", "childId", "useTree", "itemAtom", "Tree", "model", "rootId", "path", "id", "draggable", "gridTemplateColumns", "classNames", "levelOffset", "renderColumns", "blockInstruction", "canDrop", "canSelect", "onOpenChange", "onSelect", "onItemHover", "childIds", "useAtomValue", "treePath", "useMemo", "childProps", "React", "Treegrid", "Root", "TreeProvider", "value", "map", "childId", "index", "TreeItemById", "key", "last", "length", "SEPARATOR", "Path", "create", "args", "join", "parts", "path", "split", "length", "first", "last", "at", "parent", "slice", "hasRoot", "id", "hasChild", "compare", "hasDescendent", "startsWith", "siblings", "onPath", "includes"]
|
|
7
7
|
}
|