@klarkxy/dsh-font 0.1.0-rc.2 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,46 +1,34 @@
1
- # @klarkxy/dsh-font
1
+ # Font
2
2
 
3
3
  <!-- release-state-note -->
4
- The [repository registry](../../README.md#plugin-lifecycle) tracks Draft → Testing → Published, moving forward only. Fixes, testing and version updates keep published packages Published; each update still passes release checks. First publication explicitly selects Testing packages and records Published only after npm archive verification. See the [release guide](../../RELEASING.md).
5
4
 
6
- Font: customize the **interface font**, **code font**, and **conversation font size** of the DeepSeek Harness Web GUI from one settings panel.
5
+ [简体中文](docs/README.zh-CN.md)
7
6
 
8
- [中文文档](docs/README.zh-CN.md)
7
+ Change the interface font, code font, and conversation font size of the DeepSeek Harness Web GUI.
9
8
 
10
- ## What it does
11
-
12
- The plugin adds a settings panel to its bundle page in the Plugins view:
13
-
14
- - **Interface font** — the typeface of all interface text. Pick a preset (Microsoft YaHei, PingFang SC, SimSun, KaiTi, Source Han Sans/Serif), pick an actually-installed family via **Load system fonts**, or enter any CSS `font-family` stack. Empty restores the host default.
15
- - **Code font** — the monospace typeface of code blocks, inline code and terminals. Presets include Cascadia, JetBrains Mono, Fira Code, Consolas, Sarasa Mono and Maple Mono; system fonts and custom stacks are accepted too.
16
- - **Conversation font size** — 10–22 px, driven through the official `ctx.theme.setFontSize()` entry. It stays in sync with the native stepper in Settings → General and persists through the host settings scope.
17
-
18
- *Load system fonts* uses the Local Font Access API (`window.queryLocalFonts()`): Chromium-only and gated behind a browser permission prompt. Every click re-enumerates — after the first read the button relabels to *Reload system fonts*, so fonts installed later appear on the next click. Each entry commits the exact family name CSS needs, while the label leads with the name the UI locale recognizes — a converted font shows as `华康少女文字W5(P)(DFPShaoNvW5-GB)` in Chinese and `DFPShaoNvW5-GB(华康少女文字W5(P))` in English. Where the API is unavailable or denied (Firefox, Safari, Electron policy), the panel simply keeps the preset + manual-input flow. No font files are bundled — every choice is rendered with fonts already installed on the machine, falling back through the stack when a family is missing.
19
-
20
- Changes apply immediately through owned inline overrides on `<html>` for the host's `:root` font tokens (`--dsw-font-family`, `--ds-font-family-code`). Derived Markdown, brand, and terminal fonts follow them. Choosing *Default* or unloading restores prior inline values without removing another owner's later updates.
9
+ ## Install
21
10
 
22
- ## Where settings live
11
+ ```sh
12
+ dsh plugin --profile web add @klarkxy/dsh-font
13
+ ```
23
14
 
24
- Font choices keep the existing browser `localStorage` key and format. Each browser and machine has its own installed fonts, so this plugin's font choices remain browser-local. Font preferences live in the browser's `localStorage`, so they must be set again after switching browser, domain or port. The font size needs no local copy: the theme service persists it host-side through `setFontSize(px)`.
15
+ Replace `web` with your profile name, then restart the profile or reload the page.
25
16
 
26
- The host half is intentionally empty: no Host service, no RPC, no model calls.
17
+ ## Use
27
18
 
28
- ## Install
19
+ Open **Plugins → Font**:
29
20
 
30
- Install the preview channel (DSH 0.2.0-rc.2 or later):
21
+ - **Interface font** and **Code font**: pick a preset, type any font name, or click **Load system fonts** to choose from fonts installed on this computer.
22
+ - **Conversation font size**: 10–22 px, kept in sync with **Settings → General**.
31
23
 
32
- ```bash
33
- dsh plugin --profile web add @klarkxy/dsh-font@next
34
- ```
24
+ Changes apply immediately. Choose **Default** to go back to the DSH font.
35
25
 
36
- Replace `web` with your profile name and restart the profile (or reload the page) after installing. Open **Plugins → Font** to change fonts.
26
+ ## Limits
37
27
 
38
- ## Development
28
+ - **Load system fonts** works only in Chromium-based browsers and asks for permission.
29
+ - Font choices are saved in the current browser; set them again in another browser or address. The font size is saved by DSH.
30
+ - No fonts are bundled; the chosen font must be installed on the computer.
39
31
 
40
- ```bash
41
- pnpm --filter @klarkxy/dsh-font build # tsdown + client wrapper
42
- pnpm --filter @klarkxy/dsh-font typecheck
43
- pnpm --filter @klarkxy/dsh-font test
44
- ```
32
+ ## License
45
33
 
46
- Preview releases use the npm `next` tag. The stable plugin-site catalog requires a `latest` release.
34
+ [SATA License 2.1](LICENSE)
@@ -1,46 +1,34 @@
1
- # @klarkxy/dsh-font
1
+ # 字体
2
2
 
3
3
  <!-- release-state-note -->
4
- 插件生命周期见[仓库状态清单](../../../README.zh-CN.md#插件生命周期):草稿 → 测试中 → 已发布,只向前推进。已发布插件的修复、测试和升版保持已发布;每次更新仍须通过发布检查。首次发布须明确选择测试中的包,并在 npm 归档验证成功后登记。详见[发布规则](../../../RELEASING.zh-CN.md)。
5
-
6
- 字体:在一个设置面板里自定义 DeepSeek Harness Web GUI 的**界面字体**、**代码字体**和**会话字号**。
7
4
 
8
5
  [English](../README.md)
9
6
 
10
- ## 功能
11
-
12
- 插件在「插件」页自己的 Bundle 详情页里提供设置面板:
13
-
14
- - **界面字体** —— 整个界面文字的字体。可选预设(微软雅黑、苹方、宋体、楷体、思源黑体/宋体),也可以点「读取系统字体」从本机已装字体里挑,或输入任意 CSS `font-family` 字体栈。留空恢复宿主默认。
15
- - **代码字体** —— 代码块、行内代码与终端的等宽字体。预设含 Cascadia、JetBrains Mono、Fira Code、Consolas、更纱黑体、Maple Mono,同样支持系统字体与自定义。
16
- - **会话字号** —— 10–22 px,走官方 `ctx.theme.setFontSize()` 入口,与「设置 → 通用」里的字号步进器实时同步,并由宿主设置域持久化。
7
+ 自定义 DeepSeek Harness Web GUI 的界面字体、代码字体和会话字号。
17
8
 
18
- 「读取系统字体」用的是 Local Font Access API(`window.queryLocalFonts()`):仅 Chromium 系可用,首次会弹浏览器权限授权。每次点击都重新枚举——首次读取后按钮变为「重新读取系统字体」,新装字体再点一次即可刷新。列表项写入的始终是 CSS 精确匹配需要的族名,但显示以界面语言为准——同一款转换字体在中文界面显示 `华康少女文字W5(P)(DFPShaoNvW5-GB)`,在英文界面显示 `DFPShaoNvW5-GB(华康少女文字W5(P))`。在不支持或被拒绝的环境(Firefox、Safari、Electron 权限策略)里,面板退回预设 + 手填,不受影响。包内不带任何字体文件——所有选择都靠本机已装字体渲染,缺字体时按栈回退。
19
-
20
- 改动立即生效:字体覆盖写入 `<html>` 上的宿主 `:root` 字体 token(`--dsw-font-family`、`--ds-font-family-code`),Markdown、品牌和终端的派生字体随之更新。选择「默认」或卸载插件时,恢复原来的内联值,并保留其他写入者后来的修改。
9
+ ## 安装
21
10
 
22
- ## 设置存在哪里
11
+ ```sh
12
+ dsh plugin --profile web add @klarkxy/dsh-font
13
+ ```
23
14
 
24
- 字体选择沿用原有浏览器 `localStorage` 键和格式。每个浏览器、每台机器装的字体不同,所以本插件的字体选择仍留在浏览器本地。字体偏好保存在浏览器 localStorage,更换浏览器、域名或端口后需重新设置。字号不需要本地副本:theme 服务通过 `setFontSize(px)` 将它保存在宿主侧。
15
+ 把 `web` 换成你的 profile 名,安装后重启 profile 或刷新页面。
25
16
 
26
- 宿主侧(host half)是刻意留空的:没有 Host service、没有 RPC、不调模型。
17
+ ## 使用
27
18
 
28
- ## 安装
19
+ 打开「插件 → 字体」:
29
20
 
30
- 安装预发布通道(需要 DSH 0.2.0-rc.2 或更高版本):
21
+ - **界面字体**和**代码字体**:选预设、手动输入字体名,或点「读取系统字体」从本机已装字体中选择。
22
+ - **会话字号**:10–22 px,与「设置 → 通用」中的字号同步。
31
23
 
32
- ```bash
33
- dsh plugin --profile web add @klarkxy/dsh-font@next
34
- ```
24
+ 改动立即生效。选择「默认」即可恢复 DSH 原字体。
35
25
 
36
- 把 `web` 换成你的 profile 名,安装后重启 profile(或刷新页面),然后打开「插件 → 字体」调整。
26
+ ## 限制
37
27
 
38
- ## 开发
28
+ - 「读取系统字体」只在 Chromium 系浏览器可用,首次使用需要授权。
29
+ - 字体选择保存在当前浏览器,换浏览器或访问地址后需重新设置;字号由 DSH 保存。
30
+ - 插件不附带字体文件,所选字体必须已安装在本机。
39
31
 
40
- ```bash
41
- pnpm --filter @klarkxy/dsh-font build # tsdown + client wrapper
42
- pnpm --filter @klarkxy/dsh-font typecheck
43
- pnpm --filter @klarkxy/dsh-font test
44
- ```
32
+ ## 许可证
45
33
 
46
- 预发布使用 npm `next` 标签;有 `latest` 版本后再收录到稳定插件目录。
34
+ [SATA License 2.1](../LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klarkxy/dsh-font",
3
- "version": "0.1.0-rc.2",
3
+ "version": "0.1.1",
4
4
  "description": "Font: customize the interface font, code font, and conversation font size of the DeepSeek Harness Web GUI.",
5
5
  "icon": "./icon.svg",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -57,7 +57,7 @@
57
57
  "test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-font/src"
58
58
  },
59
59
  "dependencies": {
60
- "@klarkxy/dsh-plugin-kit": "0.3.0"
60
+ "@klarkxy/dsh-plugin-kit": "0.3.2"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@deepseek-ai/cordis": ">=4.0.4"
@@ -97,6 +97,6 @@
97
97
  },
98
98
  "homepage": "https://klarkxy.github.io/dsh-plugins/plugins/font/",
99
99
  "dshRelease": {
100
- "contentHash": "6d300c3b5794f2321aebc8f0aa91dea7ef814badc2e6c799a6f177558fefc308"
100
+ "contentHash": "a234269ae4dfcbf8c1136ebb571912683af3e258489f654db141e6604fe02a3e"
101
101
  }
102
102
  }