dsh-tui-theme 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cordis.patch.yml +1 -1
- package/docs/screenshots/settings.png +0 -0
- package/lib/types/index.js +3 -3
- package/lib/types/settingsSection.js +12 -8
- package/lib/types/statusLine.d.ts +5 -3
- package/lib/types/statusLine.d.ts.map +1 -1
- package/lib/types/statusLine.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ dsh plugin --profile dsh-tui add -w /path/to/dsh-tui-theme
|
|
|
79
79
|
| `showGlyph` | `true` | 花符:开 = ✿ 开头,关 = 不显示 |
|
|
80
80
|
| `showClock` | `true` | 显示 HH:MM 时钟 |
|
|
81
81
|
| `showTurns` | `true` | 显示当前会话轮数(`N✦`,自本次启动起计) |
|
|
82
|
-
| `
|
|
82
|
+
| `statusScope` | `pink-only` | 状态行展示:`pink-only` 仅樱花粉主题 / `all-themes` 所有主题 |
|
|
83
83
|
|
|
84
84
|
三项装饰全关时状态行整体消失。另有仅 profile 层的开关(`cordis.patch.yml`,不出现在 /settings):`autoInstallThemes`、`statusEnabled`。
|
|
85
85
|
|
package/cordis.patch.yml
CHANGED
|
Binary file
|
package/lib/types/index.js
CHANGED
|
@@ -35,7 +35,7 @@ export const Config = z.object({
|
|
|
35
35
|
showGlyph: z.boolean().default(true),
|
|
36
36
|
showClock: z.boolean().default(true),
|
|
37
37
|
showTurns: z.boolean().default(true),
|
|
38
|
-
|
|
38
|
+
statusScope: z.union(['pink-only', 'all-themes']).default('pink-only'),
|
|
39
39
|
});
|
|
40
40
|
const DEFAULTS = {
|
|
41
41
|
autoInstallThemes: true,
|
|
@@ -44,7 +44,7 @@ const DEFAULTS = {
|
|
|
44
44
|
showGlyph: true,
|
|
45
45
|
showClock: true,
|
|
46
46
|
showTurns: true,
|
|
47
|
-
|
|
47
|
+
statusScope: 'pink-only',
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* Backstop delay for the cordis-layer follow decision on hosts without a
|
|
@@ -67,7 +67,7 @@ export function apply(ctx, config = {}) {
|
|
|
67
67
|
showGlyph: config.showGlyph ?? DEFAULTS.showGlyph,
|
|
68
68
|
showClock: config.showClock ?? DEFAULTS.showClock,
|
|
69
69
|
showTurns: config.showTurns ?? DEFAULTS.showTurns,
|
|
70
|
-
|
|
70
|
+
statusScope: config.statusScope ?? DEFAULTS.statusScope,
|
|
71
71
|
};
|
|
72
72
|
if (cordis.autoInstallThemes) {
|
|
73
73
|
const result = installBundledThemes();
|
|
@@ -35,7 +35,7 @@ export function registerPinkSettings(ctx, cordis, onDoc) {
|
|
|
35
35
|
showGlyph: z.boolean(),
|
|
36
36
|
showClock: z.boolean(),
|
|
37
37
|
showTurns: z.boolean(),
|
|
38
|
-
|
|
38
|
+
statusScope: z.union(['pink-only', 'all-themes']),
|
|
39
39
|
}));
|
|
40
40
|
const emit = (doc) => {
|
|
41
41
|
if (doc === null || typeof doc !== 'object')
|
|
@@ -112,15 +112,19 @@ function sectionDefinition(cordis) {
|
|
|
112
112
|
format: (value) => String(value ?? cordis.showTurns),
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
path: ['
|
|
116
|
-
label: '
|
|
117
|
-
descriptions: { zh: '
|
|
118
|
-
hint: 'The blossom line
|
|
115
|
+
path: ['statusScope'],
|
|
116
|
+
label: 'Status line display',
|
|
117
|
+
descriptions: { zh: '状态行展示' },
|
|
118
|
+
hint: 'The blossom line is exclusive to the pink palettes by default; all-themes keeps it visible under other themes.',
|
|
119
119
|
hintDescriptions: {
|
|
120
|
-
zh: '
|
|
120
|
+
zh: '状态行默认为樱花粉主题专属;所有主题时在其他主题下同样显示。',
|
|
121
121
|
},
|
|
122
|
-
kind: '
|
|
123
|
-
|
|
122
|
+
kind: 'select',
|
|
123
|
+
options: [
|
|
124
|
+
{ value: 'pink-only', label: 'Pink themes only', descriptions: { zh: '樱花粉主题' } },
|
|
125
|
+
{ value: 'all-themes', label: 'All themes', descriptions: { zh: '所有主题' } },
|
|
126
|
+
],
|
|
127
|
+
format: (value) => typeof value === 'string' ? value : (cordis.statusScope ?? 'pink-only'),
|
|
124
128
|
},
|
|
125
129
|
],
|
|
126
130
|
};
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* The line belongs to the pink palettes: by default it only renders while a
|
|
10
10
|
* pink theme is active (checked per render with the host's own theme
|
|
11
11
|
* precedence, so a mid-session /theme switch takes effect on the next tick);
|
|
12
|
-
* `
|
|
12
|
+
* `statusScope: 'all-themes'` opts it into every other theme too.
|
|
13
13
|
* @module dsh-tui-pink-theme/statusLine
|
|
14
14
|
*/
|
|
15
15
|
import type { Context } from '@deepseek-ai/cordis';
|
|
16
|
+
/** Which themes the blossom line renders under. */
|
|
17
|
+
export type StatusScope = 'pink-only' | 'all-themes';
|
|
16
18
|
export interface StatusOptions {
|
|
17
19
|
/** Master switch (cordis-config layer only; not surfaced in /settings). */
|
|
18
20
|
statusEnabled?: boolean;
|
|
@@ -22,8 +24,8 @@ export interface StatusOptions {
|
|
|
22
24
|
showClock?: boolean;
|
|
23
25
|
/** Include the live turn count of the current session. */
|
|
24
26
|
showTurns?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
+
/** Theme scope of the line (default: the pink palettes only). */
|
|
28
|
+
statusScope?: StatusScope;
|
|
27
29
|
}
|
|
28
30
|
/** Fully-resolved status knobs. */
|
|
29
31
|
export type EffectiveStatus = Required<StatusOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusLine.d.ts","sourceRoot":"","sources":["../../src/statusLine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,
|
|
1
|
+
{"version":3,"file":"statusLine.d.ts","sourceRoot":"","sources":["../../src/statusLine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,YAAY,CAAA;AAEpD,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iEAAiE;IACjE,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,mCAAmC;AACnC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;AAwCrD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,GAAG,IAAI,CA2DvF"}
|
package/lib/types/statusLine.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* The line belongs to the pink palettes: by default it only renders while a
|
|
10
10
|
* pink theme is active (checked per render with the host's own theme
|
|
11
11
|
* precedence, so a mid-session /theme switch takes effect on the next tick);
|
|
12
|
-
* `
|
|
12
|
+
* `statusScope: 'all-themes'` opts it into every other theme too.
|
|
13
13
|
* @module dsh-tui-pink-theme/statusLine
|
|
14
14
|
*/
|
|
15
15
|
import { join } from 'node:path';
|
|
@@ -68,7 +68,7 @@ export function startStatusLine(ctx, getEffective) {
|
|
|
68
68
|
// The line is pink garnish: off on other themes unless opted in.
|
|
69
69
|
// The theme check runs here (not once at startup) so a mid-session
|
|
70
70
|
// /theme switch lands on the next tick or session event.
|
|
71
|
-
const themeAllows = eff.
|
|
71
|
+
const themeAllows = eff.statusScope === 'all-themes' || isPinkThemeActive(dataDir);
|
|
72
72
|
if (eff.statusEnabled && themeAllows) {
|
|
73
73
|
if (eff.showGlyph)
|
|
74
74
|
parts.push(GLYPH);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-tui-theme",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Sakura-pink themes for dsh-TUI with terminal-background auto-follow (pink-day/pink-night), a blossom status line, and a /settings section. No shortcuts, no commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/types/index.js",
|