@dxos/react-ui-mosaic 0.9.0 → 0.9.1-staging.ee54ba693a

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.
Files changed (64) hide show
  1. package/dist/lib/browser/{chunk-I3M5WM6C.mjs → chunk-OBVIYZLR.mjs} +182 -43
  2. package/dist/lib/browser/chunk-OBVIYZLR.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +20 -17
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +13 -9
  7. package/dist/lib/browser/testing/index.mjs.map +3 -3
  8. package/dist/lib/node-esm/{chunk-DVJLDZLE.mjs → chunk-4IEMCMIV.mjs} +182 -43
  9. package/dist/lib/node-esm/chunk-4IEMCMIV.mjs.map +7 -0
  10. package/dist/lib/node-esm/index.mjs +20 -17
  11. package/dist/lib/node-esm/index.mjs.map +3 -3
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/lib/node-esm/testing/index.mjs +13 -9
  14. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  15. package/dist/types/src/components/Board/Board.d.ts +1 -1
  16. package/dist/types/src/components/Board/Board.d.ts.map +1 -1
  17. package/dist/types/src/components/Board/Board.stories.d.ts +2 -2
  18. package/dist/types/src/components/Board/Board.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/Board/Item.d.ts.map +1 -1
  20. package/dist/types/src/components/Focus/Focus.d.ts +1 -1
  21. package/dist/types/src/components/Focus/Focus.d.ts.map +1 -1
  22. package/dist/types/src/components/Mosaic/Container.d.ts +10 -1
  23. package/dist/types/src/components/Mosaic/Container.d.ts.map +1 -1
  24. package/dist/types/src/components/Mosaic/DragHandle.d.ts +28 -0
  25. package/dist/types/src/components/Mosaic/DragHandle.d.ts.map +1 -0
  26. package/dist/types/src/components/Mosaic/Mosaic.d.ts +18 -2
  27. package/dist/types/src/components/Mosaic/Mosaic.d.ts.map +1 -1
  28. package/dist/types/src/components/Mosaic/Placeholder.d.ts +2 -2
  29. package/dist/types/src/components/Mosaic/Placeholder.d.ts.map +1 -1
  30. package/dist/types/src/components/Mosaic/ResizeHandle.d.ts +14 -0
  31. package/dist/types/src/components/Mosaic/ResizeHandle.d.ts.map +1 -0
  32. package/dist/types/src/components/Mosaic/ResizeHandle.stories.d.ts +12 -0
  33. package/dist/types/src/components/Mosaic/ResizeHandle.stories.d.ts.map +1 -0
  34. package/dist/types/src/components/Mosaic/Root.d.ts +1 -1
  35. package/dist/types/src/components/Mosaic/Root.d.ts.map +1 -1
  36. package/dist/types/src/components/Mosaic/Stack.d.ts +1 -1
  37. package/dist/types/src/components/Mosaic/Stack.d.ts.map +1 -1
  38. package/dist/types/src/components/Mosaic/Tile.d.ts +34 -0
  39. package/dist/types/src/components/Mosaic/Tile.d.ts.map +1 -1
  40. package/dist/types/src/components/Mosaic/styles.d.ts.map +1 -1
  41. package/dist/types/src/testing/DefaultStackTile.d.ts.map +1 -1
  42. package/dist/types/src/testing/types.d.ts +10 -12
  43. package/dist/types/src/testing/types.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +33 -33
  46. package/src/components/Board/Board.stories.tsx +3 -3
  47. package/src/components/Board/Board.tsx +1 -1
  48. package/src/components/Board/Item.tsx +20 -12
  49. package/src/components/Focus/Focus.tsx +1 -1
  50. package/src/components/Mosaic/Container.tsx +21 -7
  51. package/src/components/Mosaic/DragHandle.tsx +75 -0
  52. package/src/components/Mosaic/Mosaic.tsx +12 -4
  53. package/src/components/Mosaic/Placeholder.tsx +4 -2
  54. package/src/components/Mosaic/ResizeHandle.stories.tsx +119 -0
  55. package/src/components/Mosaic/ResizeHandle.tsx +56 -0
  56. package/src/components/Mosaic/Root.tsx +3 -1
  57. package/src/components/Mosaic/Stack.tsx +23 -2
  58. package/src/components/Mosaic/Tile.tsx +82 -4
  59. package/src/components/Mosaic/styles.ts +4 -3
  60. package/src/components/SearchStack/SearchStack.tsx +1 -1
  61. package/src/testing/DefaultStackTile.tsx +6 -4
  62. package/src/testing/types.ts +14 -14
  63. package/dist/lib/browser/chunk-I3M5WM6C.mjs.map +0 -7
  64. package/dist/lib/node-esm/chunk-DVJLDZLE.mjs.map +0 -7
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useVisibleItems.ts", "../../../src/components/Focus/Focus.tsx", "../../../src/components/Mosaic/styles.ts", "../../../src/components/Mosaic/types.ts", "../../../src/components/Mosaic/Root.tsx", "../../../src/components/Mosaic/Container.tsx", "../../../src/components/Mosaic/Tile.tsx", "../../../src/components/Mosaic/DragHandle.tsx", "../../../src/components/Mosaic/Placeholder.tsx", "../../../src/components/Mosaic/ResizeHandle.tsx", "../../../src/components/Mosaic/Stack.tsx", "../../../src/components/Mosaic/Mosaic.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type GetId, type MosaicTileData } from '../components';\n\nexport type UseVisibleItemsProps<TItem = any> = {\n /** Container id. */\n id: string;\n\n /** Current items. */\n items?: readonly TItem[] | TItem[];\n\n /** Currently dragging item. */\n dragging: MosaicTileData<TItem> | undefined;\n\n /** ID getter */\n getId: GetId<TItem>;\n};\n\n/**\n * Returns items with the dragging item removed.\n */\nexport const useVisibleItems = <TItem = any>({\n id,\n items,\n dragging,\n getId,\n}: UseVisibleItemsProps<TItem>): readonly TItem[] | TItem[] => {\n const visibleItems = useMemo(() => {\n if (!items || !dragging || id !== dragging.containerId) {\n return items ?? [];\n }\n\n const idx = items.findIndex((item) => getId(item) === dragging.id);\n if (idx === -1) {\n return items;\n }\n\n const visibleItems = items.slice();\n visibleItems.splice(idx, 1);\n return visibleItems;\n }, [id, items, dragging, getId]);\n\n return visibleItems;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// Re-export from @dxos/react-ui.\nexport { Focus, type FocusGroupProps, type FocusItemProps, useFocus } from '@dxos/react-ui';\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type ClassNameValue } from '@dxos/react-ui';\n\nexport const styles = {\n placeholder: {\n root: [\n 'group opacity-0',\n 'group-data-[mosaic-debug=\"true\"]:opacity-100',\n 'group-data-[mosaic-debug=\"true\"]:bg-orange-500',\n 'data-[mosaic-placeholder-state=active]:opacity-100',\n 'data-[mosaic-placeholder-orientation=vertical]:snap-start', // TODO(burdon): Option.\n 'data-[mosaic-placeholder-orientation=vertical]:py-1',\n 'data-[mosaic-placeholder-orientation=vertical]:data-[mosaic-placeholder-state=active]:py-2.5',\n 'data-[mosaic-placeholder-orientation=horizontal]:px-1',\n 'data-[mosaic-placeholder-orientation=horizontal]:data-[mosaic-placeholder-state=active]:px-2.5',\n ],\n content: [\n 'transition-all duration-0',\n // Placeholders open instantly (`duration-0`). The source slot is reserved on drag start by\n // activating its placeholder (see Stack.tsx), so the stack no longer collapses/flickers when the\n // dragged item is removed. NOTE: if the open animation below is ever enabled, exempt the source\n // placeholder — animating its reserved gap from 0 would reintroduce the start-of-drag flicker.\n // 'group-data-[mosaic-placeholder-state=active]:duration-200',\n 'group-data-[mosaic-placeholder-orientation=vertical]:h-0',\n 'group-data-[mosaic-placeholder-orientation=vertical]:group-data-[mosaic-placeholder-state=active]:h-[var(--mosaic-placeholder-height)]',\n 'group-data-[mosaic-placeholder-orientation=horizontal]:w-0',\n 'group-data-[mosaic-placeholder-orientation=horizontal]:group-data-[mosaic-placeholder-state=active]:w-[var(--mosaic-placeholder-width)]',\n ],\n },\n} satisfies Record<string, Record<string, ClassNameValue>>;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nexport type GetId<TData = any> = (data: TData) => string;\n\n/**\n * NOTE: Must implement value equivalence.\n */\nexport type LocationType = string | number;\n\n/**\n * Get the source data from the drag payload.\n */\nexport const getSourceData = <TData = any, TLocation = any>(\n source: ElementDragPayload,\n): MosaicTileData<TData, TLocation> | null => {\n return source.data.type === 'tile' ? (source.data as MosaicTileData<TData, TLocation>) : null;\n};\n\n/**\n * Draggable item.\n * Tiles may contain arbitrary data (which may not be an ECHO object; e.g., search result).\n */\nexport type MosaicTileData<TData = any, TLocation = any> = {\n type: 'tile';\n containerId: string;\n id: string;\n data: TData;\n location: TLocation;\n bounds?: DOMRect;\n};\n\n/**\n * Drop target placeholder.\n */\nexport type MosaicPlaceholderData<TLocation = any> = {\n type: 'placeholder';\n containerId: string;\n location: TLocation;\n};\n\n/**\n * Drop target container.\n */\nexport type MosaicContainerData = {\n type: 'container';\n id: string;\n};\n\nexport type MosaicData = MosaicTileData | MosaicPlaceholderData | MosaicContainerData;\n\nexport type MosaicTargetData = MosaicTileData | MosaicPlaceholderData;\n\n/**\n * Handler implemented by drop containers.\n */\nexport interface MosaicEventHandler<TData = any, TObject = any> {\n /**\n * Container identifier.\n */\n id: string;\n\n /**\n * Determine if the item can be dropped into this container.\n * NOTE: This is continuously called while dragging (doesn't require mouse movement).\n */\n canDrop?: (props: { source: MosaicTileData<TData> }) => boolean;\n\n /**\n * Called during drag for custom visualization.\n */\n onDrag?: (props: { source: MosaicTileData<TData>; position: { x: number; y: number } }) => void;\n\n /**\n * Insert/rearrange the item at the given location.\n */\n onDrop?: (props: { source: MosaicTileData<TData>; target?: MosaicData }) => void;\n\n /**\n * Request the object to be dropped.\n * This allows the source container to clone/mutate/swap the object before it is dropped.\n * If the callback returns true, then the callback may decide to remove the item from the source container,\n * completing the transfer.\n */\n onTake?: (props: { source: MosaicTileData<TData> }, cb: (object: TObject) => Promise<boolean>) => void;\n\n /**\n * Dragging ended.\n */\n onCancel?: () => void;\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { type ElementDragPayload, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { type DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type PropsWithChildren, forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { log } from '@dxos/log';\n\nimport { type MosaicData, type MosaicEventHandler, type MosaicTileData } from './types';\n\n//\n// Context\n//\n\ntype MosaicDraggingSource = {\n data: MosaicTileData;\n handler?: MosaicEventHandler;\n container?: Element;\n};\n\ntype MosaicDraggingTarget = {\n data: MosaicData;\n handler?: MosaicEventHandler;\n};\n\ntype MosaicDraggingState = {\n source: MosaicDraggingSource;\n target?: MosaicDraggingTarget;\n};\n\ntype MosaicRootContextValue = {\n containers: Record<string, MosaicEventHandler>;\n addContainer: (container: MosaicEventHandler) => void;\n removeContainer: (id: string) => void;\n dragging?: MosaicDraggingState;\n};\n\nconst [MosaicRootContextProvider, useMosaicRootContext] = createContext<MosaicRootContextValue>('MosaicRoot');\n\n//\n// Root\n//\n\nconst MOSAIC_ROOT_NAME = 'Mosaic.Root';\n\n// State attribute: [&:has(>_[data-mosaic-debug=true])]\nconst MOSAIC_ROOT_DEBUG_ATTR = 'mosaic-debug';\n\ntype MosaicRootProps = PropsWithChildren<{\n asChild?: boolean;\n debug?: boolean;\n}>;\n\nconst MosaicRoot = forwardRef<HTMLDivElement, MosaicRootProps>(({ children, asChild, debug }, forwardedRef) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n const Comp = asChild ? Slot : Primitive.div;\n\n const [handlers, setHandlers] = useState<Record<string, MosaicEventHandler>>({});\n const [dragging, setDragging] = useState<MosaicDraggingState | undefined>();\n\n const getSourceHandler = useCallback(\n (source: ElementDragPayload): { data: MosaicTileData; handler?: MosaicEventHandler } => {\n const data = source.data as MosaicTileData;\n return { data, handler: handlers[data.containerId] };\n },\n [handlers],\n );\n\n const getTargetHandler = useCallback(\n (location: DragLocationHistory): { data?: MosaicData; handler?: MosaicEventHandler } => {\n for (const target of location.current.dropTargets) {\n const data = target.data as MosaicData;\n let containerId: string;\n switch (data.type) {\n case 'tile':\n case 'placeholder':\n containerId = data.containerId;\n break;\n case 'container':\n containerId = data.id;\n break;\n }\n\n const handler = handlers[containerId];\n if (handler) {\n return { data, handler };\n }\n }\n\n return {};\n },\n [handlers],\n );\n\n useEffect(() => {\n const handleChange = ({ source, location }: { source: ElementDragPayload; location: DragLocationHistory }) => {\n const { data: sourceData } = getSourceHandler(source);\n const { data: targetData, handler } = getTargetHandler(location);\n setDragging((dragging) => {\n dragging?.target?.handler?.onCancel?.();\n return {\n source: {\n data: sourceData,\n handler: handlers[sourceData.containerId],\n // TODO(burdon): Check id matches.\n container: location.initial.dropTargets.find((target) => target.data.type === 'container')?.element,\n },\n target: targetData && {\n data: targetData,\n handler,\n },\n };\n });\n };\n\n const handleCancel = () => {\n setDragging((dragging) => {\n requestAnimationFrame(() => {\n dragging?.target?.handler?.onCancel?.();\n dragging?.source?.container?.dispatchEvent(new CustomEvent('dnd:cancel', { bubbles: true }));\n });\n\n return undefined;\n });\n };\n\n let noTargetTimeout: NodeJS.Timeout;\n\n // Main controller.\n return combine(\n monitorForElements({\n // Only monitor Mosaic tile drags; other pragmatic-dnd sources under this root are not ours to handle.\n canMonitor: ({ source }) => source.data.type === 'tile',\n /**\n * Dragging started within any container.\n */\n onDragStart: ({ source, location }) => {\n log('Root.onDragStart', {\n source: source.data,\n location: location.current.dropTargets.map((target) => target.data),\n });\n\n handleChange({ source, location });\n },\n\n /**\n * Dragging entered a new container.\n */\n onDropTargetChange: ({ source, location }) => {\n clearTimeout(noTargetTimeout);\n log('Root.onDropTargetChange', {\n source: source.data,\n location: location.current.dropTargets.map((target) => target.data),\n });\n\n // Stop dragging if there are no drop targets (or we are cancelling).\n if (location.current.dropTargets.length === 0) {\n noTargetTimeout = setTimeout(() => setDragging(undefined), 1_000);\n } else {\n handleChange({ source, location });\n }\n },\n\n /**\n * Dragging within any container.\n */\n onDrag: ({ source, location }) => {\n const { data } = getSourceHandler(source);\n const { handler } = getTargetHandler(location);\n if (handler) {\n const { clientX: x, clientY: y } = location.current.input;\n handler.onDrag?.({ source: data, position: { x, y } });\n }\n },\n\n /**\n * Dragging ended.\n */\n onDrop: ({ source, location }) => {\n log.info('Root.onDrop', {\n source: source.data,\n location: location.current.dropTargets.map((target) => target.data),\n });\n\n // Get the source container.\n const { data: sourceData, handler: sourceHandler } = getSourceHandler(source);\n if (!sourceHandler) {\n log.warn('invalid source', {\n source: sourceData,\n handlers: Object.keys(handlers),\n });\n return;\n }\n\n // NOTE: When dragging is cancelled (e.g., user presses ESC) onDrop is only called after a subsequent event.\n // NOTE: pDND blocks ESC event propagation while dragging.\n // - ESC only flips internal state.\n // - Completion happens on the next processed input event.\n // - This avoids reentrancy and keeps pointer/keyboard behavior consistent.\n // - We set dragging to undefined in onDropTargetChange after a delay if there are no drop targets.\n try {\n if (location.current.dropTargets.length === 0) {\n log.info('cancelled');\n } else {\n // Get the target container.\n const { data: targetData, handler: targetHandler } = getTargetHandler(location);\n if (!targetHandler) {\n log.warn('invalid target', {\n source: sourceData,\n location,\n handlers: Object.keys(handlers),\n });\n return;\n }\n\n // TODO(burdon): Check object doesn't already exist in the collection.\n if (sourceHandler === targetHandler) {\n targetHandler.onDrop?.({\n source: sourceData,\n target: targetData,\n });\n } else {\n if (!sourceHandler.onTake) {\n log.warn('invalid source', { source: sourceData });\n return;\n }\n\n sourceHandler.onTake?.({ source: sourceData }, async (object) => {\n targetHandler.onDrop?.({\n source: { ...sourceData, data: object },\n target: targetData,\n });\n\n return true;\n });\n }\n }\n } finally {\n handleCancel();\n }\n },\n }),\n );\n }, [handlers, getSourceHandler, getTargetHandler]);\n\n return (\n <MosaicRootContextProvider\n containers={handlers}\n addContainer={(container) =>\n setHandlers((containers) => ({\n ...containers,\n [container.id]: container,\n }))\n }\n removeContainer={(id) =>\n setHandlers((containers) => {\n delete containers[id];\n return { ...containers };\n })\n }\n dragging={dragging}\n >\n <Comp\n className='contents group'\n {...{\n [`data-${MOSAIC_ROOT_DEBUG_ATTR}`]: debug,\n }}\n ref={composedRef}\n >\n {children}\n </Comp>\n </MosaicRootContextProvider>\n );\n});\n\nMosaicRoot.displayName = MOSAIC_ROOT_NAME;\n\nexport { MosaicRoot, useMosaicRootContext };\n\nexport type { MosaicDraggingState, MosaicRootProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { bind } from 'bind-event-listener';\nimport React, {\n type CSSProperties,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type AllowedAxis, composable, composableProps } from '@dxos/react-ui';\nimport { isTruthy } from '@dxos/util';\n\nimport { useFocus } from '../Focus';\nimport { type MosaicDraggingState, useMosaicRootContext } from './Root';\nimport {\n type LocationType,\n type MosaicContainerData,\n type MosaicEventHandler,\n type MosaicTileData,\n getSourceData,\n} from './types';\n\n//\n// Container\n//\n\nconst MOSAIC_CONTAINER_NAME = 'Mosaic.Container';\n\ntype MosaicContainerState = { type: 'idle' } | { type: 'active'; bounds?: DOMRect };\n\ntype MosaicContainerContextValue<TData = any, Location = LocationType> = {\n id: string;\n eventHandler: MosaicEventHandler<TData>;\n orientation?: AllowedAxis;\n dragging?: MosaicDraggingState;\n scrolling?: boolean;\n state: MosaicContainerState;\n\n /** Active drop location. */\n activeLocation?: Location;\n setActiveLocation: (location: Location | undefined) => void;\n\n /** ID of the current (aria-current) item. */\n currentId?: string;\n /** Set the current item by ID. */\n setCurrentId: (id: string | undefined) => void;\n\n /** IDs of selected (aria-selected) items. */\n selectedIds?: ReadonlySet<string>;\n /** Request to set or unset selection on an item by ID. */\n setSelected: (id: string, selected: boolean) => void;\n\n /** Register a scroll-to-item callback (provided by Stack/VirtualStack). */\n registerScrollTo: (fn: ((id: string) => void) | undefined) => void;\n};\n\nconst [MosaicContainerContextProvider, useMosaicContainerContext] =\n createContext<MosaicContainerContextValue>('MosaicContainer');\n\n// State attribute: [&:has(>_[data-mosaic-container-state=active])]\nconst MOSAIC_CONTAINER_STATE_ATTR = 'mosaic-container-state';\n\n// CSS variables: [var(--mosaic-placeholder-xxx)]\nconst MOSAIC_CONTAINER_PLACEHOLDER_WIDTH = '--mosaic-placeholder-width';\nconst MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT = '--mosaic-placeholder-height';\n\nlet counter = 0;\n\n/** Imperative handle for scrolling a stack to an item without changing the current/selected item. */\nexport type MosaicScrollController = {\n scrollToItem: (id: string) => void;\n};\n\ntype MosaicContainerProps = PropsWithChildren<\n Partial<Pick<MosaicContainerContextValue, 'eventHandler' | 'orientation'>> & {\n asChild?: boolean;\n /** Support autoscrolling container when dragging. */\n autoScroll?: HTMLElement | null;\n withFocus?: boolean;\n /** Imperative handle to scroll the stack to an item (decoupled from selection). */\n controllerRef?: Ref<MosaicScrollController>;\n /** Controlled current-item ID. */\n currentId?: string;\n /** Called when a tile requests to become current. */\n onCurrentChange?: (id: string | undefined) => void;\n /** Controlled set of selected item IDs. */\n selectedIds?: ReadonlySet<string>;\n /** Called when a tile requests to toggle selection. */\n onSelectionChange?: (id: string, selected: boolean) => void;\n debug?: () => ReactNode;\n }\n>;\n\n/**\n * Container for a Mosaic layout.\n */\n// TODO(burdon): Make generic.\nconst MosaicContainer = composable<HTMLDivElement, MosaicContainerProps>(\n (\n {\n children,\n eventHandler: eventHandlerProp,\n orientation = 'vertical',\n asChild,\n autoScroll: autoscrollElement,\n withFocus,\n controllerRef,\n currentId,\n onCurrentChange,\n selectedIds,\n onSelectionChange,\n debug,\n ...props\n },\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : Primitive.div;\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n\n // Handler.\n const eventHandler = useMemo(\n () =>\n eventHandlerProp ?? {\n id: `mosaic-container-${counter++}`,\n },\n [eventHandlerProp],\n );\n\n // State.\n const { dragging } = useMosaicRootContext(MOSAIC_CONTAINER_NAME);\n const [state, setState] = useState<MosaicContainerState>({ type: 'idle' });\n const [activeLocation, setActiveLocation] = useState<LocationType | undefined>();\n const [scrolling, setScrolling] = useState(false);\n const setCurrentId = useCallback((id: string | undefined) => onCurrentChange?.(id), [onCurrentChange]);\n const setSelected = useCallback(\n (id: string, selected: boolean) => onSelectionChange?.(id, selected),\n [onSelectionChange],\n );\n\n // Scroll-to-item: Stack/VirtualStack registers its implementation.\n const scrollToRef = useRef<((id: string) => void) | undefined>(undefined);\n const registerScrollTo = useCallback((fn: ((id: string) => void) | undefined) => {\n scrollToRef.current = fn;\n }, []);\n\n // Imperative scroll-to-item, decoupled from selection (e.g. a calendar scrolling the stack to a day).\n useImperativeHandle(controllerRef, () => ({ scrollToItem: (id: string) => scrollToRef.current?.(id) }), []);\n\n // When currentId changes, scroll the matching item into view.\n useEffect(() => {\n if (currentId) {\n scrollToRef.current?.(currentId);\n }\n }, [currentId]);\n\n // Focus container.\n const { setFocus } = useFocus();\n useEffect(() => {\n if (withFocus) {\n setFocus?.(state.type === 'active' ? 'active' : undefined);\n }\n }, [setFocus, withFocus, state]);\n\n // Register handler.\n const { addContainer, removeContainer } = useMosaicRootContext(eventHandler.id);\n useEffect(() => {\n addContainer(eventHandler);\n return () => removeContainer(eventHandler.id);\n }, [eventHandler]);\n\n const data = useMemo<MosaicContainerData>(\n () =>\n ({\n type: 'container',\n id: eventHandler.id,\n }) satisfies MosaicContainerData,\n [eventHandler.id],\n );\n\n useEffect(() => {\n if (!rootRef.current) {\n return;\n }\n\n // Determine if scrolling (pause drag/drop handlers).\n let timeout: ReturnType<typeof setTimeout>;\n const handleScroll = () => {\n setScrolling(true);\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n setScrolling(false);\n }, 500);\n };\n\n return combine(\n ...[\n /**\n * Custom event for dragging cancellation.\n */\n bind(rootRef.current, {\n type: 'dnd:cancel',\n listener: () => {\n setState({ type: 'idle' });\n },\n }),\n\n // Target.\n dropTargetForElements({\n element: rootRef.current,\n getData: () => data,\n\n /**\n * Test if permitted to drop here.\n * NOTE: Contained Tile and Placeholder elements do the same.\n */\n canDrop: ({ source }) => {\n const data = getSourceData(source);\n return (data && eventHandler.canDrop?.({ source: data })) || false;\n },\n\n // Reorder is a move, not a copy — otherwise the browser shows the green \"+\" copy cursor.\n getDropEffect: () => 'move',\n\n /**\n * Dragging started in this container.\n */\n onDragStart: ({ source }) => {\n const sourceData = source.data as MosaicTileData;\n setState({ type: 'active', bounds: sourceData.bounds });\n },\n /**\n * Dragging entered this container.\n */\n onDragEnter: ({ source }) => {\n const sourceData = source.data as MosaicTileData;\n setState({ type: 'active', bounds: sourceData.bounds });\n },\n /**\n * Dragging left this container.\n * NOTE: If the container isn't full-height, then when the dragged item is temporarily removed the container will shrink,\n * triggering `onDragLeave`, which then causes the item to be added and removed continually (flickering).\n */\n onDragLeave: ({ source }) => {\n const sourceData = source.data as MosaicTileData;\n if (sourceData.containerId !== eventHandler.id) {\n setState({ type: 'idle' });\n }\n },\n /**\n * Dropped in this container.\n */\n onDrop: () => {\n setState({ type: 'idle' });\n },\n }),\n\n // Autoscroll.\n // NOTE: When used with Scrollable we get a spurious warning (in dev mode).\n // \"Auto scrolling has been attached to an element that appears not to be scrollable.\"\n autoscrollElement && [\n autoScrollForElements({\n element: autoscrollElement,\n // Only autoscroll for tile (reorder) drags. Resize-handle drags carry no tile data, so\n // resizing a tile near a viewport edge must not scroll the container.\n canScroll: ({ source }) => getSourceData(source) != null,\n getAllowedAxis: () => orientation,\n getConfiguration: () => ({\n maxScrollSpeed: 'fast',\n }),\n }),\n\n bind(autoscrollElement, {\n type: 'scroll',\n listener: handleScroll,\n }),\n\n () => setScrolling(false),\n ],\n ]\n .filter(isTruthy)\n .flatMap((x) => x),\n );\n }, [rootRef, eventHandler, data, autoscrollElement]);\n\n return (\n <MosaicContainerContextProvider\n id={eventHandler.id}\n eventHandler={eventHandler}\n orientation={orientation}\n state={state}\n dragging={state.type === 'active' ? dragging : undefined}\n scrolling={scrolling}\n activeLocation={activeLocation}\n setActiveLocation={setActiveLocation}\n currentId={currentId}\n setCurrentId={setCurrentId}\n selectedIds={selectedIds}\n setSelected={setSelected}\n registerScrollTo={registerScrollTo}\n >\n <Comp\n {...composableProps(props, {\n classNames: 'h-full',\n style: {\n [MOSAIC_CONTAINER_PLACEHOLDER_WIDTH]:\n state.type === 'active' && state.bounds ? `${state.bounds.width}px` : '0px',\n [MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT]:\n state.type === 'active' && state.bounds ? `${state.bounds.height}px` : '0px',\n } as CSSProperties,\n })}\n {...{\n [`data-${MOSAIC_CONTAINER_STATE_ATTR}`]: state.type,\n }}\n ref={composedRef}\n >\n {children}\n </Comp>\n {debug?.()}\n </MosaicContainerContextProvider>\n );\n },\n);\n\nMosaicContainer.displayName = MOSAIC_CONTAINER_NAME;\n\nexport { MosaicContainer, useMosaicContainerContext };\n\nexport type { MosaicContainerProps, MosaicContainerState };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n type ElementDragPayload,\n draggable,\n dropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { type DropTargetRecord } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type PropsWithChildren, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { composableProps, slottable } from '@dxos/react-ui';\nimport { type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\nimport { useMosaicContainerContext } from './Container';\nimport { type LocationType, type MosaicTileData, getSourceData } from './types';\n\n//\n// Tile\n//\n\nconst MOSAIC_TILE_NAME = 'Mosaic.Tile';\n\ntype MosaicTileState =\n | { type: 'idle' }\n | { type: 'preview'; container: HTMLElement; rect: DOMRect }\n | { type: 'dragging' }\n | { type: 'target'; closestEdge: Edge | null };\n\ntype MosaicTileContextValue = {\n state: MosaicTileState;\n /** Register the element that initiates dragging; set by a child `Mosaic.DragHandle`. */\n setDragHandle: (element: HTMLElement | null) => void;\n /** Current extent (rem) during/after resize; undefined when the tile is not sized. */\n size?: Size;\n /** Update the tile extent. A `commit` (drop) propagates to the consumer's `onSizeChange`. */\n setSize: (size: Size, commit?: boolean) => void;\n /** Resize bounds (rem) declared by the tile; consumed by `Mosaic.ResizeHandle`. */\n minSize?: number;\n maxSize?: number;\n};\n\nconst [MosaicTileContextProvider, useMosaicTileContext] = createContext<MosaicTileContextValue>('MosaicTile');\n\n// State attribute: data-[mosaic-tile-state=dragging]\nconst MOSAIC_TILE_STATE_ATTR = 'mosaic-tile-state';\n\ntype MosaicTileProps<TData = any, TLocation = LocationType> = ThemedClassName<\n PropsWithChildren<{\n className?: string;\n dragHandle?: HTMLElement | null;\n allowedEdges?: Edge[];\n id: string;\n data: TData;\n location: TLocation;\n draggable?: boolean;\n /** Whether this tile is the current (aria-current) item. */\n current?: boolean;\n /** Whether this tile is selected (aria-selected). */\n selected?: boolean;\n /**\n * Initial extent in rem (width when the container is horizontal, height when vertical).\n * Pair with a child `Mosaic.ResizeHandle` to make the tile user-resizable; the consumer\n * persists committed sizes via {@link MosaicTileProps.onSizeChange}.\n */\n size?: Size;\n /** Called when the user commits a resize (on drop). */\n onSizeChange?: (size: Size) => void;\n /** Lower bound for the resizable extent in rem; enforced during drag and as a CSS min constraint. */\n minSize?: number;\n /** Upper bound for the resizable extent in rem; enforced during drag and as a CSS max constraint. */\n maxSize?: number;\n debug?: boolean;\n }>\n>;\n\nconst MosaicTile = slottable<HTMLDivElement, MosaicTileProps>(\n (\n {\n children,\n asChild,\n dragHandle: dragHandleProp,\n allowedEdges: allowedEdgesProp,\n location,\n id,\n data: dataProp,\n draggable: draggableProp,\n current,\n selected,\n size: sizeProp,\n onSizeChange,\n minSize,\n maxSize,\n debug: _,\n ...props\n },\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : Primitive.div;\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs<HTMLDivElement>(rootRef, forwardedRef);\n\n // State.\n const {\n id: containerId,\n eventHandler,\n orientation,\n scrolling,\n setActiveLocation,\n } = useMosaicContainerContext(MOSAIC_TILE_NAME);\n const [state, setState] = useState<MosaicTileState>({ type: 'idle' });\n\n // A child `Mosaic.DragHandle` registers its element here; an explicit `dragHandle` prop wins.\n const [registeredDragHandle, setRegisteredDragHandle] = useState<HTMLElement | null>(null);\n const dragHandle = dragHandleProp ?? registeredDragHandle;\n\n // Live extent during a resize drag. Seeded from the prop; the consumer persists committed\n // sizes via `onSizeChange` and feeds the result back as `size` on the next render.\n const [size, setInternalSize] = useState<Size | undefined>(sizeProp);\n const setSize = useCallback(\n (nextSize: Size, commit?: boolean) => {\n setInternalSize(nextSize);\n if (commit) {\n onSizeChange?.(nextSize);\n }\n },\n [onSizeChange],\n );\n\n const allowedEdges = useMemo<Edge[]>(\n () => allowedEdgesProp || (orientation === 'vertical' ? ['top', 'bottom'] : ['left', 'right']),\n [allowedEdgesProp, orientation],\n );\n\n const data = useMemo<MosaicTileData>(\n () =>\n ({\n type: 'tile',\n id,\n containerId,\n data: dataProp,\n location,\n }) satisfies MosaicTileData,\n [containerId, location, dataProp],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!draggableProp || !root || !containerId || scrolling) {\n return;\n }\n\n const handleChange = ({ self, source }: { self: DropTargetRecord; source: ElementDragPayload }) => {\n if (source.data.id !== dataProp.id) {\n const closestEdge = extractClosestEdge(self.data);\n const location = data.location + (closestEdge === 'top' || closestEdge === 'left' ? -0.5 : 0.5);\n setActiveLocation(location);\n setState({ type: 'target', closestEdge });\n }\n };\n\n // Mark the drag as a move at the native level. pragmatic-drag-and-drop only sets `dropEffect` (on\n // dragover via `getDropEffect`), never `effectAllowed`, so the first dragstart frame shows the\n // browser's default green \"+\" copy cursor until the first drop target is entered.\n const handleNativeDragStart = (event: DragEvent) => {\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n }\n };\n root.addEventListener('dragstart', handleNativeDragStart);\n\n return combine(\n () => root.removeEventListener('dragstart', handleNativeDragStart),\n // Source.\n draggable({\n element: root,\n dragHandle: dragHandle && state.type !== 'preview' ? dragHandle : undefined,\n canDrag: () => true,\n getInitialData: () => data,\n onGenerateDragPreview: ({ location, nativeSetDragImage }) => {\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: preserveOffsetOnSource({\n element: root,\n input: location.current.input,\n }),\n render: ({ container }) => {\n data.bounds = root.getBoundingClientRect();\n setState({\n type: 'preview',\n container,\n rect: root.getBoundingClientRect(),\n });\n return () => setState({ type: 'dragging' });\n },\n });\n },\n\n onDragStart: () => {\n setState({ type: 'dragging' });\n },\n onDrop: () => {\n setState({ type: 'idle' });\n },\n }),\n\n // Target.\n dropTargetForElements({\n element: root,\n getData: ({ input, element }) => attachClosestEdge(data, { input, element, allowedEdges }),\n canDrop: ({ source }) => {\n const data = getSourceData(source);\n return (data && eventHandler.canDrop?.({ source: data })) || false;\n },\n // Reorder is a move, not a copy — otherwise the browser shows the green \"+\" copy cursor.\n getDropEffect: () => 'move',\n onDragEnter: ({ self, source }) => {\n handleChange({ self, source });\n },\n onDragLeave: () => {\n setState({ type: 'idle' });\n setActiveLocation(undefined);\n },\n onDrag: ({ self, source }) => {\n handleChange({ self, source });\n },\n onDrop: () => {\n setState({ type: 'idle' });\n setActiveLocation(undefined);\n },\n }),\n );\n }, [\n rootRef,\n forwardedRef,\n containerId,\n dragHandle,\n eventHandler,\n data,\n scrolling,\n allowedEdges,\n setActiveLocation,\n ]);\n\n const { className, ...rest } = composableProps(props, { classNames: 'relative outline-none' });\n\n // Apply the resize subject marker + explicit extent/bounds only when sized or bounded, so plain\n // tiles keep their intrinsic layout. The axis follows the container orientation (width vs height).\n const vertical = orientation === 'vertical';\n const sized = size != null;\n const bounded = sized || minSize != null || maxSize != null;\n const sizeStyles = {\n ...(sized && sizeStyle(size, vertical ? 'vertical' : 'horizontal')),\n ...(minSize != null && { [vertical ? 'minBlockSize' : 'minInlineSize']: `${minSize}rem` }),\n ...(maxSize != null && { [vertical ? 'maxBlockSize' : 'maxInlineSize']: `${maxSize}rem` }),\n };\n\n // NOTE: Ensure no gaps between cells (prevent drop indicators flickering).\n // NOTE: Ensure padding doesn't change position of cursor when dragging (no margins).\n return (\n <MosaicTileContextProvider\n state={state}\n setDragHandle={setRegisteredDragHandle}\n size={size}\n setSize={setSize}\n minSize={minSize}\n maxSize={maxSize}\n >\n <Comp\n {...rest}\n {...(bounded && resizeAttributes)}\n {...(bounded && { style: { ...rest.style, ...sizeStyles } })}\n {...{\n 'data-object-id': id,\n [`data-${MOSAIC_TILE_STATE_ATTR}`]: state.type,\n }}\n role='listitem'\n // Pair `current` / `selected` props with `aria-current` / `aria-selected`\n // so the `dx-current` / `dx-selected` / `dx-hover` utilities (which key\n // off those attributes) actually fire. Without this the props are purely\n // advisory and the corresponding styling silently no-ops.\n aria-current={current ? 'true' : undefined}\n aria-selected={selected ? 'true' : undefined}\n className={className}\n ref={composedRef}\n >\n {children}\n </Comp>\n\n {/* Dragging preview. Cloned at the source size; the live tile is removed from the list while\n dragging, so this clone is what the user sees following the cursor. NOTE: external SVG sprite\n `<use>` icons do not rasterize here — use inline SVG (see Mosaic.DragHandle) for drag affordances. */}\n {state.type === 'preview' &&\n createPortal(\n <Comp\n {...{\n // NOTE: Use to control appearance while dragging.\n [`data-${MOSAIC_TILE_STATE_ATTR}`]: state.type,\n }}\n className={className}\n style={{\n width: `${state.rect.width}px`,\n height: `${state.rect.height}px`,\n }}\n >\n {children}\n </Comp>,\n state.container,\n )}\n </MosaicTileContextProvider>\n );\n },\n);\n\nMosaicTile.displayName = MOSAIC_TILE_NAME;\n\nexport { MosaicTile, useMosaicTileContext };\n\nexport type { MosaicTileProps, MosaicTileState };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport React, { type ReactNode, forwardRef } from 'react';\n\nimport { Button, IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';\n\nimport { useMosaicTileContext } from './Tile';\n\nconst MOSAIC_DRAG_HANDLE_NAME = 'Mosaic.DragHandle';\n\nconst REACT_UI_TRANSLATION_KEY = '@dxos/react-ui';\n\nexport type MosaicDragHandleProps = ThemedClassName<\n Partial<Pick<IconButtonProps, 'icon' | 'label' | 'variant'>> & {\n testId?: string;\n /**\n * Inline glyph rendered in place of the sprite icon. The browser does not rasterize external SVG\n * sprite `<use>` icons into a native drag image, so a tile that appears in its own drag preview\n * (the clone follows the cursor) must use an inline-SVG handle here to stay visible while dragging.\n */\n children?: ReactNode;\n }\n>;\n\n/**\n * Affordance that initiates dragging the enclosing {@link MosaicTile}. Renders a button and\n * registers itself with the tile (via context), so consumers only need to drop it inside a\n * `Mosaic.Tile` — no `dragHandle` ref plumbing required.\n */\nexport const MosaicDragHandle = forwardRef<HTMLButtonElement, MosaicDragHandleProps>(\n (\n { icon = 'ph--dots-six-vertical--regular', label, variant = 'ghost', classNames, testId, children },\n forwardedRef,\n ) => {\n const { t } = useTranslation(REACT_UI_TRANSLATION_KEY);\n const { setDragHandle } = useMosaicTileContext(MOSAIC_DRAG_HANDLE_NAME);\n const ref = composeRefs(forwardedRef, setDragHandle);\n const testIdProps = testId ? { 'data-testid': testId } : {};\n\n // Inline-glyph variant: stays visible in the tile's own native drag image (sprite icons do not).\n if (children) {\n return (\n <Button\n ref={ref}\n variant={variant}\n tabIndex={-1}\n classNames={['grid place-items-center cursor-grab', classNames]}\n {...testIdProps}\n >\n {children}\n <span className='sr-only'>{label ?? t('toolbar-drag-handle.label')}</span>\n </Button>\n );\n }\n\n return (\n <IconButton\n ref={ref}\n iconOnly\n noTooltip\n tabIndex={-1}\n variant={variant}\n icon={icon}\n label={label ?? t('toolbar-drag-handle.label')}\n classNames={['cursor-grab', classNames]}\n {...testIdProps}\n />\n );\n },\n);\n\nMosaicDragHandle.displayName = MOSAIC_DRAG_HANDLE_NAME;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n DropIndicator as NaturalDropIndicator,\n type DropIndicatorProps as NaturalDropIndicatorProps,\n} from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type PropsWithChildren, useLayoutEffect, useMemo, useRef } from 'react';\n\nimport { type Axis, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useMosaicContainerContext } from './Container';\nimport { useMosaicTileContext } from './Tile';\nimport { type LocationType, type MosaicPlaceholderData, getSourceData } from './types';\n\n//\n// Placeholder\n//\n\nconst MOSAIC_PLACEHOLDER_NAME = 'Mosaic.Placeholder';\n\n// Orientation: data-[mosaic-placeholder-orientation=vertical]\nconst MOSAIC_PLACEHOLDER_ORIENTATION_ATTR = 'mosaic-placeholder-orientation';\n\n// State attribute: data-[mosaic-placeholder-state=active]\nconst MOSAIC_PLACEHOLDER_STATE_ATTR = 'mosaic-placeholder-state';\n\n// Location attribute: data-[mosaic-placeholder-location=0.5]. Identifies the\n// placeholder's slot in its container (0.5, 1.5, 2.5, …) so tests can target\n// a specific gap unambiguously without relying on layout-dependent indices.\nconst MOSAIC_PLACEHOLDER_LOCATION_ATTR = 'mosaic-placeholder-location';\n\ntype MosaicPlaceholderProps<Location = LocationType> = ThemedClassName<\n PropsWithChildren<{\n asChild?: boolean;\n orientation?: Axis;\n location: Location;\n }>\n>;\n\nconst MosaicPlaceholder = <Location extends LocationType = LocationType>({\n classNames,\n children,\n asChild,\n orientation = 'vertical',\n location,\n}: MosaicPlaceholderProps<Location>) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const Comp = asChild ? Slot : Primitive.div;\n const {\n id: containerId,\n eventHandler,\n scrolling,\n activeLocation,\n setActiveLocation,\n } = useMosaicContainerContext(MOSAIC_PLACEHOLDER_NAME);\n const data = useMemo<MosaicPlaceholderData<Location>>(\n () =>\n ({\n type: 'placeholder',\n containerId,\n location,\n }) satisfies MosaicPlaceholderData<Location>,\n [containerId, location],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || scrolling) {\n return;\n }\n\n return dropTargetForElements({\n element: root,\n getData: () => data,\n canDrop: ({ source }) => {\n const data = getSourceData(source);\n return (data && eventHandler.canDrop?.({ source: data })) || false;\n },\n // Reorder is a move, not a copy — otherwise the browser shows the green \"+\" copy cursor.\n getDropEffect: () => 'move',\n onDragEnter: () => {\n setActiveLocation(data.location);\n },\n onDragLeave: () => {\n setActiveLocation(undefined);\n },\n onDrop: () => {\n setActiveLocation(undefined);\n },\n });\n }, [rootRef, data, scrolling, setActiveLocation]);\n\n return (\n <Comp\n {...{\n [`data-${MOSAIC_PLACEHOLDER_ORIENTATION_ATTR}`]: orientation,\n [`data-${MOSAIC_PLACEHOLDER_STATE_ATTR}`]: data.location === activeLocation ? 'active' : 'idle',\n [`data-${MOSAIC_PLACEHOLDER_LOCATION_ATTR}`]: String(location),\n }}\n role='none'\n className={mx('relative', classNames)}\n ref={rootRef}\n >\n {children}\n </Comp>\n );\n};\n\nMosaicPlaceholder.displayName = MOSAIC_PLACEHOLDER_NAME;\n\n//\n// DropIndicator\n// TODO(burdon): Support DropIndicator or Placeholder variants.\n//\n\nconst DROP_INDICATOR_NAME = 'Mosaic.DropIndicator';\n\ntype MosaicDropIndicatorProps = Omit<NaturalDropIndicatorProps, 'edge'>;\n\nconst MosaicDropIndicator = (props: MosaicDropIndicatorProps) => {\n const { state } = useMosaicTileContext(DROP_INDICATOR_NAME);\n return state.type === 'target' && state.closestEdge ? (\n <NaturalDropIndicator {...props} edge={state.closestEdge} />\n ) : null;\n};\n\nMosaicDropIndicator.displayName = DROP_INDICATOR_NAME;\n\n//\n// Exports\n//\n\nexport { MosaicDropIndicator, MosaicPlaceholder };\n\nexport type { MosaicDropIndicatorProps, MosaicPlaceholderProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { ResizeHandle } from '@dxos/react-ui-dnd';\n\nimport { useMosaicContainerContext } from './Container';\nimport { useMosaicTileContext } from './Tile';\n\nconst MOSAIC_RESIZE_HANDLE_NAME = 'Mosaic.ResizeHandle';\n\n// Lower bounds for a tile's extent (rem); below these the content stops being usable.\nconst MIN_WIDTH = 20;\nconst MIN_HEIGHT = 3;\n// Extent assumed when the subject hasn't been measured yet (matches the deck plank default).\nconst DEFAULT_EXTRINSIC_SIZE = 50;\n\nexport type MosaicResizeHandleProps = {\n /** Lower bound in rem; overrides the tile's `minSize`, else a sensible per-axis minimum. */\n minSize?: number;\n /** Upper bound in rem; overrides the tile's `maxSize`. */\n maxSize?: number;\n /** Extent assumed before the subject is first measured. */\n fallbackSize?: number;\n};\n\n/**\n * Edge affordance that resizes the enclosing {@link MosaicTile}. The axis tracks the container\n * orientation (width when horizontal, height when vertical); the tile must be given a `size` so the\n * dragged extent is reflected and persisted via its `onSizeChange`. Resize bounds default to the\n * tile's `minSize`/`maxSize` and can be overridden per handle.\n */\nexport const MosaicResizeHandle = ({\n minSize,\n maxSize,\n fallbackSize = DEFAULT_EXTRINSIC_SIZE,\n}: MosaicResizeHandleProps) => {\n const { orientation = 'vertical' } = useMosaicContainerContext(MOSAIC_RESIZE_HANDLE_NAME);\n const { size, setSize, minSize: tileMinSize, maxSize: tileMaxSize } = useMosaicTileContext(MOSAIC_RESIZE_HANDLE_NAME);\n const horizontal = orientation === 'horizontal';\n\n return (\n <ResizeHandle\n side={horizontal ? 'inline-end' : 'block-end'}\n fallbackSize={fallbackSize}\n minSize={minSize ?? tileMinSize ?? (horizontal ? MIN_WIDTH : MIN_HEIGHT)}\n maxSize={maxSize ?? tileMaxSize}\n size={size}\n onSizeChange={setSize}\n />\n );\n};\n\nMosaicResizeHandle.displayName = MOSAIC_RESIZE_HANDLE_NAME;\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { type ReactVirtualizerOptions, useVirtualizer } from '@tanstack/react-virtual';\nimport React, {\n type FC,\n Fragment,\n type ReactElement,\n type Ref,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { type Axis, type ThemedClassName, composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useVisibleItems } from '../../hooks';\nimport { useMosaicContainerContext } from './Container';\nimport { MosaicPlaceholder, type MosaicPlaceholderProps } from './Placeholder';\nimport { styles } from './styles';\nimport { type MosaicTileProps } from './Tile';\nimport { type GetId } from './types';\n\n//\n// Mosaic Drag-and-drop\n//\n// Drop targets:\n// - Placeholders exist to allow gaps but prevent deadspace when dragging within a container.\n// - When dragging over a Tile, the placeholder next to the closest edge is activated.\n// - Placeholders expand when active; event handlers are disabled while the container is scrolling.\n//\n// [Container]\n// - [Placeholder 0.5]\n// - [Tile 1 ]\n// - [Placeholder 1.5]\n// - [Tile 2 ]\n// - [Placeholder 2.5]\n// - [Tile 3 ]\n// - [Placeholder 3.5]\n//\n// Implementation Notes\n// - We use [Radix composition](https://www.radix-ui.com/primitives/docs/guides/composition) to factor out composible aspects (e.g., Focus, Mosaic, etc.)\n// - NOTE: Use Slottable only if needed to disambiguate; otherwise a suspected Radix bug causes compositional problems.\n\nconst MOSAIC_STACK_NAME = 'MosaicStack';\n\ntype MosaicStackTileComponent<TData = any> = FC<MosaicTileProps<TData>>;\n\ntype MosaicStackProps<TData = any> = ThemedClassName<\n {\n role?: string;\n orientation?: Axis;\n getId: GetId<TData>;\n items?: readonly TData[];\n scrollIntoView?: boolean;\n Tile: MosaicStackTileComponent<TData>;\n } & Pick<MosaicTileProps<TData>, 'draggable' | 'debug'>\n>;\n\n/**\n * Linear layout of Mosaic tiles.\n * NOTE: This is a low-level component and should be wrapped by a scrollable container.\n */\nconst MosaicStackInner = composable<HTMLDivElement, MosaicStackProps>(\n (\n {\n orientation: orientationProp = 'vertical',\n getId,\n items,\n scrollIntoView = true,\n Tile,\n draggable = true,\n debug,\n ...props\n },\n forwardedRef,\n ) => {\n const {\n id,\n orientation = orientationProp,\n dragging,\n currentId,\n selectedIds,\n registerScrollTo,\n setActiveLocation,\n } = useMosaicContainerContext(MOSAIC_STACK_NAME);\n const visibleItems = useVisibleItems({ id, items, dragging: dragging?.source.data, getId });\n invariant(orientation === 'vertical' || orientation === 'horizontal', `Invalid orientation: ${orientation}`);\n\n // Reserve the dragged item's slot the instant it leaves `visibleItems`. The source is removed a frame\n // before any placeholder becomes active (the pointer still sits over the source, so no `onDragEnter`\n // has fired), which collapses the stack by the item's height and flickers the following tiles upward.\n // Activating the source-slot placeholder (location `index + 0.5`) in a layout effect fills the gap in\n // the same commit, before paint.\n const draggingSource = dragging?.source.data;\n const sourceIndex = useMemo(() => {\n if (!items || !draggingSource || draggingSource.containerId !== id) {\n return -1;\n }\n return items.findIndex((item) => getId(item) === draggingSource.id);\n }, [items, draggingSource, id, getId]);\n useLayoutEffect(() => {\n if (sourceIndex >= 0) {\n setActiveLocation(sourceIndex + 0.5);\n }\n }, [sourceIndex, setActiveLocation]);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const scrollToId = useCallback(\n (targetId: string) => {\n if (!scrollIntoView) {\n return;\n }\n\n const el = rootRef.current?.querySelector<HTMLElement>(`[data-object-id=\"${CSS.escape(targetId)}\"]`);\n el?.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n },\n [scrollIntoView],\n );\n\n useEffect(() => {\n registerScrollTo(scrollToId);\n return () => registerScrollTo(undefined);\n }, [registerScrollTo, scrollToId]);\n\n const composedRef = useComposedRefs(rootRef, forwardedRef);\n return (\n <div\n {...composableProps(props, {\n role: 'list',\n classNames: [\n 'flex',\n orientation === 'horizontal' && 'h-full [&>*]:shrink-0',\n orientation === 'vertical' && 'flex-col',\n ],\n })}\n ref={composedRef}\n >\n {draggable && <InternalPlaceholder orientation={orientation} location={0.5} />}\n {visibleItems?.map((item, index) => (\n <Fragment key={getId(item)}>\n <Tile\n id={getId(item)}\n data={item}\n location={index + 1}\n draggable={draggable}\n current={getId(item) === currentId}\n selected={selectedIds?.has(getId(item))}\n debug={debug}\n />\n {draggable && <InternalPlaceholder orientation={orientation} location={index + 1.5} />}\n </Fragment>\n ))}\n </div>\n );\n },\n);\n\nMosaicStackInner.displayName = MOSAIC_STACK_NAME;\n\nconst MosaicStack = MosaicStackInner as <TData = any>(\n props: MosaicStackProps<TData> & { ref?: Ref<HTMLDivElement> },\n) => ReactElement;\n\n//\n// VirtualStack\n//\n\nconst MOSAIC_VIRTUAL_STACK_NAME = 'MosaicVirtualStack';\n\ntype MosaicVirtualStackProps<TData = any> = MosaicStackProps<TData> &\n Pick<\n ReactVirtualizerOptions<HTMLElement, HTMLDivElement>,\n 'estimateSize' | 'gap' | 'getScrollElement' | 'overscan' | 'onChange'\n >;\n\nconst MosaicVirtualStackInner = forwardRef<HTMLDivElement, MosaicVirtualStackProps>(\n (\n {\n orientation = 'vertical',\n getId,\n items,\n scrollIntoView = true,\n Tile,\n estimateSize,\n getScrollElement,\n overscan = 8,\n gap,\n onChange,\n draggable = true,\n debug,\n ...props\n },\n forwardedRef,\n ) => {\n invariant(Tile);\n const { id, dragging, currentId, selectedIds, registerScrollTo } =\n useMosaicContainerContext(MOSAIC_VIRTUAL_STACK_NAME);\n const visibleItems = useVisibleItems({ id, items, dragging: dragging?.source.data, getId });\n // In draggable mode virtual indices alternate: even=placeholder, odd=tile.\n // Wrap estimateSize so placeholders get 0 (their actual negligible height) and\n // tile slots receive the caller's estimate at the correct tile index.\n // This keeps getTotalSize() stable as items are measured → no scrollbar drift.\n const wrappedEstimateSize = draggable\n ? (index: number) => (index % 2 === 0 ? 0 : estimateSize(Math.floor(index / 2)))\n : estimateSize;\n\n const virtualizer = useVirtualizer({\n // NOTE: When draggable we double the number of items to allow for placeholders.\n count: draggable ? visibleItems.length * 2 + 1 : visibleItems.length,\n estimateSize: wrappedEstimateSize,\n gap,\n // Inset the stack from both ends by `gap` (matching the inter-item spacing). The virtualizer\n // folds this into item offsets, getTotalSize(), and scrollToIndex, so no manual compensation.\n paddingStart: gap,\n paddingEnd: gap,\n // Key measurements by stable item ID so the size cache survives scrolling;\n // without this, measurements are indexed by position and are lost when items reorder.\n getItemKey: draggable\n ? (index) => (index % 2 === 0 ? `ph-${index}` : getId(visibleItems![Math.floor(index / 2)]))\n : (index) => getId(visibleItems![index]),\n getScrollElement,\n overscan,\n onChange,\n });\n\n // Register scroll-to-item via virtualizer index lookup.\n const scrollToId = useCallback(\n (targetId: string) => {\n const itemIndex = visibleItems.findIndex((item) => getId(item) === targetId);\n if (itemIndex >= 0) {\n if (!scrollIntoView) {\n return;\n }\n\n const virtualIndex = draggable ? itemIndex * 2 + 1 : itemIndex;\n // Align to the item's start, but offset by the inter-item `gap` so the tile lands\n // one gap below the viewport edge rather than flush against it (a plain\n // `scrollToIndex({ align: 'start' })` scrolls the preceding gap out of view).\n const [offset] = virtualizer.getOffsetForIndex(virtualIndex, 'start') ?? [];\n if (offset != null) {\n virtualizer.scrollToOffset(Math.max(0, offset - (gap ?? 0)), { behavior: 'smooth' });\n }\n }\n },\n [visibleItems, getId, draggable, virtualizer, scrollIntoView, gap],\n );\n\n useEffect(() => {\n registerScrollTo(scrollToId);\n return () => registerScrollTo(undefined);\n }, [registerScrollTo, scrollToId]);\n\n const virtualItems = virtualizer.getVirtualItems();\n const getData = (index: number): { data?: any; location: number } => {\n if (draggable) {\n if (index % 2 === 0) {\n return { location: Math.floor(index / 2) + 0.5 };\n } else {\n return { data: visibleItems![Math.floor(index / 2)], location: Math.floor(index / 2) + 1 };\n }\n } else {\n return { data: visibleItems![index], location: index + 1 };\n }\n };\n\n return (\n <div\n {...composableProps(props, {\n role: 'list',\n classNames: [\n // shrink-0 is required: this div sets an explicit height via inline style (getTotalSize).\n // Without it, a parent flex container (e.g. ScrollArea.Viewport) would shrink this div\n // to the viewport height, collapsing the scroll content and causing scrollbar drift.\n 'flex shrink-0',\n orientation === 'horizontal' && 'h-full [&>*]:shrink-0',\n orientation === 'vertical' && 'flex-col',\n ],\n })}\n style={{\n position: 'relative',\n ...(orientation === 'vertical'\n ? {\n width: '100%',\n height: virtualizer.getTotalSize(),\n }\n : {\n width: virtualizer.getTotalSize(),\n height: '100%',\n }),\n }}\n ref={forwardedRef}\n >\n {virtualItems.map(({ key, index, start }) => {\n const { data, location } = getData(index);\n return (\n <div\n key={key}\n data-index={index}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n ...(orientation === 'vertical'\n ? {\n width: '100%',\n transform: `translateY(${start}px)`,\n }\n : {\n height: '100%',\n transform: `translateX(${start}px)`,\n }),\n }}\n ref={virtualizer.measureElement}\n >\n {data ? (\n <Tile\n id={getId(data)}\n data={data}\n location={location}\n draggable={draggable}\n current={getId(data) === currentId}\n selected={selectedIds?.has(getId(data))}\n debug={debug}\n />\n ) : (\n <InternalPlaceholder orientation={orientation} location={location} />\n )}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nMosaicVirtualStackInner.displayName = MOSAIC_VIRTUAL_STACK_NAME;\n\nconst MosaicVirtualStack = MosaicVirtualStackInner as <TData = any>(\n props: MosaicVirtualStackProps<TData> & { ref?: Ref<HTMLDivElement> },\n) => ReactElement;\n\n(MosaicVirtualStack as any)[Symbol.for('dxos.composable')] = true;\n\n//\n// InternalPlaceholder\n//\n\nconst InternalPlaceholder = (props: MosaicPlaceholderProps<number>) => {\n return (\n <MosaicPlaceholder {...props} classNames={styles.placeholder.root}>\n <div\n className={mx(\n 'flex h-full bg-base-surface border border-dashed border-separator rounded-xs',\n styles.placeholder.content,\n )}\n />\n </MosaicPlaceholder>\n );\n};\n\nInternalPlaceholder.displayName = 'InternalPlaceholder';\n\n//\n// Exports\n//\n\nexport { MosaicStack, MosaicVirtualStack };\n\nexport type { MosaicStackProps, MosaicStackTileComponent, MosaicVirtualStackProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n MosaicContainer,\n type MosaicContainerProps,\n type MosaicContainerState,\n type MosaicScrollController,\n useMosaicContainerContext,\n} from './Container';\nimport { MosaicDragHandle, type MosaicDragHandleProps } from './DragHandle';\nimport {\n MosaicDropIndicator,\n type MosaicDropIndicatorProps,\n MosaicPlaceholder,\n type MosaicPlaceholderProps,\n} from './Placeholder';\nimport { MosaicResizeHandle, type MosaicResizeHandleProps } from './ResizeHandle';\nimport { MosaicRoot, type MosaicRootProps, useMosaicRootContext } from './Root';\nimport { MosaicStack, type MosaicStackProps, type MosaicStackTileComponent, MosaicVirtualStack } from './Stack';\nimport { MosaicTile, type MosaicTileProps, type MosaicTileState, useMosaicTileContext } from './Tile';\n\n//\n// Mosaic\n//\n\nexport const Mosaic = {\n Root: MosaicRoot,\n Container: MosaicContainer,\n Tile: MosaicTile,\n DragHandle: MosaicDragHandle,\n ResizeHandle: MosaicResizeHandle,\n Placeholder: MosaicPlaceholder,\n DropIndicator: MosaicDropIndicator,\n Stack: MosaicStack,\n VirtualStack: MosaicVirtualStack,\n};\n\nexport type {\n MosaicContainerProps,\n MosaicContainerState,\n MosaicDragHandleProps,\n MosaicDropIndicatorProps,\n MosaicPlaceholderProps,\n MosaicResizeHandleProps,\n MosaicRootProps,\n MosaicScrollController,\n MosaicStackProps,\n MosaicStackTileComponent,\n MosaicTileProps,\n MosaicTileState,\n};\n\nexport {\n useMosaicRootContext as useMosaic,\n useMosaicContainerContext as useMosaicContainer,\n useMosaicTileContext as useMosaicTile,\n};\n"],
5
+ "mappings": ";;;AAIA,SAASA,eAAe;AAqBjB,IAAMC,kBAAkB,CAAc,EAC3CC,IACAC,OACAC,UACAC,MAAK,MACuB;AAC5B,QAAMC,eAAeN,QAAQ,MAAA;AAC3B,QAAI,CAACG,SAAS,CAACC,YAAYF,OAAOE,SAASG,aAAa;AACtD,aAAOJ,SAAS,CAAA;IAClB;AAEA,UAAMK,MAAML,MAAMM,UAAU,CAACC,SAASL,MAAMK,IAAAA,MAAUN,SAASF,EAAE;AACjE,QAAIM,QAAQ,IAAI;AACd,aAAOL;IACT;AAEA,UAAMG,gBAAeH,MAAMQ,MAAK;AAChCL,IAAAA,cAAaM,OAAOJ,KAAK,CAAA;AACzB,WAAOF;EACT,GAAG;IAACJ;IAAIC;IAAOC;IAAUC;GAAM;AAE/B,SAAOC;AACT;;;AC1CA,SAASO,OAAkDC,gBAAgB;;;ACCpE,IAAMC,SAAS;EACpBC,aAAa;IACXC,MAAM;MACJ;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;;IAEFC,SAAS;MACP;;;;;;MAMA;MACA;MACA;MACA;;EAEJ;AACF;;;AChBO,IAAMC,gBAAgB,CAC3BC,WAAAA;AAEA,SAAOA,OAAOC,KAAKC,SAAS,SAAUF,OAAOC,OAA4C;AAC3F;;;ACh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,UAAM;QACN,KAAI9B;cAEEuB;2BACY,aAAaQ;UAE3B,OAAA;UACEN,WAAQ,cAAA,KAAA;YACRO;UACD,QAAA;UACP,WAAA,cAAA,KAAA;QACA/B;MAECgC;MAEGpD,KAAIG,YAAMiD;cACJA,gBAAAA,OAAAA,cAAAA,MAAAA;MACN7B,IAAAA,MAAUA,IAAAA;MACVxB;MACA0B;MACAC,WAAUC;MACVC,SAAOA,MAAAA,IAAAA,MAAAA;6BAGT,IAAA,MAAA,IAACyB,CAAAA;MAAoBlC;SAAoCI,gBAAAA,OAAAA,cAAAA,qBAAAA;;MAIjE;IAGN,CAAA,CAAA;EAGF+B,CAAAA,CAAAA;AAEA,CAAA;AAICC,wBAA2BC,cAAW;AAEvC,IAAE,qBAAA;AACF,mBAAA,uBAAsB,IAAA,iBAAA,CAAA,IAAA;0BAKU,CAAA,UAAA;SAAcC,gBAAAA,OAAOC,cAAgB,mBAAA;;IAE7DC,YAAWC,OACT,YAAA;;IAMV,WAAAA,IAAA,gFAAA,OAAA,YAAA,OAAA;EAEAP,CAAAA,CAAAA;AAEA;AACA,oBAAU,cAAA;;;ACxVH,IAAMQ,SAAS;EACpBC,MAAMC;EACNC,WAAWC;EACXC,MAAMC;EACNC,YAAYC;EACZC,cAAcC;EACdC,aAAaC;EACbC,eAAeC;EACfC,OAAOC;EACPC,cAAcC;AAChB;",
6
+ "names": ["useMemo", "useVisibleItems", "id", "items", "dragging", "getId", "visibleItems", "containerId", "idx", "findIndex", "item", "slice", "splice", "Focus", "useFocus", "styles", "placeholder", "root", "content", "getSourceData", "source", "data", "type", "combine", "monitorForElements", "useComposedRefs", "createContext", "Primitive", "Slot", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "log", "MosaicRootContextProvider", "MOSAIC_ROOT_DEBUG_ATTR", "rootRef", "forwardedRef", "Comp", "asChild", "setHandlers", "dragging", "setDragging", "getSourceHandler", "source", "data", "handler", "handlers", "target", "containerId", "type", "targetData", "getTargetHandler", "onCancel", "container", "location", "dropTargets", "find", "requestAnimationFrame", "bubbles", "noTargetTimeout", "canMonitor", "current", "handleChange", "clientX", "onDrag", "position", "x", "y", "sourceData", "sourceHandler", "warn", "object", "targetHandler", "handleCancel", "removeContainer", "containers", "className", "debug", "ref", "composedRef", "children", "MosaicRoot", "displayName", "autoScrollForElements", "combine", "dropTargetForElements", "useComposedRefs", "createContext", "Primitive", "Slot", "bind", "React", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "composable", "composableProps", "isTruthy", "MOSAIC_CONTAINER_NAME", "MosaicContainerContextProvider", "useMosaicContainerContext", "createContext", "MOSAIC_CONTAINER_STATE_ATTR", "MOSAIC_CONTAINER_PLACEHOLDER_WIDTH", "MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT", "counter", "MosaicContainer", "composable", "children", "eventHandler", "eventHandlerProp", "orientation", "asChild", "autoScroll", "autoscrollElement", "withFocus", "controllerRef", "currentId", "onCurrentChange", "selectedIds", "onSelectionChange", "debug", "props", "forwardedRef", "Comp", "Slot", "Primitive", "div", "rootRef", "useRef", "composedRef", "useComposedRefs", "useMemo", "id", "dragging", "useMosaicRootContext", "state", "setState", "useState", "type", "activeLocation", "setActiveLocation", "scrolling", "setScrolling", "setCurrentId", "useCallback", "setSelected", "selected", "scrollToRef", "undefined", "registerScrollTo", "fn", "current", "useImperativeHandle", "scrollToItem", "useEffect", "setFocus", "useFocus", "addContainer", "removeContainer", "data", "timeout", "handleScroll", "clearTimeout", "setTimeout", "combine", "bind", "listener", "dropTargetForElements", "element", "getData", "canDrop", "source", "getSourceData", "getDropEffect", "onDragStart", "sourceData", "bounds", "onDragEnter", "onDragLeave", "containerId", "onDrop", "autoScrollForElements", "canScroll", "getAllowedAxis", "getConfiguration", "maxScrollSpeed", "filter", "isTruthy", "flatMap", "x", "React", "composableProps", "classNames", "style", "width", "height", "ref", "displayName", "attachClosestEdge", "extractClosestEdge", "combine", "draggable", "dropTargetForElements", "preserveOffsetOnSource", "setCustomNativeDragPreview", "composeRefs", "createContext", "Primitive", "Slot", "React", "useCallback", "useLayoutEffect", "useMemo", "useRef", "useState", "createPortal", "composableProps", "slottable", "resizeAttributes", "sizeStyle", "MOSAIC_TILE_NAME", "MosaicTileContextProvider", "useMosaicTileContext", "createContext", "MOSAIC_TILE_STATE_ATTR", "MosaicTile", "slottable", "children", "asChild", "dragHandle", "dragHandleProp", "allowedEdges", "allowedEdgesProp", "location", "id", "data", "dataProp", "draggable", "draggableProp", "current", "selected", "size", "sizeProp", "onSizeChange", "minSize", "maxSize", "debug", "_", "props", "forwardedRef", "Comp", "Slot", "Primitive", "div", "rootRef", "useRef", "composedRef", "composeRefs", "containerId", "eventHandler", "orientation", "scrolling", "setActiveLocation", "useMosaicContainerContext", "state", "setState", "useState", "type", "registeredDragHandle", "setRegisteredDragHandle", "setInternalSize", "setSize", "useCallback", "nextSize", "commit", "useMemo", "useLayoutEffect", "root", "handleChange", "self", "source", "closestEdge", "extractClosestEdge", "handleNativeDragStart", "event", "dataTransfer", "effectAllowed", "addEventListener", "combine", "removeEventListener", "element", "undefined", "canDrag", "getInitialData", "onGenerateDragPreview", "nativeSetDragImage", "setCustomNativeDragPreview", "getOffset", "preserveOffsetOnSource", "input", "render", "container", "bounds", "getBoundingClientRect", "rect", "onDragStart", "onDrop", "dropTargetForElements", "getData", "attachClosestEdge", "canDrop", "getSourceData", "getDropEffect", "onDragEnter", "onDragLeave", "onDrag", "className", "rest", "composableProps", "classNames", "vertical", "sized", "bounded", "sizeStyles", "sizeStyle", "React", "setDragHandle", "resizeAttributes", "style", "role", "aria-current", "aria-selected", "ref", "createPortal", "width", "height", "displayName", "composeRefs", "React", "forwardRef", "Button", "IconButton", "useTranslation", "MOSAIC_DRAG_HANDLE_NAME", "REACT_UI_TRANSLATION_KEY", "MosaicDragHandle", "forwardRef", "icon", "label", "variant", "classNames", "testId", "children", "forwardedRef", "t", "useTranslation", "setDragHandle", "useMosaicTileContext", "ref", "composeRefs", "testIdProps", "React", "Button", "tabIndex", "span", "className", "IconButton", "iconOnly", "noTooltip", "displayName", "DropIndicator", "NaturalDropIndicator", "dropTargetForElements", "Primitive", "Slot", "React", "useLayoutEffect", "useMemo", "useRef", "mx", "MOSAIC_PLACEHOLDER_NAME", "MOSAIC_PLACEHOLDER_ORIENTATION_ATTR", "MOSAIC_PLACEHOLDER_STATE_ATTR", "MOSAIC_PLACEHOLDER_LOCATION_ATTR", "MosaicPlaceholder", "classNames", "children", "asChild", "orientation", "location", "rootRef", "useRef", "Comp", "Slot", "Primitive", "div", "id", "containerId", "eventHandler", "scrolling", "activeLocation", "setActiveLocation", "useMosaicContainerContext", "data", "useMemo", "type", "useLayoutEffect", "root", "current", "dropTargetForElements", "element", "getData", "canDrop", "source", "getSourceData", "getDropEffect", "onDragEnter", "onDragLeave", "undefined", "onDrop", "React", "String", "role", "className", "mx", "ref", "displayName", "DROP_INDICATOR_NAME", "MosaicDropIndicator", "props", "state", "useMosaicTileContext", "closestEdge", "NaturalDropIndicator", "edge", "React", "ResizeHandle", "MOSAIC_RESIZE_HANDLE_NAME", "MIN_WIDTH", "MIN_HEIGHT", "DEFAULT_EXTRINSIC_SIZE", "MosaicResizeHandle", "minSize", "maxSize", "fallbackSize", "orientation", "useMosaicContainerContext", "size", "setSize", "tileMinSize", "tileMaxSize", "useMosaicTileContext", "horizontal", "React", "ResizeHandle", "side", "onSizeChange", "displayName", "useComposedRefs", "useVirtualizer", "React", "Fragment", "forwardRef", "useCallback", "useEffect", "useLayoutEffect", "useMemo", "useRef", "invariant", "composable", "composableProps", "mx", "__dxlog_file", "visibleItems", "useVisibleItems", "draggable", "id", "items", "dragging", "getId", "invariant", "draggingSource", "useMemo", "useLayoutEffect", "setActiveLocation", "sourceIndex", "scrollIntoView", "useCallback", "el", "block", "behavior", "useEffect", "registerScrollTo", "composableProps", "React", "orientation", "ref", "Tile", "item", "location", "index", "current", "selected", "selectedIds", "debug", "MosaicStackInner", "useMosaicContainerContext", "MOSAIC_VIRTUAL_STACK_NAME", "count", "gap", "overscan", "onChange", "itemIndex", "virtualizer", "scrollToOffset", "offset", "Math", "style", "width", "getTotalSize", "height", "virtualItems", "div", "key", "top", "left", "start", "transform", "data", "InternalPlaceholder", "MosaicVirtualStackInner", "MosaicVirtualStack", "Symbol", "styles", "placeholder", "className", "mx", "Mosaic", "Root", "MosaicRoot", "Container", "MosaicContainer", "Tile", "MosaicTile", "DragHandle", "MosaicDragHandle", "ResizeHandle", "MosaicResizeHandle", "Placeholder", "MosaicPlaceholder", "DropIndicator", "MosaicDropIndicator", "Stack", "MosaicStack", "VirtualStack", "MosaicVirtualStack"]
7
+ }
@@ -9,7 +9,7 @@ import {
9
9
  useMosaicRootContext,
10
10
  useMosaicTileContext,
11
11
  useVisibleItems
12
- } from "./chunk-DVJLDZLE.mjs";
12
+ } from "./chunk-4IEMCMIV.mjs";
13
13
 
14
14
  // src/components/Board/Board.tsx
15
15
  import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
@@ -260,7 +260,7 @@ import { createContext } from "@radix-ui/react-context";
260
260
  import React3, { forwardRef as forwardRef3, useMemo as useMemo4, useState as useState2 } from "react";
261
261
  import { Obj as Obj2, Ref } from "@dxos/echo";
262
262
  import { useObject } from "@dxos/react-client/echo";
263
- import { IconButton, ScrollArea, Toolbar as Toolbar2, useTranslation as useTranslation2 } from "@dxos/react-ui";
263
+ import { IconButton as IconButton2, ScrollArea, Toolbar, useTranslation as useTranslation2 } from "@dxos/react-ui";
264
264
  import { composable, composableProps } from "@dxos/react-ui";
265
265
  import { Menu as Menu2, createMenuAction as createMenuAction2 } from "@dxos/react-ui-menu";
266
266
  import { mx as mx2 } from "@dxos/ui-theme";
@@ -270,7 +270,7 @@ import { translationKey as translationKey2 } from "#translations";
270
270
  import { useComposedRefs } from "@radix-ui/react-compose-refs";
271
271
  import React2, { forwardRef as forwardRef2, useMemo as useMemo3, useRef as useRef2, useState } from "react";
272
272
  import { Obj } from "@dxos/echo";
273
- import { Card, Tag, Toolbar, useTranslation } from "@dxos/react-ui";
273
+ import { Card, Icon, IconButton, Tag, useTranslation } from "@dxos/react-ui";
274
274
  import { Menu, createMenuAction } from "@dxos/react-ui-menu";
275
275
  import { getHashStyles } from "@dxos/ui-theme";
276
276
  import { translationKey } from "#translations";
@@ -319,25 +319,28 @@ var BoardItemInner = /* @__PURE__ */ forwardRef2(({ classNames, data, location,
319
319
  testId: "mosaicBoard.cardDragHandle"
320
320
  }), /* @__PURE__ */ React2.createElement(Card.Title, {
321
321
  "data-testid": "mosaicBoard.cardTitle"
322
- }, label), /* @__PURE__ */ React2.createElement(Menu.Trigger, {
322
+ }, label), /* @__PURE__ */ React2.createElement(Card.Block, {
323
+ end: true
324
+ }, /* @__PURE__ */ React2.createElement(Menu.Trigger, {
323
325
  asChild: true,
324
326
  disabled: !items?.length
325
- }, /* @__PURE__ */ React2.createElement(Toolbar.IconButton, {
327
+ }, /* @__PURE__ */ React2.createElement(IconButton, {
326
328
  iconOnly: true,
327
329
  variant: "ghost",
328
330
  icon: "ph--dots-three-vertical--regular",
329
331
  label: t("action-menu.label")
330
- })), /* @__PURE__ */ React2.createElement(Menu.Content, {
332
+ }))), /* @__PURE__ */ React2.createElement(Menu.Content, {
331
333
  items
332
334
  })), /* @__PURE__ */ React2.createElement(Card.Row, {
333
- icon: "ph--note--regular",
334
335
  classNames: "text-description"
335
- }, /* @__PURE__ */ React2.createElement(Card.Text, null, description)), /* @__PURE__ */ React2.createElement(Card.Row, {
336
+ }, /* @__PURE__ */ React2.createElement(Card.Block, null, /* @__PURE__ */ React2.createElement(Icon, {
337
+ icon: "ph--note--regular"
338
+ })), /* @__PURE__ */ React2.createElement(Card.Text, null, description)), /* @__PURE__ */ React2.createElement(Card.Row, null, /* @__PURE__ */ React2.createElement(Card.Block, null, /* @__PURE__ */ React2.createElement(Icon, {
336
339
  icon: "ph--tag--regular"
337
- }, label && /* @__PURE__ */ React2.createElement("div", {
340
+ })), label && /* @__PURE__ */ React2.createElement("div", {
338
341
  className: "shrink-0 flex gap-1 items-center text-xs"
339
342
  }, /* @__PURE__ */ React2.createElement(Tag, {
340
- palette: getHashStyles(label).hue
343
+ hue: getHashStyles(label).hue
341
344
  }, label)))))));
342
345
  });
343
346
  BoardItemInner.displayName = BOARD_ITEM_NAME;
@@ -388,19 +391,19 @@ var BoardColumnHeader = composable(({ label, dragHandleRef, ...props }, forwarde
388
391
  model.onColumnDelete,
389
392
  t
390
393
  ]);
391
- return /* @__PURE__ */ React3.createElement(Menu2.Root, null, /* @__PURE__ */ React3.createElement(Toolbar2.Root, {
394
+ return /* @__PURE__ */ React3.createElement(Menu2.Root, null, /* @__PURE__ */ React3.createElement(Toolbar.Root, {
392
395
  ...composableProps(props),
393
396
  "data-testid": "board-column-header",
394
397
  ref: forwardedRef
395
- }, /* @__PURE__ */ React3.createElement(Toolbar2.DragHandle, {
398
+ }, /* @__PURE__ */ React3.createElement(Toolbar.DragHandle, {
396
399
  ref: dragHandleRef,
397
400
  testId: "mosaicBoard.columnDragHandle"
398
- }), /* @__PURE__ */ React3.createElement(Toolbar2.Text, {
401
+ }), /* @__PURE__ */ React3.createElement(Toolbar.Text, {
399
402
  "data-testid": "mosaicBoard.columnTitle"
400
403
  }, label), /* @__PURE__ */ React3.createElement(Menu2.Trigger, {
401
404
  asChild: true,
402
405
  disabled: !columnMenuItems?.length
403
- }, /* @__PURE__ */ React3.createElement(Toolbar2.IconButton, {
406
+ }, /* @__PURE__ */ React3.createElement(Toolbar.IconButton, {
404
407
  iconOnly: true,
405
408
  variant: "ghost",
406
409
  icon: "ph--dots-three-vertical--regular",
@@ -444,10 +447,10 @@ var BoardColumnFooter = /* @__PURE__ */ forwardRef3(({ classNames, data, onAdd }
444
447
  const { t } = useTranslation2(translationKey2);
445
448
  const { model } = useBoard(BOARD_COLUMN_FOOTER_NAME);
446
449
  const handleAdd = onAdd ?? (model.onItemCreate && data ? () => void model.onItemCreate?.(data) : void 0);
447
- return /* @__PURE__ */ React3.createElement(Toolbar2.Root, {
450
+ return /* @__PURE__ */ React3.createElement(Toolbar.Root, {
448
451
  classNames: mx2("rounded-b-sm border-t border-separator", classNames),
449
452
  ref: forwardedRef
450
- }, handleAdd && /* @__PURE__ */ React3.createElement(IconButton, {
453
+ }, handleAdd && /* @__PURE__ */ React3.createElement(IconButton2, {
451
454
  "data-testid": "board-column-add-item",
452
455
  classNames: "group-hover/column:opacity-100 md:opacity-0 transition transition-opacity duration-500",
453
456
  variant: "ghost",
@@ -671,7 +674,7 @@ var SearchTile = /* @__PURE__ */ forwardRef5(({ data, location, current }, forwa
671
674
  }, /* @__PURE__ */ React5.createElement(Card2.Root, {
672
675
  fullWidth: true,
673
676
  ref: forwardedRef
674
- }, /* @__PURE__ */ React5.createElement(Card2.Header, null, /* @__PURE__ */ React5.createElement(Card2.IconBlock, null), /* @__PURE__ */ React5.createElement(Card2.Title, null, result.label)), result.snippet && /* @__PURE__ */ React5.createElement(Card2.Body, null, /* @__PURE__ */ React5.createElement(Card2.Row, null, /* @__PURE__ */ React5.createElement(Card2.Text, {
677
+ }, /* @__PURE__ */ React5.createElement(Card2.Header, null, /* @__PURE__ */ React5.createElement(Card2.Block, null), /* @__PURE__ */ React5.createElement(Card2.Title, null, result.label)), result.snippet && /* @__PURE__ */ React5.createElement(Card2.Body, null, /* @__PURE__ */ React5.createElement(Card2.Row, null, /* @__PURE__ */ React5.createElement(Card2.Text, {
675
678
  variant: "description"
676
679
  }, result.snippet))))));
677
680
  });