@adea-ai/ui 0.152.1 → 0.152.2
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.
- package/dist/components/composites/about-dialog/about-dialog.js +2 -2
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +3 -3
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +1 -1
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +3 -3
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +3 -3
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +1 -1
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +1 -1
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +1 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +2 -2
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
- package/dist/r/src/components/composites/terminal/terminal.tsx +2 -2
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +3 -3
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +3 -5
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/dist/r/src/components/conversation/message-composer.tsx +1 -2
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +1 -1
- package/dist/r/src/components/theme/appearance-panel.tsx +2 -4
- package/dist/vite/tailwind-sources.d.ts.map +1 -1
- package/dist/vite/tailwind-sources.js +49 -9
- package/dist/vite/tailwind-sources.js.map +1 -1
- package/package.json +1 -1
- package/src/components/composites/about-dialog/about-dialog.tsx +2 -2
- package/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
- package/src/components/composites/terminal/terminal.tsx +2 -2
- package/src/components/composites/update-dialog/channel-control.tsx +3 -3
- package/src/components/composites/update-dialog/update-dialog.tsx +3 -5
- package/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/src/components/conversation/message-composer.tsx +1 -2
- package/src/components/layout/split-layout/split-layout.tsx +1 -1
- package/src/components/theme/appearance-panel.tsx +2 -4
- package/src/vite/tailwind-sources.ts +67 -7
|
@@ -94,7 +94,7 @@ function AboutDialog(props) {
|
|
|
94
94
|
get busy() {
|
|
95
95
|
return copying();
|
|
96
96
|
},
|
|
97
|
-
tooltip: "Copy
|
|
97
|
+
tooltip: "Copy version details",
|
|
98
98
|
onClick: () => void copy(),
|
|
99
99
|
get children() {
|
|
100
100
|
return copied() ? "Copied" : "Copy version info";
|
|
@@ -111,7 +111,7 @@ function AboutDialog(props) {
|
|
|
111
111
|
target: "_blank",
|
|
112
112
|
rel: "noopener noreferrer",
|
|
113
113
|
get tooltip() {
|
|
114
|
-
return `Open the ${props.appName}
|
|
114
|
+
return `Open the ${props.appName} repository`;
|
|
115
115
|
},
|
|
116
116
|
onClick: (event) => {
|
|
117
117
|
if (props.openExternal) setError("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about-dialog.js","names":["createEffect","createMemo","createSignal","on","onCleanup","Show","Accessor","ExternalLink","writeClipboardText","createExternalLinkOpener","ActionButton","Alert","AlertDescription","Dialog","DialogContent","DialogTitle","AboutDialogProps","appName","appIcon","version","platform","copyright","sourceUrl","open","onOpenChange","copyVersionInfo","text","Promise","openExternal","url","restoreFocusRef","HTMLElement","COPIED_FEEDBACK_MS","AboutDialog","props","versionLabel","versionInfo","join","copied","setCopied","error","setError","copying","setCopying","disposed","epoch","timer","ReturnType","setTimeout","source","failure","clearTimeout","reset","copy","owner","active","_$createComponent","children","aria-label","undefined","initialFocus","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_$insert","type","variant","size","busy","tooltip","onClick","as","href","target","rel","event","when","message","role","_$effect","_$setAttribute","_$createComponent","_$setAttribute"],"sources":["../../../../src/components/composites/about-dialog/about-dialog.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n on,\n onCleanup,\n Show,\n type Accessor,\n} from 'solid-js'\nimport { ExternalLink } from 'lucide-solid'\nimport { writeClipboardText } from '#lib/clipboard'\nimport { createExternalLinkOpener } from '#lib/external-link'\nimport { ActionButton } from '../action-button'\nimport { Alert, AlertDescription } from '../../ui/alert'\nimport { Dialog, DialogContent, DialogTitle } from '../../ui/dialog'\n\nexport type AboutDialogProps = {\n appName: string\n appIcon: string\n version?: string\n platform: string\n copyright: string\n sourceUrl: string\n open: boolean\n onOpenChange: (open: boolean) => void\n copyVersionInfo?: (text: string) => Promise<void>\n openExternal?: (url: string) => Promise<void>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\nconst COPIED_FEEDBACK_MS = 2000\n\n/** Compact app identity and support details, with clipboard and native-browser adapters. */\nexport function AboutDialog(props: AboutDialogProps) {\n const versionLabel = () => (props.version ? `Version ${props.version}` : 'Version unavailable')\n const versionInfo = createMemo(() =>\n [props.appName, versionLabel(), `Platform: ${props.platform}`].join('\\n')\n )\n const [copied, setCopied] = createSignal(false)\n const [error, setError] = createSignal('')\n const [copying, setCopying] = createSignal(false)\n let disposed = false\n let epoch = 0\n let timer: ReturnType<typeof setTimeout> | undefined\n const source = createExternalLinkOpener({\n open: () => props.openExternal,\n failure: 'Could not open the source repository. Please try again.',\n })\n onCleanup(() => {\n disposed = true\n epoch += 1\n clearTimeout(timer)\n })\n createEffect(\n on(\n () => props.open,\n () => {\n epoch += 1\n clearTimeout(timer)\n source.reset()\n setCopied(false)\n setError('')\n setCopying(false)\n }\n )\n )\n const copy = async () => {\n const owner = epoch\n const active = () => !disposed && props.open && owner === epoch\n source.reset()\n setError('')\n setCopied(false)\n setCopying(true)\n try {\n await (props.copyVersionInfo ?? writeClipboardText)(versionInfo())\n if (!active()) return\n setCopied(true)\n clearTimeout(timer)\n timer = setTimeout(() => {\n if (active()) setCopied(false)\n }, COPIED_FEEDBACK_MS)\n } catch {\n if (active()) setError('Could not copy version info. Please try again.')\n } finally {\n if (active()) setCopying(false)\n }\n }\n return (\n <Dialog open={props.open} onOpenChange={props.onOpenChange}>\n <DialogContent\n class=\"w-full max-w-96\"\n aria-label={`About ${props.appName}`}\n aria-labelledby=\"\"\n aria-describedby={undefined}\n initialFocus=\"panel\"\n restoreFocusRef={props.restoreFocusRef}\n >\n <div class=\"flex flex-col items-center gap-2 text-center\">\n <img src={props.appIcon} alt=\"\" class=\"size-14\" aria-hidden=\"true\" />\n <DialogTitle>{props.appName}</DialogTitle>\n {/* Body text on the dialog's themed surface: primary ink measures\n below AA against the lighter dialog backgrounds across schemes,\n so the version and the source link carry foreground ink and keep\n primary as the link's underline accent (the text-link treatment). */}\n <p class=\"text-sm text-foreground\">{versionLabel()}</p>\n <p class=\"text-xs text-muted-foreground\">{props.copyright}</p>\n <div class=\"flex flex-wrap items-center justify-center gap-3\">\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n busy={copying()}\n tooltip=\"Copy
|
|
1
|
+
{"version":3,"file":"about-dialog.js","names":["createEffect","createMemo","createSignal","on","onCleanup","Show","Accessor","ExternalLink","writeClipboardText","createExternalLinkOpener","ActionButton","Alert","AlertDescription","Dialog","DialogContent","DialogTitle","AboutDialogProps","appName","appIcon","version","platform","copyright","sourceUrl","open","onOpenChange","copyVersionInfo","text","Promise","openExternal","url","restoreFocusRef","HTMLElement","COPIED_FEEDBACK_MS","AboutDialog","props","versionLabel","versionInfo","join","copied","setCopied","error","setError","copying","setCopying","disposed","epoch","timer","ReturnType","setTimeout","source","failure","clearTimeout","reset","copy","owner","active","_$createComponent","children","aria-label","undefined","initialFocus","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_$insert","type","variant","size","busy","tooltip","onClick","as","href","target","rel","event","when","message","role","_$effect","_$setAttribute","_$createComponent","_$setAttribute"],"sources":["../../../../src/components/composites/about-dialog/about-dialog.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n on,\n onCleanup,\n Show,\n type Accessor,\n} from 'solid-js'\nimport { ExternalLink } from 'lucide-solid'\nimport { writeClipboardText } from '#lib/clipboard'\nimport { createExternalLinkOpener } from '#lib/external-link'\nimport { ActionButton } from '../action-button'\nimport { Alert, AlertDescription } from '../../ui/alert'\nimport { Dialog, DialogContent, DialogTitle } from '../../ui/dialog'\n\nexport type AboutDialogProps = {\n appName: string\n appIcon: string\n version?: string\n platform: string\n copyright: string\n sourceUrl: string\n open: boolean\n onOpenChange: (open: boolean) => void\n copyVersionInfo?: (text: string) => Promise<void>\n openExternal?: (url: string) => Promise<void>\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\nconst COPIED_FEEDBACK_MS = 2000\n\n/** Compact app identity and support details, with clipboard and native-browser adapters. */\nexport function AboutDialog(props: AboutDialogProps) {\n const versionLabel = () => (props.version ? `Version ${props.version}` : 'Version unavailable')\n const versionInfo = createMemo(() =>\n [props.appName, versionLabel(), `Platform: ${props.platform}`].join('\\n')\n )\n const [copied, setCopied] = createSignal(false)\n const [error, setError] = createSignal('')\n const [copying, setCopying] = createSignal(false)\n let disposed = false\n let epoch = 0\n let timer: ReturnType<typeof setTimeout> | undefined\n const source = createExternalLinkOpener({\n open: () => props.openExternal,\n failure: 'Could not open the source repository. Please try again.',\n })\n onCleanup(() => {\n disposed = true\n epoch += 1\n clearTimeout(timer)\n })\n createEffect(\n on(\n () => props.open,\n () => {\n epoch += 1\n clearTimeout(timer)\n source.reset()\n setCopied(false)\n setError('')\n setCopying(false)\n }\n )\n )\n const copy = async () => {\n const owner = epoch\n const active = () => !disposed && props.open && owner === epoch\n source.reset()\n setError('')\n setCopied(false)\n setCopying(true)\n try {\n await (props.copyVersionInfo ?? writeClipboardText)(versionInfo())\n if (!active()) return\n setCopied(true)\n clearTimeout(timer)\n timer = setTimeout(() => {\n if (active()) setCopied(false)\n }, COPIED_FEEDBACK_MS)\n } catch {\n if (active()) setError('Could not copy version info. Please try again.')\n } finally {\n if (active()) setCopying(false)\n }\n }\n return (\n <Dialog open={props.open} onOpenChange={props.onOpenChange}>\n <DialogContent\n class=\"w-full max-w-96\"\n aria-label={`About ${props.appName}`}\n aria-labelledby=\"\"\n aria-describedby={undefined}\n initialFocus=\"panel\"\n restoreFocusRef={props.restoreFocusRef}\n >\n <div class=\"flex flex-col items-center gap-2 text-center\">\n <img src={props.appIcon} alt=\"\" class=\"size-14\" aria-hidden=\"true\" />\n <DialogTitle>{props.appName}</DialogTitle>\n {/* Body text on the dialog's themed surface: primary ink measures\n below AA against the lighter dialog backgrounds across schemes,\n so the version and the source link carry foreground ink and keep\n primary as the link's underline accent (the text-link treatment). */}\n <p class=\"text-sm text-foreground\">{versionLabel()}</p>\n <p class=\"text-xs text-muted-foreground\">{props.copyright}</p>\n <div class=\"flex flex-wrap items-center justify-center gap-3\">\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n busy={copying()}\n tooltip=\"Copy version details\"\n onClick={() => void copy()}\n >\n {copied() ? 'Copied' : 'Copy version info'}\n </ActionButton>\n <ActionButton\n as=\"a\"\n variant=\"link\"\n size=\"sm\"\n class=\"text-foreground decoration-primary\"\n href={props.sourceUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n tooltip={`Open the ${props.appName} repository`}\n onClick={(event) => {\n if (props.openExternal) setError('')\n source.onClick(props.sourceUrl)(event)\n }}\n >\n <ExternalLink aria-hidden=\"true\" />\n View source\n </ActionButton>\n </div>\n <Show when={error() || source.error()}>\n {(message) => (\n <Alert variant=\"destructive\" role=\"alert\">\n <AlertDescription>{message()}</AlertDescription>\n </Alert>\n )}\n </Show>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;AA8BA,IAAMgC,qBAAqB;;AAG3B,SAAgBC,YAAYC,OAAyB;CACnD,MAAMC,qBAAsBD,MAAMf,UAAU,WAAWe,MAAMf,YAAY;CACzE,MAAMiB,cAAcnC,iBAClB;EAACiC,MAAMjB;EAASkB,aAAa;EAAG,aAAaD,MAAMd;CAAU,CAAC,CAACiB,KAAK,IAAI,CAC1E;CACA,MAAM,CAACC,QAAQC,aAAarC,aAAa,KAAK;CAC9C,MAAM,CAACsC,OAAOC,YAAYvC,aAAa,EAAE;CACzC,MAAM,CAACwC,SAASC,cAAczC,aAAa,KAAK;CAChD,IAAI0C,WAAW;CACf,IAAIC,QAAQ;CACZ,IAAIC;CACJ,MAAMG,SAASxC,yBAAyB;EACtCc,YAAYW,MAAMN;EAClBsB,SAAS;CACX,CAAC;CACD9C,gBAAgB;EACdwC,WAAW;EACXC,SAAS;EACTM,aAAaL,KAAK;CACpB,CAAC;CACD9C,aACEG,SACQ+B,MAAMX,YACN;EACJsB,SAAS;EACTM,aAAaL,KAAK;EAClBG,OAAOG,MAAM;EACbb,UAAU,KAAK;EACfE,SAAS,EAAE;EACXE,WAAW,KAAK;CAClB,CACF,CACF;CACA,MAAMU,OAAO,YAAY;EACvB,MAAMC,QAAQT;EACd,MAAMU,eAAe,CAACX,YAAYV,MAAMX,QAAQ+B,UAAUT;EAC1DI,OAAOG,MAAM;EACbX,SAAS,EAAE;EACXF,UAAU,KAAK;EACfI,WAAW,IAAI;EACf,IAAI;GACF,OAAOT,MAAMT,mBAAmBjB,mBAAAA,CAAoB4B,YAAY,CAAC;GACjE,IAAI,CAACmB,OAAO,GAAG;GACfhB,UAAU,IAAI;GACdY,aAAaL,KAAK;GAClBA,QAAQE,iBAAiB;IACvB,IAAIO,OAAO,GAAGhB,UAAU,KAAK;GA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AMjB,QAAO;MAAa;MAC/C0D,UAAUK,UAAU;OAClB,IAAI9C,MAAMN,cAAca,SAAS,EAAE;OACnCQ,OAAO0B,QAAQzC,MAAMZ,SAAS,CAAC,CAAC0D,KAAK;MACvC;MAAC,IAAAvB,WAAA;OAAA,OAAA,CAAAD,gBAEAjD,cAAY,EAAA,eAAA,OAAA,CAAA,GAAA,aAAA;MAAA;KAAA,CAAA,GAAA,IAAA;KAAA8D,OAAAR,MAAAL,gBAIhBnD,MAAI;MAAA,IAAC4E,OAAI;OAAA,OAAEzC,MAAM,KAAKS,OAAOT,MAAM;MAAC;MAAAiB,WACjCyB,YAAO1B,gBACN7C,OAAK;OAAC4D,SAAO;OAAeY,MAAI;OAAA,IAAA1B,WAAA;QAAA,OAAAD,gBAC9B5C,kBAAgB,EAAA,IAAA6C,WAAA;SAAA,OAAEyB,QAAQ;QAAC,EAAA,CAAA;OAAA;MAAA,CAAA;KAE/B,CAAA,GAAA,IAAA;KAAAE,aAAAC,aAAAtB,OAAA,OA1CO7B,MAAMhB,OAAO,CAAA;KAAA,OAAA2C;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAgDjC"}
|
|
@@ -35,10 +35,10 @@ function AppearanceEditor(props) {
|
|
|
35
35
|
const accentDescription = () => {
|
|
36
36
|
if (props.draft.accent === "theme") return "Theme default · Uses the palette's intended color.";
|
|
37
37
|
const preset = props.accentOptions.find((option) => option.id === props.draft.accent);
|
|
38
|
-
if (preset) return `${preset.label} · Controls,
|
|
39
|
-
if (custom()) return "Custom · Controls,
|
|
38
|
+
if (preset) return `${preset.label} · Controls, selections and code.`;
|
|
39
|
+
if (custom()) return "Custom · Controls, selections and code.";
|
|
40
40
|
const offered = props.themeAccentOptions?.find((option) => option.id === props.draft.accent);
|
|
41
|
-
return offered ? `Theme ${offered.label.toLowerCase()} · The theme
|
|
41
|
+
return offered ? `Theme ${offered.label.toLowerCase()} · The theme’s own color.` : "Theme default · This theme has no such accent.";
|
|
42
42
|
};
|
|
43
43
|
const glassDescription = () => props.draft.surface === "opaque" ? "Solid surfaces for every theme." : props.draft.surface === "frosted" ? "Theme-colored glass where supported." : props.surfaceCapability.themeDefaultDescription ?? "Uses this theme's default surface.";
|
|
44
44
|
return (() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appearance-editor.js","names":["EyeOff","Palette","PanelsTopLeft","SlidersHorizontal","Show","createSignal","createUniqueId","cn","ActionButton","Button","Input","AppearanceFontSettingsGroup","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","THEME_DEFAULT_ID","Switch","Sheet","SheetBody","SheetContent","SheetDescription","SheetFooter","SheetHeader","SheetTitle","SheetTrigger","AppearanceEditorProps","AppearancePopoverProps","ModeChoices","AccentChoices","GlassChoices","isCustomAccent","SettingsRow","TerminalRow","ThemeRow","AppearanceEditor","props","errorId","custom","accentDescription","draft","accent","preset","accentOptions","find","option","id","label","offered","themeAccentOptions","toLowerCase","glassDescription","surface","surfaceCapability","themeDefaultDescription","_el$","_tmpl$6","_el$3","firstChild","_$insert","_$createComponent","when","recoveryNotice","children","_el$2","_tmpl$","appearance","selectedId","lightThemeId","preview","lightTheme","themes","disabled","saving","onSelect","onChange","darkThemeId","darkTheme","terminalThemeId","undefined","_$memo","resolvedAppearance","title","icon","description","_el$4","_tmpl$3","_el$5","_$setAttribute","value","aria-invalid","customAccentError","aria-describedby","onInput","event","currentTarget","_el$6","_tmpl$2","fontSettingsPlacement","settings","fonts","menuPortalMount","frosted","reason","_el$7","_tmpl$4","checked","reduceTransparency","onManageThemes","type","size","variant","onClick","extraRows","hideActions","_el$8","_tmpl$5","AppearanceEditorActions","_$effect","_$className","class","saveReasonId","_el$9","_tmpl$8","_el$1","_el$10","saveDisabledReason","_el$0","_tmpl$7","onReset","onCancel","aria-busy","onSave","AppearancePopover","setMenuPortalMount","HTMLElement","open","onOpenChange","onOpen","onDismiss","as","triggerVariant","tooltip","tooltipIcon","side","closeLabel","ref","_$mergeProps","_$createComponent","_$memo","Switch","_$className","_$mergeProps"],"sources":["../../../../src/components/composites/appearance-editor/appearance-editor.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/*\n * Composition substantially translated from Zeron settings/appearance.rs and\n * settings/widgets.rs, pinned at 30a9a9537c5ec96226c87f4bf349b6f77c5dfb59,\n * preserving Adea's existing appearance-surface.tsx port: System/Light/Dark\n * miniatures, compact independent theme rows, accent swatches and helper copy,\n * glass chips, and theme library affordance. Kobalte replaces the port's manual\n * radio keyboard model. The controlled draft and explicit action ports replace\n * GPUI globals and app-specific storage/native authority. Save/Cancel/Reset and\n * custom accent/reduced-transparency are accepted Adea divergences (#425).\n */\nimport { EyeOff, Palette, PanelsTopLeft, SlidersHorizontal } from 'lucide-solid'\nimport { Show, createSignal, createUniqueId } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../action-button'\nimport { Button } from '../../ui/button'\nimport { Input } from '../../ui/input'\nimport { AppearanceFontSettingsGroup } from './font-settings-group'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\n\nimport { Switch } from '../../ui/switch'\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from '../../ui/sheet'\nimport type { AppearanceEditorProps, AppearancePopoverProps } from './appearance-types'\nimport { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'\nimport { SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'\n\n/**\n * A live editor whose persistence and preview authority belong to its host.\n * No ThemeProvider is required, and no catalogue, renderer engine or storage is\n * imported. Hosts normalize unknown IDs and custom colors, report recovery,\n * snapshot on open, preview on changes, commit on Save, and restore on dismissal.\n * Both theme rows remain mounted when mode changes. Density remains outside the\n * accepted appearance surface; typeface settings are shared and host-persisted.\n */\nexport function AppearanceEditor(props: AppearanceEditorProps) {\n const errorId = createUniqueId()\n const custom = () => isCustomAccent(props)\n const accentDescription = () => {\n if (props.draft.accent === THEME_DEFAULT_ID)\n return \"Theme default · Uses the palette's intended color.\"\n const preset = props.accentOptions.find((option) => option.id === props.draft.accent)\n if (preset) return `${preset.label} · Controls, glyphs, selections, code, and activity.`\n if (custom()) return 'Custom · Controls, glyphs, selections, code, and activity.'\n const offered = props.themeAccentOptions?.find((option) => option.id === props.draft.accent)\n // A stored theme accent survives a theme switch by id; when the new pair\n // cannot offer that slot the host falls back to the theme's own primary,\n // and the description says so rather than naming a colour not on screen.\n return offered\n ? `Theme ${offered.label.toLowerCase()} · The theme's own color, on controls and activity.`\n : \"Theme default · This theme does not carry that accent, so it uses the palette's intended color.\"\n }\n const glassDescription = () =>\n props.draft.surface === 'opaque'\n ? 'Solid surfaces for every theme.'\n : props.draft.surface === 'frosted'\n ? 'Theme-colored glass where supported.'\n : (props.surfaceCapability.themeDefaultDescription ?? \"Uses this theme's default surface.\")\n return (\n <div data-appearance-editor class={cn('min-w-0', props.class)}>\n <Show when={props.recoveryNotice}>\n <p role=\"status\" class=\"px-4 py-2 text-sm text-muted-foreground\">\n {props.recoveryNotice}\n </p>\n </Show>\n <ModeChoices {...props} />\n <div class=\"divide-y divide-border rounded-lg border\">\n <ThemeRow\n appearance=\"light\"\n selectedId={props.draft.lightThemeId}\n preview={props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(lightThemeId) => props.onChange({ lightThemeId })}\n />\n <ThemeRow\n appearance=\"dark\"\n selectedId={props.draft.darkThemeId}\n preview={props.darkTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(darkThemeId) => props.onChange({ darkThemeId })}\n />\n {/* The row exists only when the host carries a terminal preference:\n the draft field is the show/hide switch, so the editor can never\n render a terminal row that writes nothing. */}\n <Show when={props.draft.terminalThemeId !== undefined}>\n <TerminalRow\n selectedId={props.draft.terminalThemeId ?? THEME_DEFAULT_ID}\n preview={props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(terminalThemeId) => props.onChange({ terminalThemeId })}\n />\n </Show>\n <SettingsRow title=\"Accent\" icon={<SlidersHorizontal />} description={accentDescription()}>\n <AccentChoices {...props} />\n </SettingsRow>\n <Show when={custom()}>\n <div class=\"px-4 py-3\">\n <label class=\"mb-2 block text-xs font-medium\" for={`${errorId}-input`}>\n Custom accent\n </label>\n <Input\n id={`${errorId}-input`}\n value={props.draft.accent}\n disabled={props.saving}\n aria-invalid={!!props.customAccentError}\n aria-describedby={props.customAccentError ? errorId : undefined}\n onInput={(event) => props.onChange({ accent: event.currentTarget.value })}\n />\n <Show when={props.customAccentError}>\n <p id={errorId} role=\"alert\" class=\"mt-1 text-xs text-foreground\">\n {props.customAccentError}\n </p>\n </Show>\n </div>\n </Show>\n {/* Inline, the typefaces read as one more palette choice; `end` hands\n the closing slot to them for hosts whose order is palette and\n surface first, text last. */}\n <Show when={props.fontSettingsPlacement !== 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n <SettingsRow title=\"Glass\" icon={<PanelsTopLeft />} description={glassDescription()}>\n <GlassChoices {...props} />\n </SettingsRow>\n <Show when={!props.surfaceCapability.frosted && props.surfaceCapability.reason}>\n <p role=\"status\" class=\"px-4 py-2 text-xs text-muted-foreground\">\n {props.surfaceCapability.reason}\n </p>\n </Show>\n <SettingsRow\n title=\"Reduce transparency\"\n icon={<EyeOff />}\n description=\"Prefer solid surfaces, including during live preview.\"\n >\n <Switch\n checked={props.draft.reduceTransparency}\n disabled={props.saving}\n onChange={(reduceTransparency: boolean) => props.onChange({ reduceTransparency })}\n aria-label=\"Reduce transparency\"\n />\n </SettingsRow>\n <SettingsRow\n title=\"Theme library\"\n icon={<Palette />}\n description={\n props.onManageThemes\n ? 'Manage themes through the application.'\n : 'Theme import is unavailable.'\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!props.onManageThemes || props.saving}\n onClick={() => props.onManageThemes?.()}\n >\n Manage themes\n </Button>\n </SettingsRow>\n <Show when={props.fontSettingsPlacement === 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n {props.extraRows}\n </div>\n <Show when={!props.hideActions}>\n {/* Sticky so Save/Cancel stay reachable in a tall scroll container: the\n editor scrolls with its host panel, and actions parked at the bottom\n of a long form were unreachable without scrolling past every row. The\n bar is a band on the subtle-fill rung, like a sheet footer. It bleeds\n through the host panel's padding (`--settings-panel-padding`, set by\n SettingsLayout) so it sits flush with the panel's bottom and side\n edges with no strip of page under it; a sticky offset is measured\n inside a scroll container's padding, so `bottom` is pulled out by the\n same amount. */}\n <div class=\"sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3\">\n <AppearanceEditorActions {...props} />\n </div>\n </Show>\n </div>\n )\n}\n\n/**\n * Reset, Cancel and Save, with the reason Save is unavailable. Rendered by the\n * editor itself, or — with `hideActions` — by a host that pins them in its own\n * footer, as `AppearancePopover` does.\n */\nexport function AppearanceEditorActions(props: AppearanceEditorProps) {\n const saveReasonId = createUniqueId()\n return (\n <div class=\"flex w-full flex-col gap-2\">\n <Show when={props.saveDisabledReason}>\n <p id={saveReasonId} role=\"status\" class=\"text-xs text-muted-foreground\">\n {props.saveDisabledReason}\n </p>\n </Show>\n {/* `global-appearance-editor-actions` lets these buttons grow with the UI\n font preference, like the rest of Appearance's own controls. */}\n <div class=\"global-appearance-editor-actions flex flex-wrap items-center gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n disabled={props.saving}\n onClick={() => props.onReset()}\n >\n Reset\n </Button>\n <div class=\"ml-auto flex gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={props.saving}\n onClick={() => props.onCancel()}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={props.saving || !!props.customAccentError || !!props.saveDisabledReason}\n aria-busy={props.saving}\n aria-describedby={props.saveDisabledReason ? saveReasonId : undefined}\n onClick={() => props.onSave()}\n >\n {props.saving ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n\n/** The editor in an inset Sheet docked beside the main view: the body scrolls and\n * Reset/Cancel/Save sit in the panel's full-width footer, always reachable.\n * Dismissal (Escape, the close button, an outside click) is `onDismiss`. */\nexport function AppearancePopover(props: AppearancePopoverProps) {\n const [menuPortalMount, setMenuPortalMount] = createSignal<HTMLElement>()\n\n return (\n <Sheet open={props.open} onOpenChange={(open) => (open ? props.onOpen() : props.onDismiss())}>\n {/* The trigger is an icon-only action, so it explains itself through the\n shared ActionButton's tooltip (keyboard focus included) rather than a\n bare aria-label. `toolbar` also holds the pressed rung while Kobalte\n marks the trigger `data-expanded`, and repeats the glyph in the\n tooltip like the other toolbar actions. */}\n <SheetTrigger\n as={ActionButton}\n variant={props.triggerVariant === 'toolbar' ? 'toolbar' : 'ghost'}\n size=\"icon-sm\"\n tooltip=\"Open appearance settings\"\n tooltipIcon={\n props.triggerVariant === 'toolbar' ? <Palette aria-hidden=\"true\" /> : undefined\n }\n aria-label=\"Appearance settings\"\n >\n <Palette />\n </SheetTrigger>\n <SheetContent side=\"end\" closeLabel=\"Close appearance settings\" ref={setMenuPortalMount}>\n <SheetHeader>\n <SheetTitle>Appearance</SheetTitle>\n <SheetDescription>\n Changes preview immediately. Save keeps them; Cancel restores the previous appearance.\n </SheetDescription>\n </SheetHeader>\n <SheetBody>\n <AppearanceEditor {...props} menuPortalMount={menuPortalMount()} hideActions />\n </SheetBody>\n <SheetFooter>\n <AppearanceEditorActions {...props} />\n </SheetFooter>\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,SAAgBgC,iBAAiBC,OAA8B;CAC7D,MAAMC,UAAU5B,eAAe;CAC/B,MAAM6B,eAAeP,eAAeK,KAAK;CACzC,MAAMG,0BAA0B;EAC9B,IAAIH,MAAMI,MAAMC,WAAAA,SACd,OAAO;EACT,MAAMC,SAASN,MAAMO,cAAcC,MAAMC,WAAWA,OAAOC,OAAOV,MAAMI,MAAMC,MAAM;EACpF,IAAIC,QAAQ,OAAO,GAAGA,OAAOK,MAAK;EAClC,IAAIT,OAAO,GAAG,OAAO;EACrB,MAAMU,UAAUZ,MAAMa,oBAAoBL,MAAMC,WAAWA,OAAOC,OAAOV,MAAMI,MAAMC,MAAM;EAI3F,OAAOO,UAC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,OAAAH,gBAIhFxD,SAAO,CAAA,CAAA;IAAA;GAAA,CAAA,GAAAwD,gBAETxC,cAAY;IAAC4H,MAAI;IAAOC,YAAU;IAAAC,KAAkCZ;IAAkB,IAAAvE,WAAA;KAAA,OAAA;MAAAH,gBACpFrC,aAAW,EAAA,IAAAwC,WAAA;OAAA,OAAA,CAAAH,gBACTpC,YAAU,EAAAuC,UAAA,aAAA,CAAA,GAAAH,gBACVvC,kBAAgB,EAAA0C,UAAA,yFAAA,CAAA,CAAA;MAAA,EAAA,CAAA;MAAAH,gBAIlBzC,WAAS,EAAA,IAAA4C,WAAA;OAAA,OAAAH,gBACPzB,kBAAgBgH,WAAK/G,OAAK;QAAA,IAAEiE,kBAAe;SAAA,OAAEA,gBAAgB;QAAC;QAAEa,aAAW;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;MAAAtD,gBAE7EtC,aAAW,EAAA,IAAAyC,WAAA;OAAA,OAAAH,gBACTyD,yBAA4BjF,KAAK;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAK5C"}
|
|
1
|
+
{"version":3,"file":"appearance-editor.js","names":["EyeOff","Palette","PanelsTopLeft","SlidersHorizontal","Show","createSignal","createUniqueId","cn","ActionButton","Button","Input","AppearanceFontSettingsGroup","DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS","THEME_DEFAULT_ID","Switch","Sheet","SheetBody","SheetContent","SheetDescription","SheetFooter","SheetHeader","SheetTitle","SheetTrigger","AppearanceEditorProps","AppearancePopoverProps","ModeChoices","AccentChoices","GlassChoices","isCustomAccent","SettingsRow","TerminalRow","ThemeRow","AppearanceEditor","props","errorId","custom","accentDescription","draft","accent","preset","accentOptions","find","option","id","label","offered","themeAccentOptions","toLowerCase","glassDescription","surface","surfaceCapability","themeDefaultDescription","_el$","_tmpl$6","_el$3","firstChild","_$insert","_$createComponent","when","recoveryNotice","children","_el$2","_tmpl$","appearance","selectedId","lightThemeId","preview","lightTheme","themes","disabled","saving","onSelect","onChange","darkThemeId","darkTheme","terminalThemeId","undefined","_$memo","resolvedAppearance","title","icon","description","_el$4","_tmpl$3","_el$5","_$setAttribute","value","aria-invalid","customAccentError","aria-describedby","onInput","event","currentTarget","_el$6","_tmpl$2","fontSettingsPlacement","settings","fonts","menuPortalMount","frosted","reason","_el$7","_tmpl$4","checked","reduceTransparency","onManageThemes","type","size","variant","onClick","extraRows","hideActions","_el$8","_tmpl$5","AppearanceEditorActions","_$effect","_$className","class","saveReasonId","_el$9","_tmpl$8","_el$1","_el$10","saveDisabledReason","_el$0","_tmpl$7","onReset","onCancel","aria-busy","onSave","AppearancePopover","setMenuPortalMount","HTMLElement","open","onOpenChange","onOpen","onDismiss","as","triggerVariant","tooltip","tooltipIcon","side","closeLabel","ref","_$mergeProps","_$createComponent","_$memo","Switch","_$className","_$mergeProps"],"sources":["../../../../src/components/composites/appearance-editor/appearance-editor.tsx"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2026 Wing\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/*\n * Composition substantially translated from Zeron settings/appearance.rs and\n * settings/widgets.rs, pinned at 30a9a9537c5ec96226c87f4bf349b6f77c5dfb59,\n * preserving Adea's existing appearance-surface.tsx port: System/Light/Dark\n * miniatures, compact independent theme rows, accent swatches and helper copy,\n * glass chips, and theme library affordance. Kobalte replaces the port's manual\n * radio keyboard model. The controlled draft and explicit action ports replace\n * GPUI globals and app-specific storage/native authority. Save/Cancel/Reset and\n * custom accent/reduced-transparency are accepted Adea divergences (#425).\n */\nimport { EyeOff, Palette, PanelsTopLeft, SlidersHorizontal } from 'lucide-solid'\nimport { Show, createSignal, createUniqueId } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../action-button'\nimport { Button } from '../../ui/button'\nimport { Input } from '../../ui/input'\nimport { AppearanceFontSettingsGroup } from './font-settings-group'\nimport { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from '#lib/appearance-font-settings'\nimport { THEME_DEFAULT_ID } from '#lib/theme-defaults'\n\nimport { Switch } from '../../ui/switch'\nimport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from '../../ui/sheet'\nimport type { AppearanceEditorProps, AppearancePopoverProps } from './appearance-types'\nimport { ModeChoices, AccentChoices, GlassChoices, isCustomAccent } from './appearance-choices'\nimport { SettingsRow, TerminalRow, ThemeRow } from './appearance-rows'\n\n/**\n * A live editor whose persistence and preview authority belong to its host.\n * No ThemeProvider is required, and no catalogue, renderer engine or storage is\n * imported. Hosts normalize unknown IDs and custom colors, report recovery,\n * snapshot on open, preview on changes, commit on Save, and restore on dismissal.\n * Both theme rows remain mounted when mode changes. Density remains outside the\n * accepted appearance surface; typeface settings are shared and host-persisted.\n */\nexport function AppearanceEditor(props: AppearanceEditorProps) {\n const errorId = createUniqueId()\n const custom = () => isCustomAccent(props)\n const accentDescription = () => {\n if (props.draft.accent === THEME_DEFAULT_ID)\n return \"Theme default · Uses the palette's intended color.\"\n const preset = props.accentOptions.find((option) => option.id === props.draft.accent)\n if (preset) return `${preset.label} · Controls, selections and code.`\n if (custom()) return 'Custom · Controls, selections and code.'\n const offered = props.themeAccentOptions?.find((option) => option.id === props.draft.accent)\n // A stored theme accent survives a theme switch by id; when the new pair\n // cannot offer that slot the host falls back to the theme's own primary,\n // and the description says so rather than naming a colour not on screen.\n return offered\n ? `Theme ${offered.label.toLowerCase()} · The theme’s own color.`\n : 'Theme default · This theme has no such accent.'\n }\n const glassDescription = () =>\n props.draft.surface === 'opaque'\n ? 'Solid surfaces for every theme.'\n : props.draft.surface === 'frosted'\n ? 'Theme-colored glass where supported.'\n : (props.surfaceCapability.themeDefaultDescription ?? \"Uses this theme's default surface.\")\n return (\n <div data-appearance-editor class={cn('min-w-0', props.class)}>\n <Show when={props.recoveryNotice}>\n <p role=\"status\" class=\"px-4 py-2 text-sm text-muted-foreground\">\n {props.recoveryNotice}\n </p>\n </Show>\n <ModeChoices {...props} />\n <div class=\"divide-y divide-border rounded-lg border\">\n <ThemeRow\n appearance=\"light\"\n selectedId={props.draft.lightThemeId}\n preview={props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(lightThemeId) => props.onChange({ lightThemeId })}\n />\n <ThemeRow\n appearance=\"dark\"\n selectedId={props.draft.darkThemeId}\n preview={props.darkTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(darkThemeId) => props.onChange({ darkThemeId })}\n />\n {/* The row exists only when the host carries a terminal preference:\n the draft field is the show/hide switch, so the editor can never\n render a terminal row that writes nothing. */}\n <Show when={props.draft.terminalThemeId !== undefined}>\n <TerminalRow\n selectedId={props.draft.terminalThemeId ?? THEME_DEFAULT_ID}\n preview={props.resolvedAppearance === 'dark' ? props.darkTheme : props.lightTheme}\n themes={props.themes}\n disabled={props.saving}\n onSelect={(terminalThemeId) => props.onChange({ terminalThemeId })}\n />\n </Show>\n <SettingsRow title=\"Accent\" icon={<SlidersHorizontal />} description={accentDescription()}>\n <AccentChoices {...props} />\n </SettingsRow>\n <Show when={custom()}>\n <div class=\"px-4 py-3\">\n <label class=\"mb-2 block text-xs font-medium\" for={`${errorId}-input`}>\n Custom accent\n </label>\n <Input\n id={`${errorId}-input`}\n value={props.draft.accent}\n disabled={props.saving}\n aria-invalid={!!props.customAccentError}\n aria-describedby={props.customAccentError ? errorId : undefined}\n onInput={(event) => props.onChange({ accent: event.currentTarget.value })}\n />\n <Show when={props.customAccentError}>\n <p id={errorId} role=\"alert\" class=\"mt-1 text-xs text-foreground\">\n {props.customAccentError}\n </p>\n </Show>\n </div>\n </Show>\n {/* Inline, the typefaces read as one more palette choice; `end` hands\n the closing slot to them for hosts whose order is palette and\n surface first, text last. */}\n <Show when={props.fontSettingsPlacement !== 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n <SettingsRow title=\"Glass\" icon={<PanelsTopLeft />} description={glassDescription()}>\n <GlassChoices {...props} />\n </SettingsRow>\n <Show when={!props.surfaceCapability.frosted && props.surfaceCapability.reason}>\n <p role=\"status\" class=\"px-4 py-2 text-xs text-muted-foreground\">\n {props.surfaceCapability.reason}\n </p>\n </Show>\n <SettingsRow\n title=\"Reduce transparency\"\n icon={<EyeOff />}\n description=\"Prefer solid surfaces, including during live preview.\"\n >\n <Switch\n checked={props.draft.reduceTransparency}\n disabled={props.saving}\n onChange={(reduceTransparency: boolean) => props.onChange({ reduceTransparency })}\n aria-label=\"Reduce transparency\"\n />\n </SettingsRow>\n <SettingsRow\n title=\"Theme library\"\n icon={<Palette />}\n description={\n props.onManageThemes\n ? 'Manage themes through the application.'\n : 'Theme import is unavailable.'\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={!props.onManageThemes || props.saving}\n onClick={() => props.onManageThemes?.()}\n >\n Manage themes\n </Button>\n </SettingsRow>\n <Show when={props.fontSettingsPlacement === 'end'}>\n <AppearanceFontSettingsGroup\n settings={props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS}\n menuPortalMount={props.menuPortalMount}\n disabled={props.saving}\n onChange={(fonts) => props.onChange({ fonts })}\n />\n </Show>\n {props.extraRows}\n </div>\n <Show when={!props.hideActions}>\n {/* Sticky so Save/Cancel stay reachable in a tall scroll container: the\n editor scrolls with its host panel, and actions parked at the bottom\n of a long form were unreachable without scrolling past every row. The\n bar is a band on the subtle-fill rung, like a sheet footer. It bleeds\n through the host panel's padding (`--settings-panel-padding`, set by\n SettingsLayout) so it sits flush with the panel's bottom and side\n edges with no strip of page under it; a sticky offset is measured\n inside a scroll container's padding, so `bottom` is pulled out by the\n same amount. */}\n <div class=\"sticky bottom-[calc(var(--settings-panel-padding,0px)*-1)] z-10 -mx-(--settings-panel-padding) -mb-(--settings-panel-padding) mt-4 border-t bg-muted px-4 py-3\">\n <AppearanceEditorActions {...props} />\n </div>\n </Show>\n </div>\n )\n}\n\n/**\n * Reset, Cancel and Save, with the reason Save is unavailable. Rendered by the\n * editor itself, or — with `hideActions` — by a host that pins them in its own\n * footer, as `AppearancePopover` does.\n */\nexport function AppearanceEditorActions(props: AppearanceEditorProps) {\n const saveReasonId = createUniqueId()\n return (\n <div class=\"flex w-full flex-col gap-2\">\n <Show when={props.saveDisabledReason}>\n <p id={saveReasonId} role=\"status\" class=\"text-xs text-muted-foreground\">\n {props.saveDisabledReason}\n </p>\n </Show>\n {/* `global-appearance-editor-actions` lets these buttons grow with the UI\n font preference, like the rest of Appearance's own controls. */}\n <div class=\"global-appearance-editor-actions flex flex-wrap items-center gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n disabled={props.saving}\n onClick={() => props.onReset()}\n >\n Reset\n </Button>\n <div class=\"ml-auto flex gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={props.saving}\n onClick={() => props.onCancel()}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={props.saving || !!props.customAccentError || !!props.saveDisabledReason}\n aria-busy={props.saving}\n aria-describedby={props.saveDisabledReason ? saveReasonId : undefined}\n onClick={() => props.onSave()}\n >\n {props.saving ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n\n/** The editor in an inset Sheet docked beside the main view: the body scrolls and\n * Reset/Cancel/Save sit in the panel's full-width footer, always reachable.\n * Dismissal (Escape, the close button, an outside click) is `onDismiss`. */\nexport function AppearancePopover(props: AppearancePopoverProps) {\n const [menuPortalMount, setMenuPortalMount] = createSignal<HTMLElement>()\n\n return (\n <Sheet open={props.open} onOpenChange={(open) => (open ? props.onOpen() : props.onDismiss())}>\n {/* The trigger is an icon-only action, so it explains itself through the\n shared ActionButton's tooltip (keyboard focus included) rather than a\n bare aria-label. `toolbar` also holds the pressed rung while Kobalte\n marks the trigger `data-expanded`, and repeats the glyph in the\n tooltip like the other toolbar actions. */}\n <SheetTrigger\n as={ActionButton}\n variant={props.triggerVariant === 'toolbar' ? 'toolbar' : 'ghost'}\n size=\"icon-sm\"\n tooltip=\"Open appearance settings\"\n tooltipIcon={\n props.triggerVariant === 'toolbar' ? <Palette aria-hidden=\"true\" /> : undefined\n }\n aria-label=\"Appearance settings\"\n >\n <Palette />\n </SheetTrigger>\n <SheetContent side=\"end\" closeLabel=\"Close appearance settings\" ref={setMenuPortalMount}>\n <SheetHeader>\n <SheetTitle>Appearance</SheetTitle>\n <SheetDescription>\n Changes preview immediately. Save keeps them; Cancel restores the previous appearance.\n </SheetDescription>\n </SheetHeader>\n <SheetBody>\n <AppearanceEditor {...props} menuPortalMount={menuPortalMount()} hideActions />\n </SheetBody>\n <SheetFooter>\n <AppearanceEditorActions {...props} />\n </SheetFooter>\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;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|
},
|
|
391
391
|
get children() {
|
|
392
|
-
return [" ", memo(() => memo(() => !!lineWindow().lost)() ? `
|
|
392
|
+
return [" ", memo(() => memo(() => !!lineWindow().lost)() ? `Older lines dropped. Showing the oldest ${lineWindow().end.toLocaleString()} kept.` : `${lineWindow().evicted.toLocaleString()} older lines dropped.`)];
|
|
393
393
|
}
|
|
394
394
|
}), null);
|
|
395
395
|
insert(_el$14, createComponent(Show, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.js","names":["ArrowDown","Check","CircleAlert","CircleSlash","Copy","Eraser","LoaderCircle","createEffect","createMemo","createSignal","For","on","Show","splitProps","ComponentProps","createCopyFeedback","cn","Button","createAnsiParser","isPlainStyle","resolveColors","AnsiLine","AnsiStyle","ansiPlainText","isAtBottom","isFailedExit","revealEarlier","terminalStatusLabel","terminalWindow","TerminalStatus","TerminalProps","Omit","output","command","status","maxLines","retainLines","maxHeight","wrap","size","onClear","copyLabel","copiedLabel","clearLabel","onCopy","ok","TERMINAL_MAX_LINES","FG_CLASS","const","BG_CLASS","segmentClass","style","fg","bg","bold","dim","italic","underline","strike","LineView","props","line","_el$","_tmpl$2","_$insert","_$createComponent","each","segments","children","segment","text","_el$7","_tmpl$3","_$effect","_$className","when","truncated","_el$2","_tmpl$","_el$3","firstChild","_el$6","nextSibling","_el$5","toLocaleString","sameAnsiLine","left","right","length","every","index","StatusReadout","_el$8","_tmpl$5","state","_el$9","_tmpl$4","fallback","_p$","_v$","_v$2","e","_$setAttribute","t","undefined","Terminal","local","rest","small","pageSize","Math","max","floor","newParser","parser","consumed","epoch","revision","next","startsWith","write","slice","equals","limit","setLimit","defer","empty","outputRows","rows","lines","open","openLine","push","parked","setParked","end","total","droppedLines","anchorEnd","current","position","lineWindow","visibleRows","start","retainedIndex","changedParkedLine","newerRows","later","scroller","HTMLDivElement","following","onScroll","atEnd","scrollHeight","scrollTop","clientHeight","currentEpoch","jumpToLatest","focus","copied","failed","copyFailed","copy","copyText","regionLabel","_el$0","_tmpl$0","_el$1","_el$13","_el$16","_el$17","_$spread","_$mergeProps","data-size","aria-busy","class","_tmpl$1","_el$10","_tmpl$6","_el$11","_el$12","_$memo","variant","aria-label","onClick","title","hidden","evicted","_el$14","_tmpl$7","_el$15","lost","revealable","min","addEventListener","_$use","element","_el$26","_tmpl$10","_el$27","_el$18","_tmpl$8","_el$19","_tmpl$9","_el$20","_el$23","_el$21","_el$24","_el$22","_v$3","_v$4","_v$5","a","_$setStyleProperty","_$createComponent","_$className","_$setAttribute","Terminal","_$mergeProps","_$memo","_$setStyleProperty"],"sources":["../../../../src/components/composites/terminal/terminal.tsx"],"sourcesContent":["import {\n ArrowDown,\n Check,\n CircleAlert,\n CircleSlash,\n Copy,\n Eraser,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n createAnsiParser,\n isPlainStyle,\n resolveColors,\n type AnsiLine,\n type AnsiStyle,\n ansiPlainText,\n} from './ansi'\nimport {\n isAtBottom,\n isFailedExit,\n revealEarlier,\n terminalStatusLabel,\n terminalWindow,\n type TerminalStatus,\n} from './terminal-model'\n\n/**\n * Terminal.\n *\n * A command and its output, as it arrives. It is the thing to put inside an\n * agent's \"ran a command\" line (a `TraceLine`, with `size=\"sm\"`) when the output\n * is the evidence; reach for `CodeBlock` instead when the text is source or a\n * finished log that needs no live behaviour, and for `TestResults` when the\n * output is a test run the host can structure.\n *\n * It does not wrap `CodeBlock`. A block's `highlight` seam re-renders the whole\n * body whenever the code changes, which is exactly wrong for output that grows a\n * line at a time, and a terminal has to own its scroller to follow the tail. It\n * keeps the block's header and surface vocabulary so the two read as one family.\n *\n * ## What the output is allowed to do\n *\n * Output is untrusted bytes. It is parsed by `createAnsiParser` into plain text\n * and a fixed set of styles — sixteen theme colours, bold, dim, italic,\n * underline, strike-through, reverse — and everything else (cursor movement,\n * title and clipboard sequences, anything malformed) is dropped, never echoed.\n * Colours come from the theme's `--terminal-ansi-*` tokens, painted on the\n * theme's own terminal background, so a program's colours keep the contrast the\n * theme measured for them. Nothing is rendered as markup.\n *\n * ## Streaming\n *\n * `output` is the whole string so far. When the new value begins with the old\n * one, only the appended text is parsed, so a chunk costs the size of the chunk\n * and not of the transcript. Finished lines are keyed by identity and are never\n * re-rendered; only the line still being written changes, which is what makes a\n * `\\r` progress bar redraw in place. Batch appends per frame — the host sees a\n * prefix check proportional to the output on every change.\n *\n * Only the last `maxLines` finished lines are mounted. The rest are counted in\n * an explicit note with a control to show them a page at a time, because tens of\n * thousands of row elements are a frozen page, not a transcript. Copy still\n * writes `output` exactly as given — not the rendered lines, not the visible tail.\n *\n * ## Following the tail\n *\n * The terminal scrolls inside its own bounded box and follows new output only\n * while the reader is at the bottom of that box. Scrolling up *parks* the view:\n * the lines mounted are the ones that were there when they left, however much\n * output arrives, and \"Jump to latest\" is the only way back to the tail (reaching\n * the bottom of a parked view with nothing newer resumes it, because nothing was\n * missed). If retention discards the lines they were reading the note says how\n * many, and when none are left the oldest retained lines are shown. The page\n * itself is never scrolled. Scrolling is instant, so there is no animation to\n * reduce.\n *\n * ## Status is a claim\n *\n * `status` is drawn only when the host passes it, in words as well as an icon,\n * and only a non-zero exit is toned as a failure: this component does not decide\n * that a command \"passed\". Without a status the header says nothing about whether\n * the command is still running. `onClear` adds a clear button; without it the\n * output is the host's record and nothing here offers to erase it.\n */\nexport type TerminalProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** Everything the command has printed so far, exactly as received. */\n output: string\n /** The command line. Shown as text; the prompt glyph is decoration. */\n command?: string\n status?: TerminalStatus\n /** Finished lines mounted at once; earlier ones are counted and revealed a page at a time. */\n maxLines?: number\n /** Finished lines kept at all; older ones are discarded and counted. Default 200 000. */\n retainLines?: number\n /** Height of the output box, which scrolls past it. A number is pixels. Default `20rem`. */\n maxHeight?: number | string\n /** Soft-wrap long lines instead of scrolling sideways. Off: terminal columns keep their alignment. */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /** Show a clear button. The host empties `output`; the terminal erases nothing itself. */\n onClear?: () => void\n copyLabel?: string\n copiedLabel?: string\n clearLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\n/** Finished lines mounted by default. */\nexport const TERMINAL_MAX_LINES = 1000\n\n// One literal class per colour, written out in full so the stylesheet generator\n// can see each of them; a class assembled from an index would never be emitted.\nconst FG_CLASS = [\n 'text-(color:--terminal-ansi-black)',\n 'text-(color:--terminal-ansi-red)',\n 'text-(color:--terminal-ansi-green)',\n 'text-(color:--terminal-ansi-yellow)',\n 'text-(color:--terminal-ansi-blue)',\n 'text-(color:--terminal-ansi-magenta)',\n 'text-(color:--terminal-ansi-cyan)',\n 'text-(color:--terminal-ansi-white)',\n 'text-(color:--terminal-ansi-bright-black)',\n 'text-(color:--terminal-ansi-bright-red)',\n 'text-(color:--terminal-ansi-bright-green)',\n 'text-(color:--terminal-ansi-bright-yellow)',\n 'text-(color:--terminal-ansi-bright-blue)',\n 'text-(color:--terminal-ansi-bright-magenta)',\n 'text-(color:--terminal-ansi-bright-cyan)',\n 'text-(color:--terminal-ansi-bright-white)',\n] as const\nconst BG_CLASS = [\n 'bg-(--terminal-ansi-black)',\n 'bg-(--terminal-ansi-red)',\n 'bg-(--terminal-ansi-green)',\n 'bg-(--terminal-ansi-yellow)',\n 'bg-(--terminal-ansi-blue)',\n 'bg-(--terminal-ansi-magenta)',\n 'bg-(--terminal-ansi-cyan)',\n 'bg-(--terminal-ansi-white)',\n 'bg-(--terminal-ansi-bright-black)',\n 'bg-(--terminal-ansi-bright-red)',\n 'bg-(--terminal-ansi-bright-green)',\n 'bg-(--terminal-ansi-bright-yellow)',\n 'bg-(--terminal-ansi-bright-blue)',\n 'bg-(--terminal-ansi-bright-magenta)',\n 'bg-(--terminal-ansi-bright-cyan)',\n 'bg-(--terminal-ansi-bright-white)',\n] as const\n\nfunction segmentClass(style: AnsiStyle): string {\n const { fg, bg } = resolveColors(style)\n return cn(\n {\n 'font-bold': style.bold,\n 'opacity-70': style.dim,\n italic: style.italic,\n underline: style.underline && !style.strike,\n 'line-through': style.strike && !style.underline,\n '[text-decoration-line:underline_line-through]': style.underline && style.strike,\n 'text-(color:--terminal-background)': fg === 'default-bg',\n 'bg-(--terminal-foreground)': bg === 'default-fg',\n },\n typeof fg === 'number' && FG_CLASS[fg],\n typeof bg === 'number' && BG_CLASS[bg]\n )\n}\n\nfunction LineView(props: { line: AnsiLine; wrap: boolean }) {\n return (\n // `min-h-lh` keeps an empty line one line tall; a block with no text would\n // collapse and the transcript would lose its blank lines.\n <div\n class={cn('min-h-lh', {\n 'whitespace-pre-wrap [overflow-wrap:anywhere]': props.wrap,\n 'w-max min-w-full': !props.wrap,\n })}\n >\n <For each={props.line.segments}>\n {(segment) =>\n isPlainStyle(segment.style) ? (\n segment.text\n ) : (\n <span class={segmentClass(segment.style)}>{segment.text}</span>\n )\n }\n </For>\n <Show when={props.line.truncated > 0}>\n <span class=\"opacity-70 select-none\">\n {' '}\n … {props.line.truncated.toLocaleString()} more characters not shown\n </span>\n </Show>\n </div>\n )\n}\n\nfunction sameAnsiLine(left: AnsiLine, right: AnsiLine): boolean {\n return (\n left.truncated === right.truncated &&\n left.segments.length === right.segments.length &&\n left.segments.every(\n (segment, index) =>\n segment.text === right.segments[index]?.text &&\n segment.style === right.segments[index]?.style\n )\n )\n}\n\nfunction StatusReadout(props: { status: TerminalStatus }) {\n return (\n // A live region, so a command that finishes while the reader is elsewhere is\n // announced once, in words.\n <span\n role=\"status\"\n data-slot=\"terminal-status\"\n data-state={props.status.state}\n class={cn('flex shrink-0 items-center gap-1 text-xs', {\n 'text-destructive': isFailedExit(props.status),\n 'text-info': props.status.state === 'running',\n 'text-muted-foreground': props.status.state !== 'running' && !isFailedExit(props.status),\n })}\n >\n {/* A zero exit gets no glyph: a tick would be this component deciding the\n command succeeded, and some tools exit non-zero on purpose or zero on\n failure. The words carry the fact; only a non-zero code is toned. */}\n <Show when={props.status.state !== 'exited' || isFailedExit(props.status)}>\n <span aria-hidden=\"true\" class=\"grid size-3.5 place-items-center [&_svg]:size-3.5\">\n <Show\n when={props.status.state === 'running'}\n fallback={\n <Show when={props.status.state === 'cancelled'} fallback={<CircleAlert />}>\n <CircleSlash />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n </Show>\n {terminalStatusLabel(props.status)}\n </span>\n )\n}\n\nexport function Terminal(props: TerminalProps) {\n const [local, rest] = splitProps(props, [\n 'output',\n 'command',\n 'status',\n 'maxLines',\n 'retainLines',\n 'maxHeight',\n 'wrap',\n 'size',\n 'onClear',\n 'copyLabel',\n 'copiedLabel',\n 'clearLabel',\n 'onCopy',\n 'class',\n ])\n\n const small = () => local.size === 'sm'\n const pageSize = () => Math.max(1, Math.floor(local.maxLines ?? TERMINAL_MAX_LINES))\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : (local.maxHeight ?? '20rem')\n\n // The parser outlives renders: it holds the half-read escape sequence, the\n // current style and the open line. A new `output` that extends the old one is\n // fed only its tail; anything else (a clear, a different command) starts over.\n const newParser = () => createAnsiParser({ retainLines: local.retainLines })\n let parser = newParser()\n let consumed = ''\n // Bumped when the output restarts, so a parked position from the old output\n // is never applied to the new one.\n let epoch = 0\n const revision = createMemo(\n () => {\n const next = local.output\n if (next.length >= consumed.length && next.startsWith(consumed)) {\n parser.write(next.slice(consumed.length))\n } else {\n parser = newParser()\n parser.write(next)\n epoch += 1\n }\n consumed = next\n return epoch\n },\n undefined,\n { equals: false }\n )\n\n const [limit, setLimit] = createSignal(pageSize())\n createEffect(on(pageSize, (size) => setLimit(size), { defer: true }))\n // A cleared terminal is a fresh one: the next command starts at the page size.\n createEffect(\n on(\n () => local.output === '',\n (empty) => {\n if (empty) setLimit(pageSize())\n },\n { defer: true }\n )\n )\n\n const outputRows = createMemo(\n () => {\n revision()\n const rows = parser.lines.slice()\n const open = parser.openLine()\n if (open) rows.push(open)\n return rows\n },\n [],\n { equals: false }\n )\n // Where the reader parked, as a count of lines since the output began. An open\n // line is a row too: freeze its snapshot so streamed characters and CR redraws\n // do not rewrite the text under a parked reader.\n const [parked, setParked] = createSignal<{ epoch: number; end: number; open?: AnsiLine }>()\n const total = () => parser.droppedLines + outputRows().length\n const anchorEnd = () => {\n const current = revision()\n const position = parked()\n return position && position.epoch === current ? position.end : undefined\n }\n const lineWindow = createMemo(() => {\n revision()\n return terminalWindow(outputRows().length, parser.droppedLines, limit(), anchorEnd())\n })\n // Finished rows keep their parser identity. If an open row existed when the\n // reader parked, substitute its immutable snapshot until they jump to latest.\n const visibleRows = createMemo(\n () => {\n revision()\n const start = lineWindow().start\n const end = lineWindow().end\n const rows = outputRows().slice(start, end)\n const position = parked()\n if (position?.epoch === revision() && position.open) {\n const retainedIndex = position.end - 1 - parser.droppedLines\n if (retainedIndex >= start && retainedIndex < end) {\n rows[retainedIndex - start] = position.open\n }\n }\n return rows\n },\n [],\n { equals: false }\n )\n const changedParkedLine = () => {\n const position = parked()\n if (position?.epoch !== revision() || !position.open) return false\n const retainedIndex = position.end - 1 - parser.droppedLines\n const current = outputRows()[retainedIndex]\n return current !== undefined && !sameAnsiLine(position.open, current)\n }\n const newerRows = () => lineWindow().later + (changedParkedLine() ? 1 : 0)\n\n let scroller: HTMLDivElement | undefined\n const following = () => anchorEnd() === undefined\n\n const onScroll = () => {\n if (!scroller) return\n const atEnd = isAtBottom(scroller.scrollHeight, scroller.scrollTop, scroller.clientHeight)\n const position = anchorEnd()\n if (!atEnd) {\n if (position === undefined) {\n const currentEpoch = revision()\n setParked({ epoch: currentEpoch, end: total(), open: parser.openLine() })\n }\n } else if (position !== undefined && position >= total() && !changedParkedLine()) {\n // Back at the end of a view with nothing newer: nothing was missed.\n setParked(undefined)\n }\n }\n createEffect(\n on(revision, () => {\n if (scroller && following()) scroller.scrollTop = scroller.scrollHeight\n })\n )\n const jumpToLatest = () => {\n if (!scroller) return\n setParked(undefined)\n scroller.scrollTop = scroller.scrollHeight\n // The button is about to disappear; leave focus somewhere real.\n scroller.focus()\n }\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(ansiPlainText(local.output))\n local.onCopy?.(ok)\n }\n\n const empty = () => local.output === ''\n const regionLabel = () =>\n local.command ? `Output of ${local.command.slice(0, 120)}` : 'Terminal output'\n\n return (\n <div\n data-slot=\"terminal\"\n data-size={local.size ?? 'default'}\n aria-busy={local.status?.state === 'running' || undefined}\n class={cn(\n 'group/terminal overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n >\n <div class={cn('flex items-center gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}>\n <Show\n when={local.command !== undefined}\n fallback={<span class=\"flex-1 text-xs text-muted-foreground\">Terminal</span>}\n >\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"shrink-0 font-code text-code text-muted-foreground select-none\"\n >\n $\n </span>\n <code\n title={local.command}\n class=\"line-clamp-2 min-w-0 font-code text-code text-foreground [overflow-wrap:anywhere]\"\n >\n {local.command}\n </code>\n </span>\n </Show>\n <Show when={local.status}>{(status) => <StatusReadout status={status()} />}</Show>\n {/* Hidden until the terminal is hovered or holds focus, never removed:\n a control that only exists under the pointer is unreachable by\n keyboard, and a touch screen has no hover, so it always shows there. */}\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/terminal:opacity-100 group-hover/terminal:opacity-100 [@media(hover:none)]:opacity-100\">\n <Show when={local.onClear !== undefined && !empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={local.clearLabel ?? 'Clear output'}\n onClick={() => local.onClear?.()}\n >\n <Eraser aria-hidden=\"true\" />\n </Button>\n </Show>\n <Show when={!empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy output')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </Show>\n </div>\n </div>\n\n <Show when={lineWindow().hidden > 0 || lineWindow().evicted > 0}>\n <div\n data-slot=\"terminal-hidden-note\"\n class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\"\n >\n <span>\n <Show when={lineWindow().hidden > 0}>\n {lineWindow().hidden.toLocaleString()} earlier{' '}\n {lineWindow().hidden === 1 ? 'line' : 'lines'} hidden\n <Show when={parser.droppedLines > 0}>\n {' '}\n ({parser.droppedLines.toLocaleString()} only in the copy)\n </Show>\n .\n </Show>\n <Show when={lineWindow().evicted > 0}>\n {' '}\n {lineWindow().lost\n ? `The lines you were reading were discarded to keep memory bounded; showing the oldest ${lineWindow().end.toLocaleString()} still kept.`\n : `${lineWindow().evicted.toLocaleString()} of the lines you were reading were discarded to keep memory bounded.`}\n </Show>\n </span>\n <Show when={lineWindow().revealable > 0}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => setLimit(revealEarlier(limit(), pageSize(), outputRows().length))}\n >\n Show {Math.min(pageSize(), lineWindow().revealable).toLocaleString()} earlier\n </Button>\n </Show>\n </div>\n </Show>\n\n <div class=\"relative\">\n <div\n ref={(element) => (scroller = element)}\n data-slot=\"terminal-body\"\n // A region that scrolls must be focusable, and a tab stop needs a name.\n role=\"region\"\n tabindex=\"0\"\n aria-label={regionLabel()}\n onScroll={onScroll}\n style={{ 'max-height': maxHeight() }}\n class=\"scroll-fade overflow-auto border-t border-border bg-(--terminal-background) text-(color:--terminal-foreground)\"\n >\n <Show\n when={!empty()}\n fallback={\n <p class={cn('m-0 opacity-70', small() ? 'px-2 py-1.5' : 'px-3 py-2')}>\n <span class=\"font-code text-code\">\n {local.status?.state === 'running' ? 'Waiting for output…' : 'No output'}\n </span>\n </p>\n }\n >\n <pre\n class={cn(\n 'm-0 font-code text-code leading-normal',\n small() ? 'px-2 py-1.5' : 'px-3 py-2'\n )}\n >\n <For each={visibleRows()}>\n {(line) => <LineView line={line} wrap={local.wrap === true} />}\n </For>\n </pre>\n </Show>\n </div>\n <Show when={newerRows() > 0}>\n <Button\n variant=\"secondary\"\n size=\"2xs\"\n class=\"absolute end-3 bottom-2 shadow-sm\"\n onClick={jumpToLatest}\n >\n <ArrowDown aria-hidden=\"true\" />\n Jump to latest\n <span class=\"text-muted-foreground tabular-nums\">\n ({newerRows().toLocaleString()} newer {newerRows() === 1 ? 'line' : 'lines'})\n </span>\n </Button>\n </Show>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2HA,IAAa8C,qBAAqB;AAIlC,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C;AAE7C,IAAME,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAmC;AAGrC,SAASC,aAAaC,OAA0B;CAC9C,MAAM,EAAEC,IAAIC,OAAOjC,cAAc+B,KAAK;CACtC,OAAOnC,GACL;EACE,aAAamC,MAAMG;EACnB,cAAcH,MAAMI;EACpBC,QAAQL,MAAMK;EACdC,WAAWN,MAAMM,aAAa,CAACN,MAAMO;EACrC,gBAAgBP,MAAMO,UAAU,CAACP,MAAMM;EACvC,iDAAiDN,MAAMM,aAAaN,MAAMO;EAC1E,sCAAsCN,OAAO;EAC7C,8BAA8BC,OAAO;CACvC,GACA,OAAOD,OAAO,YAAYL,SAASK,KACnC,OAAOC,OA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AAAF,OAAA3H,YAAAA;QAAA6H,OAAA7H;QAAAlB,OAAA0I,cAGNxD,UAAU,CAAC,CAAC9D,eAAe,GAACyH,MAAA;QAAA7I,OAAA0I,cAASxD,UAAU,MAAM,IAAI,SAAS,SAAO6D,MAAA;QAAA,OAAAL;OAAA,EAAA,CAAA;MAAA;KAAA;IAAA,CAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAjI,QAAAyB,QAAA;GAAA,IAAA+G,OAnIvEjM,GAAG,2BAA2B4F,MAAM,IAAI,gBAAgB,WAAW,GAACsG,OA8FhE9C,YAAY,GAAC+C,OAEF9K,UAAU;GAAC4K,SAAA/G,IAAAG,KAAA3B,UAAA6F,OAAArE,IAAAG,IAAA4G,IAAA;GAAAC,SAAAhH,IAAAK,KAAAD,aAAAoE,QAAA,cAAAxE,IAAAK,IAAA2G,IAAA;GAAAC,SAAAjH,IAAAkH,KAAAC,iBAAA3C,QAAA,cAAAxE,IAAAkH,IAAAD,IAAA;GAAA,OAAAjH;EAAA,GAAA;GAAAG,GAAAG,KAAAA;GAAAD,GAAAC,KAAAA;GAAA4G,GAAA5G,KAAAA;EAAA,CAAA;EAAA,OAAA6D;CAAA,EAAA,CAAA;AA0C5C"}
|
|
1
|
+
{"version":3,"file":"terminal.js","names":["ArrowDown","Check","CircleAlert","CircleSlash","Copy","Eraser","LoaderCircle","createEffect","createMemo","createSignal","For","on","Show","splitProps","ComponentProps","createCopyFeedback","cn","Button","createAnsiParser","isPlainStyle","resolveColors","AnsiLine","AnsiStyle","ansiPlainText","isAtBottom","isFailedExit","revealEarlier","terminalStatusLabel","terminalWindow","TerminalStatus","TerminalProps","Omit","output","command","status","maxLines","retainLines","maxHeight","wrap","size","onClear","copyLabel","copiedLabel","clearLabel","onCopy","ok","TERMINAL_MAX_LINES","FG_CLASS","const","BG_CLASS","segmentClass","style","fg","bg","bold","dim","italic","underline","strike","LineView","props","line","_el$","_tmpl$2","_$insert","_$createComponent","each","segments","children","segment","text","_el$7","_tmpl$3","_$effect","_$className","when","truncated","_el$2","_tmpl$","_el$3","firstChild","_el$6","nextSibling","_el$5","toLocaleString","sameAnsiLine","left","right","length","every","index","StatusReadout","_el$8","_tmpl$5","state","_el$9","_tmpl$4","fallback","_p$","_v$","_v$2","e","_$setAttribute","t","undefined","Terminal","local","rest","small","pageSize","Math","max","floor","newParser","parser","consumed","epoch","revision","next","startsWith","write","slice","equals","limit","setLimit","defer","empty","outputRows","rows","lines","open","openLine","push","parked","setParked","end","total","droppedLines","anchorEnd","current","position","lineWindow","visibleRows","start","retainedIndex","changedParkedLine","newerRows","later","scroller","HTMLDivElement","following","onScroll","atEnd","scrollHeight","scrollTop","clientHeight","currentEpoch","jumpToLatest","focus","copied","failed","copyFailed","copy","copyText","regionLabel","_el$0","_tmpl$0","_el$1","_el$13","_el$16","_el$17","_$spread","_$mergeProps","data-size","aria-busy","class","_tmpl$1","_el$10","_tmpl$6","_el$11","_el$12","_$memo","variant","aria-label","onClick","title","hidden","evicted","_el$14","_tmpl$7","_el$15","lost","revealable","min","addEventListener","_$use","element","_el$26","_tmpl$10","_el$27","_el$18","_tmpl$8","_el$19","_tmpl$9","_el$20","_el$23","_el$21","_el$24","_el$22","_v$3","_v$4","_v$5","a","_$setStyleProperty","_$createComponent","_$className","_$setAttribute","Terminal","_$mergeProps","_$memo","_$setStyleProperty"],"sources":["../../../../src/components/composites/terminal/terminal.tsx"],"sourcesContent":["import {\n ArrowDown,\n Check,\n CircleAlert,\n CircleSlash,\n Copy,\n Eraser,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n createAnsiParser,\n isPlainStyle,\n resolveColors,\n type AnsiLine,\n type AnsiStyle,\n ansiPlainText,\n} from './ansi'\nimport {\n isAtBottom,\n isFailedExit,\n revealEarlier,\n terminalStatusLabel,\n terminalWindow,\n type TerminalStatus,\n} from './terminal-model'\n\n/**\n * Terminal.\n *\n * A command and its output, as it arrives. It is the thing to put inside an\n * agent's \"ran a command\" line (a `TraceLine`, with `size=\"sm\"`) when the output\n * is the evidence; reach for `CodeBlock` instead when the text is source or a\n * finished log that needs no live behaviour, and for `TestResults` when the\n * output is a test run the host can structure.\n *\n * It does not wrap `CodeBlock`. A block's `highlight` seam re-renders the whole\n * body whenever the code changes, which is exactly wrong for output that grows a\n * line at a time, and a terminal has to own its scroller to follow the tail. It\n * keeps the block's header and surface vocabulary so the two read as one family.\n *\n * ## What the output is allowed to do\n *\n * Output is untrusted bytes. It is parsed by `createAnsiParser` into plain text\n * and a fixed set of styles — sixteen theme colours, bold, dim, italic,\n * underline, strike-through, reverse — and everything else (cursor movement,\n * title and clipboard sequences, anything malformed) is dropped, never echoed.\n * Colours come from the theme's `--terminal-ansi-*` tokens, painted on the\n * theme's own terminal background, so a program's colours keep the contrast the\n * theme measured for them. Nothing is rendered as markup.\n *\n * ## Streaming\n *\n * `output` is the whole string so far. When the new value begins with the old\n * one, only the appended text is parsed, so a chunk costs the size of the chunk\n * and not of the transcript. Finished lines are keyed by identity and are never\n * re-rendered; only the line still being written changes, which is what makes a\n * `\\r` progress bar redraw in place. Batch appends per frame — the host sees a\n * prefix check proportional to the output on every change.\n *\n * Only the last `maxLines` finished lines are mounted. The rest are counted in\n * an explicit note with a control to show them a page at a time, because tens of\n * thousands of row elements are a frozen page, not a transcript. Copy still\n * writes `output` exactly as given — not the rendered lines, not the visible tail.\n *\n * ## Following the tail\n *\n * The terminal scrolls inside its own bounded box and follows new output only\n * while the reader is at the bottom of that box. Scrolling up *parks* the view:\n * the lines mounted are the ones that were there when they left, however much\n * output arrives, and \"Jump to latest\" is the only way back to the tail (reaching\n * the bottom of a parked view with nothing newer resumes it, because nothing was\n * missed). If retention discards the lines they were reading the note says how\n * many, and when none are left the oldest retained lines are shown. The page\n * itself is never scrolled. Scrolling is instant, so there is no animation to\n * reduce.\n *\n * ## Status is a claim\n *\n * `status` is drawn only when the host passes it, in words as well as an icon,\n * and only a non-zero exit is toned as a failure: this component does not decide\n * that a command \"passed\". Without a status the header says nothing about whether\n * the command is still running. `onClear` adds a clear button; without it the\n * output is the host's record and nothing here offers to erase it.\n */\nexport type TerminalProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** Everything the command has printed so far, exactly as received. */\n output: string\n /** The command line. Shown as text; the prompt glyph is decoration. */\n command?: string\n status?: TerminalStatus\n /** Finished lines mounted at once; earlier ones are counted and revealed a page at a time. */\n maxLines?: number\n /** Finished lines kept at all; older ones are discarded and counted. Default 200 000. */\n retainLines?: number\n /** Height of the output box, which scrolls past it. A number is pixels. Default `20rem`. */\n maxHeight?: number | string\n /** Soft-wrap long lines instead of scrolling sideways. Off: terminal columns keep their alignment. */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /** Show a clear button. The host empties `output`; the terminal erases nothing itself. */\n onClear?: () => void\n copyLabel?: string\n copiedLabel?: string\n clearLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\n/** Finished lines mounted by default. */\nexport const TERMINAL_MAX_LINES = 1000\n\n// One literal class per colour, written out in full so the stylesheet generator\n// can see each of them; a class assembled from an index would never be emitted.\nconst FG_CLASS = [\n 'text-(color:--terminal-ansi-black)',\n 'text-(color:--terminal-ansi-red)',\n 'text-(color:--terminal-ansi-green)',\n 'text-(color:--terminal-ansi-yellow)',\n 'text-(color:--terminal-ansi-blue)',\n 'text-(color:--terminal-ansi-magenta)',\n 'text-(color:--terminal-ansi-cyan)',\n 'text-(color:--terminal-ansi-white)',\n 'text-(color:--terminal-ansi-bright-black)',\n 'text-(color:--terminal-ansi-bright-red)',\n 'text-(color:--terminal-ansi-bright-green)',\n 'text-(color:--terminal-ansi-bright-yellow)',\n 'text-(color:--terminal-ansi-bright-blue)',\n 'text-(color:--terminal-ansi-bright-magenta)',\n 'text-(color:--terminal-ansi-bright-cyan)',\n 'text-(color:--terminal-ansi-bright-white)',\n] as const\nconst BG_CLASS = [\n 'bg-(--terminal-ansi-black)',\n 'bg-(--terminal-ansi-red)',\n 'bg-(--terminal-ansi-green)',\n 'bg-(--terminal-ansi-yellow)',\n 'bg-(--terminal-ansi-blue)',\n 'bg-(--terminal-ansi-magenta)',\n 'bg-(--terminal-ansi-cyan)',\n 'bg-(--terminal-ansi-white)',\n 'bg-(--terminal-ansi-bright-black)',\n 'bg-(--terminal-ansi-bright-red)',\n 'bg-(--terminal-ansi-bright-green)',\n 'bg-(--terminal-ansi-bright-yellow)',\n 'bg-(--terminal-ansi-bright-blue)',\n 'bg-(--terminal-ansi-bright-magenta)',\n 'bg-(--terminal-ansi-bright-cyan)',\n 'bg-(--terminal-ansi-bright-white)',\n] as const\n\nfunction segmentClass(style: AnsiStyle): string {\n const { fg, bg } = resolveColors(style)\n return cn(\n {\n 'font-bold': style.bold,\n 'opacity-70': style.dim,\n italic: style.italic,\n underline: style.underline && !style.strike,\n 'line-through': style.strike && !style.underline,\n '[text-decoration-line:underline_line-through]': style.underline && style.strike,\n 'text-(color:--terminal-background)': fg === 'default-bg',\n 'bg-(--terminal-foreground)': bg === 'default-fg',\n },\n typeof fg === 'number' && FG_CLASS[fg],\n typeof bg === 'number' && BG_CLASS[bg]\n )\n}\n\nfunction LineView(props: { line: AnsiLine; wrap: boolean }) {\n return (\n // `min-h-lh` keeps an empty line one line tall; a block with no text would\n // collapse and the transcript would lose its blank lines.\n <div\n class={cn('min-h-lh', {\n 'whitespace-pre-wrap [overflow-wrap:anywhere]': props.wrap,\n 'w-max min-w-full': !props.wrap,\n })}\n >\n <For each={props.line.segments}>\n {(segment) =>\n isPlainStyle(segment.style) ? (\n segment.text\n ) : (\n <span class={segmentClass(segment.style)}>{segment.text}</span>\n )\n }\n </For>\n <Show when={props.line.truncated > 0}>\n <span class=\"opacity-70 select-none\">\n {' '}\n … {props.line.truncated.toLocaleString()} more characters not shown\n </span>\n </Show>\n </div>\n )\n}\n\nfunction sameAnsiLine(left: AnsiLine, right: AnsiLine): boolean {\n return (\n left.truncated === right.truncated &&\n left.segments.length === right.segments.length &&\n left.segments.every(\n (segment, index) =>\n segment.text === right.segments[index]?.text &&\n segment.style === right.segments[index]?.style\n )\n )\n}\n\nfunction StatusReadout(props: { status: TerminalStatus }) {\n return (\n // A live region, so a command that finishes while the reader is elsewhere is\n // announced once, in words.\n <span\n role=\"status\"\n data-slot=\"terminal-status\"\n data-state={props.status.state}\n class={cn('flex shrink-0 items-center gap-1 text-xs', {\n 'text-destructive': isFailedExit(props.status),\n 'text-info': props.status.state === 'running',\n 'text-muted-foreground': props.status.state !== 'running' && !isFailedExit(props.status),\n })}\n >\n {/* A zero exit gets no glyph: a tick would be this component deciding the\n command succeeded, and some tools exit non-zero on purpose or zero on\n failure. The words carry the fact; only a non-zero code is toned. */}\n <Show when={props.status.state !== 'exited' || isFailedExit(props.status)}>\n <span aria-hidden=\"true\" class=\"grid size-3.5 place-items-center [&_svg]:size-3.5\">\n <Show\n when={props.status.state === 'running'}\n fallback={\n <Show when={props.status.state === 'cancelled'} fallback={<CircleAlert />}>\n <CircleSlash />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n </Show>\n {terminalStatusLabel(props.status)}\n </span>\n )\n}\n\nexport function Terminal(props: TerminalProps) {\n const [local, rest] = splitProps(props, [\n 'output',\n 'command',\n 'status',\n 'maxLines',\n 'retainLines',\n 'maxHeight',\n 'wrap',\n 'size',\n 'onClear',\n 'copyLabel',\n 'copiedLabel',\n 'clearLabel',\n 'onCopy',\n 'class',\n ])\n\n const small = () => local.size === 'sm'\n const pageSize = () => Math.max(1, Math.floor(local.maxLines ?? TERMINAL_MAX_LINES))\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : (local.maxHeight ?? '20rem')\n\n // The parser outlives renders: it holds the half-read escape sequence, the\n // current style and the open line. A new `output` that extends the old one is\n // fed only its tail; anything else (a clear, a different command) starts over.\n const newParser = () => createAnsiParser({ retainLines: local.retainLines })\n let parser = newParser()\n let consumed = ''\n // Bumped when the output restarts, so a parked position from the old output\n // is never applied to the new one.\n let epoch = 0\n const revision = createMemo(\n () => {\n const next = local.output\n if (next.length >= consumed.length && next.startsWith(consumed)) {\n parser.write(next.slice(consumed.length))\n } else {\n parser = newParser()\n parser.write(next)\n epoch += 1\n }\n consumed = next\n return epoch\n },\n undefined,\n { equals: false }\n )\n\n const [limit, setLimit] = createSignal(pageSize())\n createEffect(on(pageSize, (size) => setLimit(size), { defer: true }))\n // A cleared terminal is a fresh one: the next command starts at the page size.\n createEffect(\n on(\n () => local.output === '',\n (empty) => {\n if (empty) setLimit(pageSize())\n },\n { defer: true }\n )\n )\n\n const outputRows = createMemo(\n () => {\n revision()\n const rows = parser.lines.slice()\n const open = parser.openLine()\n if (open) rows.push(open)\n return rows\n },\n [],\n { equals: false }\n )\n // Where the reader parked, as a count of lines since the output began. An open\n // line is a row too: freeze its snapshot so streamed characters and CR redraws\n // do not rewrite the text under a parked reader.\n const [parked, setParked] = createSignal<{ epoch: number; end: number; open?: AnsiLine }>()\n const total = () => parser.droppedLines + outputRows().length\n const anchorEnd = () => {\n const current = revision()\n const position = parked()\n return position && position.epoch === current ? position.end : undefined\n }\n const lineWindow = createMemo(() => {\n revision()\n return terminalWindow(outputRows().length, parser.droppedLines, limit(), anchorEnd())\n })\n // Finished rows keep their parser identity. If an open row existed when the\n // reader parked, substitute its immutable snapshot until they jump to latest.\n const visibleRows = createMemo(\n () => {\n revision()\n const start = lineWindow().start\n const end = lineWindow().end\n const rows = outputRows().slice(start, end)\n const position = parked()\n if (position?.epoch === revision() && position.open) {\n const retainedIndex = position.end - 1 - parser.droppedLines\n if (retainedIndex >= start && retainedIndex < end) {\n rows[retainedIndex - start] = position.open\n }\n }\n return rows\n },\n [],\n { equals: false }\n )\n const changedParkedLine = () => {\n const position = parked()\n if (position?.epoch !== revision() || !position.open) return false\n const retainedIndex = position.end - 1 - parser.droppedLines\n const current = outputRows()[retainedIndex]\n return current !== undefined && !sameAnsiLine(position.open, current)\n }\n const newerRows = () => lineWindow().later + (changedParkedLine() ? 1 : 0)\n\n let scroller: HTMLDivElement | undefined\n const following = () => anchorEnd() === undefined\n\n const onScroll = () => {\n if (!scroller) return\n const atEnd = isAtBottom(scroller.scrollHeight, scroller.scrollTop, scroller.clientHeight)\n const position = anchorEnd()\n if (!atEnd) {\n if (position === undefined) {\n const currentEpoch = revision()\n setParked({ epoch: currentEpoch, end: total(), open: parser.openLine() })\n }\n } else if (position !== undefined && position >= total() && !changedParkedLine()) {\n // Back at the end of a view with nothing newer: nothing was missed.\n setParked(undefined)\n }\n }\n createEffect(\n on(revision, () => {\n if (scroller && following()) scroller.scrollTop = scroller.scrollHeight\n })\n )\n const jumpToLatest = () => {\n if (!scroller) return\n setParked(undefined)\n scroller.scrollTop = scroller.scrollHeight\n // The button is about to disappear; leave focus somewhere real.\n scroller.focus()\n }\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(ansiPlainText(local.output))\n local.onCopy?.(ok)\n }\n\n const empty = () => local.output === ''\n const regionLabel = () =>\n local.command ? `Output of ${local.command.slice(0, 120)}` : 'Terminal output'\n\n return (\n <div\n data-slot=\"terminal\"\n data-size={local.size ?? 'default'}\n aria-busy={local.status?.state === 'running' || undefined}\n class={cn(\n 'group/terminal overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n >\n <div class={cn('flex items-center gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}>\n <Show\n when={local.command !== undefined}\n fallback={<span class=\"flex-1 text-xs text-muted-foreground\">Terminal</span>}\n >\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"shrink-0 font-code text-code text-muted-foreground select-none\"\n >\n $\n </span>\n <code\n title={local.command}\n class=\"line-clamp-2 min-w-0 font-code text-code text-foreground [overflow-wrap:anywhere]\"\n >\n {local.command}\n </code>\n </span>\n </Show>\n <Show when={local.status}>{(status) => <StatusReadout status={status()} />}</Show>\n {/* Hidden until the terminal is hovered or holds focus, never removed:\n a control that only exists under the pointer is unreachable by\n keyboard, and a touch screen has no hover, so it always shows there. */}\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/terminal:opacity-100 group-hover/terminal:opacity-100 [@media(hover:none)]:opacity-100\">\n <Show when={local.onClear !== undefined && !empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={local.clearLabel ?? 'Clear output'}\n onClick={() => local.onClear?.()}\n >\n <Eraser aria-hidden=\"true\" />\n </Button>\n </Show>\n <Show when={!empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy output')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </Show>\n </div>\n </div>\n\n <Show when={lineWindow().hidden > 0 || lineWindow().evicted > 0}>\n <div\n data-slot=\"terminal-hidden-note\"\n class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\"\n >\n <span>\n <Show when={lineWindow().hidden > 0}>\n {lineWindow().hidden.toLocaleString()} earlier{' '}\n {lineWindow().hidden === 1 ? 'line' : 'lines'} hidden\n <Show when={parser.droppedLines > 0}>\n {' '}\n ({parser.droppedLines.toLocaleString()} only in the copy)\n </Show>\n .\n </Show>\n <Show when={lineWindow().evicted > 0}>\n {' '}\n {lineWindow().lost\n ? `Older lines dropped. Showing the oldest ${lineWindow().end.toLocaleString()} kept.`\n : `${lineWindow().evicted.toLocaleString()} older lines dropped.`}\n </Show>\n </span>\n <Show when={lineWindow().revealable > 0}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => setLimit(revealEarlier(limit(), pageSize(), outputRows().length))}\n >\n Show {Math.min(pageSize(), lineWindow().revealable).toLocaleString()} earlier\n </Button>\n </Show>\n </div>\n </Show>\n\n <div class=\"relative\">\n <div\n ref={(element) => (scroller = element)}\n data-slot=\"terminal-body\"\n // A region that scrolls must be focusable, and a tab stop needs a name.\n role=\"region\"\n tabindex=\"0\"\n aria-label={regionLabel()}\n onScroll={onScroll}\n style={{ 'max-height': maxHeight() }}\n class=\"scroll-fade overflow-auto border-t border-border bg-(--terminal-background) text-(color:--terminal-foreground)\"\n >\n <Show\n when={!empty()}\n fallback={\n <p class={cn('m-0 opacity-70', small() ? 'px-2 py-1.5' : 'px-3 py-2')}>\n <span class=\"font-code text-code\">\n {local.status?.state === 'running' ? 'Waiting for output…' : 'No output'}\n </span>\n </p>\n }\n >\n <pre\n class={cn(\n 'm-0 font-code text-code leading-normal',\n small() ? 'px-2 py-1.5' : 'px-3 py-2'\n )}\n >\n <For each={visibleRows()}>\n {(line) => <LineView line={line} wrap={local.wrap === true} />}\n </For>\n </pre>\n </Show>\n </div>\n <Show when={newerRows() > 0}>\n <Button\n variant=\"secondary\"\n size=\"2xs\"\n class=\"absolute end-3 bottom-2 shadow-sm\"\n onClick={jumpToLatest}\n >\n <ArrowDown aria-hidden=\"true\" />\n Jump to latest\n <span class=\"text-muted-foreground tabular-nums\">\n ({newerRows().toLocaleString()} newer {newerRows() === 1 ? 'line' : 'lines'})\n </span>\n </Button>\n </Show>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2HA,IAAa8C,qBAAqB;AAIlC,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C;AAE7C,IAAME,WAAW;CACf;CACA;CACA;CACA;CACA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PTIONS = [
|
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
22
|
var CHANNEL_DESCRIPTIONS = {
|
|
23
|
-
stable: "Tested releases after
|
|
24
|
-
"pre-release": "Daily
|
|
25
|
-
dev: "
|
|
23
|
+
stable: "Tested releases, after four days in pre-release.",
|
|
24
|
+
"pre-release": "Daily builds. Early, with rough edges.",
|
|
25
|
+
dev: "Every build from main. For development machines."
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
28
|
* The updater dialog's release-channel row: one setting, a select trailing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-control.js","names":["SettingsRow","NativeSelect","createEffect","createSignal","onCleanup","Show","Accessor","ChannelControlActions","UpdateChannel","CHANNEL_OPTIONS","ReadonlyArray","value","label","CHANNEL_DESCRIPTIONS","Record","stable","dev","UpdateChannelControlProps","controls","read","Promise","persist","disabled","labels","Partial","descriptions","reloadOn","UpdateChannelControl","props","channel","setChannel","loaded","setLoaded","saving","setSaving","error","setError","active","then","catch","finally","save","next","previous","persisted","rollBack","caught","Error","message","recheck","_el$","_tmpl$","_$insert","_$createComponent","description","children","options","map","option","onChange","event","currentTarget","when","_el$2","_tmpl$2","_$createComponent"],"sources":["../../../../src/components/composites/update-dialog/channel-control.tsx"],"sourcesContent":["import { SettingsRow } from '../settings'\nimport { NativeSelect } from '../../ui/native-select'\nimport { createEffect, createSignal, onCleanup, Show, type Accessor } from 'solid-js'\n\nimport type { ChannelControlActions } from './update-dialog'\n\nexport type UpdateChannel = 'stable' | 'pre-release' | 'dev'\n\nconst CHANNEL_OPTIONS: ReadonlyArray<{ value: UpdateChannel; label: string }> = [\n { value: 'stable', label: 'Stable' },\n { value: 'pre-release', label: 'Pre-release' },\n { value: 'dev', label: 'Dev' },\n]\n\nconst CHANNEL_DESCRIPTIONS: Record<UpdateChannel, string> = {\n stable: 'Tested releases after
|
|
1
|
+
{"version":3,"file":"channel-control.js","names":["SettingsRow","NativeSelect","createEffect","createSignal","onCleanup","Show","Accessor","ChannelControlActions","UpdateChannel","CHANNEL_OPTIONS","ReadonlyArray","value","label","CHANNEL_DESCRIPTIONS","Record","stable","dev","UpdateChannelControlProps","controls","read","Promise","persist","disabled","labels","Partial","descriptions","reloadOn","UpdateChannelControl","props","channel","setChannel","loaded","setLoaded","saving","setSaving","error","setError","active","then","catch","finally","save","next","previous","persisted","rollBack","caught","Error","message","recheck","_el$","_tmpl$","_$insert","_$createComponent","description","children","options","map","option","onChange","event","currentTarget","when","_el$2","_tmpl$2","_$createComponent"],"sources":["../../../../src/components/composites/update-dialog/channel-control.tsx"],"sourcesContent":["import { SettingsRow } from '../settings'\nimport { NativeSelect } from '../../ui/native-select'\nimport { createEffect, createSignal, onCleanup, Show, type Accessor } from 'solid-js'\n\nimport type { ChannelControlActions } from './update-dialog'\n\nexport type UpdateChannel = 'stable' | 'pre-release' | 'dev'\n\nconst CHANNEL_OPTIONS: ReadonlyArray<{ value: UpdateChannel; label: string }> = [\n { value: 'stable', label: 'Stable' },\n { value: 'pre-release', label: 'Pre-release' },\n { value: 'dev', label: 'Dev' },\n]\n\nconst CHANNEL_DESCRIPTIONS: Record<UpdateChannel, string> = {\n stable: 'Tested releases, after four days in pre-release.',\n 'pre-release': 'Daily builds. Early, with rough edges.',\n dev: 'Every build from main. For development machines.',\n}\n\nexport type UpdateChannelControlProps = {\n /** The dialog's channel actions; every save flows through `recheck`. */\n controls: ChannelControlActions\n /** Read the persisted channel. */\n read: () => Promise<UpdateChannel>\n /** Persist a selection; resolves with the channel that actually stuck. */\n persist: (value: UpdateChannel) => Promise<UpdateChannel>\n /** Disable beyond the dialog's own working state, e.g. a host save in flight. */\n disabled?: Accessor<boolean>\n /** Per-channel option labels, when the defaults don't fit the app. Values remain unchanged. */\n labels?: Partial<Record<UpdateChannel, string>>\n /** Per-channel row descriptions, when the defaults don't fit the app. */\n descriptions?: Partial<Record<UpdateChannel, string>>\n /**\n * Re-read the persisted channel whenever this value changes. Supply it when\n * the channel can move while the dialog is closed — a service that gets torn\n * down, or a CLI writing the same setting — and hand it the dialog's `open`.\n */\n reloadOn?: Accessor<unknown>\n}\n\n/**\n * The updater dialog's release-channel row: one setting, a select trailing.\n * Every desktop application that ships channels presents the same three of\n * them with consistent behavior, which is why the row lives here rather than\n * being redrawn per app. A save always flows through the dialog's `recheck`, so a\n * channel switch re-asks the feed and the offer never outlives its channel.\n */\nexport function UpdateChannelControl(props: UpdateChannelControlProps) {\n const [channel, setChannel] = createSignal<UpdateChannel>('stable')\n const [loaded, setLoaded] = createSignal(false)\n const [saving, setSaving] = createSignal(false)\n const [error, setError] = createSignal<string | null>(null)\n\n createEffect(() => {\n props.reloadOn?.()\n let active = true\n onCleanup(() => {\n active = false\n })\n void props\n .read()\n .then((value) => {\n if (active) setChannel(value)\n })\n .catch(() => {\n if (active) setError('The current update channel could not be read.')\n })\n .finally(() => {\n if (active) setLoaded(true)\n })\n })\n\n const save = async (value: string) => {\n const next = value as UpdateChannel\n if (!loaded() || saving() || props.controls.disabled() || next === channel()) return\n const previous = channel()\n let persisted = false\n const rollBack = (caught: unknown) => {\n setChannel(previous)\n setError(caught instanceof Error ? caught.message : 'The update channel could not be saved.')\n }\n setChannel(next)\n setSaving(true)\n setError(null)\n\n try {\n await props.controls.recheck(async () => {\n try {\n setChannel(await props.persist(next))\n persisted = true\n } catch (caught) {\n rollBack(caught)\n throw caught\n }\n })\n } catch (caught) {\n // The dialog renders a failed feed check; only a failed channel write\n // rolls the choice back. A host's own `recheck` may reject before\n // persisting at all.\n if (!persisted) rollBack(caught)\n } finally {\n setSaving(false)\n }\n }\n\n return (\n <div class=\"flex flex-col gap-2\">\n <SettingsRow\n label=\"Update channel\"\n description={props.descriptions?.[channel()] ?? CHANNEL_DESCRIPTIONS[channel()]}\n >\n <NativeSelect\n aria-label=\"Update channel\"\n disabled={\n !loaded() || saving() || props.controls.disabled() || (props.disabled?.() ?? false)\n }\n value={channel()}\n options={CHANNEL_OPTIONS.map((option) => ({\n ...option,\n label: props.labels?.[option.value] ?? option.label,\n }))}\n onChange={(event) => void save(event.currentTarget.value)}\n />\n </SettingsRow>\n <Show when={error()}>{(message) => <p role=\"alert\">{message()}</p>}</Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;AAQA,IAAMS,kBAA0E;CAC9E;EAAEE,OAAO;EAAUC,OAAO;CAAS;CACnC;EAAED,OAAO;EAAeC,OAAO;CAAc;CAC7C;EAAED,OAAO;EAAOC,OAAO;CAAM;AAAC;AAGhC,IAAMC,uBAAsD;CAC1DE,QAAQ;CACR,eAAe;CACfC,KAAK;AACP;;;;;;;;AA8BA,SAAgBW,qBAAqBC,OAAkC;CACrE,MAAM,CAACC,SAASC,cAAc3B,aAA4B,QAAQ;CAClE,MAAM,CAAC4B,QAAQC,aAAa7B,aAAa,KAAK;CAC9C,MAAM,CAAC8B,QAAQC,aAAa/B,aAAa,KAAK;CAC9C,MAAM,CAACgC,OAAOC,YAAYjC,aAA4B,IAAI;CAE1DD,mBAAmB;EACjB0B,MAAMF,WAAW;EACjB,IAAIW,SAAS;EACbjC,gBAAgB;GACdiC,SAAS;EACX,CAAC;EACD,MACGlB,KAAK,CAAC,CACNmB,MAAM3B,UAAU;GACf,IAAI0B,QAAQP,WAAWnB,KAAK;EAC9B,CAAC,CAAC,CACD4B,YAAY;GACX,IAAIF,QAAQD,SAAS,+CAA+C;EACtE,CAAC,CAAC,CACDI,cAAc;GACb,IAAIH,QAAQL,UAAU,IAAI;EAC5B,CAAC;CACL,CAAC;CAED,MAAMS,OAAO,OAAO9B,UAAkB;EACpC,MAAM+B,OAAO/B;EACb,IAAI,CAACoB,OAAO,KAAKE,OAAO,KAAKL,MAAMV,SAASI,SAAS,KAAKoB,SAASb,QAAQ,GAAG;EAC9E,MAAMc,WAAWd,QAAQ;EACzB,IAAIe,YAAY;EAChB,MAAMC,YAAYC,WAAoB;GACpChB,WAAWa,QAAQ;GACnBP,SAASU,kBAAkBC,QAAQD,OAAOE,UAAU,wCAAwC;EAC9F;EACAlB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OAAO,EAAE,aAAa,CAAA;IACtB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,GAAG,CAAC,OAAO,CAAA;IAChE,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;;;;OAIG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACnD,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"update-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AA4B7C,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,iEAAiE;IACjE,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;IACjC,8DAA8D;IAC9D,KAA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IAAI,CAAA;IACtC;;;;OAIG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACnD,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA+mBpD"}
|
|
@@ -18,7 +18,7 @@ var _tmpl$4 = /*#__PURE__*/ template(`<section class="grid gap-2"aria-label="Upd
|
|
|
18
18
|
var _tmpl$5 = /*#__PURE__*/ template(`<p class="text-foreground flex items-center gap-2 text-sm"role=status>`);
|
|
19
19
|
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>`);
|
|
20
20
|
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>`);
|
|
21
|
-
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">
|
|
21
|
+
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">Versions 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>`);
|
|
22
22
|
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">`);
|
|
23
23
|
var _tmpl$0 = /*#__PURE__*/ template(`<img alt class=size-10 aria-hidden=true>`);
|
|
24
24
|
var _tmpl$1 = /*#__PURE__*/ template(`<div class="mt-4 border-t border-border pt-4">`);
|
|
@@ -388,7 +388,7 @@ function UpdateDialog(props) {
|
|
|
388
388
|
return memo(() => state()?.phase === "available")() && state()?.availableVersion;
|
|
389
389
|
},
|
|
390
390
|
get fallback() {
|
|
391
|
-
return memo(() => state()?.phase === "unavailable")() ? "No signed package is published for this platform." : memo(() => state()?.phase === "cancelled")() ? "Update cancelled. You can retry when ready." : memo(() => !!desktop())() ? "Check the release channel for the latest signed build." : local.desktopOnlyMessage ?? `
|
|
391
|
+
return memo(() => state()?.phase === "unavailable")() ? "No signed package is published for this platform." : memo(() => state()?.phase === "cancelled")() ? "Update cancelled. You can retry when ready." : memo(() => !!desktop())() ? "Check the release channel for the latest signed build." : local.desktopOnlyMessage ?? `Check for updates in the desktop app.`;
|
|
392
392
|
},
|
|
393
393
|
get children() {
|
|
394
394
|
return `A newer release, v${state()?.availableVersion}, is ready.`;
|
|
@@ -401,7 +401,7 @@ function UpdateDialog(props) {
|
|
|
401
401
|
type: "button",
|
|
402
402
|
variant: "outline",
|
|
403
403
|
size: "sm",
|
|
404
|
-
tooltip: "Check
|
|
404
|
+
tooltip: "Check for a newer version",
|
|
405
405
|
get disabled() {
|
|
406
406
|
return !desktop() || working();
|
|
407
407
|
},
|