@adea-ai/ui 0.105.0 → 0.106.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +44 -8
  2. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  3. package/dist/components/composites/action-button/action-button.js +6 -8
  4. package/dist/components/composites/action-button/action-button.js.map +1 -1
  5. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +16 -0
  6. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -0
  7. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +151 -0
  8. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -0
  9. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  10. package/dist/components/composites/appearance-editor/appearance-choices.js +24 -84
  11. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/appearance-editor.d.ts +2 -2
  13. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/appearance-editor.js +25 -7
  15. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-types.d.ts +9 -0
  17. package/dist/components/composites/appearance-editor/appearance-types.d.ts.map +1 -1
  18. package/dist/components/composites/appearance-editor/font-settings-group.d.ts +10 -0
  19. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -0
  20. package/dist/components/composites/appearance-editor/font-settings-group.js +310 -0
  21. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -0
  22. package/dist/components/composites/appearance-editor/index.d.ts +2 -0
  23. package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
  24. package/dist/components/composites/appearance-editor/index.js +3 -1
  25. package/dist/components/composites/update-dialog/update-dialog.js +2 -2
  26. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  27. package/dist/components/conversation/message-row.d.ts.map +1 -1
  28. package/dist/components/conversation/message-row.js +3 -3
  29. package/dist/components/conversation/message-row.js.map +1 -1
  30. package/dist/components/conversation/paste-token-editor.js +1 -1
  31. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  32. package/dist/components/layout/side-rail/side-rail.js +2 -2
  33. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  34. package/dist/components/layout/top-bar/top-bar.js +1 -1
  35. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  36. package/dist/components/theme/appearance-panel.d.ts +1 -1
  37. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  38. package/dist/components/theme/appearance-panel.js +45 -105
  39. package/dist/components/theme/appearance-panel.js.map +1 -1
  40. package/dist/components/theme/theme-provider.d.ts +5 -2
  41. package/dist/components/theme/theme-provider.d.ts.map +1 -1
  42. package/dist/components/theme/theme-provider.js +38 -19
  43. package/dist/components/theme/theme-provider.js.map +1 -1
  44. package/dist/components/ui/code-block/code-block.d.ts +3 -3
  45. package/dist/components/ui/code-block/code-block.js +6 -6
  46. package/dist/components/ui/code-block/code-block.js.map +1 -1
  47. package/dist/components/ui/command/command.js +1 -1
  48. package/dist/components/ui/command/command.js.map +1 -1
  49. package/dist/components/ui/context-menu/context-menu.js +1 -1
  50. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  51. package/dist/components/ui/diff-block/diff-block.js +5 -5
  52. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  53. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  54. package/dist/components/ui/dropdown-menu/dropdown-menu.js +101 -8
  55. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  56. package/dist/components/ui/kbd/kbd.js +1 -1
  57. package/dist/components/ui/kbd/kbd.js.map +1 -1
  58. package/dist/components/ui/menubar/menubar.js +1 -1
  59. package/dist/components/ui/menubar/menubar.js.map +1 -1
  60. package/dist/components/ui/typography/typography.d.ts +3 -5
  61. package/dist/components/ui/typography/typography.d.ts.map +1 -1
  62. package/dist/components/ui/typography/typography.js +6 -8
  63. package/dist/components/ui/typography/typography.js.map +1 -1
  64. package/dist/index.js +6 -3
  65. package/dist/lib/appearance-font-settings.d.ts +53 -0
  66. package/dist/lib/appearance-font-settings.d.ts.map +1 -0
  67. package/dist/lib/appearance-font-settings.js +160 -0
  68. package/dist/lib/appearance-font-settings.js.map +1 -0
  69. package/dist/lib/font-catalog.d.ts +72 -0
  70. package/dist/lib/font-catalog.d.ts.map +1 -0
  71. package/dist/lib/font-catalog.js +71 -0
  72. package/dist/lib/font-catalog.js.map +1 -0
  73. package/dist/lib/safe-script.d.ts +3 -0
  74. package/dist/lib/safe-script.d.ts.map +1 -0
  75. package/dist/lib/safe-script.js +9 -0
  76. package/dist/lib/safe-script.js.map +1 -0
  77. package/dist/lib/tokens.d.ts +2 -19
  78. package/dist/lib/tokens.d.ts.map +1 -1
  79. package/dist/lib/tokens.js +63 -39
  80. package/dist/lib/tokens.js.map +1 -1
  81. package/dist/r/appearance-editor.json +12 -1
  82. package/dist/r/lib.json +16 -1
  83. package/dist/r/registry.json +36 -3
  84. package/dist/r/src/components/composites/action-button/action-button.tsx +2 -1
  85. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +147 -0
  86. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +17 -74
  87. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +19 -6
  88. package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +9 -0
  89. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +350 -0
  90. package/dist/r/src/components/composites/appearance-editor/index.ts +19 -0
  91. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +2 -2
  92. package/dist/r/src/components/conversation/message-row.tsx +7 -3
  93. package/dist/r/src/components/conversation/paste-token-editor.tsx +1 -1
  94. package/dist/r/src/components/layout/side-rail/side-rail.tsx +3 -3
  95. package/dist/r/src/components/layout/top-bar/top-bar.tsx +1 -1
  96. package/dist/r/src/components/theme/appearance-panel.tsx +34 -83
  97. package/dist/r/src/components/theme/theme-provider.tsx +50 -20
  98. package/dist/r/src/components/ui/code-block/code-block.tsx +6 -6
  99. package/dist/r/src/components/ui/command/command.tsx +1 -1
  100. package/dist/r/src/components/ui/context-menu/context-menu.tsx +1 -1
  101. package/dist/r/src/components/ui/diff-block/diff-block.tsx +7 -7
  102. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +145 -7
  103. package/dist/r/src/components/ui/kbd/kbd.tsx +1 -1
  104. package/dist/r/src/components/ui/menubar/menubar.tsx +1 -1
  105. package/dist/r/src/components/ui/typography/typography.tsx +6 -8
  106. package/dist/r/src/lib/appearance-font-settings.ts +233 -0
  107. package/dist/r/src/lib/font-catalog.ts +80 -0
  108. package/dist/r/src/lib/safe-script.ts +7 -0
  109. package/dist/r/src/lib/tokens.ts +64 -59
  110. package/dist/r/src/styles/appearance-font-settings.css +110 -0
  111. package/dist/r/src/styles/fonts.css +4 -5
  112. package/dist/r/src/styles/globals.css +4 -1
  113. package/dist/r/src/styles/theme.css +14 -0
  114. package/dist/r/theme.json +5 -0
  115. package/dist/r/theming.json +3 -1
  116. package/package.json +3 -2
  117. package/registry.json +36 -3
  118. package/src/components/composites/action-button/action-button.tsx +2 -1
  119. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +147 -0
  120. package/src/components/composites/appearance-editor/appearance-choices.tsx +17 -74
  121. package/src/components/composites/appearance-editor/appearance-editor.tsx +19 -6
  122. package/src/components/composites/appearance-editor/appearance-types.ts +9 -0
  123. package/src/components/composites/appearance-editor/font-settings-group.tsx +350 -0
  124. package/src/components/composites/appearance-editor/index.ts +19 -0
  125. package/src/components/composites/update-dialog/update-dialog.tsx +2 -2
  126. package/src/components/conversation/message-row.tsx +7 -3
  127. package/src/components/conversation/paste-token-editor.tsx +1 -1
  128. package/src/components/layout/side-rail/side-rail.tsx +3 -3
  129. package/src/components/layout/top-bar/top-bar.tsx +1 -1
  130. package/src/components/theme/appearance-panel.tsx +34 -83
  131. package/src/components/theme/theme-provider.tsx +50 -20
  132. package/src/components/ui/code-block/code-block.tsx +6 -6
  133. package/src/components/ui/command/command.tsx +1 -1
  134. package/src/components/ui/context-menu/context-menu.tsx +1 -1
  135. package/src/components/ui/diff-block/diff-block.tsx +7 -7
  136. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +145 -7
  137. package/src/components/ui/kbd/kbd.tsx +1 -1
  138. package/src/components/ui/menubar/menubar.tsx +1 -1
  139. package/src/components/ui/typography/typography.tsx +6 -8
  140. package/src/lib/appearance-font-settings.ts +233 -0
  141. package/src/lib/font-catalog.ts +80 -0
  142. package/src/lib/safe-script.ts +7 -0
  143. package/src/lib/tokens.ts +64 -59
  144. package/src/styles/appearance-font-settings.css +110 -0
  145. package/src/styles/fonts.css +4 -5
  146. package/src/styles/globals.css +4 -1
  147. package/src/styles/theme.css +14 -0
@@ -16,8 +16,8 @@ var _tmpl$3 = /*#__PURE__*/ template(`<section class="rounded-xl border border-p
16
16
  var _tmpl$4 = /*#__PURE__*/ template(`<section class="grid gap-2"aria-label="Update progress"><p class="text-xs text-muted-foreground"role=status>`);
17
17
  var _tmpl$5 = /*#__PURE__*/ template(`<p class="text-foreground flex items-center gap-2 text-sm"role=status>`);
18
18
  var _tmpl$6 = /*#__PURE__*/ template(`<p class="text-foreground rounded-lg border border-destructive/35 bg-destructive-subtle px-3 py-2 text-sm"role=alert>`);
19
- var _tmpl$7 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><div class="flex items-center gap-2"><h2 id=update-release-notes class="text-sm font-semibold text-foreground">What changed in this release</h2></div><div class="max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-release-notes tabindex=0>`);
20
- var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><div class="flex items-center gap-2"><h2 id=update-changelog class="text-sm font-semibold text-foreground">Installed changelog</h2></div><p class="text-xs text-muted-foreground">All versions and updates included with this installation.</p><div class="max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-changelog tabindex=0>`);
19
+ var _tmpl$7 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><div class="flex items-center gap-2"><h2 id=update-release-notes class="text-sm font-semibold text-foreground">What changed in this release</h2></div><div class="max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-code text-code leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-release-notes tabindex=0>`);
20
+ var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><div class="flex items-center gap-2"><h2 id=update-changelog class="text-sm font-semibold text-foreground">Installed changelog</h2></div><p class="text-xs text-muted-foreground">All versions and updates included with this installation.</p><div class="max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-code text-code leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-changelog tabindex=0>`);
21
21
  var _tmpl$9 = /*#__PURE__*/ template(`<div data-slot=update-dialog-scroll-region class="flex min-h-0 min-w-0 flex-1 flex-col gap-5 overflow-y-auto p-6"><section class="rounded-xl border border-border bg-background/45 p-4"aria-label="Version status"><div class="flex flex-wrap items-start justify-between gap-4"><div class="flex flex-col gap-1"><p class="text-2xs font-semibold tracking-widest text-muted-foreground uppercase">Installed version</p><p class="text-sm text-muted-foreground"></p></div><div class="flex flex-col items-end gap-2">`);
22
22
  var _tmpl$0 = /*#__PURE__*/ template(`<img alt class=size-10 aria-hidden=true>`);
23
23
  var _tmpl$1 = /*#__PURE__*/ template(`<div class="mt-4 border-t border-border pt-4">`);
@@ -1 +1 @@
1
- {"version":3,"file":"update-dialog.js","names":["createEffect","createMemo","createSignal","onCleanup","onMount","Show","splitProps","Accessor","JSX","Check","CircleStop","Download","ExternalLink","LoaderCircle","Monitor","RefreshCw","Sparkles","Badge","Button","ActionButton","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","DialogTrigger","createDialogFocusRestoration","Progress","Heading","cn","formatBytes","formatReleaseDate","plainTextFromMarkdown","UpdatePhase","UpdateState","Readonly","phase","currentVersion","availableVersion","changelog","releaseNotes","releaseDate","downloadedBytes","totalBytes","error","releaseUrl","restartRequired","UpdateAdapter","getStatus","Promise","check","install","expectedVersion","cancel","pollIntervalMs","openExternal","url","isDesktopRuntime","ChannelControlActions","disabled","recheck","beforeCheck","UpdateDialogProps","adapter","appName","appIcon","fallbackVersion","desktopOnlyMessage","channelControl","actions","Element","open","defaultOpen","onOpenChange","restoreFocusRef","HTMLElement","class","messageText","value","undefined","message","trim","errorMessage","caught","fallback","Error","plainMessage","record","safe","nestedError","isBusy","state","UpdateDialog","props","local","uncontrolledOpen","setUncontrolledOpen","setOpen","next","focusRestoration","desktop","setState","busy","setBusy","setError","checkFailed","setCheckFailed","cancelPending","setCancelPending","lifecycleEpoch","activeOpenEpoch","channelCheckUnconfirmed","disposed","loadStatus","isCurrent","status","previous","hasActionableSnapshot","candidate","ignoresUnconfirmedChannelSnapshot","preservesSnapshot","epoch","failCheck","applyCheckResult","preserveOnFailure","current","clearStaleOffer","working","discardStaleOffer","channelSaved","checked","active","version","includes","requestInFlight","timer","window","setInterval","Math","max","clearInterval","openRelease","notes","channelControlDisabled","recheckChannel","triggerLabel","progressValue","min","round","_$createComponent","children","when","as","variant","size","_$memo","positioner","onKeyDown","event","KeyboardEvent","key","defaultPrevented","preventDefault","onOpenAutoFocus","currentTarget","focus","preventScroll","onCloseAutoFocus","_el$","_tmpl$","_el$2","firstChild","_$insert","icon","_el$34","_tmpl$0","_$effect","_$setAttribute","_el$3","_tmpl$9","_el$4","_el$5","_el$6","_el$7","_el$8","nextSibling","_el$9","tone","type","tooltip","onClick","_el$0","_tmpl$2","_el$1","_el$35","_tmpl$1","_el$10","_tmpl$3","_el$11","_el$12","_el$13","_el$14","_el$16","_el$15","_el$17","_el$18","_el$20","_el$19","released","_el$36","_tmpl$10","_el$37","_el$21","_tmpl$4","_el$22","aria-label","_el$23","_tmpl$5","_el$24","_tmpl$6","_el$25","_tmpl$7","_el$26","_el$27","_el$28","_el$29","_tmpl$8","_el$30","_el$31","_el$32","_el$33","_$createComponent","_$memo","_$setAttribute"],"sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n onMount,\n Show,\n splitProps,\n} from 'solid-js'\nimport type { Accessor, JSX } from 'solid-js'\nimport {\n Check,\n CircleStop,\n Download,\n ExternalLink,\n LoaderCircle,\n Monitor,\n RefreshCw,\n Sparkles,\n} from 'lucide-solid'\nimport { Badge } from '../../ui/badge'\nimport { Button } from '../../ui/button'\nimport { ActionButton } from '../action-button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '../../ui/dialog'\nimport { createDialogFocusRestoration } from '../../ui/dialog/dialog'\nimport { Progress } from '../../ui/progress'\nimport { Heading } from '../../ui/typography'\nimport { cn } from '#lib/utils'\nimport { formatBytes, formatReleaseDate, plainTextFromMarkdown } from '#lib/version-notes'\n\n/**\n * UpdateDialog.\n *\n * A software-update surface: the installed version, whether a newer release\n * exists, a download that shows its progress, and the release notes for what is\n * about to arrive.\n *\n * The transport is an adapter, because an update is the one thing a component\n * library genuinely cannot implement: it is signed, downloaded and applied by the\n * application's own updater, and the mechanism differs per shell. What *is*\n * general is the phase machine and the way each phase is presented — and that is\n * where the hard-won detail lives:\n *\n * **A refused install answers with a normal payload, not a rejection.** adea's\n * shell returns a status whose phase is `failed` when a download or an extract\n * fails, rather than throwing. Without handling that, clicking install looked like\n * nothing happened at all — the button spun, the phase never changed, and the\n * error sat unread in a field nobody rendered. The `failed` phase after an install\n * is therefore surfaced as an error, explicitly.\n *\n * **Busy is derived from the snapshot as well as from the click.** An update can\n * be downloading while the dialog is open — started before it opened, or by the\n * shell's own poll — so a local `busy` flag alone would offer an enabled Install\n * button mid-download.\n *\n * **Opening the dialog loads status first, then checks.** Status paints the\n * installed version immediately; the check is a network round trip. Doing them in\n * the other order leaves the dialog blank for as long as the check takes, on a\n * dialog whose first question is always \"what am I running?\".\n *\n * **A failed check is not a current result.** A cached `current` status can only\n * be shown as up to date after the latest check succeeds; a failed check remains\n * retryable and suppresses that claim.\n *\n * **Errors are not always `Error`s.** An adapter can reject with a string or a\n * structured safe message. Unknown object fields are never serialized into the\n * UI; a generic fallback is shown instead.\n *\n * The adapter's `isDesktopRuntime` gate exists because an update is a desktop\n * concern: a browser build has no installer, and the honest thing to show is that\n * updates are available in the desktop application rather than a disabled button\n * with no reason.\n */\n\n/** The phase an update is in. The union is the state machine. */\nexport type UpdatePhase =\n | 'idle'\n | 'checking'\n | 'current'\n | 'available'\n | 'downloading'\n | 'installing'\n | 'installed'\n | 'cancelling'\n | 'cancelled'\n | 'unavailable'\n | 'failed'\n\n/** A snapshot of the updater. Every field the dialog renders, and nothing else. */\nexport type UpdateState = Readonly<{\n phase: UpdatePhase\n /** The version currently installed. */\n currentVersion: string\n /** The version that can be installed, when one can. */\n availableVersion?: string | null\n /** A changelog for the installed channel, as markdown. */\n changelog?: string\n /** Notes for the available release, as markdown. */\n releaseNotes?: string | null\n /** The available release's date, as an ISO string. */\n releaseDate?: string | null\n /** Bytes downloaded so far, during `downloading`. */\n downloadedBytes?: number\n /** Total bytes, when the server sent a length. */\n totalBytes?: number | null\n /** Set when `phase` is `failed`, and sometimes when it is not. */\n error?: string | null\n /** A URL for the release's page. */\n releaseUrl?: string | null\n /** True when the application must restart to finish. */\n restartRequired?: boolean\n}>\n\n/**\n * The updater, as the application exposes it. Three calls, each answering with a\n * full snapshot rather than a delta — an updater's state is small, and a snapshot\n * cannot drift from the shell's own view of it.\n */\nexport type UpdateAdapter = Readonly<{\n /** The current state, without contacting the release channel. */\n getStatus(): Promise<UpdateState>\n /** Ask the release channel, and answer with what it found. */\n check(): Promise<UpdateState>\n /**\n * Download and apply `expectedVersion`.\n *\n * The argument is the version the caller believes is available, so the updater\n * can refuse a request that raced a newer release rather than installing the\n * wrong one.\n */\n install(expectedVersion: string): Promise<UpdateState>\n /** Optional native cancellation, available only while work is in flight. */\n cancel?(): Promise<UpdateState>\n /** Enable status polling during native work; omit for push-driven adapters. */\n pollIntervalMs?: number\n /** Route external links through the native shell when needed. */\n openExternal?(url: string): Promise<void>\n /** False in a browser build, where there is no installer to drive. */\n isDesktopRuntime(): boolean\n}>\n\ntype ChannelControlActions = Readonly<{\n /** Disabled while the app is checking, downloading, installing, or saving a channel. */\n disabled: Accessor<boolean>\n /** Persist a channel change, then check that channel without retaining a stale offer. */\n recheck(beforeCheck?: () => Promise<void>): Promise<void>\n}>\n\nexport type UpdateDialogProps = {\n adapter: UpdateAdapter\n /** The application's name, used in the title and the copy. */\n appName?: string\n /** The actual desktop application icon, supplied by its host. */\n appIcon?: string\n /** Complete build-time history, also available before the native status arrives. */\n changelog?: string\n /** Shown before the first status arrives, so the dialog is never blank. */\n fallbackVersion?: string\n /** Copy for the adapter's non-desktop case. */\n desktopOnlyMessage?: string\n /**\n * Optional host-owned release-channel control, rendered in the version status\n * card. The host owns its accessible label and calls `recheck` after a selection;\n * the optional callback persists that selection before the dialog checks it.\n */\n channelControl?: (actions: ChannelControlActions) => JSX.Element\n /** A controlled open state. Omit for the trigger to manage its own. */\n open?: boolean\n /**\n * Start open, uncontrolled — for a caller that opens the dialog because it found\n * something (\"an update is available\") rather than because the user asked. The\n * trigger is still rendered, so the dialog is reachable again after closing.\n */\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /**\n * Supplies a stable external control to focus when a controlled dialog closes.\n * Useful when a menu or other layer closes before this dialog opens; when omitted,\n * the element focused immediately before the dialog opens is used when available.\n */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Render only the panel, for a caller that provides its own dialog. */\n class?: string\n}\n\nfunction messageText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const message = value.trim()\n return message && message !== '[object Object]' ? message : undefined\n}\n\nfunction errorMessage(caught: unknown, fallback: string): string {\n if (caught instanceof Error) return messageText(caught.message) ?? fallback\n const plainMessage = messageText(caught)\n if (plainMessage) return plainMessage\n if (!caught || typeof caught !== 'object') return fallback\n\n const record = caught as { error?: unknown; safe?: unknown }\n const safe = record.safe as { message?: unknown } | null | undefined\n const nestedError = record.error as { safe?: { message?: unknown } | null } | null | undefined\n return messageText(safe?.message) ?? messageText(nestedError?.safe?.message) ?? fallback\n}\n\n/**\n * The phases during which the updater is working. `downloading` and `installing`\n * are included because the shell can be in either while the dialog is open, and\n * offering an enabled Install button during a download is how a double-install\n * happens.\n */\nfunction isBusy(state: UpdateState | null): boolean {\n return (\n state?.phase === 'checking' ||\n state?.phase === 'downloading' ||\n state?.phase === 'installing' ||\n state?.phase === 'cancelling'\n )\n}\n\nexport function UpdateDialog(props: UpdateDialogProps) {\n const [local] = splitProps(props, [\n 'adapter',\n 'appName',\n 'appIcon',\n 'changelog',\n 'fallbackVersion',\n 'desktopOnlyMessage',\n 'channelControl',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'restoreFocusRef',\n 'class',\n ])\n\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const open = () => local.open ?? uncontrolledOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n }\n\n const focusRestoration = createDialogFocusRestoration({\n open,\n restoreFocusRef: local.restoreFocusRef,\n })\n\n const appName = () => local.appName ?? 'the application'\n const desktop = () => local.adapter.isDesktopRuntime()\n const [state, setState] = createSignal<UpdateState | null>(null)\n const [busy, setBusy] = createSignal(false)\n const [error, setError] = createSignal('')\n const [checkFailed, setCheckFailed] = createSignal(false)\n const [cancelPending, setCancelPending] = createSignal(false)\n let lifecycleEpoch = 0\n let activeOpenEpoch: number | undefined\n let channelCheckUnconfirmed = false\n let disposed = false\n\n onCleanup(() => {\n disposed = true\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n })\n\n const loadStatus = async (isCurrent: () => boolean = () => !disposed) => {\n if (!desktop() || !isCurrent()) return\n try {\n const status = await local.adapter.getStatus()\n const previous = state()\n const hasActionableSnapshot = (candidate: UpdateState | null) =>\n candidate?.phase === 'available' || isBusy(candidate)\n const ignoresUnconfirmedChannelSnapshot =\n channelCheckUnconfirmed && hasActionableSnapshot(status)\n const preservesSnapshot =\n previous?.phase === 'available'\n ? status.phase === 'available' || isBusy(status)\n : isBusy(previous) && isBusy(status)\n if (\n isCurrent() &&\n !ignoresUnconfirmedChannelSnapshot &&\n !(checkFailed() && hasActionableSnapshot(previous) && !preservesSnapshot)\n ) {\n setState(status)\n }\n } catch (caught) {\n if (isCurrent()) setError(errorMessage(caught, 'Version status is unavailable'))\n }\n }\n\n onMount(() => {\n if (desktop() && !open()) {\n const epoch = lifecycleEpoch\n void loadStatus(() => !disposed && lifecycleEpoch === epoch)\n }\n })\n\n const failCheck = (caught: unknown, fallback: string) => {\n const message = errorMessage(caught, fallback)\n setCheckFailed(true)\n setError(message)\n }\n\n const applyCheckResult = (next: UpdateState, preserveOnFailure = true) => {\n if (next.phase === 'failed') {\n const current = state()\n if (!current || !preserveOnFailure) setState(next)\n failCheck(next.error, 'Could not check for updates')\n return\n }\n setState(next)\n setCheckFailed(false)\n setError('')\n }\n\n const check = async (\n beforeCheck?: () => Promise<void>,\n clearStaleOffer = beforeCheck !== undefined\n ) => {\n if (!desktop()) {\n setError(local.desktopOnlyMessage ?? `Update checks are available from the desktop app.`)\n return\n }\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!isCurrent()) return\n if (clearStaleOffer && working()) return\n if (clearStaleOffer) channelCheckUnconfirmed = true\n const discardStaleOffer = clearStaleOffer || channelCheckUnconfirmed\n setBusy(true)\n setError('')\n setCheckFailed(false)\n if (discardStaleOffer) {\n const current = state()\n if (current) setState({ phase: 'checking', currentVersion: current.currentVersion })\n }\n let channelSaved = beforeCheck === undefined\n try {\n await beforeCheck?.()\n channelSaved = true\n if (!isCurrent()) return\n const checked = await local.adapter.check()\n if (isCurrent()) {\n applyCheckResult(checked, !discardStaleOffer)\n if (discardStaleOffer && checked.phase !== 'failed') channelCheckUnconfirmed = false\n }\n } catch (caught) {\n if (isCurrent()) {\n if (discardStaleOffer) {\n const fallback = channelSaved\n ? 'Could not check for updates'\n : 'Could not save the update channel'\n const message = errorMessage(caught, fallback)\n setState({\n phase: 'failed',\n currentVersion: state()?.currentVersion ?? '',\n error: message,\n })\n failCheck(message, fallback)\n } else {\n failCheck(caught, 'Could not check for updates')\n await loadStatus(isCurrent)\n }\n }\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n /**\n * Status first, then the check — and an `active` flag, because the dialog can\n * close while the check is in flight and a late `setState` would write into a\n * disposed scope.\n */\n createEffect(() => {\n if (!open() || !desktop()) {\n setCancelPending(false)\n if (activeOpenEpoch !== undefined) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n return\n }\n const epoch = ++lifecycleEpoch\n activeOpenEpoch = epoch\n let active = true\n const isCurrent = () =>\n active && !disposed && activeOpenEpoch === epoch && lifecycleEpoch === epoch && open()\n onCleanup(() => {\n active = false\n if (activeOpenEpoch === epoch) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n })\n setError('')\n setCheckFailed(false)\n setCancelPending(false)\n setBusy(true)\n void (async () => {\n try {\n const current = await local.adapter.getStatus()\n if (!isCurrent()) return\n const discardStaleOffer = channelCheckUnconfirmed\n setState(\n discardStaleOffer\n ? { phase: 'checking', currentVersion: current.currentVersion }\n : current\n )\n const checked = await local.adapter.check()\n if (isCurrent()) {\n applyCheckResult(checked, !discardStaleOffer)\n if (discardStaleOffer && checked.phase !== 'failed') channelCheckUnconfirmed = false\n }\n } catch (caught) {\n if (isCurrent()) {\n if (channelCheckUnconfirmed) {\n const message = errorMessage(caught, 'Could not check for updates')\n setState({\n phase: 'failed',\n currentVersion: state()?.currentVersion ?? '',\n error: message,\n })\n failCheck(message, 'Could not check for updates')\n } else {\n failCheck(caught, 'Could not check for updates')\n }\n }\n } finally {\n if (isCurrent()) setBusy(false)\n }\n })()\n })\n\n const install = async () => {\n const version = state()?.availableVersion\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!version || !isCurrent()) return\n setBusy(true)\n setError('')\n setState((current) =>\n current ? { ...current, phase: 'downloading', downloadedBytes: 0, totalBytes: null } : current\n )\n try {\n const next = await local.adapter.install(version)\n if (!isCurrent()) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n // A refused install answers with a normal payload whose phase is `failed`.\n // Without this the click looked like nothing happened.\n if (next.phase === 'failed') {\n setError(errorMessage(next.error, 'Update installation failed'))\n } else {\n setCheckFailed(false)\n }\n } catch (caught) {\n if (!isCurrent()) return\n setError(errorMessage(caught, 'Update installation failed'))\n await loadStatus(isCurrent)\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n // Poll only an open, active native operation. Epoch ownership prevents a late\n // status response from replacing a reopened dialog's newer snapshot.\n createEffect(() => {\n const phase = state()?.phase\n if (\n !open() ||\n !desktop() ||\n !local.adapter.pollIntervalMs ||\n !['downloading', 'installing', 'cancelling'].includes(phase ?? '')\n )\n return\n const epoch = activeOpenEpoch\n let active = true\n let requestInFlight = false\n const timer = window.setInterval(\n () => {\n if (requestInFlight) return\n requestInFlight = true\n void (async () => {\n try {\n const next = await local.adapter.getStatus()\n if (!active || disposed || !open() || activeOpenEpoch !== epoch) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n if (next.phase === 'failed')\n setError(errorMessage(next.error, 'Update installation failed'))\n } catch (caught) {\n if (active && !disposed && activeOpenEpoch === epoch)\n setError(errorMessage(caught, 'Update progress is unavailable'))\n } finally {\n requestInFlight = false\n }\n })()\n },\n Math.max(250, local.adapter.pollIntervalMs)\n )\n onCleanup(() => {\n active = false\n window.clearInterval(timer)\n })\n })\n\n const cancel = async () => {\n if (!local.adapter.cancel || cancelPending() || state()?.phase === 'cancelling') return\n const epoch = activeOpenEpoch\n setError('')\n setCancelPending(true)\n setState((current) => (current ? { ...current, phase: 'cancelling' } : current))\n try {\n const next = await local.adapter.cancel()\n if (!disposed && open() && activeOpenEpoch === epoch) setState(next)\n } catch (caught) {\n if (!disposed && open() && activeOpenEpoch === epoch) {\n setError(errorMessage(caught, 'Could not cancel the update'))\n await loadStatus(() => !disposed && open() && activeOpenEpoch === epoch)\n }\n } finally {\n if (!disposed && open() && activeOpenEpoch === epoch) setCancelPending(false)\n }\n }\n\n const openRelease = async (url: string) => {\n try {\n if (local.adapter.openExternal) await local.adapter.openExternal(url)\n else window.open(url, '_blank', 'noopener,noreferrer')\n } catch (caught) {\n if (!disposed) setError(errorMessage(caught, 'Could not open the release page'))\n }\n }\n\n const changelog = createMemo(() =>\n plainTextFromMarkdown(state()?.changelog || local.changelog || '')\n )\n const notes = () => {\n const value = state()?.releaseNotes\n return value ? plainTextFromMarkdown(value) : ''\n }\n const working = () => busy() || cancelPending() || isBusy(state())\n const channelControlDisabled = () => !desktop() || working()\n const recheckChannel = (beforeCheck?: () => Promise<void>) => check(beforeCheck, true)\n const isCurrent = () => state()?.phase === 'current' && !error() && !checkFailed() && !working()\n\n const triggerLabel = () => {\n const current = state()\n const fallback = `v${local.fallbackVersion ?? '0.1.0'}`\n if (checkFailed()) return `Version ${current?.currentVersion || fallback} · Retry`\n if (!current) return `${appName()} ${fallback}`\n switch (current.phase) {\n case 'checking':\n return 'Checking for updates…'\n case 'available':\n return current.availableVersion\n ? `Update v${current.availableVersion} available`\n : 'Update available'\n case 'downloading':\n case 'installing':\n return 'Installing update…'\n case 'failed':\n return `Version ${current.currentVersion || fallback} · Retry`\n default:\n return `${appName()} v${current.currentVersion || fallback}`\n }\n }\n\n const progressValue = () => {\n const current = state()\n if (!current?.totalBytes || !current.downloadedBytes) return null\n return Math.min(100, Math.round((current.downloadedBytes / current.totalBytes) * 100))\n }\n\n return (\n <Dialog open={open()} onOpenChange={setOpen}>\n <Show when={local.open === undefined}>\n <DialogTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label=\"Open version and updates\"\n aria-haspopup=\"dialog\"\n >\n <Show when={state()?.phase === 'available'} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <Sparkles aria-hidden=\"true\" />\n </Show>\n {triggerLabel()}\n </DialogTrigger>\n </Show>\n\n <DialogContent\n positioner=\"inset\"\n class={cn('flex max-h-full min-h-0 max-w-3xl flex-col overflow-hidden', local.class)}\n onKeyDown={(event: KeyboardEvent) => {\n // An explanatory tooltip must not consume the popup's close shortcut,\n // including while its exit animation still owns Kobalte's top layer.\n if (event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault()\n setOpen(false)\n }\n }}\n onOpenAutoFocus={(event) => {\n focusRestoration.onOpenAutoFocus(event)\n // Start at the readable panel rather than opening an action's tooltip.\n if (!event.defaultPrevented && event.currentTarget instanceof HTMLElement) {\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n }\n }}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n <DialogHeader class=\"shrink-0\">\n <div class=\"flex items-center gap-3\">\n <Show\n when={local.appIcon}\n fallback={<Monitor class=\"size-10 text-primary\" aria-hidden=\"true\" />}\n >\n {(icon) => <img src={icon()} alt=\"\" class=\"size-10\" aria-hidden=\"true\" />}\n </Show>\n <div>\n <DialogTitle>Version &amp; updates</DialogTitle>\n <DialogDescription>\n Keep {appName()} current and review what changed in each release.\n </DialogDescription>\n </div>\n </div>\n </DialogHeader>\n\n <div\n data-slot=\"update-dialog-scroll-region\"\n class=\"flex min-h-0 min-w-0 flex-1 flex-col gap-5 overflow-y-auto p-6\"\n >\n <section\n class=\"rounded-xl border border-border bg-background/45 p-4\"\n aria-label=\"Version status\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"text-2xs font-semibold tracking-widest text-muted-foreground uppercase\">\n Installed version\n </p>\n <Heading as=\"p\" size=\"page\" tone=\"foreground\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </Heading>\n <p class=\"text-sm text-muted-foreground\">\n <Show\n when={isCurrent()}\n fallback={\n <Show\n when={state()?.phase === 'available' && state()?.availableVersion}\n fallback={\n state()?.phase === 'unavailable'\n ? 'No signed package is published for this platform.'\n : state()?.phase === 'cancelled'\n ? 'Update cancelled. You can retry when ready.'\n : desktop()\n ? 'Check the release channel for the latest signed build.'\n : (local.desktopOnlyMessage ??\n `Open this dialog inside the desktop app to check for updates.`)\n }\n >\n {`A newer release, v${state()?.availableVersion}, is ready.`}\n </Show>\n }\n >\n You are running the latest release.\n </Show>\n </p>\n </div>\n <div class=\"flex flex-col items-end gap-2\">\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Check the release channel for the latest signed app version.\"\n disabled={!desktop() || working()}\n onClick={() => void check()}\n >\n <Show when={working()} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n {checkFailed() ? 'Retry update check' : 'Check latest version'}\n </ActionButton>\n {/* The up-to-date confirmation reads as the button's outcome,\n so it sits directly beneath it rather than floating as a\n full-width row between sections. */}\n <Show when={isCurrent()}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n {appName()} is up to date.\n </p>\n </Show>\n </div>\n </div>\n <Show when={local.channelControl}>\n {(channelControl) => (\n <div class=\"mt-4 border-t border-border pt-4\">\n {channelControl()({\n disabled: channelControlDisabled,\n recheck: recheckChannel,\n })}\n </div>\n )}\n </Show>\n </section>\n\n <Show\n when={\n state()?.availableVersion &&\n state()?.phase !== 'installed' &&\n state()?.phase !== 'unavailable'\n }\n >\n <section\n class=\"rounded-xl border border-primary/35 bg-primary-subtle p-4\"\n aria-label=\"Available update\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"flex items-center gap-2 text-sm font-semibold\">\n <Sparkles class=\"size-4 text-primary\" aria-hidden=\"true\" />\n Version {state()?.availableVersion}{' '}\n {['downloading', 'installing', 'cancelling'].includes(state()?.phase ?? '')\n ? 'is being prepared'\n : 'is ready'}\n </p>\n <p class=\"text-sm text-muted-foreground\">\n The signed installer is verified before {appName()} restarts.\n </p>\n <Show when={formatReleaseDate(state()?.releaseDate ?? null)}>\n {(released) => (\n <p class=\"text-xs text-muted-foreground\">Released {released()}</p>\n )}\n </Show>\n </div>\n <ActionButton\n type=\"button\"\n size=\"sm\"\n tooltip={`Download the signed update and restart ${appName()}.`}\n disabled={working()}\n onClick={() => void install()}\n >\n <Show when={working()} fallback={<Download aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n Install and restart\n </ActionButton>\n </div>\n </section>\n </Show>\n\n {/*\n Progress with both numbers: a bar alone does not distinguish a stalled\n download from a slow one, and \"12.4 MB of 48.1 MB\" does.\n */}\n <Show\n when={\n state()?.phase === 'downloading' ||\n state()?.phase === 'installing' ||\n state()?.phase === 'cancelling'\n }\n >\n <section class=\"grid gap-2\" aria-label=\"Update progress\">\n <Progress\n value={progressValue() ?? undefined}\n aria-label={\n state()?.phase === 'installing' ? 'Installing update' : 'Downloading update'\n }\n />\n <p class=\"text-xs text-muted-foreground\" role=\"status\">\n <Show\n when={state()?.phase === 'installing'}\n fallback={\n <Show when={progressValue() !== null} fallback=\"Downloading…\">\n {`${formatBytes(state()?.downloadedBytes ?? 0)} of ${formatBytes(\n state()?.totalBytes ?? 0\n )} · ${progressValue()}%`}\n </Show>\n }\n >\n Applying the update…\n </Show>\n </p>\n <Show when={local.adapter.cancel}>\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Stop the current update download or installation.\"\n disabled={cancelPending() || state()?.phase === 'cancelling'}\n onClick={() => void cancel()}\n >\n <CircleStop aria-hidden=\"true\" />\n {cancelPending() || state()?.phase === 'cancelling'\n ? 'Cancelling…'\n : 'Cancel update'}\n </ActionButton>\n </Show>\n </section>\n </Show>\n\n <Show when={state()?.phase === 'installed'}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n <Show when={state()?.restartRequired} fallback=\"The update is applied.\">\n Restart {appName()} to finish the update.\n </Show>\n </p>\n </Show>\n\n <Show when={error()}>\n <p\n class=\"text-foreground rounded-lg border border-destructive/35 bg-destructive-subtle px-3 py-2 text-sm\"\n role=\"alert\"\n >\n {error()}\n </p>\n </Show>\n\n <Show when={notes()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-release-notes\" class=\"text-sm font-semibold text-foreground\">\n What changed in this release\n </h2>\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.availableVersion}\n </Badge>\n </div>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-release-notes\"\n tabindex=\"0\"\n >\n {notes()}\n </div>\n </div>\n </Show>\n\n <Show when={changelog()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-changelog\" class=\"text-sm font-semibold text-foreground\">\n Installed changelog\n </h2>\n {/* The version pill identifies which build's history this is —\n the same treatment the available-update heading carries. */}\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </Badge>\n </div>\n <p class=\"text-xs text-muted-foreground\">\n All versions and updates included with this installation.\n </p>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-changelog\"\n tabindex=\"0\"\n >\n {changelog()}\n </div>\n </div>\n </Show>\n </div>\n\n <DialogFooter>\n <Show when={state()?.releaseUrl}>\n {(url) => (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n tooltip=\"Open the release history in your browser.\"\n // `noopener,noreferrer` because the release page is a different\n // origin and must not get a handle on this window.\n onClick={() => void openRelease(url())}\n >\n <ExternalLink aria-hidden=\"true\" />\n View releases\n </ActionButton>\n )}\n </Show>\n <DialogClose as={Button} variant=\"outline\" size=\"sm\">\n Close\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkMA,SAAS+E,YAAYC,OAAoC;CACvD,IAAI,OAAOA,UAAU,UAAU,OAAOC,KAAAA;CACtC,MAAMC,UAAUF,MAAMG,KAAK;CAC3B,OAAOD,WAAWA,YAAY,oBAAoBA,UAAUD,KAAAA;AAC9D;AAEA,SAASG,aAAaC,QAAiBC,UAA0B;CAC/D,IAAID,kBAAkBE,OAAO,OAAOR,YAAYM,OAAOH,OAAO,KAAKI;CACnE,MAAME,eAAeT,YAAYM,MAAM;CACvC,IAAIG,cAAc,OAAOA;CACzB,IAAI,CAACH,UAAU,OAAOA,WAAW,UAAU,OAAOC;CAElD,MAAMG,SAASJ;CACf,MAAM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,IAAIxI;QAAQyI,SAAO;QAAWC,MAAI;QAAAJ,UAAA;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
1
+ {"version":3,"file":"update-dialog.js","names":["createEffect","createMemo","createSignal","onCleanup","onMount","Show","splitProps","Accessor","JSX","Check","CircleStop","Download","ExternalLink","LoaderCircle","Monitor","RefreshCw","Sparkles","Badge","Button","ActionButton","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","DialogTrigger","createDialogFocusRestoration","Progress","Heading","cn","formatBytes","formatReleaseDate","plainTextFromMarkdown","UpdatePhase","UpdateState","Readonly","phase","currentVersion","availableVersion","changelog","releaseNotes","releaseDate","downloadedBytes","totalBytes","error","releaseUrl","restartRequired","UpdateAdapter","getStatus","Promise","check","install","expectedVersion","cancel","pollIntervalMs","openExternal","url","isDesktopRuntime","ChannelControlActions","disabled","recheck","beforeCheck","UpdateDialogProps","adapter","appName","appIcon","fallbackVersion","desktopOnlyMessage","channelControl","actions","Element","open","defaultOpen","onOpenChange","restoreFocusRef","HTMLElement","class","messageText","value","undefined","message","trim","errorMessage","caught","fallback","Error","plainMessage","record","safe","nestedError","isBusy","state","UpdateDialog","props","local","uncontrolledOpen","setUncontrolledOpen","setOpen","next","focusRestoration","desktop","setState","busy","setBusy","setError","checkFailed","setCheckFailed","cancelPending","setCancelPending","lifecycleEpoch","activeOpenEpoch","channelCheckUnconfirmed","disposed","loadStatus","isCurrent","status","previous","hasActionableSnapshot","candidate","ignoresUnconfirmedChannelSnapshot","preservesSnapshot","epoch","failCheck","applyCheckResult","preserveOnFailure","current","clearStaleOffer","working","discardStaleOffer","channelSaved","checked","active","version","includes","requestInFlight","timer","window","setInterval","Math","max","clearInterval","openRelease","notes","channelControlDisabled","recheckChannel","triggerLabel","progressValue","min","round","_$createComponent","children","when","as","variant","size","_$memo","positioner","onKeyDown","event","KeyboardEvent","key","defaultPrevented","preventDefault","onOpenAutoFocus","currentTarget","focus","preventScroll","onCloseAutoFocus","_el$","_tmpl$","_el$2","firstChild","_$insert","icon","_el$34","_tmpl$0","_$effect","_$setAttribute","_el$3","_tmpl$9","_el$4","_el$5","_el$6","_el$7","_el$8","nextSibling","_el$9","tone","type","tooltip","onClick","_el$0","_tmpl$2","_el$1","_el$35","_tmpl$1","_el$10","_tmpl$3","_el$11","_el$12","_el$13","_el$14","_el$16","_el$15","_el$17","_el$18","_el$20","_el$19","released","_el$36","_tmpl$10","_el$37","_el$21","_tmpl$4","_el$22","aria-label","_el$23","_tmpl$5","_el$24","_tmpl$6","_el$25","_tmpl$7","_el$26","_el$27","_el$28","_el$29","_tmpl$8","_el$30","_el$31","_el$32","_el$33","_$createComponent","_$memo","_$setAttribute"],"sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n onMount,\n Show,\n splitProps,\n} from 'solid-js'\nimport type { Accessor, JSX } from 'solid-js'\nimport {\n Check,\n CircleStop,\n Download,\n ExternalLink,\n LoaderCircle,\n Monitor,\n RefreshCw,\n Sparkles,\n} from 'lucide-solid'\nimport { Badge } from '../../ui/badge'\nimport { Button } from '../../ui/button'\nimport { ActionButton } from '../action-button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '../../ui/dialog'\nimport { createDialogFocusRestoration } from '../../ui/dialog/dialog'\nimport { Progress } from '../../ui/progress'\nimport { Heading } from '../../ui/typography'\nimport { cn } from '#lib/utils'\nimport { formatBytes, formatReleaseDate, plainTextFromMarkdown } from '#lib/version-notes'\n\n/**\n * UpdateDialog.\n *\n * A software-update surface: the installed version, whether a newer release\n * exists, a download that shows its progress, and the release notes for what is\n * about to arrive.\n *\n * The transport is an adapter, because an update is the one thing a component\n * library genuinely cannot implement: it is signed, downloaded and applied by the\n * application's own updater, and the mechanism differs per shell. What *is*\n * general is the phase machine and the way each phase is presented — and that is\n * where the hard-won detail lives:\n *\n * **A refused install answers with a normal payload, not a rejection.** adea's\n * shell returns a status whose phase is `failed` when a download or an extract\n * fails, rather than throwing. Without handling that, clicking install looked like\n * nothing happened at all — the button spun, the phase never changed, and the\n * error sat unread in a field nobody rendered. The `failed` phase after an install\n * is therefore surfaced as an error, explicitly.\n *\n * **Busy is derived from the snapshot as well as from the click.** An update can\n * be downloading while the dialog is open — started before it opened, or by the\n * shell's own poll — so a local `busy` flag alone would offer an enabled Install\n * button mid-download.\n *\n * **Opening the dialog loads status first, then checks.** Status paints the\n * installed version immediately; the check is a network round trip. Doing them in\n * the other order leaves the dialog blank for as long as the check takes, on a\n * dialog whose first question is always \"what am I running?\".\n *\n * **A failed check is not a current result.** A cached `current` status can only\n * be shown as up to date after the latest check succeeds; a failed check remains\n * retryable and suppresses that claim.\n *\n * **Errors are not always `Error`s.** An adapter can reject with a string or a\n * structured safe message. Unknown object fields are never serialized into the\n * UI; a generic fallback is shown instead.\n *\n * The adapter's `isDesktopRuntime` gate exists because an update is a desktop\n * concern: a browser build has no installer, and the honest thing to show is that\n * updates are available in the desktop application rather than a disabled button\n * with no reason.\n */\n\n/** The phase an update is in. The union is the state machine. */\nexport type UpdatePhase =\n | 'idle'\n | 'checking'\n | 'current'\n | 'available'\n | 'downloading'\n | 'installing'\n | 'installed'\n | 'cancelling'\n | 'cancelled'\n | 'unavailable'\n | 'failed'\n\n/** A snapshot of the updater. Every field the dialog renders, and nothing else. */\nexport type UpdateState = Readonly<{\n phase: UpdatePhase\n /** The version currently installed. */\n currentVersion: string\n /** The version that can be installed, when one can. */\n availableVersion?: string | null\n /** A changelog for the installed channel, as markdown. */\n changelog?: string\n /** Notes for the available release, as markdown. */\n releaseNotes?: string | null\n /** The available release's date, as an ISO string. */\n releaseDate?: string | null\n /** Bytes downloaded so far, during `downloading`. */\n downloadedBytes?: number\n /** Total bytes, when the server sent a length. */\n totalBytes?: number | null\n /** Set when `phase` is `failed`, and sometimes when it is not. */\n error?: string | null\n /** A URL for the release's page. */\n releaseUrl?: string | null\n /** True when the application must restart to finish. */\n restartRequired?: boolean\n}>\n\n/**\n * The updater, as the application exposes it. Three calls, each answering with a\n * full snapshot rather than a delta — an updater's state is small, and a snapshot\n * cannot drift from the shell's own view of it.\n */\nexport type UpdateAdapter = Readonly<{\n /** The current state, without contacting the release channel. */\n getStatus(): Promise<UpdateState>\n /** Ask the release channel, and answer with what it found. */\n check(): Promise<UpdateState>\n /**\n * Download and apply `expectedVersion`.\n *\n * The argument is the version the caller believes is available, so the updater\n * can refuse a request that raced a newer release rather than installing the\n * wrong one.\n */\n install(expectedVersion: string): Promise<UpdateState>\n /** Optional native cancellation, available only while work is in flight. */\n cancel?(): Promise<UpdateState>\n /** Enable status polling during native work; omit for push-driven adapters. */\n pollIntervalMs?: number\n /** Route external links through the native shell when needed. */\n openExternal?(url: string): Promise<void>\n /** False in a browser build, where there is no installer to drive. */\n isDesktopRuntime(): boolean\n}>\n\ntype ChannelControlActions = Readonly<{\n /** Disabled while the app is checking, downloading, installing, or saving a channel. */\n disabled: Accessor<boolean>\n /** Persist a channel change, then check that channel without retaining a stale offer. */\n recheck(beforeCheck?: () => Promise<void>): Promise<void>\n}>\n\nexport type UpdateDialogProps = {\n adapter: UpdateAdapter\n /** The application's name, used in the title and the copy. */\n appName?: string\n /** The actual desktop application icon, supplied by its host. */\n appIcon?: string\n /** Complete build-time history, also available before the native status arrives. */\n changelog?: string\n /** Shown before the first status arrives, so the dialog is never blank. */\n fallbackVersion?: string\n /** Copy for the adapter's non-desktop case. */\n desktopOnlyMessage?: string\n /**\n * Optional host-owned release-channel control, rendered in the version status\n * card. The host owns its accessible label and calls `recheck` after a selection;\n * the optional callback persists that selection before the dialog checks it.\n */\n channelControl?: (actions: ChannelControlActions) => JSX.Element\n /** A controlled open state. Omit for the trigger to manage its own. */\n open?: boolean\n /**\n * Start open, uncontrolled — for a caller that opens the dialog because it found\n * something (\"an update is available\") rather than because the user asked. The\n * trigger is still rendered, so the dialog is reachable again after closing.\n */\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /**\n * Supplies a stable external control to focus when a controlled dialog closes.\n * Useful when a menu or other layer closes before this dialog opens; when omitted,\n * the element focused immediately before the dialog opens is used when available.\n */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Render only the panel, for a caller that provides its own dialog. */\n class?: string\n}\n\nfunction messageText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const message = value.trim()\n return message && message !== '[object Object]' ? message : undefined\n}\n\nfunction errorMessage(caught: unknown, fallback: string): string {\n if (caught instanceof Error) return messageText(caught.message) ?? fallback\n const plainMessage = messageText(caught)\n if (plainMessage) return plainMessage\n if (!caught || typeof caught !== 'object') return fallback\n\n const record = caught as { error?: unknown; safe?: unknown }\n const safe = record.safe as { message?: unknown } | null | undefined\n const nestedError = record.error as { safe?: { message?: unknown } | null } | null | undefined\n return messageText(safe?.message) ?? messageText(nestedError?.safe?.message) ?? fallback\n}\n\n/**\n * The phases during which the updater is working. `downloading` and `installing`\n * are included because the shell can be in either while the dialog is open, and\n * offering an enabled Install button during a download is how a double-install\n * happens.\n */\nfunction isBusy(state: UpdateState | null): boolean {\n return (\n state?.phase === 'checking' ||\n state?.phase === 'downloading' ||\n state?.phase === 'installing' ||\n state?.phase === 'cancelling'\n )\n}\n\nexport function UpdateDialog(props: UpdateDialogProps) {\n const [local] = splitProps(props, [\n 'adapter',\n 'appName',\n 'appIcon',\n 'changelog',\n 'fallbackVersion',\n 'desktopOnlyMessage',\n 'channelControl',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'restoreFocusRef',\n 'class',\n ])\n\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const open = () => local.open ?? uncontrolledOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n }\n\n const focusRestoration = createDialogFocusRestoration({\n open,\n restoreFocusRef: local.restoreFocusRef,\n })\n\n const appName = () => local.appName ?? 'the application'\n const desktop = () => local.adapter.isDesktopRuntime()\n const [state, setState] = createSignal<UpdateState | null>(null)\n const [busy, setBusy] = createSignal(false)\n const [error, setError] = createSignal('')\n const [checkFailed, setCheckFailed] = createSignal(false)\n const [cancelPending, setCancelPending] = createSignal(false)\n let lifecycleEpoch = 0\n let activeOpenEpoch: number | undefined\n let channelCheckUnconfirmed = false\n let disposed = false\n\n onCleanup(() => {\n disposed = true\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n })\n\n const loadStatus = async (isCurrent: () => boolean = () => !disposed) => {\n if (!desktop() || !isCurrent()) return\n try {\n const status = await local.adapter.getStatus()\n const previous = state()\n const hasActionableSnapshot = (candidate: UpdateState | null) =>\n candidate?.phase === 'available' || isBusy(candidate)\n const ignoresUnconfirmedChannelSnapshot =\n channelCheckUnconfirmed && hasActionableSnapshot(status)\n const preservesSnapshot =\n previous?.phase === 'available'\n ? status.phase === 'available' || isBusy(status)\n : isBusy(previous) && isBusy(status)\n if (\n isCurrent() &&\n !ignoresUnconfirmedChannelSnapshot &&\n !(checkFailed() && hasActionableSnapshot(previous) && !preservesSnapshot)\n ) {\n setState(status)\n }\n } catch (caught) {\n if (isCurrent()) setError(errorMessage(caught, 'Version status is unavailable'))\n }\n }\n\n onMount(() => {\n if (desktop() && !open()) {\n const epoch = lifecycleEpoch\n void loadStatus(() => !disposed && lifecycleEpoch === epoch)\n }\n })\n\n const failCheck = (caught: unknown, fallback: string) => {\n const message = errorMessage(caught, fallback)\n setCheckFailed(true)\n setError(message)\n }\n\n const applyCheckResult = (next: UpdateState, preserveOnFailure = true) => {\n if (next.phase === 'failed') {\n const current = state()\n if (!current || !preserveOnFailure) setState(next)\n failCheck(next.error, 'Could not check for updates')\n return\n }\n setState(next)\n setCheckFailed(false)\n setError('')\n }\n\n const check = async (\n beforeCheck?: () => Promise<void>,\n clearStaleOffer = beforeCheck !== undefined\n ) => {\n if (!desktop()) {\n setError(local.desktopOnlyMessage ?? `Update checks are available from the desktop app.`)\n return\n }\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!isCurrent()) return\n if (clearStaleOffer && working()) return\n if (clearStaleOffer) channelCheckUnconfirmed = true\n const discardStaleOffer = clearStaleOffer || channelCheckUnconfirmed\n setBusy(true)\n setError('')\n setCheckFailed(false)\n if (discardStaleOffer) {\n const current = state()\n if (current) setState({ phase: 'checking', currentVersion: current.currentVersion })\n }\n let channelSaved = beforeCheck === undefined\n try {\n await beforeCheck?.()\n channelSaved = true\n if (!isCurrent()) return\n const checked = await local.adapter.check()\n if (isCurrent()) {\n applyCheckResult(checked, !discardStaleOffer)\n if (discardStaleOffer && checked.phase !== 'failed') channelCheckUnconfirmed = false\n }\n } catch (caught) {\n if (isCurrent()) {\n if (discardStaleOffer) {\n const fallback = channelSaved\n ? 'Could not check for updates'\n : 'Could not save the update channel'\n const message = errorMessage(caught, fallback)\n setState({\n phase: 'failed',\n currentVersion: state()?.currentVersion ?? '',\n error: message,\n })\n failCheck(message, fallback)\n } else {\n failCheck(caught, 'Could not check for updates')\n await loadStatus(isCurrent)\n }\n }\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n /**\n * Status first, then the check — and an `active` flag, because the dialog can\n * close while the check is in flight and a late `setState` would write into a\n * disposed scope.\n */\n createEffect(() => {\n if (!open() || !desktop()) {\n setCancelPending(false)\n if (activeOpenEpoch !== undefined) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n return\n }\n const epoch = ++lifecycleEpoch\n activeOpenEpoch = epoch\n let active = true\n const isCurrent = () =>\n active && !disposed && activeOpenEpoch === epoch && lifecycleEpoch === epoch && open()\n onCleanup(() => {\n active = false\n if (activeOpenEpoch === epoch) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n })\n setError('')\n setCheckFailed(false)\n setCancelPending(false)\n setBusy(true)\n void (async () => {\n try {\n const current = await local.adapter.getStatus()\n if (!isCurrent()) return\n const discardStaleOffer = channelCheckUnconfirmed\n setState(\n discardStaleOffer\n ? { phase: 'checking', currentVersion: current.currentVersion }\n : current\n )\n const checked = await local.adapter.check()\n if (isCurrent()) {\n applyCheckResult(checked, !discardStaleOffer)\n if (discardStaleOffer && checked.phase !== 'failed') channelCheckUnconfirmed = false\n }\n } catch (caught) {\n if (isCurrent()) {\n if (channelCheckUnconfirmed) {\n const message = errorMessage(caught, 'Could not check for updates')\n setState({\n phase: 'failed',\n currentVersion: state()?.currentVersion ?? '',\n error: message,\n })\n failCheck(message, 'Could not check for updates')\n } else {\n failCheck(caught, 'Could not check for updates')\n }\n }\n } finally {\n if (isCurrent()) setBusy(false)\n }\n })()\n })\n\n const install = async () => {\n const version = state()?.availableVersion\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!version || !isCurrent()) return\n setBusy(true)\n setError('')\n setState((current) =>\n current ? { ...current, phase: 'downloading', downloadedBytes: 0, totalBytes: null } : current\n )\n try {\n const next = await local.adapter.install(version)\n if (!isCurrent()) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n // A refused install answers with a normal payload whose phase is `failed`.\n // Without this the click looked like nothing happened.\n if (next.phase === 'failed') {\n setError(errorMessage(next.error, 'Update installation failed'))\n } else {\n setCheckFailed(false)\n }\n } catch (caught) {\n if (!isCurrent()) return\n setError(errorMessage(caught, 'Update installation failed'))\n await loadStatus(isCurrent)\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n // Poll only an open, active native operation. Epoch ownership prevents a late\n // status response from replacing a reopened dialog's newer snapshot.\n createEffect(() => {\n const phase = state()?.phase\n if (\n !open() ||\n !desktop() ||\n !local.adapter.pollIntervalMs ||\n !['downloading', 'installing', 'cancelling'].includes(phase ?? '')\n )\n return\n const epoch = activeOpenEpoch\n let active = true\n let requestInFlight = false\n const timer = window.setInterval(\n () => {\n if (requestInFlight) return\n requestInFlight = true\n void (async () => {\n try {\n const next = await local.adapter.getStatus()\n if (!active || disposed || !open() || activeOpenEpoch !== epoch) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n if (next.phase === 'failed')\n setError(errorMessage(next.error, 'Update installation failed'))\n } catch (caught) {\n if (active && !disposed && activeOpenEpoch === epoch)\n setError(errorMessage(caught, 'Update progress is unavailable'))\n } finally {\n requestInFlight = false\n }\n })()\n },\n Math.max(250, local.adapter.pollIntervalMs)\n )\n onCleanup(() => {\n active = false\n window.clearInterval(timer)\n })\n })\n\n const cancel = async () => {\n if (!local.adapter.cancel || cancelPending() || state()?.phase === 'cancelling') return\n const epoch = activeOpenEpoch\n setError('')\n setCancelPending(true)\n setState((current) => (current ? { ...current, phase: 'cancelling' } : current))\n try {\n const next = await local.adapter.cancel()\n if (!disposed && open() && activeOpenEpoch === epoch) setState(next)\n } catch (caught) {\n if (!disposed && open() && activeOpenEpoch === epoch) {\n setError(errorMessage(caught, 'Could not cancel the update'))\n await loadStatus(() => !disposed && open() && activeOpenEpoch === epoch)\n }\n } finally {\n if (!disposed && open() && activeOpenEpoch === epoch) setCancelPending(false)\n }\n }\n\n const openRelease = async (url: string) => {\n try {\n if (local.adapter.openExternal) await local.adapter.openExternal(url)\n else window.open(url, '_blank', 'noopener,noreferrer')\n } catch (caught) {\n if (!disposed) setError(errorMessage(caught, 'Could not open the release page'))\n }\n }\n\n const changelog = createMemo(() =>\n plainTextFromMarkdown(state()?.changelog || local.changelog || '')\n )\n const notes = () => {\n const value = state()?.releaseNotes\n return value ? plainTextFromMarkdown(value) : ''\n }\n const working = () => busy() || cancelPending() || isBusy(state())\n const channelControlDisabled = () => !desktop() || working()\n const recheckChannel = (beforeCheck?: () => Promise<void>) => check(beforeCheck, true)\n const isCurrent = () => state()?.phase === 'current' && !error() && !checkFailed() && !working()\n\n const triggerLabel = () => {\n const current = state()\n const fallback = `v${local.fallbackVersion ?? '0.1.0'}`\n if (checkFailed()) return `Version ${current?.currentVersion || fallback} · Retry`\n if (!current) return `${appName()} ${fallback}`\n switch (current.phase) {\n case 'checking':\n return 'Checking for updates…'\n case 'available':\n return current.availableVersion\n ? `Update v${current.availableVersion} available`\n : 'Update available'\n case 'downloading':\n case 'installing':\n return 'Installing update…'\n case 'failed':\n return `Version ${current.currentVersion || fallback} · Retry`\n default:\n return `${appName()} v${current.currentVersion || fallback}`\n }\n }\n\n const progressValue = () => {\n const current = state()\n if (!current?.totalBytes || !current.downloadedBytes) return null\n return Math.min(100, Math.round((current.downloadedBytes / current.totalBytes) * 100))\n }\n\n return (\n <Dialog open={open()} onOpenChange={setOpen}>\n <Show when={local.open === undefined}>\n <DialogTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label=\"Open version and updates\"\n aria-haspopup=\"dialog\"\n >\n <Show when={state()?.phase === 'available'} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <Sparkles aria-hidden=\"true\" />\n </Show>\n {triggerLabel()}\n </DialogTrigger>\n </Show>\n\n <DialogContent\n positioner=\"inset\"\n class={cn('flex max-h-full min-h-0 max-w-3xl flex-col overflow-hidden', local.class)}\n onKeyDown={(event: KeyboardEvent) => {\n // An explanatory tooltip must not consume the popup's close shortcut,\n // including while its exit animation still owns Kobalte's top layer.\n if (event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault()\n setOpen(false)\n }\n }}\n onOpenAutoFocus={(event) => {\n focusRestoration.onOpenAutoFocus(event)\n // Start at the readable panel rather than opening an action's tooltip.\n if (!event.defaultPrevented && event.currentTarget instanceof HTMLElement) {\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n }\n }}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n <DialogHeader class=\"shrink-0\">\n <div class=\"flex items-center gap-3\">\n <Show\n when={local.appIcon}\n fallback={<Monitor class=\"size-10 text-primary\" aria-hidden=\"true\" />}\n >\n {(icon) => <img src={icon()} alt=\"\" class=\"size-10\" aria-hidden=\"true\" />}\n </Show>\n <div>\n <DialogTitle>Version &amp; updates</DialogTitle>\n <DialogDescription>\n Keep {appName()} current and review what changed in each release.\n </DialogDescription>\n </div>\n </div>\n </DialogHeader>\n\n <div\n data-slot=\"update-dialog-scroll-region\"\n class=\"flex min-h-0 min-w-0 flex-1 flex-col gap-5 overflow-y-auto p-6\"\n >\n <section\n class=\"rounded-xl border border-border bg-background/45 p-4\"\n aria-label=\"Version status\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"text-2xs font-semibold tracking-widest text-muted-foreground uppercase\">\n Installed version\n </p>\n <Heading as=\"p\" size=\"page\" tone=\"foreground\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </Heading>\n <p class=\"text-sm text-muted-foreground\">\n <Show\n when={isCurrent()}\n fallback={\n <Show\n when={state()?.phase === 'available' && state()?.availableVersion}\n fallback={\n state()?.phase === 'unavailable'\n ? 'No signed package is published for this platform.'\n : state()?.phase === 'cancelled'\n ? 'Update cancelled. You can retry when ready.'\n : desktop()\n ? 'Check the release channel for the latest signed build.'\n : (local.desktopOnlyMessage ??\n `Open this dialog inside the desktop app to check for updates.`)\n }\n >\n {`A newer release, v${state()?.availableVersion}, is ready.`}\n </Show>\n }\n >\n You are running the latest release.\n </Show>\n </p>\n </div>\n <div class=\"flex flex-col items-end gap-2\">\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Check the release channel for the latest signed app version.\"\n disabled={!desktop() || working()}\n onClick={() => void check()}\n >\n <Show when={working()} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n {checkFailed() ? 'Retry update check' : 'Check latest version'}\n </ActionButton>\n {/* The up-to-date confirmation reads as the button's outcome,\n so it sits directly beneath it rather than floating as a\n full-width row between sections. */}\n <Show when={isCurrent()}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n {appName()} is up to date.\n </p>\n </Show>\n </div>\n </div>\n <Show when={local.channelControl}>\n {(channelControl) => (\n <div class=\"mt-4 border-t border-border pt-4\">\n {channelControl()({\n disabled: channelControlDisabled,\n recheck: recheckChannel,\n })}\n </div>\n )}\n </Show>\n </section>\n\n <Show\n when={\n state()?.availableVersion &&\n state()?.phase !== 'installed' &&\n state()?.phase !== 'unavailable'\n }\n >\n <section\n class=\"rounded-xl border border-primary/35 bg-primary-subtle p-4\"\n aria-label=\"Available update\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"flex items-center gap-2 text-sm font-semibold\">\n <Sparkles class=\"size-4 text-primary\" aria-hidden=\"true\" />\n Version {state()?.availableVersion}{' '}\n {['downloading', 'installing', 'cancelling'].includes(state()?.phase ?? '')\n ? 'is being prepared'\n : 'is ready'}\n </p>\n <p class=\"text-sm text-muted-foreground\">\n The signed installer is verified before {appName()} restarts.\n </p>\n <Show when={formatReleaseDate(state()?.releaseDate ?? null)}>\n {(released) => (\n <p class=\"text-xs text-muted-foreground\">Released {released()}</p>\n )}\n </Show>\n </div>\n <ActionButton\n type=\"button\"\n size=\"sm\"\n tooltip={`Download the signed update and restart ${appName()}.`}\n disabled={working()}\n onClick={() => void install()}\n >\n <Show when={working()} fallback={<Download aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n Install and restart\n </ActionButton>\n </div>\n </section>\n </Show>\n\n {/*\n Progress with both numbers: a bar alone does not distinguish a stalled\n download from a slow one, and \"12.4 MB of 48.1 MB\" does.\n */}\n <Show\n when={\n state()?.phase === 'downloading' ||\n state()?.phase === 'installing' ||\n state()?.phase === 'cancelling'\n }\n >\n <section class=\"grid gap-2\" aria-label=\"Update progress\">\n <Progress\n value={progressValue() ?? undefined}\n aria-label={\n state()?.phase === 'installing' ? 'Installing update' : 'Downloading update'\n }\n />\n <p class=\"text-xs text-muted-foreground\" role=\"status\">\n <Show\n when={state()?.phase === 'installing'}\n fallback={\n <Show when={progressValue() !== null} fallback=\"Downloading…\">\n {`${formatBytes(state()?.downloadedBytes ?? 0)} of ${formatBytes(\n state()?.totalBytes ?? 0\n )} · ${progressValue()}%`}\n </Show>\n }\n >\n Applying the update…\n </Show>\n </p>\n <Show when={local.adapter.cancel}>\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Stop the current update download or installation.\"\n disabled={cancelPending() || state()?.phase === 'cancelling'}\n onClick={() => void cancel()}\n >\n <CircleStop aria-hidden=\"true\" />\n {cancelPending() || state()?.phase === 'cancelling'\n ? 'Cancelling…'\n : 'Cancel update'}\n </ActionButton>\n </Show>\n </section>\n </Show>\n\n <Show when={state()?.phase === 'installed'}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n <Show when={state()?.restartRequired} fallback=\"The update is applied.\">\n Restart {appName()} to finish the update.\n </Show>\n </p>\n </Show>\n\n <Show when={error()}>\n <p\n class=\"text-foreground rounded-lg border border-destructive/35 bg-destructive-subtle px-3 py-2 text-sm\"\n role=\"alert\"\n >\n {error()}\n </p>\n </Show>\n\n <Show when={notes()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-release-notes\" class=\"text-sm font-semibold text-foreground\">\n What changed in this release\n </h2>\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.availableVersion}\n </Badge>\n </div>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-code text-code leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-release-notes\"\n tabindex=\"0\"\n >\n {notes()}\n </div>\n </div>\n </Show>\n\n <Show when={changelog()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-changelog\" class=\"text-sm font-semibold text-foreground\">\n Installed changelog\n </h2>\n {/* The version pill identifies which build's history this is —\n the same treatment the available-update heading carries. */}\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </Badge>\n </div>\n <p class=\"text-xs text-muted-foreground\">\n All versions and updates included with this installation.\n </p>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-code text-code leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-changelog\"\n tabindex=\"0\"\n >\n {changelog()}\n </div>\n </div>\n </Show>\n </div>\n\n <DialogFooter>\n <Show when={state()?.releaseUrl}>\n {(url) => (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n tooltip=\"Open the release history in your browser.\"\n // `noopener,noreferrer` because the release page is a different\n // origin and must not get a handle on this window.\n onClick={() => void openRelease(url())}\n >\n <ExternalLink aria-hidden=\"true\" />\n View releases\n </ActionButton>\n )}\n </Show>\n <DialogClose as={Button} variant=\"outline\" size=\"sm\">\n Close\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkMA,SAAS+E,YAAYC,OAAoC;CACvD,IAAI,OAAOA,UAAU,UAAU,OAAOC,KAAAA;CACtC,MAAMC,UAAUF,MAAMG,KAAK;CAC3B,O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;QAAAyG,WAC3B9F,QAAG6F,gBACFpI,cAAY;SACX2K,MAAI;SACJnC,SAAO;SACPC,MAAI;SACJmC,SAAO;SAGPC,eAAe,KAAKjD,YAAYrF,IAAI,CAAC;SAAC,IAAA8F,WAAA;UAAA,OAAA,CAAAD,gBAErC3I,cAAY,EAAA,eAAA,OAAA,CAAA,GAAA,eAAA;SAAA;QAAA,CAAA;OAGhB,CAAA,GAAA2I,gBAEFlI,aAAW;QAACqI,IAAIxI;QAAQyI,SAAO;QAAWC,MAAI;QAAAJ,UAAA;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"message-row.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message-row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,GAAG;IAC1E,8DAA8D;IAC9D,UAAU,EAAE,sBAAsB,CAAA;IAClC,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,kFAAkF;IAClF,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,gEAAgE;IAChE,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAiLhD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAOxD;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,eAgBjF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,eA2DF"}
1
+ {"version":3,"file":"message-row.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message-row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM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Ac,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,eAgBjF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,eA2DF"}
@@ -13,13 +13,13 @@ var _tmpl$4 = /*#__PURE__*/ template(`<span>edited`);
13
13
  var _tmpl$5 = /*#__PURE__*/ template(`<span role=status>sending…`);
14
14
  var _tmpl$6 = /*#__PURE__*/ template(`<span role=status>responding…`);
15
15
  var _tmpl$7 = /*#__PURE__*/ template(`<span role=img aria-label=Delivered class=inline-flex>`);
16
- var _tmpl$8 = /*#__PURE__*/ template(`<article data-slot=message-row><span data-slot=message-avatar></span><div data-slot=message-content><div data-slot=message-bubble><span class=visually-hidden></span><div data-slot=message-body class=text-sm></div><div data-slot=message-meta class="mt-1 flex items-center gap-2 text-2xs text-muted-foreground"></div></div><footer data-slot=message-actions>`);
17
- var _tmpl$9 = /*#__PURE__*/ template(`<p class="text-muted-foreground italic">Message deleted`);
16
+ var _tmpl$8 = /*#__PURE__*/ template(`<article data-slot=message-row><span data-slot=message-avatar></span><div data-slot=message-content><div data-slot=message-bubble><span class=visually-hidden></span><div data-slot=message-body class="font-content text-content"></div><div data-slot=message-meta class="mt-1 flex items-center gap-2 text-2xs text-muted-foreground"></div></div><footer data-slot=message-actions>`);
17
+ var _tmpl$9 = /*#__PURE__*/ template(`<p class="font-content text-content text-muted-foreground italic">Message deleted`);
18
18
  var _tmpl$0 = /*#__PURE__*/ template(`<div data-slot=message-group role=group>`);
19
19
  var _tmpl$1 = /*#__PURE__*/ template(`<div data-slot=message-day-divider role=separator><span class="h-px flex-1 bg-border"></span><span class="text-2xs font-medium tracking-wide text-muted-foreground uppercase"></span><span class="h-px flex-1 bg-border">`);
20
20
  var _tmpl$10 = /*#__PURE__*/ template(`<span class=streaming-caret aria-hidden=true>`);
21
21
  var _tmpl$11 = /*#__PURE__*/ template(`<div data-slot=message-body>`);
22
- var _tmpl$12 = /*#__PURE__*/ template(`<p class=whitespace-pre-wrap>`);
22
+ var _tmpl$12 = /*#__PURE__*/ template(`<p class="font-content text-content whitespace-pre-wrap">`);
23
23
  function MessageRow(props) {
24
24
  const [local, rest] = splitProps(props, [
25
25
  "class",
@@ -1 +1 @@
1
- {"version":3,"file":"message-row.js","names":["CheckCheck","MessageSquareReply","Pencil","RotateCcw","Trash2","ComponentProps","JSX","For","Show","splitProps","cn","Button","CodeBlock","InlineCode","ConversationAvatar","ConversationAvatarKind","MessageRowProps","Omit","senderKind","senderName","time","dateTime","edited","pending","streaming","deleted","highlighted","avatar","Element","attachments","link","actions","onOpenThread","onThreadIntent","onEdit","onDelete","onRetry","MessageRow","props","local","rest","mirrored","_el$","_tmpl$8","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_el$6","_el$9","_el$13","_$spread","_$mergeProps","data-message-kind","aria-busy","undefined","tabindex","class","_$insert","_$createComponent","kind","size","children","when","fallback","_tmpl$9","_el$7","_tmpl$","_el$8","_tmpl$2","_el$0","_tmpl$3","_$effect","_$setAttribute","_tmpl$4","_tmpl$5","_tmpl$6","_$memo","_el$12","_tmpl$7","variant","onClick","onPointerEnter","onFocus","_p$","_v$","_v$2","_v$3","_v$4","e","_$className","t","a","o","MessageGroup","_el$15","_tmpl$0","MessageDayDivider","label","_el$16","_tmpl$1","_el$17","_el$18","MessageBody","text","segments","split","filter","Boolean","map","segment","startsWith","const","value","replace","body","newline","indexOf","firstLine","slice","language","test","trim","last","at","_el$19","_tmpl$11","each","Prose","code","complete","_tmpl$10","parts","_el$21","_tmpl$12","part","endsWith","length","_$mergeProps","_$createComponent","_$setAttribute","_$memo","_$className"],"sources":["../../../src/components/conversation/message-row.tsx"],"sourcesContent":["import { CheckCheck, MessageSquareReply, Pencil, RotateCcw, Trash2 } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { CodeBlock, InlineCode } from '../ui/code-block'\nimport { ConversationAvatar, type ConversationAvatarKind } from './conversation-avatar'\n\n/**\n * MessageRow.\n *\n * One turn in a transcript: a speaker, a bubble, and the actions that apply to it.\n *\n * ## What it does not know\n *\n * It takes no domain types. A caller supplies the speaker's name, the timestamp, and\n * the body as children; attachments, a linked task and the action row are slots. That\n * is deliberate and it is the difference between a component a second application can\n * use and one that only fits the application it was written in — the first version of\n * this row was written against adea's message model and could not have been used by\n * cortana at all.\n *\n * ## The two things it does know\n *\n * **The speaker's own messages mirror.** A user's turn puts the avatar on the trailing\n * edge and the bubble on the leading one, so a transcript can be read as a\n * conversation rather than as a log. `senderKind` decides that, and it is the only\n * place the layout branches.\n *\n * **`content-visibility: auto`.** A transcript is the one list in an application that\n * can hold thousands of rows, and this lets the engine skip layout and paint for the\n * ones off screen. `contain-intrinsic-size` is what keeps the scrollbar honest while\n * it does — without it the scroll height collapses as rows are skipped and the\n * thumb jumps. Both are load-bearing rather than an optimisation to add later.\n */\nexport type MessageRowProps = Omit<ComponentProps<'article'>, 'onSelect'> & {\n /** Who spoke. Decides the mirroring and the avatar's tone. */\n senderKind: ConversationAvatarKind\n /** The speaker's name, announced with the message rather than drawn. */\n senderName: string\n /** An ISO timestamp, rendered by the caller's own formatter. */\n time?: string\n /** The machine-readable time, for `<time datetime>`. */\n dateTime?: string\n /** Set when the message has been edited after sending. */\n edited?: boolean\n /** Set while the message is in flight. */\n pending?: boolean\n /**\n * Set while tokens are still arriving. Shows a caret after the body and drops\n * the delivered tick; distinct from `pending`, which is the *sending* state of\n * a message the user wrote. A turn can be neither, either, or (briefly) both.\n */\n streaming?: boolean\n /** Set when the message has been deleted, which replaces the body. */\n deleted?: boolean\n /** Draw attention to this row, e.g. after arriving from a search result. */\n highlighted?: boolean\n /** The caller's own avatar content. Falls back to a glyph for the kind. */\n avatar?: JSX.Element\n /** Attachments, rendered under the body. */\n attachments?: JSX.Element\n /** A linked entity — a task, an artifact, a session — rendered under the body. */\n link?: JSX.Element\n /** Extra rows in the action strip, before the built-in ones. */\n actions?: JSX.Element\n /** Show the reply affordance. Omit it to hide the action. */\n onOpenThread?: () => void\n /** Fires on hover and focus of the reply affordance, for prefetching. */\n onThreadIntent?: () => void\n onEdit?: () => void\n onDelete?: () => void\n onRetry?: () => void\n}\n\nexport function MessageRow(props: MessageRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'senderKind',\n 'senderName',\n 'time',\n 'dateTime',\n 'edited',\n 'pending',\n 'streaming',\n 'deleted',\n 'highlighted',\n 'avatar',\n 'attachments',\n 'link',\n 'actions',\n 'onOpenThread',\n 'onThreadIntent',\n 'onEdit',\n 'onDelete',\n 'onRetry',\n 'children',\n ])\n\n const mirrored = () => local.senderKind === 'user'\n\n return (\n <article\n data-slot=\"message-row\"\n data-message-kind={local.senderKind}\n aria-busy={local.pending || undefined}\n tabindex={local.highlighted ? -1 : undefined}\n class={cn(\n 'group/message grid max-w-3xl gap-2.5 px-1 py-1.5',\n /* The row is skipped by the engine while off screen; the intrinsic size keeps\n the scroll height stable while that happens. */\n '[content-visibility:auto] [contain-intrinsic-size:auto_7rem]',\n mirrored() ? 'grid-cols-[minmax(0,1fr)_2rem]' : 'grid-cols-[1.9rem_minmax(0,1fr)]',\n 'transition-colors ease-out hover:bg-muted/45',\n local.highlighted && 'bg-primary-subtle shadow-[inset_3px_0_var(--primary)]',\n local.class\n )}\n {...rest}\n >\n <span data-slot=\"message-avatar\" class={cn('mt-0.5', mirrored() ? 'order-2' : 'order-1')}>\n <ConversationAvatar kind={local.senderKind} size={mirrored() ? 'lg' : 'md'}>\n {local.avatar}\n </ConversationAvatar>\n </span>\n\n <div\n data-slot=\"message-content\"\n class={cn('flex min-w-0 flex-col gap-1', mirrored() ? 'order-1' : 'order-2')}\n >\n <div\n data-slot=\"message-bubble\"\n class={cn(\n 'relative w-fit min-w-16 max-w-[min(100%,38rem)] rounded-lg border border-border px-3.5 pt-2.5 pb-2',\n 'bg-card text-card-foreground',\n /* The tail: a squared corner on the side the speaker sits, which is what\n makes a bubble read as belonging to one voice. */\n mirrored() ? 'rounded-ee-sm ms-auto' : 'rounded-es-sm'\n )}\n >\n {/* The name is announced with the message rather than drawn: a transcript\n that repeats every speaker's name in every bubble is one nobody reads. */}\n <span class=\"visually-hidden\">{local.senderName}</span>\n\n <div data-slot=\"message-body\" class=\"text-sm\">\n <Show\n when={!local.deleted}\n fallback={<p class=\"text-muted-foreground italic\">Message deleted</p>}\n >\n {local.children}\n </Show>\n </div>\n\n <Show when={local.attachments}>\n <div class=\"mt-2 flex flex-wrap gap-2\">{local.attachments}</div>\n </Show>\n\n <Show when={local.link}>\n <div class=\"mt-2\">{local.link}</div>\n </Show>\n\n <div\n data-slot=\"message-meta\"\n class=\"mt-1 flex items-center gap-2 text-2xs text-muted-foreground\"\n >\n <Show when={local.time}>\n <time datetime={local.dateTime}>{local.time}</time>\n </Show>\n <Show when={local.edited}>\n <span>edited</span>\n </Show>\n <Show when={local.pending}>\n <span role=\"status\">sending…</span>\n </Show>\n <Show when={local.streaming}>\n <span role=\"status\">responding…</span>\n </Show>\n <Show when={mirrored() && !local.pending && !local.streaming && !local.deleted}>\n {/*\n `role=\"img\"` because a bare span cannot carry `aria-label` — axe's\n `aria-prohibited-attr`. The glyph is the whole message, so the role\n is also the accurate one: this element *is* an image whose meaning\n is its label.\n */}\n <span role=\"img\" aria-label=\"Delivered\" class=\"inline-flex\">\n <CheckCheck aria-hidden=\"true\" class=\"size-3\" />\n </span>\n </Show>\n </div>\n </div>\n\n {/* The action strip is hidden until the row is hovered or focused, so a\n transcript is not a wall of buttons — but it stays in the accessibility\n tree and the tab order, because a control that only exists under the\n pointer cannot be reached by keyboard. */}\n <footer\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100',\n mirrored() && 'justify-end'\n )}\n >\n <Show when={local.actions}>{local.actions}</Show>\n <Show when={local.onOpenThread && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onOpenThread?.()}\n onPointerEnter={() => local.onThreadIntent?.()}\n onFocus={() => local.onThreadIntent?.()}\n >\n <MessageSquareReply />\n Thread\n </Button>\n </Show>\n <Show when={local.onEdit && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onEdit?.()}\n >\n <Pencil />\n Edit\n </Button>\n </Show>\n <Show when={local.onDelete && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onDelete?.()}\n >\n <Trash2 />\n Delete\n </Button>\n </Show>\n <Show when={local.onRetry}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onRetry?.()}\n >\n <RotateCcw />\n Retry\n </Button>\n </Show>\n </footer>\n </div>\n </article>\n )\n}\n\n/**\n * A run of messages from the same speaker.\n *\n * Consecutive turns from one voice are a *paragraph*, and a transcript that repeats\n * the avatar and the name for each line reads as noise. The group draws the first\n * row fully and the rest without their avatar.\n */\nexport function MessageGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div data-slot=\"message-group\" role=\"group\" class={cn('flex flex-col', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/** A day divider, so a long transcript has somewhere to rest the eye. */\nexport function MessageDayDivider(props: ComponentProps<'div'> & { label: string }) {\n const [local, rest] = splitProps(props, ['class', 'label'])\n return (\n <div\n data-slot=\"message-day-divider\"\n role=\"separator\"\n class={cn('flex items-center gap-3 px-4 py-3', local.class)}\n {...rest}\n >\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {local.label}\n </span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n )\n}\n\n/**\n * Renders a body's code fences as blocks, which a plain `<p>` cannot.\n *\n * The fence grammar is the part worth owning: a fence opens with ``` and an\n * optional language, and closes with ``` on its own. Everything outside a fence\n * is prose, and inside it the language tag belongs to the block's header rather\n * than to the code.\n *\n * Inline code — a single backtick pair inside a line — is rendered too, because\n * the alternative is an identifier in the prose that is indistinguishable from a\n * word. Only the *first* pair on a line is treated as code by the splitter here,\n * which is the common case; a caller that needs full inline grammar should pass\n * already-rendered children instead of `text`.\n */\nexport function MessageBody(\n props: ComponentProps<'div'> & {\n text: string\n /** True while the turn is still streaming, so a partial fence renders as a block. */\n streaming?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'text', 'streaming'])\n\n /**\n * Split on fences, then on inline code. `filter(Boolean)` because a text that\n * begins with a fence produces an empty leading segment.\n */\n const segments = () =>\n local.text\n .split(/(```[\\s\\S]*?(?:```|$))/g)\n .filter(Boolean)\n .map((segment) => {\n if (!segment.startsWith('```')) {\n // The newlines that separate prose from a fence belong to the fence\n // syntax. Kept, `whitespace-pre-wrap` draws them as blank lines on top\n // of the column gap, doubling the space beside every code block.\n return { kind: 'prose' as const, value: segment.replace(/^\\n+|\\n+$/g, '') }\n }\n const body = segment.replace(/^```/, '').replace(/```$/, '')\n // The language is the first token on the opening line, and only when the\n // fence actually carried one — a fence with a bare newline has none.\n const newline = body.indexOf('\\n')\n const firstLine = newline === -1 ? '' : body.slice(0, newline)\n const language = /^[\\w+#.-]+$/.test(firstLine.trim()) ? firstLine.trim() : undefined\n return {\n kind: 'code' as const,\n value: language ? body.slice(newline + 1) : body,\n language,\n }\n })\n // Newlines alone between two fences leave an empty paragraph once trimmed.\n .filter((segment) => segment.kind === 'code' || segment.value !== '')\n\n const last = () => segments().at(-1)\n\n return (\n <div data-slot=\"message-body\" class={cn('flex flex-col gap-2', local.class)} {...rest}>\n <For each={segments()}>\n {(segment) => (\n <Show when={segment.kind === 'code'} fallback={<Prose text={segment.value} />}>\n <CodeBlock\n code={segment.value}\n language={segment.kind === 'code' ? segment.language : undefined}\n complete={!local.streaming}\n />\n </Show>\n )}\n </For>\n {/*\n The caret trails the last segment, and only when that segment is prose: a\n streaming code block already carries its own generating indicator, and two\n of them on one turn read as two streams.\n */}\n <Show when={local.streaming && last()?.kind === 'prose'}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\n/**\n * A run of prose, with its inline code marked. The split is non-greedy and\n * requires a non-empty span, so an unmatched backtick stays a backtick rather\n * than swallowing the rest of the paragraph.\n */\nfunction Prose(props: { text: string }) {\n const parts = () => props.text.split(/(`[^`\\n]+`)/g).filter(Boolean)\n\n return (\n <p class=\"whitespace-pre-wrap\">\n <For each={parts()}>\n {(part) => (\n <Show\n when={part.startsWith('`') && part.endsWith('`') && part.length > 2}\n fallback={part}\n >\n <InlineCode>{part.slice(1, -1)}</InlineCode>\n </Show>\n )}\n </For>\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgBqC,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ/B,WAAW6B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMG,iBAAiBF,MAAMrB,eAAe;CAE5C,cAAA;EAAA,IAAAwB,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG,aAAAC,QAAAF,MAAAD,YAAAI,QAAAD,MAAAH,YAAAK,QAAAD,MAAAF,aAAAI,QAAAD,MAAAH,aAAAK,SAAAJ,MAAAD;EAAAM,OAAAX,MAAAY,WAAA;GAAA,KAAA,uBAAA;IAAA,OAGuBf,MAAMrB;GAAU;GAAA,K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AK7D;;;;;;AAOA,SAASG,MAAM5F,OAAyB;CACtC,MAAMgG,cAAchG,MAAMoE,KAAKE,MAAM,cAAc,CAAC,CAACC,OAAOC,OAAO;CAEnE,cAAA;EAAA,IAAAyB,SAAAC,SAAA;EAAA5E,OAAA2E,QAAA1E,gBAEKtD,KAAG;GAAA,IAAC0H,OAAI;IAAA,OAAEK,MAAM;GAAC;GAAAtE,WACdyE,SAAI5E,gBACHrD,MAAI;IAAA,IACHyD,OAAI;KAAA,OAAEc,WAAA,CAAA,EAAA0D,KAAKxB,WAAW,GAAG,KAAKwB,KAAKC,SAAS,GAAG,EAAC,CAAA,CAAA,KAAID,KAAKE,SAAS;IAAC;IACnEzE,UAAUuE;IAAI,IAAAzE,WAAA;KAAA,OAAAH,gBAEbhD,YAAU,EAAA,IAAAmD,WAAA;MAAA,OAAEyE,KAAKhB,MAAM,GAAG,EAAE;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;EAEjC,CAAA,CAAA;EAAA,OAAAc;CAAA,EAAA,CAAA;AAIT"}
1
+ {"version":3,"file":"message-row.js","names":["CheckCheck","MessageSquareReply","Pencil","RotateCcw","Trash2","ComponentProps","JSX","For","Show","splitProps","cn","Button","CodeBlock","InlineCode","ConversationAvatar","ConversationAvatarKind","MessageRowProps","Omit","senderKind","senderName","time","dateTime","edited","pending","streaming","deleted","highlighted","avatar","Element","attachments","link","actions","onOpenThread","onThreadIntent","onEdit","onDelete","onRetry","MessageRow","props","local","rest","mirrored","_el$","_tmpl$8","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_el$6","_el$9","_el$13","_$spread","_$mergeProps","data-message-kind","aria-busy","undefined","tabindex","class","_$insert","_$createComponent","kind","size","children","when","fallback","_tmpl$9","_el$7","_tmpl$","_el$8","_tmpl$2","_el$0","_tmpl$3","_$effect","_$setAttribute","_tmpl$4","_tmpl$5","_tmpl$6","_$memo","_el$12","_tmpl$7","variant","onClick","onPointerEnter","onFocus","_p$","_v$","_v$2","_v$3","_v$4","e","_$className","t","a","o","MessageGroup","_el$15","_tmpl$0","MessageDayDivider","label","_el$16","_tmpl$1","_el$17","_el$18","MessageBody","text","segments","split","filter","Boolean","map","segment","startsWith","const","value","replace","body","newline","indexOf","firstLine","slice","language","test","trim","last","at","_el$19","_tmpl$11","each","Prose","code","complete","_tmpl$10","parts","_el$21","_tmpl$12","part","endsWith","length","_$mergeProps","_$createComponent","_$setAttribute","_$memo","_$className"],"sources":["../../../src/components/conversation/message-row.tsx"],"sourcesContent":["import { CheckCheck, MessageSquareReply, Pencil, RotateCcw, Trash2 } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport { CodeBlock, InlineCode } from '../ui/code-block'\nimport { ConversationAvatar, type ConversationAvatarKind } from './conversation-avatar'\n\n/**\n * MessageRow.\n *\n * One turn in a transcript: a speaker, a bubble, and the actions that apply to it.\n *\n * ## What it does not know\n *\n * It takes no domain types. A caller supplies the speaker's name, the timestamp, and\n * the body as children; attachments, a linked task and the action row are slots. That\n * is deliberate and it is the difference between a component a second application can\n * use and one that only fits the application it was written in — the first version of\n * this row was written against adea's message model and could not have been used by\n * cortana at all.\n *\n * ## The two things it does know\n *\n * **The speaker's own messages mirror.** A user's turn puts the avatar on the trailing\n * edge and the bubble on the leading one, so a transcript can be read as a\n * conversation rather than as a log. `senderKind` decides that, and it is the only\n * place the layout branches.\n *\n * **`content-visibility: auto`.** A transcript is the one list in an application that\n * can hold thousands of rows, and this lets the engine skip layout and paint for the\n * ones off screen. `contain-intrinsic-size` is what keeps the scrollbar honest while\n * it does — without it the scroll height collapses as rows are skipped and the\n * thumb jumps. Both are load-bearing rather than an optimisation to add later.\n */\nexport type MessageRowProps = Omit<ComponentProps<'article'>, 'onSelect'> & {\n /** Who spoke. Decides the mirroring and the avatar's tone. */\n senderKind: ConversationAvatarKind\n /** The speaker's name, announced with the message rather than drawn. */\n senderName: string\n /** An ISO timestamp, rendered by the caller's own formatter. */\n time?: string\n /** The machine-readable time, for `<time datetime>`. */\n dateTime?: string\n /** Set when the message has been edited after sending. */\n edited?: boolean\n /** Set while the message is in flight. */\n pending?: boolean\n /**\n * Set while tokens are still arriving. Shows a caret after the body and drops\n * the delivered tick; distinct from `pending`, which is the *sending* state of\n * a message the user wrote. A turn can be neither, either, or (briefly) both.\n */\n streaming?: boolean\n /** Set when the message has been deleted, which replaces the body. */\n deleted?: boolean\n /** Draw attention to this row, e.g. after arriving from a search result. */\n highlighted?: boolean\n /** The caller's own avatar content. Falls back to a glyph for the kind. */\n avatar?: JSX.Element\n /** Attachments, rendered under the body. */\n attachments?: JSX.Element\n /** A linked entity — a task, an artifact, a session — rendered under the body. */\n link?: JSX.Element\n /** Extra rows in the action strip, before the built-in ones. */\n actions?: JSX.Element\n /** Show the reply affordance. Omit it to hide the action. */\n onOpenThread?: () => void\n /** Fires on hover and focus of the reply affordance, for prefetching. */\n onThreadIntent?: () => void\n onEdit?: () => void\n onDelete?: () => void\n onRetry?: () => void\n}\n\nexport function MessageRow(props: MessageRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'senderKind',\n 'senderName',\n 'time',\n 'dateTime',\n 'edited',\n 'pending',\n 'streaming',\n 'deleted',\n 'highlighted',\n 'avatar',\n 'attachments',\n 'link',\n 'actions',\n 'onOpenThread',\n 'onThreadIntent',\n 'onEdit',\n 'onDelete',\n 'onRetry',\n 'children',\n ])\n\n const mirrored = () => local.senderKind === 'user'\n\n return (\n <article\n data-slot=\"message-row\"\n data-message-kind={local.senderKind}\n aria-busy={local.pending || undefined}\n tabindex={local.highlighted ? -1 : undefined}\n class={cn(\n 'group/message grid max-w-3xl gap-2.5 px-1 py-1.5',\n /* The row is skipped by the engine while off screen; the intrinsic size keeps\n the scroll height stable while that happens. */\n '[content-visibility:auto] [contain-intrinsic-size:auto_7rem]',\n mirrored() ? 'grid-cols-[minmax(0,1fr)_2rem]' : 'grid-cols-[1.9rem_minmax(0,1fr)]',\n 'transition-colors ease-out hover:bg-muted/45',\n local.highlighted && 'bg-primary-subtle shadow-[inset_3px_0_var(--primary)]',\n local.class\n )}\n {...rest}\n >\n <span data-slot=\"message-avatar\" class={cn('mt-0.5', mirrored() ? 'order-2' : 'order-1')}>\n <ConversationAvatar kind={local.senderKind} size={mirrored() ? 'lg' : 'md'}>\n {local.avatar}\n </ConversationAvatar>\n </span>\n\n <div\n data-slot=\"message-content\"\n class={cn('flex min-w-0 flex-col gap-1', mirrored() ? 'order-1' : 'order-2')}\n >\n <div\n data-slot=\"message-bubble\"\n class={cn(\n 'relative w-fit min-w-16 max-w-[min(100%,38rem)] rounded-lg border border-border px-3.5 pt-2.5 pb-2',\n 'bg-card text-card-foreground',\n /* The tail: a squared corner on the side the speaker sits, which is what\n makes a bubble read as belonging to one voice. */\n mirrored() ? 'rounded-ee-sm ms-auto' : 'rounded-es-sm'\n )}\n >\n {/* The name is announced with the message rather than drawn: a transcript\n that repeats every speaker's name in every bubble is one nobody reads. */}\n <span class=\"visually-hidden\">{local.senderName}</span>\n\n <div data-slot=\"message-body\" class=\"font-content text-content\">\n <Show\n when={!local.deleted}\n fallback={\n <p class=\"font-content text-content text-muted-foreground italic\">\n Message deleted\n </p>\n }\n >\n {local.children}\n </Show>\n </div>\n\n <Show when={local.attachments}>\n <div class=\"mt-2 flex flex-wrap gap-2\">{local.attachments}</div>\n </Show>\n\n <Show when={local.link}>\n <div class=\"mt-2\">{local.link}</div>\n </Show>\n\n <div\n data-slot=\"message-meta\"\n class=\"mt-1 flex items-center gap-2 text-2xs text-muted-foreground\"\n >\n <Show when={local.time}>\n <time datetime={local.dateTime}>{local.time}</time>\n </Show>\n <Show when={local.edited}>\n <span>edited</span>\n </Show>\n <Show when={local.pending}>\n <span role=\"status\">sending…</span>\n </Show>\n <Show when={local.streaming}>\n <span role=\"status\">responding…</span>\n </Show>\n <Show when={mirrored() && !local.pending && !local.streaming && !local.deleted}>\n {/*\n `role=\"img\"` because a bare span cannot carry `aria-label` — axe's\n `aria-prohibited-attr`. The glyph is the whole message, so the role\n is also the accurate one: this element *is* an image whose meaning\n is its label.\n */}\n <span role=\"img\" aria-label=\"Delivered\" class=\"inline-flex\">\n <CheckCheck aria-hidden=\"true\" class=\"size-3\" />\n </span>\n </Show>\n </div>\n </div>\n\n {/* The action strip is hidden until the row is hovered or focused, so a\n transcript is not a wall of buttons — but it stays in the accessibility\n tree and the tab order, because a control that only exists under the\n pointer cannot be reached by keyboard. */}\n <footer\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100',\n mirrored() && 'justify-end'\n )}\n >\n <Show when={local.actions}>{local.actions}</Show>\n <Show when={local.onOpenThread && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onOpenThread?.()}\n onPointerEnter={() => local.onThreadIntent?.()}\n onFocus={() => local.onThreadIntent?.()}\n >\n <MessageSquareReply />\n Thread\n </Button>\n </Show>\n <Show when={local.onEdit && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onEdit?.()}\n >\n <Pencil />\n Edit\n </Button>\n </Show>\n <Show when={local.onDelete && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onDelete?.()}\n >\n <Trash2 />\n Delete\n </Button>\n </Show>\n <Show when={local.onRetry}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onRetry?.()}\n >\n <RotateCcw />\n Retry\n </Button>\n </Show>\n </footer>\n </div>\n </article>\n )\n}\n\n/**\n * A run of messages from the same speaker.\n *\n * Consecutive turns from one voice are a *paragraph*, and a transcript that repeats\n * the avatar and the name for each line reads as noise. The group draws the first\n * row fully and the rest without their avatar.\n */\nexport function MessageGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div data-slot=\"message-group\" role=\"group\" class={cn('flex flex-col', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/** A day divider, so a long transcript has somewhere to rest the eye. */\nexport function MessageDayDivider(props: ComponentProps<'div'> & { label: string }) {\n const [local, rest] = splitProps(props, ['class', 'label'])\n return (\n <div\n data-slot=\"message-day-divider\"\n role=\"separator\"\n class={cn('flex items-center gap-3 px-4 py-3', local.class)}\n {...rest}\n >\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {local.label}\n </span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n )\n}\n\n/**\n * Renders a body's code fences as blocks, which a plain `<p>` cannot.\n *\n * The fence grammar is the part worth owning: a fence opens with ``` and an\n * optional language, and closes with ``` on its own. Everything outside a fence\n * is prose, and inside it the language tag belongs to the block's header rather\n * than to the code.\n *\n * Inline code — a single backtick pair inside a line — is rendered too, because\n * the alternative is an identifier in the prose that is indistinguishable from a\n * word. Only the *first* pair on a line is treated as code by the splitter here,\n * which is the common case; a caller that needs full inline grammar should pass\n * already-rendered children instead of `text`.\n */\nexport function MessageBody(\n props: ComponentProps<'div'> & {\n text: string\n /** True while the turn is still streaming, so a partial fence renders as a block. */\n streaming?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'text', 'streaming'])\n\n /**\n * Split on fences, then on inline code. `filter(Boolean)` because a text that\n * begins with a fence produces an empty leading segment.\n */\n const segments = () =>\n local.text\n .split(/(```[\\s\\S]*?(?:```|$))/g)\n .filter(Boolean)\n .map((segment) => {\n if (!segment.startsWith('```')) {\n // The newlines that separate prose from a fence belong to the fence\n // syntax. Kept, `whitespace-pre-wrap` draws them as blank lines on top\n // of the column gap, doubling the space beside every code block.\n return { kind: 'prose' as const, value: segment.replace(/^\\n+|\\n+$/g, '') }\n }\n const body = segment.replace(/^```/, '').replace(/```$/, '')\n // The language is the first token on the opening line, and only when the\n // fence actually carried one — a fence with a bare newline has none.\n const newline = body.indexOf('\\n')\n const firstLine = newline === -1 ? '' : body.slice(0, newline)\n const language = /^[\\w+#.-]+$/.test(firstLine.trim()) ? firstLine.trim() : undefined\n return {\n kind: 'code' as const,\n value: language ? body.slice(newline + 1) : body,\n language,\n }\n })\n // Newlines alone between two fences leave an empty paragraph once trimmed.\n .filter((segment) => segment.kind === 'code' || segment.value !== '')\n\n const last = () => segments().at(-1)\n\n return (\n <div data-slot=\"message-body\" class={cn('flex flex-col gap-2', local.class)} {...rest}>\n <For each={segments()}>\n {(segment) => (\n <Show when={segment.kind === 'code'} fallback={<Prose text={segment.value} />}>\n <CodeBlock\n code={segment.value}\n language={segment.kind === 'code' ? segment.language : undefined}\n complete={!local.streaming}\n />\n </Show>\n )}\n </For>\n {/*\n The caret trails the last segment, and only when that segment is prose: a\n streaming code block already carries its own generating indicator, and two\n of them on one turn read as two streams.\n */}\n <Show when={local.streaming && last()?.kind === 'prose'}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\n/**\n * A run of prose, with its inline code marked. The split is non-greedy and\n * requires a non-empty span, so an unmatched backtick stays a backtick rather\n * than swallowing the rest of the paragraph.\n */\nfunction Prose(props: { text: string }) {\n const parts = () => props.text.split(/(`[^`\\n]+`)/g).filter(Boolean)\n\n return (\n <p class=\"font-content text-content whitespace-pre-wrap\">\n <For each={parts()}>\n {(part) => (\n <Show\n when={part.startsWith('`') && part.endsWith('`') && part.length > 2}\n fallback={part}\n >\n <InlineCode>{part.slice(1, -1)}</InlineCode>\n </Show>\n )}\n </For>\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgBqC,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ/B,WAAW6B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;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WjE,KAAAA;MAAS;MAAA,IAChE2E,WAAQ;OAAA,OAAE,CAAC7F,MAAMf;MAAS;KAAA,CAAA;IAAA;GAAA,CAAA;EAG/B,CAAA,GAAA,IAAA;EAAAoC,OAAAmE,QAAAlE,gBAOFrD,MAAI;GAAA,IAACyD,OAAI;IAAA,OAAEc,WAAA,CAAA,CAAAxC,MAAMf,SAAS,CAAA,CAAA,KAAIqG,KAAK,CAAC,EAAE/D,SAAS;GAAO;GAAA,IAAAE,WAAA;IAAA,OAAAqE,SAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAN;CAAA,EAAA,CAAA;AAK7D;;;;;;AAOA,SAASG,MAAM5F,OAAyB;CACtC,MAAMgG,cAAchG,MAAMoE,KAAKE,MAAM,cAAc,CAAC,CAACC,OAAOC,OAAO;CAEnE,cAAA;EAAA,IAAAyB,SAAAC,SAAA;EAAA5E,OAAA2E,QAAA1E,gBAEKtD,KAAG;GAAA,IAAC0H,OAAI;IAAA,OAAEK,MAAM;GAAC;GAAAtE,WACdyE,SAAI5E,gBACHrD,MAAI;IAAA,IACHyD,OAAI;KAAA,OAAEc,WAAA,CAAA,EAAA0D,KAAKxB,WAAW,GAAG,KAAKwB,KAAKC,SAAS,GAAG,EAAC,CAAA,CAAA,KAAID,KAAKE,SAAS;IAAC;IACnEzE,UAAUuE;IAAI,IAAAzE,WAAA;KAAA,OAAAH,gBAEbhD,YAAU,EAAA,IAAAmD,WAAA;MAAA,OAAEyE,KAAKhB,MAAM,GAAG,EAAE;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;EAEjC,CAAA,CAAA;EAAA,OAAAc;CAAA,EAAA,CAAA;AAIT"}
@@ -9,7 +9,7 @@ var _tmpl$2 = /*#__PURE__*/ template(`<textarea data-slot=composer-input aria-ke
9
9
  var _tmpl$3 = /*#__PURE__*/ template(`<span class=visually-hidden>When the caret is next to a paste token or a token is selected, press Alt+Down Arrow to preview its text. Press Escape to close the preview.`);
10
10
  var _tmpl$4 = /*#__PURE__*/ template(`<span class="box-decoration-clone rounded-md bg-primary-subtle">`);
11
11
  var _tmpl$5 = /*#__PURE__*/ template(`<span>`);
12
- var _tmpl$6 = /*#__PURE__*/ template(`<pre class="m-0 max-h-48 max-w-64 overflow-y-auto whitespace-pre-wrap break-words font-mono">`);
12
+ var _tmpl$6 = /*#__PURE__*/ template(`<pre class="m-0 max-h-48 max-w-64 overflow-y-auto whitespace-pre-wrap break-words font-code text-code">`);
13
13
  var _tmpl$7 = /*#__PURE__*/ template(`<span>+<!> more lines`);
14
14
  var _tmpl$8 = /*#__PURE__*/ template(`<span>+<!> more characters`);
15
15
  var PREVIEW_OPEN_DELAY_MS = 300;