dsh-fonttune 0.1.2 → 0.1.3

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/CHANGELOG.en.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to **dsh-fonttune** are documented here. Chinese version: [CHANGELOG.md](CHANGELOG.md).
4
4
 
5
+ ## [0.1.3] - 2026-09-14
6
+
7
+ ### Changed
8
+ - **Switch row wording and shape**: the label on the left is now **编辑模式 / "Edit mode"** (was 编辑方式), and the two options are back to a **joined segmented control** (one shared frame with a divider between the options), while the selected option keeps its grey `--dsw-specific-sidebar-nav-item-active` surface and primary-coloured text (0.1.2 had split them into two separate buttons; this reverts that shape).
9
+ - **Card description**: now mentions the **West/CJK split** as well, in both languages, so it matches what the card actually offers.
10
+ - **Feature list trimmed in the README**: the "commit on release", "no first-paint flash" and "bilingual" bullets are gone — they describe implementation details rather than features, and the behaviour itself is unchanged (still recorded under 0.1.0 in this file).
11
+ - **Compatibility table** now lists 0.1.3 as the latest version.
12
+
5
13
  ## [0.1.2] - 2026-09-14
6
14
 
7
15
  ### Changed
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  **dsh-fonttune** 的重要变更都记录在这里。英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
4
4
 
5
+ ## [0.1.3] - 2026-09-14
6
+
7
+ ### 变更
8
+ - **开关行文案与形状**:左侧说明由「编辑方式」改为**「编辑模式」**;右侧两个选项恢复**连体分段**(一个外框、选项之间一条分隔线),选中态仍用灰底 `--dsw-specific-sidebar-nav-item-active` + 正文色文字(0.1.2 曾一度改成两个独立按钮,现改回)。
9
+ - **卡片描述**:补上「中西文分栏」(中英两份),与卡片实际能力一致。
10
+ - **README 功能列表精简**:去掉「松手才生效」「首帧不闪字体」「中英双语」三条——描述的是实现细节而非功能项,行为本身未变(仍记录在本文件 0.1.0 一节)。
11
+ - **兼容表**改列 0.1.3 为最新版本。
12
+
5
13
  ## [0.1.2] - 2026-09-14
6
14
 
7
15
  ### 变更
@@ -27,7 +35,7 @@
27
35
  - **插件配置卡片**:注册在 `settings.plugin.item`、key 为 `dsh-fonttune` 的宿主设置命名空间,出现在 **设置 → 插件 → 插件配置** 里;保存/重置走 DSH 自己的设置文档(`settings.yaml`)。
28
36
  - **正文 / 代码字体族**:两套独立的 CSS font-family 回退列表,可为空(= 完全不动 DSH 的字体栈)。
29
37
  - **选字体面板**:内置 等宽 / 中文(CJK)/ 拉丁 / 通用 四组预设;Chromium 下用 `queryLocalFonts()` 补「本机已安装」分组;搜索不到的名字给「使用 xxx」新建入口;每行用其自身字体渲染。
30
- - **中西分家(简单模式)**:卡片顶部一个开关——**简单模式**把字体栈拆成「西文字体」「中文字体」两个单选格(正文/代码各一对),内部仍维护同一条栈;**高级模式**是完整的 chips 编辑器。语义为「简单模式只动最前面」:西文格 = 栈里第一个非中文项(改选原地替换、无则插到最前),中文格 = 第一个中文项(改选原地替换、无则**紧跟西文槽插入**,保证 `西文, 中文, 通用兜底` 的 CSS 语义正确);两格之外的所有项与顺序**原样保留**并在「其余回退项」一行提示;**切换模式是纯视图切换、零写入**。中文判定以名字启发式优先(宽松正则 + 含 CJK 字符的本地化名),canvas 测宽只对名字不像 CJK 的字体补充确认——未安装的预设字体也能正确落入中文槽。开关行布局:左侧「编辑方式」说明 + 右侧分段式小切换。
38
+ - **中西分家(简单模式)**:卡片顶部一个开关——**简单模式**把字体栈拆成「西文字体」「中文字体」两个单选格(正文/代码各一对),内部仍维护同一条栈;**高级模式**是完整的 chips 编辑器。语义为「简单模式只动最前面」:西文格 = 栈里第一个非中文项(改选原地替换、无则插到最前),中文格 = 第一个中文项(改选原地替换、无则**紧跟西文槽插入**,保证 `西文, 中文, 通用兜底` 的 CSS 语义正确);两格之外的所有项与顺序**原样保留**并在「其余回退项」一行提示;**切换模式是纯视图切换、零写入**。中文判定以名字启发式优先(宽松正则 + 含 CJK 字符的本地化名),canvas 测宽只对名字不像 CJK 的字体补充确认——未安装的预设字体也能正确落入中文槽。开关行布局:左侧「编辑模式」说明 + 右侧连体分段式小切换(选中项用灰底)。
31
39
  - **拖拽排序**:已选字体是 chip 列表,可拖拽调整回退顺序,同时保留前移/后移按钮(键盘与触屏可用)。
32
40
  - **实时预览**:中英混排 + 代码两行,随当前配置实时渲染。
33
41
  - **全局字号偏移**(-3 ~ +6 px):等比缩放 DSH 自己的字号 token(`--dsh-content-font-size`、`--dsw-font-*-font-size` / `-line-height`),基准值实时读,因此与 DSH 的「字号大小」滑块**叠加**而非互相覆盖;token 名单运行时发现,内置兜底表。
package/README.en.md CHANGED
@@ -13,15 +13,12 @@
13
13
  - **Font picker panel** — four preset groups (monospace / CJK / Latin / generic), plus an "installed on this machine" group on Chromium; a name that is not in the list can be created with "use xxx"
14
14
  - **Drag to reorder** — selected families are a chip list you can drag, with earlier / later buttons kept for keyboard and touch
15
15
  - **Live preview** — a mixed Chinese/English line and a code line, rendered from the current configuration
16
- - **Commit on release** — the size and weight sliders only update their readout while dragging; the value is written once on pointer release (or keyup / blur), so dragging stays smooth
17
- - **No first-paint flash** — the host half ships the saved declarations with the page, so the first paint already uses your fonts
18
- - **Bilingual** — card copy follows DSH's language (Chinese / English)
19
16
 
20
17
  ## Compatibility
21
18
 
22
19
  | Plugin version | Supported DSH versions |
23
20
  | --- | --- |
24
- | **0.1.1** (latest) | 0.1.5-rc.2 |
21
+ | **0.1.3** (latest) | 0.1.5-rc.2 |
25
22
 
26
23
  `engines.dsh` requires **0.1.5-rc.2** or newer, and the compatibility declaration lists only the **latest release of the 0.1.5 line**: it carries every fix in that line, which makes it the most stable build of the major version, while older builds of the same major version stay compatible per semantic versioning. Earlier or newer DSH versions are untested and not declared. On install or update, the DSH market runs a host-compatibility preflight against `engines.dsh`, `dsh.compatibility.dshReleases` and `peerDependencies` in `package.json`.
27
24
 
package/README.md CHANGED
@@ -13,15 +13,12 @@
13
13
  - **选字体面板** —— 内置 等宽 / 中文(CJK)/ 拉丁 / 通用 四组预设,Chromium 下再补上「本机已安装」分组;搜索不到的名字可以直接「使用 xxx」新建
14
14
  - **拖拽排序** —— 已选字体是 chip 列表,可拖动调整回退顺序,同时保留前移 / 后移按钮(键盘与触屏可用)
15
15
  - **实时预览** —— 中英混排与代码两行,随当前配置即时渲染
16
- - **松手才生效** —— 字号与字重滑块拖动时只更新读数,松手(或键盘抬起 / 失焦)才写入设置,拖动过程不卡
17
- - **首帧不闪字体** —— 宿主半把已保存的声明随页面一起下发,首屏就是设置里的字体
18
- - **中英双语** —— 卡片文字跟随 DSH 的语言(中文 / English)
19
16
 
20
17
  ## 兼容性
21
18
 
22
19
  | 插件版本 | 支持的 DSH 版本 |
23
20
  | --- | --- |
24
- | **0.1.1**(最新) | 0.1.5-rc.2 |
21
+ | **0.1.3**(最新) | 0.1.5-rc.2 |
25
22
 
26
23
  `engines.dsh` 下限为 **0.1.5-rc.2**,兼容声明只列 **0.1.5 线的最新版本**:它包含这条线的全部修复,是同一大版本里最稳的一版,而同一大版本内的旧版本按语义化版本约定向上兼容。更早或更新的 DSH 未经验证,不作声明。安装或更新时,DSH 市场会依据 `package.json` 里的 `engines.dsh`、`dsh.compatibility.dshReleases` 与 `peerDependencies` 做宿主兼容预检。
27
24
 
package/lib/client.js CHANGED
@@ -762,7 +762,7 @@ var DICTS = {
762
762
  en: {
763
763
  "card.title": "Font tune",
764
764
  "card.description":
765
- "UI and code font families, a global size offset, and font weight",
765
+ "Body and code fonts, a size offset, weight, and a West/CJK split",
766
766
  "card.expand": "Expand",
767
767
  "card.collapse": "Collapse",
768
768
  "card.resetAll": "Reset all",
@@ -835,7 +835,7 @@ var DICTS = {
835
835
  },
836
836
  zh: {
837
837
  "card.title": "字体增强",
838
- "card.description": "正文与代码字体、全局字号偏移、字重",
838
+ "card.description": "正文与代码字体、字号偏移、字重、中西文分栏",
839
839
  "card.expand": "展开",
840
840
  "card.collapse": "收起",
841
841
  "card.resetAll": "全部重置",
@@ -871,7 +871,7 @@ var DICTS = {
871
871
  "stack.groupLocal": "本机已安装",
872
872
  "stack.hintOrder": "顺序靠前的优先命中,取第一个已安装的字体。",
873
873
 
874
- "mode.label": "编辑方式",
874
+ "mode.label": "编辑模式",
875
875
  "mode.simple": "简单",
876
876
  "mode.advanced": "高级",
877
877
  "mode.simpleHint":
@@ -971,20 +971,25 @@ var CARD_CSS = [
971
971
  ".dfp-chipButton{align-items:center;justify-content:center;width:20px;height:20px;padding:0;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:4px;display:inline-flex;font-size:13px;line-height:1}",
972
972
  ".dfp-chipButton:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3)}",
973
973
  ".dfp-chipButton:disabled{opacity:.35;cursor:default}",
974
- ".dfp-add{align-items:center;gap:6px;height:28px;padding:0 10px;color:var(--dsw-alias-label-primary);cursor:pointer;background:var(--dsw-alias-bg-layer-2);border:.5px solid var(--dsw-alias-border-l3);border-radius:8px;display:inline-flex;font-size:13px;line-height:18px}",
975
- ".dfp-add:hover{background:var(--dsw-alias-bg-layer-3)}",
974
+ ".dfp-add{align-items:center;gap:6px;height:28px;padding:0 12px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:.5px solid var(--dsw-alias-border-l3);border-radius:8px;display:inline-flex;font-size:13px;line-height:18px}",
975
+ ".dfp-add:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-specific-sidebar-nav-item-hover)}",
976
976
 
977
+ // Segmented / toggle controls follow dsh-quick-toc's settings card colours:
978
+ // the selected option takes the same --dsw-specific-sidebar-nav-item-active
979
+ // surface (not just darker text). Shape: one joined pill with a divider, as
980
+ // the card had before — quick-toc is being aligned to this shape instead.
977
981
  ".dfp-modeRow{align-items:center;gap:10px;margin:14px 0 0;display:flex}",
978
- ".dfp-modeLabel{flex:1;min-width:0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}",
982
+ ".dfp-modeLabel{flex:1;min-width:0;color:var(--dsw-alias-label-primary);font-size:14px;font-weight:400;line-height:22px}",
979
983
  ".dfp-modeSeg{flex:none;display:inline-flex;overflow:hidden;background:var(--dsw-alias-bg-layer-2);border:.5px solid var(--dsw-alias-border-l3);border-radius:8px}",
980
- ".dfp-modeButton{appearance:none;font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-left:.5px solid var(--dsw-alias-border-l3);padding:4px 14px;font-size:12px;line-height:18px}",
984
+ ".dfp-modeButton{appearance:none;font:inherit;cursor:pointer;height:28px;padding:0 14px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-left:.5px solid var(--dsw-alias-border-l3);font-size:13px;line-height:18px}",
981
985
  ".dfp-modeButton:first-child{border-left:none}",
982
- ".dfp-modeButton:hover{color:var(--dsw-alias-label-primary)}",
983
- ".dfp-modeButtonActive{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3)}",
986
+ ".dfp-modeButton:hover:not(:disabled):not(.dfp-modeButtonActive){background:var(--dsw-specific-sidebar-nav-item-hover)}",
987
+ ".dfp-modeButton:disabled{opacity:.4;cursor:default}",
988
+ ".dfp-modeButtonActive{color:var(--dsw-alias-label-primary);background:var(--dsw-specific-sidebar-nav-item-active)}",
984
989
  ".dfp-slotRow{align-items:center;gap:10px;margin-top:10px;display:flex}",
985
990
  ".dfp-slotLabel{flex:none;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;min-width:96px}",
986
991
  ".dfp-splitRow{flex:1;align-items:center;gap:4px;display:inline-flex;min-width:0}",
987
- ".dfp-pick{flex:1;appearance:none;font:inherit;cursor:pointer;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:.5px solid var(--dsw-alias-border-l3);border-radius:8px;min-height:28px;padding:0 10px;display:inline-flex;align-items:center}",
992
+ ".dfp-pick{flex:1;appearance:none;font:inherit;cursor:pointer;color:var(--dsw-alias-label-primary);background:0 0;border:.5px solid var(--dsw-alias-border-l3);border-radius:8px;height:28px;padding:0 12px;font-size:13px;line-height:18px;display:inline-flex;align-items:center}",
988
993
  ".dfp-pick:hover:not(:disabled){background:var(--dsw-alias-bg-layer-3)}",
989
994
  ".dfp-pick:disabled{opacity:.4;cursor:default}",
990
995
  ".dfp-pickEmpty{color:var(--dsw-alias-label-tertiary)}",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-fonttune",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Font plugin for the DeepSeek Harness Web GUI: body and code font families, a global font-size offset, a global font weight, and a West/CJK split picker.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",