react-devbelt 0.4.0 → 0.5.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/toolbar/toolbar-entry.tsx","../src/ui/toolbar/toolbar.tsx","../src/ui/toolbar/default-item.tsx","../src/ui/window/floating-window.tsx","../src/ui/toolbar/use-dev-layout.ts","../src/ui/toolbar/item-menu.tsx","../src/ui/toolbar/toolbar-strip.tsx","../src/ui/vendor/fluid-functionalism/use-fluid-hover.ts","../src/ui/toolbar/plugin-boundary.tsx","../src/ui/window/plugin-popover.tsx","../src/ui/toolbar/toolbar-root.tsx","../src/ui/css/styles.generated.ts","../src/ui/window/use-dock-position.ts"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\n\nimport { defaultPlugins } from \"../../plugins\";\nimport type { AiTool } from \"../../plugins/ai-handoff/ai-tools\";\nimport type { DevBeltPlugin } from \"../../plugin-api\";\nimport ToolbarImpl from \"./toolbar\";\nimport type { Isolation } from \"./toolbar-root\";\nimport type { PanelMode } from \"./use-dev-layout\";\n\nlet defaults: DevBeltPlugin[] | null = null;\n\n/** The lazy chunk: the toolbar plus the built-in plugins it falls back to. */\nexport default function ToolbarEntry({\n plugins,\n isolation,\n panelMode,\n aiTools,\n}: {\n plugins?: readonly DevBeltPlugin[];\n isolation: Isolation;\n panelMode?: PanelMode;\n aiTools?: readonly AiTool[];\n}) {\n const list = useMemo(() => plugins ?? (defaults ??= defaultPlugins()), [plugins]);\n return <ToolbarImpl plugins={list} isolation={isolation} panelMode={panelMode} aiTools={aiTools} />;\n}\n","\"use client\";\n\nimport {\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\";\nimport { MotionConfig, motion } from \"motion/react\";\nimport { ariaKeyshortcuts } from \"@ui-sdk/core/shortcuts\";\nimport { Button } from \"@ui-sdk/react/button\";\nimport {\n ToolbarButton,\n ToolbarSeparator,\n} from \"@ui-sdk/react/toolbar\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@ui-sdk/react/tooltip\";\nimport { ChevronDownIcon, GripVerticalIcon } from \"lucide-react\";\n\nimport { defaultAiTools, type AiTool } from \"../../plugins/ai-handoff/ai-tools\";\nimport { exposedAgentTools, registerAgentTools } from \"../../core/agent-tools\";\nimport type { DebugEntry } from \"../../core/debug-bundle\";\nimport { readString, writeString } from \"../../core/storage\";\nimport { installPlugins } from \"../../runtime/install-plugins\";\nimport type { DevBeltPlugin, ToolbarApi } from \"../../plugin-api\";\nimport { ToolbarContext } from \"./context\";\nimport { DefaultItem } from \"./default-item\";\nimport { FloatingWindow } from \"../window/floating-window\";\nimport { ItemMenu } from \"./item-menu\";\nimport { ToolbarStrip } from \"./toolbar-strip\";\nimport { MoreMenu } from \"./more-menu\";\nimport { PluginBoundary } from \"./plugin-boundary\";\nimport { PluginPopover } from \"../window/plugin-popover\";\nimport { spring } from \"../vendor/fluid-functionalism/springs\";\nimport {\n COLLAPSE_EVENT,\n COLLAPSE_SHORTCUT,\n collapseLabel,\n forwardToTop,\n HIDE_EVENT,\n hideLabel,\n installToolbarShortcuts,\n} from \"./toolbar-shortcuts\";\nimport { kbdClass, tooltipClass } from \"../primitives/styles\";\nimport { ToolbarPortal, useMount, type Isolation } from \"./toolbar-root\";\nimport {\n clampRect,\n defaultRect,\n useDevLayout,\n type PanelMode,\n} from \"./use-dev-layout\";\nimport { useDockPosition } from \"../window/use-dock-position\";\n\nconst COLLAPSE_KEY = \"collapsed\";\n// An open ui-sdk popup (menu, popover, dialog) owns Esc until it has closed.\nconst OPEN_POPUP =\n '[data-slot$=\"-content\"][data-open]:not([data-slot=\"tooltip-content\"])';\n\nexport type ToolbarProps = {\n plugins: readonly DevBeltPlugin[];\n isolation: Isolation;\n /** How tools open until the person picks a mode in More tools. Default `\"window\"`. */\n panelMode?: PanelMode;\n /** The AI tools offered for \"open in …\". Default: Cursor, Claude Code and Codex. */\n aiTools?: readonly AiTool[];\n};\n\n/**\n * Installs the plugins in this frame. Inside the viewport iframe that is all\n * it does: the toolbar itself lives in the top window.\n */\nexport default function ToolbarImpl({\n plugins,\n isolation,\n panelMode,\n aiTools,\n}: ToolbarProps) {\n const [embedded] = useState(() => window.self !== window.top);\n // identity of the list, so an inline `plugins={[...]}` doesn't reinstall\n const key = plugins.map((p) => p.id).join(\"|\");\n\n useEffect(() => installPlugins(plugins), [key]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // inside the viewport frame the shortcuts still work: the top window owns the toolbar\n useEffect(\n () =>\n embedded\n ? installToolbarShortcuts({\n collapse: () => forwardToTop(COLLAPSE_EVENT),\n hide: () => forwardToTop(HIDE_EVENT),\n })\n : undefined,\n [embedded],\n );\n\n return embedded ? null : (\n <TopToolbar\n plugins={plugins}\n isolation={isolation}\n panelMode={panelMode}\n aiTools={aiTools}\n />\n );\n}\n\nfunction TopToolbar({ plugins, isolation, panelMode, aiTools }: ToolbarProps) {\n const pluginCss = useMemo(\n () => plugins.flatMap((p) => (p.styles ? [p.styles] : [])),\n [plugins],\n );\n const mount = useMount(isolation, pluginCss);\n\n const [collapsed, setCollapsed] = useState(\n () => readString(COLLAPSE_KEY) === \"1\",\n );\n // Hidden is for the session only: a reload brings the toolbar back, so it is never lost.\n const [hidden, setHidden] = useState(false);\n const dock = useDockPosition(collapsed);\n const layout = useDevLayout(plugins, panelMode);\n\n // Latest state for the stable API object and the Esc listener below.\n const live = useRef({ layout, plugins, aiTools, hidden });\n const escapeHolds = useRef(0);\n useEffect(() => {\n live.current = { layout, plugins, aiTools, hidden };\n });\n\n const api = useMemo<ToolbarApi | null>(\n () =>\n mount\n ? {\n container: mount.container,\n root: mount.root,\n openWindow: (id) => live.current.layout.open(id),\n closeWindow: (id) => live.current.layout.close(id),\n toggleWindow: (id) => live.current.layout.toggle(id),\n get aiTools() {\n return live.current.aiTools ?? defaultAiTools;\n },\n debugContext: () => collectDebugContext(live.current.plugins),\n debugSections: () =>\n live.current.plugins.flatMap((p) => {\n try {\n return p.debugSections?.() ?? [];\n } catch {\n return [];\n }\n }),\n setHidden: (next) => setHidden(next),\n isHidden: () => live.current.hidden,\n holdEscape: () => {\n escapeHolds.current++;\n let released = false;\n return () => {\n if (!released) {\n released = true;\n escapeHolds.current--;\n }\n };\n },\n }\n : null,\n [mount],\n );\n\n // Tools for the browser's agent, from every plugin.\n const toolKey = plugins.map((p) => `${p.id}:${p.agent?.write === true}`).join(\"|\");\n const apiRef = useRef(api);\n useEffect(() => {\n apiRef.current = api;\n });\n useEffect(\n () =>\n registerAgentTools(\n exposedAgentTools(plugins),\n () => apiRef.current as ToolbarApi,\n ),\n [toolKey], // eslint-disable-line react-hooks/exhaustive-deps\n );\n\n // Esc closes the window in front, wherever focus is, one per press. It\n // leaves the key alone while something else should have it: an overlay that\n // holds Esc (Grab) or an open menu, popover or dialog (closes first).\n useEffect(() => {\n const onKey = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n const { layout: current } = live.current;\n if (live.current.hidden || escapeHolds.current > 0 || current.layout.open.length === 0) {\n return;\n }\n const root = mount?.root ?? document;\n if (root.querySelector(OPEN_POPUP) || document.querySelector(OPEN_POPUP)) {\n return;\n }\n event.preventDefault();\n current.close(current.layout.open[current.layout.open.length - 1]);\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [mount]);\n\n const toggleCollapsed = () =>\n setCollapsed((current) => {\n writeString(COLLAPSE_KEY, current ? \"0\" : \"1\");\n return !current;\n });\n const toggleHidden = () => setHidden((current) => !current);\n\n // Overlays stay while the toolbar is hidden (the device Frame is the page), but the toolbar's\n // own pop-ups, like the size HUD, go: they mark themselves `data-devbelt-hud`.\n useEffect(() => {\n mount?.container.toggleAttribute(\"data-devbelt-hidden\", hidden);\n }, [mount, hidden]);\n\n // ⌘. collapses to the chip (or brings back a hidden toolbar); ⌘/ hides everything.\n // They also arrive as events from the viewport frame.\n const shortcutActions = useRef({ collapse: () => {}, hide: () => {} });\n useEffect(() => {\n shortcutActions.current = {\n collapse: () => (live.current.hidden ? setHidden(false) : toggleCollapsed()),\n hide: toggleHidden,\n };\n });\n useEffect(() => {\n const collapse = () => shortcutActions.current.collapse();\n const hide = () => shortcutActions.current.hide();\n const off = installToolbarShortcuts({ collapse, hide });\n window.addEventListener(COLLAPSE_EVENT, collapse);\n window.addEventListener(HIDE_EVENT, hide);\n return () => {\n off();\n window.removeEventListener(COLLAPSE_EVENT, collapse);\n window.removeEventListener(HIDE_EVENT, hide);\n };\n }, []);\n\n const run = (plugin: DevBeltPlugin) => {\n if (!api) return;\n if (plugin.window) layout.open(plugin.id);\n else void plugin.run?.(api);\n };\n\n if (!api) return null;\n\n const pinned = plugins.filter((p) => layout.isPinned(p));\n const byId = new Map(plugins.map((p) => [p.id, p]));\n // a popover points at the toolbar, so it waits while the toolbar is tucked away\n const popoverId =\n layout.mode === \"popover\" && !collapsed ? layout.layout.open.at(-1) : undefined;\n const popover = popoverId ? byId.get(popoverId) : undefined;\n\n return (\n <ToolbarContext.Provider value={api}>\n {/* the OS reduced-motion setting drops transforms and layout moves; fades stay */}\n <MotionConfig reducedMotion=\"user\">\n <ToolbarPortal mount={mount}>\n {plugins.map((plugin) =>\n plugin.Overlay ? (\n <PluginBoundary key={plugin.id} plugin={plugin.id}>\n <plugin.Overlay />\n </PluginBoundary>\n ) : null,\n )}\n\n <div style={{ display: hidden ? \"none\" : \"contents\" }}>\n {popover?.window ? (\n <PluginPopover\n key={popover.id}\n id={popover.id}\n title={popover.window.title ?? popover.name}\n icon={popover.icon}\n size={popover.window.size}\n root={api.root}\n onClose={() => layout.close(popover.id)}\n >\n <popover.window.Component />\n </PluginPopover>\n ) : null}\n\n {layout.mode === \"window\" ? layout.layout.open.map((id, index) => {\n const plugin = byId.get(id);\n if (!plugin?.window) return null;\n const { Component, size, title } = plugin.window;\n return (\n <FloatingWindow\n key={id}\n id={id}\n size={size}\n title={title ?? plugin.name}\n icon={plugin.icon}\n // clamped on every render, so a window saved on a bigger screen\n // (or after the browser shrank) never ends up out of reach\n rect={clampRect(\n size,\n layout.layout.rects[id] ?? defaultRect(size, index),\n )}\n stack={index}\n onFocus={() => layout.focus(id)}\n onClose={() => layout.close(id)}\n onRect={(rect) => layout.setRect(id, rect)}\n >\n <PluginBoundary plugin={id}>\n <Component />\n </PluginBoundary>\n </FloatingWindow>\n );\n }) : null}\n\n {dock.guides.x !== null ? (\n <div\n data-react-grab-ignore\n data-dock-guide=\"x\"\n aria-hidden=\"true\"\n className=\"pointer-events-none fixed inset-y-0 z-[9999] w-px bg-accent/70\"\n style={{ left: dock.guides.x }}\n />\n ) : null}\n {dock.guides.y !== null ? (\n <div\n data-react-grab-ignore\n data-dock-guide=\"y\"\n aria-hidden=\"true\"\n className=\"pointer-events-none fixed inset-x-0 z-[9999] h-px bg-accent/70\"\n style={{ top: dock.guides.y }}\n />\n ) : null}\n\n <div\n ref={dock.dockRef}\n className=\"pointer-events-none fixed inset-0 z-[10000] [translate:var(--dock-x)_var(--dock-y)]\"\n style={\n {\n \"--dock-x\": `${dock.position.x}px`,\n \"--dock-y\": `${dock.position.y}px`,\n } as CSSProperties\n }\n >\n <motion.div\n data-react-grab-ignore\n data-dock=\"chip\"\n initial={false}\n animate={{ y: collapsed ? 0 : \"-3.25rem\" }}\n transition={spring.moderate}\n className=\"pointer-events-none fixed inset-x-0 bottom-[max(1rem,env(safe-area-inset-bottom))] z-[10000] mx-auto flex w-fit\"\n >\n <Tooltip>\n <TooltipTrigger\n render={\n <Button\n onPointerDown={dock.startDrag}\n aria-label={collapsed ? \"Show dev tools\" : \"Hide dev tools\"}\n aria-expanded={!collapsed}\n aria-keyshortcuts={ariaKeyshortcuts(COLLAPSE_SHORTCUT)}\n onClick={toggleCollapsed}\n />\n }\n className=\"pointer-events-auto flex h-7 w-fit items-center justify-center gap-1.5 rounded-full bg-surface-glass px-3 text-xs font-medium text-fg shadow-float backdrop-blur-lg backdrop-saturate-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus\"\n >\n <motion.span\n initial={false}\n animate={{ rotate: collapsed ? 180 : 0 }}\n transition={spring.fast}\n className=\"inline-flex\"\n >\n <ChevronDownIcon className=\"size-3.5 text-fg-icon\" aria-hidden=\"true\" />\n </motion.span>\n {collapsed ? (\n <motion.span\n initial={{ opacity: 0, y: 4 }}\n animate={{ opacity: 1, y: 0 }}\n transition={spring.fast}\n className=\"inline-flex items-center gap-1.5\"\n >\n {plugins.map((plugin) =>\n plugin.ChipStatus ? (\n <PluginBoundary key={plugin.id} plugin={plugin.id}>\n <plugin.ChipStatus />\n </PluginBoundary>\n ) : null,\n )}\n </motion.span>\n ) : null}\n </TooltipTrigger>\n <TooltipContent side=\"top\" sideOffset={8} className={`${tooltipClass} flex-col items-start`}>\n <span className=\"flex items-center gap-2\">\n {collapsed ? \"Show the toolbar\" : \"Collapse the toolbar\"}\n <kbd className={kbdClass}>{collapseLabel()}</kbd>\n </span>\n <span className=\"flex items-center gap-2 text-fg-secondary\">\n Hide everything\n <kbd className={kbdClass}>{hideLabel()}</kbd>\n </span>\n </TooltipContent>\n </Tooltip>\n </motion.div>\n\n <motion.div\n data-react-grab-ignore\n data-dock=\"toolbar\"\n initial={false}\n // out of sight below the screen edge, home indicator included\n animate={{ y: collapsed ? \"calc(100% + 1rem + env(safe-area-inset-bottom))\" : 0 }}\n transition={collapsed ? spring.slow.exit : spring.slow}\n className=\"pointer-events-none fixed inset-x-0 bottom-[max(1rem,env(safe-area-inset-bottom))] z-[10000] mx-auto w-fit\"\n >\n <ToolbarStrip\n aria-label=\"Dev tools\"\n inert={collapsed}\n className=\"pointer-events-auto relative flex w-fit max-w-[calc(100vw-1rem)] items-center gap-1 max-sm:gap-0 overflow-x-auto overscroll-x-contain rounded-full bg-surface-glass p-1 text-xs text-fg shadow-float backdrop-blur-lg backdrop-saturate-150 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n >\n <Tooltip>\n <TooltipTrigger\n render={\n <ToolbarButton\n aria-label=\"Move dev tools\"\n onPointerDown={dock.startDrag}\n onKeyDown={dock.onKeyDown}\n onDoubleClick={dock.reset}\n />\n }\n className=\"inline-flex h-8 w-6 cursor-grab touch-none items-center max-sm:hidden justify-center rounded-full text-fg-icon select-none focus-visible:outline-2 focus-visible:outline-focus active:cursor-grabbing\"\n >\n <GripVerticalIcon className=\"size-4\" aria-hidden=\"true\" />\n </TooltipTrigger>\n <TooltipContent\n side=\"top\"\n sideOffset={8}\n className={tooltipClass}\n >\n Drag to move · Alt+arrows nudge · double-click to reset\n </TooltipContent>\n </Tooltip>\n\n {pinned.map((plugin, index) => (\n <PluginBoundary key={plugin.id} plugin={plugin.id}>\n <ItemMenu\n plugin={plugin}\n onOpen={() => run(plugin)}\n onUnpin={() => layout.setPinned(plugin.id, false)}\n >\n {plugin.Item ? (\n <plugin.Item />\n ) : (\n <DefaultItem\n plugin={plugin}\n api={api}\n open={layout.isOpen(plugin.id)}\n onToggle={() => layout.toggle(plugin.id)}\n />\n )}\n </ItemMenu>\n {index < pinned.length - 1 ? (\n <ToolbarSeparator className=\"h-4 w-px bg-pressed max-sm:mx-0.5\" />\n ) : null}\n </PluginBoundary>\n ))}\n\n <ToolbarSeparator className=\"mx-1 h-4 w-px bg-pressed max-sm:mx-0.5\" />\n\n <MoreMenu\n plugins={plugins}\n isPinned={layout.isPinned}\n mode={layout.mode}\n onMode={layout.setMode}\n onCollapse={toggleCollapsed}\n onHide={toggleHidden}\n onRun={run}\n onPin={layout.setPinned}\n onReset={layout.reset}\n />\n\n {plugins.map((plugin) =>\n plugin.Status ? (\n <PluginBoundary key={plugin.id} plugin={plugin.id}>\n <plugin.Status />\n </PluginBoundary>\n ) : null,\n )}\n </ToolbarStrip>\n </motion.div>\n </div>\n </div>\n </ToolbarPortal>\n </MotionConfig>\n </ToolbarContext.Provider>\n );\n}\n\nfunction collectDebugContext(plugins: readonly DevBeltPlugin[]): DebugEntry[] {\n const entries = plugins.flatMap((p) => {\n try {\n return p.debugContext?.() ?? [];\n } catch {\n return [];\n }\n });\n return entries.some((e) => e.label === \"Page\")\n ? entries\n : [{ label: \"Page\", value: window.location.href }, ...entries];\n}\n","\"use client\";\n\nimport { useState } from \"react\";\nimport { Toggle } from \"@ui-sdk/react/toggle\";\nimport { ToolbarButton } from \"@ui-sdk/react/toolbar\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@ui-sdk/react/tooltip\";\n\nimport type { DevBeltPlugin, ToolbarApi } from \"../../plugin-api\";\nimport { toolbarItemClass, tooltipClass } from \"../primitives/styles\";\nimport { MorphText } from \"../primitives/morph-text\";\n\nconst FLASH_MS = 1_500;\n\n/** The toolbar item a plugin gets when it doesn't draw its own. */\nexport function DefaultItem({\n plugin,\n open,\n onToggle,\n api,\n}: {\n plugin: DevBeltPlugin;\n open: boolean;\n onToggle: () => void;\n api: ToolbarApi;\n}) {\n const [flash, setFlash] = useState<string | null>(null);\n const label = plugin.label ?? plugin.name;\n const { Badge, Hint } = plugin;\n\n if (plugin.window) {\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <Toggle\n aria-label={label}\n data-devbelt-item={plugin.id}\n pressed={open}\n onPressedChange={onToggle}\n />\n }\n className={`${toolbarItemClass} data-pressed:bg-pressed`}\n >\n {plugin.icon}\n {Badge ? <Badge /> : null}\n </TooltipTrigger>\n <TooltipContent side=\"top\" sideOffset={8} className={tooltipClass}>\n {plugin.window.title ?? plugin.name}\n {Hint ? <Hint /> : null}\n </TooltipContent>\n </Tooltip>\n );\n }\n\n if (plugin.run) {\n const run = plugin.run;\n const onClick = async () => {\n let result: void | string;\n try {\n result = await run(api);\n } catch {\n result = \"Failed\";\n }\n if (typeof result === \"string\") {\n setFlash(result);\n window.setTimeout(() => setFlash(null), FLASH_MS);\n }\n };\n return (\n <Tooltip>\n <TooltipTrigger\n render={<ToolbarButton aria-label={label} onClick={onClick} />}\n className={toolbarItemClass}\n >\n {plugin.icon}\n {flash ? (\n <span>\n <MorphText>{flash}</MorphText>\n </span>\n ) : null}\n {Badge ? <Badge /> : null}\n </TooltipTrigger>\n <TooltipContent side=\"top\" sideOffset={8} className={tooltipClass}>\n {plugin.description ?? plugin.name}\n </TooltipContent>\n </Tooltip>\n );\n }\n\n return null;\n}\n","\"use client\";\n\nimport { bindDrag } from \"@ui-sdk/core\";\nimport { Button } from \"@ui-sdk/react/button\";\nimport { XIcon } from \"lucide-react\";\nimport { useEffect, useRef } from \"react\";\n\nimport type { WindowSize } from \"../../plugin-api\";\nimport { iconButtonClass } from \"../primitives/styles\";\nimport { clampRect, type Rect } from \"../toolbar/use-dev-layout\";\n\nconst DRAG_THRESHOLD = 4;\nconst STEP = 8;\nconst LARGE_STEP = 40;\n// above the viewport frame (9000), below Grab's picker and the dock\nconst BASE_Z = 9100;\n\ntype Edge = \"e\" | \"s\" | \"se\";\n\ntype Props = {\n id: string;\n size: WindowSize;\n title: string;\n icon: React.ReactNode;\n rect: Rect;\n // position in the stack, 0 is the back\n stack: number;\n onFocus: () => void;\n onClose: () => void;\n onRect: (rect: Rect) => void;\n children: React.ReactNode;\n};\n\n/**\n * A panel that floats over the page: drag it by its header, resize it from\n * the right edge, bottom edge or corner, click anywhere to bring it to the\n * front. Moves write CSS variables directly, so a drag costs no render.\n */\nexport function FloatingWindow({\n id,\n size,\n title,\n icon,\n rect,\n stack,\n onFocus,\n onClose,\n onRect,\n children,\n}: Props) {\n const ref = useRef<HTMLElement>(null);\n const current = useRef(rect);\n const stop = useRef<(() => void) | undefined>(undefined);\n\n useEffect(() => {\n current.current = rect;\n }, [rect]);\n useEffect(() => () => stop.current?.(), []);\n\n const paint = (next: Rect) => {\n const el = ref.current;\n if (!el) return;\n el.style.setProperty(\"--x\", `${next.x}px`);\n el.style.setProperty(\"--y\", `${next.y}px`);\n el.style.setProperty(\"--w\", `${next.width}px`);\n el.style.setProperty(\"--h\", `${next.height}px`);\n };\n\n const drag = (\n event: React.PointerEvent<HTMLElement>,\n to: (from: Rect, dx: number, dy: number) => Rect,\n ) => {\n if (event.button !== 0) return;\n stop.current?.();\n const from = current.current;\n const origin = { x: event.clientX, y: event.clientY };\n let latest = from;\n stop.current = bindDrag(event.currentTarget, event.nativeEvent, {\n threshold: DRAG_THRESHOLD,\n cancelOnEscape: true,\n onMove: ({ x, y }) => {\n latest = clampRect(size, to(from, x - origin.x, y - origin.y));\n paint(latest);\n },\n onEnd: (_event, canceled) => {\n if (canceled) paint(from);\n else onRect(latest);\n },\n });\n };\n\n const startMove = (event: React.PointerEvent<HTMLElement>) => {\n // buttons in the header are for pressing, not dragging, except the title,\n // which fills most of the header and is also the drag handle\n const button = (event.target as HTMLElement).closest(\"button\");\n if (button && !button.hasAttribute(\"data-drag-handle\")) return;\n drag(event, (from, dx, dy) => ({\n ...from,\n x: from.x + dx,\n y: from.y + dy,\n }));\n };\n\n const startResize =\n (edge: Edge) => (event: React.PointerEvent<HTMLElement>) =>\n drag(event, (from, dx, dy) => ({\n ...from,\n width: edge.includes(\"e\") ? from.width + dx : from.width,\n height: edge.includes(\"s\") ? from.height + dy : from.height,\n }));\n\n // Alt+arrows move the window, Alt+Shift+arrows move it further, and adding\n // Ctrl resizes it, so none of it needs a pointer.\n const onKeyDown = (event: React.KeyboardEvent) => {\n if (!event.altKey) return;\n const delta = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n }[event.key];\n if (!delta) return;\n event.preventDefault();\n event.stopPropagation();\n const step = event.shiftKey ? LARGE_STEP : STEP;\n const from = current.current;\n onRect(\n event.ctrlKey\n ? {\n ...from,\n width: from.width + delta.x * step,\n height: from.height + delta.y * step,\n }\n : { ...from, x: from.x + delta.x * step, y: from.y + delta.y * step },\n );\n };\n\n const { minWidth, minHeight } = size;\n\n return (\n <section\n ref={ref}\n aria-label={title}\n data-react-grab-ignore\n data-devbelt-window={id}\n onPointerDownCapture={onFocus}\n className=\"pointer-events-auto fixed top-(--y) left-(--x) flex h-(--h) w-(--w) flex-col overflow-hidden rounded-xl border border-line bg-surface text-xs text-fg shadow-2xl\"\n style={\n {\n \"--x\": `${rect.x}px`,\n \"--y\": `${rect.y}px`,\n \"--w\": `${rect.width}px`,\n \"--h\": `${rect.height}px`,\n // never wider or taller than the screen, whatever the plugin asks for: on a phone the\n // plugin's minimum would otherwise push the window off the edge\n minWidth: `min(${minWidth}px, calc(100vw - 1rem))`,\n minHeight: `min(${minHeight}px, calc(100vh - 1rem))`,\n zIndex: BASE_Z + stack,\n } as React.CSSProperties\n }\n >\n <header\n onPointerDown={startMove}\n className=\"flex shrink-0 cursor-grab touch-none items-center gap-2 border-b border-line bg-surface-header px-2 py-1.5 select-none active:cursor-grabbing\"\n >\n <span className=\"text-fg-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n {/* The whole header drags the window. The title is also a button, so the keyboard can move it. */}\n <h2 className=\"min-w-0 flex-1 text-xs font-semibold\">\n <Button\n aria-label={`Move ${title}`}\n data-drag-handle=\"\"\n title=\"Drag the header to move · Alt+arrows nudge · add Ctrl to resize\"\n onKeyDown={onKeyDown}\n className=\"block w-full cursor-grab truncate rounded-md px-1 py-0.5 text-start focus-visible:outline-2 focus-visible:outline-focus active:cursor-grabbing\"\n >\n {title}\n </Button>\n </h2>\n <Button\n aria-label={`Close ${title}`}\n onClick={onClose}\n className={`${iconButtonClass} relative after:absolute after:-inset-1 size-6`}\n >\n <XIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </Button>\n </header>\n <div className=\"flex min-h-0 flex-1 flex-col\">{children}</div>\n {/* Resize handles. Hovering (or dragging) one thickens that edge, so you can see what you grab. */}\n <div\n aria-hidden=\"true\"\n onPointerDown={startResize(\"e\")}\n className=\"group absolute inset-y-0 right-0 w-3 cursor-ew-resize touch-none\"\n >\n <span className=\"pointer-events-none absolute inset-y-3 right-0 w-[3px] rounded-full bg-accent opacity-0 transition-opacity duration-75 group-hover:opacity-100 group-active:opacity-100\" />\n </div>\n <div\n aria-hidden=\"true\"\n onPointerDown={startResize(\"s\")}\n className=\"group absolute inset-x-0 bottom-0 h-3 cursor-ns-resize touch-none\"\n >\n <span className=\"pointer-events-none absolute inset-x-3 bottom-0 h-[3px] rounded-full bg-accent opacity-0 transition-opacity duration-75 group-hover:opacity-100 group-active:opacity-100\" />\n </div>\n <div\n aria-hidden=\"true\"\n onPointerDown={startResize(\"se\")}\n className=\"group absolute right-0 bottom-0 size-8 cursor-nwse-resize touch-none\"\n >\n {/* the corner arc follows the window's own rounded corner */}\n <span className=\"pointer-events-none absolute right-0 bottom-0 size-4 rounded-br-xl border-r-[3px] border-b-[3px] border-accent opacity-0 transition-opacity duration-75 group-hover:opacity-100 group-active:opacity-100\" />\n </div>\n </section>\n );\n}\n","\"use client\";\n\nimport { useState } from \"react\";\n\nimport { readJson, writeJson } from \"../../core/storage\";\nimport type { DevBeltPlugin, WindowSize } from \"../../plugin-api\";\n\nexport type Rect = { x: number; y: number; width: number; height: number };\n\n/** How a plugin's panel opens: a floating window, or a popover on its toolbar item. */\nexport type PanelMode = \"window\" | \"popover\";\n\nexport type DevLayout = {\n // plugin id -> pinned or not, only where it differs from the plugin's default\n pinned: Record<string, boolean>;\n // plugin ids; last is in front. A popover shows one at a time.\n open: string[];\n rects: Record<string, Rect>;\n // the person's choice; absent until they make one, so the app's default applies\n mode?: PanelMode;\n};\n\nconst isPanelMode = (value: unknown): value is PanelMode =>\n value === \"window\" || value === \"popover\";\n\nconst STORAGE_KEY = \"layout\";\nconst MARGIN = 8;\n// how much of a window must stay on screen so it can always be grabbed\nconst KEEP_VISIBLE = 96;\nconst CASCADE = 28;\n\nconst DEFAULT_LAYOUT: DevLayout = { pinned: {}, open: [], rects: {} };\n\nfunction isRect(value: unknown): value is Rect {\n const r = value as Rect | null;\n return (\n !!r &&\n [r.x, r.y, r.width, r.height].every(\n (n) => typeof n === \"number\" && Number.isFinite(n),\n )\n );\n}\n\nfunction read(windows: ReadonlySet<string>): DevLayout {\n const parsed = readJson<Partial<DevLayout> | null>(STORAGE_KEY, null);\n if (!parsed || typeof parsed !== \"object\") return DEFAULT_LAYOUT;\n const rects: DevLayout[\"rects\"] = {};\n for (const [id, rect] of Object.entries(parsed.rects ?? {})) {\n if (windows.has(id) && isRect(rect)) rects[id] = rect;\n }\n const pinned: DevLayout[\"pinned\"] = {};\n for (const [id, value] of Object.entries(parsed.pinned ?? {})) {\n if (typeof value === \"boolean\") pinned[id] = value;\n }\n return {\n pinned,\n open: Array.isArray(parsed.open)\n ? parsed.open.filter((id): id is string => windows.has(id as string))\n : [],\n rects,\n ...(isPanelMode(parsed.mode) ? { mode: parsed.mode } : {}),\n };\n}\n\nexport function clampRect(size: WindowSize, rect: Rect): Rect {\n const { minWidth, minHeight } = size;\n const width = Math.min(\n Math.max(rect.width, minWidth),\n window.innerWidth - MARGIN * 2,\n );\n const height = Math.min(\n Math.max(rect.height, minHeight),\n window.innerHeight - MARGIN * 2,\n );\n return {\n width,\n height,\n x: Math.min(\n Math.max(rect.x, KEEP_VISIBLE - width),\n window.innerWidth - KEEP_VISIBLE,\n ),\n y: Math.min(Math.max(rect.y, 0), window.innerHeight - 40),\n };\n}\n\n// New windows open near the middle, each a little lower and further right\n// than the last so a stack of them stays readable.\nexport function defaultRect(size: WindowSize, index: number): Rect {\n const width = Math.min(size.width, window.innerWidth - MARGIN * 2);\n const height = Math.min(size.height, window.innerHeight - 120);\n return clampRect(size, {\n width,\n height,\n x: (window.innerWidth - width) / 2 + index * CASCADE,\n y: Math.max(\n MARGIN,\n (window.innerHeight - height) / 2 - 40 + index * CASCADE,\n ),\n });\n}\n\nexport function useDevLayout(\n plugins: readonly DevBeltPlugin[],\n defaultMode: PanelMode = \"window\",\n) {\n const sizes = new Map<string, WindowSize>();\n for (const plugin of plugins) {\n if (plugin.window) sizes.set(plugin.id, plugin.window.size);\n }\n const [layout, setLayout] = useState<DevLayout>(() =>\n read(new Set(sizes.keys())),\n );\n\n const update = (change: (current: DevLayout) => DevLayout) =>\n setLayout((current) => {\n const next = change(current);\n writeJson(STORAGE_KEY, next);\n return next;\n });\n\n const sizeOf = (id: string) => sizes.get(id);\n\n const open = (id: string) => {\n const size = sizeOf(id);\n if (!size) return;\n update((current) => {\n // a popover has no position of its own and shows one tool at a time\n if ((current.mode ?? defaultMode) === \"popover\") {\n return { ...current, open: [id] };\n }\n return {\n ...current,\n open: [...current.open.filter((w) => w !== id), id],\n rects: current.rects[id]\n ? current.rects\n : { ...current.rects, [id]: defaultRect(size, current.open.length) },\n };\n });\n };\n\n const close = (id: string) =>\n update((current) => ({\n ...current,\n open: current.open.filter((w) => w !== id),\n }));\n\n return {\n layout,\n mode: layout.mode ?? defaultMode,\n setMode: (mode: PanelMode) =>\n update((current) => ({\n ...current,\n mode,\n // switching to a popover keeps only the tool in front\n open: mode === \"popover\" ? current.open.slice(-1) : current.open,\n })),\n isOpen: (id: string) => layout.open.includes(id),\n isPinned: (plugin: DevBeltPlugin) =>\n layout.pinned[plugin.id] ?? plugin.pinned ?? true,\n open,\n close,\n toggle: (id: string) => (layout.open.includes(id) ? close(id) : open(id)),\n focus: (id: string) =>\n update((current) =>\n current.open[current.open.length - 1] === id\n ? current\n : { ...current, open: [...current.open.filter((w) => w !== id), id] },\n ),\n setRect: (id: string, rect: Rect) => {\n const size = sizeOf(id);\n if (!size) return;\n update((current) => ({\n ...current,\n rects: { ...current.rects, [id]: clampRect(size, rect) },\n }));\n },\n setPinned: (id: string, pinned: boolean) =>\n update((current) => ({\n ...current,\n pinned: { ...current.pinned, [id]: pinned },\n })),\n reset: () => update(() => DEFAULT_LAYOUT),\n };\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n Menu,\n MenuContent,\n MenuContextTrigger,\n MenuGroup,\n MenuGroupLabel,\n MenuItem,\n MenuSeparator,\n} from \"@ui-sdk/react/menu\";\n\nimport { PinOffIcon, PlayIcon, SquareArrowOutUpRightIcon } from \"lucide-react\";\n\nimport type { DevBeltPlugin } from \"../../plugin-api\";\nimport { MenuHighlight } from \"./menu-highlight\";\nimport {\n menuContentClass,\n menuIconClass,\n menuItemClass,\n menuLabelClass,\n menuSeparatorClass,\n} from \"./more-menu\";\n\ntype Props = {\n plugin: DevBeltPlugin;\n /** Opens the plugin's window, or runs its action. */\n onOpen: () => void;\n onUnpin: () => void;\n children: ReactNode;\n};\n\n/**\n * Right-click (or long-press, or Shift+F10) on a pinned tool: the tool's own\n * More tools section, if it has one, and the basics. The browser's own menu\n * is left alone everywhere else on the toolbar.\n */\nexport function ItemMenu({ plugin, onOpen, onUnpin, children }: Props) {\n const Section = plugin.MenuSection;\n return (\n <Menu>\n <MenuContextTrigger\n aria-label={`${plugin.name} options`}\n render={<span className=\"contents\" />}\n >\n {children}\n </MenuContextTrigger>\n <MenuContent\n aria-label={`${plugin.name} options`}\n data-react-grab-ignore\n className={menuContentClass}\n >\n <MenuHighlight />\n <MenuGroup>\n <MenuGroupLabel className={`${menuLabelClass} flex items-center gap-1.5`}>\n <span className=\"inline-flex shrink-0 [&_svg]:size-3\" aria-hidden=\"true\">\n {plugin.icon}\n </span>\n {plugin.name}\n </MenuGroupLabel>\n {plugin.window || plugin.run ? (\n <MenuItem value=\"open\" className={menuItemClass} onSelect={onOpen}>\n {plugin.window ? (\n <SquareArrowOutUpRightIcon className={menuIconClass} aria-hidden=\"true\" />\n ) : (\n <PlayIcon className={menuIconClass} aria-hidden=\"true\" />\n )}\n {plugin.window ? \"Open\" : \"Run\"}\n </MenuItem>\n ) : null}\n </MenuGroup>\n {Section ? (\n <>\n <MenuSeparator className={menuSeparatorClass} />\n <Section />\n </>\n ) : null}\n <MenuSeparator className={menuSeparatorClass} />\n <MenuItem value=\"unpin\" className={menuItemClass} onSelect={onUnpin}>\n <PinOffIcon className={menuIconClass} aria-hidden=\"true\" />\n Unpin from toolbar\n </MenuItem>\n </MenuContent>\n </Menu>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Toolbar } from \"@ui-sdk/react/toolbar\";\n\nimport { FluidHoverHighlight } from \"../vendor/fluid-functionalism/fluid-hover-highlight\";\nimport { useFluidHover } from \"../vendor/fluid-functionalism/use-fluid-hover\";\n\n/**\n * The toolbar, with one hover highlight for all its buttons that glides from one\n * to the next (Fluid Functionalism's fluid hover). Plugins draw their own items, so\n * instead of each registering itself, the strip registers every enabled button inside\n * it, in DOM order, and follows the toolbar as items come and go.\n */\nexport function ToolbarStrip({\n children,\n ...props\n}: Omit<ComponentProps<typeof Toolbar>, \"children\"> & { children: ReactNode }) {\n const ref = useRef<HTMLDivElement>(null);\n const hover = useFluidHover(ref, { axis: \"x\", gapClick: false });\n const { registerItem } = hover;\n\n useEffect(() => {\n const strip = ref.current;\n if (!strip) return;\n let known: HTMLElement[] = [];\n const sync = () => {\n const buttons = Array.from(\n strip.querySelectorAll<HTMLElement>(\"button:not([disabled])\"),\n );\n // only what changed, so a text morph's churn doesn't make the hook re-measure\n buttons.forEach((button, index) => {\n if (known[index] !== button) registerItem(index, button);\n });\n for (let index = buttons.length; index < known.length; index++) {\n registerItem(index, null);\n }\n known = buttons;\n };\n sync();\n const observer = new MutationObserver(sync);\n observer.observe(strip, { childList: true, subtree: true });\n return () => {\n observer.disconnect();\n known.forEach((_, index) => registerItem(index, null));\n };\n }, [registerItem]);\n\n return (\n <Toolbar ref={ref} {...hover.handlers} {...props}>\n <FluidHoverHighlight hover={hover} className=\"z-0 rounded-full\" />\n {children}\n </Toolbar>\n );\n}\n","// Fluid hover, from Fluid Functionalism (https://www.fluidfunctionalism.com), the `use-fluid-hover`\n// item of its registry, copied as it ships: one highlight per list that springs from item to item.\n// See fluid-hover-highlight.tsx for the fill it drives.\n\"use client\";\n\nimport {\n useRef,\n useState,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useSyncExternalStore,\n type Dispatch,\n type RefObject,\n type SetStateAction,\n} from \"react\";\n\nexport interface ItemRect {\n top: number;\n height: number;\n left: number;\n width: number;\n}\n\nexport interface UseFluidHoverOptions {\n /**\n * With `nearest`, which direction to resolve the nearest item along.\n * \"y\" — vertical lists (default): closest by top/height\n * \"x\" — horizontal strips: closest by left/width\n * \"xy\" — 2-D grids: closest card across both rows AND columns,\n * measured by Euclidean distance to each item's center\n */\n axis?: \"x\" | \"y\" | \"xy\";\n /**\n * Makes an item invisible to hit-testing without unregistering it — for\n * rows that stay mounted while clipped away (a collapsed sub-tree).\n * Unregistering would invalidate every measurement; a skipped item keeps\n * the set stable. Consulted per mouse move, so keep it cheap.\n */\n isItemDisabled?: (element: HTMLElement) => boolean;\n /**\n * With `nearest`, whether a click that lands between items (a gap, the\n * padding, past the last row) is routed to the highlighted item, so what\n * is lit is what a click hits. On by default: in a menu or a list the\n * highlight is a promise about the click. Without `nearest` nothing is lit\n * between items but across the seam between two rows (a few px), and only\n * a click there is routed. Pass `false` where empty\n * space should stay\n * inert (rows with destructive actions, generous whitespace), or\n * `{ maxDistance }` to route only clicks within that many pixels of the\n * highlighted item's edge.\n */\n gapClick?: boolean | { maxDistance?: number };\n /**\n * Whether empty space lights the nearest item. Off by default: only the\n * item under the pointer lights, and the highlight fades out over empty\n * space (a popup's padding, the unfilled end of a grid row, a label beside\n * a control), gliding again from the next item it lands on. Pass `true` to\n * light the item nearest the pointer wherever it is in the container.\n */\n nearest?: boolean;\n /**\n * Whether the highlight goes to the item under the pointer when the items\n * scroll under a pointer at rest. Off by default: in a menu or a list box\n * the highlight is also where focus is, and moving one without the other\n * would light an item that Enter doesn't pick. For lists whose highlight\n * is hover only (a table's rows).\n */\n followScroll?: boolean;\n}\n\n/**\n * The highlighted index as a store a row can subscribe to. Read it with\n * `useFluidHoverSelect` instead of passing `activeIndex` down a context: a\n * context re-renders every row on every highlight change, a selector\n * re-renders the row the highlight left and the row it reached.\n */\nexport interface FluidHoverActiveStore {\n subscribe: (listener: () => void) => () => void;\n get: () => number | null;\n}\n\nexport interface UseFluidHoverReturn {\n activeIndex: number | null;\n setActiveIndex: Dispatch<SetStateAction<number | null>>;\n /** `activeIndex` as a stable store, for rows (see `useFluidHoverSelect`). */\n activeStore: FluidHoverActiveStore;\n itemRects: ItemRect[];\n /**\n * True once every registered item has been measured and no remeasure is\n * pending, i.e. `itemRects` describes the current item set. Gate absolutely\n * positioned overlays on it: an overlay that mounts against a rect a later\n * pass still corrects animates from the wrong place to the right one, which\n * reads as the highlight sliding in from another row.\n */\n isMeasured: boolean;\n /**\n * Counts pointer entries. It steps when the pointer, having entered the\n * container, first moves the highlight, so the highlight keyed on it fades\n * in at the new row instead of sliding over from where it was last (a row\n * lit from the keyboard, or one still fading out).\n */\n session: number;\n /** The same count as `session`, for code that reads it outside a render. */\n sessionRef: RefObject<number>;\n handlers: {\n /** Picks the item nearest the pointer. Moves that happened in a\n * portalled child (a row's own dropdown) are ignored. */\n onMouseMove: (e: React.MouseEvent) => void;\n onMouseEnter: () => void;\n onMouseLeave: () => void;\n /**\n * Routes a click that lands between items (a gap, the padding, past the\n * last row) to the highlighted item, so the highlight and the click agree:\n * what is lit is what a click hits. A click inside an item is left to the\n * item, and so is one on a control between items (a search field) or\n * from a portalled child (a row's own dropdown): it never landed between\n * these items. Disabled items (`isItemDisabled`) are never activated.\n */\n onClick: (e: React.MouseEvent) => void;\n };\n registerItem: (index: number, element: HTMLElement | null) => void;\n /**\n * Invalidates the published rects and runs the hook's coalesced measurement\n * pass again, holding `isMeasured` false until it settles. Reach for it when\n * the rects may be wrong and showing an overlay against them would misplace\n * it: a popup that stays mounted between opens keeps its items registered,\n * so nothing else would notice that its rects were taken while it was\n * hidden. Registration, item resize, and container resize already trigger\n * a pass; do not call this on `children` changes.\n */\n remeasure: () => void;\n /**\n * Re-reads the rects synchronously, keeping `isMeasured` as it is. Only for\n * layout that moves the rows under a visible overlay frame by frame (the\n * accordion re-measures inside its height animation). Everything else\n * wants `remeasure`, or nothing.\n */\n measureItems: () => void;\n}\n\nexport interface PickNearestInput {\n axis: \"x\" | \"y\" | \"xy\";\n /** The pointer, in viewport coordinates. */\n point: { x: number; y: number };\n /** Item rects in the container's layout space (sparse: unregistered slots\n * are undefined). */\n rects: readonly (ItemRect | undefined)[];\n /** The container's bounding rect and live scroll / border offsets, which\n * map layout rects into the pointer's viewport space. */\n containerRect: { left: number; top: number; width: number; height: number };\n scroll: { x: number; y: number };\n border: { x: number; y: number };\n /** Layout size of the container, so a cumulative ancestor `transform:\n * scale` (a popup mid scale-in) can be factored out per axis. */\n layoutSize: { width: number; height: number };\n /** Skips an item without unregistering it. */\n isDisabled?: (index: number) => boolean;\n}\n\n/**\n * The rule, as one pure function: an item the pointer is inside wins;\n * otherwise the item whose center is nearest does, so a pointer in a gap, in\n * the padding, or past the last row still lands. `y` and `x` measure one\n * coordinate; `xy` measures the straight line to each center. Ties keep the\n * first item. The hook calls this once per animation frame; the docs page\n * times it.\n */\nexport function pickNearest({\n axis,\n point,\n rects,\n containerRect,\n scroll,\n border,\n layoutSize,\n isDisabled,\n}: PickNearestInput): number | null {\n const scaleX = layoutSize.width > 0 ? containerRect.width / layoutSize.width : 1;\n const scaleY = layoutSize.height > 0 ? containerRect.height / layoutSize.height : 1;\n let closestIndex: number | null = null;\n let closestDistance = Infinity;\n let containingIndex: number | null = null;\n\n for (let index = 0; index < rects.length; index++) {\n const r = rects[index];\n if (!r) continue;\n if (isDisabled?.(index)) continue;\n\n if (axis === \"xy\") {\n const left = containerRect.left + (border.x + r.left - scroll.x) * scaleX;\n const top = containerRect.top + (border.y + r.top - scroll.y) * scaleY;\n const width = r.width * scaleX;\n const height = r.height * scaleY;\n if (\n point.x >= left &&\n point.x <= left + width &&\n point.y >= top &&\n point.y <= top + height\n ) {\n containingIndex = index;\n }\n const distance = Math.hypot(point.x - (left + width / 2), point.y - (top + height / 2));\n if (distance < closestDistance) {\n closestDistance = distance;\n closestIndex = index;\n }\n continue;\n }\n\n const horizontal = axis === \"x\";\n const mousePos = horizontal ? point.x : point.y;\n const scale = horizontal ? scaleX : scaleY;\n const itemStart =\n (horizontal ? containerRect.left : containerRect.top) +\n ((horizontal ? border.x : border.y) +\n (horizontal ? r.left : r.top) -\n (horizontal ? scroll.x : scroll.y)) *\n scale;\n const itemSize = (horizontal ? r.width : r.height) * scale;\n if (mousePos >= itemStart && mousePos <= itemStart + itemSize) {\n containingIndex = index;\n }\n const distance = Math.abs(mousePos - (itemStart + itemSize / 2));\n if (distance < closestDistance) {\n closestDistance = distance;\n closestIndex = index;\n }\n }\n\n return containingIndex ?? closestIndex;\n}\n\n/**\n * Whether an event happened inside the element whose handler hears it.\n * React bubbles events from portalled children (a dropdown opened from a\n * row, a submenu, a tooltip) through their React ancestors, so a list's\n * handlers also hear moves, clicks and focus changes that happened in\n * another layer. The hook's own move and click handlers skip those; a\n * consumer with handlers of its own (focus, keys) can call this too. A bare\n * point with no target (a caller re-picking at a remembered position)\n * counts as the list's own.\n */\nexport function isOwnEvent(e: { currentTarget?: EventTarget | null; target?: EventTarget | null }) {\n const { currentTarget, target } = e;\n if (!(currentTarget instanceof Node) || !(target instanceof Node)) return true;\n return currentTarget.contains(target);\n}\n\n/** Set on the highlighted item (boolean attribute). */\nexport const ACTIVE_ATTR = \"data-fluid-hover-active\";\n/** Set on the container: the highlighted index, or absent. */\nexport const ACTIVE_INDEX_ATTR = \"data-fluid-hover-active-index\";\n\nconst ACTIVATOR_SELECTOR =\n \"a[href], button, [role='menuitem'], [role='menuitemradio'], [role='menuitemcheckbox'], [role='option'], [role='radio'], [role='checkbox'], [role='tab'], [role='link'], [role='button']\";\n\n/**\n * The element a routed click should land on. A registered item is usually\n * the interactive row itself; when it is only a box around one (a sidebar\n * row around its button, a card around its link), the first control inside\n * is what a real click on the row would have reached.\n */\nfunction resolveActivator(element: HTMLElement): HTMLElement {\n if (element.matches(ACTIVATOR_SELECTOR) || element.hasAttribute(\"tabindex\")) {\n return element;\n }\n return element.querySelector<HTMLElement>(ACTIVATOR_SELECTOR) ?? element;\n}\n\nconst useIsoLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n/**\n * How many frames the coalesced remeasure retries while the registered items\n * still have no layout box. A popup can be in the DOM one frame before it is\n * laid out; retrying beats publishing zeroed rects, and the cap keeps a list\n * that stays hidden for good from spinning frames forever.\n */\nconst measurementAttempts = 3;\n\n// Rows in a list sit a hairline apart (2px). A pointer crossing that seam\n// is still between two items, not in empty space: the item it just left\n// stays lit, so the highlight glides on instead of fading out and back, and\n// a click there goes to it.\nconst SEAM = 4;\n\nfunction distanceToRect(r: DOMRect, point: { x: number; y: number }) {\n const dx = Math.max(r.left - point.x, 0, point.x - r.right);\n const dy = Math.max(r.top - point.y, 0, point.y - r.bottom);\n return Math.hypot(dx, dy);\n}\n\nexport function useFluidHover<T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n options: UseFluidHoverOptions = {}\n): UseFluidHoverReturn {\n const { axis = \"y\", isItemDisabled, gapClick = true, nearest = false, followScroll = false } = options;\n const gapClickMaxDistance =\n typeof gapClick === \"object\" ? (gapClick.maxDistance ?? Infinity) : Infinity;\n const itemsRef = useRef(new Map<number, HTMLElement>());\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n // Mirrored for handlers that read it outside a render (the gap click, a\n // row registering). Written in a layout effect, which runs before any\n // row's registration effect in the same commit.\n const activeIndexRef = useRef<number | null>(null);\n const listenersRef = useRef(new Set<() => void>());\n const activeStore = useMemo<FluidHoverActiveStore>(\n () => ({\n subscribe: (listener) => {\n listenersRef.current.add(listener);\n return () => {\n listenersRef.current.delete(listener);\n };\n },\n get: () => activeIndexRef.current,\n }),\n []\n );\n useIsoLayoutEffect(() => {\n activeIndexRef.current = activeIndex;\n // The store lags `activeIndex` by this one effect, so a row rendering\n // alongside the change reads the old value; subscribed rows re-render\n // with the new one in this same commit, before paint.\n listenersRef.current.forEach((listener) => listener());\n }, [activeIndex]);\n\n // The state, in the DOM: `data-fluid-hover-active` on the highlighted item\n // and `data-fluid-hover-active-index` on the container. Devtools shows it\n // and a test asserts on it without waiting for a frame. React does not\n // manage these attributes, so it never clobbers them.\n useEffect(() => {\n const container = containerRef.current;\n // The registry map itself, which is never replaced: the cleanup reads\n // who holds the index by then, not who held it now.\n const items = itemsRef.current;\n if (activeIndex === null) container?.removeAttribute(ACTIVE_INDEX_ATTR);\n else container?.setAttribute(ACTIVE_INDEX_ATTR, String(activeIndex));\n const active = activeIndex === null ? undefined : items.get(activeIndex);\n active?.setAttribute(ACTIVE_ATTR, \"\");\n return () => {\n active?.removeAttribute(ACTIVE_ATTR);\n // A row that re-registered under this index while it was highlighted\n // (a remount under a new key) was marked by registerItem, not by this\n // effect: drop the mark from whatever element holds the index now.\n if (activeIndex !== null) items.get(activeIndex)?.removeAttribute(ACTIVE_ATTR);\n };\n }, [activeIndex, containerRef]);\n const [itemRects, setItemRects] = useState<ItemRect[]>([]);\n const [isMeasured, setIsMeasured] = useState(false);\n const itemRectsRef = useRef<ItemRect[]>([]);\n const [session, setSession] = useState(0);\n const sessionRef = useRef(0);\n // Set when the pointer enters; the pointer's first change of highlight\n // starts the new session, in the same update as the change itself.\n const sessionPendingRef = useRef(false);\n const rafIdRef = useRef<number | null>(null);\n const remeasureRafIdRef = useRef<number | null>(null);\n\n /**\n * Publishes a rect for every registered item. Returns false when the\n * measurement could not be completed (no container, or an item without a\n * layout box) — nothing is published in that case, so the last complete\n * measurement stands instead of being overwritten with zeroes.\n */\n const runMeasurement = useCallback(() => {\n const container = containerRef.current;\n if (!container) return false;\n const rects: ItemRect[] = [];\n let everyItemHasLayout = true;\n itemsRef.current.forEach((element, index) => {\n // An element inside a display:none / not-yet-laid-out popup has no\n // offsetParent and reports every offset as 0. Publishing that would pin\n // overlays to the top of the list, so treat the whole pass as\n // incomplete. A boxless element is the only case: `position: fixed`\n // items also have no offsetParent but do have a size.\n const hasLayoutBox =\n element.offsetParent !== null ||\n element.offsetWidth > 0 ||\n element.offsetHeight > 0;\n if (!hasLayoutBox) {\n everyItemHasLayout = false;\n return;\n }\n // Use offset* instead of getBoundingClientRect so measurements are\n // unaffected by CSS transforms (e.g. scaleY animation on the parent\n // motion.div). offsetTop/offsetLeft are layout values relative to the\n // offsetParent (the scroll container), matching the coordinate space\n // used by `position: absolute` children. Items nested inside positioned\n // descendants of the container (a sidebar sub-menu's rows live inside a\n // positioned row) accumulate those ancestors' offsets, so every rect\n // lands in the container's own coordinate space; for a flat list the\n // loop never runs and this is exactly the plain offsetTop/offsetLeft.\n let top = element.offsetTop;\n let left = element.offsetLeft;\n let ancestor = element.offsetParent as HTMLElement | null;\n while (ancestor && ancestor !== container && container.contains(ancestor)) {\n top += ancestor.offsetTop + ancestor.clientTop;\n left += ancestor.offsetLeft + ancestor.clientLeft;\n ancestor = ancestor.offsetParent as HTMLElement | null;\n }\n rects[index] = {\n top,\n height: element.offsetHeight,\n left,\n width: element.offsetWidth,\n };\n });\n if (!everyItemHasLayout) return false;\n // Skip the state update when nothing moved (a cheap top/left/width/height\n // compare) so redundant remeasures don't churn re-renders.\n const prev = itemRectsRef.current;\n let changed = prev.length !== rects.length;\n for (let i = 0; !changed && i < rects.length; i++) {\n const p = prev[i];\n const r = rects[i];\n if (p === r) continue; // both undefined (sparse slot)\n changed =\n !p ||\n !r ||\n p.top !== r.top ||\n p.left !== r.left ||\n p.width !== r.width ||\n p.height !== r.height;\n }\n if (changed) {\n itemRectsRef.current = rects;\n setItemRects(rects);\n }\n return true;\n }, [containerRef]);\n\n const measureItems = useCallback(() => {\n runMeasurement();\n }, [runMeasurement]);\n\n /**\n * The hook's single measurement pass: coalesces every trigger (item\n * registration, container resize) into one remeasure on the next frame and\n * is the only place readiness is reported, so `isMeasured` can never turn\n * true while another pass is still queued.\n */\n const scheduleMeasurement = useCallback(\n (attempts: number) => {\n const attempt = (attemptsLeft: number) => {\n if (remeasureRafIdRef.current !== null) {\n cancelAnimationFrame(remeasureRafIdRef.current);\n }\n remeasureRafIdRef.current = requestAnimationFrame(() => {\n remeasureRafIdRef.current = null;\n if (runMeasurement()) {\n setIsMeasured(true);\n } else if (attemptsLeft > 1) {\n attempt(attemptsLeft - 1);\n }\n });\n };\n attempt(attempts);\n },\n [runMeasurement]\n );\n\n const remeasure = useCallback(() => {\n // Readiness drops first: until the pass below settles, the published rects\n // may not describe what is on screen, and an overlay positioned from them\n // would be corrected after mounting — which animates as a slide.\n setIsMeasured(false);\n scheduleMeasurement(measurementAttempts);\n }, [scheduleMeasurement]);\n\n // Observes the registered items themselves (not just the container): rows\n // that change size in place — e.g. the site-wide size step flipping while a\n // selection background is up — must invalidate the published rects even when\n // the container the effect below captured has since been remounted and the\n // ref points at a different element than the one being observed.\n const itemRoRef = useRef<ResizeObserver | null>(null);\n const getItemRo = useCallback(() => {\n if (itemRoRef.current === null && typeof ResizeObserver !== \"undefined\") {\n itemRoRef.current = new ResizeObserver(() =>\n scheduleMeasurement(measurementAttempts)\n );\n }\n return itemRoRef.current;\n }, [scheduleMeasurement]);\n\n const registerItem = useCallback(\n (index: number, element: HTMLElement | null) => {\n if (element) {\n itemsRef.current.set(index, element);\n getItemRo()?.observe(element);\n if (index === activeIndexRef.current) element.setAttribute(ACTIVE_ATTR, \"\");\n } else {\n const previous = itemsRef.current.get(index);\n if (previous) itemRoRef.current?.unobserve(previous);\n // The mark leaves with the element: a row that only moved to another\n // index (a filtering list re-ordering) must not carry it there.\n previous?.removeAttribute(ACTIVE_ATTR);\n itemsRef.current.delete(index);\n // The highlighted row is gone: nothing should stay lit or receive a\n // routed click until the pointer picks again. Decided when the\n // update applies, after this commit's registrations, so a row that\n // only moved index hands the highlight to the row now under it.\n if (index === activeIndexRef.current) {\n setActiveIndex((current) =>\n current === index && !itemsRef.current.has(index) ? null : current\n );\n }\n }\n // Coalesce rapid register/unregister calls (e.g. when an AnimatePresence\n // remounts a list of rows) into a single remeasure on the next frame,\n // so consumers don't have to manually call measureItems after the\n // container's children swap.\n remeasure();\n },\n [remeasure, getItemRo]\n );\n\n // The lit item, when the point sits in the seam between it and another\n // item: within SEAM of both, inside neither.\n const seamHold = useCallback(\n (point: { x: number; y: number }): number | null => {\n const active = activeIndexRef.current;\n if (active === null) return null;\n const activeEl = itemsRef.current.get(active);\n if (!activeEl || isItemDisabled?.(activeEl)) return null;\n const activeRect = activeEl.getBoundingClientRect();\n const d = distanceToRect(activeRect, point);\n if (d === 0 || d > SEAM) return null;\n for (const [index, el] of itemsRef.current) {\n if (index === active || el.contains(activeEl) || activeEl.contains(el)) continue;\n if (isItemDisabled?.(el)) continue;\n const r = el.getBoundingClientRect();\n if (distanceToRect(r, point) > 0 && distanceToRect(r, point) <= SEAM) return active;\n }\n return null;\n },\n [isItemDisabled]\n );\n\n // The item at a point: the one under it, or with `nearest` the closest.\n const itemAt = useCallback(\n (container: HTMLElement, point: { x: number; y: number }, target: Node): number | null => {\n if (nearest)\n return pickNearest({\n axis,\n point,\n rects: itemRectsRef.current,\n containerRect: container.getBoundingClientRect(),\n scroll: { x: container.scrollLeft, y: container.scrollTop },\n border: { x: container.clientLeft, y: container.clientTop },\n layoutSize: { width: container.offsetWidth, height: container.offsetHeight },\n isDisabled: isItemDisabled\n ? (index) => {\n const el = itemsRef.current.get(index);\n return !!el && isItemDisabled(el);\n }\n : undefined,\n });\n // The item under the pointer, or none. Items can nest (a sidebar\n // row's sub-rows sit inside it): the innermost one holding the\n // pointer wins.\n let next: number | null = null;\n let hit: HTMLElement | null = null;\n for (const [index, el] of itemsRef.current) {\n if (!el.contains(target) || isItemDisabled?.(el)) continue;\n if (!hit || hit.contains(el)) {\n hit = el;\n next = index;\n }\n }\n // In the seam between the lit item and its neighbour (or in a parent\n // row around sub-rows a seam apart), the lit item holds.\n const held = seamHold(point);\n if (held !== null && held !== next) {\n const heldEl = itemsRef.current.get(held);\n if (!hit || (heldEl && hit.contains(heldEl))) return held;\n }\n return next;\n },\n [axis, isItemDisabled, nearest, seamHold]\n );\n\n // Where the pointer last moved inside the container, while the highlight\n // is the pointer's: gone once it leaves, or once the highlight is set\n // from outside (the keyboard, focus), until the pointer moves again.\n const pointRef = useRef<{ x: number; y: number } | null>(null);\n\n const handleMouseMove = useCallback(\n (e: React.MouseEvent) => {\n if (!isOwnEvent(e)) return;\n const mouseX = e.clientX;\n const mouseY = e.clientY;\n const target = e.target as Node;\n pointRef.current = { x: mouseX, y: mouseY };\n\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n }\n\n rafIdRef.current = requestAnimationFrame(() => {\n rafIdRef.current = null;\n const container = containerRef.current;\n if (!container) return;\n const next = itemAt(container, { x: mouseX, y: mouseY }, target);\n if (sessionPendingRef.current && next !== activeIndexRef.current) {\n sessionPendingRef.current = false;\n sessionRef.current += 1;\n setSession(sessionRef.current);\n } else if (next !== null && next === activeIndexRef.current) {\n // Entered onto the item already lit (by the keyboard, or a list\n // that lights its first row on open): the pointer takes that\n // highlight over, and leaving the item glides it on. Left\n // pending, the first move off faded it out there and back in.\n sessionPendingRef.current = false;\n }\n // Empty space put the highlight out: the next item lit fades it in\n // there, as on entering, instead of sliding from the last one.\n if (next === null) sessionPendingRef.current = true;\n setActiveIndex(next);\n });\n },\n [containerRef, itemAt]\n );\n\n // Hover is what sits under the pointer, moved or not: when the items\n // scroll under a pointer at rest, the highlight goes to the item now\n // under it, as the browser's own :hover does, instead of riding away on\n // the item it was on (which left a row lit under no pointer, and\n // whatever follows :hover, like a row's checkbox, on another row). It\n // glides there as usual: the items move one way and the highlight the\n // other, so on screen it stays where the pointer is.\n useEffect(() => {\n if (!followScroll) return;\n let frame: number | null = null;\n const follow = () => {\n frame = null;\n const container = containerRef.current;\n const point = pointRef.current;\n if (!container || !point) return;\n const target = document.elementFromPoint(point.x, point.y);\n // Something else is over the container there (a popup opened from an\n // item): the pointer is its business, and the highlight stays put.\n if (!target || !container.contains(target)) return;\n const next = itemAt(container, point, target);\n if (next === activeIndexRef.current) return;\n // As a pointer move does: after empty space, the next item lit fades\n // the highlight in there instead of sliding from the last one.\n if (sessionPendingRef.current && next !== null) {\n sessionPendingRef.current = false;\n sessionRef.current += 1;\n setSession(sessionRef.current);\n }\n if (next === null) sessionPendingRef.current = true;\n setActiveIndex(next);\n };\n const onScroll = () => {\n // A touch screen has no pointer at rest: the last tap's point would\n // drag the highlight across whatever scrolls under it.\n if (!pointRef.current || frame !== null || window.matchMedia(\"(hover: none)\").matches) return;\n frame = requestAnimationFrame(follow);\n };\n window.addEventListener(\"scroll\", onScroll, { capture: true, passive: true });\n return () => {\n window.removeEventListener(\"scroll\", onScroll, { capture: true });\n if (frame !== null) cancelAnimationFrame(frame);\n };\n }, [containerRef, itemAt, followScroll]);\n\n const handleMouseEnter = useCallback(() => {\n sessionPendingRef.current = true;\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n pointRef.current = null;\n setActiveIndex(null);\n }, []);\n\n // Set from outside (the keyboard, focus), the highlight is no longer the\n // pointer's: a scroll that follows (the focused row brought into view)\n // must not hand it back to the item under a pointer at rest.\n const setActiveIndexFromOutside = useCallback<Dispatch<SetStateAction<number | null>>>((value) => {\n pointRef.current = null;\n setActiveIndex(value);\n }, []);\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n const target = e.target as Node | null;\n if (!target) return;\n // Inside an item: the item owns the click.\n for (const element of itemsRef.current.values()) {\n if (element.contains(target)) return;\n }\n // A row that unmounted while its own click was still bubbling (a pick\n // whose primitive re-renders the list synchronously, like a \"create\"\n // row that becomes a real item) already landed; it is not a gap.\n if (!target.isConnected) return;\n // Nor is a click from something rendered through a portal (a dropdown\n // opened from a row, a submenu): it bubbles here through React, but it\n // never happened between these rows.\n if (!isOwnEvent(e)) return;\n // A control that sits between the rows (a search field at the top of\n // a menu, a footer button) keeps its own click too.\n const control = (target as Element).closest?.(\n \"input, textarea, select, button, a, summary, [contenteditable], [role='textbox'], [role='searchbox'], [role='button']\"\n );\n if (control) return;\n if (gapClick === false) return;\n // Without nearest nothing is lit between items, except across the\n // seam between two rows, where the row just left holds. The highlight\n // updates a frame late, so one still lit from further away must not\n // take a click that landed in a wider gap.\n const index = nearest ? activeIndexRef.current : seamHold({ x: e.clientX, y: e.clientY });\n if (index === null) return;\n const element = itemsRef.current.get(index);\n if (!element || isItemDisabled?.(element)) return;\n if (gapClickMaxDistance !== Infinity) {\n const r = element.getBoundingClientRect();\n const dx = Math.max(r.left - e.clientX, 0, e.clientX - r.right);\n const dy = Math.max(r.top - e.clientY, 0, e.clientY - r.bottom);\n if (Math.hypot(dx, dy) > gapClickMaxDistance) return;\n }\n // A real DOM click on the item, so its own handlers (and the primitive\n // wrapping it, if any) run exactly as if the pointer had been inside.\n resolveActivator(element).click();\n },\n [isItemDisabled, gapClick, gapClickMaxDistance, nearest, seamHold]\n );\n\n // Remeasure when the container resizes — a reflow moves items even though\n // the registered set is unchanged, which would otherwise leave itemRects\n // stale. Coalesced through the same rAF as register/unregister. Readiness is\n // deliberately not dropped: the item set is unchanged, so the published rects\n // stay usable, and hiding overlays on every reflow would flicker them.\n useEffect(() => {\n const container = containerRef.current;\n if (!container || typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(() => scheduleMeasurement(measurementAttempts));\n ro.observe(container);\n return () => ro.disconnect();\n }, [containerRef, scheduleMeasurement]);\n\n // Clean up rAF and the item observer on unmount\n useEffect(() => {\n return () => {\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n }\n if (remeasureRafIdRef.current !== null) {\n cancelAnimationFrame(remeasureRafIdRef.current);\n }\n itemRoRef.current?.disconnect();\n itemRoRef.current = null;\n };\n }, []);\n\n return {\n activeIndex,\n setActiveIndex: setActiveIndexFromOutside,\n activeStore,\n itemRects,\n isMeasured,\n session,\n sessionRef,\n handlers: {\n onMouseMove: handleMouseMove,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onClick: handleClick,\n },\n registerItem,\n remeasure,\n measureItems,\n };\n}\n\nconst subscribeNever = () => () => {};\n\n/**\n * Reads one value derived from the highlighted index, re-rendering only when\n * that value changes. The selector must return a primitive:\n *\n * const isActive = useFluidHoverSelect(ctx?.activeStore, (i) => i === index);\n *\n * A missing store (a row rendered outside a list) reads as nothing lit.\n */\nexport function useFluidHoverSelect<T>(\n store: FluidHoverActiveStore | null | undefined,\n select: (activeIndex: number | null) => T\n): T {\n return useSyncExternalStore(\n store?.subscribe ?? subscribeNever,\n () => select(store ? store.get() : null),\n () => select(null)\n );\n}\n\n/**\n * Registers an item's element with its list for as long as it is mounted.\n * The one way rows join a list: pass the hook's `registerItem` (or the copy\n * a context hands down), the row's index, and its ref. Either may be\n * missing for a row rendered outside a list (a standalone card, an accordion\n * item that is not grouped); then nothing is registered.\n */\nexport function useRegisterFluidHoverItem(\n registerItem: ((index: number, element: HTMLElement | null) => void) | undefined,\n index: number | undefined,\n ref: RefObject<HTMLElement | null>\n) {\n // Before paint, so a list that measures in its own layout effect (a Table\n // snapping its fills as rows open) already sees every item at its new\n // index: a child's layout effect runs before its parent's.\n useIsoLayoutEffect(() => {\n if (!registerItem || index === undefined) return;\n registerItem(index, ref.current);\n return () => registerItem(index, null);\n }, [index, registerItem, ref]);\n}\n","\"use client\";\n\nimport { Component, type ReactNode } from \"react\";\n\ntype Props = { plugin: string; children: ReactNode };\ntype State = { failed: boolean };\n\n/** A plugin that throws while rendering loses its own UI, not the toolbar's. */\nexport class PluginBoundary extends Component<Props, State> {\n state: State = { failed: false };\n\n static getDerivedStateFromError(): State {\n return { failed: true };\n }\n\n componentDidCatch(error: unknown) {\n console.warn(`devbelt: plugin \"${this.props.plugin}\" crashed`, error);\n }\n\n render() {\n return this.state.failed ? null : this.props.children;\n }\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n Popover,\n PopoverClose,\n PopoverContent,\n PopoverTitle,\n} from \"@ui-sdk/react/popover\";\nimport { XIcon } from \"lucide-react\";\n\nimport type { WindowSize } from \"../../plugin-api\";\nimport { PluginBoundary } from \"../toolbar/plugin-boundary\";\nimport { iconButtonClass } from \"../primitives/styles\";\n\nconst MARGIN = 8;\n\ntype Props = {\n id: string;\n title: string;\n icon: ReactNode;\n size: WindowSize;\n /** Where the popover points: the plugin's toolbar item, else the toolbar. */\n root: Document | ShadowRoot;\n onClose: () => void;\n children: ReactNode;\n};\n\nconst findAnchor = (root: Document | ShadowRoot, id: string) =>\n root.querySelector(`[data-devbelt-item=\"${id}\"]`) ??\n root.querySelector('[data-dock=\"toolbar\"]');\n\n// A press on the toolbar is the toolbar's to handle: its toggle closes this\n// popover, and another tool's toggle replaces it.\nconst onToolbar = (event: Event | undefined) =>\n event\n ?.composedPath()\n .some((node) => node instanceof Element && node.hasAttribute(\"data-dock\")) ??\n false;\n\n/**\n * A plugin's Window shown as a popover on its toolbar item instead of a\n * floating window. Fixed at the Window's default size (or the room there is),\n * not draggable or resizable. Esc and a press outside close it.\n */\nexport function PluginPopover({\n id,\n title,\n icon,\n size,\n root,\n onClose,\n children,\n}: Props) {\n return (\n <Popover\n open\n modal={false}\n onOpenChange={(open, details) => {\n if (open) return;\n if (details.reason !== \"escape-key\" && onToolbar(details.event)) {\n details.cancel();\n return;\n }\n onClose();\n }}\n >\n <PopoverContent\n anchor={findAnchor(root, id)}\n side=\"top\"\n align=\"center\"\n sideOffset={12}\n initialFocus=\"content\"\n data-react-grab-ignore\n data-devbelt-window={id}\n className=\"m-0 flex flex-col overflow-hidden rounded-xl border border-line bg-surface p-0 text-xs text-fg shadow-2xl\"\n style={{\n width: `min(${size.width}px, calc(100vw - ${MARGIN * 2}px))`,\n height: `min(${size.height}px, var(--available-height, 100vh))`,\n }}\n >\n <header className=\"flex shrink-0 items-center gap-2 border-b border-line bg-surface-header px-2 py-1.5\">\n <span className=\"text-fg-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n <PopoverTitle className=\"min-w-0 flex-1 truncate text-xs font-semibold\">\n {title}\n </PopoverTitle>\n <PopoverClose\n aria-label={`Close ${title}`}\n className={`${iconButtonClass} relative after:absolute after:-inset-1 size-6`}\n >\n <XIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </PopoverClose>\n </header>\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <PluginBoundary plugin={id}>{children}</PluginBoundary>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\nimport { useLayoutEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { PROPERTY_CSS, TOOLBAR_CSS } from \"../css/styles.generated\";\n\nexport type Isolation = \"shadow\" | \"none\";\n\nconst HOST_TAG = \"devbelt-root\";\n// Tailwind declares its --tw-* variables with @property, which browsers only\n// honor on the document, so those rules go into <head> once.\nconst PROPERTY_STYLE_ID = \"devbelt-properties\";\n\n// The host sits in the page's tree, so the page's own CSS can reach it. `all:\n// initial` stops inherited font and colour from leaking in, and the base font\n// size keeps `rem` stable whatever the page sets on <html>.\nconst HOST_CSS = `:host{all:initial;display:contents;font:12px/1.5 ui-sans-serif,system-ui,sans-serif;color:var(--color-fg);-webkit-font-smoothing:antialiased}`;\n\nfunction ensurePropertyStyles() {\n if (document.getElementById(PROPERTY_STYLE_ID)) return;\n const style = document.createElement(\"style\");\n style.id = PROPERTY_STYLE_ID;\n style.textContent = PROPERTY_CSS;\n document.head.append(style);\n}\n\nexport type Mount = {\n container: HTMLElement;\n root: Document | ShadowRoot;\n};\n\n/**\n * Creates the element the toolbar renders into and reports it once it exists.\n * \"shadow\" attaches a shadow root with the compiled stylesheet, so the page's\n * CSS never touches the toolbar and the toolbar's never touches the page.\n * \"none\" renders into a plain div and leaves styling to the caller, who\n * imports `react-devbelt/styles.css`.\n */\nexport function useMount(isolation: Isolation, pluginCss: string[]): Mount | null {\n const [mount, setMount] = useState<Mount | null>(null);\n const cssKey = pluginCss.join(\"\\n\");\n\n useLayoutEffect(() => {\n const host = document.createElement(HOST_TAG);\n // React Grab and the page-picker skip anything under this attribute\n host.setAttribute(\"data-react-grab-ignore\", \"\");\n const container = document.createElement(\"div\");\n container.setAttribute(\"data-devbelt\", \"\");\n let root: Document | ShadowRoot = document;\n\n if (isolation === \"shadow\") {\n ensurePropertyStyles();\n const shadow = host.attachShadow({ mode: \"open\" });\n const style = document.createElement(\"style\");\n style.textContent = `${HOST_CSS}${TOOLBAR_CSS}${cssKey}`;\n shadow.append(style, container);\n root = shadow;\n } else {\n if (cssKey) {\n const style = document.createElement(\"style\");\n style.textContent = cssKey;\n host.append(style);\n }\n host.append(container);\n }\n\n document.body.append(host);\n setMount({ container, root });\n return () => {\n host.remove();\n setMount(null);\n };\n }, [isolation, cssKey]);\n\n return mount;\n}\n\nexport function ToolbarPortal({\n mount,\n children,\n}: {\n mount: Mount | null;\n children: React.ReactNode;\n}) {\n return mount ? createPortal(children, mount.container) : null;\n}\n","// Generated by scripts/build-css.mjs. Do not edit.\nexport const PROPERTY_CSS = \"@property --tw-animation-delay{syntax:\\\"*\\\";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:\\\"*\\\";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:\\\"*\\\";inherits:false}@property --tw-animation-fill-mode{syntax:\\\"*\\\";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\\\"*\\\";inherits:false}@property --tw-rotate-y{syntax:\\\"*\\\";inherits:false}@property --tw-rotate-z{syntax:\\\"*\\\";inherits:false}@property --tw-skew-x{syntax:\\\"*\\\";inherits:false}@property --tw-skew-y{syntax:\\\"*\\\";inherits:false}@property --tw-space-y-reverse{syntax:\\\"*\\\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\\\"*\\\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\\\"*\\\";inherits:false}@property --tw-font-weight{syntax:\\\"*\\\";inherits:false}@property --tw-tracking{syntax:\\\"*\\\";inherits:false}@property --tw-ordinal{syntax:\\\"*\\\";inherits:false}@property --tw-slashed-zero{syntax:\\\"*\\\";inherits:false}@property --tw-numeric-figure{syntax:\\\"*\\\";inherits:false}@property --tw-numeric-spacing{syntax:\\\"*\\\";inherits:false}@property --tw-numeric-fraction{syntax:\\\"*\\\";inherits:false}@property --tw-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\\\"*\\\";inherits:false}@property --tw-shadow-alpha{syntax:\\\"<percentage>\\\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\\\"*\\\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\\\"<percentage>\\\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\\\"*\\\";inherits:false}@property --tw-ring-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\\\"*\\\";inherits:false}@property --tw-inset-ring-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\\\"*\\\";inherits:false}@property --tw-ring-offset-width{syntax:\\\"<length>\\\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\\\"*\\\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\\\"*\\\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\\\"*\\\";inherits:false;initial-value:solid}@property --tw-blur{syntax:\\\"*\\\";inherits:false}@property --tw-brightness{syntax:\\\"*\\\";inherits:false}@property --tw-contrast{syntax:\\\"*\\\";inherits:false}@property --tw-grayscale{syntax:\\\"*\\\";inherits:false}@property --tw-hue-rotate{syntax:\\\"*\\\";inherits:false}@property --tw-invert{syntax:\\\"*\\\";inherits:false}@property --tw-opacity{syntax:\\\"*\\\";inherits:false}@property --tw-saturate{syntax:\\\"*\\\";inherits:false}@property --tw-sepia{syntax:\\\"*\\\";inherits:false}@property --tw-drop-shadow{syntax:\\\"*\\\";inherits:false}@property --tw-drop-shadow-color{syntax:\\\"*\\\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\\\"<percentage>\\\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-blur{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-brightness{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-contrast{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-grayscale{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-invert{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-opacity{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-saturate{syntax:\\\"*\\\";inherits:false}@property --tw-backdrop-sepia{syntax:\\\"*\\\";inherits:false}@property --tw-duration{syntax:\\\"*\\\";inherits:false}@property --tw-ease{syntax:\\\"*\\\";inherits:false}@property --tw-content{syntax:\\\"*\\\";inherits:false;initial-value:\\\"\\\"}@property --tw-scale-x{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\\\"*\\\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\\\"*\\\";inherits:false;initial-value:1}\";\nexport const TOOLBAR_CSS = \"/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:\\\"\\\";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, \\\"Segoe UI\\\", Roboto, \\\"Helvetica Neue\\\", \\\"Noto Sans\\\", Arial, sans-serif, \\\"Apple Color Emoji\\\", \\\"Segoe UI Emoji\\\", \\\"Segoe UI Symbol\\\", \\\"Noto Color Emoji\\\";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \\\"Liberation Mono\\\", \\\"Courier New\\\", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-violet-300:oklch(81.1% .111 293.571);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-neutral-400:oklch(70.8% 0 none);--color-neutral-500:oklch(55.6% 0 none);--color-neutral-900:oklch(20.5% 0 none);--color-neutral-950:oklch(14.5% 0 none);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--blur-lg:16px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--palette-ink:var(--color-neutral-950);--palette-ink-raised:var(--color-neutral-900);--palette-black:var(--color-black);--palette-paper:var(--color-white);--palette-mute:var(--color-neutral-400);--palette-dim:var(--color-neutral-500);--palette-sky:var(--color-sky-400);--palette-sky-strong:var(--color-sky-500);--palette-sky-soft:var(--color-sky-300);--palette-emerald:var(--color-emerald-400);--palette-emerald-strong:var(--color-emerald-500);--palette-emerald-soft:var(--color-emerald-300);--palette-amber:var(--color-amber-400);--palette-amber-soft:var(--color-amber-300);--palette-rose:var(--color-rose-400);--palette-rose-soft:var(--color-rose-300);--palette-violet-soft:var(--color-violet-300);--color-surface:var(--palette-ink);--color-surface-raised:var(--palette-ink-raised);--color-surface-overlay:#0a0a0ad9}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-overlay:color-mix(in oklab, var(--palette-ink) 85%, transparent)}}:root,:host{--color-surface-sticky:#0a0a0acc}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-sticky:color-mix(in oklab, var(--palette-ink) 80%, transparent)}}:root,:host{--color-surface-glass:#0a0a0abf}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-glass:color-mix(in oklab, var(--palette-ink) 75%, transparent)}}:root,:host{--color-surface-header:#17171799}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-header:color-mix(in oklab, var(--palette-ink-raised) 60%, transparent)}}:root,:host{--color-scrim:#0009}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-scrim:color-mix(in oklab, var(--palette-black) 60%, transparent)}}:root,:host{--color-page:var(--palette-paper);--color-fg:var(--palette-paper);--color-fg-secondary:#ffffffb3}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-fg-secondary:color-mix(in oklab, var(--palette-paper) 70%, transparent)}}:root,:host{--color-fg-tertiary:#ffffff80}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-fg-tertiary:color-mix(in oklab, var(--palette-paper) 50%, transparent)}}:root,:host{--color-fg-disabled:#fff6}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-fg-disabled:color-mix(in oklab, var(--palette-paper) 40%, transparent)}}:root,:host{--color-fg-icon:var(--palette-mute);--color-fg-inverse:var(--palette-ink);--color-inverse:var(--palette-paper);--color-inverse-hover:#ffffffe6}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-inverse-hover:color-mix(in oklab, var(--palette-paper) 90%, transparent)}}:root,:host{--color-hover:#ffffff1a}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-hover:color-mix(in oklab, var(--palette-paper) 10%, transparent)}}:root,:host{--color-hover-subtle:#ffffff0d}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-hover-subtle:color-mix(in oklab, var(--palette-paper) 5%, transparent)}}:root,:host{--color-pressed:#ffffff26}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-pressed:color-mix(in oklab, var(--palette-paper) 15%, transparent)}}:root,:host{--color-track:#fff3}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-track:color-mix(in oklab, var(--palette-paper) 20%, transparent)}}:root,:host{--color-line:#ffffff1a}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-line:color-mix(in oklab, var(--palette-paper) 10%, transparent)}}:root,:host{--color-line-strong:#ffffff26}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-line-strong:color-mix(in oklab, var(--palette-paper) 15%, transparent)}}:root,:host{--color-line-control:#ffffff4d}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-line-control:color-mix(in oklab, var(--palette-paper) 30%, transparent)}}:root,:host{--color-line-inverse:var(--palette-paper);--color-accent:var(--palette-sky);--color-accent-strong:var(--palette-sky-strong);--color-accent-fg:var(--palette-sky-soft);--color-focus:var(--color-accent);--color-success:var(--palette-emerald);--color-success-strong:var(--palette-emerald-strong);--color-success-fg:var(--palette-emerald-soft);--color-warning:var(--palette-amber);--color-warning-fg:var(--palette-amber-soft);--color-danger:var(--palette-rose);--color-danger-fg:var(--palette-rose-soft);--shadow-float:inset 0 0 0 1px var(--color-line), 0 8px 24px -8px #00000080}@supports (color:color-mix(in lab, red, red)){:root,:host{--shadow-float:inset 0 0 0 1px var(--color-line), 0 8px 24px -8px color-mix(in oklab, var(--palette-black) 50%, transparent)}}:root,:host{--color-syntax-key:var(--palette-sky-soft);--color-syntax-string:var(--palette-emerald-soft);--color-syntax-number:var(--palette-amber-soft);--color-syntax-literal:var(--palette-violet-soft);--color-syntax-punctuation:var(--palette-dim)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, \\\"Segoe UI\\\", Roboto, \\\"Helvetica Neue\\\", \\\"Noto Sans\\\", Arial, sans-serif, \\\"Apple Color Emoji\\\", \\\"Segoe UI Emoji\\\", \\\"Segoe UI Symbol\\\", \\\"Noto Color Emoji\\\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \\\"Liberation Mono\\\", \\\"Courier New\\\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}[data-devbelt] :where(button,[role=button],[role=tab],[role=switch],[role=checkbox],summary):not(:disabled,[aria-disabled=true]){cursor:pointer}[data-devbelt] [torph-sr]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-4{inset:calc(var(--spacing) * 4)}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.inset-y-0{inset-block:0}.inset-y-0\\\\.5{inset-block:calc(var(--spacing) * .5)}.inset-y-3{inset-block:calc(var(--spacing) * 3)}.-top-6{top:calc(var(--spacing) * -6)}.top-\\\\(--y\\\\){top:var(--y)}.top-0{top:0}.top-1{top:var(--spacing)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:0}.bottom-0{bottom:0}.bottom-\\\\[max\\\\(1rem\\\\,env\\\\(safe-area-inset-bottom\\\\)\\\\)\\\\]{bottom:max(1rem, env(safe-area-inset-bottom))}.left-\\\\(--x\\\\){left:var(--x)}.left-0{left:0}.isolate{isolation:isolate}.-z-10{z-index:calc(10 * -1)}.z-0{z-index:0}.z-10{z-index:10}.z-\\\\[9000\\\\]{z-index:9000}.z-\\\\[9999\\\\]{z-index:9999}.z-\\\\[10000\\\\]{z-index:10000}.z-\\\\[10001\\\\]{z-index:10001}.float-end{float:inline-end}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.ms-2{margin-inline-start:calc(var(--spacing) * 2)}.ms-auto{margin-inline-start:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.\\\\!hidden{display:none!important}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}@supports not selector(::-webkit-scrollbar){.scrollbar-slim{scrollbar-width:thin;scrollbar-color:var(--color-track) transparent}}.scrollbar-slim::-webkit-scrollbar{width:10px;height:10px}.scrollbar-slim::-webkit-scrollbar-track{background:0 0}.scrollbar-slim::-webkit-scrollbar-corner{background:0 0}.scrollbar-slim::-webkit-scrollbar-thumb{background-color:var(--color-track);background-clip:content-box;border:2px solid #0000;border-radius:9999px}.scrollbar-slim::-webkit-scrollbar-thumb:hover{background-color:var(--color-fg-disabled)}.size-2\\\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.h-\\\\(--h\\\\){height:var(--h)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-\\\\[3px\\\\]{height:3px}.h-auto{height:auto}.h-px{height:1px}.max-h-\\\\(--available-height\\\\){max-height:var(--available-height)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-\\\\[40\\\\%\\\\]{max-height:40%}.max-h-none{max-height:none}.min-h-0{min-height:0}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-\\\\(--w\\\\){width:var(--w)}.w-3{width:calc(var(--spacing) * 3)}.w-6{width:calc(var(--spacing) * 6)}.w-9{width:calc(var(--spacing) * 9)}.w-28{width:calc(var(--spacing) * 28)}.w-52{width:calc(var(--spacing) * 52)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-\\\\[3px\\\\]{width:3px}.w-\\\\[min\\\\(26rem\\\\,calc\\\\(100vw-2rem\\\\)\\\\)\\\\]{width:min(26rem,100vw - 2rem)}.w-\\\\[min\\\\(380px\\\\,calc\\\\(100vw-32px\\\\)\\\\)\\\\]{width:min(380px,100vw - 32px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\\\[calc\\\\(100vw-1rem\\\\)\\\\]{max-width:calc(100vw - 1rem)}.max-w-full{max-width:100%}.max-w-none{max-width:none}.min-w-0{min-width:0}.min-w-4{min-width:calc(var(--spacing) * 4)}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-56{min-width:calc(var(--spacing) * 56)}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.\\\\[translate\\\\:var\\\\(--dock-x\\\\)_var\\\\(--dock-y\\\\)\\\\]{translate:var(--dock-x) var(--dock-y)}.transform{transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.animate-pulse{animation:var(--animate-pulse)}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-ns-resize{cursor:ns-resize}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.\\\\[scrollbar-width\\\\:none\\\\]{scrollbar-width:none}.grid-cols-\\\\[3\\\\.25rem_minmax\\\\(0\\\\,1fr\\\\)_2\\\\.25rem_3\\\\.25rem_minmax\\\\(0\\\\,1\\\\.4fr\\\\)\\\\]{grid-template-columns:3.25rem minmax(0,1fr) 2.25rem 3.25rem minmax(0,1.4fr)}.grid-cols-\\\\[3\\\\.25rem_minmax\\\\(0\\\\,1fr\\\\)_2rem_4\\\\.5rem\\\\]{grid-template-columns:3.25rem minmax(0,1fr) 2rem 4.5rem}.grid-cols-\\\\[max-content_minmax\\\\(0\\\\,1fr\\\\)\\\\]{grid-template-columns:max-content minmax(0,1fr)}.grid-cols-\\\\[minmax\\\\(0\\\\,12rem\\\\)_minmax\\\\(0\\\\,1fr\\\\)_auto_auto\\\\]{grid-template-columns:minmax(0,12rem) minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-1\\\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:var(--spacing)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-x-contain{overscroll-behavior-x:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-br-xl{border-bottom-right-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r-\\\\[3px\\\\]{border-right-style:var(--tw-border-style);border-right-width:3px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-\\\\[3px\\\\]{border-bottom-style:var(--tw-border-style);border-bottom-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--color-accent)}.border-line{border-color:var(--color-line)}.border-line-control{border-color:var(--color-line-control)}.border-line-strong{border-color:var(--color-line-strong)}.border-success{border-color:var(--color-success)}.bg-accent{background-color:var(--color-accent)}.bg-accent-strong{background-color:var(--color-accent-strong)}.bg-accent\\\\/5{background-color:#00bcfe0d}@supports (color:color-mix(in lab, red, red)){.bg-accent\\\\/5{background-color:color-mix(in oklab, var(--color-accent) 5%, transparent)}}.bg-accent\\\\/10{background-color:#00bcfe1a}@supports (color:color-mix(in lab, red, red)){.bg-accent\\\\/10{background-color:color-mix(in oklab, var(--color-accent) 10%, transparent)}}.bg-accent\\\\/15{background-color:#00bcfe26}@supports (color:color-mix(in lab, red, red)){.bg-accent\\\\/15{background-color:color-mix(in oklab, var(--color-accent) 15%, transparent)}}.bg-accent\\\\/20{background-color:#00bcfe33}@supports (color:color-mix(in lab, red, red)){.bg-accent\\\\/20{background-color:color-mix(in oklab, var(--color-accent) 20%, transparent)}}.bg-accent\\\\/60{background-color:#00bcfe99}@supports (color:color-mix(in lab, red, red)){.bg-accent\\\\/60{background-color:color-mix(in oklab, var(--color-accent) 60%, transparent)}}.bg-accent\\\\/70{background-color:#00bcfeb3}@supports (color:color-mix(in lab, red, red)){.bg-accent\\\\/70{background-color:color-mix(in oklab, var(--color-accent) 70%, transparent)}}.bg-danger{background-color:var(--color-danger)}.bg-hover{background-color:var(--color-hover)}.bg-hover-subtle{background-color:var(--color-hover-subtle)}.bg-inverse{background-color:var(--color-inverse)}.bg-page{background-color:var(--color-page)}.bg-pressed{background-color:var(--color-pressed)}.bg-scrim{background-color:var(--color-scrim)}.bg-success{background-color:var(--color-success)}.bg-success-strong{background-color:var(--color-success-strong)}.bg-success\\\\/10{background-color:#00d2941a}@supports (color:color-mix(in lab, red, red)){.bg-success\\\\/10{background-color:color-mix(in oklab, var(--color-success) 10%, transparent)}}.bg-success\\\\/20{background-color:#00d29433}@supports (color:color-mix(in lab, red, red)){.bg-success\\\\/20{background-color:color-mix(in oklab, var(--color-success) 20%, transparent)}}.bg-surface{background-color:var(--color-surface)}.bg-surface-glass{background-color:var(--color-surface-glass)}.bg-surface-header{background-color:var(--color-surface-header)}.bg-surface-overlay{background-color:var(--color-surface-overlay)}.bg-surface-raised{background-color:var(--color-surface-raised)}.bg-surface-sticky{background-color:var(--color-surface-sticky)}.bg-track{background-color:var(--color-track)}.bg-transparent{background-color:#0000}.bg-warning{background-color:var(--color-warning)}@supports (animation-timeline:scroll()){.scroll-fade{animation-name:scroll-fade-start,scroll-fade-end;animation-duration:auto;animation-composition:add;-webkit-mask-composite:source-in;animation-timing-function:linear;animation-fill-mode:both;animation-timeline:scroll(self);animation-range:0 48px,calc(100% - 48px) 100%;-webkit-mask-image:linear-gradient(#0000,#000 48px),linear-gradient(0deg,#0000,#000 48px);mask-image:linear-gradient(#0000,#000 48px),linear-gradient(0deg,#0000,#000 48px);-webkit-mask-position:0 -48px,0 0;mask-position:0 -48px,0 0;-webkit-mask-size:100% calc(100% + 48px),100% calc(100% + 48px);mask-size:100% calc(100% + 48px),100% calc(100% + 48px);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}}.fill-current{fill:currentColor}.p-0{padding:0}.p-0\\\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1{padding-inline:var(--spacing)}.px-1\\\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.ps-3\\\\.5{padding-inline-start:calc(var(--spacing) * 3.5)}.ps-6{padding-inline-start:calc(var(--spacing) * 6)}.pe-1{padding-inline-end:var(--spacing)}.pt-1\\\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-1{padding-bottom:var(--spacing)}.text-end{text-align:end}.text-start{text-align:start}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\\\[10px\\\\]{font-size:10px}.text-\\\\[11px\\\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-fg{color:var(--color-accent-fg)}.text-danger-fg{color:var(--color-danger-fg)}.text-fg{color:var(--color-fg)}.text-fg-disabled{color:var(--color-fg-disabled)}.text-fg-icon{color:var(--color-fg-icon)}.text-fg-inverse{color:var(--color-fg-inverse)}.text-fg-secondary{color:var(--color-fg-secondary)}.text-fg-tertiary{color:var(--color-fg-tertiary)}.text-success-fg{color:var(--color-success-fg)}.text-warning-fg{color:var(--color-warning-fg)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-float{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--color-line)), 0 8px 24px -8px var(--tw-shadow-color,#00000080)}@supports (color:color-mix(in lab, red, red)){.shadow-float{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--color-line)), 0 8px 24px -8px var(--tw-shadow-color,color-mix(in oklab, var(--palette-black) 50%, transparent))}}.shadow-float{box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-line{--tw-ring-color:var(--color-line)}.ring-line-strong{--tw-ring-color:var(--color-line-strong)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\\\[color\\\\,transform\\\\]{transition-property:color,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\\\[opacity\\\\,scale\\\\]{transition-property:opacity,scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-\\\\[240ms\\\\]{--tw-duration:.24s;transition-duration:.24s}.ease-\\\\[cubic-bezier\\\\(0\\\\.23\\\\,1\\\\,0\\\\.32\\\\,1\\\\)\\\\]{--tw-ease:cubic-bezier(.23,1,.32,1);transition-timing-function:cubic-bezier(.23,1,.32,1)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}@media (hover:hover){:is(:where(.group):hover .group-hover\\\\:opacity-100){opacity:1}}:is(:where(.group):active .group-active\\\\:opacity-100){opacity:1}.placeholder\\\\:text-fg-disabled::placeholder{color:var(--color-fg-disabled)}.backdrop\\\\:bg-scrim::backdrop{background-color:var(--color-scrim)}.after\\\\:absolute:after{content:var(--tw-content);position:absolute}.after\\\\:-inset-1:after{content:var(--tw-content);inset:calc(var(--spacing) * -1)}.after\\\\:inset-x-0:after{content:var(--tw-content);inset-inline:0}.after\\\\:-inset-y-0\\\\.5:after{content:var(--tw-content);inset-block:calc(var(--spacing) * -.5)}.after\\\\:-inset-y-1:after{content:var(--tw-content);inset-block:calc(var(--spacing) * -1)}@media (hover:hover){.hover\\\\:bg-hover:hover{background-color:var(--color-hover)}.hover\\\\:bg-hover-subtle:hover{background-color:var(--color-hover-subtle)}.hover\\\\:bg-inverse:hover{background-color:var(--color-inverse)}.hover\\\\:bg-inverse-hover:hover{background-color:var(--color-inverse-hover)}.hover\\\\:bg-success:hover{background-color:var(--color-success)}.hover\\\\:text-fg:hover{color:var(--color-fg)}}.focus-visible\\\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\\\:outline-offset-1:focus-visible{outline-offset:1px}.focus-visible\\\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\\\:outline-focus:focus-visible{outline-color:var(--color-focus)}.active\\\\:scale-\\\\[0\\\\.97\\\\]:active{scale:.97}.active\\\\:cursor-grabbing:active{cursor:grabbing}.disabled\\\\:opacity-40:disabled{opacity:.4}.data-checked\\\\:border-line-inverse[data-checked]{border-color:var(--color-line-inverse)}.data-checked\\\\:bg-inverse[data-checked]{background-color:var(--color-inverse)}.data-checked\\\\:bg-surface[data-checked]{background-color:var(--color-surface)}.data-checked\\\\:text-fg-inverse[data-checked]{color:var(--color-fg-inverse)}.data-disabled\\\\:opacity-40[data-disabled]{opacity:.4}.data-ending-style\\\\:opacity-0[data-ending-style]{opacity:0}.data-ending-style\\\\:duration-\\\\[160ms\\\\][data-ending-style]{--tw-duration:.16s;transition-duration:.16s}.data-highlighted\\\\:bg-hover-subtle[data-highlighted]{background-color:var(--color-hover-subtle)}.data-pressed\\\\:border-line-inverse[data-pressed]{border-color:var(--color-line-inverse)}.data-pressed\\\\:bg-accent\\\\/20[data-pressed]{background-color:#00bcfe33}@supports (color:color-mix(in lab, red, red)){.data-pressed\\\\:bg-accent\\\\/20[data-pressed]{background-color:color-mix(in oklab, var(--color-accent) 20%, transparent)}}.data-pressed\\\\:bg-inverse[data-pressed]{background-color:var(--color-inverse)}.data-pressed\\\\:bg-pressed[data-pressed]{background-color:var(--color-pressed)}.data-pressed\\\\:text-fg-inverse[data-pressed]{color:var(--color-fg-inverse)}@media (hover:hover){.data-pressed\\\\:hover\\\\:bg-transparent[data-pressed]:hover{background-color:#0000}}.data-selected\\\\:bg-accent\\\\/15[data-selected]{background-color:#00bcfe26}@supports (color:color-mix(in lab, red, red)){.data-selected\\\\:bg-accent\\\\/15[data-selected]{background-color:color-mix(in oklab, var(--color-accent) 15%, transparent)}}.data-selected\\\\:bg-hover[data-selected]{background-color:var(--color-hover)}.data-selected\\\\:text-fg[data-selected]{color:var(--color-fg)}.data-starting-style\\\\:scale-\\\\[0\\\\.98\\\\][data-starting-style]{scale:.98}.data-starting-style\\\\:opacity-0[data-starting-style]{opacity:0}.data-unchecked\\\\:invisible[data-unchecked]{visibility:hidden}@media (prefers-reduced-motion:reduce){.motion-reduce\\\\:transition-none{transition-property:none}.motion-reduce\\\\:active\\\\:scale-100:active{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media not all and (min-width:40rem){.max-sm\\\\:mx-0\\\\.5{margin-inline:calc(var(--spacing) * .5)}.max-sm\\\\:hidden{display:none}.max-sm\\\\:gap-0{gap:0}.max-sm\\\\:px-1\\\\.5{padding-inline:calc(var(--spacing) * 1.5)}}@media (min-width:40rem){.sm\\\\:hidden{display:none}}.\\\\[\\\\&_\\\\.hljs-attr\\\\]\\\\:text-syntax-key .hljs-attr{color:var(--color-syntax-key)}.\\\\[\\\\&_\\\\.hljs-literal\\\\]\\\\:text-syntax-literal .hljs-literal{color:var(--color-syntax-literal)}.\\\\[\\\\&_\\\\.hljs-number\\\\]\\\\:text-syntax-number .hljs-number{color:var(--color-syntax-number)}.\\\\[\\\\&_\\\\.hljs-punctuation\\\\]\\\\:text-syntax-punctuation .hljs-punctuation{color:var(--color-syntax-punctuation)}.\\\\[\\\\&_\\\\.hljs-string\\\\]\\\\:text-syntax-string .hljs-string{color:var(--color-syntax-string)}.\\\\[\\\\&_pre\\\\]\\\\:text-\\\\[13px\\\\] pre{font-size:13px}.\\\\[\\\\&_svg\\\\]\\\\:size-3 svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\\\[\\\\&_svg\\\\]\\\\:text-accent-fg svg{color:var(--color-accent-fg)}.\\\\[\\\\&_svg\\\\]\\\\:text-fg-icon svg{color:var(--color-fg-icon)}.\\\\[\\\\&_svg\\\\]\\\\:text-fg-inverse svg{color:var(--color-fg-inverse)}.\\\\[\\\\&_svg\\\\]\\\\:transition-colors svg{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\\\[\\\\&_svg\\\\]\\\\:duration-75 svg{--tw-duration:75ms;transition-duration:75ms}.data-pressed\\\\:\\\\[\\\\&_svg\\\\]\\\\:text-accent-fg[data-pressed] svg{color:var(--color-accent-fg)}.data-pressed\\\\:\\\\[\\\\&_svg\\\\]\\\\:text-fg[data-pressed] svg{color:var(--color-fg)}.data-pressed\\\\:\\\\[\\\\&_svg\\\\]\\\\:text-fg-inverse\\\\![data-pressed] svg{color:var(--color-fg-inverse)!important}.\\\\[\\\\&\\\\:\\\\:-webkit-scrollbar\\\\]\\\\:hidden::-webkit-scrollbar{display:none}}@keyframes scroll-fade-start{0%{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}to{-webkit-mask-position:0 48px,0 0;mask-position:0 48px,0 0}}@keyframes scroll-fade-end{0%{-webkit-mask-position:0 0,0 -48px;mask-position:0 0,0 -48px}to{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}}@keyframes scroll-fade-start-x{0%{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}to{-webkit-mask-position:48px 0,0 0;mask-position:48px 0,0 0}}@keyframes scroll-fade-end-x{0%{-webkit-mask-position:0 0,-48px 0;mask-position:0 0,-48px 0}to{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}}[data-devbelt-hidden] [data-devbelt-hud]{display:none}@keyframes pulse{50%{opacity:.5}}\";\n","\"use client\";\n\nimport { bindDrag } from \"@ui-sdk/core\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { readJson, writeJson, writeString } from \"../../core/storage\";\n\nexport type DockPosition = { x: number; y: number };\n\nconst STORAGE_KEY = \"position\";\nconst ORIGIN: DockPosition = { x: 0, y: 0 };\nconst MARGIN = 8;\nconst STEP = 8;\nconst LARGE_STEP = 40;\nconst DRAG_THRESHOLD = 4;\n// While dragging, the dock's edges and centre are pulled to the window's when\n// they come this close. The edge gap matches where the dock rests by default.\nconst SNAP_DISTANCE = 12;\nconst SNAP_EDGE_GAP = 16;\n\nexport type SnapGuides = { x: number | null; y: number | null };\nconst NO_GUIDES: SnapGuides = { x: null, y: null };\n\nfunction read(): DockPosition {\n const parsed = readJson<Partial<DockPosition> | null>(STORAGE_KEY, null);\n return typeof parsed?.x === \"number\" && typeof parsed.y === \"number\"\n ? { x: parsed.x, y: parsed.y }\n : ORIGIN;\n}\n\nfunction write(position: DockPosition) {\n if (position.x === 0 && position.y === 0) writeString(STORAGE_KEY, null);\n else writeJson(STORAGE_KEY, position);\n}\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), Math.max(min, max));\n\n// Pulls one axis to the nearest of: start edge gap, end edge gap, centre. The\n// box spans [lo, hi] when the dock sits at `from`, and is at `offset` now.\nfunction snapAxis(\n offset: number,\n from: number,\n lo: number,\n hi: number,\n size: number,\n): { offset: number; guide: number | null } {\n const shift = offset - from;\n const a = lo + shift;\n const b = hi + shift;\n const targets = [\n { delta: SNAP_EDGE_GAP - a, guide: SNAP_EDGE_GAP },\n { delta: size - SNAP_EDGE_GAP - b, guide: size - SNAP_EDGE_GAP },\n { delta: size / 2 - (a + b) / 2, guide: size / 2 },\n ];\n const best = targets\n .filter((t) => Math.abs(t.delta) <= SNAP_DISTANCE)\n .sort((p, q) => Math.abs(p.delta) - Math.abs(q.delta))[0];\n return best\n ? { offset: offset + best.delta, guide: best.guide }\n : { offset, guide: null };\n}\n\n/**\n * Lets the dev dock (chip + toolbar) be dragged anywhere inside the window.\n * The drag writes CSS variables straight to the dock, so it costs no render\n * per pointer move; the final position is committed to state on release.\n */\nexport function useDockPosition(collapsed: boolean) {\n const dockRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState<DockPosition>(read);\n const [guides, setGuides] = useState<SnapGuides>(NO_GUIDES);\n const current = useRef(position);\n const stopDrag = useRef<(() => void) | undefined>(undefined);\n\n const paint = (next: DockPosition) => {\n const dock = dockRef.current;\n dock?.style.setProperty(\"--dock-x\", `${next.x}px`);\n dock?.style.setProperty(\"--dock-y\", `${next.y}px`);\n };\n\n const commit = (next: DockPosition) => {\n current.current = next;\n setPosition(next);\n paint(next);\n write(next);\n };\n\n // What the dock occupies on screen now: the chip, plus the toolbar unless\n // it has slid out of view.\n const bounds = () => {\n const parts = dockRef.current?.querySelectorAll<HTMLElement>(\"[data-dock]\");\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n parts?.forEach((part) => {\n if (collapsed && part.dataset.dock === \"toolbar\") return;\n const rect = part.getBoundingClientRect();\n left = Math.min(left, rect.left);\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n });\n return Number.isFinite(left) ? { left, top, right, bottom } : null;\n };\n\n // Keeps the dock inside the window, given where it is at `from`.\n const fit = (desired: DockPosition, from: DockPosition): DockPosition => {\n const box = bounds();\n if (!box) return desired;\n return {\n x: clamp(\n desired.x,\n from.x + MARGIN - box.left,\n from.x + window.innerWidth - MARGIN - box.right,\n ),\n y: clamp(\n desired.y,\n from.y + MARGIN - box.top,\n from.y + window.innerHeight - MARGIN - box.bottom,\n ),\n };\n };\n\n useEffect(() => {\n const onResize = () => {\n const fitted = fit(current.current, current.current);\n if (fitted.x !== current.current.x || fitted.y !== current.current.y) {\n commit(fitted);\n }\n };\n window.addEventListener(\"resize\", onResize);\n return () => {\n window.removeEventListener(\"resize\", onResize);\n stopDrag.current?.();\n };\n // fit and commit read refs and the latest collapsed state on each call\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [collapsed]);\n\n const startDrag = (event: React.PointerEvent<HTMLElement>) => {\n if (event.button !== 0) return;\n stopDrag.current?.();\n const from = current.current;\n const box = bounds();\n const origin = { x: event.clientX, y: event.clientY };\n stopDrag.current = bindDrag(event.currentTarget, event.nativeEvent, {\n threshold: DRAG_THRESHOLD,\n cancelOnEscape: true,\n onMove: ({ x, y, event: move }) => {\n const desired = {\n x: from.x + x - origin.x,\n y: from.y + y - origin.y,\n };\n if (!box) return paint(desired);\n // Clamp against the box measured at the start, so it never feeds back.\n const clamped = {\n x: clamp(\n desired.x,\n from.x + MARGIN - box.left,\n from.x + window.innerWidth - MARGIN - box.right,\n ),\n y: clamp(\n desired.y,\n from.y + MARGIN - box.top,\n from.y + window.innerHeight - MARGIN - box.bottom,\n ),\n };\n // Holding Alt drops the magnet for a free placement.\n if (move.altKey) {\n setGuides((g) => (g.x === null && g.y === null ? g : NO_GUIDES));\n return paint(clamped);\n }\n const snapX = snapAxis(\n clamped.x,\n from.x,\n box.left,\n box.right,\n window.innerWidth,\n );\n const snapY = snapAxis(\n clamped.y,\n from.y,\n box.top,\n box.bottom,\n window.innerHeight,\n );\n paint({ x: snapX.offset, y: snapY.offset });\n setGuides((g) =>\n g.x === snapX.guide && g.y === snapY.guide\n ? g\n : { x: snapX.guide, y: snapY.guide },\n );\n },\n onEnd: (_event, canceled) => {\n setGuides(NO_GUIDES);\n if (canceled) {\n paint(from);\n return;\n }\n const x = parseFloat(\n dockRef.current?.style.getPropertyValue(\"--dock-x\") ?? \"\",\n );\n const y = parseFloat(\n dockRef.current?.style.getPropertyValue(\"--dock-y\") ?? \"\",\n );\n if (Number.isFinite(x) && Number.isFinite(y)) commit({ x, y });\n },\n });\n };\n\n // Alt+arrows nudge it (Shift for a bigger step), like ui-sdk's own move.\n const onKeyDown = (event: React.KeyboardEvent) => {\n if (!event.altKey) return;\n const delta = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n }[event.key];\n if (!delta) return;\n event.preventDefault();\n event.stopPropagation();\n const step = event.shiftKey ? LARGE_STEP : STEP;\n const from = current.current;\n commit(\n fit({ x: from.x + delta.x * step, y: from.y + delta.y * step }, from),\n );\n };\n\n const reset = () => commit(ORIGIN);\n\n return { dockRef, position, guides, startDrag, onKeyDown, reset };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,WAAAA,gBAAe;;;ACAxB;AAAA,EACE,aAAAC;AAAA,EACA,WAAAC;AAAA,E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oBAAoB,SAAiD;AAC5E,QAAM,UAAU,QAAQ,QAAQ,CAAC,MAAM;AACrC,QAAI;AACF,aAAO,EAAE,eAAe,KAAK,CAAC;AAAA,IAChC,QAAQ;AACN,aAAO,CAAC;AAAA,IACV;AAAA,EACF,CAAC;AACD,SAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,UAAU,MAAM,IACzC,UACA,CAAC,EAAE,OAAO,QAAQ,OAAO,OAAO,SAAS,KAAK,GAAG,GAAG,OAAO;AACjE;;;ADzdS,gBAAAO,YAAA;AAfT,IAAI,WAAmC;AAGxB,SAAR,aAA8B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,QAAM,OAAOC,SAAQ,MAAM,YAAY,aAAa,eAAe,IAAI,CAAC,OAAO,CAAC;AAChF,SAAO,gBAAAD,KAAC,eAAY,SAAS,MAAM,WAAsB,WAAsB,SAAkB;AACnG;","names":["useMemo","useEffect","useMemo","useRef","useState","useState","useState","jsx","jsxs","jsx","jsxs","useEffect","useRef","useRef","useState","useEffect","distance","element","jsx","jsxs","useRef","useEffect","XIcon","jsx","jsxs","MARGIN","XIcon","useLayoutEffect","useState","useState","useLayoutEffect","useEffect","useRef","useState","STORAGE_KEY","MARGIN","STEP","LARGE_STEP","DRAG_THRESHOLD","read","useRef","useState","useEffect","jsx","jsxs","useState","useEffect","useMemo","useRef","Component","jsx","useMemo"]}
package/dist/ui.d.ts CHANGED
@@ -13,7 +13,7 @@ export * from '@ui-sdk/react/toggle';
13
13
  export * from '@ui-sdk/react/tooltip';
14
14
  import './index-C8VytW9X.js';
15
15
 
16
- declare const toolbarItemClass = "relative z-10 inline-flex h-8 items-center after:absolute after:inset-x-0 after:-inset-y-1 gap-1.5 rounded-full px-2.5 text-xs font-medium text-fg transition-colors duration-75 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus [&_svg]:text-fg-icon [&_svg]:transition-colors [&_svg]:duration-75 data-pressed:[&_svg]:text-fg";
16
+ declare const toolbarItemClass = "relative z-10 inline-flex h-8 items-center after:absolute after:inset-x-0 after:-inset-y-1 gap-1.5 rounded-full px-2.5 text-xs font-medium text-fg transition-[color,transform] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus [&_svg]:text-fg-icon [&_svg]:transition-colors [&_svg]:duration-75 data-pressed:[&_svg]:text-fg";
17
17
  declare const tooltipClass = "m-0 flex items-center gap-2 rounded-md border border-line bg-surface-raised px-2 py-1 text-xs text-fg shadow-lg";
18
18
  declare const kbdClass = "inline-flex h-4 min-w-4 items-center justify-center rounded border border-line-control px-1 font-sans text-[10px] leading-none text-fg";
19
19
  declare const iconButtonClass = "inline-flex size-7 items-center justify-center rounded-md text-fg-icon hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-focus";
package/dist/ui.js CHANGED
@@ -56,7 +56,7 @@ import {
56
56
  kbdClass,
57
57
  toolbarItemClass,
58
58
  tooltipClass
59
- } from "./chunk-EYWS436C.js";
59
+ } from "./chunk-6FUPE5IB.js";
60
60
  import {
61
61
  useToolbar
62
62
  } from "./chunk-6TOYYHSR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-devbelt",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A pluggable in-browser dev toolbar for React and Next.js: network and console logs, responsive viewport frames, element grab, and agent-readable debug bundles.",
5
5
  "keywords": [
6
6
  "devtools",