@k2b/ui 0.55.0 → 0.57.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.
Files changed (126) hide show
  1. package/dist/browser/actions/SplitButton.js +5 -7
  2. package/dist/browser/actions/SplitButton.js.map +1 -1
  3. package/dist/browser/actions/Toolbar.js +16 -7
  4. package/dist/browser/actions/Toolbar.js.map +1 -1
  5. package/dist/browser/actions/ViewTabs.js +6 -5
  6. package/dist/browser/actions/ViewTabs.js.map +1 -1
  7. package/dist/browser/chat/ChatComposer.js +28 -27
  8. package/dist/browser/chat/ChatComposer.js.map +1 -1
  9. package/dist/browser/content/Lightbox.js +917 -283
  10. package/dist/browser/content/Lightbox.js.map +1 -1
  11. package/dist/browser/content/PdfPages.js +8 -3
  12. package/dist/browser/content/PdfPages.js.map +1 -1
  13. package/dist/browser/content/PdfThumbnails.js +271 -0
  14. package/dist/browser/content/PdfThumbnails.js.map +1 -0
  15. package/dist/browser/content/PdfViewer.js +11 -3
  16. package/dist/browser/content/PdfViewer.js.map +1 -1
  17. package/dist/browser/content/Timeline.js +116 -117
  18. package/dist/browser/content/Timeline.js.map +1 -1
  19. package/dist/browser/content/code-highlight.js +24 -11
  20. package/dist/browser/content/code-highlight.js.map +1 -1
  21. package/dist/browser/content/index.js +5 -1
  22. package/dist/browser/content/index.js.map +1 -1
  23. package/dist/browser/content/lightbox-messages.js +64 -18
  24. package/dist/browser/content/lightbox-messages.js.map +1 -1
  25. package/dist/browser/content/lightbox-renderers.js +6 -0
  26. package/dist/browser/content/lightbox-renderers.js.map +1 -0
  27. package/dist/browser/content/map-view-worker.js +3 -3
  28. package/dist/browser/content/pdf-messages.js +16 -2
  29. package/dist/browser/content/pdf-messages.js.map +1 -1
  30. package/dist/browser/content/pdf-viewer-engine.js +15 -15
  31. package/dist/browser/content/pdf-viewer-worker.js +4 -5
  32. package/dist/browser/feedback/prompt-confirm.js +2 -0
  33. package/dist/browser/feedback/prompt-confirm.js.map +1 -1
  34. package/dist/browser/internal/truncated-title.js +9 -0
  35. package/dist/browser/internal/truncated-title.js.map +1 -0
  36. package/dist/browser/intl/messages.js +1 -1
  37. package/dist/browser/intl/messages.js.map +1 -1
  38. package/dist/browser/layout/DetailPanel.js +3 -5
  39. package/dist/browser/layout/DetailPanel.js.map +1 -1
  40. package/dist/browser/layout/FloatingWindow.js +416 -122
  41. package/dist/browser/layout/FloatingWindow.js.map +1 -1
  42. package/dist/browser/layout/PanelDialog.js +3 -1
  43. package/dist/browser/layout/PanelDialog.js.map +1 -1
  44. package/dist/browser/layout/PersonPopover.js +406 -0
  45. package/dist/browser/layout/PersonPopover.js.map +1 -0
  46. package/dist/browser/layout/floating-window-geometry.js +58 -2
  47. package/dist/browser/layout/floating-window-geometry.js.map +1 -1
  48. package/dist/browser/layout/floating-window-messages.js +12 -0
  49. package/dist/browser/layout/floating-window-messages.js.map +1 -1
  50. package/dist/browser/layout/index.js +1 -0
  51. package/dist/browser/layout/index.js.map +1 -1
  52. package/dist/ssr/actions/CommandMenu.js +2 -2
  53. package/dist/ssr/actions/CommandMenu.js.map +1 -1
  54. package/dist/ssr/actions/SplitButton.js +5 -7
  55. package/dist/ssr/actions/SplitButton.js.map +1 -1
  56. package/dist/ssr/actions/Toolbar.js +16 -7
  57. package/dist/ssr/actions/Toolbar.js.map +1 -1
  58. package/dist/ssr/actions/ViewTabs.js +6 -5
  59. package/dist/ssr/actions/ViewTabs.js.map +1 -1
  60. package/dist/ssr/chat/ChatComposer.js +31 -30
  61. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  62. package/dist/ssr/content/Lightbox.js +659 -150
  63. package/dist/ssr/content/Lightbox.js.map +1 -1
  64. package/dist/ssr/content/PdfPages.js +8 -3
  65. package/dist/ssr/content/PdfPages.js.map +1 -1
  66. package/dist/ssr/content/PdfThumbnails.js +189 -0
  67. package/dist/ssr/content/PdfThumbnails.js.map +1 -0
  68. package/dist/ssr/content/PdfViewer.js +11 -3
  69. package/dist/ssr/content/PdfViewer.js.map +1 -1
  70. package/dist/ssr/content/Timeline.js +2 -5
  71. package/dist/ssr/content/Timeline.js.map +1 -1
  72. package/dist/ssr/content/code-highlight.js +24 -11
  73. package/dist/ssr/content/code-highlight.js.map +1 -1
  74. package/dist/ssr/content/index.js +5 -1
  75. package/dist/ssr/content/index.js.map +1 -1
  76. package/dist/ssr/content/lightbox-messages.js +64 -18
  77. package/dist/ssr/content/lightbox-messages.js.map +1 -1
  78. package/dist/ssr/content/lightbox-renderers.js +6 -0
  79. package/dist/ssr/content/lightbox-renderers.js.map +1 -0
  80. package/dist/ssr/content/pdf-messages.js +16 -2
  81. package/dist/ssr/content/pdf-messages.js.map +1 -1
  82. package/dist/ssr/feedback/prompt-confirm.js +1 -0
  83. package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
  84. package/dist/ssr/inputs/ChoiceInputs.js +2 -2
  85. package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
  86. package/dist/ssr/inputs/SignatureInput.js +2 -2
  87. package/dist/ssr/inputs/SignatureInput.js.map +1 -1
  88. package/dist/ssr/inputs/markdown/SlashCommands.js +2 -2
  89. package/dist/ssr/inputs/markdown/SlashCommands.js.map +1 -1
  90. package/dist/ssr/internal/truncated-title.js +9 -0
  91. package/dist/ssr/internal/truncated-title.js.map +1 -0
  92. package/dist/ssr/intl/messages.js +1 -1
  93. package/dist/ssr/intl/messages.js.map +1 -1
  94. package/dist/ssr/layout/DetailPanel.js +1 -4
  95. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  96. package/dist/ssr/layout/FloatingWindow.js +286 -73
  97. package/dist/ssr/layout/FloatingWindow.js.map +1 -1
  98. package/dist/ssr/layout/PanelDialog.js +1 -0
  99. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  100. package/dist/ssr/layout/PersonPopover.js +248 -0
  101. package/dist/ssr/layout/PersonPopover.js.map +1 -0
  102. package/dist/ssr/layout/floating-window-geometry.js +58 -2
  103. package/dist/ssr/layout/floating-window-geometry.js.map +1 -1
  104. package/dist/ssr/layout/floating-window-messages.js +12 -0
  105. package/dist/ssr/layout/floating-window-messages.js.map +1 -1
  106. package/dist/ssr/layout/index.js +1 -0
  107. package/dist/ssr/layout/index.js.map +1 -1
  108. package/dist/styles.css +1 -1
  109. package/dist/types/actions/SplitButton.d.ts +2 -0
  110. package/dist/types/actions/Toolbar.d.ts +6 -0
  111. package/dist/types/chat/ChatComposer.d.ts +1 -0
  112. package/dist/types/content/Lightbox.d.ts +54 -14
  113. package/dist/types/content/PdfPages.d.ts +7 -1
  114. package/dist/types/content/PdfThumbnails.d.ts +26 -0
  115. package/dist/types/content/PdfViewer.d.ts +12 -3
  116. package/dist/types/content/index.d.ts +4 -2
  117. package/dist/types/content/lightbox-messages.d.ts +31 -8
  118. package/dist/types/content/lightbox-renderers.d.ts +3 -0
  119. package/dist/types/content/pdf-messages.d.ts +7 -0
  120. package/dist/types/internal/truncated-title.d.ts +7 -0
  121. package/dist/types/layout/FloatingWindow.d.ts +29 -1
  122. package/dist/types/layout/PersonPopover.d.ts +70 -0
  123. package/dist/types/layout/floating-window-geometry.d.ts +20 -3
  124. package/dist/types/layout/floating-window-messages.d.ts +6 -0
  125. package/dist/types/layout/index.d.ts +3 -2
  126. package/package.json +20 -20
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["actions/ViewTabs.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { createScrollFade, scrollFadeEdges } from \"../layout/scroll-fade\";\nimport Dropdown, { type DropdownItem } from \"./Dropdown\";\n\nexport type ViewTab = {\n id: string;\n label: string;\n href: string;\n icon?: string;\n count?: number | string;\n /** A short quiet label after the count, such as \"New\" for a view people have not opened yet. */\n badge?: string;\n /** Stays in the strip after More at every width, for a view of another kind than the ones that overflow. */\n pinned?: boolean;\n};\nexport type ViewTabsProps = {\n /** Accessible name of the navigation landmark, e.g. \"Views\". */\n label: string;\n items: readonly ViewTab[];\n /** Id of the open view; the server reads it from `?view=`. Unknown ids select nothing. */\n current: string | undefined;\n /** At most this many views before More (default 5). */\n max?: number;\n /**\n * The strip shows only the views that fit its room and counts the rest in More, instead of scrolling them. The open\n * view and pinned views stay. Pair it with a larger `max` so a wide head shows more views.\n */\n fit?: boolean;\n class?: string;\n};\n\n/** Two deterministic strip levels; only opening the menu reads CSS visibility. */\nexport function viewTabsLayout(items: readonly ViewTab[], current: string | undefined, max = 5) {\n // At least one slot keeps the current view visible, including for an invalid limit.\n const limit = Number.isFinite(max) ? Math.max(1, Math.floor(max)) : 5;\n // Pinned views never overflow, so they take no slot.\n const flowing = items.flatMap((item, index) => (item.pinned ? [] : [index]));\n const pinned = items.flatMap((item, index) => (item.pinned ? [index] : []));\n const currentIndex = items.findIndex((item) => item.id === current);\n const currentPosition = flowing.indexOf(currentIndex);\n const visible = (size: number) => {\n const indices = flowing.slice(0, size);\n if (currentPosition >= size) indices[indices.length - 1] = currentIndex;\n return indices;\n };\n const wide = visible(limit);\n const compact = visible(Math.min(limit, 3));\n return { wide, compact, pinned, wideHidden: flowing.length - wide.length, compactHidden: flowing.length - compact.length };\n}\n\n/**\n * Self-contained: the server script embeds this before hydration. A fitting strip first keeps only the views that fit\n * its room and counts the rest in More; then the open or focused view scrolls into the strip.\n */\nfunction settleViewTabs(list: Element | null, edges: (element: HTMLElement) => string | undefined, focused?: HTMLElement) {\n if (!(list instanceof HTMLElement)) return;\n const more = list.querySelector<HTMLElement>(\":scope > .k2b-view-tabs__more\");\n const fitCount = more?.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"fit\"]');\n const flowing = Array.from(list.querySelectorAll<HTMLElement>(\":scope > .k2b-view-tabs__item:not([data-pinned])\"));\n\n for (const item of flowing) item.removeAttribute(\"data-fit-hidden\");\n more?.removeAttribute(\"data-fit\");\n // The shown entries against the strip's inner room, whatever its scroll and padding.\n const overflows = () => {\n const boxes = Array.from(list.children)\n .filter((child) => child instanceof HTMLElement && child.tagName === \"LI\" && child.getClientRects().length > 0)\n .map((child) => child.getBoundingClientRect());\n if (boxes.length === 0) return false;\n const style = getComputedStyle(list);\n const room = list.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);\n return Math.max(...boxes.map((box) => box.right)) - Math.min(...boxes.map((box) => box.left)) > room + 0.5;\n };\n // The phone head row keeps its scrolling strip: its CSS turns fitting off.\n const fits = list.hasAttribute(\"data-fit-room\") && getComputedStyle(list).getPropertyValue(\"--k2b-view-tabs-fit\").trim() !== \"none\";\n if (fits && more && fitCount && overflows()) {\n // Count from the level on screen: the compact strip already keeps fewer views than the wide one.\n const compact = more.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"compact\"]');\n const compactShown = Boolean(compact && getComputedStyle(compact).display !== \"none\");\n const behind = Number(compactShown ? more.dataset.behindCompact : more.dataset.behindWide) || 0;\n // The last views on screen leave first; the open view stays.\n const candidates = flowing.filter((item) => item.getClientRects().length > 0 && !item.querySelector(\"[aria-current=page]\")).reverse();\n more.setAttribute(\"data-fit\", \"\");\n let hidden = 0;\n for (const item of candidates) {\n item.setAttribute(\"data-fit-hidden\", \"\");\n hidden += 1;\n fitCount.textContent = `+${behind + hidden}`;\n if (!overflows()) break;\n }\n if (hidden === 0) more.removeAttribute(\"data-fit\");\n }\n const current = focused ?? list.querySelector(\".k2b-view-tabs__tab[aria-current=page]\");\n if (current && current.getClientRects().length > 0 && list.scrollWidth - list.clientWidth > 1) {\n const bounds = list.getBoundingClientRect();\n const item = current.getBoundingClientRect();\n const fade = edges(list);\n const style = getComputedStyle(list);\n const left = fade === \"top\" || fade === \"both\" ? parseFloat(style.scrollPaddingLeft) || 0 : 0;\n const right = fade === \"bottom\" || fade === \"both\" ? parseFloat(style.scrollPaddingRight) || 0 : 0;\n if (item.left < bounds.left + left || item.right > bounds.right - right) {\n let offset = item.left - bounds.left - (bounds.width - item.width) / 2;\n if (focused) {\n // Reserve padding at the destination edge; native clamping drops it when that end is reached.\n offset =\n item.left < bounds.left + left\n ? item.left - bounds.left - (parseFloat(style.scrollPaddingLeft) || 0)\n : item.right - bounds.right + (parseFloat(style.scrollPaddingRight) || 0);\n }\n // Only the strip moves: scrollIntoView would also scroll the page. Instant keeps the first frame free of animation.\n list.scrollTo({ left: list.scrollLeft + offset, behavior: \"instant\" });\n }\n }\n const fade = edges(list);\n if (fade) list.setAttribute(\"data-scroll-fade\", fade);\n else list.removeAttribute(\"data-scroll-fade\");\n}\n\ntype WatchedViewTabs = HTMLElement & {\n __k2bViewTabsWatch?: {\n resize: ResizeObserver;\n focus: (event: FocusEvent) => void;\n preferCurrent: boolean;\n connect: () => void;\n /** Runs one fit in the next frame; calls before it runs share it. */\n schedule: () => void;\n frame: number;\n /** The head lead's width and the widths of the shown entries when the last fit ended. */\n room: string;\n /** Fits again once web fonts finish loading: their metrics change every view's width, not the lead's. */\n fonts: () => void;\n };\n};\n\n/**\n * Also embedded, so it must not close over module state.\n *\n * A fitting strip converges by construction. It fits again only when the strip renders, web fonts finish loading, or\n * a notification finds another width of the head lead or of an entry that the last fit left shown. A fit only shows\n * and hides entries: the lead is an inline-size container that takes no width from the strip, and every entry keeps\n * its own width (`flex: none`), so the notifications a fit causes find the widths it ended with and stop there.\n */\nfunction watchViewTabs(list: WatchedViewTabs | null, settle: typeof settleViewTabs, edges: (element: HTMLElement) => string | undefined) {\n if (!(list instanceof HTMLElement)) return;\n const fits = list.hasAttribute(\"data-fit-room\");\n const roomOf = () => list.closest<HTMLElement>(\".k2b-app-workspace__head-lead\");\n // What a fit depends on: the lead's width and each shown entry's width, which fonts, icons and labels change.\n const measured = () =>\n [roomOf()?.clientWidth ?? -1, ...Array.from(list.children, (child) => child.getBoundingClientRect().width)].join(\" \");\n // A DOM property survives hydration: one observer and focus listener per reused list.\n let watch = list.__k2bViewTabsWatch;\n if (!watch) {\n const focus = (event: FocusEvent) => {\n // Pointer focus must not move the target under the pointer.\n if (watch && event.target instanceof HTMLElement && event.target.matches(\".k2b-view-tabs__tab:focus-visible\")) {\n watch.preferCurrent = false;\n settle(list, edges, event.target);\n }\n };\n const settleNow = () => {\n const focused = document.activeElement;\n if (\n watch?.preferCurrent === false &&\n focused instanceof HTMLElement &&\n list.contains(focused) &&\n focused.matches(\".k2b-view-tabs__tab:focus-visible\")\n )\n settle(list, edges, focused);\n else settle(list, edges);\n };\n // Head actions parse after the views; settle again after their layout, before paint, and on later resizes.\n const connect = () => {\n if (!watch) return;\n watch.resize.disconnect();\n watch.resize.observe(list);\n for (const child of Array.from(list.children)) watch.resize.observe(child);\n const room = roomOf();\n if (fits && room) watch.resize.observe(room);\n };\n // Fitting resizes the strip and possibly the head, which other observers may watch. Inside a ResizeObserver\n // callback that would leave their notifications undelivered, so a fit runs in the next frame, still before it paints.\n const schedule = () => {\n if (!watch || watch.frame) return;\n watch.frame = requestAnimationFrame(() => {\n if (!watch) return;\n watch.frame = 0;\n if (!list.isConnected) return;\n settleNow();\n watch.room = measured();\n });\n };\n watch = {\n resize: new ResizeObserver(() => {\n // A scrolling strip only scrolls and settles at once.\n if (!fits) return settleNow();\n // Heights follow the fit, and hidden entries measure 0 by its own doing: only another measure counts.\n if (watch && measured() !== watch.room) watch.schedule();\n }),\n focus,\n preferCurrent: true,\n connect,\n schedule,\n frame: 0,\n room: \"\",\n fonts: () => watch?.schedule(),\n };\n Object.defineProperty(list, \"__k2bViewTabsWatch\", { value: watch, configurable: true });\n list.addEventListener(\"focusin\", focus);\n // A first visit can paint before the web fonts load; the server frame and the client then fit the same metrics.\n if (fits && document.fonts) {\n document.fonts.addEventListener(\"loadingdone\", watch.fonts);\n void document.fonts.ready.then(watch.fonts);\n }\n }\n watch.preferCurrent = true;\n watch.connect();\n settle(list, edges);\n if (fits) {\n watch.room = measured();\n // The head's actions parse after the views. A frame's animation callbacks run before its first layout and\n // paint, so this fit also counts their room in the first frame.\n watch.schedule();\n }\n return watch;\n}\nconst VIEW_TABS_SCRIPT = `(${watchViewTabs})(document.currentScript&&document.currentScript.previousElementSibling,${settleViewTabs},${scrollFadeEdges})`;\n\n/**\n * URL-backed object views. Every view is an ordinary document link, in the strip and under More, so reload, back,\n * and forward keep the view the URL names.\n */\nexport function ViewTabs(props: ViewTabsProps): JSX.Element {\n const messages = useUiMessages();\n const layout = createMemo(() => viewTabsLayout(props.items, props.current, props.max));\n const stripItems = new Map<number, HTMLLIElement>();\n let list: HTMLUListElement | undefined;\n createScrollFade(\n () => list,\n () => true,\n );\n onMount(() => {\n const watch = watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges);\n let disposed = false;\n // Later mount effects can invalidate WebKit's scroll layout after this\n // initial settle. Finish once the mount task is complete, before its first\n // frame; ResizeObserver alone runs too late for that frame.\n queueMicrotask(() => {\n if (!disposed && watch?.preferCurrent) settleViewTabs(list ?? null, scrollFadeEdges);\n });\n onCleanup(() => {\n disposed = true;\n watch?.resize.disconnect();\n if (watch?.frame) cancelAnimationFrame(watch.frame);\n if (watch) document.fonts?.removeEventListener(\"loadingdone\", watch.fonts);\n if (list && watch) {\n list.removeEventListener(\"focusin\", watch.focus);\n Reflect.deleteProperty(list, \"__k2bViewTabsWatch\");\n }\n });\n });\n // User effects run after Solid's render effects, including For and aria-current, in the same task.\n // What the strip shows: another open view, view, label, count or badge can change what fits. Equal content in a new\n // array settles nothing again.\n const shown = createMemo(() =>\n [\n props.current ?? \"\",\n layout().wide.join(\",\"),\n ...props.items.map((item) => `${item.id}\\u0000${item.label}\\u0000${item.count ?? \"\"}\\u0000${item.badge ?? \"\"}`),\n ].join(\"\\u0001\"),\n );\n createEffect(on(shown, () => watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges), { defer: true }));\n const [open, setOpen] = createSignal(false);\n const [menuItems, setMenuItems] = createSignal<DropdownItem[]>([]);\n const onOpenChange = (next: boolean) => {\n if (next) {\n setMenuItems(\n props.items\n .filter(\n (item, index) =>\n !item.pinned &&\n item.id !== props.current &&\n (!layout().wide.includes(index) || stripItems.get(index)?.getClientRects().length === 0),\n )\n .map((item) => ({\n href: item.href,\n label: item.label,\n icon: item.icon,\n trailing: item.count !== undefined ? <span class=\"k2b-view-tabs__count\">{item.count}</span> : undefined,\n })),\n );\n }\n setOpen(next);\n };\n const tabContent = (item: ViewTab) => (\n <>\n <Show when={item.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span class=\"k2b-view-tabs__label k2b-truncate-fade\">{item.label}</span>\n <Show when={item.count !== undefined}>\n <span class=\"k2b-view-tabs__count\">{item.count}</span>\n </Show>\n <Show when={item.badge}>{(badge) => <span class=\"k2b-view-tabs__badge\">{badge()}</span>}</Show>\n </>\n );\n const stripItem = (index: number) => {\n const item = () => props.items[index]!;\n onCleanup(() => stripItems.delete(index));\n return (\n <li\n ref={(element) => stripItems.set(index, element)}\n class=\"k2b-view-tabs__item\"\n data-view-tab={item().id}\n data-pinned={item().pinned ? \"\" : undefined}\n data-compact-hidden={!item().pinned && !layout().compact.includes(index) ? \"\" : undefined}\n >\n <a class=\"k2b-view-tabs__tab\" href={item().href} aria-current={item().id === props.current ? \"page\" : undefined}>\n {tabContent(item())}\n </a>\n </li>\n );\n };\n return (\n <nav class={`k2b-view-tabs ${props.class ?? \"\"}`} aria-label={props.label}>\n <ul\n ref={list}\n class=\"k2b-view-tabs__list\"\n data-scroll-fade-mode=\"both\"\n data-scroll-fade-axis=\"horizontal\"\n data-fit-room={props.fit ? \"\" : undefined}\n >\n <For each={layout().wide}>{stripItem}</For>\n {/* A fitting strip keeps More ready, hidden until a view leaves the strip. */}\n <Show when={layout().compactHidden + layout().wideHidden > 0 || (props.fit && layout().wide.length > 1)}>\n <li\n class=\"k2b-view-tabs__more\"\n data-wide={layout().wideHidden > 0 ? \"\" : undefined}\n data-behind-wide={layout().wideHidden}\n data-behind-compact={layout().compactHidden}\n >\n <Dropdown.Root items={menuItems()} open={open()} onOpenChange={onOpenChange} label={messages().moreViews}>\n <Dropdown.Trigger appearance=\"plain\" class=\"k2b-view-tabs__tab k2b-view-tabs__more-trigger\" label={messages().moreViews}>\n <span class=\"k2b-view-tabs__label\">{messages().more}</span>\n <Show when={layout().wideHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"wide\">\n +{layout().wideHidden}\n </span>\n </Show>\n <Show when={layout().compactHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"compact\">\n +{layout().compactHidden}\n </span>\n </Show>\n {/* Written by the strip's fit, never by the render, so a rerender keeps the count it measured. */}\n <span class=\"k2b-view-tabs__more-count\" data-level=\"fit\" />\n <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </li>\n </Show>\n <For each={layout().pinned}>{stripItem}</For>\n </ul>\n <script innerHTML={VIEW_TABS_SCRIPT} />\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC9G,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,gBAAgB,EAAE,eAAe,QAAQ,uBAAuB;AACzE,OAAO,QAAQ,MAA6B,YAAY;AA6BxD;AACA,OAAO,SAAS,cAAc,CAAC,KAAyB,EAAE,OAA2B,EAAE,GAAG,GAAG,CAAC,EAAE;EAC9F;EACA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;EACrE;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAM,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,KAAK,CAAE,CAAC;EAC5E,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC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AAC;QAAA;QAAE,YAAY,EAAE,YAAY;QAAA,IAAE,KAAK;UAAA,OAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;QAAA;QAAA;UAAA,yBACrG,QAAQ,CAAC,OAAO;YAAC,UAAU;YAAA;YAAA,IAAgE,KAAK;cAAA,OAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;YAAA;YAAA;cAAA,gCACjF,QAAQ,CAAC,CAAC,CAAC,IAAI,sBAClD,IAAI;gBAAA,IAAC,IAAI;kBAAA,OAAE,MAAM,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC;gBAAA;gBAAA;kBAAA,+BAE7B,MAAM,CAAC,CAAC,CAAC,UAAU;gBAAA;cAAA,sBAGxB,IAAI;gBAAA,IAAC,IAAI;kBAAA,OAAE,MAAM,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC;gBAAA;gBAAA;kBAAA,+BAEhC,MAAM,CAAC,CAAC,CAAC,aAAa;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,gCAUnC,GAAG;IAAA,IAAC,IAAI;MAAA,OAAE,MAAM,CAAC,CAAC,CAAC,MAAM;IAAA;IAAA,UAAG;EAAS,KAErB,gBAAgB;AAGzC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["actions/ViewTabs.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { createScrollFade, scrollFadeEdges } from \"../layout/scroll-fade\";\nimport Dropdown, { type DropdownItem } from \"./Dropdown\";\n\nexport type ViewTab = {\n id: string;\n label: string;\n href: string;\n icon?: string;\n count?: number | string;\n /** A short quiet label after the count, such as \"New\" for a view people have not opened yet. */\n badge?: string;\n /** Stays in the strip after More at every width, for a view of another kind than the ones that overflow. */\n pinned?: boolean;\n};\nexport type ViewTabsProps = {\n /** Accessible name of the navigation landmark, e.g. \"Views\". */\n label: string;\n items: readonly ViewTab[];\n /** Id of the open view; the server reads it from `?view=`. Unknown ids select nothing. */\n current: string | undefined;\n /** At most this many views before More (default 5). */\n max?: number;\n /**\n * The strip shows only the views that fit its room and counts the rest in More, instead of scrolling them. The open\n * view and pinned views stay. Pair it with a larger `max` so a wide head shows more views.\n */\n fit?: boolean;\n class?: string;\n};\n\n/** Two deterministic strip levels; only opening the menu reads CSS visibility. */\nexport function viewTabsLayout(items: readonly ViewTab[], current: string | undefined, max = 5) {\n // At least one slot keeps the current view visible, including for an invalid limit.\n const limit = Number.isFinite(max) ? Math.max(1, Math.floor(max)) : 5;\n // Pinned views never overflow, so they take no slot.\n const flowing = items.flatMap((item, index) => (item.pinned ? [] : [index]));\n const pinned = items.flatMap((item, index) => (item.pinned ? [index] : []));\n const currentIndex = items.findIndex((item) => item.id === current);\n const currentPosition = flowing.indexOf(currentIndex);\n const visible = (size: number) => {\n const indices = flowing.slice(0, size);\n if (currentPosition >= size) indices[indices.length - 1] = currentIndex;\n return indices;\n };\n const wide = visible(limit);\n const compact = visible(Math.min(limit, 3));\n return { wide, compact, pinned, wideHidden: flowing.length - wide.length, compactHidden: flowing.length - compact.length };\n}\n\n/**\n * Self-contained: the server script embeds this before hydration. A fitting strip first keeps only the views that fit\n * its room and counts the rest in More; then the open or focused view scrolls into the strip.\n */\nfunction settleViewTabs(list: Element | null, edges: (element: HTMLElement) => string | undefined, focused?: HTMLElement) {\n if (!(list instanceof HTMLElement)) return;\n const more = list.querySelector<HTMLElement>(\":scope > .k2b-view-tabs__more\");\n const fitCount = more?.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"fit\"]');\n const flowing = Array.from(list.querySelectorAll<HTMLElement>(\":scope > .k2b-view-tabs__item:not([data-pinned])\"));\n\n for (const item of flowing) item.removeAttribute(\"data-fit-hidden\");\n more?.removeAttribute(\"data-fit\");\n // The shown entries against the strip's inner room, whatever its scroll and padding.\n const overflows = () => {\n const boxes = Array.from(list.children)\n .filter((child) => child instanceof HTMLElement && child.tagName === \"LI\" && child.getClientRects().length > 0)\n .map((child) => child.getBoundingClientRect());\n if (boxes.length === 0) return false;\n const style = getComputedStyle(list);\n const room = list.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);\n return Math.max(...boxes.map((box) => box.right)) - Math.min(...boxes.map((box) => box.left)) > room + 0.5;\n };\n // The phone head row keeps its scrolling strip: its CSS turns fitting off.\n const fits = list.hasAttribute(\"data-fit-room\") && getComputedStyle(list).getPropertyValue(\"--k2b-view-tabs-fit\").trim() !== \"none\";\n if (fits && more && fitCount && overflows()) {\n // Count from the level on screen: the compact strip already keeps fewer views than the wide one.\n const compact = more.querySelector<HTMLElement>('.k2b-view-tabs__more-count[data-level=\"compact\"]');\n const compactShown = Boolean(compact && getComputedStyle(compact).display !== \"none\");\n const behind = Number(compactShown ? more.dataset.behindCompact : more.dataset.behindWide) || 0;\n // The last views on screen leave first; the open view stays.\n const candidates = flowing.filter((item) => item.getClientRects().length > 0 && !item.querySelector(\"[aria-current=page]\")).reverse();\n more.setAttribute(\"data-fit\", \"\");\n let hidden = 0;\n for (const item of candidates) {\n item.setAttribute(\"data-fit-hidden\", \"\");\n hidden += 1;\n fitCount.textContent = `+${behind + hidden}`;\n if (!overflows()) break;\n }\n if (hidden === 0) more.removeAttribute(\"data-fit\");\n }\n const current = focused ?? list.querySelector(\".k2b-view-tabs__tab[aria-current=page]\");\n if (current && current.getClientRects().length > 0 && list.scrollWidth - list.clientWidth > 1) {\n const bounds = list.getBoundingClientRect();\n const item = current.getBoundingClientRect();\n const fade = edges(list);\n const style = getComputedStyle(list);\n const left = fade === \"top\" || fade === \"both\" ? parseFloat(style.scrollPaddingLeft) || 0 : 0;\n const right = fade === \"bottom\" || fade === \"both\" ? parseFloat(style.scrollPaddingRight) || 0 : 0;\n if (item.left < bounds.left + left || item.right > bounds.right - right) {\n let offset = item.left - bounds.left - (bounds.width - item.width) / 2;\n if (focused) {\n // Reserve padding at the destination edge; native clamping drops it when that end is reached.\n offset =\n item.left < bounds.left + left\n ? item.left - bounds.left - (parseFloat(style.scrollPaddingLeft) || 0)\n : item.right - bounds.right + (parseFloat(style.scrollPaddingRight) || 0);\n }\n // Only the strip moves: scrollIntoView would also scroll the page. Instant keeps the first frame free of animation.\n list.scrollTo({ left: list.scrollLeft + offset, behavior: \"instant\" });\n }\n }\n const fade = edges(list);\n if (fade) list.setAttribute(\"data-scroll-fade\", fade);\n else list.removeAttribute(\"data-scroll-fade\");\n}\n\ntype WatchedViewTabs = HTMLElement & {\n __k2bViewTabsWatch?: {\n resize: ResizeObserver;\n focus: (event: FocusEvent) => void;\n preferCurrent: boolean;\n connect: () => void;\n /** Runs one fit in the next frame; calls before it runs share it. */\n schedule: () => void;\n frame: number;\n /** The room's width and the widths of the shown entries when the last fit ended. */\n room: string;\n /** Fits again once web fonts finish loading: their metrics change every view's width, not the lead's. */\n fonts: () => void;\n };\n};\n\n/**\n * Also embedded, so it must not close over module state.\n *\n * A fitting strip converges by construction. It fits again only when the strip renders, web fonts finish loading, or\n * a notification finds another width of its room or of an entry that the last fit left shown. The room is the head\n * lead, or outside a workspace head the strip's own root, which takes its width from its row. A fit only shows and\n * hides entries: neither room takes width from the entries, and every entry keeps its own width (`flex: none`), so the\n * notifications a fit causes find the widths it ended with and stop there.\n */\nfunction watchViewTabs(list: WatchedViewTabs | null, settle: typeof settleViewTabs, edges: (element: HTMLElement) => string | undefined) {\n if (!(list instanceof HTMLElement)) return;\n const fits = list.hasAttribute(\"data-fit-room\");\n const roomOf = () => list.closest<HTMLElement>(\".k2b-app-workspace__head-lead\") ?? list.closest<HTMLElement>(\".k2b-view-tabs\");\n // What a fit depends on: the room's width and each shown entry's width, which fonts, icons and labels change.\n const measured = () =>\n [roomOf()?.clientWidth ?? -1, ...Array.from(list.children, (child) => child.getBoundingClientRect().width)].join(\" \");\n // A DOM property survives hydration: one observer and focus listener per reused list.\n let watch = list.__k2bViewTabsWatch;\n if (!watch) {\n const focus = (event: FocusEvent) => {\n // Pointer focus must not move the target under the pointer.\n if (watch && event.target instanceof HTMLElement && event.target.matches(\".k2b-view-tabs__tab:focus-visible\")) {\n watch.preferCurrent = false;\n settle(list, edges, event.target);\n }\n };\n const settleNow = () => {\n const focused = document.activeElement;\n if (\n watch?.preferCurrent === false &&\n focused instanceof HTMLElement &&\n list.contains(focused) &&\n focused.matches(\".k2b-view-tabs__tab:focus-visible\")\n )\n settle(list, edges, focused);\n else settle(list, edges);\n };\n // Head actions parse after the views; settle again after their layout, before paint, and on later resizes.\n const connect = () => {\n if (!watch) return;\n watch.resize.disconnect();\n watch.resize.observe(list);\n for (const child of Array.from(list.children)) watch.resize.observe(child);\n const room = roomOf();\n if (fits && room) watch.resize.observe(room);\n };\n // Fitting resizes the strip and possibly the head, which other observers may watch. Inside a ResizeObserver\n // callback that would leave their notifications undelivered, so a fit runs in the next frame, still before it paints.\n const schedule = () => {\n if (!watch || watch.frame) return;\n watch.frame = requestAnimationFrame(() => {\n if (!watch) return;\n watch.frame = 0;\n if (!list.isConnected) return;\n settleNow();\n watch.room = measured();\n });\n };\n watch = {\n resize: new ResizeObserver(() => {\n // A scrolling strip only scrolls and settles at once.\n if (!fits) return settleNow();\n // Heights follow the fit, and hidden entries measure 0 by its own doing: only another measure counts.\n if (watch && measured() !== watch.room) watch.schedule();\n }),\n focus,\n preferCurrent: true,\n connect,\n schedule,\n frame: 0,\n room: \"\",\n fonts: () => watch?.schedule(),\n };\n Object.defineProperty(list, \"__k2bViewTabsWatch\", { value: watch, configurable: true });\n list.addEventListener(\"focusin\", focus);\n // A first visit can paint before the web fonts load; the server frame and the client then fit the same metrics.\n if (fits && document.fonts) {\n document.fonts.addEventListener(\"loadingdone\", watch.fonts);\n void document.fonts.ready.then(watch.fonts);\n }\n }\n watch.preferCurrent = true;\n watch.connect();\n settle(list, edges);\n if (fits) {\n watch.room = measured();\n // The head's actions parse after the views. A frame's animation callbacks run before its first layout and\n // paint, so this fit also counts their room in the first frame.\n watch.schedule();\n }\n return watch;\n}\nconst VIEW_TABS_SCRIPT = `(${watchViewTabs})(document.currentScript&&document.currentScript.previousElementSibling,${settleViewTabs},${scrollFadeEdges})`;\n\n/**\n * URL-backed object views. Every view is an ordinary document link, in the strip and under More, so reload, back,\n * and forward keep the view the URL names.\n */\nexport function ViewTabs(props: ViewTabsProps): JSX.Element {\n const messages = useUiMessages();\n const layout = createMemo(() => viewTabsLayout(props.items, props.current, props.max));\n const stripItems = new Map<number, HTMLLIElement>();\n let list: HTMLUListElement | undefined;\n createScrollFade(\n () => list,\n () => true,\n );\n onMount(() => {\n const watch = watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges);\n let disposed = false;\n // Later mount effects can invalidate WebKit's scroll layout after this\n // initial settle. Finish once the mount task is complete, before its first\n // frame; ResizeObserver alone runs too late for that frame.\n queueMicrotask(() => {\n if (!disposed && watch?.preferCurrent) settleViewTabs(list ?? null, scrollFadeEdges);\n });\n onCleanup(() => {\n disposed = true;\n watch?.resize.disconnect();\n if (watch?.frame) cancelAnimationFrame(watch.frame);\n if (watch) document.fonts?.removeEventListener(\"loadingdone\", watch.fonts);\n if (list && watch) {\n list.removeEventListener(\"focusin\", watch.focus);\n Reflect.deleteProperty(list, \"__k2bViewTabsWatch\");\n }\n });\n });\n // User effects run after Solid's render effects, including For and aria-current, in the same task.\n // What the strip shows: another open view, view, label, count or badge can change what fits. Equal content in a new\n // array settles nothing again.\n const shown = createMemo(() =>\n [\n props.current ?? \"\",\n layout().wide.join(\",\"),\n ...props.items.map((item) => `${item.id}\\u0000${item.label}\\u0000${item.count ?? \"\"}\\u0000${item.badge ?? \"\"}`),\n ].join(\"\\u0001\"),\n );\n createEffect(on(shown, () => watchViewTabs(list ?? null, settleViewTabs, scrollFadeEdges), { defer: true }));\n const [open, setOpen] = createSignal(false);\n const [menuItems, setMenuItems] = createSignal<DropdownItem[]>([]);\n const onOpenChange = (next: boolean) => {\n if (next) {\n setMenuItems(\n props.items\n .filter(\n (item, index) =>\n !item.pinned &&\n item.id !== props.current &&\n (!layout().wide.includes(index) || stripItems.get(index)?.getClientRects().length === 0),\n )\n .map((item) => ({\n href: item.href,\n label: item.label,\n icon: item.icon,\n trailing: item.count !== undefined ? <span class=\"k2b-view-tabs__count\">{item.count}</span> : undefined,\n })),\n );\n }\n setOpen(next);\n };\n const tabContent = (item: ViewTab) => (\n <>\n <Show when={item.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span class=\"k2b-view-tabs__label k2b-truncate-fade\">{item.label}</span>\n <Show when={item.count !== undefined}>\n <span class=\"k2b-view-tabs__count\">{item.count}</span>\n </Show>\n <Show when={item.badge}>{(badge) => <span class=\"k2b-view-tabs__badge\">{badge()}</span>}</Show>\n </>\n );\n const stripItem = (index: number) => {\n const item = () => props.items[index]!;\n onCleanup(() => stripItems.delete(index));\n return (\n <li\n ref={(element) => stripItems.set(index, element)}\n class=\"k2b-view-tabs__item\"\n data-view-tab={item().id}\n data-pinned={item().pinned ? \"\" : undefined}\n data-compact-hidden={!item().pinned && !layout().compact.includes(index) ? \"\" : undefined}\n >\n <a class=\"k2b-view-tabs__tab\" href={item().href} aria-current={item().id === props.current ? \"page\" : undefined}>\n {tabContent(item())}\n </a>\n </li>\n );\n };\n return (\n <nav class={`k2b-view-tabs ${props.class ?? \"\"}`} aria-label={props.label}>\n <ul\n ref={list}\n class=\"k2b-view-tabs__list\"\n data-scroll-fade-mode=\"both\"\n data-scroll-fade-axis=\"horizontal\"\n data-fit-room={props.fit ? \"\" : undefined}\n >\n <For each={layout().wide}>{stripItem}</For>\n {/* A fitting strip keeps More ready, hidden until a view leaves the strip. */}\n <Show when={layout().compactHidden + layout().wideHidden > 0 || (props.fit && layout().wide.length > 1)}>\n <li\n class=\"k2b-view-tabs__more\"\n data-wide={layout().wideHidden > 0 ? \"\" : undefined}\n data-behind-wide={layout().wideHidden}\n data-behind-compact={layout().compactHidden}\n >\n <Dropdown.Root items={menuItems()} open={open()} onOpenChange={onOpenChange} label={messages().moreViews}>\n <Dropdown.Trigger appearance=\"plain\" class=\"k2b-view-tabs__tab k2b-view-tabs__more-trigger\" label={messages().moreViews}>\n <span class=\"k2b-view-tabs__label\">{messages().more}</span>\n <Show when={layout().wideHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"wide\">\n +{layout().wideHidden}\n </span>\n </Show>\n <Show when={layout().compactHidden > 0}>\n <span class=\"k2b-view-tabs__more-count\" data-level=\"compact\">\n +{layout().compactHidden}\n </span>\n </Show>\n {/* Written by the strip's fit, never by the render, so a rerender keeps the count it measured. */}\n <span class=\"k2b-view-tabs__more-count\" data-level=\"fit\" />\n <i class=\"ti ti-chevron-down\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\n </li>\n </Show>\n <For each={layout().pinned}>{stripItem}</For>\n </ul>\n <script innerHTML={VIEW_TABS_SCRIPT} />\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC9G,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,gBAAgB,EAAE,eAAe,QAAQ,uBAAuB;AACzE,OAAO,QAAQ,MAA6B,YAAY;AA6BxD;AACA,OAAO,SAAS,cAAc,CAAC,KAAyB,EAAE,OAA2B,EAAE,GAAG,GAAG,CAAC,EAAE;EAC9F;EACA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;EACrE;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAM,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,KAAK,CAAE,CAAC;EAC5E,MAAM,MAAM,GAA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;UAAA,OAAE,SAAS,CAAC,CAAC;QAAA;QAAA,IAAE,IAAI;UAAA,OAAE,IAAI,CAAC,CAAC;QAAA;QAAE,YAAY,EAAE,YAAY;QAAA,IAAE,KAAK;UAAA,OAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;QAAA;QAAA;UAAA,yBACrG,QAAQ,CAAC,OAAO;YAAC,UAAU;YAAA;YAAA,IAAgE,KAAK;cAAA,OAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;YAAA;YAAA;cAAA,gCACjF,QAAQ,CAAC,CAAC,CAAC,IAAI,sBAClD,IAAI;gBAAA,IAAC,IAAI;kBAAA,OAAE,MAAM,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC;gBAAA;gBAAA;kBAAA,+BAE7B,MAAM,CAAC,CAAC,CAAC,UAAU;gBAAA;cAAA,sBAGxB,IAAI;gBAAA,IAAC,IAAI;kBAAA,OAAE,MAAM,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC;gBAAA;gBAAA;kBAAA,+BAEhC,MAAM,CAAC,CAAC,CAAC,aAAa;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,gCAUnC,GAAG;IAAA,IAAC,IAAI;MAAA,OAAE,MAAM,CAAC,CAAC,CAAC,MAAM;IAAA;IAAA,UAAG;EAAS,KAErB,gBAAgB;AAGzC","ignoreList":[]}
@@ -15,7 +15,7 @@ var _tmpl$ = ["<span><strong", ">", "</strong></span>"],
15
15
  _tmpl$8 = ["<div class=\"k2b-chat-composer__microphone\">", "", "</div>"],
16
16
  _tmpl$9 = ["<div class=\"k2b-chat-composer__highlight\" aria-hidden=\"true\">", "\n</div>"],
17
17
  _tmpl$0 = "<textarea class=\"k2b-chat-composer__measure\" rows=\"1\" tabindex=\"-1\" aria-hidden=\"true\" readonly></textarea>",
18
- _tmpl$1 = ["<div class=\"k2b-chat-composer__input\" role=\"group\"", ">", "<textarea class=\"", "\" rows=\"1\"", "", "></textarea>", "</div>"],
18
+ _tmpl$1 = ["<div class=\"k2b-chat-composer__input\" role=\"group\"", ">", "<textarea class=\"", "\" rows=\"1\"", "", "", "></textarea>", "</div>"],
19
19
  _tmpl$10 = "<span class=\"k2b-dictation-mark\"></span>",
20
20
  _tmpl$11 = ["<span class=\"", "\">", "</span>"],
21
21
  _tmpl$12 = ["<span class=\"k2b-chat-composer__command-detail\"", "><small", ">", "</small><small", "><i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\"></i>", "</small></span>"],
@@ -176,6 +176,8 @@ const swallowTap = down => {
176
176
  const attachmentIcon = attachment => attachment.icon ?? (attachment.kind === "image" ? "ti ti-photo" : attachment.kind === "resource" ? "ti ti-link" : "ti ti-file");
177
177
  const hasContent = items => items.some(item => item != null && typeof item !== "boolean" && item !== "");
178
178
  export function ChatComposer(props) {
179
+ // A parent that recomputes the same key keeps the same draft: only a new value resets what belongs to the old one.
180
+ const draftKey = createMemo(() => props.draftKey);
179
181
  const accessory = children(() => props.accessory);
180
182
  const hasAccessory = () => hasContent(accessory.toArray());
181
183
  const hint = children(() => props.hint);
@@ -372,13 +374,13 @@ export function ChatComposer(props) {
372
374
  });
373
375
  const openingStart = createMemo(() => commandQuery()?.start);
374
376
  createEffect(() => {
375
- props.draftKey;
377
+ draftKey();
376
378
  const start = openingStart();
377
379
  if (start !== undefined) setCommandOpening(opening => opening + 1);
378
380
  });
379
381
  // A failed `open` row says so for the rest of its list opening.
380
382
  createEffect(() => {
381
- props.draftKey;
383
+ draftKey();
382
384
  commandOpening();
383
385
  setOpenFailures({});
384
386
  });
@@ -400,7 +402,7 @@ export function ChatComposer(props) {
400
402
  // Rows of a `fixedWhileOpen` section are the ones it had when this `/` opened the list; later ones wait for the next
401
403
  // `/`. A retry row starts another opening in the same open list, so it does not count.
402
404
  const fixedCommandKeys = createMemo(() => {
403
- props.draftKey;
405
+ draftKey();
404
406
  if (openingStart() === undefined) return undefined;
405
407
  return untrack(() => {
406
408
  const fixed = new Set((props.commandSections ?? []).filter(section => section.fixedWhileOpen).map(section => section.id));
@@ -435,7 +437,7 @@ export function ChatComposer(props) {
435
437
  const currentCommandQuery = createMemo(() => caretCommandToken()?.query);
436
438
  // Arrow marking belongs to one token in one draft; another draft or `/` starts at the top row again.
437
439
  createEffect(() => {
438
- props.draftKey;
440
+ draftKey();
439
441
  caretCommandStart();
440
442
  currentCommandQuery();
441
443
  setCommandMoved(false);
@@ -484,15 +486,15 @@ export function ChatComposer(props) {
484
486
  // cancels too, unless the opener announced that next move with `follow()`: its busy line moves to the status line,
485
487
  // and Escape still cancels there. Any later unannounced draft change cancels.
486
488
  createEffect(() => {
487
- const draftKey = props.draftKey;
489
+ const key = draftKey();
488
490
  const open = commandsOpen();
489
491
  const row = openingRow();
490
492
  const run = openingRun;
491
493
  if (!run || row === undefined) return;
492
- if (draftKey !== run.key) {
494
+ if (key !== run.key) {
493
495
  if (run.follow) {
494
496
  run.follow = false;
495
- run.key = draftKey;
497
+ run.key = key;
496
498
  run.moved = true;
497
499
  showCommandStatus({
498
500
  tone: "busy",
@@ -602,7 +604,7 @@ export function ChatComposer(props) {
602
604
  onCleanup(() => window.removeEventListener("pointerdown", onPointerDown, true));
603
605
  });
604
606
  createEffect(() => {
605
- props.draftKey;
607
+ draftKey();
606
608
  const token = commandQuery();
607
609
  setSearchError(false);
608
610
  if (!token || !props.searchCommands) {
@@ -693,7 +695,7 @@ export function ChatComposer(props) {
693
695
  const history = [];
694
696
  let historyIndex = -1;
695
697
  createEffect(() => {
696
- props.draftKey;
698
+ draftKey();
697
699
  untrack(() => {
698
700
  history.length = 0;
699
701
  historyIndex = -1;
@@ -940,8 +942,7 @@ export function ChatComposer(props) {
940
942
  // drops the source ends it; the words so far stay.
941
943
  // Memos compare values, so typing and arriving words never end it.
942
944
  const dictationField = createMemo(() => `${Boolean(props.dictation)}:${editBlocked()}`);
943
- const dictationDraft = createMemo(() => props.draftKey);
944
- createEffect(on([dictationField, dictationDraft], () => liveDictation.end(), {
945
+ createEffect(on([dictationField, draftKey], () => liveDictation.end(), {
945
946
  defer: true
946
947
  }));
947
948
  const hasDraft = () => Boolean(props.value.trim() || !running() && attachments().length > 0);
@@ -1100,7 +1101,7 @@ export function ChatComposer(props) {
1100
1101
  */
1101
1102
  const attachFilesFromCommand = (token, selection) => {
1102
1103
  if (!canSelectFiles()) return;
1103
- const key = props.draftKey;
1104
+ const key = draftKey();
1104
1105
  const previous = snapshot();
1105
1106
  const previousHistory = {
1106
1107
  entries: [...history],
@@ -1110,7 +1111,7 @@ export function ChatComposer(props) {
1110
1111
  edit(nextValue, reconcileChatMentions(props.value, nextValue, mentions()));
1111
1112
  setDismissed(true);
1112
1113
  chooseFiles(() => {
1113
- if (props.draftKey !== key || props.value !== nextValue) return;
1114
+ if (draftKey() !== key || props.value !== nextValue) return;
1114
1115
  setDismissed(true);
1115
1116
  props.onValueChange(previous.value);
1116
1117
  props.onMentionsChange?.(previous.mentions);
@@ -1123,7 +1124,7 @@ export function ChatComposer(props) {
1123
1124
  });
1124
1125
  });
1125
1126
  queueMicrotask(() => {
1126
- if (props.draftKey !== key || props.value !== nextValue) return;
1127
+ if (draftKey() !== key || props.value !== nextValue) return;
1127
1128
  textareaRef?.setSelectionRange(token.start, token.start);
1128
1129
  syncCaret();
1129
1130
  });
@@ -1145,7 +1146,7 @@ export function ChatComposer(props) {
1145
1146
  };
1146
1147
  const submit = async () => {
1147
1148
  if (!canSubmit()) return;
1148
- const key = props.draftKey;
1149
+ const key = draftKey();
1149
1150
  setSubmitting(true);
1150
1151
  try {
1151
1152
  if (isTouchOnly()) {
@@ -1153,7 +1154,7 @@ export function ChatComposer(props) {
1153
1154
  // The sheet's Back entry leaves first, so a submit handler that navigates finds the history settled.
1154
1155
  await dialogHistorySettled();
1155
1156
  // A draft that another one replaced, or that may no longer go out, is not sent and keeps its text.
1156
- if (disposed || props.draftKey !== key || !submittable()) return;
1157
+ if (disposed || draftKey() !== key || !submittable()) return;
1157
1158
  }
1158
1159
  const intent = running() ? runningSubmitIntent() : "send";
1159
1160
  const previousValue = props.value;
@@ -1244,7 +1245,7 @@ export function ChatComposer(props) {
1244
1245
  // From "+" a reference joins the text at the caret, apart from a word right before it.
1245
1246
  const lead = value => fromAdd && token.start > 0 && !/\s/.test(value[token.start - 1] ?? "") ? " " : "";
1246
1247
  const previous = snapshot();
1247
- const key = props.draftKey;
1248
+ const key = draftKey();
1248
1249
  const replacement = command.mention ? lead(props.value) + command.mention.name + " " : "";
1249
1250
  const nextValue = props.value.slice(0, token.start) + replacement + props.value.slice(token.end);
1250
1251
  const nextMentions = reconcileChatMentions(props.value, nextValue, mentions());
@@ -1268,7 +1269,7 @@ export function ChatComposer(props) {
1268
1269
  let restored = false;
1269
1270
  let mentioned;
1270
1271
  const restore = () => {
1271
- if (props.draftKey !== key || props.value !== nextValue) return;
1272
+ if (draftKey() !== key || props.value !== nextValue) return;
1272
1273
  setDismissed(true);
1273
1274
  props.onValueChange(previous.value);
1274
1275
  props.onMentionsChange?.(previous.mentions);
@@ -1285,7 +1286,7 @@ export function ChatComposer(props) {
1285
1286
  if (heldHistory && command.action) {
1286
1287
  await dialogHistorySettled();
1287
1288
  // Another draft or no composer any more: the command does not run against it.
1288
- if (disposed || props.draftKey !== key) return;
1289
+ if (disposed || draftKey() !== key) return;
1289
1290
  }
1290
1291
  const result = await command.action?.({
1291
1292
  setValue: value => edit(value),
@@ -1301,7 +1302,7 @@ export function ChatComposer(props) {
1301
1302
  showCommandStatus();
1302
1303
  } else if (result && "mention" in result) {
1303
1304
  // One undo step from the token to the reference, as if the row had been a reference itself.
1304
- if (props.draftKey === key && props.value === nextValue) {
1305
+ if (draftKey() === key && props.value === nextValue) {
1305
1306
  restore();
1306
1307
  restored = false;
1307
1308
  const name = result.mention.name;
@@ -1344,9 +1345,9 @@ export function ChatComposer(props) {
1344
1345
  if (commandStatus()?.tone === "busy") showCommandStatus();
1345
1346
  setExecuting(false);
1346
1347
  }
1347
- if (submitRequested && props.draftKey === key) await submit();
1348
+ if (submitRequested && draftKey() === key) await submit();
1348
1349
  queueMicrotask(() => {
1349
- if (props.draftKey !== key) return;
1350
+ if (draftKey() !== key) return;
1350
1351
  if (restored || props.value === nextValue || mentioned && props.value === mentioned.value) {
1351
1352
  const position = restored ? token.end : mentioned?.caret ?? token.start + replacement.length;
1352
1353
  textareaRef?.setSelectionRange(restored && addSelection ? addSelection.start : position, restored && addSelection ? addSelection.end : position);
@@ -1362,13 +1363,13 @@ export function ChatComposer(props) {
1362
1363
  * stays in the row while the list is still there, otherwise the status line says it, so it never ends in silence.
1363
1364
  */
1364
1365
  const openFromCommand = async (command, open, token) => {
1365
- const key = props.draftKey;
1366
+ const key = draftKey();
1366
1367
  const row = chatCommandKey(command);
1367
1368
  const value = props.value;
1368
1369
  const nextValue = value.slice(0, token.start) + value.slice(token.end);
1369
1370
  const nextMentions = reconcileChatMentions(value, nextValue, mentions());
1370
1371
  // Still the same draft and `/…`, so the row is where the person chose it.
1371
- const inPlace = () => !disposed && props.draftKey === key && props.value === value && commandQuery()?.start === token.start;
1372
+ const inPlace = () => !disposed && draftKey() === key && props.value === value && commandQuery()?.start === token.start;
1372
1373
  const heldHistory = commandSheetHeld();
1373
1374
  // Closing the list or leaving the composer cancels the opening; the row ends at once, without waiting for it.
1374
1375
  const controller = new AbortController();
@@ -1430,15 +1431,15 @@ export function ChatComposer(props) {
1430
1431
  // Success: the token leaves and the list closes in the same step that ends the opening, so a phone sheet never
1431
1432
  // takes its Back entry again while the page navigates.
1432
1433
  batch(() => {
1433
- if (!disposed && props.draftKey === key && props.value === value) {
1434
+ if (!disposed && draftKey() === key && props.value === value) {
1434
1435
  edit(nextValue, nextMentions);
1435
1436
  setDismissed(true);
1436
1437
  }
1437
- endAddSearch(!disposed && props.draftKey === key);
1438
+ endAddSearch(!disposed && draftKey() === key);
1438
1439
  finish(true);
1439
1440
  });
1440
1441
  queueMicrotask(() => {
1441
- if (disposed || props.draftKey !== key || props.value !== nextValue) return;
1442
+ if (disposed || draftKey() !== key || props.value !== nextValue) return;
1442
1443
  textareaRef?.setSelectionRange(token.start, token.start);
1443
1444
  syncCaret();
1444
1445
  autoResize();
@@ -2063,7 +2064,7 @@ export function ChatComposer(props) {
2063
2064
  children: part => part.mark ? _$ssr(_tmpl$10) : _$ssr(_tmpl$11, `${Boolean(part.mention) ? "k2b-chat-composer__mention" : ""} ${Boolean(part.fresh) ? "k2b-dictation-fresh" : ""}`, _$escape(part.text))
2064
2065
  })));
2065
2066
  }
2066
- })), mentions().length > 0 || Boolean(dictationView()) ? "k2b-chat-composer__textarea--highlighted" : "", _$ssrAttribute("value", _$escape(props.value, true), false), _$ssrAttribute("disabled", editBlocked() && openingRow() === undefined, true) + _$ssrAttribute("readonly", _$escape(openingRow(), true) !== _$escape(undefined, true), false) + _$ssrAttribute("enterkeyhint", conversation() ? "enter" : _$escape(undefined, true), false) + _$ssrAttribute("placeholder", _$escape(props.placeholder ?? (running() ? chatMessages().addGuidance : conversation() ? chatMessages().writeConversationMessage : chatMessages().writeMessage), true), false) + _$ssrAttribute("aria-label", _$escape(props.inputLabel ?? messages().message, true), false) + _$ssrAttribute("role", fieldOwnsList() ? "combobox" : _$escape(undefined, true), false) + _$ssrAttribute("aria-autocomplete", fieldOwnsList() ? "list" : _$escape(undefined, true), false) + _$ssrAttribute("aria-controls", fieldOwnsList() ? _$escape(commandListId, true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-expanded", fieldOwnsList() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-activedescendant", !fieldOwnsList() ? _$escape(undefined, true) : emojiOpen() || peopleOpen() ? `${_$escape(commandListId, true)}-${_$escape(selectedCommandIndex(), true)}` : selectedCommand() ? _$escape(commandOptionId(selectedCommand()), true) : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
2067
+ })), mentions().length > 0 || Boolean(dictationView()) ? "k2b-chat-composer__textarea--highlighted" : "", _$ssrAttribute("value", _$escape(props.value, true), false), _$ssrAttribute("disabled", editBlocked() && openingRow() === undefined, true), _$ssrAttribute("readonly", openingRow() !== undefined, true) + _$ssrAttribute("enterkeyhint", conversation() ? "enter" : _$escape(undefined, true), false) + _$ssrAttribute("placeholder", _$escape(props.placeholder ?? (running() ? chatMessages().addGuidance : conversation() ? chatMessages().writeConversationMessage : chatMessages().writeMessage), true), false) + _$ssrAttribute("aria-label", _$escape(props.inputLabel ?? messages().message, true), false) + _$ssrAttribute("role", fieldOwnsList() ? "combobox" : _$escape(undefined, true), false) + _$ssrAttribute("aria-autocomplete", fieldOwnsList() ? "list" : _$escape(undefined, true), false) + _$ssrAttribute("aria-controls", fieldOwnsList() ? _$escape(commandListId, true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-expanded", fieldOwnsList() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-activedescendant", !fieldOwnsList() ? _$escape(undefined, true) : emojiOpen() || peopleOpen() ? `${_$escape(commandListId, true)}-${_$escape(selectedCommandIndex(), true)}` : selectedCommand() ? _$escape(commandOptionId(selectedCommand()), true) : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
2067
2068
  get when() {
2068
2069
  return conversation();
2069
2070
  },
@@ -2193,7 +2194,7 @@ export function ChatComposer(props) {
2193
2194
  return addSearch();
2194
2195
  },
2195
2196
  get children() {
2196
- return _$ssr(_tmpl$20, _$ssrAttribute("value", _$escape(addQuery(), true), false) + _$ssrAttribute("placeholder", _$escape(chatMessages().commandSearch, true), false) + _$ssrAttribute("aria-label", _$escape(chatMessages().commandSearchLabel, true), false), _$ssrAttribute("aria-controls", _$escape(commandListId, true), false), _$ssrAttribute("aria-activedescendant", selectedCommand() ? _$escape(commandOptionId(selectedCommand()), true) : _$escape(undefined, true), false), _$ssrAttribute("readonly", _$escape(openingRow(), true) !== _$escape(undefined, true), false));
2197
+ return _$ssr(_tmpl$20, _$ssrAttribute("value", _$escape(addQuery(), true), false) + _$ssrAttribute("placeholder", _$escape(chatMessages().commandSearch, true), false) + _$ssrAttribute("aria-label", _$escape(chatMessages().commandSearchLabel, true), false), _$ssrAttribute("aria-controls", _$escape(commandListId, true), false), _$ssrAttribute("aria-activedescendant", selectedCommand() ? _$escape(commandOptionId(selectedCommand()), true) : _$escape(undefined, true), false), _$ssrAttribute("readonly", openingRow() !== undefined, true));
2197
2198
  }
2198
2199
  })), _$ssrAttribute("id", _$escape(commandListId, true), false), _$ssrAttribute("aria-label", _$escape(chatMessages().commands, true), false) + _$ssrAttribute("aria-busy", searching() ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(For, {
2199
2200
  get each() {