sideby 0.23.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.js +9 -6
- package/dist/src/cli/json-schemas.js +1 -0
- package/dist/src/cli/main.js +6 -5
- package/dist/src/core/ask.d.ts +10 -6
- package/dist/src/core/ask.js +47 -9
- package/dist/src/core/config.js +7 -1
- package/dist/src/core/themes.d.ts +2 -2
- package/dist/src/core/themes.js +10 -6
- package/dist/src/families/agy/index.js +4 -1
- package/dist/src/families/claude/index.js +4 -1
- package/dist/src/families/codex/index.js +8 -1
- package/dist/src/families/grok/index.js +4 -1
- package/dist/src/families/pi/index.js +4 -1
- package/dist/src/panel/handler.js +1 -1
- package/dist/src/panel/i18n.d.ts +0 -2
- package/dist/src/panel/i18n.js +0 -4
- package/dist/src/panel/page-logic.d.ts +11 -0
- package/dist/src/panel/page-logic.js +27 -2
- package/dist/src/panel/page-script.js +36 -10
- package/dist/src/panel/page-styles.js +35 -25
- package/dist/src/panel/page.js +6 -0
- package/dist/src/panel/theme.d.ts +3 -1
- package/dist/src/panel/theme.js +1 -0
- package/dist/src/panel/themes.d.ts +4 -2
- package/dist/src/panel/themes.js +378 -140
- package/dist/src/types.d.ts +7 -0
- package/package.json +2 -2
- package/schemas/config.json +1 -1
- package/schemas/try.json +4 -0
- package/skills/sideby/SKILL.md +2 -2
- package/skills/sideby/references/ai-tasks.md +1 -0
- package/skills/sideby/references/themes.md +6 -6
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { groupsToAccept } from '../core/inbound.js';
|
|
4
4
|
import { quotaIsStale } from '../core/quota-levels.js';
|
|
5
5
|
import { remoteControlTodo } from '../core/remote-control.js';
|
|
6
|
-
import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, remoteControlSummary, reorder, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
|
|
6
|
+
import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, remoteControlSummary, reorder, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
|
|
7
7
|
const LOGIC = [
|
|
8
8
|
quotaIsStale,
|
|
9
9
|
aiTaskAccounts,
|
|
@@ -40,6 +40,8 @@ const LOGIC = [
|
|
|
40
40
|
maskEmail,
|
|
41
41
|
matchesQuery,
|
|
42
42
|
menuPlacement,
|
|
43
|
+
radioStep,
|
|
44
|
+
dotsKeepKeyboard,
|
|
43
45
|
mergeDaily,
|
|
44
46
|
mergeUsage,
|
|
45
47
|
messageChip,
|
|
@@ -6747,14 +6749,14 @@ const MAIN = String.raw `
|
|
|
6747
6749
|
let themeFetching = false
|
|
6748
6750
|
// The Theme config names ('default' when none) and the one the page shows (inside a Portal, 'default' is its colors).
|
|
6749
6751
|
let themeChosen = (BOOT.panel && BOOT.panel.colorTheme) || 'default'
|
|
6750
|
-
let themeNow = themeChosen === 'default' ?
|
|
6752
|
+
let themeNow = themeChosen === 'default' ? BOOT.themes.default : themeChosen
|
|
6751
6753
|
function themeName(x) { return x.source === 'portal' ? t('th.page') : x.id === 'custom' && x.source === 'file' ? t('th.custom') : lang === 'zh' && x.nameZh ? x.nameZh : x.name }
|
|
6752
6754
|
function themeLabel() {
|
|
6753
6755
|
const x = th && th.data && th.data.themes.find((y) => y.id === themeNow)
|
|
6754
6756
|
if (x) return themeName(x)
|
|
6755
6757
|
if (themeNow === 'default') return t('th.page')
|
|
6756
|
-
const b =
|
|
6757
|
-
return b ? b[lang === 'zh' ?
|
|
6758
|
+
const b = BOOT.themes.names[themeNow]
|
|
6759
|
+
return b ? b[lang === 'zh' ? 'zh' : 'en'] : themeNow
|
|
6758
6760
|
}
|
|
6759
6761
|
function applyThemeCss(css) {
|
|
6760
6762
|
if (!css || typeof CSSStyleSheet !== 'function' || !('adoptedStyleSheets' in document)) { location.reload(); return }
|
|
@@ -6808,6 +6810,11 @@ const MAIN = String.raw `
|
|
|
6808
6810
|
}
|
|
6809
6811
|
function renderThemes() {
|
|
6810
6812
|
if (!th) return
|
|
6813
|
+
// Keyboard use of the dots ends once focus sits on another control (Tab to Remove, a field), so this render
|
|
6814
|
+
// leaves it there instead of pulling it back to the dot in use.
|
|
6815
|
+
const was = document.activeElement
|
|
6816
|
+
const at = !was || was === document.body || was === dlg.el ? 'none' : was.classList.contains('theme-dot') ? 'dot' : 'other'
|
|
6817
|
+
if (th.keyed && !dotsKeepKeyboard(at)) th.keyed = false
|
|
6811
6818
|
const d = th.data
|
|
6812
6819
|
const body = [h('p', { class: 'muted small' }, t('th.intro'))]
|
|
6813
6820
|
// What changed, with undo, sits in the footer beside Close, so the dialog never grows when it appears.
|
|
@@ -6817,15 +6824,29 @@ const MAIN = String.raw `
|
|
|
6817
6824
|
if (d) {
|
|
6818
6825
|
if (d.fallback) body.push(h('p', { class: 'note note-warn' }, d.fallback))
|
|
6819
6826
|
else if (d.adjusted) body.push(h('p', { class: 'note' }, t('th.adjusted', { n: d.adjusted })))
|
|
6820
|
-
|
|
6827
|
+
// One row of color dots, a radio group: the arrows move the choice (and switch the Theme), the dot in use has a
|
|
6828
|
+
// ring in its own color and a check; the name is in its tooltip.
|
|
6829
|
+
const now = d.themes.find((y) => y.id === d.active)
|
|
6830
|
+
const dots = h('div', { class: 'theme-dots', role: 'radiogroup', 'aria-labelledby': 'th-dots-head', onkeydown: (e) => {
|
|
6831
|
+
const all = [...dots.querySelectorAll('.theme-dot')]
|
|
6832
|
+
const next = radioStep(all.length, all.indexOf(document.activeElement), e.key)
|
|
6833
|
+
if (next < 0 || all[next].disabled) return
|
|
6834
|
+
e.preventDefault()
|
|
6835
|
+
th.keyed = true
|
|
6836
|
+
all[next].focus()
|
|
6837
|
+
all[next].click()
|
|
6838
|
+
} }, d.themes.filter((x) => x.source === 'builtin' || !x.problems.length).map((x) => {
|
|
6821
6839
|
const on = x.id === d.active
|
|
6822
|
-
return h('button', { class: 'theme-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6840
|
+
return h('button', { class: 'theme-dot', type: 'button', role: 'radio', 'aria-checked': String(on), tabindex: on ? '0' : '-1', 'aria-label': themeName(x), title: themeName(x), css: { '--dot': x.swatches[2] || x.swatches[0] }, disabled: th.busy || (BOOT.readOnly && !on), onclick: (e) => {
|
|
6841
|
+
// A pointer click (detail > 0) ends keyboard use; the arrows click with detail 0.
|
|
6842
|
+
if (e.detail > 0) th.keyed = false
|
|
6843
|
+
if (!on && !BOOT.readOnly) useThemeBy({ use: x.id })
|
|
6844
|
+
} })
|
|
6845
|
+
}))
|
|
6846
|
+
body.push(h('p', { class: 'theme-head', id: 'th-dots-head' }, t('th.title')), dots)
|
|
6826
6847
|
if (!BOOT.readOnly) {
|
|
6827
6848
|
const cur = d.themes.find((y) => y.id === d.active)
|
|
6828
|
-
const pick = h('input', { id: 'th-accent', type: 'color', value: th.accent || (cur && cur.swatches[2]) || '#3f8fc4', disabled: th.busy, 'aria-label': t('th.accent') })
|
|
6849
|
+
const pick = h('input', { id: 'th-accent', type: 'color', value: th.accent || (cur && cur.swatches[2]) || '#3f8fc4', disabled: th.busy, 'aria-label': t('th.accent') }) // design-system-ignore: a color input needs a hex start value when no Theme has one
|
|
6829
6850
|
pick.addEventListener('input', () => { th.accent = pick.value })
|
|
6830
6851
|
body.push(h('div', { class: 'theme-row' },
|
|
6831
6852
|
h('label', { class: 'theme-label', for: 'th-accent' }, t('th.accent')), pick,
|
|
@@ -6855,6 +6876,11 @@ const MAIN = String.raw `
|
|
|
6855
6876
|
}
|
|
6856
6877
|
if (th.error) body.push(errorNote(th.error, null))
|
|
6857
6878
|
setKids(dlg.el, dialogFrame(t('th.title'), null, body, [status, h('button', { class: 'btn', type: 'button', onclick: () => dlg.el.close() }, t('btn.close'))]))
|
|
6879
|
+
// A switch made with the arrows re-renders the dialog (more than once): keep the keyboard on the dot now in use.
|
|
6880
|
+
if (th.keyed && !th.busy) {
|
|
6881
|
+
const on = dlg.el.querySelector('.theme-dot[aria-checked="true"]')
|
|
6882
|
+
if (on) on.focus()
|
|
6883
|
+
}
|
|
6858
6884
|
}
|
|
6859
6885
|
|
|
6860
6886
|
// ---------- pick commands (spec §3.13, ADR-0035) ----------
|
|
@@ -12,24 +12,28 @@ const colorDecls = (tokens) => Object.entries(tokens)
|
|
|
12
12
|
// blue whatever the Theme (ADR-0050).
|
|
13
13
|
const DERIVED_COLORS = `
|
|
14
14
|
--btn-text: var(--text); --btn-hover-text: var(--accent); --check: var(--focus);
|
|
15
|
-
--logo-bg: var(--surface-2); --logo-fg: #3f8fc4; --logo-line: var(--border);
|
|
16
|
-
--focus-outline: 2px solid var(--focus); --focus-ring: none
|
|
15
|
+
--logo-bg: var(--surface-2); --logo-fg: #3f8fc4; /* design-system-ignore: the mark's body keeps the brand blue (ADR-0050) */ --logo-line: var(--border);
|
|
16
|
+
--focus-outline: 2px solid var(--focus); --focus-ring: none;
|
|
17
|
+
--scrim: color-mix(in srgb, var(--text) 40%, transparent);`;
|
|
18
|
+
// The usage chart (--spark) takes the main button's hue at a readable lightness, keeping its chroma: a black-and-white
|
|
19
|
+
// Theme gets a gray chart instead of a made-up color.
|
|
17
20
|
// Design tokens. A host theme (theme.ts) layers its values over these: light values after LIGHT_TOKENS, dark values after
|
|
18
21
|
// DARK_TOKENS. DARK_TOKENS sets every color token again, so a host's light colors never leak into dark mode, while
|
|
19
22
|
// type, shape and layout tokens are shared by both schemes.
|
|
20
23
|
const LIGHT_TOKENS = `
|
|
21
24
|
--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
22
25
|
--font-size: 14px; --small: 12.5px; --control-size: 13.5px; --heading-size: 15px; --large: 16px; --title-size: 22px;
|
|
23
|
-
--title-weight: 750; --heading-weight: 650; --strong-weight: 600; --button-weight: 600; --primary-weight:
|
|
24
|
-
--radius: 14px; --ctl-radius: 8px; --chip-radius: 999px; --ctl-h: 34px; --ctl-h-sm: 28px; --field-h: 36px;
|
|
26
|
+
--title-weight: 750; --heading-weight: 650; --strong-weight: 600; --button-weight: 600; --primary-weight: 500;
|
|
27
|
+
--radius: 14px; --ctl-radius: 8px; --primary-radius: 999px; --chip-radius: 999px; --ctl-h: 34px; --ctl-h-sm: 28px; --field-h: 36px;
|
|
25
28
|
--content-width: 1180px; --gutter: 24px;${DERIVED_COLORS}
|
|
26
|
-
--spark: oklch(from var(--
|
|
29
|
+
--spark: oklch(from var(--primary) clamp(0.55, l, 0.62) c h); --spark-soft: oklch(from var(--primary) 0.83 calc(c * 0.6) h);
|
|
27
30
|
${colorDecls(DEFAULT_THEME.light)};
|
|
28
|
-
--float-shadow: 0 10px 30px
|
|
31
|
+
--float-shadow: 0 10px 30px color-mix(in srgb, var(--text) 14%, transparent), 0 2px 6px color-mix(in srgb, var(--text) 6%, transparent);`;
|
|
29
32
|
const DARK_TOKENS = `${DERIVED_COLORS}
|
|
30
|
-
--
|
|
33
|
+
--scrim: rgba(0,0,0,.55); /* design-system-ignore: a dark page's dialog backdrop darkens it; the text color would wash it out */
|
|
34
|
+
--spark: oklch(from var(--primary) clamp(0.7, l, 0.78) c h); --spark-soft: oklch(from var(--primary) 0.45 calc(c * 0.6) h);
|
|
31
35
|
${colorDecls(DEFAULT_THEME.dark)};
|
|
32
|
-
--float-shadow: 0 12px 32px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);`;
|
|
36
|
+
--float-shadow: 0 12px 32px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);`; // design-system-ignore: a shadow on a dark page is black whatever the Theme
|
|
33
37
|
/**
|
|
34
38
|
* The page's style block: default tokens, the host's tokens over them, then the rules that read them. With
|
|
35
39
|
* `colorScheme: 'auto'` the page follows the system unless the viewer picked light or dark in the Panel, which sets
|
|
@@ -105,15 +109,17 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
105
109
|
.ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
106
110
|
|
|
107
111
|
/* Themes (spec §3.34): the cards in the Theme dialog, and the short fade while the page takes a new Theme. */
|
|
108
|
-
.theme-
|
|
109
|
-
.theme-
|
|
110
|
-
|
|
111
|
-
.theme-
|
|
112
|
-
.theme-
|
|
113
|
-
.theme-
|
|
114
|
-
.theme-
|
|
115
|
-
.theme-
|
|
116
|
-
.theme-
|
|
112
|
+
.theme-head { margin: 12px 0 8px; color: var(--muted); font-size: var(--small); }
|
|
113
|
+
.theme-head b { color: var(--text); font-weight: var(--strong-weight); }
|
|
114
|
+
/* Theme dots: a 28px dot per Theme; the hairline keeps a black or white dot visible on a page of the same color. */
|
|
115
|
+
.theme-dots { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; padding: 4px; }
|
|
116
|
+
.theme-dot { position: relative; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--dot); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); cursor: pointer; transition: transform .12s; }
|
|
117
|
+
.theme-dot:hover:not(:disabled) { transform: scale(1.08); }
|
|
118
|
+
.theme-dot[aria-checked=true] { outline: 2px solid var(--dot); outline-offset: 2px; cursor: default; }
|
|
119
|
+
.theme-dot[aria-checked=true]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; text-shadow: 0 0 2px rgba(0,0,0,.45); } /* design-system-ignore: the check sits on the dot's own color, white with a soft edge reads on every accent */
|
|
120
|
+
.theme-dot:disabled:not([aria-checked=true]) { opacity: .6; cursor: default; }
|
|
121
|
+
.theme-dot:focus-visible { outline: var(--focus-outline); outline-offset: 3px; }
|
|
122
|
+
.theme-dot[aria-checked=true]:focus-visible { outline: 2px solid var(--focus); }
|
|
117
123
|
.theme-status { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; min-width: 0; color: var(--muted); }
|
|
118
124
|
.theme-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
|
|
119
125
|
.theme-label { font-weight: var(--strong-weight); }
|
|
@@ -132,7 +138,7 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
132
138
|
.stat-text { min-width: 0; }
|
|
133
139
|
.stat-label { color: var(--muted); font-size: var(--small); display: flex; align-items: center; gap: 6px; }
|
|
134
140
|
.stat-value { font-size: 22px; font-weight: var(--heading-weight); letter-spacing: -0.02em; line-height: 1.35; white-space: nowrap; }
|
|
135
|
-
.stat-sub { color: var(--
|
|
141
|
+
.stat-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
136
142
|
.stat-btn { font: inherit; color: inherit; background: none; border: 0; border-left: 1px solid var(--border); cursor: pointer; transition: background-color .12s; }
|
|
137
143
|
.stat-btn:hover { background: var(--hover); }
|
|
138
144
|
.stat-btn[aria-pressed=true] { background: var(--warn-soft); }
|
|
@@ -145,7 +151,7 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
145
151
|
.search { position: relative; flex: 1 1 160px; min-width: 120px; display: block; }
|
|
146
152
|
.search-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
|
|
147
153
|
.search .search-input { padding-left: 34px; padding-right: 34px; height: var(--ctl-h); }
|
|
148
|
-
.kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px/16px var(--mono); color: var(--
|
|
154
|
+
.kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px/16px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; pointer-events: none; }
|
|
149
155
|
.search:focus-within .kbd, .search input:not(:placeholder-shown) ~ .kbd { display: none; }
|
|
150
156
|
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
151
157
|
.tb-select { width: auto; height: var(--ctl-h); font-size: var(--control-size); }
|
|
@@ -253,7 +259,7 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
253
259
|
.is-dragging { opacity: .45; }
|
|
254
260
|
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
|
|
255
261
|
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
|
|
256
|
-
.menu-head { padding: 6px 10px 2px; color: var(--
|
|
262
|
+
.menu-head { padding: 6px 10px 2px; color: var(--muted); font-size: 11px; font-weight: var(--strong-weight); }
|
|
257
263
|
/* The arrow at a row's start opens and closes its details; so does a click anywhere else in the row. */
|
|
258
264
|
.row-toggle { width: 28px; height: 28px; margin: -4px -6px -4px -8px; }
|
|
259
265
|
.fold-hit { cursor: pointer; }
|
|
@@ -426,7 +432,7 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
426
432
|
.rows .m-label, .rows .m-unit { display: none; }
|
|
427
433
|
|
|
428
434
|
/* Chips and badges */
|
|
429
|
-
.badge { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
|
|
435
|
+
.badge { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; } /* design-system-ignore: white initials on each Host's fixed logo color */
|
|
430
436
|
.badge-logo { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
|
|
431
437
|
.badge svg { display: block; width: 20px; height: 20px; fill: currentColor; }
|
|
432
438
|
.badge-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 10.5px; }
|
|
@@ -515,7 +521,7 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
515
521
|
a.btn:hover { text-decoration: none; }
|
|
516
522
|
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--btn-hover-border); color: var(--btn-hover-text); }
|
|
517
523
|
.btn:active:not(:disabled) { background: var(--active); }
|
|
518
|
-
.btn-primary { background: var(--primary); border-color: var(--primary-border); color: var(--on-primary); font-weight: var(--primary-weight); }
|
|
524
|
+
.btn-primary { background: var(--primary); border-color: var(--primary-border); color: var(--on-primary); font-weight: var(--primary-weight); border-radius: var(--primary-radius); }
|
|
519
525
|
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover-border); color: var(--on-primary); }
|
|
520
526
|
.btn-primary:active:not(:disabled) { background: var(--primary-active); border-color: var(--primary-hover-border); }
|
|
521
527
|
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
|
|
@@ -654,7 +660,7 @@ a.btn:hover { text-decoration: none; }
|
|
|
654
660
|
.tune-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
|
|
655
661
|
.tune-vals { display: flex; gap: 24px; }
|
|
656
662
|
.tune-num { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
657
|
-
.tune-best { color: var(--ok
|
|
663
|
+
.tune-best { color: var(--ok); }
|
|
658
664
|
.ah-fam { border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
|
|
659
665
|
.ah-fam-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
|
660
666
|
.ah-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
|
|
@@ -665,7 +671,7 @@ a.btn:hover { text-decoration: none; }
|
|
|
665
671
|
.disabled-why { color: var(--muted); font-size: var(--small); margin-top: 10px; }
|
|
666
672
|
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
667
673
|
/* A thin ring with an arc that fades out behind its head: lighter than a thick broken circle at text size. */
|
|
668
|
-
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 8%, color-mix(in srgb, currentColor 18%, transparent) 30%, currentColor); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.75px), #000 calc(100% - 1.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 1.75px), #000 calc(100% - 1.5px)); animation: spin .75s linear infinite; vertical-align: -2px; flex: none; }
|
|
674
|
+
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 8%, color-mix(in srgb, currentColor 18%, transparent) 30%, currentColor); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.75px), #000 calc(100% - 1.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 1.75px), #000 calc(100% - 1.5px)); animation: spin .75s linear infinite; vertical-align: -2px; flex: none; } /* design-system-ignore: #000 sets mask opacity, not a color */
|
|
669
675
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
670
676
|
.copy { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
|
|
671
677
|
.copy code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; overflow-x: auto; white-space: nowrap; color: var(--text); min-width: 0; }
|
|
@@ -784,7 +790,11 @@ select:is(:hover, :focus) { --chevron: var(--text); }
|
|
|
784
790
|
/* Dialog */
|
|
785
791
|
.dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); box-shadow: var(--float-shadow); }
|
|
786
792
|
.dialog[open] { display: flex; }
|
|
787
|
-
.dialog::backdrop { background:
|
|
793
|
+
.dialog::backdrop { background: var(--scrim); }
|
|
794
|
+
/* The dialog box takes focus when it opens (showModal) but is not a control: no ring around it. Any other focusable
|
|
795
|
+
element without its own rule gets the Theme's focus ring, never the browser's default blue. */
|
|
796
|
+
.dialog:focus, .dialog:focus-visible { outline: none; }
|
|
797
|
+
:where(:focus-visible) { outline: var(--focus-outline); outline-offset: 2px; }
|
|
788
798
|
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 4px; }
|
|
789
799
|
.dlg-head h2 { font-size: var(--large); }
|
|
790
800
|
.dlg-body { padding: 10px 18px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
|
package/dist/src/panel/page.js
CHANGED
|
@@ -11,6 +11,7 @@ import { widthTier } from './page-logic.js';
|
|
|
11
11
|
import { PAGE_SCRIPT } from './page-script.js';
|
|
12
12
|
import { pageStyles } from './page-styles.js';
|
|
13
13
|
import { resolveTheme } from './theme.js';
|
|
14
|
+
import { BUILTIN_THEMES, DEFAULT_THEME_ID } from './themes.js';
|
|
14
15
|
/** GitHub's mark, from Simple Icons (CC0 1.0, https://simpleicons.org); a trademark of GitHub that only names the site. */
|
|
15
16
|
const GITHUB_MARK = 'M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12';
|
|
16
17
|
/** Browsers keep a favicon past `no-cache`; a link that changes with the mark makes them fetch the new one. */
|
|
@@ -49,6 +50,11 @@ export function renderPage(opts) {
|
|
|
49
50
|
colorScheme: theme.colorScheme,
|
|
50
51
|
lang,
|
|
51
52
|
panel: opts.panel ?? {},
|
|
53
|
+
// Built-in Theme names and the default, for the Theme row in Settings before /api/themes answers.
|
|
54
|
+
themes: {
|
|
55
|
+
default: DEFAULT_THEME_ID,
|
|
56
|
+
names: Object.fromEntries(BUILTIN_THEMES.map((t) => [t.id, t.name])),
|
|
57
|
+
},
|
|
52
58
|
warn: QUOTA_WARN_PERCENT,
|
|
53
59
|
fail: QUOTA_FAIL_PERCENT,
|
|
54
60
|
usageDays: USAGE_DAYS,
|
|
@@ -21,7 +21,7 @@ export interface PanelThemeTokens {
|
|
|
21
21
|
/** Labels, emphasis and numbers. */
|
|
22
22
|
strongWeight?: string;
|
|
23
23
|
buttonWeight?: string;
|
|
24
|
-
/** Main action button
|
|
24
|
+
/** Main action button. */
|
|
25
25
|
primaryWeight?: string;
|
|
26
26
|
/** Page background. */
|
|
27
27
|
bg?: string;
|
|
@@ -81,6 +81,8 @@ export interface PanelThemeTokens {
|
|
|
81
81
|
/** Buttons and fields. */
|
|
82
82
|
controlRadius?: string;
|
|
83
83
|
chipRadius?: string;
|
|
84
|
+
/** Main action button; a pill by default (design system, 2026-10-25). */
|
|
85
|
+
primaryRadius?: string;
|
|
84
86
|
/** Button height; `controlHeightSmall` for buttons inside cards and banners. */
|
|
85
87
|
controlHeight?: string;
|
|
86
88
|
controlHeightSmall?: string;
|
package/dist/src/panel/theme.js
CHANGED
|
@@ -5,10 +5,12 @@ export interface BuiltinTheme {
|
|
|
5
5
|
en: string;
|
|
6
6
|
zh: string;
|
|
7
7
|
};
|
|
8
|
-
/** A few colors for the Theme's card in Settings: page,
|
|
8
|
+
/** A few colors for the Theme's card in Settings: page, accent tint, main button, dark page. */
|
|
9
9
|
swatches: readonly string[];
|
|
10
10
|
light: PanelThemeTokens;
|
|
11
11
|
dark: PanelThemeTokens;
|
|
12
12
|
}
|
|
13
|
-
export declare const DEFAULT_THEME_ID = "
|
|
13
|
+
export declare const DEFAULT_THEME_ID = "teal";
|
|
14
|
+
/** Built-in Themes that were renamed, and the Theme each became; config and Theme Files naming the old id still work. */
|
|
15
|
+
export declare const RENAMED_THEMES: Readonly<Record<string, string>>;
|
|
14
16
|
export declare const BUILTIN_THEMES: readonly BuiltinTheme[];
|