@dxos/react-ui-list 0.8.4-main.72ec0f3 → 0.8.4-main.7ace549

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.
@@ -553,7 +553,7 @@ var TreeDataSchema = Schema.Struct({
553
553
  item: Schema.Any
554
554
  });
555
555
  var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
556
- var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, canDrop, canSelect, onOpenChange, onSelect }) => {
556
+ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect }) => {
557
557
  var _effect = _useSignals7();
558
558
  try {
559
559
  const rowRef = useRef2(null);
@@ -594,7 +594,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
594
594
  }
595
595
  invariant2(buttonRef.current, void 0, {
596
596
  F: __dxlog_file2,
597
- L: 110,
597
+ L: 112,
598
598
  S: void 0,
599
599
  A: [
600
600
  "buttonRef.current",
@@ -656,7 +656,16 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
656
656
  },
657
657
  getIsSticky: () => true,
658
658
  onDrag: ({ self, source }) => {
659
- const instruction2 = extractInstruction(self.data);
659
+ const desired = extractInstruction(self.data);
660
+ const block = desired && blockInstruction?.({
661
+ instruction: desired,
662
+ source: source.data,
663
+ target: data
664
+ });
665
+ const instruction2 = block && desired.type !== "instruction-blocked" ? {
666
+ type: "instruction-blocked",
667
+ desired
668
+ } : desired;
660
669
  if (source.data.id !== id) {
661
670
  if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
662
671
  cancelExpandRef.current = setTimeout(() => {
@@ -694,6 +703,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
694
703
  mode,
695
704
  path,
696
705
  open,
706
+ blockInstruction,
697
707
  canDrop
698
708
  ]);
699
709
  useEffect3(() => () => cancelExpand(), [
@@ -809,6 +819,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
809
819
  last: index === items.length - 1,
810
820
  draggable: _draggable,
811
821
  renderColumns: Columns,
822
+ blockInstruction,
812
823
  canDrop,
813
824
  canSelect,
814
825
  onOpenChange,
@@ -821,7 +832,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
821
832
  var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
822
833
 
823
834
  // src/components/Tree/Tree.tsx
824
- var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, canDrop, canSelect, onOpenChange, onSelect }) => {
835
+ var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect }) => {
825
836
  var _effect = _useSignals8();
826
837
  try {
827
838
  const context = useMemo2(() => ({
@@ -858,6 +869,7 @@ var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable:
858
869
  levelOffset,
859
870
  draggable: draggable3,
860
871
  renderColumns,
872
+ blockInstruction,
861
873
  canDrop,
862
874
  canSelect,
863
875
  onOpenChange,
@@ -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/react-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 is-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-slideUp data-[state=open]:animate-slideDown'>\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/react-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 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 } from '@dxos/react-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: 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 } & HTMLAttributes<HTMLDivElement>\n >\n>;\n\n/**\n * Draggable list item.\n */\nexport const ListItem = <T extends ListItemRecord>({ children, classNames, item, ...props }: ListItemProps<T>) => {\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: '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 <div ref={ref} role='listitem' className={mx('flex relative', classNames, stateStyles[state.type])} {...props}>\n {children}\n {state.type === 'is-dragging-over' && state.closestEdge && (\n <NaturalListItem.DropIndicator edge={state.closestEdge} />\n )}\n </div>\n </ListItemProvider>\n );\n};\n\n//\n// List item components\n//\n\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('os');\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 ListItemButton = ({\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\nexport const ListItemDragHandle = ({ disabled }: Pick<IconButtonProps, 'disabled'>) => {\n const { dragHandleRef } = useListItemContext('DRAG_HANDLE');\n const { t } = useTranslation('os');\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 is-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: 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?: 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 ListItemButton,\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 ItemDeleteButton: ListItemDeleteButton,\n ItemButton: ListItemButton,\n ItemTitle: ListItemTitle,\n};\n\ntype ListItem = ListItemRecord;\n\nexport type { ListRootProps, ListItemProps, ListItem, ListItemRecord };\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { type HasId } from '@dxos/echo/internal';\nimport { Treegrid, type TreegridRootProps } from '@dxos/react-ui';\n\nimport { type TreeContextType, TreeProvider } from './TreeContext';\nimport { TreeItem, type TreeItemProps } from './TreeItem';\n\nexport type TreeProps<T extends HasId = any, O = any> = {\n root?: T;\n path?: string[];\n id: string;\n} & TreeContextType<T, O> &\n Partial<Pick<TreegridRootProps, 'gridTemplateColumns' | 'classNames'>> &\n Pick<\n TreeItemProps<T>,\n 'draggable' | 'renderColumns' | 'canDrop' | 'canSelect' | 'onOpenChange' | 'onSelect' | 'levelOffset'\n >;\n\nexport const Tree = <T extends HasId = any, O = any>({\n root,\n path,\n id,\n useItems,\n getProps,\n isOpen,\n isCurrent,\n draggable = false,\n gridTemplateColumns = '[tree-row-start] 1fr min-content [tree-row-end]',\n classNames,\n levelOffset,\n renderColumns,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\n}: TreeProps<T, O>) => {\n const context = useMemo(\n () => ({\n useItems,\n getProps,\n isOpen,\n isCurrent,\n }),\n [useItems, getProps, isOpen, isCurrent],\n );\n const items = useItems(root);\n const treePath = useMemo(() => (path ? [...path, id] : [id]), [id, path]);\n\n return (\n <Treegrid.Root gridTemplateColumns={gridTemplateColumns} classNames={classNames}>\n <TreeProvider value={context}>\n {items.map((item, index) => (\n <TreeItem\n key={item.id}\n item={item}\n last={index === items.length - 1}\n path={treePath}\n levelOffset={levelOffset}\n draggable={draggable}\n renderColumns={renderColumns}\n canDrop={canDrop}\n canSelect={canSelect}\n onOpenChange={onOpenChange}\n onSelect={onSelect}\n />\n ))}\n </TreeProvider>\n </Treegrid.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\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 className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n testId?: string;\n};\n\nexport type TreeContextType<T = any, O = any> = {\n useItems: (parent?: T, options?: O) => T[];\n getProps: (item: T, parent: string[]) => TreeItemDataProps;\n isOpen: (path: string[], item: T) => boolean;\n isCurrent: (path: string[], item: T) => boolean;\n};\n\nconst TreeContext = createContext<null | TreeContextType>(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 * as Schema from 'effect/Schema';\nimport React, { type FC, type KeyboardEvent, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { type HasId } from '@dxos/echo/internal';\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} from '@dxos/react-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 TreeItemState = '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 HasId = 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 HasId = any> = {\n item: T;\n path: string[];\n levelOffset?: number;\n last: boolean;\n draggable?: boolean;\n renderColumns?: ColumnRenderer<T>;\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};\n\nconst RawTreeItem = <T extends HasId = any>({\n item,\n path: _path,\n levelOffset = 2,\n last,\n draggable: _draggable,\n renderColumns: Columns,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\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<TreeItemState>('idle');\n const [instruction, setInstruction] = useState<Instruction | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const { useItems, getProps, isOpen, isCurrent } = useTree();\n const items = useItems(item);\n const { id, parentOf, label, className, headingClassName, icon, iconHue, disabled, testId } = getProps(item, _path);\n const path = useMemo(() => [..._path, id], [_path, id]);\n const open = isOpen(path, item);\n const current = isCurrent(path, item);\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\n const cancelExpand = useCallback(() => {\n if (cancelExpandRef.current) {\n clearTimeout(cancelExpandRef.current);\n cancelExpandRef.current = null;\n }\n }, []);\n\n useEffect(() => {\n if (!_draggable) {\n return;\n }\n\n invariant(buttonRef.current);\n\n const data = { id, path, item } satisfies TreeData;\n\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about\n return combine(\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 // https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx\n 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 instruction = extractInstruction(self.data);\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 }, [_draggable, item, id, mode, path, open, 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 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 classNames={[\n 'grid grid-cols-subgrid col-[tree-row] mbs-0.5 aria-[current]:bg-activeSurface',\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n hoverableDescriptionIcons,\n ghostHover,\n ghostFocusWithin,\n className,\n ]}\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 onKeyDown={handleKeyDown}\n onContextMenu={(event) => {\n event.preventDefault();\n setMenuOpen(true);\n }}\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 items.map((item, index) => (\n <TreeItem\n key={item.id}\n item={item}\n path={path}\n last={index === items.length - 1}\n draggable={_draggable}\n renderColumns={Columns}\n canDrop={canDrop}\n canSelect={canSelect}\n onOpenChange={onOpenChange}\n onSelect={onSelect}\n />\n ))}\n </>\n );\n};\n\nexport const TreeItem = memo(RawTreeItem) as FC<TreeItemProps>;\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/react-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 pis-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'} size={5} classNames={['mlb-1', styles?.icon]} />}\n <span className='flex-1 is-0 truncate text-start text-sm 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 'bs-full is-6 pli-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,WACE,sBAAA,c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AC,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", "createContext", "defaultGetId", "item", "id", "AccordionRoot", "classNames", "items", "getId", "children", "value", "defaultValue", "onValueChange", "Root", "type", "className", "mx", "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", "combine", "draggable", "dropTargetForElements", "setCustomNativeDragPreview", "attachClosestEdge", "extractClosestEdge", "createContext", "React", "useEffect", "useRef", "useState", "createPortal", "invariant", "IconButton", "ListItem", "NaturalListItem", "useTranslation", "mx", "monitorForElements", "extractClosestEdge", "getReorderDestinationIndex", "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", "type", "stateStyles", "defaultContext", "LIST_ITEM_NAME", "ListItemProvider", "useListItemContext", "createContext", "ListItem", "children", "classNames", "item", "props", "isItem", "readonly", "dragPreview", "setState", "setRootState", "useListContext", "ref", "useRef", "dragHandleRef", "state", "useState", "useEffect", "element", "current", "invariant", "combine", "draggable", "dragHandle", "canDrag", "getInitialData", "onGenerateDragPreview", "nativeSetDragImage", "source", "rect", "getBoundingClientRect", "setCustomNativeDragPreview", "getOffset", "container", "height", "x", "y", "render", "style", "width", "undefined", "onDragStart", "onDrop", "dropTargetForElements", "canDrop", "data", "getData", "input", "attachClosestEdge", "allowedEdges", "getIsSticky", "onDragEnter", "self", "closestEdge", "extractClosestEdge", "onDragLeave", "onDrag", "React", "div", "role", "className", "mx", "NaturalListItem", "DropIndicator", "edge", "ListItemDeleteButton", "autoHide", "disabled", "icon", "label", "isDisabled", "t", "useTranslation", "IconButton", "iconOnly", "variant", "ListItemButton", "ListItemDragHandle", "ListItemDragPreview", "createPortal", "ListItemWrapper", "ListItemTitle", "List", "Root", "ListRoot", "Item", "ListItem", "ItemDragPreview", "ListItemDragPreview", "ItemWrapper", "ListItemWrapper", "ItemDragHandle", "ListItemDragHandle", "ItemDeleteButton", "ListItemDeleteButton", "ItemButton", "ListItemButton", "ItemTitle", "ListItemTitle", "React", "useMemo", "Treegrid", "createContext", "useContext", "raise", "TreeContext", "createContext", "TreeProvider", "Provider", "useTree", "useContext", "raise", "Error", "combine", "draggable", "dropTargetForElements", "attachInstruction", "extractInstruction", "Schema", "React", "memo", "useCallback", "useEffect", "useMemo", "useRef", "useState", "invariant", "TreeItem", "NaturalTreeItem", "Treegrid", "ghostFocusWithin", "ghostHover", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "DEFAULT_INDENTATION", "paddingIndentation", "level", "indentation", "paddingInlineStart", "React", "forwardRef", "memo", "useCallback", "Button", "Icon", "toLocalizedString", "useTranslation", "TextTooltip", "getStyles", "TreeItemHeading", "memo", "forwardRef", "label", "className", "icon", "iconHue", "disabled", "current", "onSelect", "forwardedRef", "t", "useTranslation", "styles", "getStyles", "undefined", "handleSelect", "useCallback", "event", "altKey", "handleButtonKeydown", "key", "preventDefault", "stopPropagation", "React", "TextTooltip", "text", "toLocalizedString", "side", "truncateQuery", "onlyWhenTruncating", "asChild", "ref", "Button", "data-testid", "variant", "density", "classNames", "onClick", "onKeyDown", "Icon", "size", "span", "data-tooltip", "React", "forwardRef", "memo", "IconButton", "TreeItemToggle", "memo", "forwardRef", "open", "isBranch", "hidden", "classNames", "props", "forwardedRef", "React", "IconButton", "ref", "data-testid", "aria-expanded", "variant", "density", "size", "icon", "iconOnly", "noTooltip", "label", "tabIndex", "hoverableDescriptionIcons", "TreeDataSchema", "Struct", "id", "String", "path", "Array", "item", "Any", "isTreeData", "data", "is", "RawTreeItem", "_path", "levelOffset", "last", "draggable", "_draggable", "renderColumns", "Columns", "canDrop", "canSelect", "onOpenChange", "onSelect", "rowRef", "useRef", "buttonRef", "openRef", "cancelExpandRef", "_state", "setState", "useState", "instruction", "setInstruction", "menuOpen", "setMenuOpen", "useItems", "getProps", "isOpen", "isCurrent", "useTree", "items", "parentOf", "label", "className", "headingClassName", "icon", "iconHue", "disabled", "testId", "useMemo", "open", "current", "level", "length", "isBranch", "mode", "canSelectItem", "cancelExpand", "useCallback", "clearTimeout", "useEffect", "invariant", "combine", "element", "getInitialData", "onDragStart", "onDrop", "dropTargetForElements", "getData", "input", "attachInstruction", "indentPerLevel", "DEFAULT_INDENTATION", "currentLevel", "block", "source", "_canDrop", "target", "getIsSticky", "onDrag", "self", "extractInstruction", "type", "setTimeout", "onDragLeave", "handleOpenToggle", "handleSelect", "option", "focus", "handleKeyDown", "event", "key", "React", "Treegrid", "Row", "ref", "aria-labelledby", "join", "PARENT_OF_SEPARATOR", "classNames", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "ghostHover", "ghostFocusWithin", "data-object-id", "data-testid", "aria-current", "undefined", "onKeyDown", "onContextMenu", "preventDefault", "div", "role", "style", "paddingIndentation", "Cell", "TreeItemToggle", "onClick", "TreeItemHeading", "NaturalTreeItem", "DropIndicator", "gap", "map", "index", "TreeItem", "memo", "Tree", "root", "path", "id", "useItems", "getProps", "isOpen", "isCurrent", "draggable", "gridTemplateColumns", "classNames", "levelOffset", "renderColumns", "canDrop", "canSelect", "onOpenChange", "onSelect", "context", "useMemo", "items", "treePath", "React", "Treegrid", "Root", "TreeProvider", "value", "map", "item", "index", "TreeItem", "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"]
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/react-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 is-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-slideUp data-[state=open]:animate-slideDown'>\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/react-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 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 } from '@dxos/react-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: 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 } & HTMLAttributes<HTMLDivElement>\n >\n>;\n\n/**\n * Draggable list item.\n */\nexport const ListItem = <T extends ListItemRecord>({ children, classNames, item, ...props }: ListItemProps<T>) => {\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: '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 <div ref={ref} role='listitem' className={mx('flex relative', classNames, stateStyles[state.type])} {...props}>\n {children}\n {state.type === 'is-dragging-over' && state.closestEdge && (\n <NaturalListItem.DropIndicator edge={state.closestEdge} />\n )}\n </div>\n </ListItemProvider>\n );\n};\n\n//\n// List item components\n//\n\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('os');\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 ListItemButton = ({\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\nexport const ListItemDragHandle = ({ disabled }: Pick<IconButtonProps, 'disabled'>) => {\n const { dragHandleRef } = useListItemContext('DRAG_HANDLE');\n const { t } = useTranslation('os');\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 is-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: 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?: 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 ListItemButton,\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 ItemDeleteButton: ListItemDeleteButton,\n ItemButton: ListItemButton,\n ItemTitle: ListItemTitle,\n};\n\ntype ListItem = ListItemRecord;\n\nexport type { ListRootProps, ListItemProps, ListItem, ListItemRecord };\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { type HasId } from '@dxos/echo/internal';\nimport { Treegrid, type TreegridRootProps } from '@dxos/react-ui';\n\nimport { type TreeContextType, TreeProvider } from './TreeContext';\nimport { TreeItem, type TreeItemProps } from './TreeItem';\n\nexport type TreeProps<T extends HasId = any, O = any> = {\n root?: T;\n path?: string[];\n id: string;\n} & TreeContextType<T, O> &\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 | 'levelOffset'\n >;\n\nexport const Tree = <T extends HasId = any, O = any>({\n root,\n path,\n id,\n useItems,\n getProps,\n isOpen,\n isCurrent,\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}: TreeProps<T, O>) => {\n const context = useMemo(\n () => ({\n useItems,\n getProps,\n isOpen,\n isCurrent,\n }),\n [useItems, getProps, isOpen, isCurrent],\n );\n const items = useItems(root);\n const treePath = useMemo(() => (path ? [...path, id] : [id]), [id, path]);\n\n return (\n <Treegrid.Root gridTemplateColumns={gridTemplateColumns} classNames={classNames}>\n <TreeProvider value={context}>\n {items.map((item, index) => (\n <TreeItem\n key={item.id}\n item={item}\n last={index === items.length - 1}\n path={treePath}\n levelOffset={levelOffset}\n draggable={draggable}\n renderColumns={renderColumns}\n blockInstruction={blockInstruction}\n canDrop={canDrop}\n canSelect={canSelect}\n onOpenChange={onOpenChange}\n onSelect={onSelect}\n />\n ))}\n </TreeProvider>\n </Treegrid.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\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 className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n disabled?: boolean;\n testId?: string;\n};\n\nexport type TreeContextType<T = any, O = any> = {\n useItems: (parent?: T, options?: O) => T[];\n getProps: (item: T, parent: string[]) => TreeItemDataProps;\n isOpen: (path: string[], item: T) => boolean;\n isCurrent: (path: string[], item: T) => boolean;\n};\n\nconst TreeContext = createContext<null | TreeContextType>(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 * as Schema from 'effect/Schema';\nimport React, { type FC, type KeyboardEvent, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { type HasId } from '@dxos/echo/internal';\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} from '@dxos/react-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 TreeItemState = '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 HasId = 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 HasId = 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};\n\nconst RawTreeItem = <T extends HasId = any>({\n item,\n path: _path,\n levelOffset = 2,\n last,\n draggable: _draggable,\n renderColumns: Columns,\n blockInstruction,\n canDrop,\n canSelect,\n onOpenChange,\n onSelect,\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<TreeItemState>('idle');\n const [instruction, setInstruction] = useState<Instruction | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const { useItems, getProps, isOpen, isCurrent } = useTree();\n const items = useItems(item);\n const { id, parentOf, label, className, headingClassName, icon, iconHue, disabled, testId } = getProps(item, _path);\n const path = useMemo(() => [..._path, id], [_path, id]);\n const open = isOpen(path, item);\n const current = isCurrent(path, item);\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\n const cancelExpand = useCallback(() => {\n if (cancelExpandRef.current) {\n clearTimeout(cancelExpandRef.current);\n cancelExpandRef.current = null;\n }\n }, []);\n\n useEffect(() => {\n if (!_draggable) {\n return;\n }\n\n invariant(buttonRef.current);\n\n const data = { id, path, item } satisfies TreeData;\n\n // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about\n return combine(\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 // https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx\n 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 }, [_draggable, 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 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 classNames={[\n 'grid grid-cols-subgrid col-[tree-row] mbs-0.5 aria-[current]:bg-activeSurface',\n hoverableControls,\n hoverableFocusedKeyboardControls,\n hoverableFocusedWithinControls,\n hoverableDescriptionIcons,\n ghostHover,\n ghostFocusWithin,\n className,\n ]}\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 onKeyDown={handleKeyDown}\n onContextMenu={(event) => {\n event.preventDefault();\n setMenuOpen(true);\n }}\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 items.map((item, index) => (\n <TreeItem\n key={item.id}\n item={item}\n path={path}\n last={index === items.length - 1}\n draggable={_draggable}\n renderColumns={Columns}\n blockInstruction={blockInstruction}\n canDrop={canDrop}\n canSelect={canSelect}\n onOpenChange={onOpenChange}\n onSelect={onSelect}\n />\n ))}\n </>\n );\n};\n\nexport const TreeItem = memo(RawTreeItem) as FC<TreeItemProps>;\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/react-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 pis-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'} size={5} classNames={['mlb-1', styles?.icon]} />}\n <span className='flex-1 is-0 truncate text-start text-sm 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 'bs-full is-6 pli-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,WACE,sBAAA,cAACb,mBAAsB;MAAES;IAAM,GAC7B,sBAAA,cAAoBK,yBAAI;MACtBC,MAAK;MACLJ;MACAC;MACAC;MACAG,WAAWC,GAAGV,UAAAA;OAEbG,WAAW;MAAEF,OAAOA,SAAS,CAAA;IAAG,CAAA,CAAA,CAAA;;;;AAIzC;;;AD1CA,IAAMU,sBAAsB;AAQrB,IAAM,CAACC,uBAAuBC,yBAAAA,IACnCC,eAAyCH,mBAAAA;AAIpC,IAAMI,gBAAgB,CAA2B,EAAEC,UAAUC,YA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AAKJ,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", "createContext", "defaultGetId", "item", "id", "AccordionRoot", "classNames", "items", "getId", "children", "value", "defaultValue", "onValueChange", "Root", "type", "className", "mx", "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", "combine", "draggable", "dropTargetForElements", "setCustomNativeDragPreview", "attachClosestEdge", "extractClosestEdge", "createContext", "React", "useEffect", "useRef", "useState", "createPortal", "invariant", "IconButton", "ListItem", "NaturalListItem", "useTranslation", "mx", "monitorForElements", "extractClosestEdge", "getReorderDestinationIndex", "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", "type", "stateStyles", "defaultContext", "LIST_ITEM_NAME", "ListItemProvider", "useListItemContext", "createContext", "ListItem", "children", "classNames", "item", "props", "isItem", "readonly", "dragPreview", "setState", "setRootState", "useListContext", "ref", "useRef", "dragHandleRef", "state", "useState", "useEffect", "element", "current", "invariant", "combine", "draggable", "dragHandle", "canDrag", "getInitialData", "onGenerateDragPreview", "nativeSetDragImage", "source", "rect", "getBoundingClientRect", "setCustomNativeDragPreview", "getOffset", "container", "height", "x", "y", "render", "style", "width", "undefined", "onDragStart", "onDrop", "dropTargetForElements", "canDrop", "data", "getData", "input", "attachClosestEdge", "allowedEdges", "getIsSticky", "onDragEnter", "self", "closestEdge", "extractClosestEdge", "onDragLeave", "onDrag", "React", "div", "role", "className", "mx", "NaturalListItem", "DropIndicator", "edge", "ListItemDeleteButton", "autoHide", "disabled", "icon", "label", "isDisabled", "t", "useTranslation", "IconButton", "iconOnly", "variant", "ListItemButton", "ListItemDragHandle", "ListItemDragPreview", "createPortal", "ListItemWrapper", "ListItemTitle", "List", "Root", "ListRoot", "Item", "ListItem", "ItemDragPreview", "ListItemDragPreview", "ItemWrapper", "ListItemWrapper", "ItemDragHandle", "ListItemDragHandle", "ItemDeleteButton", "ListItemDeleteButton", "ItemButton", "ListItemButton", "ItemTitle", "ListItemTitle", "React", "useMemo", "Treegrid", "createContext", "useContext", "raise", "TreeContext", "createContext", "TreeProvider", "Provider", "useTree", "useContext", "raise", "Error", "combine", "draggable", "dropTargetForElements", "attachInstruction", "extractInstruction", "Schema", "React", "memo", "useCallback", "useEffect", "useMemo", "useRef", "useState", "invariant", "TreeItem", "NaturalTreeItem", "Treegrid", "ghostFocusWithin", "ghostHover", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "DEFAULT_INDENTATION", "paddingIndentation", "level", "indentation", "paddingInlineStart", "React", "forwardRef", "memo", "useCallback", "Button", "Icon", "toLocalizedString", "useTranslation", "TextTooltip", "getStyles", "TreeItemHeading", "memo", "forwardRef", "label", "className", "icon", "iconHue", "disabled", "current", "onSelect", "forwardedRef", "t", "useTranslation", "styles", "getStyles", "undefined", "handleSelect", "useCallback", "event", "altKey", "handleButtonKeydown", "key", "preventDefault", "stopPropagation", "React", "TextTooltip", "text", "toLocalizedString", "side", "truncateQuery", "onlyWhenTruncating", "asChild", "ref", "Button", "data-testid", "variant", "density", "classNames", "onClick", "onKeyDown", "Icon", "size", "span", "data-tooltip", "React", "forwardRef", "memo", "IconButton", "TreeItemToggle", "memo", "forwardRef", "open", "isBranch", "hidden", "classNames", "props", "forwardedRef", "React", "IconButton", "ref", "data-testid", "aria-expanded", "variant", "density", "size", "icon", "iconOnly", "noTooltip", "label", "tabIndex", "hoverableDescriptionIcons", "TreeDataSchema", "Struct", "id", "String", "path", "Array", "item", "Any", "isTreeData", "data", "is", "RawTreeItem", "_path", "levelOffset", "last", "draggable", "_draggable", "renderColumns", "Columns", "blockInstruction", "canDrop", "canSelect", "onOpenChange", "onSelect", "rowRef", "useRef", "buttonRef", "openRef", "cancelExpandRef", "_state", "setState", "useState", "instruction", "setInstruction", "menuOpen", "setMenuOpen", "useItems", "getProps", "isOpen", "isCurrent", "useTree", "items", "parentOf", "label", "className", "headingClassName", "icon", "iconHue", "disabled", "testId", "useMemo", "open", "current", "level", "length", "isBranch", "mode", "canSelectItem", "cancelExpand", "useCallback", "clearTimeout", "useEffect", "invariant", "combine", "element", "getInitialData", "onDragStart", "onDrop", "dropTargetForElements", "getData", "input", "attachInstruction", "indentPerLevel", "DEFAULT_INDENTATION", "currentLevel", "block", "source", "_canDrop", "target", "getIsSticky", "onDrag", "self", "desired", "extractInstruction", "type", "setTimeout", "onDragLeave", "handleOpenToggle", "handleSelect", "option", "focus", "handleKeyDown", "event", "key", "React", "Treegrid", "Row", "ref", "aria-labelledby", "join", "PARENT_OF_SEPARATOR", "classNames", "hoverableControls", "hoverableFocusedKeyboardControls", "hoverableFocusedWithinControls", "ghostHover", "ghostFocusWithin", "data-object-id", "data-testid", "aria-current", "undefined", "onKeyDown", "onContextMenu", "preventDefault", "div", "role", "style", "paddingIndentation", "Cell", "TreeItemToggle", "onClick", "TreeItemHeading", "NaturalTreeItem", "DropIndicator", "gap", "map", "index", "TreeItem", "memo", "Tree", "root", "path", "id", "useItems", "getProps", "isOpen", "isCurrent", "draggable", "gridTemplateColumns", "classNames", "levelOffset", "renderColumns", "blockInstruction", "canDrop", "canSelect", "onOpenChange", "onSelect", "context", "useMemo", "items", "treePath", "React", "Treegrid", "Root", "TreeProvider", "value", "map", "item", "index", "TreeItem", "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
  }
@@ -1 +1 @@
1
- {"inputs":{"src/components/Accordion/AccordionRoot.tsx":{"bytes":4670,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Accordion/AccordionItem.tsx":{"bytes":7696,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/Accordion/AccordionRoot.tsx","kind":"import-statement","original":"./AccordionRoot"}],"format":"esm"},"src/components/Accordion/Accordion.tsx":{"bytes":1931,"imports":[{"path":"src/components/Accordion/AccordionItem.tsx","kind":"import-statement","original":"./AccordionItem"},{"path":"src/components/Accordion/AccordionRoot.tsx","kind":"import-statement","original":"./AccordionRoot"}],"format":"esm"},"src/components/Accordion/index.ts":{"bytes":478,"imports":[{"path":"src/components/Accordion/Accordion.tsx","kind":"import-statement","original":"./Accordion"}],"format":"esm"},"src/components/List/ListRoot.tsx":{"bytes":11176,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/components/List/ListItem.tsx","kind":"import-statement","original":"./ListItem"}],"format":"esm"},"src/components/List/ListItem.tsx":{"bytes":27286,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/List/ListRoot.tsx","kind":"import-statement","original":"./ListRoot"}],"format":"esm"},"src/components/List/List.tsx":{"bytes":3449,"imports":[{"path":"src/components/List/ListItem.tsx","kind":"import-statement","original":"./ListItem"},{"path":"src/components/List/ListRoot.tsx","kind":"import-statement","original":"./ListRoot"}],"format":"esm"},"src/components/List/index.ts":{"bytes":460,"imports":[{"path":"src/components/List/List.tsx","kind":"import-statement","original":"./List"}],"format":"esm"},"src/components/Tree/TreeContext.tsx":{"bytes":2221,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/helpers.ts":{"bytes":1170,"imports":[],"format":"esm"},"src/components/Tree/TreeItemHeading.tsx":{"bytes":8355,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-text-tooltip","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/TreeItemToggle.tsx":{"bytes":4033,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/TreeItem.tsx":{"bytes":34082,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/Tree/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/components/Tree/TreeContext.tsx","kind":"import-statement","original":"./TreeContext"},{"path":"src/components/Tree/TreeItemHeading.tsx","kind":"import-statement","original":"./TreeItemHeading"},{"path":"src/components/Tree/TreeItemToggle.tsx","kind":"import-statement","original":"./TreeItemToggle"}],"format":"esm"},"src/components/Tree/Tree.tsx":{"bytes":6493,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/components/Tree/TreeContext.tsx","kind":"import-statement","original":"./TreeContext"},{"path":"src/components/Tree/TreeItem.tsx","kind":"import-statement","original":"./TreeItem"}],"format":"esm"},"src/components/Tree/index.ts":{"bytes":647,"imports":[{"path":"src/components/Tree/Tree.tsx","kind":"import-statement","original":"./Tree"},{"path":"src/components/Tree/TreeContext.tsx","kind":"import-statement","original":"./TreeContext"},{"path":"src/components/Tree/TreeItem.tsx","kind":"import-statement","original":"./TreeItem"}],"format":"esm"},"src/components/index.ts":{"bytes":624,"imports":[{"path":"src/components/Accordion/index.ts","kind":"import-statement","original":"./Accordion"},{"path":"src/components/List/index.ts","kind":"import-statement","original":"./List"},{"path":"src/components/Tree/index.ts","kind":"import-statement","original":"./Tree"}],"format":"esm"},"src/util/path.ts":{"bytes":3405,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":449,"imports":[{"path":"src/util/path.ts","kind":"import-statement","original":"./path"}],"format":"esm"},"src/index.ts":{"bytes":538,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":57978},"dist/lib/browser/index.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-text-tooltip","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["Accordion","List","Path","Tree","TreeDataSchema","TreeItem","TreeProvider","isTreeData","useTree"],"entryPoint":"src/index.ts","inputs":{"src/components/Accordion/AccordionItem.tsx":{"bytesInOutput":2031},"src/components/Accordion/AccordionRoot.tsx":{"bytesInOutput":933},"src/components/Accordion/Accordion.tsx":{"bytesInOutput":132},"src/components/Accordion/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/List/ListItem.tsx":{"bytesInOutput":7720},"src/components/List/ListRoot.tsx":{"bytesInOutput":2472},"src/components/List/List.tsx":{"bytesInOutput":261},"src/components/List/index.ts":{"bytesInOutput":0},"src/components/Tree/Tree.tsx":{"bytesInOutput":1388},"src/components/Tree/TreeContext.tsx":{"bytesInOutput":293},"src/components/Tree/TreeItem.tsx":{"bytesInOutput":9146},"src/components/Tree/helpers.ts":{"bytesInOutput":162},"src/components/Tree/TreeItemHeading.tsx":{"bytesInOutput":2178},"src/components/Tree/TreeItemToggle.tsx":{"bytesInOutput":1069},"src/components/Tree/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/util/path.ts":{"bytesInOutput":678},"src/util/index.ts":{"bytesInOutput":0}},"bytes":29267}}}
1
+ {"inputs":{"src/components/Accordion/AccordionRoot.tsx":{"bytes":4670,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Accordion/AccordionItem.tsx":{"bytes":7696,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/Accordion/AccordionRoot.tsx","kind":"import-statement","original":"./AccordionRoot"}],"format":"esm"},"src/components/Accordion/Accordion.tsx":{"bytes":1931,"imports":[{"path":"src/components/Accordion/AccordionItem.tsx","kind":"import-statement","original":"./AccordionItem"},{"path":"src/components/Accordion/AccordionRoot.tsx","kind":"import-statement","original":"./AccordionRoot"}],"format":"esm"},"src/components/Accordion/index.ts":{"bytes":478,"imports":[{"path":"src/components/Accordion/Accordion.tsx","kind":"import-statement","original":"./Accordion"}],"format":"esm"},"src/components/List/ListRoot.tsx":{"bytes":11176,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/components/List/ListItem.tsx","kind":"import-statement","original":"./ListItem"}],"format":"esm"},"src/components/List/ListItem.tsx":{"bytes":27286,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/List/ListRoot.tsx","kind":"import-statement","original":"./ListRoot"}],"format":"esm"},"src/components/List/List.tsx":{"bytes":3449,"imports":[{"path":"src/components/List/ListItem.tsx","kind":"import-statement","original":"./ListItem"},{"path":"src/components/List/ListRoot.tsx","kind":"import-statement","original":"./ListRoot"}],"format":"esm"},"src/components/List/index.ts":{"bytes":460,"imports":[{"path":"src/components/List/List.tsx","kind":"import-statement","original":"./List"}],"format":"esm"},"src/components/Tree/TreeContext.tsx":{"bytes":2221,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/helpers.ts":{"bytes":1170,"imports":[],"format":"esm"},"src/components/Tree/TreeItemHeading.tsx":{"bytes":8355,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-text-tooltip","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/TreeItemToggle.tsx":{"bytes":4033,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/Tree/TreeItem.tsx":{"bytes":35594,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/Tree/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/components/Tree/TreeContext.tsx","kind":"import-statement","original":"./TreeContext"},{"path":"src/components/Tree/TreeItemHeading.tsx","kind":"import-statement","original":"./TreeItemHeading"},{"path":"src/components/Tree/TreeItemToggle.tsx","kind":"import-statement","original":"./TreeItemToggle"}],"format":"esm"},"src/components/Tree/Tree.tsx":{"bytes":6799,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/components/Tree/TreeContext.tsx","kind":"import-statement","original":"./TreeContext"},{"path":"src/components/Tree/TreeItem.tsx","kind":"import-statement","original":"./TreeItem"}],"format":"esm"},"src/components/Tree/index.ts":{"bytes":647,"imports":[{"path":"src/components/Tree/Tree.tsx","kind":"import-statement","original":"./Tree"},{"path":"src/components/Tree/TreeContext.tsx","kind":"import-statement","original":"./TreeContext"},{"path":"src/components/Tree/TreeItem.tsx","kind":"import-statement","original":"./TreeItem"}],"format":"esm"},"src/components/index.ts":{"bytes":624,"imports":[{"path":"src/components/Accordion/index.ts","kind":"import-statement","original":"./Accordion"},{"path":"src/components/List/index.ts","kind":"import-statement","original":"./List"},{"path":"src/components/Tree/index.ts","kind":"import-statement","original":"./Tree"}],"format":"esm"},"src/util/path.ts":{"bytes":3405,"imports":[],"format":"esm"},"src/util/index.ts":{"bytes":449,"imports":[{"path":"src/util/path.ts","kind":"import-statement","original":"./path"}],"format":"esm"},"src/index.ts":{"bytes":538,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":58859},"dist/lib/browser/index.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-accordion","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-text-tooltip","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["Accordion","List","Path","Tree","TreeDataSchema","TreeItem","TreeProvider","isTreeData","useTree"],"entryPoint":"src/index.ts","inputs":{"src/components/Accordion/AccordionItem.tsx":{"bytesInOutput":2031},"src/components/Accordion/AccordionRoot.tsx":{"bytesInOutput":933},"src/components/Accordion/Accordion.tsx":{"bytesInOutput":132},"src/components/Accordion/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/List/ListItem.tsx":{"bytesInOutput":7720},"src/components/List/ListRoot.tsx":{"bytesInOutput":2472},"src/components/List/List.tsx":{"bytesInOutput":261},"src/components/List/index.ts":{"bytesInOutput":0},"src/components/Tree/Tree.tsx":{"bytesInOutput":1430},"src/components/Tree/TreeContext.tsx":{"bytesInOutput":293},"src/components/Tree/TreeItem.tsx":{"bytesInOutput":9554},"src/components/Tree/helpers.ts":{"bytesInOutput":162},"src/components/Tree/TreeItemHeading.tsx":{"bytesInOutput":2178},"src/components/Tree/TreeItemToggle.tsx":{"bytesInOutput":1069},"src/components/Tree/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/util/path.ts":{"bytesInOutput":678},"src/util/index.ts":{"bytesInOutput":0}},"bytes":29717}}}
@@ -555,7 +555,7 @@ var TreeDataSchema = Schema.Struct({
555
555
  item: Schema.Any
556
556
  });
557
557
  var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
558
- var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, canDrop, canSelect, onOpenChange, onSelect }) => {
558
+ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect }) => {
559
559
  var _effect = _useSignals7();
560
560
  try {
561
561
  const rowRef = useRef2(null);
@@ -596,7 +596,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
596
596
  }
597
597
  invariant2(buttonRef.current, void 0, {
598
598
  F: __dxlog_file2,
599
- L: 110,
599
+ L: 112,
600
600
  S: void 0,
601
601
  A: [
602
602
  "buttonRef.current",
@@ -658,7 +658,16 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
658
658
  },
659
659
  getIsSticky: () => true,
660
660
  onDrag: ({ self, source }) => {
661
- const instruction2 = extractInstruction(self.data);
661
+ const desired = extractInstruction(self.data);
662
+ const block = desired && blockInstruction?.({
663
+ instruction: desired,
664
+ source: source.data,
665
+ target: data
666
+ });
667
+ const instruction2 = block && desired.type !== "instruction-blocked" ? {
668
+ type: "instruction-blocked",
669
+ desired
670
+ } : desired;
662
671
  if (source.data.id !== id) {
663
672
  if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
664
673
  cancelExpandRef.current = setTimeout(() => {
@@ -696,6 +705,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
696
705
  mode,
697
706
  path,
698
707
  open,
708
+ blockInstruction,
699
709
  canDrop
700
710
  ]);
701
711
  useEffect3(() => () => cancelExpand(), [
@@ -811,6 +821,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
811
821
  last: index === items.length - 1,
812
822
  draggable: _draggable,
813
823
  renderColumns: Columns,
824
+ blockInstruction,
814
825
  canDrop,
815
826
  canSelect,
816
827
  onOpenChange,
@@ -823,7 +834,7 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
823
834
  var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
824
835
 
825
836
  // src/components/Tree/Tree.tsx
826
- var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, canDrop, canSelect, onOpenChange, onSelect }) => {
837
+ var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect }) => {
827
838
  var _effect = _useSignals8();
828
839
  try {
829
840
  const context = useMemo2(() => ({
@@ -860,6 +871,7 @@ var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable:
860
871
  levelOffset,
861
872
  draggable: draggable3,
862
873
  renderColumns,
874
+ blockInstruction,
863
875
  canDrop,
864
876
  canSelect,
865
877
  onOpenChange,