dsh-document-view 1.1.1 → 1.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 +37 -0
- package/README.md +152 -77
- package/README.zh.md +225 -0
- package/SECURITY.md +7 -6
- package/client.js +1245 -13
- package/docs/COMPATIBILITY.md +18 -9
- package/docs/DETAIL.md +1 -1
- package/docs/DETAIL.zh.md +1 -1
- package/docs/PUBLISHING.md +15 -11
- package/docs/screenshots/01-overview.png +0 -0
- package/docs/screenshots/02-annotations.png +0 -0
- package/docs/screenshots/03-settings.png +0 -0
- package/docs/screenshots/archive/01-overview-illustration-20261115.png +0 -0
- package/docs/screenshots/preview.png +0 -0
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +6 -3
- package/scripts/build.mjs +2 -0
- package/scripts/verify.mjs +164 -2
- package/src/annotations.mjs +375 -0
- package/src/collaboration.mjs +807 -9
- package/src/model.mjs +62 -4
- package/README.en.md +0 -134
- /package/docs/screenshots/{02-settings.png → archive/02-settings-illustration-20261115.png} +0 -0
- /package/docs/screenshots/{03-narrow.png → archive/03-narrow-illustration-20261115.png} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 1.2.1(2026-11-21)
|
|
4
|
+
|
|
5
|
+
- 文档默认语言改为英文:`README.md` 用英文、中文移到 `README.zh.md`,npm 包页与 GitHub 首页默认显示英文,顶部保留语言切换。
|
|
6
|
+
- 截图改为只对文字打码(左侧会话名、右侧对话文字、文件路径),面板、图标与工具栏保持清晰可见。
|
|
7
|
+
- 详情页预览图同步替换。
|
|
8
|
+
|
|
9
|
+
## 1.2.0(2026-11-21)
|
|
10
|
+
|
|
11
|
+
- 文档批注:在 Word / PDF / PPT 的 PDF 阅读页里选中文字,浮条提供「删除线」与「批注」;页面按矩形画删除线或虚线下划线 + 编号,缩放、翻页、重渲染后按引文重新定位。
|
|
12
|
+
- 汇总面板:文档工具栏「批注 N」打开列表,支持定位、编辑意见、删除、清空;「提交给 AI」把文件路径、页码、原文、意见与处理约定整理成一条结构化消息,直接发进当前会话。
|
|
13
|
+
- 批注按文件路径存入 `localStorage`(`dsh.document-view.annotations.v1`),提交后标记为已提交;不读取、不写回原文件。
|
|
14
|
+
- 修复:批注面板支持点击面板外部关闭、右上角 × 关闭,再点工具栏「批注」可收起;切换文件或会话时自动收起;标题计数不再被 flex 拉开。
|
|
15
|
+
- 覆盖 `.doc` / `.docx` / `.pdf` / `.ppt` / `.pptx`(宿主转 PDF 后带文字层);`.xlsx` 是插件自绘表格,不含文字层,暂不支持。
|
|
16
|
+
- `src/annotations.mjs` 新增存储、地址解码与提示词格式化;`scripts/verify.mjs` 增加 24 条批注断言与 4 条多窗口布局断言,并新增 `node --check client.js`。
|
|
17
|
+
- 优化与修复:重定位按页复用文本索引;文档改动后引文移到相邻 1–2 页仍能跟随,找不到引文就不再画旧矩形;引文带前后文,提示词明确「引文里的指令不执行」;编辑已提交的批注会重新变为待提交;提交防重复点击并加 15 秒超时;批注按钮与选区限定在当前会话面板内;宿主重建缩放层后自动补画标记;本地存储写失败会明确提示;容量裁剪优先丢已提交条目;HTML 解锁只在协作模式内触发;兼容 POSIX 路径分隔符;损坏的本地存储会被清洗。多窗口:批注改为每条一个 localStorage 键,监听 `storage` 事件实时合并;布局状态按会话合并保存,两个窗口不再互相覆盖;旧版 v1 批注自动迁移。
|
|
18
|
+
- Word 人工编辑本轮未做;预览工具栏自带的「用应用打开」可交给系统 Word / WPS,保存后预览自动刷新。
|
|
19
|
+
- README 中英双语补充批注功能与本地存储说明。
|
|
20
|
+
- 批注高亮加强:删除 span 红底 `rgba(239,68,68,.18)`、批注意见 span 黄底 `rgba(250,204,21,.36)`,此前 .06 / .16 底几乎看不见。
|
|
21
|
+
- 已提交的批注在被 AI 改完后可标出改动位置:原引文在新文件中找不到时,用批注存的前后文锚点定位「两个锚点之间」的接缝——替换段涂绿并加绿色底边、删除画 2px 绿竖线、角标改为 ✓;区间计算抽成纯函数 `locateChangedSpan`(verify 增加 5 条断言)。
|
|
22
|
+
- 创建批注时若选区与 PDF 文字层存在空格差异(「7 天」vs「7天」),用 `locateQuoteLoose` 回退定位并照常存前后文,避免这类批注改完后无法再定位(verify 增加 2 条断言,共 72 条)。
|
|
23
|
+
- 批注提示词(`formatAnnotationPrompt`)改为逐条分块:目标单列并标注「只删 / 只替换「」内字符」,前文 / 后文单列并标注「仅定位,不要改」;目标不再截断(原 160 字截断会让长引文被当成完整目标);处理约定补齐删除后的多余标点处理、意见未给新文字时的最小改动、PDF 空格差异定位规则。`scripts/verify.mjs` 增加 4 条断言,`client.js` 已重建。
|
|
24
|
+
|
|
25
|
+
## 未发版(2026-11-17)
|
|
26
|
+
|
|
27
|
+
- 支持本地 HTML:`.html` / `.htm` 文件在文档视图中居中显示(此前退回右侧栏)。
|
|
28
|
+
- `isDocument()` 增加后缀识别;布局判定增加 `iframe[data-html-preview]` DOM 兜底;iframe 加入 structuralSelector。
|
|
29
|
+
- `scripts/verify.mjs` 增加两条 HTML 断言;`client.js` 已重建。
|
|
30
|
+
- 声明宿主要求 `dsh.engines.dsh = ">=0.2.2-rc.3"`,插件市场不再显示「未声明宿主要求」。
|
|
31
|
+
- README 中英双语的「要求与兼容性」同步改为已声明口径。
|
|
32
|
+
|
|
33
|
+
## 文档(2026-11-16,未发版,仅仓库文档)
|
|
34
|
+
|
|
35
|
+
- 重写中英文 README:价值前置、徽章行、目录、30 秒安装、适用人群、Star 引导、路线图。
|
|
36
|
+
- 新增 `CONTRIBUTING.md` 与 Bug / Feature 两个 Issue 模板,降低参与门槛。
|
|
37
|
+
- 同步 `ROADMAP.md`、`docs/COMPATIBILITY.md` 的当前事实(已收录目录、插件版本 1.1.1)。
|
|
38
|
+
- 本批仅改文档,不重建 `client.js`、不升版本号。
|
|
39
|
+
|
|
3
40
|
## v1.1.1 (2026-11-15)
|
|
4
41
|
|
|
5
42
|
- 发布流程改为 npm trusted publishing(GitHub Actions OIDC),不再依赖会过期的 npm 令牌。
|
package/README.md
CHANGED
|
@@ -1,150 +1,225 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="icon.svg" alt="dsh-document-view" width="96" />
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
<h1>dsh-document-view</h1>
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
[](https://www.npmjs.com/package/dsh-document-view)
|
|
7
|
-
[](https://github.com/deepseek-ai/DeepSeek-Harness/releases/tag/dsh-v0.2.2-rc.3)
|
|
8
|
-
[](#要求)
|
|
6
|
+
<p><strong>Read the document. Keep the conversation. Mark it up.</strong><br />A split document view for DeepSeek Harness: the file stays in the center, your AI chat stays on the right; strike out or comment on the page, send the review to the AI, and see each edit highlighted.</p>
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
<p>English · <a href="README.zh.md">简体中文 →</a></p>
|
|
9
|
+
</div>
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
[](https://github.com/Frank-Fan-1058/dsh-document-view/stargazers)
|
|
12
|
+
[](https://github.com/Frank-Fan-1058/dsh-document-view/network/members)
|
|
13
|
+
[](https://github.com/Frank-Fan-1058/dsh-document-view/issues)
|
|
14
|
+
[](https://www.npmjs.com/package/dsh-document-view)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
[](https://github.com/deepseek-ai/DeepSeek-Harness)
|
|
17
|
+
[](SECURITY.md)
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
> ⭐ If this saves you a few round trips, star the repo — it helps other DeepSeek Harness users discover the plugin in marketplaces.
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
> Screenshots are **real captures**: the session sidebar and conversation are masked, and the document is a sample agreement with fictional parties and prices.
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>Table of contents</summary>
|
|
27
|
+
|
|
28
|
+
- [Install in 30 seconds](#install-in-30-seconds)
|
|
29
|
+
- [The problem](#the-problem)
|
|
30
|
+
- [Who it is for](#who-it-is-for)
|
|
31
|
+
- [Features](#features)
|
|
32
|
+
- [Privacy & security](#privacy--security)
|
|
33
|
+
- [Requirements & compatibility](#requirements--compatibility)
|
|
34
|
+
- [Install](#install)
|
|
35
|
+
- [Usage](#usage)
|
|
36
|
+
- [FAQ](#faq)
|
|
37
|
+
- [Roadmap](#roadmap)
|
|
38
|
+
- [Contributing](#contributing)
|
|
39
|
+
- [License](#license)
|
|
40
|
+
|
|
41
|
+
</details>
|
|
15
42
|
|
|
16
43
|
---
|
|
17
44
|
|
|
18
|
-
##
|
|
45
|
+
## Install in 30 seconds
|
|
46
|
+
|
|
47
|
+
Published on npm — one command:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
# Official CLI
|
|
51
|
+
dsh plugin --profile web add dsh-document-view
|
|
52
|
+
|
|
53
|
+
# Or 1024 Store
|
|
54
|
+
dsh1024 plugin --profile web add dsh-document-view
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Package: [npm / dsh-document-view](https://www.npmjs.com/package/dsh-document-view) (currently `1.2.0`). Enable it in the DSH plugin list and refresh the page. Other install options are in [Install](#install).
|
|
58
|
+
|
|
59
|
+
## The problem
|
|
19
60
|
|
|
20
|
-
|
|
61
|
+
Open a file in DSH and it takes over the right sidebar, pushing your conversation away. Asking the AI to explain, summarize or rewrite against that document means constantly switching between "reading" and "chatting" — and losing context every time. Pasting the content into the chat means repeated copy-paste and truncated context.
|
|
21
62
|
|
|
22
|
-
`dsh-document-view`
|
|
63
|
+
`dsh-document-view` does exactly one thing: **keeps both on screen**. It does not take over the editor, change save behavior, or touch your files. It only rearranges the window so DSH native document / Office preview and the chat panel work side by side.
|
|
23
64
|
|
|
24
|
-
| |
|
|
65
|
+
| | Default | Document view on |
|
|
25
66
|
| --- | --- | --- |
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
67
|
+
| Document | Takes the right sidebar | Center area |
|
|
68
|
+
| Conversation | Pushed away | Always visible on the right |
|
|
69
|
+
| Ask AI about the document | Switch back and forth / paste | Same screen |
|
|
70
|
+
| Editing / saving / preview | Native | **Still native** |
|
|
71
|
+
|
|
72
|
+
## Who it is for
|
|
73
|
+
|
|
74
|
+
- Reading papers, reports, contracts or specs while asking the AI about them
|
|
75
|
+
- Checking Excel / PowerPoint data and following up on a specific row or slide
|
|
76
|
+
- Editing code or Markdown while getting AI review, without switching tabs
|
|
77
|
+
- Using a large or multi-monitor setup and wanting document and chat side by side
|
|
30
78
|
|
|
31
|
-
##
|
|
79
|
+
## Features
|
|
32
80
|
|
|
33
|
-
### 1.
|
|
81
|
+
### 1. Document and chat, side by side
|
|
34
82
|
|
|
35
|
-

|
|
36
84
|
|
|
37
|
-
|
|
85
|
+
Open any file, then click **Document view** in the conversation header actions or the file tab actions. Drag the divider to resize; `←` / `→` nudge it, `Home` resets the ratio, and double-clicking the divider restores the default. The toggle and ratio are **saved per session**.
|
|
38
86
|
|
|
39
|
-
### 2.
|
|
87
|
+
### 2. Mark up the page, hand the review to the agent
|
|
40
88
|
|
|
41
|
-

|
|
42
90
|
|
|
43
|
-
|
|
91
|
+
Select text in the Word / PDF / PowerPoint page and a small toolbar appears:
|
|
44
92
|
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
- **自动更新 / 已暂停**:沿用宿主原生的文件变化监听,需要仔细阅读时可暂停跟随,继续后显示最新内容,并保留原生预览的页码与缩放状态。
|
|
93
|
+
- **Strikethrough** marks a passage for deletion and draws the line on the page.
|
|
94
|
+
- **Comment** records your change request; the page shows an amber highlight with a dashed underline and a numbered badge.
|
|
48
95
|
|
|
49
|
-
|
|
96
|
+
The **Annotate N** button in the document toolbar opens the review list: jump to a mark, edit the comment, delete it. **Send to AI** turns the whole list into one structured message (file path, page, exact target text, surrounding context, request, working conventions) in the right-hand conversation. The agent edits the original file, and the native preview follows the disk change. Annotations are kept per file path in browser storage, so a refresh or restart keeps them.
|
|
50
97
|
|
|
51
|
-
|
|
98
|
+
> Excel previews are an in-plugin canvas without a text layer, so they are outside this version.
|
|
99
|
+
> Manual Word editing is not part of this release: the preview toolbar already has an "open in app" control that hands the file to Word / WPS; saving there refreshes the preview.
|
|
52
100
|
|
|
53
|
-
|
|
101
|
+
### 3. See where the edit landed
|
|
54
102
|
|
|
55
|
-
|
|
103
|
+
Once a review is sent, the quoted text no longer exists in the edited file. The plugin then re-anchors the mark with the text that surrounded it:
|
|
56
104
|
|
|
57
|
-
|
|
105
|
+
- a replaced passage gets a green highlight, a green underline and a **✓** badge;
|
|
106
|
+
- a deleted passage gets a 2px green caret in the seam between its neighbours;
|
|
107
|
+
- a mark whose text did not change stays as it was (dimmed) and is never marked green.
|
|
58
108
|
|
|
59
|
-
|
|
109
|
+
Each mark is resolved on its own; a mark without surrounding context is reported, not guessed.
|
|
60
110
|
|
|
61
|
-
|
|
111
|
+
### 4. Settings and auto-enter
|
|
62
112
|
|
|
63
|
-
-
|
|
64
|
-
- **零文件访问**:不调用任何读写文件的接口,不碰编辑器内容。
|
|
65
|
-
- **零凭据**:包内不含 API Key、Token、密码、Cookie 或任何密钥;没有 `.env`、没有配置文件。
|
|
66
|
-
- **只存一项偏好**:用浏览器 `localStorage` 保存「自动进入开关 + 每个会话的分栏比例」,键名 `dsh.document-view.v1`,不保存文档内容、路径、文件名或对话内容。
|
|
67
|
-
- **作用域收窄**:所有样式都限定在插件自己加的 `[data-fdc-*]` 属性下,不改宿主全局样式;不移动、不克隆、不重新挂载任何 React 组件,只调整窗口网格的几何尺寸。
|
|
113
|
+

|
|
68
114
|
|
|
69
|
-
|
|
115
|
+
The arrow next to the toggle opens settings:
|
|
70
116
|
|
|
71
|
-
|
|
117
|
+
- **Auto-enter on document view** (off by default) — fires only when *you* click a file or file tab; background file operations never open it. After you exit manually, the same file will not re-open repeatedly.
|
|
118
|
+
- **Document-first / Balanced / Chat-first** presets, saved per session.
|
|
119
|
+
- **Auto update / Paused** — reuses the host native file watcher. Pause when you want to read carefully; resuming shows the latest content while preserving the native viewer page and zoom state.
|
|
72
120
|
|
|
73
|
-
|
|
74
|
-
- Node.js >= 20 —— **仅从源码重建时需要**;单纯安装使用不需要 Node.js。
|
|
75
|
-
- 不设 `engines.dsh` 硬约束:版本约束写错会直接阻止安装,兼容性声明放在本文档与 [兼容性说明](docs/COMPATIBILITY.md)。
|
|
121
|
+
### 5. Works in narrow windows
|
|
76
122
|
|
|
77
|
-
|
|
123
|
+
When the window is too narrow it switches to a single-column **Document / Chat** toggle. **Unsent input is preserved**, and focus moves to the visible switch if the current focus would be hidden.
|
|
78
124
|
|
|
79
|
-
|
|
125
|
+
### 6. Native all the way down
|
|
80
126
|
|
|
81
|
-
|
|
127
|
+
Rendering, editing, saving and preview of Markdown, PDF, Word, Excel, PowerPoint and local HTML files remain entirely with DSH own viewers and Office engine. The plugin **never reads, writes or uploads your files** and reimplements no editing feature. Disable it and the default layout returns.
|
|
128
|
+
|
|
129
|
+
## Privacy & security
|
|
130
|
+
|
|
131
|
+
The plugin touches your workspace UI, so every claim below is verifiable from the source:
|
|
132
|
+
|
|
133
|
+
- **No network calls** — no `http(s)://` address, `XMLHttpRequest` or `WebSocket`. The single `fetch` reads the HTML file you just opened, through the host's own local `dsh-resource://` protocol.
|
|
134
|
+
- **No file reads or writes** — no filesystem or editor read/write APIs. Annotations only read the selected text from the rendered page text layer; the original file is never opened.
|
|
135
|
+
- **No credentials** — no API keys, tokens, passwords, cookies, `.env` or config files ship in the package.
|
|
136
|
+
- **Two local stores only** — `dsh.document-view.v1` holds the auto-enter toggle and per-session ratios; `dsh.document-view.annotations.v2/` holds one key per annotation (file path, page, quoted text, request, status), so several windows can add marks without overwriting each other. Both stay in browser `localStorage`; nothing is uploaded or written back to a file.
|
|
137
|
+
- **Narrow CSS scope** — all styles are scoped to the plugin own `[data-fdc-*]` attributes. No host components are moved, cloned or remounted; only the window grid geometry changes.
|
|
138
|
+
|
|
139
|
+
See [SECURITY.md](SECURITY.md) and [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
|
|
140
|
+
|
|
141
|
+
## Requirements & compatibility
|
|
142
|
+
|
|
143
|
+
- [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) Desktop / Web, verified on **v0.2.2-rc.3**.
|
|
144
|
+
- Node.js >= 20 — **only for rebuilding from source**; not needed to install or use.
|
|
145
|
+
- **Host requirement declared**: `dsh.engines.dsh = ">=0.2.2-rc.3"`. On older DSH versions the host refuses the install with `incompatible-version` instead of loading a plugin that would blank the page. Granular boundaries are in the [compatibility notes](docs/COMPATIBILITY.md).
|
|
146
|
+
|
|
147
|
+
> The plugin relies on the host DOM structure and slot names. If a DSH upgrade changes them, the plugin **disables itself safely and the page keeps working** (no white screen). Re-verify with the [upgrade checklist](docs/COMPATIBILITY.md).
|
|
148
|
+
|
|
149
|
+
## Install
|
|
150
|
+
|
|
151
|
+
**Option 0 — from npm (recommended, unlocks one-line install)**
|
|
82
152
|
|
|
83
153
|
```sh
|
|
84
|
-
# 1024 Store 的安装方式
|
|
85
154
|
dsh1024 plugin --profile web add dsh-document-view
|
|
86
|
-
|
|
87
|
-
# 或直接走官方 CLI
|
|
155
|
+
# or
|
|
88
156
|
dsh plugin --profile web add dsh-document-view
|
|
89
157
|
```
|
|
90
158
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
**方式一:本地目录安装(最简单)**
|
|
159
|
+
**Option 1 — local directory**
|
|
94
160
|
|
|
95
161
|
```sh
|
|
96
162
|
git clone https://github.com/Frank-Fan-1058/dsh-document-view.git
|
|
97
163
|
```
|
|
98
164
|
|
|
99
|
-
|
|
165
|
+
Then in DSH: **Plugins → Add plugin**, pick the `dsh-document-view` directory, enable it, and refresh the page (or restart DSH).
|
|
100
166
|
|
|
101
|
-
|
|
167
|
+
**Option 2 — tarball**
|
|
102
168
|
|
|
103
169
|
```sh
|
|
104
170
|
npm pack
|
|
105
171
|
```
|
|
106
172
|
|
|
107
|
-
|
|
173
|
+
Extract `dsh-document-view-*.tgz` anywhere, then point step 2 of Option 1 at that directory.
|
|
108
174
|
|
|
109
|
-
|
|
175
|
+
**Option 3 — build from source**
|
|
110
176
|
|
|
111
177
|
```sh
|
|
112
|
-
npm install #
|
|
178
|
+
npm install # only needed to rebuild
|
|
113
179
|
node scripts/build.mjs
|
|
180
|
+
node scripts/verify.mjs
|
|
114
181
|
```
|
|
115
182
|
|
|
116
|
-
`src/`
|
|
183
|
+
`src/` is the source; `client.js` is the self-contained build artifact (all CSS inlined, no runtime dependencies). **Rebuild `client.js` after any `src/` change** — do not hand-edit the artifact.
|
|
184
|
+
|
|
185
|
+
> `file:` dependencies are physical copies: after editing source, remove `node_modules/<package>` and reinstall so the running copy updates.
|
|
117
186
|
|
|
118
|
-
|
|
187
|
+
## Usage
|
|
119
188
|
|
|
120
|
-
|
|
189
|
+
1. Open a file in the right sidebar (Markdown / PDF / Office).
|
|
190
|
+
2. Click **Document view** in the conversation header or file tab actions.
|
|
191
|
+
3. Drag the divider; `←` / `→` to nudge, `Home` or double-click to reset.
|
|
192
|
+
4. Open settings via the arrow for auto-enter and layout presets.
|
|
193
|
+
5. Click the toggle again (or the exit entry in the session / file header) to return to the default layout.
|
|
121
194
|
|
|
122
|
-
|
|
123
|
-
2. 点会话头部或文件标签上的 **「文档视图」**。
|
|
124
|
-
3. 拖动分隔线调宽度;`←` / `→` 微调,`Home` 或双击分隔线复位。
|
|
125
|
-
4. 点开关旁的箭头进设置,按需开启「自动进入」或选布局预设。
|
|
126
|
-
5. 再点一次开关(或会话顶部 / 文件顶部的退出入口)即可退出,恢复默认布局。
|
|
195
|
+
## FAQ
|
|
127
196
|
|
|
128
|
-
|
|
197
|
+
**Will it affect my editors or Office plugins?** No. It changes layout only — Univer, Office converters and native editors are untouched.
|
|
129
198
|
|
|
130
|
-
|
|
199
|
+
**Are my files read or uploaded?** No. No network requests, no file I/O, only the toggle and ratios are stored.
|
|
131
200
|
|
|
132
|
-
|
|
201
|
+
**Does anything remain after disabling?** No. All injected styles, attributes, the divider and listeners are removed on teardown.
|
|
133
202
|
|
|
134
|
-
|
|
203
|
+
**What if a DSH upgrade breaks it?** It disables itself safely and the page stays usable. Open an [Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) with your DSH version.
|
|
135
204
|
|
|
136
|
-
|
|
205
|
+
**Which file types are supported?** Whatever the host supports natively — Markdown, PDF, Word, Excel, PowerPoint, local HTML, etc. The plugin adds no format restrictions.
|
|
137
206
|
|
|
138
|
-
|
|
207
|
+
## Roadmap
|
|
139
208
|
|
|
140
|
-
|
|
209
|
+
Shipped: v1.0.0 first third-party installable release, v1.1.0 bilingual docs and safe-deactivation fallback, v1.1.1 npm trusted publishing, v1.2.0 page annotations and edit highlighting.
|
|
141
210
|
|
|
142
|
-
|
|
211
|
+
Already listed: npm package, 1024 Store / awesome catalog (PR #942 merged), and the GitHub `dsh-plugin` topic. Next (feedback-driven): follow up on the dsh-market catalog PR review; re-verify after new DSH releases; add more locales and layout presets. See [ROADMAP.md](ROADMAP.md) and [CHANGELOG.md](CHANGELOG.md).
|
|
143
212
|
|
|
144
|
-
##
|
|
213
|
+
## Contributing
|
|
145
214
|
|
|
146
|
-
|
|
215
|
+
Issues and PRs welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Rebuild `client.js` when changing `src/`; update both `locale/en.json` and `locale/zh.json` when changing UI copy. Never put real sessions, file names, accounts or personal data into illustrations or examples.
|
|
147
216
|
|
|
148
|
-
|
|
217
|
+
Want more people to find it inside DSH? See **[docs/PUBLISHING.md](docs/PUBLISHING.md)** for the full playbook (1024 Store, dsh-market, the `dsh-plugin` GitHub topic, npm publishing) and the ready-to-use [catalog entry](docs/awesome-dsh-catalog-entry.json).
|
|
218
|
+
|
|
219
|
+
## License
|
|
149
220
|
|
|
150
221
|
[MIT](LICENSE) © 2026 dsh-document-view contributors
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
<p align="center">Found it useful? <a href="https://github.com/Frank-Fan-1058/dsh-document-view">Give it a ⭐ Star</a> · <a href="https://github.com/Frank-Fan-1058/dsh-document-view/issues">Report an issue</a> · <a href="README.zh.md">中文 README</a></p>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="icon.svg" alt="dsh-document-view" width="96" />
|
|
3
|
+
|
|
4
|
+
<h1>dsh-document-view</h1>
|
|
5
|
+
|
|
6
|
+
<p><strong>边看文档,边聊 AI,边划批注。</strong><br />文档居中显示,当前会话留在右侧;在页面上划线批注,一键交给 AI 逐条改,改完改动处标绿。</p>
|
|
7
|
+
|
|
8
|
+
<p>简体中文 · <a href="README.md">English →</a></p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
[](https://github.com/Frank-Fan-1058/dsh-document-view/stargazers)
|
|
12
|
+
[](https://github.com/Frank-Fan-1058/dsh-document-view/network/members)
|
|
13
|
+
[](https://github.com/Frank-Fan-1058/dsh-document-view/issues)
|
|
14
|
+
[](https://www.npmjs.com/package/dsh-document-view)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
[](https://github.com/deepseek-ai/DeepSeek-Harness)
|
|
17
|
+
[](SECURITY.md)
|
|
18
|
+
|
|
19
|
+
> ⭐ 如果它帮你省下了来回切换,给仓库点个 Star —— 这能让更多 DSH 用户在插件市场里发现它。
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
> 以上为**真实界面截图**:会话栏与对话内容已打码,文档为示例协议(主体与价格均为虚构)。
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>目录</summary>
|
|
27
|
+
|
|
28
|
+
- [30 秒装上](#30-秒装上)
|
|
29
|
+
- [为什么需要它](#为什么需要它)
|
|
30
|
+
- [适合谁](#适合谁)
|
|
31
|
+
- [核心能力](#核心能力)
|
|
32
|
+
- [隐私与安全](#隐私与安全)
|
|
33
|
+
- [要求与兼容性](#要求与兼容性)
|
|
34
|
+
- [安装](#安装)
|
|
35
|
+
- [使用](#使用)
|
|
36
|
+
- [常见问题](#常见问题)
|
|
37
|
+
- [路线图](#路线图)
|
|
38
|
+
- [参与贡献](#参与贡献)
|
|
39
|
+
- [许可证](#许可证)
|
|
40
|
+
|
|
41
|
+
</details>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 30 秒装上
|
|
46
|
+
|
|
47
|
+
已发布到 npm,一行命令即可:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
# 官方 CLI
|
|
51
|
+
dsh plugin --profile web add dsh-document-view
|
|
52
|
+
|
|
53
|
+
# 或 1024 Store
|
|
54
|
+
dsh1024 plugin --profile web add dsh-document-view
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
包地址:[npm / dsh-document-view](https://www.npmjs.com/package/dsh-document-view)(当前 `1.2.0`)。装完在 DSH 插件列表启用、刷新页面即可。其它装法见 [安装](#安装)。
|
|
58
|
+
|
|
59
|
+
## 为什么需要它
|
|
60
|
+
|
|
61
|
+
在 DSH 里打开一个文件,文档会占满右侧栏,正在进行的对话被挤走。想让 AI 对照文档解释、总结、改写,只能在「看文档」和「看对话」之间反复切换,上下文一直在丢;把内容复制进对话,又得反复粘贴、还容易截断。
|
|
62
|
+
|
|
63
|
+
`dsh-document-view` 只做一件事:**把这两块同时留在屏幕上**。它不接管编辑器、不改动保存逻辑、也不碰你的文件 —— 只是重新排布窗口,让 DSH 原生的文档 / Office 预览和对话框并排工作。
|
|
64
|
+
|
|
65
|
+
| | 默认布局 | 开启文档视图 |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| 看文档 | 右侧栏独占 | 中间区域显示 |
|
|
68
|
+
| 当前对话 | 被挤走,需要切回 | 右侧始终可见 |
|
|
69
|
+
| 让 AI 对照文档回答 | 来回切换 / 反复粘贴 | 同屏完成 |
|
|
70
|
+
| 编辑、保存、预览 | 原生功能 | **仍是原生功能** |
|
|
71
|
+
|
|
72
|
+
## 适合谁
|
|
73
|
+
|
|
74
|
+
- 读论文、报告、合同、需求文档时,想让 AI 边看边解释
|
|
75
|
+
- 对着 Excel / PPT 核对数据,随时追问某一行、某一页
|
|
76
|
+
- 一边改代码或 Markdown,一边让 AI 评审,不想来回切标签
|
|
77
|
+
- 用大屏或多显示器,希望文档和对话各占一块
|
|
78
|
+
|
|
79
|
+
## 核心能力
|
|
80
|
+
|
|
81
|
+
### 1. 文档与对话同屏
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
打开任意文件后,在会话头部或文件标签的操作区点 **「文档协作」** 即可开启。拖动分隔线调整宽度,也可以用 `←` / `→` 微调、`Home` 复位、双击分隔线恢复默认比例。开关和比例**按会话分别记住**。
|
|
86
|
+
|
|
87
|
+
### 2. 划线批注,一键交给 AI
|
|
88
|
+
|
|
89
|
+

|
|
90
|
+
|
|
91
|
+
在 Word / PDF / PPT 的阅读页里选中文字,浮条上会出现两个动作:
|
|
92
|
+
|
|
93
|
+
- **删除线**:标记这段应删掉,页面上直接画删除线。
|
|
94
|
+
- **批注**:写一句修改意见,页面上以黄底虚线下划线加编号标出。
|
|
95
|
+
|
|
96
|
+
文档工具栏的 **「批注 N」** 打开汇总面板:按页列出每条批注,可定位、改意见、删除。点 **「提交给 AI」**,插件把「文件路径 + 页码 + 目标原文 + 前后文 + 意见 + 处理约定」整理成一条结构化消息发进右侧对话,AI 按条改原文件,改完原生预览自动跟随磁盘更新。批注按文件路径保存在浏览器本地,刷新或重启后仍在。
|
|
97
|
+
|
|
98
|
+
> Excel 预览是插件自绘表格,没有文字层,因此不在本版批注范围内。
|
|
99
|
+
> Word 的人工编辑本轮未做:预览工具栏自带的「用应用打开」可把文件交给系统 Word / WPS,保存后预览会自动刷新。
|
|
100
|
+
|
|
101
|
+
### 3. 改完的位置会标绿
|
|
102
|
+
|
|
103
|
+
批注提交后,原引文在新文件里已经找不到(说明这段被改过),插件就用批注存下的前后文锚点重新定位:
|
|
104
|
+
|
|
105
|
+
- 被替换的段落:绿色底 + 绿底边,角标变成 **✓**;
|
|
106
|
+
- 整段被删:前文与后文的接缝处一条 2px 绿色竖线;
|
|
107
|
+
- 文字没动的批注保持原样(变淡显示),不会误标。
|
|
108
|
+
|
|
109
|
+
多处批注各自独立定位;找不到前后文的批注不猜、不标。
|
|
110
|
+
|
|
111
|
+
### 4. 设置与自动进入
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
开关旁的箭头打开设置:
|
|
116
|
+
|
|
117
|
+
- **查看文档时自动进入**(默认关闭):只在你主动点击文件或文件标签时触发,后台文件操作不会打扰你;手动退出后,同一个文件不会反复自动打开。
|
|
118
|
+
- **文档优先 / 均衡 / 对话优先** 三种预设,按会话保存。
|
|
119
|
+
- **自动更新 / 已暂停**:沿用宿主原生的文件变化监听,需要仔细阅读时可暂停跟随,继续后显示最新内容,并保留原生预览的页码与缩放状态。
|
|
120
|
+
|
|
121
|
+
### 5. 窄窗口也能用
|
|
122
|
+
|
|
123
|
+
窗口不够宽时自动切换为「文档 / 对话」单栏切换,**未发送的输入不会丢**;宽转窄时若焦点落在即将隐藏的区域,会移到可见的切换按钮上。
|
|
124
|
+
|
|
125
|
+
### 6. 只用原生能力
|
|
126
|
+
|
|
127
|
+
Markdown、PDF、Word、Excel、PPT 与**本地 HTML 文件**的渲染、编辑、保存与预览,全部继续由 DSH 自带的查看器和 Office 引擎负责。本插件**不读取、不写入、不上传**你的文件,也不重复实现任何编辑功能。停用插件即恢复默认布局。
|
|
128
|
+
|
|
129
|
+
## 隐私与安全
|
|
130
|
+
|
|
131
|
+
插件会接触你的工作界面,所以这一点值得单独说清楚 —— 以下每条都能从源码核对:
|
|
132
|
+
|
|
133
|
+
- **零网络请求**:没有任何 `http(s)://` 地址、`XMLHttpRequest`、`WebSocket`。唯一的 `fetch` 是读你刚打开的那个 HTML 文件(走宿主自己的 `dsh-resource://` 本地协议),用于自建 HTML 预览。
|
|
134
|
+
- **零文件读写**:不调用任何读写文件的接口,不碰编辑器内容。批注只读取页面文字层里的选中文字,不打开原文件。
|
|
135
|
+
- **零凭据**:包内不含 API Key、Token、密码、Cookie 或任何密钥;没有 `.env`、没有配置文件。
|
|
136
|
+
- **只存两类本地数据**:`dsh.document-view.v1` 保存「自动进入开关 + 每个会话的分栏比例」;`dsh.document-view.annotations.v2/` 下每条批注一个键(文件路径、页码、选中文字、意见与状态),多个窗口同时打开时互不覆盖;两者都只在浏览器 `localStorage`,不上传、不写回文件。
|
|
137
|
+
- **作用域收窄**:所有样式限定在插件自己加的 `[data-fdc-*]` 属性下,不改宿主全局样式;不移动、不克隆、不重新挂载任何 React 组件,只调整窗口网格的几何尺寸。
|
|
138
|
+
|
|
139
|
+
详见 [SECURITY.md](SECURITY.md) 与 [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md)。
|
|
140
|
+
|
|
141
|
+
## 要求与兼容性
|
|
142
|
+
|
|
143
|
+
- [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) 桌面版 / Web 版,已在 **v0.2.2-rc.3** 上验证通过。
|
|
144
|
+
- Node.js >= 20 —— **仅从源码重建时需要**;单纯安装使用不需要 Node.js。
|
|
145
|
+
- **已声明宿主要求**:`dsh.engines.dsh = ">=0.2.2-rc.3"`——低于该版本 DSH 会拒绝安装并提示 `incompatible-version`,避免装上去白屏。更细的兼容边界见 [兼容性说明](docs/COMPATIBILITY.md)。
|
|
146
|
+
|
|
147
|
+
> 插件依赖宿主的 DOM 结构与 slot 名称。DSH 升级后若这些内部结构变化,插件会**自动停用并保持页面可用**(不会白屏),随后按 [升级复核清单](docs/COMPATIBILITY.md#升级复核清单) 重验即可。
|
|
148
|
+
|
|
149
|
+
## 安装
|
|
150
|
+
|
|
151
|
+
**方式零:从 npm 安装(推荐,解锁一键安装)**
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
dsh1024 plugin --profile web add dsh-document-view
|
|
155
|
+
# 或
|
|
156
|
+
dsh plugin --profile web add dsh-document-view
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**方式一:本地目录安装**
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
git clone https://github.com/Frank-Fan-1058/dsh-document-view.git
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
然后打开 DSH → **插件 → 添加插件**,选中 `dsh-document-view` 目录 → 在插件列表启用 → 刷新页面(或重启 DSH)。
|
|
166
|
+
|
|
167
|
+
**方式二:打包成 tarball**
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
npm pack
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
把生成的 `dsh-document-view-*.tgz` 解压到任意目录,再按方式一第 2 步指向该目录。
|
|
174
|
+
|
|
175
|
+
**方式三:从源码构建**
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
npm install # 仅构建时需要
|
|
179
|
+
node scripts/build.mjs
|
|
180
|
+
node scripts/verify.mjs
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
`src/` 是源码,`client.js` 是自包含构建产物(内联全部 CSS,无运行时依赖)。**改了 `src/` 必须重建** `client.js`,不要手改产物。
|
|
184
|
+
|
|
185
|
+
> `file:` 依赖是实体拷贝:改了源码要删掉 `node_modules/<包名>` 再重装,运行副本才会更新。
|
|
186
|
+
|
|
187
|
+
## 使用
|
|
188
|
+
|
|
189
|
+
1. 在右侧栏打开一个文件(Markdown / PDF / Office 均可)。
|
|
190
|
+
2. 点会话头部或文件标签上的 **「文档视图」**。
|
|
191
|
+
3. 拖动分隔线调宽度;`←` / `→` 微调,`Home` 或双击分隔线复位。
|
|
192
|
+
4. 点开关旁的箭头进设置,按需开启「自动进入」或选布局预设。
|
|
193
|
+
5. 再点一次开关(或会话顶部 / 文件顶部的退出入口)即可退出,恢复默认布局。
|
|
194
|
+
|
|
195
|
+
## 常见问题
|
|
196
|
+
|
|
197
|
+
**会影响我已有的文档编辑器或 Office 插件吗?** 不会。本插件不改 Univer、Office 转换服务或任何原生编辑器,只调整窗口布局。
|
|
198
|
+
|
|
199
|
+
**我的文件会被读取或上传吗?** 不会。插件不发网络请求、不读写文件,只保存开关与比例两项偏好。
|
|
200
|
+
|
|
201
|
+
**关掉插件后布局会残留吗?** 不会。卸载时会移除所有注入的样式、属性、分隔线与监听,恢复宿主原生布局。
|
|
202
|
+
|
|
203
|
+
**升级 DSH 后失效了怎么办?** 插件会安全地自动停用(页面照常可用)。请提 [Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) 并附上 DSH 版本,维护者按 [升级复核清单](docs/COMPATIBILITY.md#升级复核清单) 适配。
|
|
204
|
+
|
|
205
|
+
**支持哪些文件类型?** 宿主原生支持什么就支持什么:Markdown、PDF、Word、Excel、PPT、本地 HTML 等,本插件不做格式限制。
|
|
206
|
+
|
|
207
|
+
## 路线图
|
|
208
|
+
|
|
209
|
+
已发布:v1.0.0 首个第三方可安装版本、v1.1.0 双语文档与安全兜底、v1.1.1 npm trusted publishing、v1.2.0 文档批注与改动高亮。
|
|
210
|
+
|
|
211
|
+
已收录:npm 包、1024 Store / awesome 目录(PR #942 已合并)、GitHub `dsh-plugin` topic。接下来(按反馈排期):跟进 dsh-market 目录 PR 审核;DSH 新版本发布后按升级复核清单重验;视反馈补充更多语言与布局预设。完整清单见 [ROADMAP.md](ROADMAP.md),版本记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
212
|
+
|
|
213
|
+
## 参与贡献
|
|
214
|
+
|
|
215
|
+
欢迎提 [Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) 与 PR,流程见 [CONTRIBUTING.md](CONTRIBUTING.md)。改 `src/` 后请一并提交重建后的 `client.js`;涉及界面文案时同步更新 `locale/en.json` 与 `locale/zh.json`。提交界面截图前请先对会话、文件名、账号等打码。
|
|
216
|
+
|
|
217
|
+
想让更多人在 DSH 内直接搜到并安装?完整流程(1024 Store / dsh-market 的收录方式、`dsh-plugin` topic、npm 发布、目录 PR 模板)见 **[docs/PUBLISHING.md](docs/PUBLISHING.md)**,仓库内已备好可直接复用的 [目录条目](docs/awesome-dsh-catalog-entry.json)。
|
|
218
|
+
|
|
219
|
+
## 许可证
|
|
220
|
+
|
|
221
|
+
[MIT](LICENSE) © 2026 dsh-document-view contributors
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
<p align="center">觉得有用?<a href="https://github.com/Frank-Fan-1058/dsh-document-view">给个 ⭐ Star</a> · <a href="https://github.com/Frank-Fan-1058/dsh-document-view/issues">反馈问题</a> · <a href="README.md">English README</a></p>
|
package/SECURITY.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# Security & privacy
|
|
2
2
|
|
|
3
|
-
`dsh-document-view` is a
|
|
3
|
+
`dsh-document-view` is a client bundle for the document split view and in-page review marks. The following claims are verifiable from the source (`src/`, `client.js`, `index.js`):
|
|
4
4
|
|
|
5
5
|
| Concern | Status |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| Network requests | None — no `
|
|
8
|
-
| File I/O |
|
|
7
|
+
| Network requests | None — no `https?://` URL, `XMLHttpRequest`, `WebSocket` or `EventSource`. The only `fetch` reads the file you already opened through the host's local `dsh-resource://` protocol, to render our own HTML preview |
|
|
8
|
+
| File I/O | Read-only, and only the open document: the HTML preview re-reads that one file through the host's own protocol; annotations read the rendered page text layer. No filesystem API, no writes |
|
|
9
9
|
| Credentials | None — no API keys, tokens, passwords, cookies, `.env`, or config files in the package |
|
|
10
|
-
| Data stored |
|
|
11
|
-
| Data not stored |
|
|
10
|
+
| Data stored | Two local stores. `dsh.document-view.v1`: the auto-enter flag and per-session column ratios. The `dsh.document-view.annotations.v2/` prefix: one key per annotation — file path, page number, the quoted snippet, your comment, and open/sent status; a `storage` listener keeps concurrently open windows converged |
|
|
11
|
+
| Data not stored | Full document contents, chat content, account data, or anything you did not select for an annotation |
|
|
12
|
+
| Sending to the model | Only when you press **Send to AI**: the review prompt goes through the host's own conversation service, exactly like a typed message. The plugin itself makes no network call |
|
|
12
13
|
| Host modification | CSS is scoped to the plugin's own `[data-fdc-*]` attributes; no host React nodes are moved, cloned or remounted |
|
|
13
|
-
| Teardown | Removes all injected styles, attributes, divider,
|
|
14
|
+
| Teardown | Removes all injected styles, attributes, divider, observer, annotation layer, popover and listeners on disable |
|
|
14
15
|
|
|
15
16
|
The only URLs in the repository are documentation links in the README, the `docs/` guides, and the public `repository` / `bugs` / `homepage` fields in `package.json`.
|
|
16
17
|
|