@lynn123411/dsh-native-plus 0.3.5 → 0.4.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 +49 -26
- package/lib/client.js +90 -138
- package/lib/client.js.map +3 -3
- package/lib/index.js +11 -9
- package/lib/index.js.map +2 -2
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# @lynn123411/dsh-native-plus
|
|
2
2
|
|
|
3
|
-
在 DSH
|
|
3
|
+
在 DSH 自带的蓝白黑之上,把对话正文的装饰整理得更像一本正经的书,并让侧边栏的工作区行显示「里面有会话在跑」。配色一个字不改。
|
|
4
4
|
|
|
5
5
|
## 概述
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
插件做两件事,都不碰颜色:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
- **正文装饰**:六级标题按宿主蓝阶从深到浅排;引用是一条蓝竖线加一层浅蓝底;表格表头填浅蓝、四角圆角;代码块一圈发丝边框、圆角比宿主小一档;分隔线两端淡出;列表标记换成等宽字体取链接蓝。
|
|
9
|
+
- **正文装饰**:六级标题按宿主蓝阶从深到浅排;引用是一条蓝竖线加一层浅蓝底,外框与表格同款;表格装进一张描边发丝线、带两层投影的圆角卡片,表头填浅蓝;代码块外框与表格同款、圆角比宿主小一档;分隔线两端淡出;列表标记换成等宽字体取链接蓝,无序列表的圆点加大一号;对话末尾的文件改动卡片也换成同一套卡片描边。
|
|
11
10
|
- **侧边栏运行标记**:某个工作区里有会话在跑(含子代理)时,该工作区行右端亮起一个 6px 的圆点,缓慢明暗呼吸;工作区折叠着也看得到,鼠标悬停到这一行、或打开这一行的菜单时让位给同一位置的操作条。
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
蓝阶、纸面、语法色全部读宿主自己的令牌,深浅两套主题自动跟随,没有第二份深色表要维护。行高与段落间距沿用宿主原样,插件不为它们提供可调项;行内代码默认只把底色压深一点,描边与柔光默认关闭。
|
|
13
|
+
|
|
14
|
+
正文的每一项装饰都能单独开关;行内代码的开关打开后,再展开「加深灰色」与「描边样式」两个子项。
|
|
14
15
|
|
|
15
16
|
## 安装与开关
|
|
16
17
|
|
|
@@ -20,33 +21,47 @@ dsh plugin --profile web add @lynn123411/dsh-native-plus
|
|
|
20
21
|
|
|
21
22
|
这条命令把包名写进 profile 的 `dependencies` 与 `dsh.profile.bundles`,包内 `cordis.patch.yml` 随之插入一条 root loader entry(`id: dsh-native-plus`)。
|
|
22
23
|
|
|
23
|
-
开关就是这条 loader entry:在插件页或 `plugin_manager` 里把它关掉,样式表按 `data-plugin` 归属键整批删掉,`<html>`
|
|
24
|
+
开关就是这条 loader entry:在插件页或 `plugin_manager` 里把它关掉,样式表按 `data-plugin` 归属键整批删掉,`<html>` 上的属性一并撤掉,页面回到宿主原本的样子;重新打开时重新注入。行 id 同时是配置命名空间:宿主 `Config` 与浏览器 `ctx.configForms.get('dsh-native-plus')` 读写的是同一份值。
|
|
24
25
|
|
|
25
26
|
## 配置
|
|
26
27
|
|
|
27
28
|
配置界面在宿主「插件」页本插件的详情页上。
|
|
28
29
|
|
|
29
|
-
全部
|
|
30
|
+
全部 11 个字段写在 [src/client/schema.ts](./src/client/schema.ts) 里,宿主 schema 与配置卡片共用这些定义。
|
|
30
31
|
|
|
31
32
|
| 字段 | 范围 | 默认 | 说明 |
|
|
32
33
|
| --- | --- | --- | --- |
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
34
|
+
| 标题装饰 | 开 / 关 | 开 | 标题的蓝阶、字号档位与上下间距。 |
|
|
35
|
+
| 引用卡片 | 开 / 关 | 开 | 引用的底色、蓝竖线与卡片外框。 |
|
|
36
|
+
| 表格卡片 | 开 / 关 | 开 | 表格的卡片外框、表头浅蓝与单元格边距。 |
|
|
37
|
+
| 代码块 | 开 / 关 | 开 | 代码块外框、标题条与行号颜色。 |
|
|
38
|
+
| 列表标记 | 开 / 关 | 开 | 项目符号的字体、颜色与大小。 |
|
|
39
|
+
| 分隔线 | 开 / 关 | 开 | 分隔线的渐变与间距。 |
|
|
40
|
+
| 文件改动卡片 | 开 / 关 | 开 | 对话末尾「已编辑 N 个文件」那张卡片的外框描边。 |
|
|
41
|
+
| 行内代码 | 开 / 关 | 开 | 行内代码的总开关,打开后展开下面两项。 |
|
|
42
|
+
| 加深灰色 | 开 / 关 | 开 | 把行内代码的底色压深一点。 |
|
|
43
|
+
| 描边样式 | 开 / 关 | 关 | 行内代码的卡片描边与柔光。 |
|
|
36
44
|
| 工作区运行标记 | 开 / 关 | 开 | 控制工作区圆点与无障碍描述。 |
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
前六项与「行内代码」各自独立;「加深灰色」「描边样式」只在行内代码的父项打开时生效。旧配置缺少开关时沿用默认值。
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
投影写一组根属性:
|
|
41
49
|
|
|
42
50
|
| 名字 | 作用 |
|
|
43
51
|
| --- | --- |
|
|
44
|
-
| `data-native-plus` |
|
|
52
|
+
| `data-native-plus` | 插件生效标记 |
|
|
53
|
+
| `data-np-headings` | 标题装饰 |
|
|
54
|
+
| `data-np-quotes` | 引用卡片 |
|
|
55
|
+
| `data-np-tables` | 表格卡片 |
|
|
56
|
+
| `data-np-code` | 代码块 |
|
|
57
|
+
| `data-np-lists` | 列表标记 |
|
|
58
|
+
| `data-np-rules` | 分隔线 |
|
|
59
|
+
| `data-np-changed-files` | 文件改动卡片 |
|
|
60
|
+
| `data-np-inline-tint` | 行内代码:加深灰色(父子都打开时才有) |
|
|
61
|
+
| `data-np-inline-stroke` | 行内代码:描边样式(父子都打开时才有) |
|
|
45
62
|
| `data-np-activity` | 工作区运行标记开关 |
|
|
46
|
-
| `--np-line-height` | 正文行高倍数 |
|
|
47
|
-
| `--np-p-gap` | 段落间距 |
|
|
48
63
|
|
|
49
|
-
字段都标了 `.volatile()`:改它们不重挂这条 loader entry。投影订阅本插件那一行的配置表单,值变了只改 `<html>`
|
|
64
|
+
字段都标了 `.volatile()`:改它们不重挂这条 loader entry。投影订阅本插件那一行的配置表单,值变了只改 `<html>` 上的属性,样式表不重建。宿主没服务这份配置时卡片整块不出现。插件同时用 `ctx.settings.configure({ auto: false })` 关掉内核按 schema 自动生成的那份设置页,避免同一批字段在设置页上出现第二次。
|
|
50
65
|
|
|
51
66
|
## 实现
|
|
52
67
|
|
|
@@ -61,11 +76,13 @@ dsh plugin --profile web add @lynn123411/dsh-native-plus
|
|
|
61
76
|
|
|
62
77
|
样式表按「包名/文件名」拼归属键写在 `data-plugin` 与 `data-plugin-css` 上:热更时新内容覆盖旧标签,卸载时整批删。
|
|
63
78
|
|
|
64
|
-
###
|
|
79
|
+
### 正文装饰的作用范围
|
|
65
80
|
|
|
66
81
|
正文层只作用于助手回答的正文(`[data-chat-flow-kind='assistant-step']`):推理块用同一个 flow kind,但它带 `data-chat-group-part='reasoning'`,被排除在外——推理行要保持宿主的小字号与紧凑行距;工具行的 flow kind 是 `tool-call`,宿主本来就不在里面放 markdown 元素。
|
|
67
82
|
|
|
68
|
-
|
|
83
|
+
行高、段落间距与列表缩进全部沿用宿主,插件不再覆盖,也没有对应的可调项。行内代码默认只把底色压深一点;打开「描边样式」后,才把边框换成宿主 elevation 的发丝色并加两层极淡柔光。字体与字号始终是宿主的。标题的上下间距、字号档位与着色仍由本插件负责。
|
|
84
|
+
|
|
85
|
+
文件改动卡片不在正文层里,它挂在宿主自己的 `data-changed-files` 根上,只换外框:宿主的 0.5px 边框让位给 `--dsw-elevation-panel` 的描边与两层柔光,圆角、底色、内部排版都不动。
|
|
69
86
|
|
|
70
87
|
装饰全部用「宿主的数据属性 + 元素名」两层选择器:宿主正文的类名是 CSS Modules 的哈希串,换一次构建就变,不能当锚点。用到的锚点只有 `data-chat-flow-kind`、`data-chat-group-part`、`data-code-block-banner`、`data-line-numbers`、`data-row-key` 这类语义属性。
|
|
71
88
|
|
|
@@ -78,13 +95,18 @@ dsh plugin --profile web add @lynn123411/dsh-native-plus
|
|
|
78
95
|
| 标题 h1 | `--dsw-static-blue-800`(深色下 `-300`) |
|
|
79
96
|
| 标题 h6 | `--dsw-static-blue-600`(深色下 `-500`) |
|
|
80
97
|
| 标题 h2–h5 | 上面两端之间按 80% / 60% / 40% / 20% 插值 |
|
|
81
|
-
|
|
|
98
|
+
| 引用竖线、列表标记 | `--dsw-alias-link` |
|
|
82
99
|
| 引用底、表头底 | 由 `--dsw-alias-link` 与 `--dsw-alias-bg-base` 混出 |
|
|
100
|
+
| 行内代码底 | `--dsw-alias-markdown-inline-code` 混入 6% 黑 |
|
|
101
|
+
| 行内代码描边 | `--dsw-elevation-stroke-color` |
|
|
102
|
+
| 行内代码柔光 | 宿主黑色,浅色混 14% / 8%、深色 60% / 40% |
|
|
83
103
|
| 代码块底与标题条 | `--dsw-alias-markdown-code-block` / `-banner` |
|
|
84
104
|
| 语法高亮 | 宿主的 `--shiki-token-*`,插件一个字都不写 |
|
|
85
105
|
|
|
86
106
|
蓝阶端点随深浅模式切换,中间的四档在各自主题的两端色值之间等距插值。对比度自检读取目标宿主的标题蓝阶与正文背景,逐个主题核对两端是否达到 WCAG AA 的 4.5:1。
|
|
87
107
|
|
|
108
|
+
表格、引用、代码块三张卡片也不自己配色:圆角取内容块的 `--dsw-radius-md`(与图片同档),描边和两层柔光直接用宿主的 `--dsw-elevation-panel`,描边色随主题落在宿主的 `--dsw-alias-border-l4` / 深色 `-l3` 上。
|
|
109
|
+
|
|
88
110
|
蓝阶取饱和的 `--dsw-static-blue-*`,不取 `--dsw-static-deepseek-*`:后者最深的一档停在藏青(#283142),饱和度过低,浅色下看上去接近黑色。
|
|
89
111
|
|
|
90
112
|
### 侧边栏运行标记
|
|
@@ -103,15 +125,16 @@ dsh plugin --profile web add @lynn123411/dsh-native-plus
|
|
|
103
125
|
|
|
104
126
|
## 模型体验
|
|
105
127
|
|
|
106
|
-
|
|
128
|
+
不注册工具、不改系统提示、不往模型上下文里加任何东西:模型看到的一切与不装这个插件时相同,装与不装只差页面上的装饰。
|
|
107
129
|
|
|
108
130
|
## 限制
|
|
109
131
|
|
|
110
|
-
-
|
|
132
|
+
- 只改助手正文的装饰:推理块、工具行、侧边栏会话行与设置页都不受影响。
|
|
111
133
|
- 装饰依赖宿主那几个不带哈希的语义属性。宿主改名时样式不会报错,只会静默不生效——`scripts/test-anchors.mjs` 去宿主源码里逐个确认它们还在。
|
|
134
|
+
- 表格外框挂在宿主包住表格的那层 div 上(`:has(> table)`)。宿主不再给表格包这一层时,外框静默消失,表格退回原来的样子;`scripts/test-anchors.mjs` 会去宿主源码里确认这层结构还在。
|
|
112
135
|
- 侧边栏运行标记随宿主的会话状态服务和工作区列表挂载。
|
|
113
136
|
- 不提供配色开关:颜色全部来自宿主令牌,插件没有自己的色板可以调。
|
|
114
|
-
-
|
|
137
|
+
- 行高与段落间距沿用宿主原样;行内代码只改底色、描边与投影,字体与字号仍是宿主的。
|
|
115
138
|
|
|
116
139
|
## 验证
|
|
117
140
|
|
|
@@ -121,13 +144,13 @@ cd plugins/dsh-native-plus && pnpm check
|
|
|
121
144
|
|
|
122
145
|
`check` = `typecheck` + `build` + 五个自检 + `assert:lib-untracked`:
|
|
123
146
|
|
|
124
|
-
- `smoke-host.mjs`:真 cordis `Context` + 真 settings 服务的登记面,断言宿主半边只声明配置形状并登记 `auto: false`,且字段集与 `src/client/schema.ts` 的 `
|
|
125
|
-
- `test-projection.mjs
|
|
147
|
+
- `smoke-host.mjs`:真 cordis `Context` + 真 settings 服务的登记面,断言宿主半边只声明配置形状并登记 `auto: false`,且字段集与 `src/client/schema.ts` 的 `SWITCHES` 一一对上。
|
|
148
|
+
- `test-projection.mjs`:开关脏值的收拢(非布尔退回默认、关掉的值原样保留)、每个开关只影响自己的属性、行内代码父子项的约束、卸载后不留痕迹。
|
|
126
149
|
- `smoke-client.mjs`:按 Web shell 的方式装载 `lib/client.js`,验样式表归属键、投影落点、卡片注册进 `plugins.bundle.config` 且 key 是包名、主题通道一次都没被碰、运行标记按实时状态和完整归属落到正确的行上(同组并发、子代理、未分组、侧边栏挂载与重建、卸载),并带一条「未声明服务读取必须抛」的反例断言。
|
|
127
150
|
- `test-tokens.mjs` 读取包依赖提供的宿主题令牌,核对标题六档使用变量、两套主题的蓝阶端点均达到 4.5:1。验证另一份宿主源码时,把 `DSH_THEME_CSS` 指向它的 `packages/client/ui-theme/src/styles/design-platform.css`。
|
|
128
|
-
- `test-anchors.mjs
|
|
151
|
+
- `test-anchors.mjs`:宿主锚点仍存在、表格仍被一层 div 包住、没有哈希类名、文档里写死的数字与实际一致。
|
|
129
152
|
- `assert-lib-untracked.mjs`:`lib/` 是构建镜像,不入 git。
|
|
130
153
|
|
|
131
154
|
锚点自检要能找到宿主源码(`DSH_SOURCE` 或仓库同级的 `../github/deepseek-harness`),找不到时这一条跳过而不是失败。
|
|
132
155
|
|
|
133
|
-
|
|
156
|
+
浏览器里验收:打开任意会话,正文的标题应是蓝色、引用带蓝竖线、表格与代码块都是带发丝描边和投影的圆角卡片(引用同款)、无序列表圆点比宿主大一号;侧边栏找一个有会话在跑的工作区,行右端应有一个呼吸的圆点;把鼠标移到那一行,圆点让位给操作条。
|
package/lib/client.js
CHANGED
|
@@ -25,17 +25,15 @@ __export(index_exports, {
|
|
|
25
25
|
BUNDLE_CONFIG_SLOT: () => BUNDLE_CONFIG_SLOT,
|
|
26
26
|
BUNDLE_NAME: () => BUNDLE_NAME,
|
|
27
27
|
DEFAULT_SETTINGS: () => DEFAULT_SETTINGS,
|
|
28
|
-
FIELDS: () => FIELDS,
|
|
29
28
|
NS: () => NS,
|
|
30
29
|
NativePlusCard: () => NativePlusCard,
|
|
31
30
|
ROOT_ATTRIBUTE: () => ROOT_ATTRIBUTE,
|
|
32
|
-
ROOT_VARIABLES: () => ROOT_VARIABLES,
|
|
33
31
|
SETTINGS_NAMESPACE: () => SETTINGS_NAMESPACE,
|
|
32
|
+
SWITCHES: () => SWITCHES,
|
|
34
33
|
apply: () => apply,
|
|
35
34
|
applyActivity: () => applyActivity,
|
|
36
35
|
applyProjection: () => applyProjection,
|
|
37
36
|
bindProjection: () => bindProjection,
|
|
38
|
-
clampNumber: () => clampNumber,
|
|
39
37
|
clearProjection: () => clearProjection,
|
|
40
38
|
defaultConfig: () => defaultConfig,
|
|
41
39
|
inject: () => inject,
|
|
@@ -50,33 +48,28 @@ __export(index_exports, {
|
|
|
50
48
|
module.exports = __toCommonJS(index_exports);
|
|
51
49
|
|
|
52
50
|
// src/client/schema.ts
|
|
53
|
-
var
|
|
54
|
-
{ key: "lineHeight", label: "field.lineHeight", hint: "hint.lineHeight", min: 1.4, max: 2, step: 0.05, unit: "\xD7", default: 1.75 },
|
|
55
|
-
{ key: "paragraphGap", label: "field.paragraphGap", hint: "hint.paragraphGap", min: 4, max: 24, step: 1, unit: "px", default: 10 }
|
|
56
|
-
];
|
|
51
|
+
var INLINE_CODE_CHILDREN = ["inlineCodeTint", "inlineCodeStroke"];
|
|
57
52
|
var SWITCHES = [
|
|
58
|
-
{ key: "
|
|
59
|
-
{ key: "
|
|
53
|
+
{ key: "headings", label: "field.headings", default: true },
|
|
54
|
+
{ key: "quotes", label: "field.quotes", default: true },
|
|
55
|
+
{ key: "tables", label: "field.tables", default: true },
|
|
56
|
+
{ key: "codeBlocks", label: "field.codeBlocks", default: true },
|
|
57
|
+
{ key: "lists", label: "field.lists", default: true },
|
|
58
|
+
{ key: "rules", label: "field.rules", default: true },
|
|
59
|
+
{ key: "changedFiles", label: "field.changedFiles", default: true },
|
|
60
|
+
{ key: "inlineCode", label: "field.inlineCode", hint: "hint.inlineCode", default: true },
|
|
61
|
+
{ key: "inlineCodeTint", label: "field.inlineCodeTint", default: true },
|
|
62
|
+
{ key: "inlineCodeStroke", label: "field.inlineCodeStroke", default: false },
|
|
63
|
+
{ key: "workspaceActivity", label: "field.workspaceActivity", hint: "hint.workspaceActivity", default: true }
|
|
60
64
|
];
|
|
61
65
|
function defaultConfig() {
|
|
62
66
|
const out = {};
|
|
63
|
-
for (const field of FIELDS) out[field.key] = field.default;
|
|
64
67
|
for (const field of SWITCHES) out[field.key] = field.default;
|
|
65
68
|
return out;
|
|
66
69
|
}
|
|
67
|
-
function clampNumber(value, min, max, fallback) {
|
|
68
|
-
if (typeof value !== "number" && typeof value !== "string") return fallback;
|
|
69
|
-
if (typeof value === "string" && value.trim() === "") return fallback;
|
|
70
|
-
const parsed = typeof value === "number" ? value : Number(value);
|
|
71
|
-
if (!Number.isFinite(parsed)) return fallback;
|
|
72
|
-
return Math.min(max, Math.max(min, parsed));
|
|
73
|
-
}
|
|
74
70
|
function normalizeConfig(raw) {
|
|
75
71
|
const source = raw ?? {};
|
|
76
72
|
const out = {};
|
|
77
|
-
for (const field of FIELDS) {
|
|
78
|
-
out[field.key] = clampNumber(source[field.key], field.min, field.max, field.default);
|
|
79
|
-
}
|
|
80
73
|
for (const field of SWITCHES) {
|
|
81
74
|
out[field.key] = typeof source[field.key] === "boolean" ? source[field.key] : field.default;
|
|
82
75
|
}
|
|
@@ -86,34 +79,44 @@ function normalizeConfig(raw) {
|
|
|
86
79
|
// src/client/settings.ts
|
|
87
80
|
var ROOT_ATTRIBUTE = "data-native-plus";
|
|
88
81
|
var ACTIVITY_ROOT_ATTRIBUTE = "data-np-activity";
|
|
82
|
+
var INLINE_TINT_ATTRIBUTE = "data-np-inline-tint";
|
|
83
|
+
var INLINE_STROKE_ATTRIBUTE = "data-np-inline-stroke";
|
|
84
|
+
var FEATURE_ATTRIBUTES = {
|
|
85
|
+
headings: "data-np-headings",
|
|
86
|
+
quotes: "data-np-quotes",
|
|
87
|
+
tables: "data-np-tables",
|
|
88
|
+
codeBlocks: "data-np-code",
|
|
89
|
+
lists: "data-np-lists",
|
|
90
|
+
rules: "data-np-rules",
|
|
91
|
+
changedFiles: "data-np-changed-files"
|
|
92
|
+
};
|
|
93
|
+
var PROJECTED_ATTRIBUTES = [
|
|
94
|
+
ROOT_ATTRIBUTE,
|
|
95
|
+
...Object.values(FEATURE_ATTRIBUTES),
|
|
96
|
+
INLINE_TINT_ATTRIBUTE,
|
|
97
|
+
INLINE_STROKE_ATTRIBUTE,
|
|
98
|
+
ACTIVITY_ROOT_ATTRIBUTE
|
|
99
|
+
];
|
|
89
100
|
var DEFAULT_SETTINGS = Object.freeze(defaultConfig());
|
|
90
101
|
function normalizeSettings(raw) {
|
|
91
102
|
return normalizeConfig(raw);
|
|
92
103
|
}
|
|
93
|
-
var ROOT_VARIABLES = ["--np-line-height", "--np-p-gap"];
|
|
94
104
|
function projectSettings(settings, enabled = true) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
const attributes = {};
|
|
106
|
+
attributes[ROOT_ATTRIBUTE] = enabled ? "on" : null;
|
|
107
|
+
for (const [key, attribute] of Object.entries(FEATURE_ATTRIBUTES)) {
|
|
108
|
+
attributes[attribute] = enabled && settings[key] === true ? "on" : null;
|
|
99
109
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"--np-p-gap": `${Number(settings.paragraphGap)}px`
|
|
105
|
-
}
|
|
106
|
-
};
|
|
110
|
+
attributes[INLINE_TINT_ATTRIBUTE] = enabled && settings.inlineCode === true && settings.inlineCodeTint === true ? "on" : null;
|
|
111
|
+
attributes[INLINE_STROKE_ATTRIBUTE] = enabled && settings.inlineCode === true && settings.inlineCodeStroke === true ? "on" : null;
|
|
112
|
+
attributes[ACTIVITY_ROOT_ATTRIBUTE] = enabled && settings.workspaceActivity === true ? "on" : null;
|
|
113
|
+
return { attributes };
|
|
107
114
|
}
|
|
108
115
|
function applyProjection(root, projection) {
|
|
109
116
|
for (const [attribute, value] of Object.entries(projection.attributes)) {
|
|
110
117
|
if (value === null) root.removeAttribute(attribute);
|
|
111
118
|
else root.setAttribute(attribute, value);
|
|
112
119
|
}
|
|
113
|
-
for (const [property, value] of Object.entries(projection.variables)) {
|
|
114
|
-
if (value === null) root.style.removeProperty(property);
|
|
115
|
-
else root.style.setProperty(property, value);
|
|
116
|
-
}
|
|
117
120
|
}
|
|
118
121
|
function clearProjection(root) {
|
|
119
122
|
applyProjection(root, projectSettings(normalizeSettings(void 0), false));
|
|
@@ -151,15 +154,8 @@ var CARD_CSS = `
|
|
|
151
154
|
.dsh-np-row-title{font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}
|
|
152
155
|
.dsh-np-row-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
|
|
153
156
|
.dsh-np-row-field{flex:none;display:flex;align-items:center;gap:8px}
|
|
154
|
-
.dsh-np-
|
|
155
|
-
|
|
156
|
-
.dsh-np-slider{width:110px;height:32px;appearance:none;background:transparent;cursor:pointer;margin:0}
|
|
157
|
-
.dsh-np-slider::-webkit-slider-runnable-track{height:4px;border-radius:999px;corner-shape:round;
|
|
158
|
-
background:var(--dsw-alias-border-l3)}
|
|
159
|
-
.dsh-np-slider::-webkit-slider-thumb{appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:999px;
|
|
160
|
-
corner-shape:round;background:var(--dsw-alias-brand-primary);border:0 solid transparent}
|
|
161
|
-
.dsh-np-slider:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px;border-radius:999px}
|
|
162
|
-
.dsh-np-unit{font-size:12px;color:var(--dsw-alias-label-tertiary);flex:none;min-width:16px}
|
|
157
|
+
.dsh-np-subrows{display:flex;flex-direction:column;padding-inline-start:14px;margin-inline-start:3px;border-inline-start:1px solid var(--dsw-alias-border-l1)}
|
|
158
|
+
.dsh-np-subrows > .dsh-np-row{padding:6px 0}
|
|
163
159
|
.dsh-np-note{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);padding-top:8px}
|
|
164
160
|
.dsh-np-empty{font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary)}
|
|
165
161
|
`;
|
|
@@ -168,9 +164,8 @@ var CARD_CSS = `
|
|
|
168
164
|
var import_react = require("react");
|
|
169
165
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
170
166
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
167
|
+
var INLINE_CHILDREN = INLINE_CODE_CHILDREN.map((key) => SWITCHES.find((field) => field.key === key)).filter((field) => field !== void 0);
|
|
168
|
+
var TOP_LEVEL = SWITCHES.filter((field) => !INLINE_CODE_CHILDREN.includes(field.key));
|
|
174
169
|
function Row({ title, hint, children }) {
|
|
175
170
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-np-row", children: [
|
|
176
171
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-np-row-info", children: [
|
|
@@ -180,62 +175,6 @@ function Row({ title, hint, children }) {
|
|
|
180
175
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-np-row-field", children })
|
|
181
176
|
] });
|
|
182
177
|
}
|
|
183
|
-
function NumberControl({ field, value, onCommit }) {
|
|
184
|
-
const [text, setText] = (0, import_react.useState)(String(value));
|
|
185
|
-
(0, import_react.useEffect)(() => {
|
|
186
|
-
setText(String(value));
|
|
187
|
-
}, [value]);
|
|
188
|
-
const commit = () => {
|
|
189
|
-
const parsed = Number(text);
|
|
190
|
-
if (!Number.isFinite(parsed)) {
|
|
191
|
-
setText(String(value));
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
const clamped = Math.min(field.max, Math.max(field.min, Math.round(parsed / field.step) * field.step));
|
|
195
|
-
setText(String(clamped));
|
|
196
|
-
if (clamped !== value) onCommit(clamped);
|
|
197
|
-
};
|
|
198
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
200
|
-
"input",
|
|
201
|
-
{
|
|
202
|
-
type: "range",
|
|
203
|
-
className: "dsh-np-slider",
|
|
204
|
-
min: field.min,
|
|
205
|
-
max: field.max,
|
|
206
|
-
step: field.step,
|
|
207
|
-
value,
|
|
208
|
-
"aria-label": field.label,
|
|
209
|
-
onChange: (event) => {
|
|
210
|
-
onCommit(Number(event.currentTarget.value));
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
),
|
|
214
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
215
|
-
import_dsh_client_ui_primitives.Input,
|
|
216
|
-
{
|
|
217
|
-
className: "dsh-np-number",
|
|
218
|
-
type: "number",
|
|
219
|
-
inputMode: "decimal",
|
|
220
|
-
min: field.min,
|
|
221
|
-
max: field.max,
|
|
222
|
-
step: field.step,
|
|
223
|
-
value: text,
|
|
224
|
-
"aria-label": field.label,
|
|
225
|
-
onChange: (event) => {
|
|
226
|
-
setText(event.target.value);
|
|
227
|
-
},
|
|
228
|
-
onBlur: commit,
|
|
229
|
-
onKeyDown: (event) => {
|
|
230
|
-
if (event.key === "Enter") {
|
|
231
|
-
event.currentTarget.blur();
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
),
|
|
236
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-np-unit", children: field.unit })
|
|
237
|
-
] });
|
|
238
|
-
}
|
|
239
178
|
function NativePlusCard(props) {
|
|
240
179
|
const { form } = props;
|
|
241
180
|
const t = (key) => props.t(key);
|
|
@@ -257,36 +196,35 @@ function NativePlusCard(props) {
|
|
|
257
196
|
void form.set(key, next);
|
|
258
197
|
};
|
|
259
198
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-np-card", children: [
|
|
260
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
261
|
-
|
|
262
|
-
import_dsh_client_ui_primitives.Switch,
|
|
263
|
-
{
|
|
264
|
-
label: t(field.label),
|
|
265
|
-
checked: current[field.key] === true,
|
|
266
|
-
onChange: (next) => {
|
|
267
|
-
write(field.key, next);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
) }, field.key)),
|
|
271
|
-
FIELDS.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-np-rows", children: TOP_LEVEL.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
272
201
|
Row,
|
|
273
202
|
{
|
|
274
203
|
title: t(field.label),
|
|
275
204
|
hint: field.hint === void 0 ? void 0 : t(field.hint),
|
|
276
205
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
277
|
-
|
|
206
|
+
import_dsh_client_ui_primitives.Switch,
|
|
278
207
|
{
|
|
279
|
-
field,
|
|
280
|
-
|
|
281
|
-
|
|
208
|
+
label: t(field.label),
|
|
209
|
+
checked: current[field.key] === true,
|
|
210
|
+
onChange: (next) => {
|
|
282
211
|
write(field.key, next);
|
|
283
212
|
}
|
|
284
213
|
}
|
|
285
214
|
)
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
))
|
|
289
|
-
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
field.key === "inlineCode" && current.inlineCode === true && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-np-subrows", children: INLINE_CHILDREN.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t(child.label), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
218
|
+
import_dsh_client_ui_primitives.Switch,
|
|
219
|
+
{
|
|
220
|
+
label: t(child.label),
|
|
221
|
+
checked: current[child.key] === true,
|
|
222
|
+
onChange: (next) => {
|
|
223
|
+
write(child.key, next);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
) }, child.key)) })
|
|
227
|
+
] }, field.key)) }),
|
|
290
228
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-np-note", children: t("note.scope") })
|
|
291
229
|
] });
|
|
292
230
|
}
|
|
@@ -294,33 +232,47 @@ function NativePlusCard(props) {
|
|
|
294
232
|
// src/client/locales.ts
|
|
295
233
|
var NS = "nativeplus";
|
|
296
234
|
var en = {
|
|
297
|
-
"field.
|
|
235
|
+
"field.headings": "Heading decoration",
|
|
236
|
+
"field.quotes": "Quoted blocks",
|
|
237
|
+
"field.tables": "Tables",
|
|
238
|
+
"field.codeBlocks": "Code blocks",
|
|
239
|
+
"field.lists": "List markers",
|
|
240
|
+
"field.rules": "Dividers",
|
|
241
|
+
"field.changedFiles": "Changed files card",
|
|
242
|
+
"field.inlineCode": "Inline code",
|
|
243
|
+
"hint.inlineCode": "When on, the two sub-options appear below.",
|
|
244
|
+
"field.inlineCodeTint": "Darker grey background",
|
|
245
|
+
"field.inlineCodeStroke": "Stroke and glow",
|
|
298
246
|
"field.workspaceActivity": "Workspace activity indicator",
|
|
247
|
+
"hint.workspaceActivity": "Shows a breathing dot on the workspace row while a session in it is running.",
|
|
299
248
|
"activity.running": "A session is running",
|
|
300
|
-
"field.lineHeight": "Line height",
|
|
301
|
-
"hint.lineHeight": "Line height for conversation body text.",
|
|
302
|
-
"field.paragraphGap": "Paragraph gap",
|
|
303
|
-
"hint.paragraphGap": "Space between two paragraphs in an answer, in pixels.",
|
|
304
249
|
"state.unavailable": "The Host does not serve this configuration right now.",
|
|
305
|
-
"note.scope": "Colors are the ones DSH already ships.
|
|
250
|
+
"note.scope": "Colors are the ones DSH already ships. Each conversation decoration can be turned off on its own."
|
|
306
251
|
};
|
|
307
252
|
var zh = {
|
|
308
|
-
"field.
|
|
253
|
+
"field.headings": "\u6807\u9898\u88C5\u9970",
|
|
254
|
+
"field.quotes": "\u5F15\u7528\u5361\u7247",
|
|
255
|
+
"field.tables": "\u8868\u683C\u5361\u7247",
|
|
256
|
+
"field.codeBlocks": "\u4EE3\u7801\u5757",
|
|
257
|
+
"field.lists": "\u5217\u8868\u6807\u8BB0",
|
|
258
|
+
"field.rules": "\u5206\u9694\u7EBF",
|
|
259
|
+
"field.changedFiles": "\u6587\u4EF6\u6539\u52A8\u5361\u7247",
|
|
260
|
+
"field.inlineCode": "\u884C\u5185\u4EE3\u7801",
|
|
261
|
+
"hint.inlineCode": "\u6253\u5F00\u540E\uFF0C\u4E0B\u9762\u4F1A\u5C55\u5F00\u4E24\u4E2A\u5B50\u9879\u3002",
|
|
262
|
+
"field.inlineCodeTint": "\u52A0\u6DF1\u7070\u8272",
|
|
263
|
+
"field.inlineCodeStroke": "\u63CF\u8FB9\u6837\u5F0F",
|
|
309
264
|
"field.workspaceActivity": "\u5DE5\u4F5C\u533A\u8FD0\u884C\u6807\u8BB0",
|
|
265
|
+
"hint.workspaceActivity": "\u5DE5\u4F5C\u533A\u91CC\u6709\u4F1A\u8BDD\u6B63\u5728\u8FD0\u884C\u65F6\uFF0C\u884C\u5C3E\u663E\u793A\u547C\u5438\u5706\u70B9\u3002",
|
|
310
266
|
"activity.running": "\u6709\u4F1A\u8BDD\u6B63\u5728\u8FD0\u884C",
|
|
311
|
-
"field.lineHeight": "\u884C\u9AD8",
|
|
312
|
-
"hint.lineHeight": "\u5BF9\u8BDD\u6B63\u6587\u7684\u884C\u9AD8\u500D\u6570\u3002",
|
|
313
|
-
"field.paragraphGap": "\u6BB5\u843D\u95F4\u8DDD",
|
|
314
|
-
"hint.paragraphGap": "\u4E00\u4E2A\u56DE\u7B54\u91CC\u4E24\u6BB5\u4E4B\u95F4\u7A7A\u591A\u5C11\u50CF\u7D20\u3002",
|
|
315
267
|
"state.unavailable": "\u5BBF\u4E3B\u5F53\u524D\u6CA1\u6709\u63D0\u4F9B\u8FD9\u4EFD\u914D\u7F6E\u3002",
|
|
316
|
-
"note.scope": "\u989C\u8272\u5168\u90E8\u6CBF\u7528 DSH \u81EA\u5E26\u7684\u90A3\u5957\u3002\
|
|
268
|
+
"note.scope": "\u989C\u8272\u5168\u90E8\u6CBF\u7528 DSH \u81EA\u5E26\u7684\u90A3\u5957\u3002\u6B63\u6587\u88C5\u9970\u53EF\u4EE5\u9010\u9879\u5F00\u5173\u3002"
|
|
317
269
|
};
|
|
318
270
|
|
|
319
271
|
// inline-css:/home/runner/work/my-dsh/my-dsh/plugins/dsh-native-plus/src/client/styles/tokens.css
|
|
320
|
-
var tokens_default = "\nhtml[data-native-plus='on'] body {\n --np-heading-strong: var(--dsw-static-blue-800);\n --np-heading-soft: var(--dsw-static-blue-600);\n\n --np-h1: var(--np-heading-strong);\n --np-h2: color-mix(in srgb, var(--np-heading-strong) 80%, var(--np-heading-soft));\n --np-h3: color-mix(in srgb, var(--np-heading-strong) 60%, var(--np-heading-soft));\n --np-h4: color-mix(in srgb, var(--np-heading-strong) 40%, var(--np-heading-soft));\n --np-h5: color-mix(in srgb, var(--np-heading-strong) 20%, var(--np-heading-soft));\n --np-h6: var(--np-heading-soft);\n\n --np-tint-weak: color-mix(in srgb, var(--dsw-alias-link) 6%, var(--dsw-alias-bg-base));\n --np-tint-strong: color-mix(in srgb, var(--dsw-alias-link) 10%, var(--dsw-alias-bg-base));\n --np-hairline: color-mix(in srgb, var(--dsw-alias-link) 22%, transparent);\n --np-rule: color-mix(in srgb, var(--dsw-alias-link) 30%, transparent);\n\n --np-quote-fill: var(--np-tint-weak);\n --np-quote-bar: var(--dsw-alias-link);\n --np-table-head: var(--np-tint-strong);\n --np-inline-
|
|
272
|
+
var tokens_default = "\nhtml[data-native-plus='on'] body {\n --np-heading-strong: var(--dsw-static-blue-800);\n --np-heading-soft: var(--dsw-static-blue-600);\n\n --np-h1: var(--np-heading-strong);\n --np-h2: color-mix(in srgb, var(--np-heading-strong) 80%, var(--np-heading-soft));\n --np-h3: color-mix(in srgb, var(--np-heading-strong) 60%, var(--np-heading-soft));\n --np-h4: color-mix(in srgb, var(--np-heading-strong) 40%, var(--np-heading-soft));\n --np-h5: color-mix(in srgb, var(--np-heading-strong) 20%, var(--np-heading-soft));\n --np-h6: var(--np-heading-soft);\n\n --np-tint-weak: color-mix(in srgb, var(--dsw-alias-link) 6%, var(--dsw-alias-bg-base));\n --np-tint-strong: color-mix(in srgb, var(--dsw-alias-link) 10%, var(--dsw-alias-bg-base));\n --np-hairline: color-mix(in srgb, var(--dsw-alias-link) 22%, transparent);\n --np-rule: color-mix(in srgb, var(--dsw-alias-link) 30%, transparent);\n\n --np-quote-fill: var(--np-tint-weak);\n --np-quote-bar: var(--dsw-alias-link);\n --np-table-head: var(--np-tint-strong);\n --np-inline-tint: color-mix(in srgb, var(--dsw-alias-markdown-inline-code) 94%, var(--dsw-static-neutral-1000));\n --np-inline-code-glow:\n 0 1px 2px color-mix(in srgb, var(--dsw-static-neutral-1000) 14%, transparent),\n 0 2px 6px color-mix(in srgb, var(--dsw-static-neutral-1000) 8%, transparent);\n --np-code-block: var(--dsw-alias-markdown-code-block);\n --np-code-banner: var(--dsw-alias-markdown-code-block-banner);\n --np-list-marker: var(--dsw-alias-link);\n}\n\nhtml[data-native-plus='on'] body[data-ds-dark-theme] {\n --np-heading-strong: var(--dsw-static-blue-300);\n --np-heading-soft: var(--dsw-static-blue-500);\n --np-inline-code-glow:\n 0 1px 2px color-mix(in srgb, var(--dsw-static-neutral-1000) 60%, transparent),\n 0 2px 6px color-mix(in srgb, var(--dsw-static-neutral-1000) 40%, transparent);\n}\n";
|
|
321
273
|
|
|
322
274
|
// inline-css:/home/runner/work/my-dsh/my-dsh/plugins/dsh-native-plus/src/client/styles/markdown.css
|
|
323
|
-
var markdown_default = "
|
|
275
|
+
var markdown_default = "html[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6) {\n margin: 28px 0 12px;\n}\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) {\n font-size: calc(var(--dsh-content-font-size, 14px) * 1.05);\n font-weight: 600;\n line-height: 1.5;\n}\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n line-height: 1.6;\n}\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1) { color: var(--np-h1); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2) { color: var(--np-h2); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3) { color: var(--np-h3); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4) { color: var(--np-h4); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) { color: var(--np-h5); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) { color: var(--np-h6); }\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6):first-child {\n margin-top: 0;\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) {\n position: relative;\n margin: 14px 0;\n padding: 8px 14px 8px 18px;\n border: 0;\n border-radius: var(--dsw-radius-md);\n background: var(--np-quote-fill);\n box-shadow: var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote)::before {\n content: '';\n position: absolute;\n inset-block: 8px;\n inset-inline-start: 7px;\n width: 3px;\n border-radius: var(--dsw-radius-xs);\n background: var(--np-quote-bar);\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) :where(h1, h2, h3, h4, h5, h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n margin: 6px 0;\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote blockquote) {\n margin-inline-end: 0;\n background: color-mix(in srgb, var(--np-quote-fill) 70%, var(--dsw-alias-bg-base));\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li)::marker {\n font-family: var(--ds-font-family-code);\n color: var(--np-list-marker);\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul) > :where(li)::marker {\n font-size: 1.15em;\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li) {\n margin: 3px 0;\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(input[type='checkbox']) {\n accent-color: var(--np-list-marker);\n margin-inline-end: 8px;\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(table) {\n border-collapse: separate;\n border-spacing: 0;\n font-size: calc(var(--dsh-content-font-size, 14px) - 1px);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(div):has(> table) {\n border-radius: var(--dsw-radius-md);\n background: var(--dsw-alias-bg-layer-1);\n box-shadow: var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(div):has(> table):focus-visible {\n box-shadow:\n 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)),\n var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th) {\n font-weight: 600;\n background: var(--np-table-head);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th:first-child, td:first-child) {\n padding-inline-start: 16px;\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th:last-child, td:last-child) {\n padding-inline-end: 16px;\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(tbody > tr:last-child > td) {\n border-bottom: none;\n}\n\nhtml[data-native-plus='on'][data-np-rules] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(hr) {\n height: 1px;\n margin: 28px 0;\n border: 0;\n background: linear-gradient(\n to right,\n transparent 0%,\n var(--np-rule) 22%,\n var(--np-rule) 50%,\n var(--np-rule) 78%,\n transparent 100%\n );\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(.md-code-block) {\n --dsl-code-block-border-radius: var(--dsw-radius-md);\n background: var(--np-code-block);\n box-shadow: var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-code-block-banner]) {\n border-bottom: var(--dsh-hairline-width, 0.5px) solid var(--np-hairline);\n background: var(--np-code-banner);\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) {\n color: var(--dsw-alias-label-caption);\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) :where(.line)::before {\n color: var(--dsw-alias-label-caption);\n}\n\nhtml[data-native-plus='on'][data-np-inline-tint] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :not(pre) > code {\n background-color: var(--np-inline-tint);\n}\n\nhtml[data-native-plus='on'][data-np-inline-stroke] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :not(pre) > code {\n border-color: var(--dsw-elevation-stroke-color);\n box-shadow: var(--np-inline-code-glow);\n}\n\nhtml[data-native-plus='on'][data-np-changed-files] [data-changed-files] {\n border-color: transparent;\n box-shadow: var(--dsw-elevation-panel);\n}\n";
|
|
324
276
|
|
|
325
277
|
// inline-css:/home/runner/work/my-dsh/my-dsh/plugins/dsh-native-plus/src/client/styles/sidebar.css
|
|
326
278
|
var sidebar_default = "\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running] {\n position: relative;\n}\n\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]::after {\n content: '';\n position: absolute;\n inset-inline-end: 8px;\n top: 50%;\n width: 6px;\n height: 6px;\n margin-top: -3px;\n border-radius: 50%;\n corner-shape: round;\n background: var(--dsw-alias-label-tertiary);\n animation: dsh-np-breathe 2.4s ease-in-out infinite;\n}\n\n@media (hover: hover) {\n html[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]:hover::after {\n visibility: hidden;\n }\n}\n\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]:has([aria-expanded='true'])::after {\n visibility: hidden;\n}\n\n@media (prefers-reduced-motion: reduce) {\n html[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]::after {\n animation: none;\n }\n}\n\n@keyframes dsh-np-breathe {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 1; }\n}\n";
|
package/lib/client.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/client/index.ts", "../src/client/schema.ts", "../src/client/settings.ts", "../src/client/binding.ts", "../src/client/card-css.ts", "../src/client/card.tsx", "../src/client/locales.ts", "inline-css:/home/runner/work/my-dsh/my-dsh/plugins/dsh-native-plus/src/client/styles/tokens.css", "inline-css:/home/runner/work/my-dsh/my-dsh/plugins/dsh-native-plus/src/client/styles/markdown.css", "inline-css:/home/runner/work/my-dsh/my-dsh/plugins/dsh-native-plus/src/client/styles/sidebar.css", "../src/client/workspace-activity.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context as ClientContext } from '@deepseek-ai/cordis';\nimport type {} from '@deepseek-ai/dsh-client-locale/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client';\nimport { bindProjection, readSettings, BUNDLE_NAME, BUNDLE_CONFIG_SLOT, SETTINGS_NAMESPACE, type ConfigForm } from './binding.ts';\nimport { CARD_CSS } from './card-css.ts';\nimport { NativePlusCard } from './card.tsx';\nimport { NS, en, zh } from './locales.ts';\nimport tokens from './styles/tokens.css?inline';\nimport markdown from './styles/markdown.css?inline';\nimport sidebar from './styles/sidebar.css?inline';\nimport {\n watchWorkspaceActivity,\n type SessionListLike,\n type SessionStatusLike,\n type SnapshotSource,\n type WorkspaceListLike,\n} from './workspace-activity.ts';\n\nexport { NS } from './locales.ts';\nexport {\n BUNDLE_CONFIG_SLOT, BUNDLE_NAME, SETTINGS_NAMESPACE, bindProjection, readSettings,\n} from './binding.ts';\nexport { NativePlusCard } from './card.tsx';\nexport {\n applyProjection, clearProjection, DEFAULT_SETTINGS, normalizeSettings,\n projectSettings, ROOT_ATTRIBUTE, ROOT_VARIABLES,\n} from './settings.ts';\nexport { FIELDS, clampNumber, defaultConfig, normalizeConfig } from './schema.ts';\nexport {\n ACTIVITY_ATTRIBUTE, applyActivity, runningWorkspaceKeys, watchWorkspaceActivity,\n} from './workspace-activity.ts';\n\nexport const name = '@lynn123411/dsh-native-plus';\n\nexport const inject = ['configForms', 'slots', 'locale'];\n\nconst SHEETS: readonly (readonly [string, string])[] = [\n ['tokens.css', tokens],\n ['markdown.css', markdown],\n ['card.css', CARD_CSS],\n ['sidebar.css', sidebar],\n];\n\nfunction injectStyles(): void {\n if (typeof document === 'undefined') return;\n for (const [file, css] of SHEETS) {\n const key = `${name}/${file}`;\n const existing = document.head.querySelector<HTMLStyleElement>(`style[data-plugin-css=\"${key}\"]`);\n const tag = existing ?? document.createElement('style');\n tag.dataset.plugin = name;\n tag.dataset.pluginCss = key;\n tag.textContent = css;\n if (existing === null) document.head.appendChild(tag);\n }\n}\n\nfunction removeStyles(): void {\n if (typeof document === 'undefined') return;\n for (const tag of document.head.querySelectorAll(`style[data-plugin=\"${name}\"]`)) tag.remove();\n}\n\ninterface ClientServices {\n configForms: {\n get(namespace: string): ConfigForm;\n whileServed(namespaces: readonly string[], register: (served: ReadonlySet<string>) => () => void): () => void;\n };\n slots: {\n inject(slot: string, register: () => () => void): () => void;\n register(options: Record<string, unknown>, component: unknown): () => void;\n };\n locale: {\n register(namespace: string, dictionaries: { zh: unknown; en: unknown }): () => void;\n bind(namespace: string): (key: string) => string;\n subscribe(listener: () => void): () => void;\n };\n workspaces: { list: SnapshotSource<WorkspaceListLike> };\n sessions: { list: SnapshotSource<SessionListLike> };\n uiSession: { sessionStatus: SnapshotSource<SessionStatusLike> };\n}\n\nexport function apply(ctx: ClientContext): void {\n const services = ctx as unknown as ClientServices;\n\n ctx.effect(() => {\n injectStyles();\n return () => { removeStyles(); };\n }, 'dsh-native-plus: stylesheets');\n\n ctx.effect(\n () => services.locale.register(NS, { zh, en }),\n 'dsh-native-plus: dictionaries',\n );\n\n ctx.effect(() => {\n if (typeof document === 'undefined') return () => {};\n return bindProjection(document.documentElement, services.configForms.get(SETTINGS_NAMESPACE));\n }, 'dsh-native-plus: projection');\n\n ctx.effect(\n () => services.configForms.whileServed([SETTINGS_NAMESPACE], () => services.slots.inject(\n BUNDLE_CONFIG_SLOT,\n () => services.slots.register({\n name: BUNDLE_CONFIG_SLOT,\n key: BUNDLE_NAME,\n locale: NS,\n inject: () => ({ form: services.configForms.get(SETTINGS_NAMESPACE) }),\n }, NativePlusCard),\n )),\n 'dsh-native-plus: plugins page config',\n );\n\n ctx.inject(['workspaces', 'sessions', 'uiSession', 'uiSession.sessionStatus'], (scope) => {\n const injected = scope as unknown as ClientServices;\n scope.effect(\n () => typeof document === 'undefined'\n ? () => {}\n : watchWorkspaceActivity(document, {\n workspaces: injected.workspaces.list,\n sessions: injected.sessions.list,\n statuses: injected.uiSession.sessionStatus,\n }, {\n enabled: {\n getSnapshot: () => readSettings(services.configForms.get(SETTINGS_NAMESPACE))?.workspaceActivity !== false,\n subscribe: (listener) => services.configForms.get(SETTINGS_NAMESPACE).subscribe(listener),\n },\n description: {\n getSnapshot: () => services.locale.bind(NS)('activity.running'),\n subscribe: (listener) => services.locale.subscribe(listener),\n },\n }),\n 'dsh-native-plus: workspace activity',\n );\n });\n}\n", "\nexport interface Field {\n key: string;\n label: string;\n hint?: string;\n min: number;\n max: number;\n step: number;\n unit: string;\n default: number;\n}\n\nexport const FIELDS: readonly Field[] = [\n { key: 'lineHeight', label: 'field.lineHeight', hint: 'hint.lineHeight', min: 1.4, max: 2, step: 0.05, unit: '\u00D7', default: 1.75 },\n { key: 'paragraphGap', label: 'field.paragraphGap', hint: 'hint.paragraphGap', min: 4, max: 24, step: 1, unit: 'px', default: 10 },\n];\n\nexport const SWITCHES = [\n { key: 'bodyDecoration', label: 'field.bodyDecoration', default: true },\n { key: 'workspaceActivity', label: 'field.workspaceActivity', default: true },\n] as const;\n\nexport type ConfigValue = string | number | boolean;\n\nexport type Config = Record<string, ConfigValue>;\n\nexport function defaultConfig(): Config {\n const out: Config = {};\n for (const field of FIELDS) out[field.key] = field.default;\n for (const field of SWITCHES) out[field.key] = field.default;\n return out;\n}\n\nexport function clampNumber(value: unknown, min: number, max: number, fallback: number): number {\n if (typeof value !== 'number' && typeof value !== 'string') return fallback;\n if (typeof value === 'string' && value.trim() === '') return fallback;\n const parsed = typeof value === 'number' ? value : Number(value);\n if (!Number.isFinite(parsed)) return fallback;\n return Math.min(max, Math.max(min, parsed));\n}\n\nexport function normalizeConfig(raw: Partial<Record<string, unknown>> | undefined | null): Config {\n const source = raw ?? {};\n const out: Config = {};\n for (const field of FIELDS) {\n out[field.key] = clampNumber(source[field.key], field.min, field.max, field.default);\n }\n for (const field of SWITCHES) {\n out[field.key] = typeof source[field.key] === 'boolean' ? source[field.key] as boolean : field.default;\n }\n return out;\n}\n", "import { defaultConfig, normalizeConfig, type Config } from './schema.ts';\n\nexport const ROOT_ATTRIBUTE = 'data-native-plus';\nexport const ACTIVITY_ROOT_ATTRIBUTE = 'data-np-activity';\n\nexport interface Projection {\n attributes: Record<string, string | null>;\n variables: Record<string, string | null>;\n}\n\nexport type Settings = Config;\n\nexport const DEFAULT_SETTINGS: Readonly<Settings> = Object.freeze(defaultConfig());\n\nexport function normalizeSettings(raw: Partial<Record<string, unknown>> | undefined | null): Settings {\n return normalizeConfig(raw);\n}\n\nexport const ROOT_VARIABLES: readonly string[] = ['--np-line-height', '--np-p-gap'];\n\nexport function projectSettings(settings: Settings, enabled = true): Projection {\n if (!enabled) {\n const variables: Record<string, null> = {};\n for (const name of ROOT_VARIABLES) variables[name] = null;\n return { attributes: { [ROOT_ATTRIBUTE]: null, [ACTIVITY_ROOT_ATTRIBUTE]: null }, variables };\n }\n\n return {\n attributes: { [ROOT_ATTRIBUTE]: settings.bodyDecoration ? 'on' : null, [ACTIVITY_ROOT_ATTRIBUTE]: settings.workspaceActivity ? 'on' : null },\n variables: {\n '--np-line-height': String(Number(settings.lineHeight)),\n '--np-p-gap': `${Number(settings.paragraphGap)}px`,\n },\n };\n}\n\nexport function applyProjection(root: HTMLElement, projection: Projection): void {\n for (const [attribute, value] of Object.entries(projection.attributes)) {\n if (value === null) root.removeAttribute(attribute);\n else root.setAttribute(attribute, value);\n }\n for (const [property, value] of Object.entries(projection.variables)) {\n if (value === null) root.style.removeProperty(property);\n else root.style.setProperty(property, value);\n }\n}\n\nexport function clearProjection(root: HTMLElement): void {\n applyProjection(root, projectSettings(normalizeSettings(undefined), false));\n}\n", "import {\n applyProjection,\n clearProjection,\n normalizeSettings,\n projectSettings,\n type Settings,\n} from './settings.ts';\n\nexport const SETTINGS_NAMESPACE = 'dsh-native-plus';\n\nexport const BUNDLE_CONFIG_SLOT = 'plugins.bundle.config';\n\nexport const BUNDLE_NAME = '@lynn123411/dsh-native-plus';\n\nexport interface ConfigForm {\n getSnapshot(): {\n status: 'loading' | 'ready' | 'unavailable';\n value?: Partial<Record<string, unknown>> | undefined;\n writable?: boolean;\n revision?: number | undefined;\n };\n subscribe(listener: () => void): () => void;\n set(field: string, value: unknown): Promise<boolean>;\n mutate(ops: readonly FormOp[], expectedRevision?: number): Promise<boolean>;\n}\n\nexport type FormOp =\n | { op: 'set'; path: string[]; value: unknown }\n | { op: 'unset'; path: string[] };\n\nexport function readSettings(form: ConfigForm): Settings | undefined {\n const snapshot = form.getSnapshot();\n if (snapshot.status === 'unavailable') return undefined;\n return normalizeSettings(snapshot.value);\n}\n\nexport function bindProjection(root: HTMLElement, form: ConfigForm): () => void {\n const sync = (): void => {\n const settings = readSettings(form);\n applyProjection(root, projectSettings(settings ?? normalizeSettings(undefined)));\n };\n sync();\n const off = form.subscribe(sync);\n return () => {\n off();\n clearProjection(root);\n };\n}\n", "export const CARD_CSS = `\n.dsh-np-card{display:flex;flex-direction:column;gap:16px;padding:16px 0}\n.dsh-np-rows{display:flex;flex-direction:column}\n.dsh-np-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:0.5px solid var(--dsw-alias-border-l1)}\n.dsh-np-rows > .dsh-np-row:last-child{border-bottom:0}\n.dsh-np-row-info{display:flex;flex-direction:column;gap:2px;min-width:0}\n.dsh-np-row-title{font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}\n.dsh-np-row-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}\n.dsh-np-row-field{flex:none;display:flex;align-items:center;gap:8px}\n.dsh-np-number{width:76px}\n/* \u6570\u503C\u6ED1\u5757\uFF1A\u7EC6\u8F68 + \u5706\u70B9\u3002 */\n.dsh-np-slider{width:110px;height:32px;appearance:none;background:transparent;cursor:pointer;margin:0}\n.dsh-np-slider::-webkit-slider-runnable-track{height:4px;border-radius:999px;corner-shape:round;\n background:var(--dsw-alias-border-l3)}\n.dsh-np-slider::-webkit-slider-thumb{appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:999px;\n corner-shape:round;background:var(--dsw-alias-brand-primary);border:0 solid transparent}\n.dsh-np-slider:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px;border-radius:999px}\n.dsh-np-unit{font-size:12px;color:var(--dsw-alias-label-tertiary);flex:none;min-width:16px}\n.dsh-np-note{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);padding-top:8px}\n.dsh-np-empty{font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary)}\n`;\n", "import { useEffect, useState } from 'react';\nimport * as React from 'react';\nimport { Input, Switch } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';\nimport { readSettings, type ConfigForm } from './binding.ts';\nimport { FIELDS, SWITCHES, defaultConfig, type Field } from './schema.ts';\nimport { NS } from './locales.ts';\n\ntype Translate = (key: string) => string;\n\ntype Value = string | number | boolean;\n\nfunction valueOf(settings: Record<string, Value>, key: string): Value {\n return settings[key] ?? '';\n}\n\nfunction Row({ title, hint, children }: {\n title: string;\n hint?: string | undefined;\n children: React.ReactNode;\n}): React.ReactElement {\n return (\n <div className=\"dsh-np-row\">\n <div className=\"dsh-np-row-info\">\n <div className=\"dsh-np-row-title\">{title}</div>\n {hint !== undefined && <div className=\"dsh-np-row-hint\">{hint}</div>}\n </div>\n <div className=\"dsh-np-row-field\">{children}</div>\n </div>\n );\n}\n\nfunction NumberControl({ field, value, onCommit }: {\n field: Field;\n value: number;\n onCommit: (next: number) => void;\n}): React.ReactElement {\n const [text, setText] = useState(String(value));\n useEffect(() => { setText(String(value)) }, [value]);\n const commit = (): void => {\n const parsed = Number(text);\n if (!Number.isFinite(parsed)) { setText(String(value)); return; }\n const clamped = Math.min(field.max, Math.max(field.min, Math.round(parsed / field.step) * field.step));\n setText(String(clamped));\n if (clamped !== value) onCommit(clamped);\n };\n return (\n <>\n <input\n type=\"range\"\n className=\"dsh-np-slider\"\n min={field.min}\n max={field.max}\n step={field.step}\n value={value}\n aria-label={field.label}\n onChange={(event) => { onCommit(Number(event.currentTarget.value)) }}\n />\n <Input\n className=\"dsh-np-number\"\n type=\"number\"\n inputMode=\"decimal\"\n min={field.min}\n max={field.max}\n step={field.step}\n value={text}\n aria-label={field.label}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => { setText(event.target.value) }}\n onBlur={commit}\n onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') { event.currentTarget.blur(); }\n }}\n />\n <span className=\"dsh-np-unit\">{field.unit}</span>\n </>\n );\n}\n\nexport function NativePlusCard(\n props: PropsRuntime<'plugins.bundle.config'> & PropsLocale<typeof NS> & { form: ConfigForm },\n): React.ReactElement {\n const { form } = props;\n const t: Translate = (key: string) => (props as unknown as { t: (k: string) => string }).t(key);\n const [settings, setSettings] = useState<Record<string, Value> | undefined>(() => readSettings(form));\n const [available, setAvailable] = useState(() => form.getSnapshot().status !== 'unavailable');\n\n useEffect(() => {\n const sync = (): void => {\n setSettings(readSettings(form));\n setAvailable(form.getSnapshot().status !== 'unavailable');\n };\n sync();\n return form.subscribe(sync);\n }, [form]);\n\n if (!available) {\n return <div className=\"dsh-np-card\"><div className=\"dsh-np-empty\">{t('state.unavailable')}</div></div>;\n }\n\n const current: Record<string, Value> = settings ?? defaultConfig();\n const write = (key: string, next: Value): void => { void form.set(key, next); };\n\n return (\n <div className=\"dsh-np-card\">\n <div className=\"dsh-np-rows\">\n {SWITCHES.map((field) => (\n <Row key={field.key} title={t(field.label)}>\n <Switch label={t(field.label)} checked={current[field.key] === true}\n onChange={(next: boolean) => { write(field.key, next) }} />\n </Row>\n ))}\n {FIELDS.map((field) => (\n <Row\n key={field.key}\n title={t(field.label)}\n hint={field.hint === undefined ? undefined : t(field.hint)}\n >\n <NumberControl\n field={field}\n value={Number(valueOf(current, field.key))}\n onCommit={(next) => { write(field.key, next) }}\n />\n </Row>\n ))}\n </div>\n <div className=\"dsh-np-note\">{t('note.scope')}</div>\n </div>\n );\n}\n", "export const NS = 'nativeplus';\n\nexport const en = {\n 'field.bodyDecoration': 'Conversation styling',\n 'field.workspaceActivity': 'Workspace activity indicator',\n 'activity.running': 'A session is running',\n 'field.lineHeight': 'Line height',\n 'hint.lineHeight': 'Line height for conversation body text.',\n 'field.paragraphGap': 'Paragraph gap',\n 'hint.paragraphGap': 'Space between two paragraphs in an answer, in pixels.',\n\n 'state.unavailable': 'The Host does not serve this configuration right now.',\n 'note.scope': 'Colors are the ones DSH already ships. This plugin only changes spacing and the blue scale of headings.',\n} as const;\n\nexport const zh: Record<keyof typeof en, string> = {\n 'field.bodyDecoration': '\u6B63\u6587\u88C5\u9970',\n 'field.workspaceActivity': '\u5DE5\u4F5C\u533A\u8FD0\u884C\u6807\u8BB0',\n 'activity.running': '\u6709\u4F1A\u8BDD\u6B63\u5728\u8FD0\u884C',\n 'field.lineHeight': '\u884C\u9AD8',\n 'hint.lineHeight': '\u5BF9\u8BDD\u6B63\u6587\u7684\u884C\u9AD8\u500D\u6570\u3002',\n 'field.paragraphGap': '\u6BB5\u843D\u95F4\u8DDD',\n 'hint.paragraphGap': '\u4E00\u4E2A\u56DE\u7B54\u91CC\u4E24\u6BB5\u4E4B\u95F4\u7A7A\u591A\u5C11\u50CF\u7D20\u3002',\n\n 'state.unavailable': '\u5BBF\u4E3B\u5F53\u524D\u6CA1\u6709\u63D0\u4F9B\u8FD9\u4EFD\u914D\u7F6E\u3002',\n 'note.scope': '\u989C\u8272\u5168\u90E8\u6CBF\u7528 DSH \u81EA\u5E26\u7684\u90A3\u5957\u3002\u63D2\u4EF6\u53EA\u6539\u95F4\u8DDD\u4E0E\u6807\u9898\u7684\u84DD\u8272\u6DF1\u6D45\u3002',\n};\n", "\nhtml[data-native-plus='on'] body {\n --np-heading-strong: var(--dsw-static-blue-800);\n --np-heading-soft: var(--dsw-static-blue-600);\n\n --np-h1: var(--np-heading-strong);\n --np-h2: color-mix(in srgb, var(--np-heading-strong) 80%, var(--np-heading-soft));\n --np-h3: color-mix(in srgb, var(--np-heading-strong) 60%, var(--np-heading-soft));\n --np-h4: color-mix(in srgb, var(--np-heading-strong) 40%, var(--np-heading-soft));\n --np-h5: color-mix(in srgb, var(--np-heading-strong) 20%, var(--np-heading-soft));\n --np-h6: var(--np-heading-soft);\n\n --np-tint-weak: color-mix(in srgb, var(--dsw-alias-link) 6%, var(--dsw-alias-bg-base));\n --np-tint-strong: color-mix(in srgb, var(--dsw-alias-link) 10%, var(--dsw-alias-bg-base));\n --np-hairline: color-mix(in srgb, var(--dsw-alias-link) 22%, transparent);\n --np-rule: color-mix(in srgb, var(--dsw-alias-link) 30%, transparent);\n\n --np-quote-fill: var(--np-tint-weak);\n --np-quote-bar: var(--dsw-alias-link);\n --np-table-head: var(--np-tint-strong);\n --np-inline-code-bg: color-mix(in srgb, var(--dsw-alias-link) 9%, transparent);\n --np-code-block: var(--dsw-alias-markdown-code-block);\n --np-code-banner: var(--dsw-alias-markdown-code-block-banner);\n --np-list-marker: var(--dsw-alias-link);\n}\n\nhtml[data-native-plus='on'] body[data-ds-dark-theme] {\n --np-heading-strong: var(--dsw-static-blue-300);\n --np-heading-soft: var(--dsw-static-blue-500);\n}\n\nhtml[data-native-plus='on'] body {\n --dsw-font-markdown-base:\n var(--dsh-content-font-size, 14px) / calc(var(--dsh-content-font-size, 14px) * var(--np-line-height, 1.75))\n var(--dsw-font-family);\n --dsw-font-markdown-base-font-size: var(--dsh-content-font-size, 14px);\n --dsw-font-markdown-base-line-height: calc(var(--dsh-content-font-size, 14px) * var(--np-line-height, 1.75));\n\n --dsw-font-markdown-base-strong:\n 600 var(--dsh-content-font-size, 14px) / calc(var(--dsh-content-font-size, 14px) * var(--np-line-height, 1.75))\n var(--dsw-font-family);\n --dsw-font-markdown-base-strong-font-size: var(--dsh-content-font-size, 14px);\n --dsw-font-markdown-base-strong-line-height: calc(var(--dsh-content-font-size, 14px) * var(--np-line-height, 1.75));\n\n --dsw-font-markdown-h1:\n 700 calc(var(--dsh-content-font-size, 14px) * 1.6) / 1.3 var(--dsw-font-family);\n --dsw-font-markdown-h1-font-size: calc(var(--dsh-content-font-size, 14px) * 1.6);\n --dsw-font-markdown-h1-font-weight: 700;\n --dsw-font-markdown-h1-line-height: 1.3;\n\n --dsw-font-markdown-h2:\n 700 calc(var(--dsh-content-font-size, 14px) * 1.5) / 1.3 var(--dsw-font-family);\n --dsw-font-markdown-h2-font-size: calc(var(--dsh-content-font-size, 14px) * 1.5);\n --dsw-font-markdown-h2-font-weight: 700;\n --dsw-font-markdown-h2-line-height: 1.3;\n\n --dsw-font-markdown-h3:\n 600 calc(var(--dsh-content-font-size, 14px) * 1.35) / 1.35 var(--dsw-font-family);\n --dsw-font-markdown-h3-font-size: calc(var(--dsh-content-font-size, 14px) * 1.35);\n --dsw-font-markdown-h3-font-weight: 600;\n --dsw-font-markdown-h3-line-height: 1.35;\n\n --dsw-font-markdown-h4:\n 600 calc(var(--dsh-content-font-size, 14px) * 1.15) / 1.4 var(--dsw-font-family);\n --dsw-font-markdown-h4-font-size: calc(var(--dsh-content-font-size, 14px) * 1.15);\n --dsw-font-markdown-h4-font-weight: 600;\n --dsw-font-markdown-h4-line-height: 1.4;\n}", "\nhtml[data-native-plus='on'] {\n --np-underline-offset: 2px;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(p) {\n margin: var(--np-p-gap, 10px) 0;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li > p) {\n margin: 4px 0;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :not(pre) > code {\n background-color: var(--np-inline-code-bg);\n border-color: var(--np-hairline);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(a) {\n text-underline-offset: var(--np-underline-offset);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6) {\n margin: 28px 0 12px;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) {\n font-size: calc(var(--dsh-content-font-size, 14px) * 1.05);\n font-weight: 600;\n line-height: 1.5;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n line-height: 1.6;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1) { color: var(--np-h1); }\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2) { color: var(--np-h2); }\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3) { color: var(--np-h3); }\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4) { color: var(--np-h4); }\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) { color: var(--np-h5); }\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) { color: var(--np-h6); }\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) {\n position: relative;\n margin: 14px 0;\n padding: 8px 14px 8px 18px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n background: var(--np-quote-fill);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote)::before {\n content: '';\n position: absolute;\n inset-block: 8px;\n inset-inline-start: 7px;\n width: 3px;\n border-radius: var(--dsw-radius-xs);\n background: var(--np-quote-bar);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) :where(h1, h2, h3, h4, h5, h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n margin: 6px 0;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote blockquote) {\n margin-inline-end: 0;\n background: color-mix(in srgb, var(--np-quote-fill) 70%, var(--dsw-alias-bg-base));\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul, ol) {\n margin: var(--np-p-gap, 10px) 0;\n padding-inline-start: 1.35em;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li)::marker {\n font-family: var(--ds-font-family-code);\n color: var(--np-list-marker);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul) > :where(li)::marker {\n font-size: 0.85em;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li) {\n margin: 3px 0;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(input[type='checkbox']) {\n accent-color: var(--np-list-marker);\n margin-inline-end: 8px;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(table) {\n border-collapse: separate;\n border-spacing: 0;\n font-size: calc(var(--dsh-content-font-size, 14px) - 1px);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th) {\n font-weight: 600;\n background: var(--np-table-head);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th:first-child, td:first-child) {\n padding-inline-start: 12px;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th:last-child, td:last-child) {\n padding-inline-end: 12px;\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(thead > tr > th:first-child) {\n border-start-start-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(thead > tr > th:last-child) {\n border-start-end-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(tbody > tr:last-child > td:first-child) {\n border-end-start-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(tbody > tr:last-child > td:last-child) {\n border-end-end-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(hr) {\n height: 1px;\n margin: 28px 0;\n border: 0;\n background: linear-gradient(\n to right,\n transparent 0%,\n var(--np-rule) 22%,\n var(--np-rule) 50%,\n var(--np-rule) 78%,\n transparent 100%\n );\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(.md-code-block) {\n border: var(--dsh-hairline-width, 0.5px) solid var(--np-hairline);\n --dsl-code-block-border-radius: var(--dsw-radius-md);\n background: var(--np-code-block);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-code-block-banner]) {\n border-bottom: var(--dsh-hairline-width, 0.5px) solid var(--np-hairline);\n background: var(--np-code-banner);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-code-block-banner]) :where(div:first-child) {\n font-family: var(--ds-font-family-code);\n letter-spacing: 0.02em;\n color: var(--np-list-marker);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) {\n color: var(--dsw-alias-label-caption);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) :where(.line)::before {\n color: var(--dsw-alias-label-caption);\n}\n\nhtml[data-native-plus='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6):first-child {\n margin-top: 0;\n}\n", "\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running] {\n position: relative;\n}\n\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]::after {\n content: '';\n position: absolute;\n inset-inline-end: 8px;\n top: 50%;\n width: 6px;\n height: 6px;\n margin-top: -3px;\n border-radius: 50%;\n corner-shape: round;\n background: var(--dsw-alias-label-tertiary);\n animation: dsh-np-breathe 2.4s ease-in-out infinite;\n}\n\n@media (hover: hover) {\n html[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]:hover::after {\n visibility: hidden;\n }\n}\n\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]:has([aria-expanded='true'])::after {\n visibility: hidden;\n}\n\n@media (prefers-reduced-motion: reduce) {\n html[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]::after {\n animation: none;\n }\n}\n\n@keyframes dsh-np-breathe {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 1; }\n}\n", "export interface SnapshotSource<T> {\n getSnapshot(): T\n subscribe(listener: () => void): () => void\n}\n\nexport interface WorkspaceListLike {\n readonly items: readonly {\n readonly workspaceId: string\n readonly sessionIds: readonly string[]\n }[]\n}\n\nexport interface SessionListLike {\n readonly ids: readonly string[]\n readonly byId: Readonly<Record<string, { readonly running?: boolean } | undefined>>\n readonly projectionsBySession: Readonly<Record<string, {\n readonly values: { readonly subagentCatalog?: readonly { readonly id: string }[] }\n } | undefined>>\n}\n\nexport type SessionStatusLike = ReadonlyMap<string, { readonly running?: boolean }>\n\nexport const ACTIVITY_ATTRIBUTE = 'data-np-running'\nconst LIST_SELECTOR = '[data-sidebar-list-area]'\nconst ROW_KEY_PREFIX = 'workspace:'\nconst ROW_SELECTOR = `[data-row-key^=\"${ROW_KEY_PREFIX}\"]`\nconst UNGROUPED_KEY = ''\nconst DESCRIPTION_ATTRIBUTE = 'data-np-activity-description'\nlet nextDescriptionId = 0\nconst descriptionIds = new WeakMap<Element, string>()\n\nexport function runningWorkspaceKeys(\n workspaces: WorkspaceListLike,\n sessions: SessionListLike,\n statuses: SessionStatusLike,\n): Set<string> {\n const keys = new Set<string>()\n const accounted = new Set<string>()\n const running = (id: string): boolean =>\n (statuses.get(id)?.running ?? sessions.byId[id]?.running) === true\n const active = (id: string): boolean => running(id)\n || sessions.projectionsBySession[id]?.values.subagentCatalog?.some(child => running(child.id)) === true\n\n for (const workspace of workspaces.items) {\n for (const id of workspace.sessionIds) accounted.add(id)\n if (workspace.sessionIds.some(active)) keys.add(workspace.workspaceId)\n }\n if (sessions.ids.some(id => !accounted.has(id) && active(id))) keys.add(UNGROUPED_KEY)\n return keys\n}\n\nexport function applyActivity(list: ParentNode, keys: ReadonlySet<string>, description = ''): void {\n for (const row of list.querySelectorAll(ROW_SELECTOR)) {\n const key = row.getAttribute('data-row-key')?.slice(ROW_KEY_PREFIX.length)\n const active = key !== undefined && keys.has(key)\n row.toggleAttribute(ACTIVITY_ATTRIBUTE, active)\n let label = row.querySelector<HTMLElement>(`[${DESCRIPTION_ATTRIBUTE}]`)\n if (active && description) {\n if (label === null) {\n label = row.ownerDocument.createElement('span')\n label.setAttribute(DESCRIPTION_ATTRIBUTE, '')\n label.id = descriptionIds.get(row) ?? `dsh-np-activity-${++nextDescriptionId}`\n descriptionIds.set(row, label.id)\n Object.assign(label.style, { position: 'absolute', width: '1px', height: '1px', padding: '0', margin: '-1px', overflow: 'hidden', clipPath: 'inset(50%)', whiteSpace: 'nowrap', border: '0' })\n row.appendChild(label)\n }\n label.textContent = description\n const ids = (row.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean)\n if (!ids.includes(label.id)) row.setAttribute('aria-describedby', [...ids, label.id].join(' '))\n } else {\n const ownedId = label?.id ?? descriptionIds.get(row)\n if (ownedId !== undefined) {\n const ids = (row.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(id => id && id !== ownedId)\n if (ids.length) row.setAttribute('aria-describedby', ids.join(' '))\n else row.removeAttribute('aria-describedby')\n descriptionIds.delete(row)\n }\n label?.remove()\n }\n }\n}\n\nexport interface ActivitySources {\n workspaces: SnapshotSource<WorkspaceListLike>\n sessions: SnapshotSource<SessionListLike>\n statuses: SnapshotSource<SessionStatusLike>\n}\n\nfunction containsElement(node: Node, selector: string): boolean {\n if (node.nodeType !== 1) return false\n const element = node as Element\n return element.matches(selector) || element.querySelector(selector) !== null\n}\n\nexport function watchWorkspaceActivity(doc: Document, sources: ActivitySources, options: {\n enabled: SnapshotSource<boolean>\n description: SnapshotSource<string>\n}): () => void {\n const view = doc.defaultView\n const Observer = view?.MutationObserver\n let list: Element | null = null\n let keys: ReadonlySet<string> = new Set()\n let frame: number | undefined\n const paint = (): void => {\n frame = undefined\n if (list !== null) applyActivity(list, options.enabled.getSnapshot() ? keys : new Set(), options.description.getSnapshot())\n }\n const schedule = (): void => {\n if (list === null || frame !== undefined) return\n if (view?.requestAnimationFrame === undefined) paint()\n else frame = view.requestAnimationFrame(paint)\n }\n const recompute = (): void => {\n const next = runningWorkspaceKeys(\n sources.workspaces.getSnapshot(), sources.sessions.getSnapshot(), sources.statuses.getSnapshot(),\n )\n if (next.size === keys.size && [...next].every(key => keys.has(key))) return\n keys = next\n schedule()\n }\n\n const observer = Observer === undefined ? undefined : new Observer(records => {\n if (list === null) {\n if (records.some(record => [...record.addedNodes].some(node => containsElement(node, LIST_SELECTOR)))) {\n bindList()\n }\n } else if (!list.isConnected) {\n bindList()\n } else if (records.some(record => list?.contains(record.target)\n && ([...record.addedNodes].some(node => containsElement(node, ROW_SELECTOR))\n || [...record.removedNodes].some(node => containsElement(node, `[${DESCRIPTION_ATTRIBUTE}]`))))) {\n schedule()\n }\n })\n function bindList(): void {\n observer?.disconnect()\n if (list !== null) applyActivity(list, new Set())\n list = doc.querySelector(LIST_SELECTOR)\n if (list === null) {\n observer?.observe(doc.documentElement, { childList: true, subtree: true })\n return\n }\n observer?.observe(list, { childList: true, subtree: true })\n for (let parent = list.parentElement; parent !== null; parent = parent.parentElement) {\n observer?.observe(parent, { childList: true })\n }\n schedule()\n }\n\n const disposers = [sources.workspaces, sources.sessions, sources.statuses].map(source => source.subscribe(recompute))\n disposers.push(options.enabled.subscribe(schedule), options.description.subscribe(schedule))\n recompute()\n bindList()\n return () => {\n for (const dispose of disposers) dispose()\n observer?.disconnect()\n if (frame !== undefined) view?.cancelAnimationFrame?.(frame)\n if (list !== null) applyActivity(list, new Set())\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,SAA2B;AAAA,EACtC,EAAE,KAAK,cAAc,OAAO,oBAAoB,MAAM,mBAAmB,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AAAA,MAChF;AAAA,MACA,MAAM,SAAS,MAAM,SAAS;AAAA,QAC5B,MAAM;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,QAAQ,OAAO,EAAE,MAAM,SAAS,YAAY,IAAI,kBAAkB,EAAE;AAAA,MACtE,GAAG,cAAc;AAAA,IACnB,CAAC;AAAA,IACD;AAAA,EACF;AAEA,MAAI,OAAO,CAAC,cAAc,YAAY,aAAa,yBAAyB,GAAG,CAAC,UAAU;AACxF,UAAM,WAAW;AACjB,UAAM;AAAA,MACJ,MAAM,OAAO,aAAa,cACtB,MAAM;AAAA,MAAC,IACP,uBAAuB,UAAU;AAAA,QACjC,YAAY,SAAS,WAAW;AAAA,QAChC,UAAU,SAAS,SAAS;AAAA,QAC5B,UAAU,SAAS,UAAU;AAAA,MAC/B,GAAG;AAAA,QACD,SAAS;AAAA,UACP,aAAa,MAAM,aAAa,SAAS,YAAY,IAAI,kBAAkB,CAAC,GAAG,sBAAsB;AAAA,UACrG,WAAW,CAAC,aAAa,SAAS,YAAY,IAAI,kBAAkB,EAAE,UAAU,QAAQ;AAAA,QAC1F;AAAA,QACA,aAAa;AAAA,UACX,aAAa,MAAM,SAAS,OAAO,KAAK,EAAE,EAAE,kBAAkB;AAAA,UAC9D,WAAW,CAAC,aAAa,SAAS,OAAO,UAAU,QAAQ;AAAA,QAC7D;AAAA,MACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import type { Context as ClientContext } from '@deepseek-ai/cordis';\nimport type {} from '@deepseek-ai/dsh-client-locale/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client';\nimport { bindProjection, readSettings, BUNDLE_NAME, BUNDLE_CONFIG_SLOT, SETTINGS_NAMESPACE, type ConfigForm } from './binding.ts';\nimport { CARD_CSS } from './card-css.ts';\nimport { NativePlusCard } from './card.tsx';\nimport { NS, en, zh } from './locales.ts';\nimport tokens from './styles/tokens.css?inline';\nimport markdown from './styles/markdown.css?inline';\nimport sidebar from './styles/sidebar.css?inline';\nimport {\n watchWorkspaceActivity,\n type SessionListLike,\n type SessionStatusLike,\n type SnapshotSource,\n type WorkspaceListLike,\n} from './workspace-activity.ts';\n\nexport { NS } from './locales.ts';\nexport {\n BUNDLE_CONFIG_SLOT, BUNDLE_NAME, SETTINGS_NAMESPACE, bindProjection, readSettings,\n} from './binding.ts';\nexport { NativePlusCard } from './card.tsx';\nexport {\n applyProjection, clearProjection, DEFAULT_SETTINGS, normalizeSettings,\n projectSettings, ROOT_ATTRIBUTE,\n} from './settings.ts';\nexport { SWITCHES, defaultConfig, normalizeConfig } from './schema.ts';\nexport {\n ACTIVITY_ATTRIBUTE, applyActivity, runningWorkspaceKeys, watchWorkspaceActivity,\n} from './workspace-activity.ts';\n\nexport const name = '@lynn123411/dsh-native-plus';\n\nexport const inject = ['configForms', 'slots', 'locale'];\n\nconst SHEETS: readonly (readonly [string, string])[] = [\n ['tokens.css', tokens],\n ['markdown.css', markdown],\n ['card.css', CARD_CSS],\n ['sidebar.css', sidebar],\n];\n\nfunction injectStyles(): void {\n if (typeof document === 'undefined') return;\n for (const [file, css] of SHEETS) {\n const key = `${name}/${file}`;\n const existing = document.head.querySelector<HTMLStyleElement>(`style[data-plugin-css=\"${key}\"]`);\n const tag = existing ?? document.createElement('style');\n tag.dataset.plugin = name;\n tag.dataset.pluginCss = key;\n tag.textContent = css;\n if (existing === null) document.head.appendChild(tag);\n }\n}\n\nfunction removeStyles(): void {\n if (typeof document === 'undefined') return;\n for (const tag of document.head.querySelectorAll(`style[data-plugin=\"${name}\"]`)) tag.remove();\n}\n\ninterface ClientServices {\n configForms: {\n get(namespace: string): ConfigForm;\n whileServed(namespaces: readonly string[], register: (served: ReadonlySet<string>) => () => void): () => void;\n };\n slots: {\n inject(slot: string, register: () => () => void): () => void;\n register(options: Record<string, unknown>, component: unknown): () => void;\n };\n locale: {\n register(namespace: string, dictionaries: { zh: unknown; en: unknown }): () => void;\n bind(namespace: string): (key: string) => string;\n subscribe(listener: () => void): () => void;\n };\n workspaces: { list: SnapshotSource<WorkspaceListLike> };\n sessions: { list: SnapshotSource<SessionListLike> };\n uiSession: { sessionStatus: SnapshotSource<SessionStatusLike> };\n}\n\nexport function apply(ctx: ClientContext): void {\n const services = ctx as unknown as ClientServices;\n\n ctx.effect(() => {\n injectStyles();\n return () => { removeStyles(); };\n }, 'dsh-native-plus: stylesheets');\n\n ctx.effect(\n () => services.locale.register(NS, { zh, en }),\n 'dsh-native-plus: dictionaries',\n );\n\n ctx.effect(() => {\n if (typeof document === 'undefined') return () => {};\n return bindProjection(document.documentElement, services.configForms.get(SETTINGS_NAMESPACE));\n }, 'dsh-native-plus: projection');\n\n ctx.effect(\n () => services.configForms.whileServed([SETTINGS_NAMESPACE], () => services.slots.inject(\n BUNDLE_CONFIG_SLOT,\n () => services.slots.register({\n name: BUNDLE_CONFIG_SLOT,\n key: BUNDLE_NAME,\n locale: NS,\n inject: () => ({ form: services.configForms.get(SETTINGS_NAMESPACE) }),\n }, NativePlusCard),\n )),\n 'dsh-native-plus: plugins page config',\n );\n\n ctx.inject(['workspaces', 'sessions', 'uiSession', 'uiSession.sessionStatus'], (scope) => {\n const injected = scope as unknown as ClientServices;\n scope.effect(\n () => typeof document === 'undefined'\n ? () => {}\n : watchWorkspaceActivity(document, {\n workspaces: injected.workspaces.list,\n sessions: injected.sessions.list,\n statuses: injected.uiSession.sessionStatus,\n }, {\n enabled: {\n getSnapshot: () => readSettings(services.configForms.get(SETTINGS_NAMESPACE))?.workspaceActivity !== false,\n subscribe: (listener) => services.configForms.get(SETTINGS_NAMESPACE).subscribe(listener),\n },\n description: {\n getSnapshot: () => services.locale.bind(NS)('activity.running'),\n subscribe: (listener) => services.locale.subscribe(listener),\n },\n }),\n 'dsh-native-plus: workspace activity',\n );\n });\n}\n", "export interface Toggle {\n key: string;\n label: string;\n hint?: string;\n default: boolean;\n}\n\nexport const INLINE_CODE_CHILDREN: readonly string[] = ['inlineCodeTint', 'inlineCodeStroke'];\n\nexport const SWITCHES: readonly Toggle[] = [\n { key: 'headings', label: 'field.headings', default: true },\n { key: 'quotes', label: 'field.quotes', default: true },\n { key: 'tables', label: 'field.tables', default: true },\n { key: 'codeBlocks', label: 'field.codeBlocks', default: true },\n { key: 'lists', label: 'field.lists', default: true },\n { key: 'rules', label: 'field.rules', default: true },\n { key: 'changedFiles', label: 'field.changedFiles', default: true },\n { key: 'inlineCode', label: 'field.inlineCode', hint: 'hint.inlineCode', default: true },\n { key: 'inlineCodeTint', label: 'field.inlineCodeTint', default: true },\n { key: 'inlineCodeStroke', label: 'field.inlineCodeStroke', default: false },\n { key: 'workspaceActivity', label: 'field.workspaceActivity', hint: 'hint.workspaceActivity', default: true },\n];\n\nexport type Config = Record<string, boolean>;\n\nexport function defaultConfig(): Config {\n const out: Config = {};\n for (const field of SWITCHES) out[field.key] = field.default;\n return out;\n}\n\nexport function normalizeConfig(raw: Partial<Record<string, unknown>> | undefined | null): Config {\n const source = raw ?? {};\n const out: Config = {};\n for (const field of SWITCHES) {\n out[field.key] = typeof source[field.key] === 'boolean' ? source[field.key] as boolean : field.default;\n }\n return out;\n}\n", "import { defaultConfig, normalizeConfig, type Config } from './schema.ts';\n\nexport const ROOT_ATTRIBUTE = 'data-native-plus';\nexport const ACTIVITY_ROOT_ATTRIBUTE = 'data-np-activity';\nexport const INLINE_TINT_ATTRIBUTE = 'data-np-inline-tint';\nexport const INLINE_STROKE_ATTRIBUTE = 'data-np-inline-stroke';\n\nexport const FEATURE_ATTRIBUTES: Readonly<Record<string, string>> = {\n headings: 'data-np-headings',\n quotes: 'data-np-quotes',\n tables: 'data-np-tables',\n codeBlocks: 'data-np-code',\n lists: 'data-np-lists',\n rules: 'data-np-rules',\n changedFiles: 'data-np-changed-files',\n};\n\nexport const PROJECTED_ATTRIBUTES: readonly string[] = [\n ROOT_ATTRIBUTE,\n ...Object.values(FEATURE_ATTRIBUTES),\n INLINE_TINT_ATTRIBUTE,\n INLINE_STROKE_ATTRIBUTE,\n ACTIVITY_ROOT_ATTRIBUTE,\n];\n\nexport interface Projection {\n attributes: Record<string, string | null>;\n}\n\nexport type Settings = Config;\n\nexport const DEFAULT_SETTINGS: Readonly<Settings> = Object.freeze(defaultConfig());\n\nexport function normalizeSettings(raw: Partial<Record<string, unknown>> | undefined | null): Settings {\n return normalizeConfig(raw);\n}\n\nexport function projectSettings(settings: Settings, enabled = true): Projection {\n const attributes: Record<string, string | null> = {};\n attributes[ROOT_ATTRIBUTE] = enabled ? 'on' : null;\n for (const [key, attribute] of Object.entries(FEATURE_ATTRIBUTES)) {\n attributes[attribute] = enabled && settings[key] === true ? 'on' : null;\n }\n attributes[INLINE_TINT_ATTRIBUTE] = enabled && settings.inlineCode === true && settings.inlineCodeTint === true ? 'on' : null;\n attributes[INLINE_STROKE_ATTRIBUTE] = enabled && settings.inlineCode === true && settings.inlineCodeStroke === true ? 'on' : null;\n attributes[ACTIVITY_ROOT_ATTRIBUTE] = enabled && settings.workspaceActivity === true ? 'on' : null;\n return { attributes };\n}\n\nexport function applyProjection(root: HTMLElement, projection: Projection): void {\n for (const [attribute, value] of Object.entries(projection.attributes)) {\n if (value === null) root.removeAttribute(attribute);\n else root.setAttribute(attribute, value);\n }\n}\n\nexport function clearProjection(root: HTMLElement): void {\n applyProjection(root, projectSettings(normalizeSettings(undefined), false));\n}\n", "import {\n applyProjection,\n clearProjection,\n normalizeSettings,\n projectSettings,\n type Settings,\n} from './settings.ts';\n\nexport const SETTINGS_NAMESPACE = 'dsh-native-plus';\n\nexport const BUNDLE_CONFIG_SLOT = 'plugins.bundle.config';\n\nexport const BUNDLE_NAME = '@lynn123411/dsh-native-plus';\n\nexport interface ConfigForm {\n getSnapshot(): {\n status: 'loading' | 'ready' | 'unavailable';\n value?: Partial<Record<string, unknown>> | undefined;\n writable?: boolean;\n revision?: number | undefined;\n };\n subscribe(listener: () => void): () => void;\n set(field: string, value: unknown): Promise<boolean>;\n mutate(ops: readonly FormOp[], expectedRevision?: number): Promise<boolean>;\n}\n\nexport type FormOp =\n | { op: 'set'; path: string[]; value: unknown }\n | { op: 'unset'; path: string[] };\n\nexport function readSettings(form: ConfigForm): Settings | undefined {\n const snapshot = form.getSnapshot();\n if (snapshot.status === 'unavailable') return undefined;\n return normalizeSettings(snapshot.value);\n}\n\nexport function bindProjection(root: HTMLElement, form: ConfigForm): () => void {\n const sync = (): void => {\n const settings = readSettings(form);\n applyProjection(root, projectSettings(settings ?? normalizeSettings(undefined)));\n };\n sync();\n const off = form.subscribe(sync);\n return () => {\n off();\n clearProjection(root);\n };\n}\n", "export const CARD_CSS = `\n.dsh-np-card{display:flex;flex-direction:column;gap:16px;padding:16px 0}\n.dsh-np-rows{display:flex;flex-direction:column}\n.dsh-np-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:0.5px solid var(--dsw-alias-border-l1)}\n.dsh-np-rows > .dsh-np-row:last-child{border-bottom:0}\n.dsh-np-row-info{display:flex;flex-direction:column;gap:2px;min-width:0}\n.dsh-np-row-title{font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}\n.dsh-np-row-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}\n.dsh-np-row-field{flex:none;display:flex;align-items:center;gap:8px}\n.dsh-np-subrows{display:flex;flex-direction:column;padding-inline-start:14px;margin-inline-start:3px;border-inline-start:1px solid var(--dsw-alias-border-l1)}\n.dsh-np-subrows > .dsh-np-row{padding:6px 0}\n.dsh-np-note{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);padding-top:8px}\n.dsh-np-empty{font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary)}\n`;\n", "import { Fragment, useEffect, useState } from 'react';\nimport * as React from 'react';\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';\nimport { readSettings, type ConfigForm } from './binding.ts';\nimport { INLINE_CODE_CHILDREN, SWITCHES, defaultConfig, type Config, type Toggle } from './schema.ts';\nimport { NS } from './locales.ts';\n\ntype Translate = (key: string) => string;\n\nconst INLINE_CHILDREN = INLINE_CODE_CHILDREN\n .map((key) => SWITCHES.find((field) => field.key === key))\n .filter((field): field is Toggle => field !== undefined);\n\nconst TOP_LEVEL = SWITCHES.filter((field) => !INLINE_CODE_CHILDREN.includes(field.key));\n\nfunction Row({ title, hint, children }: {\n title: string;\n hint?: string | undefined;\n children: React.ReactNode;\n}): React.ReactElement {\n return (\n <div className=\"dsh-np-row\">\n <div className=\"dsh-np-row-info\">\n <div className=\"dsh-np-row-title\">{title}</div>\n {hint !== undefined && <div className=\"dsh-np-row-hint\">{hint}</div>}\n </div>\n <div className=\"dsh-np-row-field\">{children}</div>\n </div>\n );\n}\n\nexport function NativePlusCard(\n props: PropsRuntime<'plugins.bundle.config'> & PropsLocale<typeof NS> & { form: ConfigForm },\n): React.ReactElement {\n const { form } = props;\n const t: Translate = (key: string) => (props as unknown as { t: (k: string) => string }).t(key);\n const [settings, setSettings] = useState<Config | undefined>(() => readSettings(form));\n const [available, setAvailable] = useState(() => form.getSnapshot().status !== 'unavailable');\n\n useEffect(() => {\n const sync = (): void => {\n setSettings(readSettings(form));\n setAvailable(form.getSnapshot().status !== 'unavailable');\n };\n sync();\n return form.subscribe(sync);\n }, [form]);\n\n if (!available) {\n return <div className=\"dsh-np-card\"><div className=\"dsh-np-empty\">{t('state.unavailable')}</div></div>;\n }\n\n const current: Config = settings ?? defaultConfig();\n const write = (key: string, next: boolean): void => { void form.set(key, next); };\n\n return (\n <div className=\"dsh-np-card\">\n <div className=\"dsh-np-rows\">\n {TOP_LEVEL.map((field) => (\n <Fragment key={field.key}>\n <Row\n title={t(field.label)}\n hint={field.hint === undefined ? undefined : t(field.hint)}\n >\n <Switch label={t(field.label)} checked={current[field.key] === true}\n onChange={(next: boolean) => { write(field.key, next) }} />\n </Row>\n {field.key === 'inlineCode' && current.inlineCode === true && (\n <div className=\"dsh-np-subrows\">\n {INLINE_CHILDREN.map((child) => (\n <Row key={child.key} title={t(child.label)}>\n <Switch label={t(child.label)} checked={current[child.key] === true}\n onChange={(next: boolean) => { write(child.key, next) }} />\n </Row>\n ))}\n </div>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"dsh-np-note\">{t('note.scope')}</div>\n </div>\n );\n}\n", "export const NS = 'nativeplus';\n\nexport const en = {\n 'field.headings': 'Heading decoration',\n 'field.quotes': 'Quoted blocks',\n 'field.tables': 'Tables',\n 'field.codeBlocks': 'Code blocks',\n 'field.lists': 'List markers',\n 'field.rules': 'Dividers',\n 'field.changedFiles': 'Changed files card',\n 'field.inlineCode': 'Inline code',\n 'hint.inlineCode': 'When on, the two sub-options appear below.',\n 'field.inlineCodeTint': 'Darker grey background',\n 'field.inlineCodeStroke': 'Stroke and glow',\n 'field.workspaceActivity': 'Workspace activity indicator',\n 'hint.workspaceActivity': 'Shows a breathing dot on the workspace row while a session in it is running.',\n 'activity.running': 'A session is running',\n\n 'state.unavailable': 'The Host does not serve this configuration right now.',\n 'note.scope': 'Colors are the ones DSH already ships. Each conversation decoration can be turned off on its own.',\n} as const;\n\nexport const zh: Record<keyof typeof en, string> = {\n 'field.headings': '\u6807\u9898\u88C5\u9970',\n 'field.quotes': '\u5F15\u7528\u5361\u7247',\n 'field.tables': '\u8868\u683C\u5361\u7247',\n 'field.codeBlocks': '\u4EE3\u7801\u5757',\n 'field.lists': '\u5217\u8868\u6807\u8BB0',\n 'field.rules': '\u5206\u9694\u7EBF',\n 'field.changedFiles': '\u6587\u4EF6\u6539\u52A8\u5361\u7247',\n 'field.inlineCode': '\u884C\u5185\u4EE3\u7801',\n 'hint.inlineCode': '\u6253\u5F00\u540E\uFF0C\u4E0B\u9762\u4F1A\u5C55\u5F00\u4E24\u4E2A\u5B50\u9879\u3002',\n 'field.inlineCodeTint': '\u52A0\u6DF1\u7070\u8272',\n 'field.inlineCodeStroke': '\u63CF\u8FB9\u6837\u5F0F',\n 'field.workspaceActivity': '\u5DE5\u4F5C\u533A\u8FD0\u884C\u6807\u8BB0',\n 'hint.workspaceActivity': '\u5DE5\u4F5C\u533A\u91CC\u6709\u4F1A\u8BDD\u6B63\u5728\u8FD0\u884C\u65F6\uFF0C\u884C\u5C3E\u663E\u793A\u547C\u5438\u5706\u70B9\u3002',\n 'activity.running': '\u6709\u4F1A\u8BDD\u6B63\u5728\u8FD0\u884C',\n\n 'state.unavailable': '\u5BBF\u4E3B\u5F53\u524D\u6CA1\u6709\u63D0\u4F9B\u8FD9\u4EFD\u914D\u7F6E\u3002',\n 'note.scope': '\u989C\u8272\u5168\u90E8\u6CBF\u7528 DSH \u81EA\u5E26\u7684\u90A3\u5957\u3002\u6B63\u6587\u88C5\u9970\u53EF\u4EE5\u9010\u9879\u5F00\u5173\u3002',\n};\n", "\nhtml[data-native-plus='on'] body {\n --np-heading-strong: var(--dsw-static-blue-800);\n --np-heading-soft: var(--dsw-static-blue-600);\n\n --np-h1: var(--np-heading-strong);\n --np-h2: color-mix(in srgb, var(--np-heading-strong) 80%, var(--np-heading-soft));\n --np-h3: color-mix(in srgb, var(--np-heading-strong) 60%, var(--np-heading-soft));\n --np-h4: color-mix(in srgb, var(--np-heading-strong) 40%, var(--np-heading-soft));\n --np-h5: color-mix(in srgb, var(--np-heading-strong) 20%, var(--np-heading-soft));\n --np-h6: var(--np-heading-soft);\n\n --np-tint-weak: color-mix(in srgb, var(--dsw-alias-link) 6%, var(--dsw-alias-bg-base));\n --np-tint-strong: color-mix(in srgb, var(--dsw-alias-link) 10%, var(--dsw-alias-bg-base));\n --np-hairline: color-mix(in srgb, var(--dsw-alias-link) 22%, transparent);\n --np-rule: color-mix(in srgb, var(--dsw-alias-link) 30%, transparent);\n\n --np-quote-fill: var(--np-tint-weak);\n --np-quote-bar: var(--dsw-alias-link);\n --np-table-head: var(--np-tint-strong);\n --np-inline-tint: color-mix(in srgb, var(--dsw-alias-markdown-inline-code) 94%, var(--dsw-static-neutral-1000));\n --np-inline-code-glow:\n 0 1px 2px color-mix(in srgb, var(--dsw-static-neutral-1000) 14%, transparent),\n 0 2px 6px color-mix(in srgb, var(--dsw-static-neutral-1000) 8%, transparent);\n --np-code-block: var(--dsw-alias-markdown-code-block);\n --np-code-banner: var(--dsw-alias-markdown-code-block-banner);\n --np-list-marker: var(--dsw-alias-link);\n}\n\nhtml[data-native-plus='on'] body[data-ds-dark-theme] {\n --np-heading-strong: var(--dsw-static-blue-300);\n --np-heading-soft: var(--dsw-static-blue-500);\n --np-inline-code-glow:\n 0 1px 2px color-mix(in srgb, var(--dsw-static-neutral-1000) 60%, transparent),\n 0 2px 6px color-mix(in srgb, var(--dsw-static-neutral-1000) 40%, transparent);\n}\n", "html[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6) {\n margin: 28px 0 12px;\n}\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) {\n font-size: calc(var(--dsh-content-font-size, 14px) * 1.05);\n font-weight: 600;\n line-height: 1.5;\n}\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n line-height: 1.6;\n}\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1) { color: var(--np-h1); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2) { color: var(--np-h2); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3) { color: var(--np-h3); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4) { color: var(--np-h4); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) { color: var(--np-h5); }\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) { color: var(--np-h6); }\n\nhtml[data-native-plus='on'][data-np-headings] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6):first-child {\n margin-top: 0;\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) {\n position: relative;\n margin: 14px 0;\n padding: 8px 14px 8px 18px;\n border: 0;\n border-radius: var(--dsw-radius-md);\n background: var(--np-quote-fill);\n box-shadow: var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote)::before {\n content: '';\n position: absolute;\n inset-block: 8px;\n inset-inline-start: 7px;\n width: 3px;\n border-radius: var(--dsw-radius-xs);\n background: var(--np-quote-bar);\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) :where(h1, h2, h3, h4, h5, h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n margin: 6px 0;\n}\n\nhtml[data-native-plus='on'][data-np-quotes] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote blockquote) {\n margin-inline-end: 0;\n background: color-mix(in srgb, var(--np-quote-fill) 70%, var(--dsw-alias-bg-base));\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li)::marker {\n font-family: var(--ds-font-family-code);\n color: var(--np-list-marker);\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul) > :where(li)::marker {\n font-size: 1.15em;\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li) {\n margin: 3px 0;\n}\n\nhtml[data-native-plus='on'][data-np-lists] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(input[type='checkbox']) {\n accent-color: var(--np-list-marker);\n margin-inline-end: 8px;\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(table) {\n border-collapse: separate;\n border-spacing: 0;\n font-size: calc(var(--dsh-content-font-size, 14px) - 1px);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(div):has(> table) {\n border-radius: var(--dsw-radius-md);\n background: var(--dsw-alias-bg-layer-1);\n box-shadow: var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(div):has(> table):focus-visible {\n box-shadow:\n 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)),\n var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th) {\n font-weight: 600;\n background: var(--np-table-head);\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th:first-child, td:first-child) {\n padding-inline-start: 16px;\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th:last-child, td:last-child) {\n padding-inline-end: 16px;\n}\n\nhtml[data-native-plus='on'][data-np-tables] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(tbody > tr:last-child > td) {\n border-bottom: none;\n}\n\nhtml[data-native-plus='on'][data-np-rules] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(hr) {\n height: 1px;\n margin: 28px 0;\n border: 0;\n background: linear-gradient(\n to right,\n transparent 0%,\n var(--np-rule) 22%,\n var(--np-rule) 50%,\n var(--np-rule) 78%,\n transparent 100%\n );\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(.md-code-block) {\n --dsl-code-block-border-radius: var(--dsw-radius-md);\n background: var(--np-code-block);\n box-shadow: var(--dsw-elevation-panel);\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-code-block-banner]) {\n border-bottom: var(--dsh-hairline-width, 0.5px) solid var(--np-hairline);\n background: var(--np-code-banner);\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) {\n color: var(--dsw-alias-label-caption);\n}\n\nhtml[data-native-plus='on'][data-np-code] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) :where(.line)::before {\n color: var(--dsw-alias-label-caption);\n}\n\nhtml[data-native-plus='on'][data-np-inline-tint] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :not(pre) > code {\n background-color: var(--np-inline-tint);\n}\n\nhtml[data-native-plus='on'][data-np-inline-stroke] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :not(pre) > code {\n border-color: var(--dsw-elevation-stroke-color);\n box-shadow: var(--np-inline-code-glow);\n}\n\nhtml[data-native-plus='on'][data-np-changed-files] [data-changed-files] {\n border-color: transparent;\n box-shadow: var(--dsw-elevation-panel);\n}\n", "\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running] {\n position: relative;\n}\n\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]::after {\n content: '';\n position: absolute;\n inset-inline-end: 8px;\n top: 50%;\n width: 6px;\n height: 6px;\n margin-top: -3px;\n border-radius: 50%;\n corner-shape: round;\n background: var(--dsw-alias-label-tertiary);\n animation: dsh-np-breathe 2.4s ease-in-out infinite;\n}\n\n@media (hover: hover) {\n html[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]:hover::after {\n visibility: hidden;\n }\n}\n\nhtml[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]:has([aria-expanded='true'])::after {\n visibility: hidden;\n}\n\n@media (prefers-reduced-motion: reduce) {\n html[data-np-activity='on'] [data-row-key^='workspace:'][data-np-running]::after {\n animation: none;\n }\n}\n\n@keyframes dsh-np-breathe {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 1; }\n}\n", "export interface SnapshotSource<T> {\n getSnapshot(): T\n subscribe(listener: () => void): () => void\n}\n\nexport interface WorkspaceListLike {\n readonly items: readonly {\n readonly workspaceId: string\n readonly sessionIds: readonly string[]\n }[]\n}\n\nexport interface SessionListLike {\n readonly ids: readonly string[]\n readonly byId: Readonly<Record<string, { readonly running?: boolean } | undefined>>\n readonly projectionsBySession: Readonly<Record<string, {\n readonly values: { readonly subagentCatalog?: readonly { readonly id: string }[] }\n } | undefined>>\n}\n\nexport type SessionStatusLike = ReadonlyMap<string, { readonly running?: boolean }>\n\nexport const ACTIVITY_ATTRIBUTE = 'data-np-running'\nconst LIST_SELECTOR = '[data-sidebar-list-area]'\nconst ROW_KEY_PREFIX = 'workspace:'\nconst ROW_SELECTOR = `[data-row-key^=\"${ROW_KEY_PREFIX}\"]`\nconst UNGROUPED_KEY = ''\nconst DESCRIPTION_ATTRIBUTE = 'data-np-activity-description'\nlet nextDescriptionId = 0\nconst descriptionIds = new WeakMap<Element, string>()\n\nexport function runningWorkspaceKeys(\n workspaces: WorkspaceListLike,\n sessions: SessionListLike,\n statuses: SessionStatusLike,\n): Set<string> {\n const keys = new Set<string>()\n const accounted = new Set<string>()\n const running = (id: string): boolean =>\n (statuses.get(id)?.running ?? sessions.byId[id]?.running) === true\n const active = (id: string): boolean => running(id)\n || sessions.projectionsBySession[id]?.values.subagentCatalog?.some(child => running(child.id)) === true\n\n for (const workspace of workspaces.items) {\n for (const id of workspace.sessionIds) accounted.add(id)\n if (workspace.sessionIds.some(active)) keys.add(workspace.workspaceId)\n }\n if (sessions.ids.some(id => !accounted.has(id) && active(id))) keys.add(UNGROUPED_KEY)\n return keys\n}\n\nexport function applyActivity(list: ParentNode, keys: ReadonlySet<string>, description = ''): void {\n for (const row of list.querySelectorAll(ROW_SELECTOR)) {\n const key = row.getAttribute('data-row-key')?.slice(ROW_KEY_PREFIX.length)\n const active = key !== undefined && keys.has(key)\n row.toggleAttribute(ACTIVITY_ATTRIBUTE, active)\n let label = row.querySelector<HTMLElement>(`[${DESCRIPTION_ATTRIBUTE}]`)\n if (active && description) {\n if (label === null) {\n label = row.ownerDocument.createElement('span')\n label.setAttribute(DESCRIPTION_ATTRIBUTE, '')\n label.id = descriptionIds.get(row) ?? `dsh-np-activity-${++nextDescriptionId}`\n descriptionIds.set(row, label.id)\n Object.assign(label.style, { position: 'absolute', width: '1px', height: '1px', padding: '0', margin: '-1px', overflow: 'hidden', clipPath: 'inset(50%)', whiteSpace: 'nowrap', border: '0' })\n row.appendChild(label)\n }\n label.textContent = description\n const ids = (row.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean)\n if (!ids.includes(label.id)) row.setAttribute('aria-describedby', [...ids, label.id].join(' '))\n } else {\n const ownedId = label?.id ?? descriptionIds.get(row)\n if (ownedId !== undefined) {\n const ids = (row.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(id => id && id !== ownedId)\n if (ids.length) row.setAttribute('aria-describedby', ids.join(' '))\n else row.removeAttribute('aria-describedby')\n descriptionIds.delete(row)\n }\n label?.remove()\n }\n }\n}\n\nexport interface ActivitySources {\n workspaces: SnapshotSource<WorkspaceListLike>\n sessions: SnapshotSource<SessionListLike>\n statuses: SnapshotSource<SessionStatusLike>\n}\n\nfunction containsElement(node: Node, selector: string): boolean {\n if (node.nodeType !== 1) return false\n const element = node as Element\n return element.matches(selector) || element.querySelector(selector) !== null\n}\n\nexport function watchWorkspaceActivity(doc: Document, sources: ActivitySources, options: {\n enabled: SnapshotSource<boolean>\n description: SnapshotSource<string>\n}): () => void {\n const view = doc.defaultView\n const Observer = view?.MutationObserver\n let list: Element | null = null\n let keys: ReadonlySet<string> = new Set()\n let frame: number | undefined\n const paint = (): void => {\n frame = undefined\n if (list !== null) applyActivity(list, options.enabled.getSnapshot() ? keys : new Set(), options.description.getSnapshot())\n }\n const schedule = (): void => {\n if (list === null || frame !== undefined) return\n if (view?.requestAnimationFrame === undefined) paint()\n else frame = view.requestAnimationFrame(paint)\n }\n const recompute = (): void => {\n const next = runningWorkspaceKeys(\n sources.workspaces.getSnapshot(), sources.sessions.getSnapshot(), sources.statuses.getSnapshot(),\n )\n if (next.size === keys.size && [...next].every(key => keys.has(key))) return\n keys = next\n schedule()\n }\n\n const observer = Observer === undefined ? undefined : new Observer(records => {\n if (list === null) {\n if (records.some(record => [...record.addedNodes].some(node => containsElement(node, LIST_SELECTOR)))) {\n bindList()\n }\n } else if (!list.isConnected) {\n bindList()\n } else if (records.some(record => list?.contains(record.target)\n && ([...record.addedNodes].some(node => containsElement(node, ROW_SELECTOR))\n || [...record.removedNodes].some(node => containsElement(node, `[${DESCRIPTION_ATTRIBUTE}]`))))) {\n schedule()\n }\n })\n function bindList(): void {\n observer?.disconnect()\n if (list !== null) applyActivity(list, new Set())\n list = doc.querySelector(LIST_SELECTOR)\n if (list === null) {\n observer?.observe(doc.documentElement, { childList: true, subtree: true })\n return\n }\n observer?.observe(list, { childList: true, subtree: true })\n for (let parent = list.parentElement; parent !== null; parent = parent.parentElement) {\n observer?.observe(parent, { childList: true })\n }\n schedule()\n }\n\n const disposers = [sources.workspaces, sources.sessions, sources.statuses].map(source => source.subscribe(recompute))\n disposers.push(options.enabled.subscribe(schedule), options.description.subscribe(schedule))\n recompute()\n bindList()\n return () => {\n for (const dispose of disposers) dispose()\n observer?.disconnect()\n if (frame !== undefined) view?.cancelAnimationFrame?.(frame)\n if (list !== null) applyActivity(list, new Set())\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOO,IAAM,uBAA0C,CAAC,kBAAkB,kBAAkB;AAErF,IAAM,WAA8B;AAAA,EACzC,EAAE,KAAK,YAAY,OAAO,kBAAkB,SAAS,KAAK;AAAA,EAC1D,EAAE,KAAK,UAAU,OAAO,gBAAgB,SAAS,KAAK;AAAA,EACtD,EAAE,KAAK,UAAU,OAAO,gBAAgB,SAAS,KAAK;AAAA,EACtD,EAAE,KAAK,cAAc,OAAO,oBAAoB,SAAS,KAAK;AAAA,EAC9D,EAAE,KAAK,SAAS,OAAO,eAAe,SAAS,KAAK;AAAA,EACpD,EAAE,KAAK,SAAS,OAAO,eAAe,SAAS,KAAK;AAAA,EACpD,EAAE,KAAK,gBAAgB,OAAO,sBAAsB,SAAS,KAAK;AAAA,EAClE,EAAE,KAAK,cAAc,OAAO,oBAAoB,MAAM,mBAAmB,SAAS,KAAK;AAAA,EACvF,EAAE,KAAK,kBAAkB,OAAO,wBAAwB,SAAS,KAAK;AAAA,EACtE,EAAE,KAAK,oBAAoB,OAAO,0BAA0B,SAAS,MAAM;AAAA,EAC3E,EAAE,KAAK,qBAAqB,OAAO,2BAA2B,MAAM,0BAA0B,SAAS,KAAK;AAC9G;AAIO,SAAS,gBAAwB;AACtC,QAAM,MAAc,CAAC;AACrB,aAAW,SAAS,SAAU,KAAI,MAAM,GAAG,IAAI,M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,QAC5B,UAAU,SAAS,UAAU;AAAA,MAC/B,GAAG;AAAA,QACD,SAAS;AAAA,UACP,aAAa,MAAM,aAAa,SAAS,YAAY,IAAI,kBAAkB,CAAC,GAAG,sBAAsB;AAAA,UACrG,WAAW,CAAC,aAAa,SAAS,YAAY,IAAI,kBAAkB,EAAE,UAAU,QAAQ;AAAA,QAC1F;AAAA,QACA,aAAa;AAAA,UACX,aAAa,MAAM,SAAS,OAAO,KAAK,EAAE,EAAE,kBAAkB;AAAA,UAC9D,WAAW,CAAC,aAAa,SAAS,OAAO,UAAU,QAAQ;AAAA,QAC7D;AAAA,MACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/lib/index.js
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
|
|
4
4
|
// src/client/schema.ts
|
|
5
|
-
var FIELDS = [
|
|
6
|
-
{ key: "lineHeight", label: "field.lineHeight", hint: "hint.lineHeight", min: 1.4, max: 2, step: 0.05, unit: "\xD7", default: 1.75 },
|
|
7
|
-
{ key: "paragraphGap", label: "field.paragraphGap", hint: "hint.paragraphGap", min: 4, max: 24, step: 1, unit: "px", default: 10 }
|
|
8
|
-
];
|
|
9
5
|
var SWITCHES = [
|
|
10
|
-
{ key: "
|
|
11
|
-
{ key: "
|
|
6
|
+
{ key: "headings", label: "field.headings", default: true },
|
|
7
|
+
{ key: "quotes", label: "field.quotes", default: true },
|
|
8
|
+
{ key: "tables", label: "field.tables", default: true },
|
|
9
|
+
{ key: "codeBlocks", label: "field.codeBlocks", default: true },
|
|
10
|
+
{ key: "lists", label: "field.lists", default: true },
|
|
11
|
+
{ key: "rules", label: "field.rules", default: true },
|
|
12
|
+
{ key: "changedFiles", label: "field.changedFiles", default: true },
|
|
13
|
+
{ key: "inlineCode", label: "field.inlineCode", hint: "hint.inlineCode", default: true },
|
|
14
|
+
{ key: "inlineCodeTint", label: "field.inlineCodeTint", default: true },
|
|
15
|
+
{ key: "inlineCodeStroke", label: "field.inlineCodeStroke", default: false },
|
|
16
|
+
{ key: "workspaceActivity", label: "field.workspaceActivity", hint: "hint.workspaceActivity", default: true }
|
|
12
17
|
];
|
|
13
18
|
|
|
14
19
|
// src/index.ts
|
|
@@ -17,9 +22,6 @@ var inject = ["settings"];
|
|
|
17
22
|
var SETTINGS_NAMESPACE = name;
|
|
18
23
|
function buildShape() {
|
|
19
24
|
const shape = {};
|
|
20
|
-
for (const field of FIELDS) {
|
|
21
|
-
shape[field.key] = z.number().step(field.step).min(field.min).max(field.max).default(field.default).volatile();
|
|
22
|
-
}
|
|
23
25
|
for (const field of SWITCHES) shape[field.key] = z.boolean().default(field.default).volatile();
|
|
24
26
|
return shape;
|
|
25
27
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/client/schema.ts"],
|
|
4
|
-
"sourcesContent": ["import z from '@deepseek-ai/schemastery';\n\nimport {
|
|
5
|
-
"mappings": ";AAAA,OAAO,OAAO;;;
|
|
4
|
+
"sourcesContent": ["import z from '@deepseek-ai/schemastery';\n\nimport { SWITCHES } from './client/schema.ts';\n\nexport const name = 'dsh-native-plus';\n\nexport const inject = ['settings'];\n\nexport const SETTINGS_NAMESPACE = name;\n\nfunction buildShape(): Record<string, unknown> {\n const shape: Record<string, unknown> = {};\n for (const field of SWITCHES) shape[field.key] = z.boolean().default(field.default).volatile();\n return shape;\n}\n\nexport const Config = z.object(buildShape());\n\ninterface HostContext {\n fiber: unknown;\n settings: {\n configure(presentation: { auto?: boolean }, owner?: unknown): () => void;\n };\n}\n\nexport function apply(ctx: HostContext): void {\n ctx.settings.configure({ auto: false }, ctx.fiber);\n}\n", "export interface Toggle {\n key: string;\n label: string;\n hint?: string;\n default: boolean;\n}\n\nexport const INLINE_CODE_CHILDREN: readonly string[] = ['inlineCodeTint', 'inlineCodeStroke'];\n\nexport const SWITCHES: readonly Toggle[] = [\n { key: 'headings', label: 'field.headings', default: true },\n { key: 'quotes', label: 'field.quotes', default: true },\n { key: 'tables', label: 'field.tables', default: true },\n { key: 'codeBlocks', label: 'field.codeBlocks', default: true },\n { key: 'lists', label: 'field.lists', default: true },\n { key: 'rules', label: 'field.rules', default: true },\n { key: 'changedFiles', label: 'field.changedFiles', default: true },\n { key: 'inlineCode', label: 'field.inlineCode', hint: 'hint.inlineCode', default: true },\n { key: 'inlineCodeTint', label: 'field.inlineCodeTint', default: true },\n { key: 'inlineCodeStroke', label: 'field.inlineCodeStroke', default: false },\n { key: 'workspaceActivity', label: 'field.workspaceActivity', hint: 'hint.workspaceActivity', default: true },\n];\n\nexport type Config = Record<string, boolean>;\n\nexport function defaultConfig(): Config {\n const out: Config = {};\n for (const field of SWITCHES) out[field.key] = field.default;\n return out;\n}\n\nexport function normalizeConfig(raw: Partial<Record<string, unknown>> | undefined | null): Config {\n const source = raw ?? {};\n const out: Config = {};\n for (const field of SWITCHES) {\n out[field.key] = typeof source[field.key] === 'boolean' ? source[field.key] as boolean : field.default;\n }\n return out;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,OAAO;;;ACSP,IAAM,WAA8B;AAAA,EACzC,EAAE,KAAK,YAAY,OAAO,kBAAkB,SAAS,KAAK;AAAA,EAC1D,EAAE,KAAK,UAAU,OAAO,gBAAgB,SAAS,KAAK;AAAA,EACtD,EAAE,KAAK,UAAU,OAAO,gBAAgB,SAAS,KAAK;AAAA,EACtD,EAAE,KAAK,cAAc,OAAO,oBAAoB,SAAS,KAAK;AAAA,EAC9D,EAAE,KAAK,SAAS,OAAO,eAAe,SAAS,KAAK;AAAA,EACpD,EAAE,KAAK,SAAS,OAAO,eAAe,SAAS,KAAK;AAAA,EACpD,EAAE,KAAK,gBAAgB,OAAO,sBAAsB,SAAS,KAAK;AAAA,EAClE,EAAE,KAAK,cAAc,OAAO,oBAAoB,MAAM,mBAAmB,SAAS,KAAK;AAAA,EACvF,EAAE,KAAK,kBAAkB,OAAO,wBAAwB,SAAS,KAAK;AAAA,EACtE,EAAE,KAAK,oBAAoB,OAAO,0BAA0B,SAAS,MAAM;AAAA,EAC3E,EAAE,KAAK,qBAAqB,OAAO,2BAA2B,MAAM,0BAA0B,SAAS,KAAK;AAC9G;;;ADjBO,IAAM,OAAO;AAEb,IAAM,SAAS,CAAC,UAAU;AAE1B,IAAM,qBAAqB;AAElC,SAAS,aAAsC;AAC7C,QAAM,QAAiC,CAAC;AACxC,aAAW,SAAS,SAAU,OAAM,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,MAAM,OAAO,EAAE,SAAS;AAC7F,SAAO;AACT;AAEO,IAAM,SAAS,EAAE,OAAO,WAAW,CAAC;AASpC,SAAS,MAAM,KAAwB;AAC5C,MAAI,SAAS,UAAU,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK;AACnD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Native Plus",
|
|
4
|
-
"description": "Polishes conversation typography on top of the colors DSH already ships: a blue scale for the six heading levels, quotes and tables, code blocks
|
|
4
|
+
"description": "Polishes conversation typography on top of the colors DSH already ships: a blue scale for the six heading levels, quotes and tables, code blocks.",
|
|
5
5
|
"detail": "docs/DETAIL.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynn123411/dsh-native-plus",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "在 DSH
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "在 DSH 自带的蓝白黑之上增强对话正文的装饰:六级标题的蓝阶、引用与表格、代码块;侧边栏工作区行显示运行标记。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|