@yunkersek/dsh-prts-theme 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-prts authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,106 @@
1
- # Temporary Holding Version
1
+ # PRTS 主题 · @yunkersek/dsh-prts-theme
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 把 [prts-design](https://mooncellwiki.github.io/prts-design/storybook/)(明日方舟 PRTS wiki 的设计系统)的配色带进 DeepSeek Harness。注册两个真主题:
4
+
5
+ | 主题 id | 名称 | 对应设计系统 | 气质 |
6
+ | --- | --- | --- | --- |
7
+ | `prts-dark` | PRTS 主题 · 终端(暗) | Storybook 工具栏「主题 终端(暗)」 | 近黑画布 `#0f0f10` + 官网青 `#18d1ff`,游戏内终端界面 |
8
+ | `prts-light` | PRTS 主题 · 日间(亮) | Storybook「宿主页面:prts.wiki」 | 浅灰画布 `#f5f5f5` + 游戏内蓝 `#0098dc`,wiki 阅读界面 |
9
+
10
+ 装上后**默认直接切到终端暗色**,不需要进设置;在「设置 → 外观」顶部新增的一行里可随时切回跟随系统或日间亮色。
11
+
12
+ ## 目录
13
+
14
+ ```
15
+ prts-theme/
16
+ ├─ package.json # bundle + client 声明
17
+ ├─ cordis.patch.yml # 插入 prts-theme 插件行
18
+ ├─ index.js # Host half(空实现)
19
+ ├─ client.js # 主题注册 + 设置行(Web)
20
+ ├─ locale/{zh,en}.json
21
+ ├─ icon.svg
22
+ └─ preview.html # 离线令牌预览,直接双击看
23
+ ```
24
+
25
+ ## 设计取值
26
+
27
+ 全部取自仓库 `packages/tokens` 的语义令牌,不自己调色:
28
+
29
+ - **画布/表面**:`bg-canvas` → `bg-layer-1/2/3` 四级递减,卡片靠 1px 描边和阴影分层,不靠大圆角。
30
+ - **唯一强调色**:暗色用 `brand.cyan-500 #18d1ff`(PRTS 官网青),亮色用 `brand.blue-500 #0098dc`(游戏内蓝)。强调色只落在可交互元素上;`accent-2` 保留 PRTS 的警示黄 `#ffd800`。
31
+ - **描边**:`border-l1 #262729 / #e8eaeb` 最轻、`border-l2 #2f3133 / #d9dbdc` 常规,`border-l4` 收紧到近乎发丝。
32
+ - **状态色**:success `#4fd18f / #1f8f5f`、warning `#ffb340 / #b86f00`、error `#ff5c5c / #c8102e`、idle `#5b5d60 / #8d8d8d`。
33
+ - **圆角**:PRTS 是方正界面 —— 主题把 `--dsw-radius-xs…panel` 压到 `2/2/3/4/4/6px`,仅保留给开关、头像之类的小件。
34
+ - **焦点/选中**:`--dsw-elevation-stroke-color` 染成 20% 青,选中文本 `rgba(24,209,255,.28)`。
35
+ - **稀有度**:1–6 星的橙/紫/蓝/黄梯度保留在令牌里给 markdown/富文本用。
36
+
37
+ 字体不归主题管(DSH 另行设置):想更接近 PRTS,可在设置里把界面字体设成 `Source Han Sans SC, PingFang SC, Microsoft YaHei`,等宽设成 `Cascadia Mono`,标题字重交给系统字体即可。
38
+
39
+ ## 整皮重绘(不只是换色)
40
+
41
+ DSH 的 CSS module 编译后类名形如 `_newSession_<hash>_<line>`。主题用 `[class*='newSession']` 这类「局部名包含」选择器,配合 `data-slot` 槽位做钩子——不绑哈希、不依赖布局结构,升级后大概率仍命中。
42
+
43
+ | 控件 | 处理 |
44
+ | --- | --- |
45
+ | 侧栏「新会话」 | 9px 斜切角 + 青色渐变板 + 1px 青描边 + 顶边 2×52px 青色刻度,标签字距 `.14em` |
46
+ | 发送键 | 斜切角、实心青底、深色前景 `#04161c`,悬停加青晕 |
47
+ | 输入区「+」 | 发丝方框,悬停转青边 |
48
+ | 图标键(侧栏折叠、头部工具) | 方正 2px,悬停 1px 青描边 |
49
+ | 面板行 / 选中项 | 悬停 6% 青晕,选中 inset 2px 青条 |
50
+ | 页签 | 选中态青字 + inset 2px 青底条 |
51
+ | 菜单 / 选项 | 悬停青晕,圆角 0–2px |
52
+ | 滚动条 | 方形滑块,悬停转青 |
53
+ | 全局圆角 | `--dsw-radius-*` 压到 2–6px;卡片/弹层/提示再兜一层 `border-radius: 2px` |
54
+ | 时间线进度条 | 按 `components/progress.css`:8px 平轨 + 方形两端 + accent 实心填充;未完成段 `-45°` 条纹;分段 1px 缝;百分比 label 字体 + tabular-nums |
55
+
56
+ 只覆盖视觉属性(色值、描边、圆角、字距、阴影、伪元素),不动布局与交互;暗亮各一套,按 `html[data-prts-theme='dark'|'light']` 分流。
57
+
58
+ 改完 `client.js` 用 `plugin_manager action=remove_bundle target="@yunkersek/dsh-prts-theme"` 再 `install_bundle target=E:\Codes\prts-theme` 重装即可热应用,不必刷新页面。(对已装包直接 `install_bundle` 会返回 `already-installed`,中间必须摘一次。)
59
+
60
+ 验证方式:宿主窗口不允许外部注入按键、浏览器通道也拒绝打开宿主地址,所以只能截图取色 + 人眼确认——已核对新会话板底 `rgb(22,49,57)`、青描边、发送键 `#18d1ff`,以及时间线 dock 进度条的方形平轨、绿/青分段、pending 条纹与 `60.00%` 百分比排版(对照图 `docs/progress-before-after.png`);设置行、亮色皮肤、各控件悬停态必须人工点一下。
61
+
62
+ ## 进度条(移植 Storybook 的 Progress)
63
+
64
+ `@deepseek-ai/dsh-timeline` 的进度条由 `src/client/Progress.tsx` 渲染成 `.timeline-progress`(`data-segmented` 时按 done / active / pending / blocked 切段),样式写在同包 `src/client/timeline.css`:6–8px 高、`border-radius: 8px`、0.5px 描边、活动段带流动光泽。主题按 `prts-design/packages/css/src/components/progress.css` 重写:
65
+
66
+ | PRTS `progress.css` | 本主题落地 |
67
+ | --- | --- |
68
+ | `.ak-progress` 8px 平轨、`--ak-bg-surface-3`、无圆角 | `.timeline-progress` → 8px、`--prts-meter-track`、`border-radius: 0`;0.5px 描边换成 inset 1px 发丝 |
69
+ | `.ak-progress::before` 实心 accent 填充 | 非分段条 `> span` 用 `--dsw-alias-brand-primary` 实心,过渡 320ms |
70
+ | `.ak-progress--stripes` 的 `-45deg` 条纹 | pending 段 = 条纹 reserve;blocked 段 = 警示色条纹 |
71
+ | `.ak-progress--segmented > i` 的 2px 间隙 | 分段之间改用 1px inset 缝,避免间隙把 100% 宽度撑破 |
72
+ | `.ak-progress-label` 600 / xs label 字体、静默色 | dock 标题 600 + `.04em`;百分比 11px label 字体 + `.08em` + `tabular-nums`,青灰混合色 |
73
+ | `.ak-progress--sm` 4px | 任务行内的迷你条 4px |
74
+ | `.ak-ring`(环形) | 未移植:DSH 没有环形进度场景 |
75
+
76
+ 流动光泽改成窄扫描线(`rgba(255,255,255,.18)`),保留「正在跑」的暗示但不带高光质感。
77
+
78
+ ## 安装
79
+
80
+ ```bash
81
+ # A. 作为 DSH bundle 安装(推荐,热生效,不必刷新页面)
82
+ plugin_manager install_bundle target "@yunkersek/dsh-prts-theme"
83
+ # 或先放进 profile: npm i @yunkersek/dsh-prts-theme
84
+
85
+ # B. 本地目录安装(开发时)
86
+ plugin_manager install_bundle target "E:/Codes/prts-theme"
87
+ ```
88
+
89
+ 对已装包重复 `install_bundle` 会返回 `already-installed`;改完样式要热更新时,先 `remove_bundle target "@yunkersek/dsh-prts-theme"` 再装一次。
90
+ 卸载:`plugin_manager remove_bundle target "@yunkersek/dsh-prts-theme"`。
91
+
92
+ ## 实现要点
93
+
94
+ - `client.js` 通过 `ctx.theme.register({ id, colorScheme, tokens })` 注册,`tokens` 是 `--dsw-alias-*` / `--dsw-specific-*` 变量名 → 色值,暗色 152 项、亮色 154 项,即 `design-platform.css` 里出现的全部 alias(人工真值 134 项 + 自动映射补齐的 18 项系统件)。
95
+ - 运行时切换用 `ctx.theme.setTheme(id)`,并写 `localStorage['prts-theme:choice']`;选「跟随系统」时把偏好交还 `system`,不劫持。
96
+ - 监听 `theme/change`:一旦用户在内置 light/dark/system 里切换,自动退回「跟随系统」,避免和内置开关打架。
97
+ - 样式覆盖(圆角/焦点/选中/角标)由 `ctx.effect` 注册一份全局 `<style>`,卸载时自动清理。
98
+ - 设置行注册在 `settings.general.item`,`order: 12`,排在原生「外观」行之后,外观是 PRTS 的三张卡片。
99
+
100
+ ## 与已装插件的冲突
101
+
102
+ `profiles/desktop/cordis.patch.yml` 里有一条陈旧的 `theme-prts`(`@ash-qw/dsh-theme-prts`),该包并未安装,属于悬空引用、不参与加载;本主题用独立 id `prts-theme` / `prts-dark` / `prts-light`,不与之冲突。若要清理可直接删掉那条 patch 行。
103
+
104
+ ## 许可
105
+
106
+ 配色与令牌来自 MooncellWiki/prts-design(MIT)。本包为独立实现,不含其代码与素材,图标为自绘。