@songsid/agend 2.4.0-beta.14 → 2.4.0-beta.16
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/accounts-profiles.d.ts +1 -1
- package/dist/accounts-view.d.ts +3 -0
- package/dist/accounts-view.js.map +1 -1
- package/dist/auth-api.js +5 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.d.ts +6 -1
- package/dist/backend/claude-code.js +63 -8
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/kiro.js +6 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/types.d.ts +2 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-command.d.ts +4 -2
- package/dist/backend-command.js +3 -0
- package/dist/backend-command.js.map +1 -1
- package/dist/browser-backend-signins.d.ts +1 -0
- package/dist/browser-backend-signins.js +3 -1
- package/dist/browser-backend-signins.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/classic-channel-manager.d.ts +1 -0
- package/dist/classic-channel-manager.js +4 -1
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/claude-credential-change.d.ts +22 -0
- package/dist/claude-credential-change.js +47 -0
- package/dist/claude-credential-change.js.map +1 -0
- package/dist/claude-credential-launch.d.ts +62 -0
- package/dist/claude-credential-launch.js +304 -0
- package/dist/claude-credential-launch.js.map +1 -0
- package/dist/claude-credential-runner.d.ts +1 -0
- package/dist/claude-credential-runner.js +56 -0
- package/dist/claude-credential-runner.js.map +1 -0
- package/dist/claude-credential-vault.d.ts +51 -0
- package/dist/claude-credential-vault.js +252 -0
- package/dist/claude-credential-vault.js.map +1 -0
- package/dist/claude-setup-token-transport.d.ts +9 -0
- package/dist/claude-setup-token-transport.js +82 -0
- package/dist/claude-setup-token-transport.js.map +1 -0
- package/dist/claude-setup-token.d.ts +51 -0
- package/dist/claude-setup-token.js +83 -0
- package/dist/claude-setup-token.js.map +1 -0
- package/dist/cli-audited.js +7 -6
- package/dist/cli-audited.js.map +1 -1
- package/dist/command-report.d.ts +11 -0
- package/dist/command-report.js +2 -0
- package/dist/command-report.js.map +1 -0
- package/dist/config-validator.js +9 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +4 -2
- package/dist/config.js.map +1 -1
- package/dist/contact-auth-api.d.ts +2 -1
- package/dist/contact-auth-api.js +15 -5
- package/dist/contact-auth-api.js.map +1 -1
- package/dist/contact-auth-policy.d.ts +5 -0
- package/dist/contact-auth-policy.js +2 -0
- package/dist/contact-auth-policy.js.map +1 -1
- package/dist/contact-auth-store.d.ts +12 -1
- package/dist/contact-auth-store.js +67 -5
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-auth-types.d.ts +27 -1
- package/dist/contact-auth-types.js.map +1 -1
- package/dist/daemon.d.ts +5 -0
- package/dist/daemon.js +59 -3
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +1 -0
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-manager.d.ts +48 -3
- package/dist/fleet-manager.js +446 -27
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +16 -6
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +23 -5
- package/dist/host-monitoring-config.d.ts +14 -0
- package/dist/host-monitoring-config.js +31 -0
- package/dist/host-monitoring-config.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/instance-config-impact.js +1 -1
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instructions.js +1 -0
- package/dist/instructions.js.map +1 -1
- package/dist/locale.d.ts +2 -0
- package/dist/locale.js +19 -1
- package/dist/locale.js.map +1 -1
- package/dist/needs-you-hub.js +3 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +2 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/profile-signins.d.ts +1 -0
- package/dist/profile-signins.js +3 -1
- package/dist/profile-signins.js.map +1 -1
- package/dist/public-web-gateway.js +2 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +21 -2
- package/dist/public-web-link.js +22 -2
- package/dist/public-web-link.js.map +1 -1
- package/dist/settings-api.d.ts +12 -0
- package/dist/settings-api.js +146 -7
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +2 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +13 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/topic-commands.d.ts +7 -1
- package/dist/topic-commands.js +98 -88
- package/dist/topic-commands.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/ui/accounts-view.js +12 -6
- package/dist/ui/backend-signin.js +3 -1
- package/dist/ui/chat-commands.js +2 -0
- package/dist/ui/chat-popout-transport.js +49 -19
- package/dist/ui/chat-popout.js +15 -1
- package/dist/ui/chat-store.js +1 -1
- package/dist/ui/claude-credentials.js +112 -0
- package/dist/ui/claude-setup-token.js +36 -0
- package/dist/ui/contact-auth-client.js +9 -2
- package/dist/ui/contact-auth-strings.js +78 -16
- package/dist/ui/contact-authorizations.js +47 -26
- package/dist/ui/contact-needs.js +22 -6
- package/dist/ui/contact-permissions.js +55 -10
- package/dist/ui/contact-tool-groups.js +39 -0
- package/dist/ui/fleet-canvas.js +3 -2
- package/dist/ui/fleet-office-card.js +414 -41
- package/dist/ui/fleet-office-dialogue.js +3 -3
- package/dist/ui/fleet-office-pack.d.ts +67 -1
- package/dist/ui/fleet-office-pack.js +412 -18
- package/dist/ui/fleet-office-play.js +262 -3
- package/dist/ui/fleet-office-skin.js +67 -20
- package/dist/ui/fleet-office-zones.js +19 -1
- package/dist/ui/fleet-office.js +393 -47
- package/dist/ui/office-share-page.js +5 -1
- package/dist/ui/panel-chat.js +47 -3
- package/dist/ui/panel-fleet.js +1 -1
- package/dist/ui/panel-needs.js +7 -4
- package/dist/ui/panel-settings.js +2 -1
- package/dist/ui/preview-popout.js +134 -0
- package/dist/ui/reply-file-preview.js +1 -1
- package/dist/ui/settings-appearance.js +6 -1
- package/dist/ui/settings-host-monitoring.js +51 -0
- package/dist/ui/settings-registry.js +1 -1
- package/dist/ui/settings-shared.js +3 -2
- package/dist/ui/shared/app-i18n.js +4 -0
- package/dist/ui/shared/app-shell.js +16 -7
- package/dist/ui/shared/app.css +266 -27
- package/dist/ui/shared/app.js +7 -1
- package/dist/ui/shared/chat-strings.js +8 -2
- package/dist/ui/shared/info-tip.js +64 -0
- package/dist/ui/shared/office-dialogue.css +12 -0
- package/dist/ui/shared/preview-panel.js +44 -18
- package/dist/ui/shared/preview-popout.css +11 -0
- package/dist/ui/shared/theme-picker.js +46 -0
- package/dist/ui/shared/theme.js +47 -4
- package/dist/ui/shared/tokens.css +273 -0
- package/dist/ui/shared/ui-confirm.js +5 -2
- package/dist/ui/shared/usage-dialog.js +9 -34
- package/dist/ui/shared/view-strings.js +2 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +1 -0
- package/dist/usage/providers.js +14 -1
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.js +5 -2
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +5 -1
- package/dist/web-api.js +29 -9
- package/dist/web-api.js.map +1 -1
- package/dist/web-claude-credentials.d.ts +31 -0
- package/dist/web-claude-credentials.js +138 -0
- package/dist/web-claude-credentials.js.map +1 -0
- package/dist/web-commands.d.ts +5 -2
- package/dist/web-commands.js +4 -2
- package/dist/web-commands.js.map +1 -1
- package/dist/web-office-skins.d.ts +7 -2
- package/dist/web-office-skins.js +42 -16
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-session.d.ts +20 -1
- package/dist/web-session.js +27 -0
- package/dist/web-session.js.map +1 -1
- package/dist/web-terminal.d.ts +4 -0
- package/dist/web-terminal.js +16 -1
- package/dist/web-terminal.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
|
14
14
|
import { t } from "/assets/app-i18n.js";
|
|
15
15
|
import { Icon } from "/assets/ui-icons.js";
|
|
16
16
|
import { Skeleton } from "/assets/ui-states.js";
|
|
17
|
+
import { Dialog } from "/assets/ui-dialog.js";
|
|
17
18
|
import "/assets/chat-render.js";
|
|
18
19
|
import "/assets/preview.js";
|
|
19
20
|
import { loadHtmlAttachment } from "/assets/html-attachment.js";
|
|
@@ -24,6 +25,31 @@ import { pagesOf, pageIdOf } from "./preview-pages.js";
|
|
|
24
25
|
import { drawMarkdown, TEXT_CARD_MAX } from "/assets/chat-thread.js";
|
|
25
26
|
import "/assets/chat-md-strings.js"; // M-2448: the Markdown panel's own words (an older cached chat-strings.js lacks them)
|
|
26
27
|
|
|
28
|
+
/** Secondary phone controls use the app's focus-trapped options sheet, keeping the toolbar one row. */
|
|
29
|
+
function PreviewToolbar({ owner, versions, views, width, reload, run, fullscreen, actions }) {
|
|
30
|
+
const query = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
|
|
31
|
+
const [narrow, setNarrow] = useState(() => !!globalThis.matchMedia?.(query).matches);
|
|
32
|
+
const [more, setMore] = useState(false);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const media = globalThis.matchMedia?.(query);
|
|
35
|
+
const changed = () => { setNarrow(!!media?.matches); setMore(false); };
|
|
36
|
+
media?.addEventListener?.("change", changed);
|
|
37
|
+
return () => media?.removeEventListener?.("change", changed);
|
|
38
|
+
}, []);
|
|
39
|
+
useEffect(() => { setMore(false); }, [owner]);
|
|
40
|
+
return html`<div class="pv-panel-bar">
|
|
41
|
+
${narrow ? html`${views}${run}${fullscreen}
|
|
42
|
+
<button type="button" class="icon-btn pv-toolbar-more" title=${t("chat.pvMenu")} aria-label=${t("chat.pvMenu")}
|
|
43
|
+
aria-haspopup="dialog" aria-expanded=${more ? "true" : "false"} onClick=${() => setMore(true)}><${Icon} name="more" size=${18} /></button>
|
|
44
|
+
${more ? html`<div class="pv-toolbar-dialog" onKeyDown=${e => e.stopPropagation()}>
|
|
45
|
+
<${Dialog} title=${t("chat.pvMenu")} onClose=${() => setMore(false)}>
|
|
46
|
+
${versions}${width ? html`<label class="field"><span>${t("chat.pvWidth")}</span>${width}</label>` : null}
|
|
47
|
+
${reload}${actions}
|
|
48
|
+
</${Dialog}>
|
|
49
|
+
</div>` : null}` : html`${versions}${views}<span class="grow"></span>${width}${reload}${run}${fullscreen}${actions}`}
|
|
50
|
+
</div>`;
|
|
51
|
+
}
|
|
52
|
+
|
|
27
53
|
export { htmlTitle };
|
|
28
54
|
|
|
29
55
|
const R = () => globalThis.AgendChatRender;
|
|
@@ -38,6 +64,7 @@ const P = () => globalThis.AgendPreview;
|
|
|
38
64
|
let state = { open: null, run: 0 };
|
|
39
65
|
let runs = 0, version = 0, claims = 0;
|
|
40
66
|
const subs = new Set();
|
|
67
|
+
export const previewHostReady = name => hosts.has(name);
|
|
41
68
|
const hosts = new Map(); // instance → mounted host token; an older cleanup cannot close its successor
|
|
42
69
|
|
|
43
70
|
function set(next) { state = next; version++; for (const fn of [...subs]) { try { fn(state); } catch { /* one listener's error stops no other */ } } }
|
|
@@ -181,7 +208,7 @@ const timeOf = (ts) => (ts ? chatTime(ts, { yesterday: (hm) => t("chat.yesterday
|
|
|
181
208
|
* reveal(msgKey) (the thread shows that message), download(code).
|
|
182
209
|
*/
|
|
183
210
|
/** allow(commit): this device's opt-in through the chat's one path (setPreviewOptIn: the confirm, then commit(setOptIn)) → the choice. */
|
|
184
|
-
export function PreviewPanel({ name, split, msgs, subscribe, keyOf, reveal, download, allow }) {
|
|
211
|
+
export function PreviewPanel({ name, split, msgs, subscribe, keyOf, reveal, download, allow, popout }) {
|
|
185
212
|
const [st, setSt] = useState(state);
|
|
186
213
|
const [view, setView] = useState("preview");
|
|
187
214
|
const [run, setRun] = useState({ state: "idle", reason: "" });
|
|
@@ -470,31 +497,30 @@ export function PreviewPanel({ name, split, msgs, subscribe, keyOf, reveal, down
|
|
|
470
497
|
<button type="button" class="pv-source" title=${source} onClick=${() => { if (window.matchMedia && window.matchMedia("(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)").matches) closePanel(); reveal(open.msgKey); }}>${source}</button></div>
|
|
471
498
|
${pages.length > 1 ? html`<button type="button" class=${`btn btn-sm pv-pages-toggle${listing ? " on" : ""}`} aria-pressed=${listing ? "true" : "false"} title=${t("chat.pvPagesTitle")}
|
|
472
499
|
onClick=${() => setListing(v => !v)}><${Icon} name="file" size=${14} />${t("chat.pvPagesCount", pages.length)}</button>` : null}
|
|
500
|
+
${typeof popout === "function" ? html`<button type="button" class="icon-btn pv-panel-popout" aria-label=${t("chat.pvPopout")} title=${t("chat.pvPopout")} onClick=${() => popout(open)}><${Icon} name="external" size=${18} /></button>` : null}
|
|
473
501
|
<button type="button" class="icon-btn only-wide pv-panel-close" title=${t("chat.pvClose")} aria-label=${t("chat.pvClose")} onClick=${closePanel}><${Icon} name="close" size=${18} /></button>
|
|
474
502
|
</div>
|
|
475
|
-
|
|
476
|
-
|
|
503
|
+
<${PreviewToolbar} owner=${open.key}
|
|
504
|
+
versions=${html`${vers.list.length > 1 && vers.index >= 0 ? html`<div class="pv-ver" role="group" aria-label=${t("chat.pvVersions")}>
|
|
477
505
|
<button type="button" class="icon-btn pv-ver-prev" title=${t("chat.pvVerPrev")} aria-label=${t("chat.pvVerPrev")} disabled=${vers.index === 0} onClick=${() => step(-1)}><${Icon} name="prev" size=${16} /></button>
|
|
478
506
|
<span class="pv-ver-at" aria-live="polite" title=${t("chat.pvVerLong", vers.index + 1, vers.list.length)} aria-label=${t("chat.pvVerLong", vers.index + 1, vers.list.length)}>${t("chat.pvVer", vers.index + 1, vers.list.length)}</span>
|
|
479
507
|
<button type="button" class="icon-btn pv-ver-next" title=${t("chat.pvVerNext")} aria-label=${t("chat.pvVerNext")} disabled=${vers.index === vers.list.length - 1} onClick=${() => step(1)}><${Icon} name="next" size=${16} /></button>
|
|
480
|
-
</div>` : null}
|
|
481
|
-
|
|
508
|
+
</div>` : null}`}
|
|
509
|
+
views=${html`<div class="seg-inline" role="group" aria-label=${t("chat.pvPanel")}>
|
|
482
510
|
<button type="button" class=${`btn btn-sm${shown === "preview" ? " on" : ""}`} aria-pressed=${shown === "preview" ? "true" : "false"} title=${t("chat.pvPage")} onClick=${() => pickView("preview")}><${Icon} name="eye" size=${14} /><span class="lbl">${t("chat.pvPage")}</span></button>
|
|
483
511
|
<button type="button" class=${`btn btn-sm${shown === "code" ? " on" : ""}`} aria-pressed=${shown === "code" ? "true" : "false"} title=${t("chat.pvCode")} onClick=${() => pickView("code")}><${Icon} name="code" size=${14} /><span class="lbl">${t("chat.pvCode")}</span></button>
|
|
484
512
|
${prev ? html`<button type="button" class=${`btn btn-sm pv-changes${shown === "changes" ? " on" : ""}`} aria-pressed=${shown === "changes" ? "true" : "false"} title=${t("chat.pvChanges")} onClick=${() => pickView("changes")}><${Icon} name="diff" size=${14} /><span class="lbl">${t("chat.pvChanges")}</span></button>` : null}
|
|
485
|
-
</div
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
<button type="button" class="btn btn-sm pv-panel-stop" title=${t("chat.pvStop")} onClick=${stop}><${Icon} name="stop" size=${14} /><span class="lbl">${t("chat.pvStop")}</span></button>`
|
|
513
|
+
</div>`}
|
|
514
|
+
width=${html`${shown === "preview" ? html`<select class="pv-width" aria-label=${t("chat.pvWidth")} title=${t("chat.pvWidth")} value=${device} onChange=${(e) => setDevice(e.currentTarget.value)}>
|
|
515
|
+
<option value="full">${t("chat.pvWidthFull")}</option><option value="tablet">${t("chat.pvWidthTablet")}</option><option value="phone">${t("chat.pvWidthPhone")}</option></select>` : null}`}
|
|
516
|
+
reload=${html`${going ? html`<button type="button" class="btn btn-sm pv-panel-reload" title=${t("chat.pvReload")} onClick=${() => { stop(); start(true); }}><${Icon} name="restart" size=${14} /><span class="lbl">${t("chat.pvReload")}</span></button>` : null}`}
|
|
517
|
+
run=${html`${going ? html`<button type="button" class="btn btn-sm pv-panel-stop" title=${t("chat.pvStop")} onClick=${stop}><${Icon} name="stop" size=${14} /><span class="lbl">${t("chat.pvStop")}</span></button>`
|
|
491
518
|
: run.state === "large" ? html`<button type="button" class="btn btn-sm btn-primary pv-panel-anyway" title=${t("chat.pvAnyway")} disabled=${!a.ok} onClick=${() => start(true)}><${Icon} name="play" size=${14} /><span class="lbl">${t("chat.pvAnyway")}</span></button>`
|
|
492
|
-
: html`<button type="button" class="btn btn-sm btn-primary pv-panel-run" title=${t("chat.pvPreview")} disabled=${!a.ok} onClick=${() => start()}><${Icon} name="play" size=${14} /><span class="lbl">${t("chat.pvPreview")}</span></button>`}
|
|
493
|
-
|
|
494
|
-
onClick=${() => (fs ? leaveFs() : enterFs())}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${14} /></button
|
|
495
|
-
|
|
496
|
-
<button type="button" class="btn btn-sm pv-panel-dl" title=${t("chat.pvDownload")} onClick=${() => download(open.code, fileName)}><${Icon} name="download" size=${14} /><span class="lbl">${t("chat.pvDownload")}</span></button
|
|
497
|
-
</div>
|
|
519
|
+
: html`<button type="button" class="btn btn-sm btn-primary pv-panel-run" title=${t("chat.pvPreview")} disabled=${!a.ok} onClick=${() => start()}><${Icon} name="play" size=${14} /><span class="lbl">${t("chat.pvPreview")}</span></button>`}`}
|
|
520
|
+
fullscreen=${html`<button type="button" class=${`icon-btn pv-panel-fs${fs ? " on" : ""}`} aria-pressed=${fs ? "true" : "false"} title=${t(fs ? "chat.pvFsExit" : "chat.pvFs")} aria-label=${t(fs ? "chat.pvFsExit" : "chat.pvFs")}
|
|
521
|
+
onClick=${() => (fs ? leaveFs() : enterFs())}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${14} /></button>`}
|
|
522
|
+
actions=${html`<${PanelActions} open=${open} name=${name} run=${run} view=${view} />
|
|
523
|
+
<button type="button" class="btn btn-sm pv-panel-dl" title=${t("chat.pvDownload")} onClick=${() => download(open.code, fileName)}><${Icon} name="download" size=${14} /><span class="lbl">${t("chat.pvDownload")}</span></button>`} />
|
|
498
524
|
${newer && newer.key !== open.key ? html`<div class="pv-newer" role="status"><span>${t("chat.pvNewer", timeOf(newer.ts))}</span>
|
|
499
525
|
<button type="button" class="btn btn-sm pv-newer-show" onClick=${showNewer}>${t("chat.pvNewerShow")}</button>${newerNote ? newerNote.loading
|
|
500
526
|
? html`<${Skeleton} variant="inline" lines=${1} label=${t("chat.pvLoading")} />` : html`<span class="pv-newer-note">${newerNote}</span>` : null}</div>` : null}
|
|
@@ -533,7 +559,7 @@ function MarkdownPanel({ open, name, md, view, setView, plain, body, panel, fs,
|
|
|
533
559
|
<button type="button" class=${`btn btn-sm${view === "source" ? " on" : ""}`} aria-pressed=${view === "source" ? "true" : "false"} title=${t("chat.pvMdSource")} onClick=${() => setView("source")}><${Icon} name="code" size=${14} /><span class="lbl">${t("chat.pvMdSource")}</span></button>
|
|
534
560
|
</div>
|
|
535
561
|
<span class="grow"></span>
|
|
536
|
-
<button type="button" class=${`btn
|
|
562
|
+
<button type="button" class=${`icon-btn pv-panel-fs${fs ? " on" : ""}`} aria-pressed=${fs ? "true" : "false"} title=${t(fs ? "chat.pvFsExit" : "chat.pvFs")} aria-label=${t(fs ? "chat.pvFsExit" : "chat.pvFs")}
|
|
537
563
|
onClick=${() => (fs ? leaveFs() : enterFs())}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${14} /></button>
|
|
538
564
|
${open.att ? html`<a class="btn btn-sm pv-panel-dl" href=${`/ui/file/${open.att.id}`} download=${open.att.name} title=${t("chat.pvDownload")}><${Icon} name="download" size=${14} /><span class="lbl">${t("chat.pvDownload")}</span></a>` : null}
|
|
539
565
|
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Presentation only: the already-mounted chat keeps its store, live stream and preview owner. */
|
|
2
|
+
[data-preview-window="1"] .p-chat > .panel-head,
|
|
3
|
+
[data-preview-window="1"] .p-chat > .chat-card,
|
|
4
|
+
[data-preview-window="1"] .p-chat > .aw-chat_header,
|
|
5
|
+
[data-preview-window="1"] .p-chat .chat-split > .chat-main,
|
|
6
|
+
[data-preview-window="1"] .p-chat .pv-divider { display: none; }
|
|
7
|
+
[data-preview-window="1"] .p-chat .chat-split { width: 100%; min-width: 0; }
|
|
8
|
+
[data-preview-window="1"] .p-chat .pv-panel:not(.pv-fs) { flex: 1; width: 100%; max-width: none; min-width: 0; position: relative; inset: auto; }
|
|
9
|
+
@media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
|
|
10
|
+
.pv-panel-popout { min-width: var(--tap); min-height: var(--tap); }
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Built-in colours use the existing root tokens and mode controller; this dialog only edits that browser choice.
|
|
2
|
+
import { html, useEffect, useRef, useState } from "./app-html.js";
|
|
3
|
+
import { Dialog } from "./ui-dialog.js";
|
|
4
|
+
import { t } from "./app-i18n.js";
|
|
5
|
+
import { savePref, withoutHold } from "./app-prefs.js";
|
|
6
|
+
|
|
7
|
+
export const BUILTIN_PALETTES = Object.freeze(["", "sky", "meadow", "violet", "mint"]);
|
|
8
|
+
export const paletteName = (id) => t(`app.palette${id ? id[0].toUpperCase() + id.slice(1) : "Default"}`);
|
|
9
|
+
|
|
10
|
+
export function ThemePicker({ onClose }) {
|
|
11
|
+
const T = globalThis.AgendTheme;
|
|
12
|
+
const [mode, setMode] = useState(T?.get?.() || "system"), [palette, setPalette] = useState(T?.getPalette?.() || "");
|
|
13
|
+
const draft = useRef({ mode, palette });
|
|
14
|
+
const [systemLight, setSystemLight] = useState(() => globalThis.matchMedia?.("(prefers-color-scheme: light)").matches === true);
|
|
15
|
+
const lease = useRef(null);
|
|
16
|
+
const closing = useRef(false);
|
|
17
|
+
if (!lease.current) lease.current = T?.beginPreview?.();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const media = globalThis.matchMedia?.("(prefers-color-scheme: light)");
|
|
20
|
+
const changed = () => setSystemLight(media.matches);
|
|
21
|
+
const unsubscribe = T?.onChange?.(() => {
|
|
22
|
+
if (!closing.current && lease.current?.isCurrent?.() === false) { closing.current = true; onClose(); }
|
|
23
|
+
});
|
|
24
|
+
media?.addEventListener?.("change", changed);
|
|
25
|
+
return () => { unsubscribe?.(); media?.removeEventListener?.("change", changed); lease.current?.cancel(); };
|
|
26
|
+
}, []);
|
|
27
|
+
const update = (nextMode, nextPalette) => { draft.current = { mode: nextMode, palette: nextPalette }; setMode(nextMode); setPalette(nextPalette); lease.current?.update(nextMode, nextPalette); };
|
|
28
|
+
const cancel = () => { closing.current = true; lease.current?.cancel(); onClose(); };
|
|
29
|
+
const apply = () => { closing.current = true; if (lease.current?.commit()) withoutHold(() => savePref("theme", draft.current.mode)); onClose(); };
|
|
30
|
+
const tone = mode === "system" ? systemLight ? "light" : "dark" : mode;
|
|
31
|
+
return html`<${Dialog} title=${t("app.colours")} cls="theme-picker" onClose=${cancel} actions=${html`
|
|
32
|
+
<button type="button" class="btn theme-cancel" onClick=${cancel}>${t("app.cancel")}</button>
|
|
33
|
+
<button type="button" class="btn btn-primary theme-apply" onClick=${apply}>${t("app.apply")}</button>`}>
|
|
34
|
+
<div class="theme-colours" role="radiogroup" aria-label=${t("app.colours")}>
|
|
35
|
+
${BUILTIN_PALETTES.map(id => html`<label key=${id} class=${`theme-colour${palette === id ? " selected" : ""}`}>
|
|
36
|
+
<input type="radio" name="builtin-palette" value=${id} checked=${palette === id} onChange=${(e) => { if (e.currentTarget.checked) update(draft.current.mode, id); }} />
|
|
37
|
+
<span class="theme-swatch" data-palette=${id} data-tone=${tone} aria-hidden="true"><span class="theme-swatch-side"><i></i><i></i></span><span class="theme-swatch-chat"><i></i><i></i></span></span>
|
|
38
|
+
<span class="theme-colour-name">${paletteName(id)}<span class="theme-tick" aria-hidden="true">${palette === id ? "✓" : ""}</span></span>
|
|
39
|
+
</label>`)}
|
|
40
|
+
</div>
|
|
41
|
+
<fieldset class="theme-appearance"><legend>${t("app.theme")}</legend><div class="theme-mode-options">
|
|
42
|
+
${["system", "light", "dark"].map(value => html`<label class="check"><input type="radio" name="builtin-appearance" value=${value} checked=${mode === value}
|
|
43
|
+
onChange=${(e) => { if (e.currentTarget.checked) update(value, draft.current.palette); }} /><span>${t(`app.theme${value[0].toUpperCase() + value.slice(1)}`)}</span></label>`)}
|
|
44
|
+
</div></fieldset>
|
|
45
|
+
</${Dialog}>`;
|
|
46
|
+
}
|
package/dist/ui/shared/theme.js
CHANGED
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
(function () {
|
|
15
15
|
"use strict";
|
|
16
16
|
var KEY = "agend_theme";
|
|
17
|
+
var PALETTE_KEY = "agend_palette";
|
|
18
|
+
var PALETTES = ["sky", "meadow", "violet", "mint"];
|
|
17
19
|
var SYNCED_FLAG = "agend_prefs_synced";
|
|
18
20
|
function valid(v) { return v === "light" || v === "dark" ? v : "system"; }
|
|
21
|
+
function validPalette(v) { return PALETTES.indexOf(v) >= 0 ? v : ""; }
|
|
19
22
|
function read() {
|
|
20
23
|
try { return valid(localStorage.getItem(KEY)); } catch (e) { return "system"; } // storage blocked: follow the device
|
|
21
24
|
}
|
|
@@ -26,6 +29,8 @@
|
|
|
26
29
|
var root = document.documentElement;
|
|
27
30
|
if (v === "system") root.removeAttribute("data-theme");
|
|
28
31
|
else root.setAttribute("data-theme", v);
|
|
32
|
+
if (palette) root.setAttribute("data-palette", palette);
|
|
33
|
+
else root.removeAttribute("data-palette");
|
|
29
34
|
}
|
|
30
35
|
/** The host's choice for this page: a theme, or null — none known here (no data-prefs, or not in step yet). */
|
|
31
36
|
function hostChoice() {
|
|
@@ -39,18 +44,46 @@
|
|
|
39
44
|
return inStep ? "system" : null;
|
|
40
45
|
}
|
|
41
46
|
var current = hostChoice();
|
|
47
|
+
// Built-in colours are this browser's base palette. Agent page colours and owner CSS remain above it.
|
|
48
|
+
var palette = "";
|
|
49
|
+
try { palette = validPalette(localStorage.getItem(PALETTE_KEY)); } catch (e) { /* default */ }
|
|
42
50
|
if (current !== null) cache(current); else current = read();
|
|
43
51
|
apply(current);
|
|
44
52
|
var listeners = [];
|
|
53
|
+
var preview = null;
|
|
54
|
+
function retirePreview() {
|
|
55
|
+
if (preview) { current = preview.mode; palette = preview.colours; preview = null; }
|
|
56
|
+
}
|
|
57
|
+
function changed() {
|
|
58
|
+
apply(current);
|
|
59
|
+
for (var i = 0; i < listeners.length; i++) { try { listeners[i](current); } catch (e) { /* independent listeners */ } }
|
|
60
|
+
}
|
|
61
|
+
function cachePalette() {
|
|
62
|
+
try { if (palette) localStorage.setItem(PALETTE_KEY, palette); else localStorage.removeItem(PALETTE_KEY); } catch (e) { /* this page only */ }
|
|
63
|
+
}
|
|
45
64
|
window.AgendTheme = {
|
|
46
65
|
/** The theme this page shows. */
|
|
47
66
|
get: function () { return current; },
|
|
67
|
+
getPalette: function () { return palette; },
|
|
68
|
+
setPalette: function (v) { retirePreview(); palette = validPalette(v); cachePalette(); changed(); },
|
|
48
69
|
/** Choose "system", "light" or "dark" (this browser's copy; app-prefs.js keeps the host's); applied now even when it cannot be stored. */
|
|
49
70
|
set: function (v) {
|
|
71
|
+
retirePreview();
|
|
50
72
|
current = valid(v);
|
|
51
73
|
cache(current);
|
|
52
|
-
|
|
53
|
-
|
|
74
|
+
changed();
|
|
75
|
+
},
|
|
76
|
+
/** A dialog's temporary paint. An outside choice retires it; cancel never overwrites that newer choice. */
|
|
77
|
+
beginPreview: function () {
|
|
78
|
+
retirePreview();
|
|
79
|
+
var lease = { mode: current, colours: palette }, before = current, beforePalette = palette;
|
|
80
|
+
preview = lease;
|
|
81
|
+
return {
|
|
82
|
+
isCurrent: function () { return preview === lease; },
|
|
83
|
+
update: function (mode, colours) { if (preview !== lease) return; current = valid(mode); palette = validPalette(colours); changed(); },
|
|
84
|
+
cancel: function () { if (preview !== lease) return; preview = null; current = before; palette = beforePalette; changed(); },
|
|
85
|
+
commit: function () { if (preview !== lease) return false; preview = null; cache(current); cachePalette(); changed(); return true; },
|
|
86
|
+
};
|
|
54
87
|
},
|
|
55
88
|
/** Call `fn` with the theme whenever it changes on this page (an open Preferences shows it); returns the unsubscribe. */
|
|
56
89
|
onChange: function (fn) {
|
|
@@ -107,7 +140,17 @@
|
|
|
107
140
|
window.addEventListener("pageshow", schedule);
|
|
108
141
|
// Page palettes are applied to the shell; routes replace headers. Coalesce paints and
|
|
109
142
|
// ignore content attributes so updating this meta element cannot trigger itself.
|
|
110
|
-
|
|
111
|
-
|
|
143
|
+
// M-3455: the split view's grid (.ws-geometry) changes only its size and drag state on these attributes — never a colour.
|
|
144
|
+
// A divider drag writes them every frame; re-reading the header colours then forced a layout and style walk per frame.
|
|
145
|
+
function relevant(records) {
|
|
146
|
+
if (!records || !records.length) return true;
|
|
147
|
+
for (var i = 0; i < records.length; i++) {
|
|
148
|
+
var r = records[i];
|
|
149
|
+
if (r.type !== "attributes" || !r.target.classList || !r.target.classList.contains("ws-geometry")) return true;
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
new MutationObserver(function (records) { if (relevant(records)) schedule(); }).observe(document.documentElement, {
|
|
154
|
+
subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "data-theme", "data-palette", "data-agent"],
|
|
112
155
|
});
|
|
113
156
|
})();
|
|
@@ -202,3 +202,276 @@
|
|
|
202
202
|
@media (pointer: coarse), (max-width: 899px) {
|
|
203
203
|
.composer-ph { --fs-md: 16px; }
|
|
204
204
|
}
|
|
205
|
+
|
|
206
|
+
/* M-3368: browser colour palettes; the same tokens paint the page and its swatch. */
|
|
207
|
+
:root[data-palette="sky"], .theme-swatch[data-palette="sky"][data-tone="dark"] {
|
|
208
|
+
--bg: #162532;
|
|
209
|
+
--bg-sidebar: #101e2b;
|
|
210
|
+
--surface: #243543;
|
|
211
|
+
--surface-2: #314553;
|
|
212
|
+
--user-bubble: #2b4356;
|
|
213
|
+
--text: #edf5fc;
|
|
214
|
+
--text-2: #d3e2ef;
|
|
215
|
+
--text-3: #c3d4e3;
|
|
216
|
+
--accent: #86c6ff;
|
|
217
|
+
--on-accent: #10283e;
|
|
218
|
+
--border-strong: #849caf;
|
|
219
|
+
--accent-fill: #86c6ff;
|
|
220
|
+
--focus: #86c6ff;
|
|
221
|
+
--code-bg: #101e2b;
|
|
222
|
+
--code-head: #243543;
|
|
223
|
+
--inline-code: #314553;
|
|
224
|
+
--border: #314553;
|
|
225
|
+
--accent-dim: color-mix(in srgb, #86c6ff 14%, transparent);
|
|
226
|
+
}
|
|
227
|
+
@media (prefers-color-scheme: light) {
|
|
228
|
+
:root[data-palette="sky"]:not([data-theme="dark"]) {
|
|
229
|
+
--bg: #f7fbff;
|
|
230
|
+
--bg-sidebar: #f4faff;
|
|
231
|
+
--surface: #eff6fc;
|
|
232
|
+
--surface-2: #ddebf7;
|
|
233
|
+
--user-bubble: #d9ebfa;
|
|
234
|
+
--text: #10283e;
|
|
235
|
+
--text-2: #354e63;
|
|
236
|
+
--text-3: #435e73;
|
|
237
|
+
--accent: #095da8;
|
|
238
|
+
--on-accent: #ffffff;
|
|
239
|
+
--border-strong: #718596;
|
|
240
|
+
--accent-fill: #095da8;
|
|
241
|
+
--focus: #095da8;
|
|
242
|
+
--code-bg: #eaf3fb;
|
|
243
|
+
--code-head: #eff6fc;
|
|
244
|
+
--inline-code: #ddebf7;
|
|
245
|
+
--border: #ddebf7;
|
|
246
|
+
--accent-dim: color-mix(in srgb, #095da8 8%, transparent);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
:root[data-palette="sky"][data-theme="light"], .theme-swatch[data-palette="sky"][data-tone="light"] {
|
|
250
|
+
--bg: #f7fbff;
|
|
251
|
+
--bg-sidebar: #f4faff;
|
|
252
|
+
--surface: #eff6fc;
|
|
253
|
+
--surface-2: #ddebf7;
|
|
254
|
+
--user-bubble: #d9ebfa;
|
|
255
|
+
--text: #10283e;
|
|
256
|
+
--text-2: #354e63;
|
|
257
|
+
--text-3: #435e73;
|
|
258
|
+
--accent: #095da8;
|
|
259
|
+
--on-accent: #ffffff;
|
|
260
|
+
--border-strong: #718596;
|
|
261
|
+
--accent-fill: #095da8;
|
|
262
|
+
--focus: #095da8;
|
|
263
|
+
--code-bg: #eaf3fb;
|
|
264
|
+
--code-head: #eff6fc;
|
|
265
|
+
--inline-code: #ddebf7;
|
|
266
|
+
--border: #ddebf7;
|
|
267
|
+
--accent-dim: color-mix(in srgb, #095da8 8%, transparent);
|
|
268
|
+
}
|
|
269
|
+
:root[data-palette="meadow"], .theme-swatch[data-palette="meadow"][data-tone="dark"] {
|
|
270
|
+
--bg: #1f2215;
|
|
271
|
+
--bg-sidebar: #171a10;
|
|
272
|
+
--surface: #272b1c;
|
|
273
|
+
--surface-2: #343a25;
|
|
274
|
+
--user-bubble: #354329;
|
|
275
|
+
--text: #f5f6e5;
|
|
276
|
+
--text-2: #dfe5ca;
|
|
277
|
+
--text-3: #cfd7b6;
|
|
278
|
+
--accent: #85cf7d;
|
|
279
|
+
--on-accent: #ffffff;
|
|
280
|
+
--border-strong: #97a279;
|
|
281
|
+
--accent-fill: #317531;
|
|
282
|
+
--focus: #85cf7d;
|
|
283
|
+
--code-bg: #171a10;
|
|
284
|
+
--code-head: #272b1c;
|
|
285
|
+
--inline-code: #343a25;
|
|
286
|
+
--border: #343a25;
|
|
287
|
+
--accent-dim: color-mix(in srgb, #4fae4e 14%, transparent);
|
|
288
|
+
--palette-chat-bg: #30351f;
|
|
289
|
+
--palette-chat-text-2: #e1e7ce;
|
|
290
|
+
--palette-chat-text-3: #d1dabb;
|
|
291
|
+
--accent-decoration: #4fae4e;
|
|
292
|
+
--meadow-wallpaper-start: #343a22;
|
|
293
|
+
--meadow-wallpaper-end: #2b301d;
|
|
294
|
+
--meadow-wallpaper-tile: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20192%20192%22%3E%3Cg%20opacity%3D%22.035%22%20fill%3D%22none%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M27%2062C13%2048%2017%2029%2032%2022C39%2039%2037%2053%2027%2062ZM27%2062L31%2031M114%2048C109%2033%20120%2022%20135%2024C134%2039%20126%2049%20114%2048ZM114%2048L128%2029M73%20138C56%20135%2050%20121%2056%20108C73%20113%2080%20125%2073%20138ZM73%20138L59%20116M139%20160Q137%20143%20129%20136M139%20160Q144%20139%20154%20131M139%20160L141%20137%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
|
295
|
+
}
|
|
296
|
+
@media (prefers-color-scheme: light) {
|
|
297
|
+
:root[data-palette="meadow"]:not([data-theme="dark"]) {
|
|
298
|
+
--bg: #ffffff;
|
|
299
|
+
--bg-sidebar: #ffffff;
|
|
300
|
+
--surface: #ffffff;
|
|
301
|
+
--surface-2: #f4f4f5;
|
|
302
|
+
--user-bubble: #eef6e8;
|
|
303
|
+
--text: #212121;
|
|
304
|
+
--text-2: #60666a;
|
|
305
|
+
--text-3: #62686c;
|
|
306
|
+
--accent: #235d23;
|
|
307
|
+
--on-accent: #ffffff;
|
|
308
|
+
--border-strong: #7a7f73;
|
|
309
|
+
--accent-fill: #317531;
|
|
310
|
+
--focus: #235d23;
|
|
311
|
+
--code-bg: #f4f4f5;
|
|
312
|
+
--code-head: #f4f4f5;
|
|
313
|
+
--inline-code: #f4f4f5;
|
|
314
|
+
--border: #e0e0e0;
|
|
315
|
+
--accent-dim: color-mix(in srgb, #4fae4e 8%, transparent);
|
|
316
|
+
--palette-chat-bg: #c4cf93;
|
|
317
|
+
--palette-chat-text-2: #424833;
|
|
318
|
+
--palette-chat-text-3: #4b513c;
|
|
319
|
+
--accent-decoration: #4fae4e;
|
|
320
|
+
--meadow-wallpaper-start: #c4cf93;
|
|
321
|
+
--meadow-wallpaper-end: #cdd69e;
|
|
322
|
+
--meadow-wallpaper-tile: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20192%20192%22%3E%3Cg%20opacity%3D%22.02%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M27%2062C13%2048%2017%2029%2032%2022C39%2039%2037%2053%2027%2062ZM27%2062L31%2031M114%2048C109%2033%20120%2022%20135%2024C134%2039%20126%2049%20114%2048ZM114%2048L128%2029M73%20138C56%20135%2050%20121%2056%20108C73%20113%2080%20125%2073%20138ZM73%20138L59%20116M139%20160Q137%20143%20129%20136M139%20160Q144%20139%20154%20131M139%20160L141%20137%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
:root[data-palette="meadow"][data-theme="light"], .theme-swatch[data-palette="meadow"][data-tone="light"] {
|
|
326
|
+
--bg: #ffffff;
|
|
327
|
+
--bg-sidebar: #ffffff;
|
|
328
|
+
--surface: #ffffff;
|
|
329
|
+
--surface-2: #f4f4f5;
|
|
330
|
+
--user-bubble: #eef6e8;
|
|
331
|
+
--text: #212121;
|
|
332
|
+
--text-2: #60666a;
|
|
333
|
+
--text-3: #62686c;
|
|
334
|
+
--accent: #235d23;
|
|
335
|
+
--on-accent: #ffffff;
|
|
336
|
+
--border-strong: #7a7f73;
|
|
337
|
+
--accent-fill: #317531;
|
|
338
|
+
--focus: #235d23;
|
|
339
|
+
--code-bg: #f4f4f5;
|
|
340
|
+
--code-head: #f4f4f5;
|
|
341
|
+
--inline-code: #f4f4f5;
|
|
342
|
+
--border: #e0e0e0;
|
|
343
|
+
--accent-dim: color-mix(in srgb, #4fae4e 8%, transparent);
|
|
344
|
+
--palette-chat-bg: #c4cf93;
|
|
345
|
+
--palette-chat-text-2: #424833;
|
|
346
|
+
--palette-chat-text-3: #4b513c;
|
|
347
|
+
--accent-decoration: #4fae4e;
|
|
348
|
+
--meadow-wallpaper-start: #c4cf93;
|
|
349
|
+
--meadow-wallpaper-end: #cdd69e;
|
|
350
|
+
--meadow-wallpaper-tile: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20192%20192%22%3E%3Cg%20opacity%3D%22.02%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M27%2062C13%2048%2017%2029%2032%2022C39%2039%2037%2053%2027%2062ZM27%2062L31%2031M114%2048C109%2033%20120%2022%20135%2024C134%2039%20126%2049%20114%2048ZM114%2048L128%2029M73%20138C56%20135%2050%20121%2056%20108C73%20113%2080%20125%2073%20138ZM73%20138L59%20116M139%20160Q137%20143%20129%20136M139%20160Q144%20139%20154%20131M139%20160L141%20137%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
|
351
|
+
}
|
|
352
|
+
:root[data-palette="violet"], .theme-swatch[data-palette="violet"][data-tone="dark"] {
|
|
353
|
+
--bg: #211e32;
|
|
354
|
+
--bg-sidebar: #181626;
|
|
355
|
+
--surface: #302b45;
|
|
356
|
+
--surface-2: #403953;
|
|
357
|
+
--user-bubble: #3b3253;
|
|
358
|
+
--text: #f2effc;
|
|
359
|
+
--text-2: #e0d9f2;
|
|
360
|
+
--text-3: #d0c6e6;
|
|
361
|
+
--accent: #c4aaff;
|
|
362
|
+
--on-accent: #27213e;
|
|
363
|
+
--border-strong: #9b8cb2;
|
|
364
|
+
--accent-fill: #c4aaff;
|
|
365
|
+
--focus: #c4aaff;
|
|
366
|
+
--code-bg: #181626;
|
|
367
|
+
--code-head: #302b45;
|
|
368
|
+
--inline-code: #403953;
|
|
369
|
+
--border: #403953;
|
|
370
|
+
--accent-dim: color-mix(in srgb, #c4aaff 14%, transparent);
|
|
371
|
+
}
|
|
372
|
+
@media (prefers-color-scheme: light) {
|
|
373
|
+
:root[data-palette="violet"]:not([data-theme="dark"]) {
|
|
374
|
+
--bg: #faf8ff;
|
|
375
|
+
--bg-sidebar: #faf8ff;
|
|
376
|
+
--surface: #f5f2fc;
|
|
377
|
+
--surface-2: #e6dff4;
|
|
378
|
+
--user-bubble: #e4dbf7;
|
|
379
|
+
--text: #27213e;
|
|
380
|
+
--text-2: #514662;
|
|
381
|
+
--text-3: #635772;
|
|
382
|
+
--accent: #6847a5;
|
|
383
|
+
--on-accent: #ffffff;
|
|
384
|
+
--border-strong: #89799b;
|
|
385
|
+
--accent-fill: #6847a5;
|
|
386
|
+
--focus: #6847a5;
|
|
387
|
+
--code-bg: #f4f1fd;
|
|
388
|
+
--code-head: #f5f2fc;
|
|
389
|
+
--inline-code: #e6dff4;
|
|
390
|
+
--border: #e6dff4;
|
|
391
|
+
--accent-dim: color-mix(in srgb, #6847a5 8%, transparent);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
:root[data-palette="violet"][data-theme="light"], .theme-swatch[data-palette="violet"][data-tone="light"] {
|
|
395
|
+
--bg: #faf8ff;
|
|
396
|
+
--bg-sidebar: #faf8ff;
|
|
397
|
+
--surface: #f5f2fc;
|
|
398
|
+
--surface-2: #e6dff4;
|
|
399
|
+
--user-bubble: #e4dbf7;
|
|
400
|
+
--text: #27213e;
|
|
401
|
+
--text-2: #514662;
|
|
402
|
+
--text-3: #635772;
|
|
403
|
+
--accent: #6847a5;
|
|
404
|
+
--on-accent: #ffffff;
|
|
405
|
+
--border-strong: #89799b;
|
|
406
|
+
--accent-fill: #6847a5;
|
|
407
|
+
--focus: #6847a5;
|
|
408
|
+
--code-bg: #f4f1fd;
|
|
409
|
+
--code-head: #f5f2fc;
|
|
410
|
+
--inline-code: #e6dff4;
|
|
411
|
+
--border: #e6dff4;
|
|
412
|
+
--accent-dim: color-mix(in srgb, #6847a5 8%, transparent);
|
|
413
|
+
}
|
|
414
|
+
:root[data-palette="mint"], .theme-swatch[data-palette="mint"][data-tone="dark"] {
|
|
415
|
+
--bg: #172723;
|
|
416
|
+
--bg-sidebar: #11221f;
|
|
417
|
+
--surface: #293b35;
|
|
418
|
+
--surface-2: #354d44;
|
|
419
|
+
--user-bubble: #315047;
|
|
420
|
+
--text: #edf8f1;
|
|
421
|
+
--text-2: #d9ebe0;
|
|
422
|
+
--text-3: #c4dcd0;
|
|
423
|
+
--accent: #81d6bd;
|
|
424
|
+
--on-accent: #14382d;
|
|
425
|
+
--border-strong: #8b9f93;
|
|
426
|
+
--accent-fill: #81d6bd;
|
|
427
|
+
--focus: #81d6bd;
|
|
428
|
+
--code-bg: #11221f;
|
|
429
|
+
--code-head: #293b35;
|
|
430
|
+
--inline-code: #354d44;
|
|
431
|
+
--border: #354d44;
|
|
432
|
+
--accent-dim: color-mix(in srgb, #81d6bd 14%, transparent);
|
|
433
|
+
}
|
|
434
|
+
@media (prefers-color-scheme: light) {
|
|
435
|
+
:root[data-palette="mint"]:not([data-theme="dark"]) {
|
|
436
|
+
--bg: #fffaf2;
|
|
437
|
+
--bg-sidebar: #f5fbf7;
|
|
438
|
+
--surface: #f6f5ed;
|
|
439
|
+
--surface-2: #e5eee6;
|
|
440
|
+
--user-bubble: #d9eee4;
|
|
441
|
+
--text: #17352e;
|
|
442
|
+
--text-2: #3a554c;
|
|
443
|
+
--text-3: #4b6258;
|
|
444
|
+
--accent: #17695c;
|
|
445
|
+
--on-accent: #ffffff;
|
|
446
|
+
--border-strong: #748b80;
|
|
447
|
+
--accent-fill: #17695c;
|
|
448
|
+
--focus: #17695c;
|
|
449
|
+
--code-bg: #f1f5ee;
|
|
450
|
+
--code-head: #f6f5ed;
|
|
451
|
+
--inline-code: #e5eee6;
|
|
452
|
+
--border: #e5eee6;
|
|
453
|
+
--accent-dim: color-mix(in srgb, #17695c 8%, transparent);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
:root[data-palette="mint"][data-theme="light"], .theme-swatch[data-palette="mint"][data-tone="light"] {
|
|
457
|
+
--bg: #fffaf2;
|
|
458
|
+
--bg-sidebar: #f5fbf7;
|
|
459
|
+
--surface: #f6f5ed;
|
|
460
|
+
--surface-2: #e5eee6;
|
|
461
|
+
--user-bubble: #d9eee4;
|
|
462
|
+
--text: #17352e;
|
|
463
|
+
--text-2: #3a554c;
|
|
464
|
+
--text-3: #4b6258;
|
|
465
|
+
--accent: #17695c;
|
|
466
|
+
--on-accent: #ffffff;
|
|
467
|
+
--border-strong: #748b80;
|
|
468
|
+
--accent-fill: #17695c;
|
|
469
|
+
--focus: #17695c;
|
|
470
|
+
--code-bg: #f1f5ee;
|
|
471
|
+
--code-head: #f6f5ed;
|
|
472
|
+
--inline-code: #e5eee6;
|
|
473
|
+
--border: #e5eee6;
|
|
474
|
+
--accent-dim: color-mix(in srgb, #17695c 8%, transparent);
|
|
475
|
+
}
|
|
476
|
+
.theme-swatch[data-palette=""][data-tone="light"] { --bg: #ffffff; --bg-sidebar: #f9f9f9; --user-bubble: #f4f4f4; --accent-fill: #0d0d0d; }
|
|
477
|
+
.theme-swatch[data-palette=""][data-tone="dark"] { --bg: #212121; --bg-sidebar: #171717; --user-bubble: #2f2f2f; --accent-fill: #ececec; }
|
|
@@ -14,9 +14,11 @@ let seq = 0;
|
|
|
14
14
|
* Ask. Resolves true for the confirm button, false for Cancel, Esc, the backdrop or ×.
|
|
15
15
|
* `message` may hold blank lines (paragraphs); it is shown as text.
|
|
16
16
|
*/
|
|
17
|
-
export function confirmDialog({ title, message, confirmLabel, danger = false } = {}) {
|
|
17
|
+
export function confirmDialog({ title, message, confirmLabel, danger = false, more = null } = {}) {
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
|
-
|
|
19
|
+
// M-3387: `more` { label, lines } — a list closed under the text until opened (e.g. every tool name a switch stops).
|
|
20
|
+
const extra = more && more.label && Array.isArray(more.lines) && more.lines.length ? { label: String(more.label), lines: more.lines.map(String) } : null;
|
|
21
|
+
const item = { id: ++seq, title: title || t("app.confirmTitle"), message: String(message || ""), confirmLabel: confirmLabel || t("app.confirmOk"), danger, more: extra, resolve };
|
|
20
22
|
confirmStore.set((s) => ({ queue: [...s.queue, item] }));
|
|
21
23
|
});
|
|
22
24
|
}
|
|
@@ -39,5 +41,6 @@ export function ConfirmHost() {
|
|
|
39
41
|
actions=${html`<button type="button" class="btn" onClick=${() => answerConfirm(q.id, false)}>${t("app.cancel")}</button>
|
|
40
42
|
<button type="button" class=${`btn ${q.danger ? "btn-danger" : "btn-primary"}`} data-confirm="yes" onClick=${() => answerConfirm(q.id, true)}>${q.confirmLabel}</button>`}>
|
|
41
43
|
${paragraphs.map((p, i) => html`<p key=${i} class="confirm-text">${p}</p>`)}
|
|
44
|
+
${q.more ? html`<details class="confirm-more"><summary>${q.more.label}</summary><ul>${q.more.lines.map((l, i) => html`<li key=${i} class="mono">${l}</li>`)}</ul></details>` : null}
|
|
42
45
|
</${Dialog}>`;
|
|
43
46
|
}
|
|
@@ -10,6 +10,7 @@ import { readStream } from "./read-stream.js";
|
|
|
10
10
|
import { Dialog } from "./ui-dialog.js";
|
|
11
11
|
import { ErrorState, Skeleton } from "./ui-states.js";
|
|
12
12
|
import { Icon } from "./ui-icons.js";
|
|
13
|
+
import { InfoTip } from "./info-tip.js";
|
|
13
14
|
import "./view-strings.js";
|
|
14
15
|
import { CompactMeter, level, resetClock, resetText, tn, usageClock, usageDuration, usageText, windowTag } from "./usage-meter.js";
|
|
15
16
|
// What this file exported before the meter moved out of it (#3321), for what imports it from here.
|
|
@@ -203,43 +204,17 @@ function rowNote(p) {
|
|
|
203
204
|
}
|
|
204
205
|
/**
|
|
205
206
|
* M-3248 (the user): a login no agent uses said 「此帳號目前沒有 Agent」 as a line of text beside its name. It is a quiet ⓘ
|
|
206
|
-
* there now (the muted text colour, never a warning's)
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* shows them without opening the row. In the full card it is a button, reached with Tab.
|
|
207
|
+
* there now (the muted text colour, never a warning's). In the full card it is the shared info icon (info-tip.js: its words
|
|
208
|
+
* on a hover, a focus or a tap, in a bubble fixed to the window, so the group's rounded clip never cuts it). In a compact
|
|
209
|
+
* row (itself a button that opens the login's card) the mark is only drawn and its words are part of the row's name — the
|
|
210
|
+
* row reads "wii, No agents on this profile" — and a tap opens the card, where the ⓘ is (M-3443: no hover-only mark).
|
|
211
211
|
*/
|
|
212
212
|
function NoAgentsMark({ inRow = false }) {
|
|
213
213
|
const words = tn("usage.no_agents");
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const r = mark.current && mark.current.getBoundingClientRect ? mark.current.getBoundingClientRect() : null;
|
|
219
|
-
const w = window.innerWidth || 0, hgt = window.innerHeight || 0;
|
|
220
|
-
if (!r || !w) { setAt({ x: 8, y: 8, above: false }); return; }
|
|
221
|
-
const above = r.bottom + 72 > hgt;
|
|
222
|
-
// Pushed sideways to stay inside the window (a custom property: the page allows no style attribute).
|
|
223
|
-
setAt({ x: Math.round(Math.max(8, Math.min(r.left - 8, w - Math.min(260, w - 16) - 8))), y: Math.round(above ? hgt - r.top + 6 : r.bottom + 6), above });
|
|
224
|
-
};
|
|
225
|
-
const hide = () => { setAt(null); setPinned(false); };
|
|
226
|
-
useLayoutEffect(() => {
|
|
227
|
-
const b = bubble.current;
|
|
228
|
-
if (b && b.style && at) { b.style.setProperty("--tip-x", `${at.x}px`); b.style.setProperty("--tip-y", `${at.y}px`); }
|
|
229
|
-
}, [at]);
|
|
230
|
-
useEffect(() => {
|
|
231
|
-
if (!at) return undefined;
|
|
232
|
-
const esc = (e) => { if (e.key === "Escape") { e.stopPropagation(); hide(); } };
|
|
233
|
-
const away = (e) => { if (mark.current && !mark.current.contains(e.target)) hide(); };
|
|
234
|
-
document.addEventListener("keydown", esc, true); document.addEventListener("click", away); window.addEventListener("scroll", hide, true);
|
|
235
|
-
return () => { document.removeEventListener("keydown", esc, true); document.removeEventListener("click", away); window.removeEventListener("scroll", hide, true); };
|
|
236
|
-
}, [!!at]);
|
|
237
|
-
const tap = (e) => { e.stopPropagation(); e.preventDefault(); if (pinned) hide(); else { show(); setPinned(true); } };
|
|
238
|
-
const leave = () => { if (!pinned) hide(); };
|
|
239
|
-
const tip = at ? html`<span ref=${bubble} class=${`s-tipbody u-na-tip${at.above ? " above" : ""}`} aria-hidden="true">${words}</span>` : null;
|
|
240
|
-
return inRow
|
|
241
|
-
? html`<span ref=${mark} class="u-na" role="img" aria-label=${words} onMouseEnter=${show} onMouseLeave=${leave} onClick=${tap}><${Icon} name="info" size=${14} />${tip}</span>`
|
|
242
|
-
: html`<button ref=${mark} type="button" class="u-na" aria-label=${words} onMouseEnter=${show} onMouseLeave=${leave} onFocus=${show} onBlur=${hide} onClick=${tap}><${Icon} name="info" size=${14} />${tip}</button>`;
|
|
214
|
+
// M-3443: the full card's ⓘ is the shared info icon (a button: hover, focus, tap). A compact row is itself a button that
|
|
215
|
+
// opens that card, so there it is no second control: the words are in the row's name (read with it), the mark only drawn.
|
|
216
|
+
if (inRow) return html`<span class="u-na" aria-hidden="true"><${Icon} name="info" size=${14} /></span><span class="sr-only">${words}</span>`;
|
|
217
|
+
return html`<${InfoTip} text=${words} label=${words} cls="u-na-tip" />`;
|
|
243
218
|
}
|
|
244
219
|
/**
|
|
245
220
|
* A login in three short lines, under its provider's name (the user's pick, 2026-10-22): its name and plan; then its
|