{"version":3,"file":"chunk-Splitter.mjs","names":["createContext","SplitterPrimitive"],"sources":["../../src/components/Splitter/Splitter.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\n// Two panes and the seam between them on Ark's splitter machine, which owns the drag, the keyboard resize, the\n// `separator` role and its `aria-value*`, and the panes' lower bound. DXOS owns the vocabulary the app speaks: sizes in\n// rem rather than percent, an `anchor` naming the pane the size measures, a `mode` that collapses to one pane, and a\n// `collapseBelow` width under which the root shows one pane at a time (master-detail on a narrow host).\n\nimport { Splitter as SplitterPrimitive } from '@ark-ui/react/splitter';\nimport React, {\n  type ComponentProps,\n  type Dispatch,\n  type RefObject,\n  type SetStateAction,\n  useCallback,\n  useEffect,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport { createContext, useControllableState } from '@dxos/react-hooks';\nimport { mx } from '@dxos/ui-theme';\nimport { type SlottableProps } from '@dxos/ui-types';\n\nimport { recipes } from '../../recipes.ts';\nimport { composableProps, slottable } from '../../util/slots.ts';\n\ntype SplitterOrientation = 'horizontal' | 'vertical';\n\n// Animated panel visibility: collapse to the start panel, the end panel, or show both split at `size`.\ntype SplitterMode = 'start' | 'end' | 'split';\n\ntype Position = 'start' | 'end';\n\n/** A pane extent as the machine takes it: a bare number is a percentage, a string carries its unit. */\ntype PanelSize = NonNullable<ComponentProps<typeof SplitterPrimitive.Root>['size']>[number];\n\n/** The seam sits between the two panes, which is the only pair there is. */\nconst RESIZE_TRIGGER_ID = 'start:end';\n\n//\n// Context\n//\n\nconst SPLITTER_NAME = 'Splitter';\n\ntype SplitterContextValue = {\n  orientation: SplitterOrientation;\n  transition: number;\n  resizable: boolean;\n  /** True only briefly after a `mode` change, so the collapse animates but layout reflows (resize) do not. */\n  animating: boolean;\n  /** The pane `anchoredSize` measures. */\n  anchor: Position;\n  /** The anchored pane's extent in rem while split, if known; the panes then size themselves without the machine. */\n  anchoredSize?: number;\n  /** The requested mode (`mode`/`defaultMode`), which `collapseBelow` may override. */\n  mode: SplitterMode;\n  /** The mode the panes actually show: `split` above `collapseBelow`, one pane below it. */\n  visibleMode: SplitterMode;\n  /** True while the root is narrower than `collapseBelow`, so one pane shows at a time. */\n  collapsed: boolean;\n  /** Requests a mode; reported through `onModeChange`, and stored unless `mode` is controlled. */\n  setMode: Dispatch<SetStateAction<SplitterMode>>;\n};\n\nconst [SplitterProvider, useSplitterContext] = createContext<SplitterContextValue>(SPLITTER_NAME);\n\nconst getRem = (): number => parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n\n/** A `collapseBelow` length in px; rem (and em, read as rem) or px, since the root measures itself in px. */\nconst toPx = (length: string): number => {\n  const match = /^\\s*(\\d*\\.?\\d+)\\s*(rem|em|px)?\\s*$/.exec(length);\n  if (!match) {\n    throw new Error(`Splitter.Root: unsupported collapseBelow length '${length}' (use rem or px).`);\n  }\n  const value = parseFloat(match[1]);\n  return match[2] === 'px' ? value : value * getRem();\n};\n\n/**\n * Whether the element is narrower than `collapseBelow`, measured before paint and on every resize. A container query\n * cannot drive this, because the panes' sizes and the context's `collapsed` are React state the machine consumes.\n */\nconst useNarrow = (root: RefObject<HTMLDivElement | null>, collapseBelow?: string): boolean => {\n  const [narrow, setNarrow] = useState(false);\n  useLayoutEffect(() => {\n    const element = root.current;\n    if (!element || collapseBelow === undefined) {\n      setNarrow(false);\n      return;\n    }\n    const threshold = toPx(collapseBelow);\n    const update = (width: number) => setNarrow(width < threshold);\n    update(element.getBoundingClientRect().width);\n    const observer = new ResizeObserver(([entry]) => update(entry.contentRect.width));\n    observer.observe(element);\n    return () => observer.disconnect();\n  }, [root, collapseBelow]);\n  return narrow;\n};\n\n/**\n * The size array the machine takes, with the pane that is not anchored left as a hole for it to\n * fill from the remainder — the machine reads each index independently, so the pane it finds nothing\n * for is the one that flexes.\n */\nconst anchoredSizes = (size: number, anchor: Position): PanelSize[] => {\n  const sizes: PanelSize[] = [];\n  sizes[anchor === 'start' ? 0 : 1] = `${size}rem`;\n  return sizes;\n};\n\n/** The machine reports percentages; the app speaks rem, measured along the split axis. */\nconst toRem = (percent: number, root: RefObject<HTMLDivElement | null>, orientation: SplitterOrientation): number => {\n  const rect = root.current?.getBoundingClientRect();\n  if (!rect) {\n    return 0;\n  }\n  const extent = orientation === 'horizontal' ? rect.width : rect.height;\n  return ((percent / 100) * extent) / getRem();\n};\n\n//\n// Root\n//\n\nconst ROOT_NAME = 'Splitter.Root';\n\ntype SplitterRootElementProps = {\n  orientation?: SplitterOrientation;\n  /** The pane(s) to show (controlled); `split` by default. Under `collapseBelow` it picks the one pane shown. */\n  mode?: SplitterMode;\n  defaultMode?: SplitterMode;\n  onModeChange?: (mode: SplitterMode) => void;\n  /**\n   * A container width (CSS length in rem or px, e.g. `32rem`): narrower, the root shows only the `mode` pane (`split`\n   * reads as `start`); wider, it shows both whatever the mode, so a selection that asked for the detail shows it beside\n   * the list.\n   */\n  collapseBelow?: string;\n  /** Which panel `size` measures (defaults to `start`); the other panel fills the remainder. */\n  anchor?: Position;\n  /** The anchored panel's extent in rem (controlled). */\n  size?: number;\n  defaultSize?: number;\n  onSizeChange?: (size: number) => void;\n  /** Collapse animation in ms; defaults to the theme's `--dx-disclosure-duration` (0 under reduced motion). */\n  transition?: number;\n  /** A draggable seam; when false (the default) the ResizeTrigger renders nothing and the sizes are fixed. */\n  resizable?: boolean;\n  /** Lower bound (rem) applied to both panels. */\n  minSize?: number;\n};\n\ntype SplitterRootProps = SlottableProps<SplitterRootElementProps>;\n\n/** A duration custom property as the element resolves it, in milliseconds. */\nconst cssDuration = (element: HTMLElement, property: string): number => {\n  const value = getComputedStyle(element).getPropertyValue(property).trim();\n  const duration = Number.parseFloat(value);\n  return Number.isNaN(duration) ? 0 : value.endsWith('ms') ? duration : duration * 1000;\n};\n\nconst SplitterRoot = slottable<HTMLDivElement, SplitterRootElementProps>(\n  (\n    {\n      asChild,\n      children,\n      orientation = 'vertical',\n      mode: modeProp,\n      defaultMode = 'split',\n      onModeChange,\n      collapseBelow,\n      anchor = 'start',\n      size: sizeProp,\n      defaultSize,\n      onSizeChange,\n      transition: transitionProp,\n      resizable = false,\n      minSize = 0,\n      ...props\n    },\n    forwardedRef,\n  ) => {\n    const rootRef = useRef<HTMLDivElement>(null);\n    const [themeTransition, setThemeTransition] = useState(0);\n    useLayoutEffect(() => {\n      if (rootRef.current) {\n        setThemeTransition(cssDuration(rootRef.current, '--dx-disclosure-duration'));\n      }\n    }, []);\n    const transition = transitionProp ?? themeTransition;\n    const [requestedMode = 'split', setRequestedMode] = useControllableState<SplitterMode>({\n      prop: modeProp,\n      defaultProp: defaultMode,\n      onChange: onModeChange,\n    });\n    const setMode = useCallback<Dispatch<SetStateAction<SplitterMode>>>(\n      (next) => setRequestedMode((previous) => (typeof next === 'function' ? next(previous ?? 'split') : next)),\n      [setRequestedMode],\n    );\n    const narrow = useNarrow(rootRef, collapseBelow);\n    // `useNarrow` is false without `collapseBelow`, so only a root that opted in overrides the requested mode.\n    const mode: SplitterMode =\n      collapseBelow === undefined\n        ? requestedMode\n        : narrow\n          ? requestedMode === 'split'\n            ? 'start'\n            : requestedMode\n          : 'split';\n\n    // Animate ONLY for a brief window right after a `mode` change (the collapse). The rest of the time the\n    // transition is off, so layout reflows from a container/window resize never animate (no jitter) — this\n    // avoids relying on observing/throttling resize events at all.\n    const [animating, setAnimating] = useState(false);\n    const previousMode = useRef(mode);\n    // Flipped during render, not in an effect: the panes' new sizes commit in this very pass, and a\n    // `transition` that arrives a render later finds nothing left to animate.\n    if (previousMode.current !== mode) {\n      previousMode.current = mode;\n      if (transition > 0 && !animating) {\n        setAnimating(true);\n      }\n    }\n    // Keyed on the mode as well, so a change inside the window re-arms the timer rather than letting\n    // the previous one expire mid-motion.\n    useEffect(() => {\n      if (!animating) {\n        return;\n      }\n      const timer = setTimeout(() => setAnimating(false), transition);\n      return () => clearTimeout(timer);\n    }, [animating, transition, mode]);\n\n    const collapsed = mode !== 'split';\n    // The machine sizes panes in percent of the container and re-derives the anchored pane's share\n    // a frame after the container resizes, so a neighbour animating its width made the seam lag and\n    // snap. Tracked in rem here — the controlled prop, else the last drag — so the panes can carry\n    // a fixed basis and let the flex layout absorb a container resize on the same frame.\n    const [draggedSize, setDraggedSize] = useState(defaultSize);\n    const anchoredSize = collapsed ? undefined : (sizeProp ?? draggedSize);\n    const panels = useMemo(\n      () => [\n        {\n          id: 'start' as const,\n          // A collapsed pane has to be allowed to reach zero, which its own lower bound would\n          // otherwise hold it above.\n          minSize: mode === 'end' ? '0%' : `${minSize}rem`,\n          // The anchored pane keeps its width when the container changes size; the other absorbs it.\n          resizeBehavior: anchor === 'start' ? ('preserve-pixel-size' as const) : undefined,\n        },\n        {\n          id: 'end' as const,\n          minSize: mode === 'start' ? '0%' : `${minSize}rem`,\n          resizeBehavior: anchor === 'end' ? ('preserve-pixel-size' as const) : undefined,\n        },\n      ],\n      [mode, anchor, minSize],\n    );\n\n    const size = useMemo<PanelSize[] | undefined>(() => {\n      if (mode === 'start') {\n        return ['100%', '0%'];\n      }\n      if (mode === 'end') {\n        return ['0%', '100%'];\n      }\n      return sizeProp === undefined ? undefined : anchoredSizes(sizeProp, anchor);\n    }, [mode, sizeProp, anchor]);\n\n    const handleResize = useCallback(\n      ({ size }: { size: number[] }) => {\n        // A collapse is the caller's own instruction coming back; reporting it would overwrite the\n        // size the panes return to.\n        if (collapsed) {\n          return;\n        }\n        const percent = size[anchor === 'start' ? 0 : 1];\n        if (percent !== undefined) {\n          const rem = toRem(percent, rootRef, orientation);\n          setDraggedSize(rem);\n          onSizeChange?.(rem);\n        }\n      },\n      [onSizeChange, collapsed, anchor, orientation],\n    );\n\n    const { className, ...rest } = composableProps(props);\n\n    return (\n      <SplitterProvider\n        orientation={orientation}\n        transition={transition}\n        resizable={resizable}\n        animating={animating}\n        anchor={anchor}\n        anchoredSize={anchoredSize}\n        mode={requestedMode}\n        visibleMode={mode}\n        collapsed={narrow}\n        setMode={setMode}\n      >\n        <SplitterPrimitive.Root\n          {...rest}\n          asChild={asChild}\n          orientation={orientation}\n          panels={panels}\n          size={size}\n          defaultSize={defaultSize === undefined ? undefined : anchoredSizes(defaultSize, anchor)}\n          onResize={handleResize}\n          data-collapsed={narrow ? '' : undefined}\n          className={mx(recipes.splitter(), className)}\n          ref={(element) => {\n            rootRef.current = element;\n            if (typeof forwardedRef === 'function') {\n              forwardedRef(element);\n            } else if (forwardedRef) {\n              forwardedRef.current = element;\n            }\n          }}\n        >\n          {children}\n        </SplitterPrimitive.Root>\n      </SplitterProvider>\n    );\n  },\n);\n\nSplitterRoot.displayName = ROOT_NAME;\n\n//\n// Panel\n//\n\nconst PANEL_NAME = 'Splitter.Panel';\n\ntype SplitterPanelProps = SlottableProps<{ position: Position }>;\n\nconst SplitterPanel = slottable<HTMLDivElement, { position: Position }>(\n  ({ asChild, children, position, ...props }, forwardedRef) => {\n    const { transition, animating, anchor, anchoredSize } = useSplitterContext(PANEL_NAME);\n    const { className, style, ...rest } = composableProps(props);\n\n    // Only animate during the brief post-mode-change window (collapse), never while dragging or on a plain\n    // container/window resize — so the panels track layout reflows instantly without jitter.\n    const animate = transition > 0 && animating;\n    // While split with a known size, the anchored pane holds its rem and the other flexes, over the\n    // machine's percent shares (see `anchoredSize` in the root). Longhands, because Ark merges style\n    // objects key by key and the machine writes these three; a shorthand would sit beside them.\n    const flex =\n      anchoredSize === undefined\n        ? undefined\n        : position === anchor\n          ? { flexGrow: 0, flexShrink: 0, flexBasis: `${anchoredSize}rem` }\n          : { flexGrow: 1, flexShrink: 1, flexBasis: '0%' };\n\n    return (\n      <SplitterPrimitive.Panel\n        {...rest}\n        asChild={asChild}\n        id={position}\n        ref={forwardedRef}\n        className={mx(recipes.splitterPanel(), className)}\n        style={{\n          transition: animate\n            ? `flex-grow ${transition}ms var(--dx-disclosure-ease-open), flex-basis ${transition}ms var(--dx-disclosure-ease-open)`\n            : undefined,\n          // A pane growing from nothing must be allowed to be small on the way: its lower bound\n          // returns at once with the mode, and would hold it at `minSize` until the basis caught up.\n          ...(animate && { minWidth: 0, minHeight: 0 }),\n          ...flex,\n          ...style,\n        }}\n      >\n        {children}\n      </SplitterPrimitive.Panel>\n    );\n  },\n);\n\nSplitterPanel.displayName = PANEL_NAME;\n\n//\n// ResizeTrigger\n//\n\nconst RESIZE_TRIGGER_NAME = 'Splitter.ResizeTrigger';\n\ntype SplitterResizeTriggerProps = SlottableProps;\n\n/**\n * The seam: a 7px grab area straddling the panes around a 1px divider. Without `resizable` it is only the divider (a\n * static `separator`, not focusable), and while one pane shows it renders nothing.\n */\nconst SplitterResizeTrigger = slottable<HTMLButtonElement>(({ asChild, children, ...props }, forwardedRef) => {\n  const { orientation, resizable, visibleMode } = useSplitterContext(RESIZE_TRIGGER_NAME);\n  const { className, ...rest } = composableProps(props);\n\n  if (!resizable) {\n    return visibleMode === 'split' ? (\n      <div\n        role='separator'\n        aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n        data-scope='splitter'\n        data-part='divider'\n        data-orientation={orientation}\n        className={mx(recipes.splitterDivider(), className)}\n      />\n    ) : null;\n  }\n\n  return (\n    <SplitterPrimitive.ResizeTrigger\n      {...rest}\n      asChild={asChild}\n      id={RESIZE_TRIGGER_ID}\n      // The machine renders a button, which submits the form around it unless told otherwise.\n      type='button'\n      ref={forwardedRef}\n      // A separator's orientation is its own, not the group's: panes side by side are parted by a\n      // vertical line. The machine reports the group's.\n      aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n      className={mx(recipes.splitterResizeTrigger(), className)}\n    >\n      {children}\n    </SplitterPrimitive.ResizeTrigger>\n  );\n});\n\nSplitterResizeTrigger.displayName = RESIZE_TRIGGER_NAME;\n\n//\n// useContext\n//\n\ntype SplitterContext = Pick<SplitterContextValue, 'mode' | 'visibleMode' | 'collapsed' | 'setMode' | 'orientation'>;\n\n/** The nearest Splitter's mode state, for parts inside it: a master that opens its detail, a Back button when collapsed. */\nconst useSplitterPublicContext = (): SplitterContext => {\n  const { mode, visibleMode, collapsed, setMode, orientation } = useSplitterContext('Splitter.useContext');\n  return { mode, visibleMode, collapsed, setMode, orientation };\n};\n\n//\n// Splitter\n//\nexport type {\n  SplitterContext as Context,\n  SplitterMode as Mode,\n  SplitterOrientation as Orientation,\n  SplitterPanelProps as PanelProps,\n  SplitterResizeTriggerProps as ResizeTriggerProps,\n  SplitterRootProps as RootProps,\n};\n\nexport {\n  SplitterPanel as Panel,\n  SplitterResizeTrigger as ResizeTrigger,\n  SplitterRoot as Root,\n  useSplitterPublicContext as useContext,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,IAAM,oBAAoB;AA4B1B,IAAM,CAAC,kBAAkB,sBAAsBA,gBAAoC,UAAa;AAEhG,IAAM,eAAuB,WAAW,iBAAiB,SAAS,eAAe,CAAC,CAAC,QAAQ,KAAK;;AAGhG,IAAM,QAAQ,WAA2B;CACvC,MAAM,QAAQ,qCAAqC,KAAK,MAAM;CAC9D,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,oDAAoD,OAAO,mBAAmB;CAEhG,MAAM,QAAQ,WAAW,MAAM,EAAE;CACjC,OAAO,MAAM,OAAO,OAAO,QAAQ,QAAQ,OAAO;AACpD;;;;;AAMA,IAAM,aAAa,MAAwC,kBAAoC;CAC7F,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,sBAAsB;EACpB,MAAM,UAAU,KAAK;EACrB,IAAI,CAAC,WAAW,kBAAkB,KAAA,GAAW;GAC3C,UAAU,KAAK;GACf;EACF;EACA,MAAM,YAAY,KAAK,aAAa;EACpC,MAAM,UAAU,UAAkB,UAAU,QAAQ,SAAS;EAC7D,OAAO,QAAQ,sBAAsB,CAAC,CAAC,KAAK;EAC5C,MAAM,WAAW,IAAI,gBAAgB,CAAC,WAAW,OAAO,MAAM,YAAY,KAAK,CAAC;EAChF,SAAS,QAAQ,OAAO;EACxB,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,MAAM,aAAa,CAAC;CACxB,OAAO;A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