@adea-ai/ui 0.103.1 → 0.104.1

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 (25) hide show
  1. package/README.md +10 -0
  2. package/dist/components/composites/about-dialog/about-dialog.js +1 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  4. package/dist/components/composites/catalog-browser/catalog-detail.d.ts +4 -0
  5. package/dist/components/composites/catalog-browser/catalog-detail.d.ts.map +1 -1
  6. package/dist/components/composites/catalog-browser/catalog-detail.js +36 -7
  7. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  8. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  9. package/dist/components/composites/update-dialog/update-dialog.js +34 -30
  10. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  11. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  12. package/dist/components/layout/split-layout/split-layout.js +131 -3
  13. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  14. package/dist/r/catalog-browser.json +1 -0
  15. package/dist/r/registry.json +1 -0
  16. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +1 -1
  17. package/dist/r/src/components/composites/catalog-browser/catalog-detail.tsx +36 -6
  18. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +7 -3
  19. package/dist/r/src/components/layout/split-layout/split-layout.tsx +149 -9
  20. package/package.json +1 -1
  21. package/registry.json +1 -0
  22. package/src/components/composites/about-dialog/about-dialog.tsx +1 -1
  23. package/src/components/composites/catalog-browser/catalog-detail.tsx +36 -6
  24. package/src/components/composites/update-dialog/update-dialog.tsx +7 -3
  25. package/src/components/layout/split-layout/split-layout.tsx +149 -9
@@ -1 +1 @@
1
- {"version":3,"file":"split-layout.js","names":["Resizable","For","createMemo","createComputed","createUniqueId","createSignal","onCleanup","on","Accessor","JSX","X","GripVertical","Button","cn","computeLayoutFrames","LayoutRect","paneDropIntent","PaneDropIntent","PANE_DRAG_TYPE","listLeaves","MIN_SPLIT_RATIO","MAX_SPLIT_RATIO","SplitLayoutBranch","SplitLayoutLeaf","SplitLayoutState","SplitLayoutProps","state","L","label","labelForLeaf","leaf","renderLeaf","Element","renderPaneLabel","paneTabIndex","labelForSeparator","branch","onResize","splitId","ratio","onFocus","leafId","onClose","onMove","targetId","intent","renderPaneActions","class","rectStyle","rect","CSSProperties","left","x","top","y","width","height","SplitLayout","props","root","HTMLDivElement","pendingFrame","refs","Map","HTMLElement","domIds","prefix","nextDomId","nextDragId","drag","setDrag","id","token","drop","setDrop","clearDrag","undefined","domId","existing","get","created","set","leaves","center","leafMap","map","frames","branches","Array","from","values","flatMap","frame","node","kind","current","has","target","allowedTarget","transfer","DataTransfer","types","includes","dropLabel","placement","branchMap","schedule","action","cancelAnimationFrame","requestAnimationFrame","active","ownerDocument","activeElement","contains","field","HTMLTextAreaElement","HTMLInputElement","selection","start","selectionStart","end","selectionEnd","direction","selectionDirection","isConnected","body","focus","preventScroll","setSelectionRange","clear","close","next","_el$","_tmpl$","_el$2","firstChild","_$use","el","_$insert","_$createComponent","each","children","initial","content","paneLabel","actions","delete","_el$3","_tmpl$2","_el$4","_el$5","_el$6","_el$7","nextSibling","$$focusin","addEventListener","event","dataTransfer","clientX","clientY","currentTarget","getBoundingClientRect","accepted","getData","preventDefault","relatedTarget","Node","dropEffect","_$setAttribute","setData","effectAllowed","source","setDragImage","Math","max","round","_c$","_$memo","_c$2","variant","size","aria-label","onClick","_c$3","_el$8","_tmpl$3","_$effect","_$className","_p$","_v$4","_v$5","_v$6","_v$7","focusedLeafId","_v$8","_v$9","_v$0","_v$1","_v$10","Boolean","_v$11","_v$12","e","t","a","o","i","n","s","h","_$style","r","d","l","orientation","sizes","keyboardDelta","onSizesChange","getClientRects","length","some","Number","isFinite","abs","style","Panel","minSize","maxSize","Handle","aria-orientation","aria-controls","join","aria-valuenow","_v$","_v$2","_v$3","_$delegateEvents","_$createComponent","_$memo","_$className","_$setAttribute","_$style","_$delegateEvents"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport {\n For,\n createMemo,\n createComputed,\n createUniqueId,\n createSignal,\n onCleanup,\n on,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport { X, GripVertical } from 'lucide-solid'\nimport { Button } from '../../ui/button'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\nexport type { PaneDropIntent } from './drop'\nconst PANE_DRAG_TYPE = 'application/x-adea-pane-move'\nimport {\n listLeaves,\n MIN_SPLIT_RATIO,\n MAX_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\n\nexport type SplitLayoutProps<L extends SplitLayoutLeaf> = {\n state: SplitLayoutState<L>\n label: string\n /** Accessible name for a pane region and its close button. */\n labelForLeaf: (leaf: L) => string\n /** Called once per stable leaf owner; the accessor tracks opaque payload replacement. */\n renderLeaf: (leaf: Accessor<L>) => JSX.Element\n /** Inline visible header composition, separate from the region and close-button name. */\n renderPaneLabel?: (leaf: Accessor<L>) => JSX.Element\n /** Whether pane regions participate in sequential keyboard navigation; defaults to programmatic focus only. */\n paneTabIndex?: 0 | -1\n /** Accessible splitter name; defaults to the current orientation-specific label. */\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n onFocus?: (leafId: string) => void\n /** Host performs the model transition and returns the surviving focus destination. */\n onClose?: (leafId: string) => string | undefined\n /** Pointer placement only; the host supplies keyboard commands and performs the model transition. */\n onMove?: (leafId: string, targetId: string, intent: PaneDropIntent) => void\n /** Stable header composition for host-owned keyboard actions/capability feedback. */\n renderPaneActions?: (leaf: Accessor<L>) => JSX.Element\n class?: string\n}\nfunction rectStyle(rect: LayoutRect): JSX.CSSProperties {\n return {\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n }\n}\n/** Muxy frame geometry keeps leaf owners stable; Corvu owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\n let nextDomId = 0\n let nextDragId = 0\n const [drag, setDrag] = createSignal<{ id: string; token: string }>()\n const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()\n const clearDrag = () => {\n setDrag(undefined)\n setDrop(undefined)\n }\n const domId = (id: string) => {\n const existing = domIds.get(id)\n if (existing) return existing\n const created = `${prefix}-pane-${nextDomId++}`\n domIds.set(id, created)\n return created\n }\n const leaves = createMemo(() => listLeaves(props.state.center))\n const leafMap = createMemo(() => new Map(leaves().map((leaf) => [leaf.id, leaf])))\n const frames = createMemo(() => computeLayoutFrames(props.state.center))\n const branches = createMemo(() =>\n Array.from(frames().values()).flatMap((frame) =>\n frame.node.kind === 'split' ? [frame.node] : []\n )\n )\n createComputed(() => {\n const current = drag()\n if (current && (!props.onMove || !leafMap().has(current.id))) clearDrag()\n const target = drop()\n if (target && !leafMap().has(target.id)) setDrop(undefined)\n })\n const allowedTarget = (id: string, transfer: DataTransfer | null) => {\n const current = drag()\n return props.onMove &&\n current &&\n current.id !== id &&\n leafMap().has(current.id) &&\n leafMap().has(id) &&\n transfer?.types.includes(PANE_DRAG_TYPE)\n ? current\n : undefined\n }\n const dropLabel = createMemo(() => {\n const target = drop()\n const leaf = target ? leafMap().get(target.id) : undefined\n return target && leaf\n ? `Drop to place pane ${target.intent.placement} ${props.labelForLeaf(leaf)}`\n : ''\n })\n const branchMap = createMemo(() => new Map(branches().map((branch) => [branch.id, branch])))\n const schedule = (action: () => void) => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n pendingFrame = requestAnimationFrame(() => {\n pendingFrame = undefined\n action()\n })\n }\n // Register before keyed children update: capture a focused editor before an\n // ordered DOM move can blur it. Never override a newer focus outside this root.\n createComputed(\n on(\n () => props.state.center,\n () => {\n const active = root?.ownerDocument.activeElement\n if (!root || !(active instanceof HTMLElement) || !root.contains(active)) return\n const field =\n active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement\n ? active\n : undefined\n const selection = field\n ? {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n : undefined\n schedule(() => {\n if (!active.isConnected || !root?.contains(active)) return\n const current = active.ownerDocument.activeElement\n if (current !== active && current !== active.ownerDocument.body) return\n active.focus({ preventScroll: true })\n if (field && selection?.start !== null && selection?.end !== null && selection)\n field.setSelectionRange(\n selection.start,\n selection.end,\n selection.direction ?? undefined\n )\n })\n }\n )\n )\n onCleanup(() => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n clearDrag()\n refs.clear()\n domIds.clear()\n })\n const close = (id: string) => {\n const next = props.onClose?.(id)\n if (next) schedule(() => refs.get(next)?.focus({ preventScroll: true }))\n }\n return (\n <div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n const initial = leafMap().get(id)!\n const leaf = () => leafMap().get(id) ?? initial\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabIndex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) setDrop(undefined)\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={Boolean(props.onMove)}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The ghost is the pane itself, not the handle strip: the\n // browser snapshots the region before the drag state dims\n // this section, so the dragged pane stays readable while\n // its source visibly recedes.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function')\n event.dataTransfer.setDragImage(\n source,\n Math.max(0, Math.round(event.clientX - frame.left)),\n Math.max(0, Math.round(event.clientY - frame.top))\n )\n }}\n onDragEnd={clearDrag}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <Button\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n onClick={() => close(id)}\n >\n <X />\n </Button>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel()}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const initial = branchMap().get(id)!\n const branch: Accessor<SplitLayoutBranch<L>> = () => branchMap().get(id) ?? initial\n return (\n <Resizable\n orientation={branch().direction === 'row' ? 'horizontal' : 'vertical'}\n sizes={[branch().ratio, 1 - branch().ratio]}\n keyboardDelta={0.05}\n onSizesChange={(sizes) => {\n // Corvu also reports panel registration/unregistration while\n // mounting or disposing a controller. Those incomplete or\n // hidden-host sizes are not user resize intent.\n if (!root?.isConnected || root.getClientRects().length === 0) return\n if (\n sizes.length !== 2 ||\n sizes.some((size) => !Number.isFinite(size)) ||\n Math.abs(sizes[0]! + sizes[1]! - 1) > 0.000001\n )\n return\n if (sizes[0] !== undefined && Math.abs(sizes[0] - branch().ratio) > 0.000001)\n props.onResize(id, sizes[0])\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"pointer-events-none absolute flex min-h-0 min-w-0 data-[orientation=vertical]:flex-col\"\n >\n <Resizable.Panel\n minSize={MIN_SPLIT_RATIO}\n maxSize={MAX_SPLIT_RATIO}\n aria-hidden=\"true\"\n />\n <Resizable.Handle\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={10}\n aria-valuemax={90}\n aria-valuenow={Math.round(branch().ratio * 100)}\n class=\"pointer-events-auto relative w-px shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full\"\n />\n <Resizable.Panel\n minSize={MIN_SPLIT_RATIO}\n maxSize={MAX_SPLIT_RATIO}\n aria-hidden=\"true\"\n />\n </Resizable>\n )\n }}\n </For>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMkB,iBAAiB;AAiCvB,SAAS8B,UAAUC,MAAqC;CACtD,OAAO;EACLE,MAAM,GAAGF,KAAKG,IAAI,IAAG;EACrBC,KAAK,GAAGJ,KAAKK,IAAI,IAAG;EACpBC,OAAO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,KAAAnC,aAAApC,MAAA,iBAAAwD,IAAAe,IAAA+B,IAAA;GAAAC,SAAA/C,IAAAgB,KAAAjB,UAAAvD,MAAAwD,IAAAgB,IAAA+B,IAAA;GAAA,OAAA/C;EAAA,GAAA;GAAAc,GAAA9H,KAAAA;GAAA+H,GAAA/H,KAAAA;GAAAgI,GAAAhI,KAAAA;EAAA,CAAA;EAAA,OAAAwD;CAAA,EAAA,CAAA;AAqMlG;AAACwG,eAAA,CAAA,SAAA,CAAA"}
1
+ {"version":3,"file":"split-layout.js","names":["Resizable","For","createMemo","createComputed","createUniqueId","createSignal","onCleanup","on","Accessor","JSX","X","GripVertical","Button","cn","computeLayoutFrames","LayoutRect","paneDropIntent","PaneDropIntent","PANE_DRAG_TYPE","DRAG_PREVIEW_MAX_WIDTH","DRAG_PREVIEW_MAX_HEIGHT","listLeaves","MIN_SPLIT_RATIO","MAX_SPLIT_RATIO","SplitLayoutBranch","SplitLayoutLeaf","SplitLayoutState","SplitLayoutProps","state","L","label","labelForLeaf","leaf","renderLeaf","Element","renderPaneLabel","paneTabIndex","labelForSeparator","branch","onResize","splitId","ratio","onFocus","leafId","onClose","onMove","targetId","intent","renderPaneActions","class","rectStyle","rect","CSSProperties","left","x","top","y","width","height","dragPreviewPlaceholder","source","HTMLElement","message","placeholder","document","createElement","className","getAttribute","setAttribute","localName","textContent","boundedSnapshotSize","sourceWidth","Math","max","sourceHeight","scale","min","round","cloneDragPreviewNode","Node","nodeType","TEXT_NODE","cloneNode","SVGElement","includes","undefined","HTMLImageElement","snapshot","size","naturalWidth","naturalHeight","complete","Error","context","getContext","drawImage","children","createDocumentFragment","child","childNodes","clone","append","length","attribute","removeAttribute","Array","from","attributes","test","name","HTMLCanvasElement","childClone","SplitLayout","props","root","HTMLDivElement","pendingFrame","refs","Map","domIds","prefix","nextDomId","nextDragId","dragPreview","drag","setDrag","id","token","drop","setDrop","clearDrag","remove","createDragPreview","preview","inert","body","domId","existing","get","created","set","leaves","center","leafMap","map","frames","branches","values","flatMap","frame","node","kind","current","has","target","allowedTarget","transfer","DataTransfer","types","dropLabel","placement","branchMap","schedule","action","cancelAnimationFrame","requestAnimationFrame","active","ownerDocument","activeElement","contains","field","HTMLTextAreaElement","HTMLInputElement","selection","start","selectionStart","end","selectionEnd","direction","selectionDirection","isConnected","focus","preventScroll","setSelectionRange","clear","close","next","_el$","_tmpl$","_el$2","firstChild","_$use","el","_$insert","_$createComponent","each","initial","content","paneLabel","actions","delete","_el$3","_tmpl$2","_el$4","_el$5","_el$6","_el$7","nextSibling","$$focusin","addEventListener","event","dataTransfer","clientX","clientY","currentTarget","getBoundingClientRect","accepted","getData","preventDefault","relatedTarget","dropEffect","_$setAttribute","setData","effectAllowed","setDragImage","previewFrame","scaleX","scaleY","_c$","_$memo","_c$2","variant","aria-label","onClick","_c$3","_el$8","_tmpl$3","_$effect","_$className","_p$","_v$4","_v$5","_v$6","_v$7","focusedLeafId","_v$8","_v$9","_v$0","_v$1","_v$10","Boolean","_v$11","_v$12","e","t","a","o","i","n","s","h","_$style","r","d","l","orientation","sizes","keyboardDelta","onSizesChange","getClientRects","some","Number","isFinite","abs","style","Panel","minSize","maxSize","Handle","aria-orientation","aria-controls","join","aria-valuenow","_v$","_v$2","_v$3","_$delegateEvents","_$createComponent","_$memo","_$className","_$setAttribute","_$style","_$delegateEvents"],"sources":["../../../../src/components/layout/split-layout/split-layout.tsx"],"sourcesContent":["import Resizable from '@corvu/resizable'\nimport {\n For,\n createMemo,\n createComputed,\n createUniqueId,\n createSignal,\n onCleanup,\n on,\n type Accessor,\n type JSX,\n} from 'solid-js'\nimport { X, GripVertical } from 'lucide-solid'\nimport { Button } from '../../ui/button'\nimport { cn } from '#lib/utils'\nimport { computeLayoutFrames, type LayoutRect } from './geometry'\nimport { paneDropIntent, type PaneDropIntent } from './drop'\nexport type { PaneDropIntent } from './drop'\nconst PANE_DRAG_TYPE = 'application/x-adea-pane-move'\nconst DRAG_PREVIEW_MAX_WIDTH = 384\nconst DRAG_PREVIEW_MAX_HEIGHT = 256\nimport {\n listLeaves,\n MIN_SPLIT_RATIO,\n MAX_SPLIT_RATIO,\n type SplitLayoutBranch,\n type SplitLayoutLeaf,\n type SplitLayoutState,\n} from './model'\n\nexport type SplitLayoutProps<L extends SplitLayoutLeaf> = {\n state: SplitLayoutState<L>\n label: string\n /** Accessible name for a pane region and its close button. */\n labelForLeaf: (leaf: L) => string\n /** Called once per stable leaf owner; the accessor tracks opaque payload replacement. */\n renderLeaf: (leaf: Accessor<L>) => JSX.Element\n /** Inline visible header composition, separate from the region and close-button name. */\n renderPaneLabel?: (leaf: Accessor<L>) => JSX.Element\n /** Whether pane regions participate in sequential keyboard navigation; defaults to programmatic focus only. */\n paneTabIndex?: 0 | -1\n /** Accessible splitter name; defaults to the current orientation-specific label. */\n labelForSeparator?: (branch: SplitLayoutBranch<L>) => string\n onResize: (splitId: string, ratio: number) => void\n onFocus?: (leafId: string) => void\n /** Host performs the model transition and returns the surviving focus destination. */\n onClose?: (leafId: string) => string | undefined\n /** Pointer placement only; the host supplies keyboard commands and performs the model transition. */\n onMove?: (leafId: string, targetId: string, intent: PaneDropIntent) => void\n /** Stable header composition for host-owned keyboard actions/capability feedback. */\n renderPaneActions?: (leaf: Accessor<L>) => JSX.Element\n class?: string\n}\nfunction rectStyle(rect: LayoutRect): JSX.CSSProperties {\n return {\n left: `${rect.x * 100}%`,\n top: `${rect.y * 100}%`,\n width: `${rect.width * 100}%`,\n height: `${rect.height * 100}%`,\n }\n}\nfunction dragPreviewPlaceholder(source: HTMLElement, message: string) {\n const placeholder = document.createElement('div')\n placeholder.className = cn(\n source.getAttribute('class'),\n 'flex min-h-8 min-w-0 items-center justify-center bg-muted px-2 text-center text-xs text-muted-foreground'\n )\n placeholder.setAttribute('data-split-drag-placeholder', source.localName)\n placeholder.textContent = message\n return placeholder\n}\nfunction boundedSnapshotSize(width: number, height: number) {\n const sourceWidth = Math.max(1, width)\n const sourceHeight = Math.max(1, height)\n const scale = Math.min(\n 1,\n DRAG_PREVIEW_MAX_WIDTH / sourceWidth,\n DRAG_PREVIEW_MAX_HEIGHT / sourceHeight\n )\n return {\n width: Math.max(1, Math.round(sourceWidth * scale)),\n height: Math.max(1, Math.round(sourceHeight * scale)),\n }\n}\nfunction cloneDragPreviewNode(source: Node): Node | undefined {\n if (source.nodeType === Node.TEXT_NODE) return source.cloneNode(false)\n if (!(source instanceof HTMLElement || source instanceof SVGElement))\n return source.cloneNode(false)\n\n if (['script', 'style', 'link', 'source', 'track', 'meta'].includes(source.localName))\n return undefined\n if (['iframe', 'video', 'audio', 'object', 'embed'].includes(source.localName))\n return dragPreviewPlaceholder(\n source as HTMLElement,\n 'Embedded content unavailable while moving'\n )\n if (source instanceof HTMLImageElement) {\n const snapshot = document.createElement('canvas')\n const size = boundedSnapshotSize(\n source.naturalWidth || source.width,\n source.naturalHeight || source.height\n )\n snapshot.width = size.width\n snapshot.height = size.height\n snapshot.className = source.getAttribute('class') ?? ''\n snapshot.setAttribute('data-split-drag-image', '')\n try {\n if (!source.complete || source.naturalWidth === 0)\n throw new Error('image has no decoded pixels')\n const context = snapshot.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, snapshot.width, snapshot.height)\n return snapshot\n } catch {\n return dragPreviewPlaceholder(source, 'Image preview unavailable')\n }\n }\n\n // Copying a defined custom element can run its constructor; inserting it can\n // also reconnect a stream or terminal session. Flatten its display tree.\n if (source instanceof HTMLElement && source.localName.includes('-')) {\n const children = document.createDocumentFragment()\n for (const child of source.childNodes) {\n const clone = cloneDragPreviewNode(child)\n if (clone) children.append(clone)\n }\n return children.childNodes.length > 0\n ? children\n : dragPreviewPlaceholder(source, 'Live component preview unavailable while moving')\n }\n\n const clone = source.cloneNode(false) as HTMLElement | SVGElement\n for (const attribute of [\n 'id',\n 'style',\n 'draggable',\n 'data-pane-drag-handle',\n 'data-pane-id',\n 'src',\n 'srcset',\n 'href',\n 'xlink:href',\n 'data',\n 'poster',\n ])\n clone.removeAttribute(attribute)\n for (const attribute of Array.from(clone.attributes))\n if (/^on/i.test(attribute.name)) clone.removeAttribute(attribute.name)\n\n if (source instanceof HTMLCanvasElement && clone instanceof HTMLCanvasElement) {\n const size = boundedSnapshotSize(source.width, source.height)\n clone.width = size.width\n clone.height = size.height\n try {\n const context = clone.getContext('2d')\n if (!context) throw new Error('canvas snapshot context is unavailable')\n context.drawImage(source, 0, 0, clone.width, clone.height)\n } catch {\n return dragPreviewPlaceholder(source, 'Canvas preview unavailable while moving')\n }\n return clone\n }\n\n for (const child of source.childNodes) {\n const childClone = cloneDragPreviewNode(child)\n if (childClone) clone.append(childClone)\n }\n return clone\n}\n/** Muxy frame geometry keeps leaf owners stable; Corvu owns constrained separator interactions. */\nexport function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {\n let root: HTMLDivElement | undefined\n let pendingFrame: number | undefined\n const refs = new Map<string, HTMLElement>()\n const domIds = new Map<string, string>()\n const prefix = createUniqueId()\n let nextDomId = 0\n let nextDragId = 0\n let dragPreview: HTMLElement | undefined\n const [drag, setDrag] = createSignal<{ id: string; token: string }>()\n const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()\n const clearDrag = () => {\n setDrag(undefined)\n setDrop(undefined)\n dragPreview?.remove()\n dragPreview = undefined\n }\n const createDragPreview = (source: HTMLElement) => {\n dragPreview?.remove()\n const preview = cloneDragPreviewNode(source) as HTMLElement\n preview.className =\n 'pointer-events-none fixed -left-full top-0 z-(--z-dialog) flex h-64 max-h-screen w-96 max-w-screen min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-xl'\n preview.removeAttribute('id')\n preview.removeAttribute('style')\n preview.removeAttribute('role')\n preview.removeAttribute('aria-label')\n preview.removeAttribute('data-pane-id')\n preview.removeAttribute('data-focused')\n preview.removeAttribute('data-drag-source')\n preview.removeAttribute('data-drop-direction')\n preview.removeAttribute('data-drop-placement')\n preview.setAttribute('data-split-drag-preview', '')\n preview.setAttribute('aria-hidden', 'true')\n preview.inert = true\n document.body.append(preview)\n dragPreview = preview\n return preview\n }\n const domId = (id: string) => {\n const existing = domIds.get(id)\n if (existing) return existing\n const created = `${prefix}-pane-${nextDomId++}`\n domIds.set(id, created)\n return created\n }\n const leaves = createMemo(() => listLeaves(props.state.center))\n const leafMap = createMemo(() => new Map(leaves().map((leaf) => [leaf.id, leaf])))\n const frames = createMemo(() => computeLayoutFrames(props.state.center))\n const branches = createMemo(() =>\n Array.from(frames().values()).flatMap((frame) =>\n frame.node.kind === 'split' ? [frame.node] : []\n )\n )\n createComputed(() => {\n const current = drag()\n if (current && (!props.onMove || !leafMap().has(current.id))) clearDrag()\n const target = drop()\n if (target && !leafMap().has(target.id)) setDrop(undefined)\n })\n const allowedTarget = (id: string, transfer: DataTransfer | null) => {\n const current = drag()\n return props.onMove &&\n current &&\n current.id !== id &&\n leafMap().has(current.id) &&\n leafMap().has(id) &&\n transfer?.types.includes(PANE_DRAG_TYPE)\n ? current\n : undefined\n }\n const dropLabel = createMemo(() => {\n const target = drop()\n const leaf = target ? leafMap().get(target.id) : undefined\n return target && leaf\n ? `Drop to place pane ${target.intent.placement} ${props.labelForLeaf(leaf)}`\n : ''\n })\n const branchMap = createMemo(() => new Map(branches().map((branch) => [branch.id, branch])))\n const schedule = (action: () => void) => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n pendingFrame = requestAnimationFrame(() => {\n pendingFrame = undefined\n action()\n })\n }\n // Register before keyed children update: capture a focused editor before an\n // ordered DOM move can blur it. Never override a newer focus outside this root.\n createComputed(\n on(\n () => props.state.center,\n () => {\n const active = root?.ownerDocument.activeElement\n if (!root || !(active instanceof HTMLElement) || !root.contains(active)) return\n const field =\n active instanceof HTMLTextAreaElement || active instanceof HTMLInputElement\n ? active\n : undefined\n const selection = field\n ? {\n start: field.selectionStart,\n end: field.selectionEnd,\n direction: field.selectionDirection,\n }\n : undefined\n schedule(() => {\n if (!active.isConnected || !root?.contains(active)) return\n const current = active.ownerDocument.activeElement\n if (current !== active && current !== active.ownerDocument.body) return\n active.focus({ preventScroll: true })\n if (field && selection?.start !== null && selection?.end !== null && selection)\n field.setSelectionRange(\n selection.start,\n selection.end,\n selection.direction ?? undefined\n )\n })\n }\n )\n )\n onCleanup(() => {\n if (pendingFrame !== undefined) cancelAnimationFrame(pendingFrame)\n clearDrag()\n refs.clear()\n domIds.clear()\n })\n const close = (id: string) => {\n const next = props.onClose?.(id)\n if (next) schedule(() => refs.get(next)?.focus({ preventScroll: true }))\n }\n return (\n <div\n ref={(el) => {\n root = el\n }}\n role=\"group\"\n aria-label={props.label}\n data-slot=\"split-layout\"\n data-dragging={drag() ? '' : undefined}\n class={cn('relative size-full min-h-0 min-w-0 data-[dragging]:cursor-grabbing', props.class)}\n >\n <For each={leaves().map((leaf) => leaf.id)}>\n {(id) => {\n const initial = leafMap().get(id)!\n const leaf = () => leafMap().get(id) ?? initial\n const content = props.renderLeaf(leaf)\n const paneLabel = props.renderPaneLabel?.(leaf)\n const actions = props.renderPaneActions?.(leaf)\n const intent = () => (drop()?.id === id ? drop()?.intent : undefined)\n onCleanup(() => {\n refs.delete(id)\n domIds.delete(id)\n })\n return (\n <section\n ref={(el) => refs.set(id, el)}\n id={domId(id)}\n role=\"region\"\n aria-label={props.labelForLeaf(leaf())}\n tabIndex={props.paneTabIndex ?? -1}\n data-pane-id={id}\n data-focused={props.state.focusedLeafId === id ? '' : undefined}\n data-drag-source={drag()?.id === id ? '' : undefined}\n data-drop-direction={intent()?.direction}\n data-drop-placement={intent()?.placement}\n onDragOver={(event) => {\n if (!allowedTarget(id, event.dataTransfer)) return\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n if (!next) {\n setDrop(undefined)\n return\n }\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n setDrop({ id, intent: next })\n }}\n onDragLeave={(event) => {\n if (\n event.relatedTarget instanceof Node &&\n event.currentTarget.contains(event.relatedTarget)\n )\n return\n if (drop()?.id === id) setDrop(undefined)\n }}\n onDrop={(event) => {\n const current = allowedTarget(id, event.dataTransfer)\n const next = paneDropIntent(\n event.clientX,\n event.clientY,\n event.currentTarget.getBoundingClientRect()\n )\n const accepted =\n current && next && event.dataTransfer?.getData(PANE_DRAG_TYPE) === current.token\n clearDrag()\n if (!accepted) return\n event.preventDefault()\n props.onMove?.(current.id, id, next)\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n onFocusIn={() => props.onFocus?.(id)}\n >\n <header class=\"flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2\">\n <span\n data-pane-drag-handle=\"\"\n draggable={Boolean(props.onMove)}\n class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {\n 'cursor-grab': Boolean(props.onMove),\n 'cursor-grabbing': drag()?.id === id,\n })}\n title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}\n onDragStart={(event) => {\n if (!props.onMove || !event.dataTransfer) {\n event.preventDefault()\n return\n }\n const token = `${prefix}-${++nextDragId}`\n setDrag({ id, token })\n event.dataTransfer.setData(PANE_DRAG_TYPE, token)\n event.dataTransfer.effectAllowed = 'move'\n // The native drag image carries this pane's actual content\n // in a bounded floating-window frame; the source recedes\n // independently as the browser follows the image pointer.\n const source = refs.get(id)\n const frame = source?.getBoundingClientRect()\n if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {\n const preview = createDragPreview(source)\n const previewFrame = preview.getBoundingClientRect()\n const scaleX = previewFrame.width / frame.width\n const scaleY = previewFrame.height / frame.height\n event.dataTransfer.setDragImage(\n preview,\n Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),\n Math.max(0, Math.round((event.clientY - frame.top) * scaleY))\n )\n preview.setAttribute('data-native-drag-image', '')\n }\n }}\n onDragEnd={clearDrag}\n >\n {props.onMove ? (\n <GripVertical class=\"size-3 shrink-0\" aria-hidden=\"true\" />\n ) : null}\n <span class=\"min-w-0 flex-1 truncate\">\n {paneLabel ?? props.labelForLeaf(leaf())}\n </span>\n </span>\n {actions}\n {props.onClose ? (\n <Button\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={`Close ${props.labelForLeaf(leaf())}`}\n onClick={() => close(id)}\n >\n <X />\n </Button>\n ) : null}\n </header>\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\">{content}</div>\n {intent() ? (\n <div\n aria-hidden=\"true\"\n class={cn('pointer-events-none absolute border-2 border-primary bg-primary/10', {\n 'inset-y-0 left-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'before',\n 'inset-y-0 right-0 w-1/2':\n intent()?.direction === 'row' && intent()?.placement === 'after',\n 'inset-x-0 top-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'before',\n 'inset-x-0 bottom-0 h-1/2':\n intent()?.direction === 'column' && intent()?.placement === 'after',\n })}\n />\n ) : null}\n </section>\n )\n }}\n </For>\n <span class=\"sr-only\" role=\"status\">\n {dropLabel()}\n </span>\n <For each={branches().map((branch) => branch.id)}>\n {(id) => {\n const initial = branchMap().get(id)!\n const branch: Accessor<SplitLayoutBranch<L>> = () => branchMap().get(id) ?? initial\n return (\n <Resizable\n orientation={branch().direction === 'row' ? 'horizontal' : 'vertical'}\n sizes={[branch().ratio, 1 - branch().ratio]}\n keyboardDelta={0.05}\n onSizesChange={(sizes) => {\n // Corvu also reports panel registration/unregistration while\n // mounting or disposing a controller. Those incomplete or\n // hidden-host sizes are not user resize intent.\n if (!root?.isConnected || root.getClientRects().length === 0) return\n if (\n sizes.length !== 2 ||\n sizes.some((size) => !Number.isFinite(size)) ||\n Math.abs(sizes[0]! + sizes[1]! - 1) > 0.000001\n )\n return\n if (sizes[0] !== undefined && Math.abs(sizes[0] - branch().ratio) > 0.000001)\n props.onResize(id, sizes[0])\n }}\n style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}\n class=\"pointer-events-none absolute flex min-h-0 min-w-0 data-[orientation=vertical]:flex-col\"\n >\n <Resizable.Panel\n minSize={MIN_SPLIT_RATIO}\n maxSize={MAX_SPLIT_RATIO}\n aria-hidden=\"true\"\n />\n <Resizable.Handle\n aria-label={\n props.labelForSeparator?.(branch()) ??\n (branch().direction === 'row' ? 'Resize pane columns' : 'Resize pane rows')\n }\n aria-orientation={branch().direction === 'row' ? 'vertical' : 'horizontal'}\n aria-controls={listLeaves(branch())\n .map((leaf) => domId(leaf.id))\n .join(' ')}\n aria-valuemin={10}\n aria-valuemax={90}\n aria-valuenow={Math.round(branch().ratio * 100)}\n class=\"pointer-events-auto relative w-px shrink-0 bg-border after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 focus-visible:bg-primary focus-visible:outline-none hover:bg-primary data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:inset-x-0 data-[orientation=vertical]:after:-inset-y-1 data-[orientation=vertical]:after:h-3 data-[orientation=vertical]:after:w-full\"\n />\n <Resizable.Panel\n minSize={MIN_SPLIT_RATIO}\n maxSize={MAX_SPLIT_RATIO}\n aria-hidden=\"true\"\n />\n </Resizable>\n )\n }}\n </For>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMkB,iBAAiB;AACvB,IAAMC,yBAAyB;AAC/B,IAAMC,0BAA0B;AAiChC,SAAS8B,UAAUC,MAAqC;CACtD,OAAO;EACLE,MAAM,GAAGF,KAAKG,IAAI,IAAG;EACrBC,KAAK,GAAGJ,KAAKK,IAAI,IAAG;EACpBC,OAAO,GAAGN,KAAKM,QAAQ,IAAG;EAC1BC,QAAQ,GAAGP,KAAKO,SAAS,IAAG;CAC9B;AACF;AACA,SAASC,uBAAuBC,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AAc,IAAA8B,GAAA;GAAAC,SAAA7C,IAAAe,KAAAjC,aAAAlC,MAAA,iBAAAoD,IAAAe,IAAA8B,IAAA;GAAAC,SAAA9C,IAAAgB,KAAAjB,UAAAnD,MAAAoD,IAAAgB,IAAA8B,IAAA;GAAA,OAAA9C;EAAA,GAAA;GAAAc,GAAAxK,KAAAA;GAAAyK,GAAAzK,KAAAA;GAAA0K,GAAA1K,KAAAA;EAAA,CAAA;EAAA,OAAAsG;CAAA,EAAA,CAAA;AA2MlG;AAACmG,eAAA,CAAA,SAAA,CAAA"}
@@ -4,6 +4,7 @@
4
4
  "title": "Catalog Browser",
5
5
  "description": "",
6
6
  "dependencies": [
7
+ "class-variance-authority@^0.7.1",
7
8
  "lucide-solid@^1.48.0"
8
9
  ],
9
10
  "registryDependencies": [
@@ -1956,6 +1956,7 @@
1956
1956
  "title": "Catalog Browser",
1957
1957
  "description": "",
1958
1958
  "dependencies": [
1959
+ "class-variance-authority@^0.7.1",
1959
1960
  "lucide-solid@^1.48.0"
1960
1961
  ],
1961
1962
  "registryDependencies": [
@@ -94,7 +94,7 @@ export function AboutDialog(props: AboutDialogProps) {
94
94
  return (
95
95
  <Dialog open={props.open} onOpenChange={props.onOpenChange}>
96
96
  <DialogContent
97
- class="w-96"
97
+ class="w-full max-w-96"
98
98
  onKeyDown={(event: KeyboardEvent) => {
99
99
  // Tooltip help on the identity actions cannot trap Escape in this popup.
100
100
  if (event.key === 'Escape' && !event.defaultPrevented) {
@@ -1,5 +1,27 @@
1
- import { createUniqueId, Show, type JSX } from 'solid-js'
1
+ import { createContext, createUniqueId, Show, useContext, type JSX } from 'solid-js'
2
2
  import { Badge } from '../../ui/badge'
3
+ import { cva } from 'class-variance-authority'
4
+
5
+ type SectionsLayout = 'stacked' | 'columns'
6
+ const SectionsLayoutContext = createContext<() => SectionsLayout>((): SectionsLayout => 'stacked')
7
+ const sectionsVariants = cva('grid min-w-0', {
8
+ variants: {
9
+ layout: {
10
+ stacked: 'gap-2',
11
+ columns:
12
+ 'gap-4 rounded-xl border border-border p-3 md:auto-cols-fr md:grid-flow-col md:gap-0',
13
+ },
14
+ },
15
+ })
16
+ const sectionVariants = cva('grid min-w-0 gap-1.5 wrap-anywhere', {
17
+ variants: {
18
+ layout: {
19
+ stacked: 'rounded-xl border border-border p-3',
20
+ columns:
21
+ 'md:border-s md:border-border md:px-3 md:first:border-s-0 md:first:ps-0 md:last:pe-0',
22
+ },
23
+ },
24
+ })
3
25
 
4
26
  /** Shared item summary and action frame for catalog-owned detail content. */
5
27
  export function CatalogDetail(props: {
@@ -13,6 +35,8 @@ export function CatalogDetail(props: {
13
35
  badges?: JSX.Element
14
36
  action?: JSX.Element
15
37
  status?: JSX.Element
38
+ /** Groups related fields in one padded card; stacks them on narrow screens. */
39
+ sectionsLayout?: SectionsLayout
16
40
  children?: JSX.Element
17
41
  }) {
18
42
  return (
@@ -40,19 +64,25 @@ export function CatalogDetail(props: {
40
64
  </div>
41
65
  </Show>
42
66
  </div>
43
- <div class="grid min-w-0 gap-2">{props.children}</div>
67
+ <SectionsLayoutContext.Provider value={() => props.sectionsLayout ?? 'stacked'}>
68
+ <div
69
+ data-catalog-detail-sections
70
+ data-layout={props.sectionsLayout ?? 'stacked'}
71
+ class={sectionsVariants({ layout: props.sectionsLayout ?? 'stacked' })}
72
+ >
73
+ {props.children}
74
+ </div>
75
+ </SectionsLayoutContext.Provider>
44
76
  </article>
45
77
  )
46
78
  }
47
79
 
48
80
  /** A shared compact row for host-specific fields, permissions, and copy. */
49
81
  export function CatalogDetailSection(props: { title: string; children?: JSX.Element }) {
82
+ const layout = useContext(SectionsLayoutContext)
50
83
  const headingId = `catalog-detail-section-${createUniqueId()}`
51
84
  return (
52
- <section
53
- class="grid min-w-0 gap-1.5 rounded-xl border border-border p-3"
54
- aria-labelledby={headingId}
55
- >
85
+ <section class={sectionVariants({ layout: layout() })} aria-labelledby={headingId}>
56
86
  <h3
57
87
  id={headingId}
58
88
  class="text-2xs font-semibold tracking-wider text-muted-foreground uppercase"
@@ -615,7 +615,8 @@ export function UpdateDialog(props: UpdateDialogProps) {
615
615
  </Show>
616
616
 
617
617
  <DialogContent
618
- class={cn('max-w-3xl', local.class)}
618
+ positioner="inset"
619
+ class={cn('flex max-h-full min-h-0 max-w-3xl flex-col overflow-hidden', local.class)}
619
620
  onKeyDown={(event: KeyboardEvent) => {
620
621
  // An explanatory tooltip must not consume the popup's close shortcut,
621
622
  // including while its exit animation still owns Kobalte's top layer.
@@ -634,7 +635,7 @@ export function UpdateDialog(props: UpdateDialogProps) {
634
635
  }}
635
636
  onCloseAutoFocus={focusRestoration.onCloseAutoFocus}
636
637
  >
637
- <DialogHeader>
638
+ <DialogHeader class="shrink-0">
638
639
  <div class="flex items-center gap-3">
639
640
  <Show
640
641
  when={local.appIcon}
@@ -651,7 +652,10 @@ export function UpdateDialog(props: UpdateDialogProps) {
651
652
  </div>
652
653
  </DialogHeader>
653
654
 
654
- <div class="flex min-h-0 flex-col gap-5 overflow-y-auto p-6">
655
+ <div
656
+ data-slot="update-dialog-scroll-region"
657
+ class="flex min-h-0 min-w-0 flex-1 flex-col gap-5 overflow-y-auto p-6"
658
+ >
655
659
  <section
656
660
  class="rounded-xl border border-border bg-background/45 p-4"
657
661
  aria-label="Version status"
@@ -17,6 +17,8 @@ import { computeLayoutFrames, type LayoutRect } from './geometry'
17
17
  import { paneDropIntent, type PaneDropIntent } from './drop'
18
18
  export type { PaneDropIntent } from './drop'
19
19
  const PANE_DRAG_TYPE = 'application/x-adea-pane-move'
20
+ const DRAG_PREVIEW_MAX_WIDTH = 384
21
+ const DRAG_PREVIEW_MAX_HEIGHT = 256
20
22
  import {
21
23
  listLeaves,
22
24
  MIN_SPLIT_RATIO,
@@ -57,6 +59,114 @@ function rectStyle(rect: LayoutRect): JSX.CSSProperties {
57
59
  height: `${rect.height * 100}%`,
58
60
  }
59
61
  }
62
+ function dragPreviewPlaceholder(source: HTMLElement, message: string) {
63
+ const placeholder = document.createElement('div')
64
+ placeholder.className = cn(
65
+ source.getAttribute('class'),
66
+ 'flex min-h-8 min-w-0 items-center justify-center bg-muted px-2 text-center text-xs text-muted-foreground'
67
+ )
68
+ placeholder.setAttribute('data-split-drag-placeholder', source.localName)
69
+ placeholder.textContent = message
70
+ return placeholder
71
+ }
72
+ function boundedSnapshotSize(width: number, height: number) {
73
+ const sourceWidth = Math.max(1, width)
74
+ const sourceHeight = Math.max(1, height)
75
+ const scale = Math.min(
76
+ 1,
77
+ DRAG_PREVIEW_MAX_WIDTH / sourceWidth,
78
+ DRAG_PREVIEW_MAX_HEIGHT / sourceHeight
79
+ )
80
+ return {
81
+ width: Math.max(1, Math.round(sourceWidth * scale)),
82
+ height: Math.max(1, Math.round(sourceHeight * scale)),
83
+ }
84
+ }
85
+ function cloneDragPreviewNode(source: Node): Node | undefined {
86
+ if (source.nodeType === Node.TEXT_NODE) return source.cloneNode(false)
87
+ if (!(source instanceof HTMLElement || source instanceof SVGElement))
88
+ return source.cloneNode(false)
89
+
90
+ if (['script', 'style', 'link', 'source', 'track', 'meta'].includes(source.localName))
91
+ return undefined
92
+ if (['iframe', 'video', 'audio', 'object', 'embed'].includes(source.localName))
93
+ return dragPreviewPlaceholder(
94
+ source as HTMLElement,
95
+ 'Embedded content unavailable while moving'
96
+ )
97
+ if (source instanceof HTMLImageElement) {
98
+ const snapshot = document.createElement('canvas')
99
+ const size = boundedSnapshotSize(
100
+ source.naturalWidth || source.width,
101
+ source.naturalHeight || source.height
102
+ )
103
+ snapshot.width = size.width
104
+ snapshot.height = size.height
105
+ snapshot.className = source.getAttribute('class') ?? ''
106
+ snapshot.setAttribute('data-split-drag-image', '')
107
+ try {
108
+ if (!source.complete || source.naturalWidth === 0)
109
+ throw new Error('image has no decoded pixels')
110
+ const context = snapshot.getContext('2d')
111
+ if (!context) throw new Error('canvas snapshot context is unavailable')
112
+ context.drawImage(source, 0, 0, snapshot.width, snapshot.height)
113
+ return snapshot
114
+ } catch {
115
+ return dragPreviewPlaceholder(source, 'Image preview unavailable')
116
+ }
117
+ }
118
+
119
+ // Copying a defined custom element can run its constructor; inserting it can
120
+ // also reconnect a stream or terminal session. Flatten its display tree.
121
+ if (source instanceof HTMLElement && source.localName.includes('-')) {
122
+ const children = document.createDocumentFragment()
123
+ for (const child of source.childNodes) {
124
+ const clone = cloneDragPreviewNode(child)
125
+ if (clone) children.append(clone)
126
+ }
127
+ return children.childNodes.length > 0
128
+ ? children
129
+ : dragPreviewPlaceholder(source, 'Live component preview unavailable while moving')
130
+ }
131
+
132
+ const clone = source.cloneNode(false) as HTMLElement | SVGElement
133
+ for (const attribute of [
134
+ 'id',
135
+ 'style',
136
+ 'draggable',
137
+ 'data-pane-drag-handle',
138
+ 'data-pane-id',
139
+ 'src',
140
+ 'srcset',
141
+ 'href',
142
+ 'xlink:href',
143
+ 'data',
144
+ 'poster',
145
+ ])
146
+ clone.removeAttribute(attribute)
147
+ for (const attribute of Array.from(clone.attributes))
148
+ if (/^on/i.test(attribute.name)) clone.removeAttribute(attribute.name)
149
+
150
+ if (source instanceof HTMLCanvasElement && clone instanceof HTMLCanvasElement) {
151
+ const size = boundedSnapshotSize(source.width, source.height)
152
+ clone.width = size.width
153
+ clone.height = size.height
154
+ try {
155
+ const context = clone.getContext('2d')
156
+ if (!context) throw new Error('canvas snapshot context is unavailable')
157
+ context.drawImage(source, 0, 0, clone.width, clone.height)
158
+ } catch {
159
+ return dragPreviewPlaceholder(source, 'Canvas preview unavailable while moving')
160
+ }
161
+ return clone
162
+ }
163
+
164
+ for (const child of source.childNodes) {
165
+ const childClone = cloneDragPreviewNode(child)
166
+ if (childClone) clone.append(childClone)
167
+ }
168
+ return clone
169
+ }
60
170
  /** Muxy frame geometry keeps leaf owners stable; Corvu owns constrained separator interactions. */
61
171
  export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L>) {
62
172
  let root: HTMLDivElement | undefined
@@ -66,11 +176,35 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
66
176
  const prefix = createUniqueId()
67
177
  let nextDomId = 0
68
178
  let nextDragId = 0
179
+ let dragPreview: HTMLElement | undefined
69
180
  const [drag, setDrag] = createSignal<{ id: string; token: string }>()
70
181
  const [drop, setDrop] = createSignal<{ id: string; intent: PaneDropIntent }>()
71
182
  const clearDrag = () => {
72
183
  setDrag(undefined)
73
184
  setDrop(undefined)
185
+ dragPreview?.remove()
186
+ dragPreview = undefined
187
+ }
188
+ const createDragPreview = (source: HTMLElement) => {
189
+ dragPreview?.remove()
190
+ const preview = cloneDragPreviewNode(source) as HTMLElement
191
+ preview.className =
192
+ 'pointer-events-none fixed -left-full top-0 z-(--z-dialog) flex h-64 max-h-screen w-96 max-w-screen min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-xl'
193
+ preview.removeAttribute('id')
194
+ preview.removeAttribute('style')
195
+ preview.removeAttribute('role')
196
+ preview.removeAttribute('aria-label')
197
+ preview.removeAttribute('data-pane-id')
198
+ preview.removeAttribute('data-focused')
199
+ preview.removeAttribute('data-drag-source')
200
+ preview.removeAttribute('data-drop-direction')
201
+ preview.removeAttribute('data-drop-placement')
202
+ preview.setAttribute('data-split-drag-preview', '')
203
+ preview.setAttribute('aria-hidden', 'true')
204
+ preview.inert = true
205
+ document.body.append(preview)
206
+ dragPreview = preview
207
+ return preview
74
208
  }
75
209
  const domId = (id: string) => {
76
210
  const existing = domIds.get(id)
@@ -236,7 +370,7 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
236
370
  props.onMove?.(current.id, id, next)
237
371
  }}
238
372
  style={rectStyle(frames().get(id)?.rect ?? { x: 0, y: 0, width: 0, height: 0 })}
239
- class="absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring"
373
+ class="absolute flex min-h-0 min-w-0 flex-col overflow-hidden border border-border transition-opacity motion-reduce:transition-none data-[drag-source]:opacity-40 data-[focused]:border-primary bg-background text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring"
240
374
  onFocusIn={() => props.onFocus?.(id)}
241
375
  >
242
376
  <header class="flex min-w-0 shrink-0 items-center gap-2 bg-surface px-2">
@@ -245,6 +379,7 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
245
379
  draggable={Boolean(props.onMove)}
246
380
  class={cn('flex min-w-0 flex-1 items-center gap-2 truncate text-sm', {
247
381
  'cursor-grab': Boolean(props.onMove),
382
+ 'cursor-grabbing': drag()?.id === id,
248
383
  })}
249
384
  title={props.onMove ? `Drag ${props.labelForLeaf(leaf())} to move` : undefined}
250
385
  onDragStart={(event) => {
@@ -256,18 +391,23 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
256
391
  setDrag({ id, token })
257
392
  event.dataTransfer.setData(PANE_DRAG_TYPE, token)
258
393
  event.dataTransfer.effectAllowed = 'move'
259
- // The ghost is the pane itself, not the handle strip: the
260
- // browser snapshots the region before the drag state dims
261
- // this section, so the dragged pane stays readable while
262
- // its source visibly recedes.
394
+ // The native drag image carries this pane's actual content
395
+ // in a bounded floating-window frame; the source recedes
396
+ // independently as the browser follows the image pointer.
263
397
  const source = refs.get(id)
264
398
  const frame = source?.getBoundingClientRect()
265
- if (source && frame && typeof event.dataTransfer.setDragImage === 'function')
399
+ if (source && frame && typeof event.dataTransfer.setDragImage === 'function') {
400
+ const preview = createDragPreview(source)
401
+ const previewFrame = preview.getBoundingClientRect()
402
+ const scaleX = previewFrame.width / frame.width
403
+ const scaleY = previewFrame.height / frame.height
266
404
  event.dataTransfer.setDragImage(
267
- source,
268
- Math.max(0, Math.round(event.clientX - frame.left)),
269
- Math.max(0, Math.round(event.clientY - frame.top))
405
+ preview,
406
+ Math.max(0, Math.round((event.clientX - frame.left) * scaleX)),
407
+ Math.max(0, Math.round((event.clientY - frame.top) * scaleY))
270
408
  )
409
+ preview.setAttribute('data-native-drag-image', '')
410
+ }
271
411
  }}
272
412
  onDragEnd={clearDrag}
273
413
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.103.1",
3
+ "version": "0.104.1",
4
4
  "description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
5
5
  "keywords": [
6
6
  "adea",
package/registry.json CHANGED
@@ -1956,6 +1956,7 @@
1956
1956
  "title": "Catalog Browser",
1957
1957
  "description": "",
1958
1958
  "dependencies": [
1959
+ "class-variance-authority@^0.7.1",
1959
1960
  "lucide-solid@^1.48.0"
1960
1961
  ],
1961
1962
  "registryDependencies": [
@@ -94,7 +94,7 @@ export function AboutDialog(props: AboutDialogProps) {
94
94
  return (
95
95
  <Dialog open={props.open} onOpenChange={props.onOpenChange}>
96
96
  <DialogContent
97
- class="w-96"
97
+ class="w-full max-w-96"
98
98
  onKeyDown={(event: KeyboardEvent) => {
99
99
  // Tooltip help on the identity actions cannot trap Escape in this popup.
100
100
  if (event.key === 'Escape' && !event.defaultPrevented) {
@@ -1,5 +1,27 @@
1
- import { createUniqueId, Show, type JSX } from 'solid-js'
1
+ import { createContext, createUniqueId, Show, useContext, type JSX } from 'solid-js'
2
2
  import { Badge } from '../../ui/badge'
3
+ import { cva } from 'class-variance-authority'
4
+
5
+ type SectionsLayout = 'stacked' | 'columns'
6
+ const SectionsLayoutContext = createContext<() => SectionsLayout>((): SectionsLayout => 'stacked')
7
+ const sectionsVariants = cva('grid min-w-0', {
8
+ variants: {
9
+ layout: {
10
+ stacked: 'gap-2',
11
+ columns:
12
+ 'gap-4 rounded-xl border border-border p-3 md:auto-cols-fr md:grid-flow-col md:gap-0',
13
+ },
14
+ },
15
+ })
16
+ const sectionVariants = cva('grid min-w-0 gap-1.5 wrap-anywhere', {
17
+ variants: {
18
+ layout: {
19
+ stacked: 'rounded-xl border border-border p-3',
20
+ columns:
21
+ 'md:border-s md:border-border md:px-3 md:first:border-s-0 md:first:ps-0 md:last:pe-0',
22
+ },
23
+ },
24
+ })
3
25
 
4
26
  /** Shared item summary and action frame for catalog-owned detail content. */
5
27
  export function CatalogDetail(props: {
@@ -13,6 +35,8 @@ export function CatalogDetail(props: {
13
35
  badges?: JSX.Element
14
36
  action?: JSX.Element
15
37
  status?: JSX.Element
38
+ /** Groups related fields in one padded card; stacks them on narrow screens. */
39
+ sectionsLayout?: SectionsLayout
16
40
  children?: JSX.Element
17
41
  }) {
18
42
  return (
@@ -40,19 +64,25 @@ export function CatalogDetail(props: {
40
64
  </div>
41
65
  </Show>
42
66
  </div>
43
- <div class="grid min-w-0 gap-2">{props.children}</div>
67
+ <SectionsLayoutContext.Provider value={() => props.sectionsLayout ?? 'stacked'}>
68
+ <div
69
+ data-catalog-detail-sections
70
+ data-layout={props.sectionsLayout ?? 'stacked'}
71
+ class={sectionsVariants({ layout: props.sectionsLayout ?? 'stacked' })}
72
+ >
73
+ {props.children}
74
+ </div>
75
+ </SectionsLayoutContext.Provider>
44
76
  </article>
45
77
  )
46
78
  }
47
79
 
48
80
  /** A shared compact row for host-specific fields, permissions, and copy. */
49
81
  export function CatalogDetailSection(props: { title: string; children?: JSX.Element }) {
82
+ const layout = useContext(SectionsLayoutContext)
50
83
  const headingId = `catalog-detail-section-${createUniqueId()}`
51
84
  return (
52
- <section
53
- class="grid min-w-0 gap-1.5 rounded-xl border border-border p-3"
54
- aria-labelledby={headingId}
55
- >
85
+ <section class={sectionVariants({ layout: layout() })} aria-labelledby={headingId}>
56
86
  <h3
57
87
  id={headingId}
58
88
  class="text-2xs font-semibold tracking-wider text-muted-foreground uppercase"
@@ -615,7 +615,8 @@ export function UpdateDialog(props: UpdateDialogProps) {
615
615
  </Show>
616
616
 
617
617
  <DialogContent
618
- class={cn('max-w-3xl', local.class)}
618
+ positioner="inset"
619
+ class={cn('flex max-h-full min-h-0 max-w-3xl flex-col overflow-hidden', local.class)}
619
620
  onKeyDown={(event: KeyboardEvent) => {
620
621
  // An explanatory tooltip must not consume the popup's close shortcut,
621
622
  // including while its exit animation still owns Kobalte's top layer.
@@ -634,7 +635,7 @@ export function UpdateDialog(props: UpdateDialogProps) {
634
635
  }}
635
636
  onCloseAutoFocus={focusRestoration.onCloseAutoFocus}
636
637
  >
637
- <DialogHeader>
638
+ <DialogHeader class="shrink-0">
638
639
  <div class="flex items-center gap-3">
639
640
  <Show
640
641
  when={local.appIcon}
@@ -651,7 +652,10 @@ export function UpdateDialog(props: UpdateDialogProps) {
651
652
  </div>
652
653
  </DialogHeader>
653
654
 
654
- <div class="flex min-h-0 flex-col gap-5 overflow-y-auto p-6">
655
+ <div
656
+ data-slot="update-dialog-scroll-region"
657
+ class="flex min-h-0 min-w-0 flex-1 flex-col gap-5 overflow-y-auto p-6"
658
+ >
655
659
  <section
656
660
  class="rounded-xl border border-border bg-background/45 p-4"
657
661
  aria-label="Version status"