@grapecity-software/dsh-spreadjs-editor 0.2.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release Notes / 版本记录
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### 中文
6
+
7
+ - **编辑器跟随 DSH 的主题,而不是操作系统**:此前深色与否取决于系统的 `prefers-color-scheme`,所以在 DSH 里选「浅色 / 深色」时编辑器毫无反应——两者不一致时最明显。现在改为订阅 DSH 的主题服务;DSH 偏好设为「跟随系统」时,仍然随系统一起切换。
8
+ - **面板自身配色改用 DSH 真实存在的主题 token**:原先用的几个 `--dsw-*` 变量 DSH 并未定义,那些规则实际一直落在硬编码的浅色回退值上,深色下会出现白色底块。
9
+
10
+ ### English
11
+
12
+ - **The editor follows the harness theme, not the operating system**: toolbars, sheet area and panel used to darken according to the system's `prefers-color-scheme`, so choosing light or dark inside the harness changed nothing here — most visible when the two disagreed. The plugin now subscribes to the harness theme service, and a harness preference of `system` still tracks the OS.
13
+ - **The panel's own chrome reads real harness theme tokens**: several `--dsw-*` variables it used are not defined by DSH, so those rules were silently falling back to hard-coded light colours and left white patches in dark mode.
14
+
3
15
  ## 0.2.0
4
16
 
5
17
  > 破坏性变更:本版要求 DSH `>=0.1.5-rc.3`,并改用 DSH 自带的右侧栏,不再需要任何第三方侧边栏插件;升级前请先升级 DSH。仓库里准备过的 `0.1.5` 从未发布,其内容已并入本版。
@@ -10,7 +22,6 @@
10
22
  - **浅色/深色完整跟随系统**:此前只有工具栏和面板变深、工作表区域仍是白底,现在一起切换。
11
23
  - **界面更干净**:去掉面板顶部的文件名标题栏(DSH 标签页已有)和底部状态栏,保存与冲突提示改为右下角浮层。
12
24
  - **新增「关于」**:Designer「设置」标签里可查看插件版本、内置 SpreadJS 与 Designer 版本、授权状态和版权信息。
13
- - **可以让 AI 直接改你正在编辑的表**:另装配套的 `@grapecity-software/dsh-spreadjs-driver` 后,可通过对话让 Agent 修改当前工作簿;未安装时插件行为不变。
14
25
  - 内置 SpreadJS 升级到 19.2.0;新增配置项 `maxSaveBytes`(默认 64 MB)与 `trustedHosts`。
15
26
 
16
27
  ### English
@@ -19,7 +30,6 @@
19
30
  - **Light and dark follow the system all the way**: previously only the toolbars and panels darkened while the sheet stayed white.
20
31
  - **A cleaner panel**: the file-name title bar (the harness tab already shows it) and the status bar are gone, and save or conflict messages appear as a floating notice in the corner.
21
32
  - **A new About dialog**: the Designer's settings tab shows the plugin and bundled versions, the licence state and the copyright.
22
- - **Let an agent edit the sheet you are looking at**: with the companion `@grapecity-software/dsh-spreadjs-driver` installed, you can ask an agent to change the open workbook in conversation; without it the plugin behaves as before.
23
33
  - Bundled SpreadJS moved to 19.2.0; new configuration `maxSaveBytes` (default 64 MB) and `trustedHosts`.
24
34
 
25
35
  ## 0.1.4
package/README.md CHANGED
@@ -19,7 +19,7 @@ A DeepSeek Harness Web UI plugin that opens, views, and edits Excel / SpreadJS f
19
19
  - 支持 `.xlsx`、`.xlsm`、`.csv`、`.sjs`、`.ssjson` 文件。
20
20
  - 从文件树打开工作簿,使用 SpreadJS Designer 编辑表格。
21
21
  - 编辑后可直接保存回原文件:原子写入、限制在会话工作区内、带冲突检测。
22
- - 编辑器跟随系统切换浅色和深色主题,工具栏与工作表区域一起变。
22
+ - 编辑器跟随 DSH 的浅色/深色主题,工具栏与工作表区域一起变;DSH 偏好设为「跟随系统」时自然跟着系统走。
23
23
  - 「设置」标签里有「关于」按钮:内置版本、授权状态与版权信息在弹窗里。
24
24
 
25
25
  ### 内置版本与文件兼容性
@@ -64,21 +64,6 @@ npx --yes @deepseek-ai/dsh@latest --profile web
64
64
  - **写不出工作区。** 目标必须在当前会话的工作区内,越界(含 `..` 逃逸)直接拒绝。
65
65
  - **只有循环回环地址可用。** 保存接口与 DSH 其它接口一样只服务本机来源;通过局域网地址访问时,需要把该地址加进 `trustedHosts`。
66
66
 
67
- ### 配合 AI 使用:让 Agent 改你正在看的表
68
-
69
- 再装上 [`@grapecity-software/dsh-spreadjs-driver`](https://www.npmjs.com/package/@grapecity-software/dsh-spreadjs-driver),就可以直接对 Agent 说"把金额列改成红色"——改动**立刻出现在你正看着的这张表上**。
70
-
71
- ```sh
72
- dsh plugin --profile web add @grapecity-software/dsh-spreadjs-driver
73
- ```
74
-
75
- - **改的是同一个对象,不是文件副本。** 编辑器把当前工作簿交给该插件的 `spreadjsHostBridge` 服务;两个插件的浏览器半跑在同一个页面里,所以改动直接落在 Designer 正在渲染的那份文档上——**不会覆盖你尚未保存的编辑**(这一点是按文件走的路子给不了的)。
76
- - **磁盘上的文件不动。** 改动只活在编辑器里,除非你明确要求保存——所以你有机会先看清楚,再决定要不要落盘。
77
- - **只有它拿得到。** 工作簿是编辑器**主动交出去**的,不存在"查找别人的工作簿"这类入口,同页面上的其他插件够不到。
78
- - 该插件本身还带一整套表格工具(新建、导入、导出 `.xlsx` / `.csv` / `.pdf`、截图),**不装编辑器也能单独使用**。
79
-
80
- > 需要本插件 **0.2.0 或更高版本**——更早的版本里没有这个桥,装上 driver 也不会有联动。
81
-
82
67
  ### 配置
83
68
 
84
69
  如已获得许可证,在 web profile 的 `cordis.patch.yml` 中添加以下配置:
@@ -103,7 +88,7 @@ dsh plugin --profile web add @grapecity-software/dsh-spreadjs-driver
103
88
 
104
89
  | 命令 | 验证内容 |
105
90
  | --- | --- |
106
- | `npm run typecheck`、`npm test` | 类型契约,以及 53 个单元测试(保存路由的每条守卫、文件地址解析,以及保存命令重定向的每条分支) |
91
+ | `npm run typecheck`、`npm test` | 类型契约,以及 84 个单元测试(保存路由的每条守卫、文件地址解析、保存命令重定向的每条分支,以及编辑器主题桥的每条分支) |
107
92
  | `node scripts/smoke-client.mjs` | 构建后的浏览器半结构:loader 包装、内联的 SpreadJS 与样式、外部依赖只有 react |
108
93
  | `node scripts/smoke-node.mjs` | 构建后的宿主半:路由注册、许可证配置,以及保存路径的真实写盘、冲突与越界拒绝 |
109
94
  | `npm run probe:live` | **对着正在运行的 DSH** 跑一遍真实保存:真实 `ctx.fs` 的解析、落盘、冲突守卫、工作区越界 |
@@ -125,7 +110,7 @@ dsh plugin --profile web add @grapecity-software/dsh-spreadjs-driver
125
110
  - Opens `.xlsx`, `.xlsm`, `.csv`, `.sjs`, and `.ssjson` files.
126
111
  - Open workbooks from the file tree and edit them with SpreadJS Designer.
127
112
  - Save edits straight back to the file: atomic, confined to the session workspace, with conflict detection.
128
- - Follows the system's light or dark theme, toolbars and worksheet alike.
113
+ - Follows the harness's light or dark theme, toolbars and worksheet alike; a harness preference of `system` still tracks the OS.
129
114
  - An **About** button in the settings tab reports the bundled versions, the licence state and the copyright.
130
115
 
131
116
  ### Bundled Versions and File Compatibility
@@ -170,21 +155,6 @@ Save has a single entry point: the **保存到工作区** button in the Designer
170
155
  - **It cannot write outside the workspace.** The target must sit inside the current session's workspace; anything else — including `..` escapes — is refused.
171
156
  - **Loopback only.** The save endpoint serves the local machine like the rest of DSH. If you reach DSH through a LAN address, add that address to `trustedHosts`.
172
157
 
173
- ### Let the agent edit the sheet you are looking at
174
-
175
- Install [`@grapecity-software/dsh-spreadjs-driver`](https://www.npmjs.com/package/@grapecity-software/dsh-spreadjs-driver) alongside this plugin, and you can simply ask the agent — "make the amount column red" — and **watch the change land on the sheet you have open**.
176
-
177
- ```sh
178
- dsh plugin --profile web add @grapecity-software/dsh-spreadjs-driver
179
- ```
180
-
181
- - **It edits the same object, not a copy of the file.** The editor hands its current workbook to that plugin's `spreadjsHostBridge` service. Both plugins' browser halves run in the same page, so the change lands on the very document the Designer is rendering — and it **does not clobber edits you have not saved**, which a file-based route cannot promise.
182
- - **The file on disk is not touched.** The change lives in the editor until you explicitly ask for a save, so you get to look before deciding.
183
- - **Only that plugin can reach it.** The workbook is handed over *by the editor*; there is no way to go looking for somebody else's workbook, so other plugins on the page cannot touch it.
184
- - That plugin also brings a full set of spreadsheet tools of its own (create, import, export `.xlsx` / `.csv` / `.pdf`, screenshot) and **works on its own without the editor**.
185
-
186
- > Requires this plugin **0.2.0 or later** — earlier versions have no bridge, so installing the driver alongside them changes nothing.
187
-
188
158
  ### Configuration
189
159
 
190
160
  If you have licenses, add the following to the web profile's `cordis.patch.yml`:
@@ -209,7 +179,7 @@ Restart DSH and refresh the browser after changing the configuration.
209
179
 
210
180
  | Command | What it proves |
211
181
  | --- | --- |
212
- | `npm run typecheck`, `npm test` | The type contract, and 53 unit tests: every save guard, file-address parsing, and every branch of the Save-command redirect |
182
+ | `npm run typecheck`, `npm test` | The type contract, and 84 unit tests: every save guard, file-address parsing, every branch of the Save-command redirect, and every branch of the editor theme bridge |
213
183
  | `node scripts/smoke-client.mjs` | The built browser half's structure: loader wrapper, inlined SpreadJS and styles, react as the only runtime external |
214
184
  | `node scripts/smoke-node.mjs` | The built host half: route registration, license config, and the save path writing real bytes plus refusing conflicts and escapes |
215
185
  | `npm run probe:live` | A real save against a **running DSH**: the actual `ctx.fs` resolving, writing, refusing a stale base hash, and refusing a workspace escape |
package/lib/client.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/lib/client.js
3
- size: 51960527 bytes
4
- sha256: 755ed8c0ded6f8614655c3fa528f535c2d80092201ce8b62eb0ea0c7c44d7655
3
+ size: 51961608 bytes
4
+ sha256: 9f275e2b18e8ba9a93544c9a3bf6ae82f4a9dec330d2f515176c2de65d827a07
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapecity-software/dsh-spreadjs-editor",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "DeepSeek Harness Web UI plugin: SpreadJS workbook editor for the harness's own right Sidebar, with binary save.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -61,6 +61,7 @@
61
61
  "client": {
62
62
  "platform": "web",
63
63
  "inject": [
64
+ "@deepseek-ai/dsh-client-ui-theme",
64
65
  "@deepseek-ai/dsh-client-ui-slots",
65
66
  "@deepseek-ai/dsh-client-ui-sidebar-right",
66
67
  "@deepseek-ai/dsh-client-ui-sidebar-documentpreview"
@@ -72,6 +73,7 @@
72
73
  "@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5-rc.3",
73
74
  "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": ">=0.1.5-rc.3",
74
75
  "@deepseek-ai/dsh-client-ui-slots": ">=0.1.5-rc.3",
76
+ "@deepseek-ai/dsh-client-ui-theme": ">=0.1.5-rc.3",
75
77
  "react": "^18.0.0"
76
78
  },
77
79
  "devDependencies": {
@@ -103,6 +105,7 @@
103
105
  "@deepseek-ai/dsh-client-ui-slots": "0.1.5-rc.3",
104
106
  "@deepseek-ai/dsh-client-ui-sidebar-right": "0.1.5-rc.3",
105
107
  "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "0.1.5-rc.3",
108
+ "@deepseek-ai/dsh-client-ui-theme": "0.1.5-rc.3",
106
109
  "@deepseek-ai/dsh-host-webserver": "0.1.5-rc.3",
107
110
  "@types/node": "^22.0.0",
108
111
  "@types/react": "^18.3.0",