dsh-preview-find 0.0.0-stage → 0.1.0

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,3 +1,108 @@
1
- # Temporary Holding Version
1
+ # dsh-preview-find
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
+ Find-in-preview for DeepSeek Harness: a search button on the file preview's
4
+ toolbar that opens a small panel, like the editor's find widget. It searches
5
+ the text the preview shows, highlights every match, and steps through them.
6
+
7
+ ## Install
8
+
9
+ Published on npm:
10
+
11
+ ```sh
12
+ dsh plugin --profile web add dsh-preview-find
13
+ ```
14
+
15
+ The command forwards to pnpm inside that profile and then registers the package
16
+ as a profile layer, because `package.json` declares `dsh.bundle.patch`; no
17
+ manual `dsh.profile.bundles` edit is needed. Reload the page and the find button
18
+ appears on every preview that renders text. The plugin also shows up on the
19
+ Plugins page, where it can be switched off.
20
+
21
+ ### From a checkout
22
+
23
+ The Harness serves the browser half from `lib/client.js`, which is a build
24
+ artifact, so build it before installing:
25
+
26
+ ```sh
27
+ pnpm install
28
+ pnpm run build # lib/index.js (host half) and lib/client.js (browser half)
29
+ dsh plugin --profile web add /absolute/path/to/dsh-preview-find
30
+ ```
31
+
32
+ Re-run `pnpm run build` after changing the source: the browser artifact is
33
+ cached immutably per revision, and a reload picks up the new one. `npm publish`
34
+ builds the same two files through `prepack`, so the published tarball always
35
+ carries `lib/`.
36
+
37
+ ## Use
38
+
39
+ The search button sits in the preview's header, between the preview's own
40
+ controls and the reload button:
41
+
42
+ ```
43
+ path … [viewer] [wrap] [search] [reload] [handoff] [file tree]
44
+ ```
45
+
46
+ Markdown previews have no wrap control, so the button is directly left of
47
+ reload; code previews keep it after the wrap control.
48
+
49
+ | Control | Behavior |
50
+ | --- | --- |
51
+ | search button | opens and closes the panel |
52
+ | input | searches as you type, after 120 ms |
53
+ | `Enter` / `Shift+Enter` | next / previous match |
54
+ | `Esc` | closes the panel |
55
+ | `Aa` | match case |
56
+ | `ab\|` | match whole words only |
57
+ | `.*` | treat the input as a regular expression |
58
+
59
+ The panel shows the position and total (`3/17`), `no results`, or that the
60
+ regular expression does not compile. All matches get one color and the current
61
+ match another; the current match is scrolled into view.
62
+
63
+ ## What it searches
64
+
65
+ The text the preview renders — Markdown, code, and plain-text bodies — split
66
+ into blocks by layout, so a term can cross inline markup inside a paragraph but
67
+ never spans two paragraphs. Whole-word matching treats letters, digits, and
68
+ underscores in any script as word characters, so `搜索` does not match inside
69
+ `搜索引擎`, and a paragraph's own edge counts as a word boundary.
70
+
71
+ - A paged file is searched as far as it is loaded; the preview reads more pages
72
+ as you scroll.
73
+ - The control exists only where the preview puts text in the document: paged-text
74
+ bodies (Markdown, code, plain text) and PDF, whose preview keeps a real text
75
+ layer. Images, Office, Excel, and HTML draw pixels or a frame, so they get no
76
+ control at all — opening one loads nothing.
77
+ - A file read as plain text (an SVG, for example) gets the control back, because
78
+ that body renders text.
79
+ - Highlighting needs the CSS Custom Highlight API (Chromium 105+, Safari 17.2+,
80
+ Firefox 140+). On older browsers the panel still counts and scrolls to
81
+ matches, without painting them.
82
+
83
+ ## How it plugs in
84
+
85
+ The plugin is browser-only (`dsh.client.platform: web`) and uses published
86
+ surfaces only:
87
+
88
+ - `documentPreviews` (the document preview registry) lists the live renderer
89
+ implementations; the plugin registers one `sidebar.right.tab.document.action`
90
+ cell per text-bearing implementation id — paged-text bodies, and PDF's text
91
+ layer — and follows implementations added or removed later.
92
+ - The panel searches the preview body's rendered text and paints matches with
93
+ `CSS.highlights`, so it never mutates the React-rendered document.
94
+ - Copy goes through the `previewFind` locale namespace (English and Chinese;
95
+ other languages fall back through the shared locale chain).
96
+
97
+ ## Development
98
+
99
+ ```sh
100
+ pnpm run build # emit lib/index.js and lib/client.js
101
+ pnpm test # builds, then runs the unit and bundle tests
102
+ pnpm run typecheck
103
+ ```
104
+
105
+ `tests/bundle.spec.ts` loads the built `lib/client.js` through the same
106
+ `window.__ModuleLoader__` contract the web shell uses, with a stand-in module
107
+ table, and drives the rendered control. That is the check that catches a bundle
108
+ shape or module-request mistake before the plugin reaches a browser.
package/README.zh.md ADDED
@@ -0,0 +1,80 @@
1
+ # dsh-preview-find
2
+
3
+ DeepSeek Harness 的文件预览"查找"插件:在预览工具栏加一个搜索按钮,点开后像编辑器的查找小窗一样,在预览显示的文本里搜索、高亮全部命中、并逐个跳转。
4
+
5
+ ## 安装
6
+
7
+ 已发布到 npm,一条命令即可:
8
+
9
+ ```sh
10
+ dsh plugin --profile web add dsh-preview-find
11
+ ```
12
+
13
+ 这条命令把安装转发给该 profile 里的 pnpm,随后因为 `package.json` 声明了
14
+ `dsh.bundle.patch`,它会自动把这个包登记为该 profile 的一层 bundle——不需要手动改
15
+ `dsh.profile.bundles`。刷新页面后,凡是会渲染文本的预览都会出现搜索按钮;插件也会出现在
16
+ Plugins 页面,可以随时关掉。
17
+
18
+ ### 从源码安装
19
+
20
+ Harness 读取的浏览器半是构建产物 `lib/client.js`,所以先从源码构建:
21
+
22
+ ```sh
23
+ pnpm install
24
+ pnpm run build # lib/index.js(宿主半)+ lib/client.js(浏览器半)
25
+ dsh plugin --profile web add /absolute/path/to/dsh-preview-find
26
+ ```
27
+
28
+ 改完源码要重新 `pnpm run build`:浏览器产物按 revision 做不可变缓存,刷新页面就会拿到新的那份。
29
+ `npm publish` 通过 `prepack` 跑同一条构建,所以发布的 tarball 里一定带着 `lib/`。
30
+
31
+ ## 使用
32
+
33
+ 搜索按钮在预览顶部那行里,位于预览自己的控件与"重新读取"之间:
34
+
35
+ ```
36
+ 路径 … [解析类型] [换行] [搜索] [重新读取] [外部动作] [文档树]
37
+ ```
38
+
39
+ Markdown 预览没有"换行"控件,所以搜索按钮正好在"重新读取"左边;代码预览会多一个"换行"在它左边。
40
+
41
+ | 控件 | 行为 |
42
+ | --- | --- |
43
+ | 搜索按钮 | 打开/关闭小窗 |
44
+ | 输入框 | 边输入边搜(停 120 ms 后执行) |
45
+ | `Enter` / `Shift+Enter` | 下一个 / 上一个命中 |
46
+ | `Esc` | 关闭小窗 |
47
+ | `Aa` | 区分大小写 |
48
+ | `ab\|` | 只匹配完整单词(全字匹配) |
49
+ | `.*` | 把输入当正则表达式 |
50
+
51
+ 小窗显示命中位置与总数(`3/17`)、"无结果",或正则写错时的提示。全部命中一种底色,当前命中另一种底色,并自动滚动到可见处。
52
+
53
+ ## 搜索范围
54
+
55
+ 搜的是预览真正渲染出来的文本——Markdown、代码、纯文本。文本按版面切成"块",所以一个词可以跨过段落里的行内标记,但不会跨两段匹配。全字匹配把任何文字的字母、数字、下划线都算作词字符,所以 `搜索` 不会命中 `搜索引擎` 里的那一段,而段落自身的两端算作词边界。
56
+
57
+ - 分页加载的文件只搜已加载的部分;往下滚动时预览会继续读取更多页。
58
+ - 控件只在"预览会把文本铺进文档"的情况下出现:分页文本类(Markdown、代码、纯文本),以及 PDF
59
+ (它的预览保留了真正的文本层)。图片、Office、Excel、HTML 是画像素或在 frame 里渲染的,完全不给控件,
60
+ 打开它们什么都不会加载。
61
+ - 同一个文件改用纯文本方式打开(例如 SVG)时控件会回来,因为那种方式真的渲染了文本。
62
+ - 高亮依赖 CSS Custom Highlight API(Chromium 105+、Safari 17.2+、Firefox 140+)。老浏览器上小窗照常计数和跳转,只是不画高亮。
63
+
64
+ ## 接入方式
65
+
66
+ 插件只有浏览器半(`dsh.client.platform: web`),只使用对外发布的接口:
67
+
68
+ - 用 `documentPreviews`(文档预览注册表)列出当前所有渲染器实现,只挑"会把文本铺进文档"的那些(分页文本类 + PDF 的文本层),按实现 id 往 `sidebar.right.tab.document.action` 这个工具栏扩展位各注册一个控件,之后新增或移除的实现也会跟上。
69
+ - 小窗直接搜索预览正文渲染出的文本,用 `CSS.highlights` 画高亮,完全不去改 React 渲染出的 DOM。
70
+ - 文案走 `previewFind` 这个 locale 命名空间(英文 + 中文,其它语言走共享回退链)。
71
+
72
+ ## 开发
73
+
74
+ ```sh
75
+ pnpm run build # 产出 lib/index.js 与 lib/client.js
76
+ pnpm test # 先构建,再跑单元测试与打包产物测试
77
+ pnpm run typecheck
78
+ ```
79
+
80
+ `tests/bundle.spec.ts` 会按 web shell 的同一套 `window.__ModuleLoader__` 约定加载构建出来的 `lib/client.js`,配一张替身模块表,并真正渲染、点击控件。打包形状或模块请求写错,在进浏览器之前就会在这里报出来。
@@ -0,0 +1,9 @@
1
+ # dsh-preview-find bundle layer — applied when a profile lists this bundle.
2
+ #
3
+ # The entry loads the Host half (lib/index.js), which has no behavior of its
4
+ # own. Its browser half arrives over exports["./client"] because package.json
5
+ # declares dsh.client.platform: "web"; the web shell serves it from /plugins and
6
+ # activates it as the same Cordis plugin.
7
+ - insert:
8
+ - id: preview-find
9
+ name: dsh-preview-find
package/lib/client.js ADDED
@@ -0,0 +1,856 @@
1
+ window.__ModuleLoader__.load({ id: "dsh-preview-find", factory: (require) => {
2
+ var module = { exports: {} };
3
+ var exports = module.exports;
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
+ let react = require("react");
6
+ let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ // src/client/dom.ts
9
+ /**
10
+ * DOM lookups the find control needs to reach the preview it belongs to.
11
+ *
12
+ * The control renders in the preview's header, while the text it searches
13
+ * renders in that same preview's body, owned by another package. These are the
14
+ * body's published `data-*` hooks, read from the control's own element so a
15
+ * second preview pane can never search the first one's text.
16
+ */
17
+ /** Root of one document preview, carrying its state as an attribute. */
18
+ const PREVIEW_ROOT = "[data-textpreview-state]";
19
+ /** The preview's scrolling content region. */
20
+ const PREVIEW_BODY = "[data-textpreview-body]";
21
+ /**
22
+ * Find the preview body a header control belongs to.
23
+ * @param anchor - the control's own element.
24
+ * @returns the body element, or `null` before any preview renders.
25
+ */
26
+ function previewBodyOf(anchor) {
27
+ if (anchor === null) return null;
28
+ return anchor.closest(PREVIEW_ROOT)?.querySelector(PREVIEW_BODY) ?? null;
29
+ }
30
+ /**
31
+ * Find the element that actually scrolls a match into view: the nearest
32
+ * ancestor-or-self whose content overflows it.
33
+ * @param node - a match boundary or any node inside the preview.
34
+ * @returns the scrollport, or `null` when nothing scrolls.
35
+ */
36
+ function scrollportOf(node) {
37
+ let element = node instanceof HTMLElement ? node : node?.parentElement ?? null;
38
+ while (element !== null) {
39
+ if (element.scrollHeight > element.clientHeight + 1) return element;
40
+ element = element.parentElement;
41
+ }
42
+ return null;
43
+ }
44
+ /**
45
+ * Scroll a match into view unless it already sits comfortably inside its
46
+ * scrollport; a match is placed near the top third, as a find widget's target
47
+ * is.
48
+ * @param range - the match to reveal.
49
+ * @param fallback - scrollport to use when the match's ancestors do not scroll.
50
+ */
51
+ function revealRange(range, fallback) {
52
+ if (range === void 0) return;
53
+ const port = scrollportOf(range.startContainer) ?? fallback;
54
+ if (port === null) return;
55
+ const rect = range.getBoundingClientRect();
56
+ const box = port.getBoundingClientRect();
57
+ const margin = Math.min(48, box.height / 4);
58
+ if (rect.top >= box.top + margin && rect.bottom <= box.bottom - margin) return;
59
+ port.scrollTop += rect.top - box.top - margin;
60
+ }
61
+ // src/client/find.ts
62
+ /** Display values that keep an element inside its parent's block. */
63
+ const INLINE_DISPLAY = /* @__PURE__ */ new Set([
64
+ "inline",
65
+ "inline-block",
66
+ "inline-flex",
67
+ "inline-grid",
68
+ "inline-table",
69
+ "contents",
70
+ "ruby",
71
+ "ruby-base",
72
+ "ruby-text",
73
+ "ruby-base-container",
74
+ "ruby-text-container"
75
+ ]);
76
+ /** Elements whose text is markup support, not document content. */
77
+ const NON_CONTENT = /* @__PURE__ */ new Set([
78
+ "SCRIPT",
79
+ "STYLE",
80
+ "TEMPLATE",
81
+ "NOSCRIPT"
82
+ ]);
83
+ /** `NodeFilter.SHOW_TEXT` without relying on a document-scoped global. */
84
+ const SHOW_TEXT = 4;
85
+ /**
86
+ * Resolve the block an element's text belongs to.
87
+ * @param element - element holding a text node.
88
+ * @param root - element the search is confined to.
89
+ * @param cache - per-element answers for one collection pass.
90
+ * @returns the nearest block-level ancestor, or `root` at or above it.
91
+ */
92
+ function blockOf(element, root, cache) {
93
+ const cached = cache.get(element);
94
+ if (cached !== void 0) return cached;
95
+ const display = element.ownerDocument.defaultView?.getComputedStyle(element).display ?? "block";
96
+ const parent = element.parentElement;
97
+ const block = element !== root && parent !== null && INLINE_DISPLAY.has(display) ? blockOf(parent, root, cache) : element;
98
+ cache.set(element, block);
99
+ return block;
100
+ }
101
+ /**
102
+ * Collect the searchable blocks under a root, in document order.
103
+ * @param root - the preview body whose rendered text is searched.
104
+ * @returns one entry per run of consecutive text nodes inside one block.
105
+ */
106
+ function textBlocks(root) {
107
+ const walker = root.ownerDocument.createTreeWalker(root, SHOW_TEXT);
108
+ const cache = /* @__PURE__ */ new Map();
109
+ const blocks = [];
110
+ let block;
111
+ let text = "";
112
+ let runs = [];
113
+ const flush = () => {
114
+ if (text !== "") blocks.push({
115
+ text,
116
+ runs
117
+ });
118
+ text = "";
119
+ runs = [];
120
+ };
121
+ for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {
122
+ const parent = node.parentElement;
123
+ if (parent === null || NON_CONTENT.has(parent.tagName)) continue;
124
+ const owner = blockOf(parent, root, cache);
125
+ if (owner !== block) {
126
+ flush();
127
+ block = owner;
128
+ }
129
+ const value = node.data;
130
+ if (value === "") continue;
131
+ runs.push({
132
+ node,
133
+ start: text.length,
134
+ length: value.length
135
+ });
136
+ text += value;
137
+ }
138
+ flush();
139
+ return blocks;
140
+ }
141
+ /**
142
+ * Compile a query into a global pattern.
143
+ * @param query - the text or regular expression the reader typed.
144
+ * @param options - literal-versus-regex and case sensitivity.
145
+ * @returns the pattern, or `undefined` for an empty query.
146
+ * @throws {SyntaxError} when a regular-expression query does not compile.
147
+ */
148
+ function compilePattern(query, options) {
149
+ if (query === "") return void 0;
150
+ const source = options.regex ? query : query.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
151
+ return new RegExp(source, options.caseSensitive ? "g" : "gi");
152
+ }
153
+ /**
154
+ * Locate one character offset inside a block.
155
+ * @param block - the block holding the offset.
156
+ * @param offset - character offset from the block's first character.
157
+ * @returns the text node and the offset inside it, or `undefined` outside the block.
158
+ */
159
+ function locate(block, offset) {
160
+ for (const run of block.runs) if (offset >= run.start && offset < run.start + run.length) return {
161
+ node: run.node,
162
+ offset: offset - run.start
163
+ };
164
+ }
165
+ /**
166
+ * Build a document range for one match inside a block.
167
+ * @param block - the block holding the match.
168
+ * @param start - offset of the match's first character.
169
+ * @param end - offset just past the match's last character.
170
+ * @returns the range, or `undefined` when the match falls outside the block's text runs.
171
+ */
172
+ function rangeIn(block, start, end) {
173
+ const first = block.runs[0];
174
+ if (first === void 0 || end <= start) return void 0;
175
+ const from = locate(block, start);
176
+ const to = locate(block, end - 1);
177
+ if (from === void 0 || to === void 0) return void 0;
178
+ const range = first.node.ownerDocument.createRange();
179
+ range.setStart(from.node, from.offset);
180
+ range.setEnd(to.node, to.offset + 1);
181
+ return range;
182
+ }
183
+ /** A letter, a number, or an underscore, in any script. */
184
+ const WORD_CHARACTER = /[\p{L}\p{N}_]/u;
185
+ /**
186
+ * Whether one character continues a word.
187
+ * @param character - the character, or `undefined` past a block's edge.
188
+ * @returns true for a letter, number, or underscore; block edges are not words.
189
+ */
190
+ function isWordCharacter(character) {
191
+ return character !== void 0 && WORD_CHARACTER.test(character);
192
+ }
193
+ /**
194
+ * Whether a match stands on its own inside its block's text.
195
+ * @param text - the block's concatenated text.
196
+ * @param start - offset of the match's first character.
197
+ * @param end - offset just past the match's last character.
198
+ * @returns true when neither neighbor continues a word.
199
+ */
200
+ function isWholeWord(text, start, end) {
201
+ return !isWordCharacter(text[start - 1]) && !isWordCharacter(text[end]);
202
+ }
203
+ /**
204
+ * Collect every match of one pattern, in document order.
205
+ * @param blocks - blocks from {@link textBlocks}.
206
+ * @param pattern - compiled query; its own `g` flag is optional.
207
+ * @param scope - how many matches to collect, and whether they must be whole words.
208
+ * @returns the matches, capped at the scope's limit.
209
+ */
210
+ function findRanges(blocks, pattern, scope) {
211
+ const { limit, wholeWord } = scope;
212
+ const ranges = [];
213
+ const flags = pattern.flags.includes("g") ? pattern.flags : `${pattern.flags}g`;
214
+ for (const block of blocks) {
215
+ if (ranges.length >= limit) break;
216
+ const patternPerBlock = new RegExp(pattern.source, flags);
217
+ for (let match = patternPerBlock.exec(block.text); match !== null; match = patternPerBlock.exec(block.text)) {
218
+ if (match[0] === "") {
219
+ patternPerBlock.lastIndex += 1;
220
+ continue;
221
+ }
222
+ const end = match.index + match[0].length;
223
+ if (wholeWord && !isWholeWord(block.text, match.index, end)) continue;
224
+ const range = rangeIn(block, match.index, end);
225
+ if (range !== void 0) ranges.push(range);
226
+ if (ranges.length >= limit) break;
227
+ }
228
+ }
229
+ return ranges;
230
+ }
231
+ // src/client/highlight.ts
232
+ /**
233
+ * Painting matched ranges with the browser's Custom Highlight API.
234
+ *
235
+ * Highlights are registered in the document-wide registry and styled by
236
+ * `::highlight()` rules, so the control highlights text without touching the
237
+ * React-rendered DOM. A page has one registry, so the last control to paint
238
+ * owns both names — a second preview pane opening its own find panel takes
239
+ * them over, and the earlier pane's cleanup leaves them alone.
240
+ */
241
+ /** Registry name covering every match. */
242
+ const ALL = "preview-find";
243
+ /** Registry name covering the active match. */
244
+ const ACTIVE = "preview-find-current";
245
+ /** @returns the document's highlight registry, or `undefined` where the API is unsupported. */
246
+ function registry() {
247
+ return globalThis.CSS?.highlights;
248
+ }
249
+ /** @returns the `Highlight` constructor, or `undefined` where the API is unsupported. */
250
+ function constructor() {
251
+ return globalThis.Highlight;
252
+ }
253
+ /** Which control instance currently owns the registry names. */
254
+ let owner;
255
+ /**
256
+ * Claim the registry names for one control instance.
257
+ * @returns the claim token {@link clearMatches} needs.
258
+ */
259
+ function claimMatches() {
260
+ const token = Symbol("preview-find");
261
+ owner = token;
262
+ return token;
263
+ }
264
+ /**
265
+ * Paint every match, with the active one in its own color.
266
+ * @param token - the caller's claim from {@link claimMatches}.
267
+ * @param ranges - matches in document order.
268
+ * @param active - index of the match to emphasize; out of range paints all matches only.
269
+ */
270
+ function paintMatches(token, ranges, active) {
271
+ const highlights = registry();
272
+ const Highlight = constructor();
273
+ if (highlights === void 0 || Highlight === void 0) return;
274
+ owner = token;
275
+ highlights.set(ALL, new Highlight(...ranges));
276
+ const current = ranges[active];
277
+ if (current === void 0) {
278
+ highlights.delete(ACTIVE);
279
+ return;
280
+ }
281
+ highlights.set(ACTIVE, new Highlight(current));
282
+ }
283
+ /**
284
+ * Remove both registrations, unless another control has taken them over.
285
+ * @param token - the caller's claim from {@link claimMatches}.
286
+ */
287
+ function clearMatches(token) {
288
+ if (owner !== token) return;
289
+ owner = void 0;
290
+ const highlights = registry();
291
+ if (highlights === void 0) return;
292
+ highlights.delete(ALL);
293
+ highlights.delete(ACTIVE);
294
+ }
295
+ // src/client/locales.ts
296
+ /**
297
+ * Copy for the find control and its panel.
298
+ *
299
+ * The locale service requires both baseline dictionaries (`zh` and `en`) for a
300
+ * namespace; other languages fall back through the shared lookup chain.
301
+ */
302
+ /** This plugin's locale namespace. */
303
+ const NS = "previewFind";
304
+ /** English copy, the key source for {@link PreviewFindKey}. */
305
+ const en = {
306
+ "find.open": "Find in file",
307
+ "find.placeholder": "Find",
308
+ "find.matchCase": "Match case",
309
+ "find.wholeWord": "Match whole word",
310
+ "find.regex": "Use regular expression",
311
+ "find.previous": "Previous match",
312
+ "find.next": "Next match",
313
+ "find.close": "Close find",
314
+ "find.noResults": "No results",
315
+ "find.invalidRegex": "Invalid pattern"
316
+ };
317
+ /** Chinese copy. */
318
+ const zh = {
319
+ "find.open": "在文件中查找",
320
+ "find.placeholder": "查找",
321
+ "find.matchCase": "区分大小写",
322
+ "find.wholeWord": "全字匹配",
323
+ "find.regex": "使用正则表达式",
324
+ "find.previous": "上一个匹配项",
325
+ "find.next": "下一个匹配项",
326
+ "find.close": "关闭查找",
327
+ "find.noResults": "无结果",
328
+ "find.invalidRegex": "正则表达式无效"
329
+ };
330
+ // src/client/PreviewFind.tsx
331
+ /**
332
+ * The find control: a toolbar button that opens a small panel under itself.
333
+ *
334
+ * The button joins the preview's own toolbar through the document preview's
335
+ * `sidebar.right.tab.document.action` seat, so it sits between the preview's
336
+ * controls and the file handoff. The panel floats over the document instead of
337
+ * taking a row, and the matches are found in the preview body's rendered text
338
+ * — what the reader sees, in every renderer that draws text.
339
+ */
340
+ /** Most matches one search reports; a wider document keeps the first ones. */
341
+ const MATCH_LIMIT = 2e3;
342
+ /** How long the content and query settle before a search runs. */
343
+ const SETTLE_MS = 120;
344
+ /** No matches, no query. */
345
+ const EMPTY = {
346
+ ranges: [],
347
+ active: 0,
348
+ invalid: false,
349
+ signature: ""
350
+ };
351
+ /**
352
+ * Search the preview's rendered text and move between matches.
353
+ * @param props - document content and localized copy.
354
+ * @returns the toolbar button, and the panel while it is open.
355
+ */
356
+ function PreviewFind({ content, t }) {
357
+ const [open, setOpen] = (0, react.useState)(false);
358
+ const [query, setQuery] = (0, react.useState)("");
359
+ const [matchCase, setMatchCase] = (0, react.useState)(false);
360
+ const [wholeWord, setWholeWord] = (0, react.useState)(false);
361
+ const [regex, setRegex] = (0, react.useState)(false);
362
+ const [results, setResults] = (0, react.useState)(EMPTY);
363
+ const anchorRef = (0, react.useRef)(null);
364
+ const inputRef = (0, react.useRef)(null);
365
+ const tokenRef = (0, react.useRef)(null);
366
+ const signature = `${regex ? "r" : "l"}${matchCase ? "c" : "i"}${wholeWord ? "w" : "-"}\u0000${query}`;
367
+ (0, react.useEffect)(() => {
368
+ if (!open) return void 0;
369
+ let cancelled = false;
370
+ const timer = setTimeout(() => {
371
+ const body = previewBodyOf(anchorRef.current);
372
+ let ranges = [];
373
+ let invalid = false;
374
+ if (body !== null) try {
375
+ const pattern = compilePattern(query, {
376
+ regex,
377
+ caseSensitive: matchCase
378
+ });
379
+ if (pattern !== void 0) ranges = findRanges(textBlocks(body), pattern, {
380
+ limit: MATCH_LIMIT,
381
+ wholeWord
382
+ });
383
+ } catch (error) {
384
+ if (!(error instanceof SyntaxError)) throw error;
385
+ invalid = true;
386
+ }
387
+ if (cancelled) return;
388
+ setResults((previous) => ({
389
+ ranges,
390
+ invalid,
391
+ signature,
392
+ active: previous.signature === signature ? Math.min(previous.active, Math.max(ranges.length - 1, 0)) : 0
393
+ }));
394
+ }, SETTLE_MS);
395
+ return () => {
396
+ cancelled = true;
397
+ clearTimeout(timer);
398
+ };
399
+ }, [
400
+ open,
401
+ query,
402
+ regex,
403
+ matchCase,
404
+ wholeWord,
405
+ signature,
406
+ content
407
+ ]);
408
+ (0, react.useEffect)(() => {
409
+ if (!open) {
410
+ if (tokenRef.current !== null) clearMatches(tokenRef.current);
411
+ return;
412
+ }
413
+ paintMatches(tokenRef.current ?? (tokenRef.current = claimMatches()), results.ranges, results.active);
414
+ revealRange(results.ranges[results.active], previewBodyOf(anchorRef.current));
415
+ }, [open, results]);
416
+ (0, react.useEffect)(() => () => {
417
+ if (tokenRef.current !== null) clearMatches(tokenRef.current);
418
+ }, []);
419
+ (0, react.useEffect)(() => {
420
+ if (!open) return;
421
+ inputRef.current?.focus();
422
+ inputRef.current?.select();
423
+ }, [open]);
424
+ const step = (0, react.useCallback)((delta) => {
425
+ setResults((previous) => {
426
+ const count = previous.ranges.length;
427
+ if (count === 0) return previous;
428
+ return {
429
+ ...previous,
430
+ active: (previous.active + delta + count) % count
431
+ };
432
+ });
433
+ }, []);
434
+ const count = results.ranges.length;
435
+ const countLabel = results.invalid || query === "" ? "" : count === 0 ? t("find.noResults") : `${results.active + 1}/${count}`;
436
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
437
+ ref: anchorRef,
438
+ "data-preview-find": true,
439
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
440
+ label: t("find.open"),
441
+ side: "bottom",
442
+ delayMs: 500,
443
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
444
+ type: "button",
445
+ "data-preview-find-toggle": true,
446
+ "aria-label": t("find.open"),
447
+ "aria-expanded": open,
448
+ onClick: () => {
449
+ setOpen((value) => !value);
450
+ },
451
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSearchOutlineRegular, {})
452
+ })
453
+ }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
454
+ "data-preview-find-panel": true,
455
+ role: "search",
456
+ onKeyDown: (event) => {
457
+ if (event.key === "Escape") {
458
+ event.preventDefault();
459
+ setOpen(false);
460
+ return;
461
+ }
462
+ if (event.key === "Enter") {
463
+ event.preventDefault();
464
+ step(event.shiftKey ? -1 : 1);
465
+ }
466
+ },
467
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
468
+ "data-preview-find-row": true,
469
+ children: [
470
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
471
+ ref: inputRef,
472
+ "data-preview-find-input": true,
473
+ value: query,
474
+ placeholder: t("find.placeholder"),
475
+ "aria-label": t("find.placeholder"),
476
+ spellCheck: false,
477
+ autoCapitalize: "off",
478
+ autoComplete: "off",
479
+ ...results.invalid ? { "data-invalid": "" } : {},
480
+ onChange: (event) => {
481
+ setQuery(event.target.value);
482
+ }
483
+ }),
484
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
485
+ "data-preview-find-count": true,
486
+ "aria-live": "polite",
487
+ children: countLabel
488
+ }),
489
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
490
+ label: t("find.previous"),
491
+ side: "bottom",
492
+ delayMs: 500,
493
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
494
+ type: "button",
495
+ "data-preview-find-step": "previous",
496
+ "aria-label": t("find.previous"),
497
+ disabled: count === 0,
498
+ onClick: () => {
499
+ step(-1);
500
+ },
501
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutlineRegular, {})
502
+ })
503
+ }),
504
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
505
+ label: t("find.next"),
506
+ side: "bottom",
507
+ delayMs: 500,
508
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
509
+ type: "button",
510
+ "data-preview-find-step": "next",
511
+ "aria-label": t("find.next"),
512
+ disabled: count === 0,
513
+ onClick: () => {
514
+ step(1);
515
+ },
516
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {})
517
+ })
518
+ }),
519
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
520
+ label: t("find.close"),
521
+ side: "bottom",
522
+ delayMs: 500,
523
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
524
+ type: "button",
525
+ "data-preview-find-close": true,
526
+ "aria-label": t("find.close"),
527
+ onClick: () => {
528
+ setOpen(false);
529
+ },
530
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, {})
531
+ })
532
+ })
533
+ ]
534
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
535
+ "data-preview-find-opts": true,
536
+ children: [
537
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
538
+ label: t("find.matchCase"),
539
+ side: "bottom",
540
+ delayMs: 500,
541
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
542
+ type: "button",
543
+ "data-preview-find-option": "case",
544
+ "aria-pressed": matchCase,
545
+ "aria-label": t("find.matchCase"),
546
+ onClick: () => {
547
+ setMatchCase((value) => !value);
548
+ },
549
+ children: "Aa"
550
+ })
551
+ }),
552
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
553
+ label: t("find.wholeWord"),
554
+ side: "bottom",
555
+ delayMs: 500,
556
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
557
+ type: "button",
558
+ "data-preview-find-option": "word",
559
+ "aria-pressed": wholeWord,
560
+ "aria-label": t("find.wholeWord"),
561
+ onClick: () => {
562
+ setWholeWord((value) => !value);
563
+ },
564
+ children: "ab|"
565
+ })
566
+ }),
567
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
568
+ label: t("find.regex"),
569
+ side: "bottom",
570
+ delayMs: 500,
571
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
572
+ type: "button",
573
+ "data-preview-find-option": "regex",
574
+ "aria-pressed": regex,
575
+ "aria-label": t("find.regex"),
576
+ onClick: () => {
577
+ setRegex((value) => !value);
578
+ },
579
+ children: ".*"
580
+ })
581
+ }),
582
+ results.invalid && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
583
+ "data-preview-find-hint": true,
584
+ "data-invalid": true,
585
+ children: t("find.invalidRegex")
586
+ })
587
+ ]
588
+ })]
589
+ })]
590
+ });
591
+ }
592
+ // src/client/styles.ts
593
+ /**
594
+ * The stylesheet the plugin injects once per page.
595
+ *
596
+ * Styles travel as text instead of a CSS module because this package is built
597
+ * outside the Harness build preset, which is what compiles `.module.css`
598
+ * files into the loader's deferred metadata. Every color and radius comes
599
+ * from a `--dsw-*` theme token, so the panel follows the active theme.
600
+ */
601
+ /** The injected `<style>` element's id, shared across plugin instances. */
602
+ const STYLE_ID = "dsh-preview-find-styles";
603
+ /** Highlight names must match {@link ./highlight.ts}. */
604
+ const FIND_STYLES = `
605
+ [data-preview-find] {
606
+ position: relative;
607
+ display: inline-flex;
608
+ flex: none;
609
+ }
610
+
611
+ [data-preview-find-toggle] {
612
+ display: inline-flex;
613
+ flex: none;
614
+ align-items: center;
615
+ justify-content: center;
616
+ width: 28px;
617
+ height: 28px;
618
+ padding: 6px;
619
+ color: var(--dsw-alias-label-secondary);
620
+ line-height: 1;
621
+ background: transparent;
622
+ border: none;
623
+ border-radius: var(--dsw-radius-sm);
624
+ cursor: pointer;
625
+ }
626
+
627
+ [data-preview-find-toggle] svg {
628
+ width: 15px;
629
+ height: 15px;
630
+ }
631
+
632
+ [data-preview-find-toggle]:hover,
633
+ [data-preview-find-toggle][aria-expanded='true'] {
634
+ color: var(--dsw-alias-label-primary);
635
+ background: var(--dsw-alias-interactive-bg-hover);
636
+ }
637
+
638
+ [data-preview-find-panel] {
639
+ position: absolute;
640
+ top: calc(100% + 8px);
641
+ right: 0;
642
+ z-index: 60;
643
+ display: flex;
644
+ flex-direction: column;
645
+ gap: 6px;
646
+ box-sizing: border-box;
647
+ width: min(300px, calc(100vw - 32px));
648
+ padding: 6px;
649
+ color: var(--dsw-alias-label-primary);
650
+ font-size: 12px;
651
+ font-family: var(--dsw-font-family);
652
+ background: var(--dsw-alias-bg-overlay);
653
+ border: 0.5px solid var(--dsw-alias-border-l2);
654
+ border-radius: var(--dsw-radius-md);
655
+ box-shadow: var(--dsw-shadow-lv3);
656
+ }
657
+
658
+ [data-preview-find-row],
659
+ [data-preview-find-opts] {
660
+ display: flex;
661
+ gap: 4px;
662
+ align-items: center;
663
+ }
664
+
665
+ [data-preview-find-input] {
666
+ flex: 1 1 auto;
667
+ min-width: 0;
668
+ height: 26px;
669
+ padding: 0 8px;
670
+ color: var(--dsw-alias-label-primary);
671
+ font: inherit;
672
+ background: var(--dsw-alias-bg-layer-1);
673
+ border: 0.5px solid var(--dsw-alias-border-l2);
674
+ border-radius: var(--dsw-radius-sm);
675
+ outline: none;
676
+ }
677
+
678
+ [data-preview-find-input]:focus {
679
+ border-color: var(--dsw-alias-border-selected);
680
+ }
681
+
682
+ [data-preview-find-input][data-invalid] {
683
+ border-color: var(--dsw-alias-interactive-bg-hover-danger);
684
+ }
685
+
686
+ [data-preview-find-count] {
687
+ flex: none;
688
+ min-width: 40px;
689
+ color: var(--dsw-alias-label-secondary);
690
+ font-variant-numeric: tabular-nums;
691
+ text-align: end;
692
+ white-space: nowrap;
693
+ }
694
+
695
+ [data-preview-find-step],
696
+ [data-preview-find-close] {
697
+ display: inline-flex;
698
+ flex: none;
699
+ align-items: center;
700
+ justify-content: center;
701
+ width: 24px;
702
+ height: 24px;
703
+ padding: 4px;
704
+ color: var(--dsw-alias-label-secondary);
705
+ background: transparent;
706
+ border: none;
707
+ border-radius: var(--dsw-radius-sm);
708
+ cursor: pointer;
709
+ }
710
+
711
+ [data-preview-find-step] svg,
712
+ [data-preview-find-close] svg {
713
+ width: 14px;
714
+ height: 14px;
715
+ }
716
+
717
+ [data-preview-find-step]:hover,
718
+ [data-preview-find-close]:hover {
719
+ color: var(--dsw-alias-label-primary);
720
+ background: var(--dsw-alias-interactive-bg-hover);
721
+ }
722
+
723
+ [data-preview-find-step]:disabled {
724
+ opacity: 0.4;
725
+ cursor: default;
726
+ background: transparent;
727
+ }
728
+
729
+ [data-preview-find-option] {
730
+ flex: none;
731
+ height: 20px;
732
+ padding: 0 6px;
733
+ color: var(--dsw-alias-label-secondary);
734
+ font-size: 11px;
735
+ font-family: var(--dsw-font-family);
736
+ background: transparent;
737
+ border: 0.5px solid var(--dsw-alias-border-l2);
738
+ border-radius: var(--dsw-radius-sm);
739
+ cursor: pointer;
740
+ }
741
+
742
+ [data-preview-find-option][aria-pressed='true'] {
743
+ color: var(--dsw-alias-label-primary);
744
+ background: var(--dsw-alias-interactive-bg-hover);
745
+ border-color: var(--dsw-alias-border-selected);
746
+ }
747
+
748
+ [data-preview-find-hint] {
749
+ margin-inline-start: auto;
750
+ color: var(--dsw-alias-label-secondary);
751
+ }
752
+
753
+ [data-preview-find-hint][data-invalid] {
754
+ color: var(--dsw-alias-interactive-bg-hover-danger);
755
+ }
756
+
757
+ ::highlight(preview-find) {
758
+ color: inherit;
759
+ background-color: var(--dsw-alias-interactive-bg-hover-accent);
760
+ }
761
+
762
+ ::highlight(preview-find-current) {
763
+ color: inherit;
764
+ background-color: var(--dsw-alias-bg-document-selection);
765
+ }
766
+ `;
767
+ /**
768
+ * Install the plugin's stylesheet in one document.
769
+ * @param doc - the page's document.
770
+ * @returns the disposer removing the element this call added.
771
+ */
772
+ function installStyles(doc) {
773
+ if (doc.getElementById(STYLE_ID) !== null) return () => {};
774
+ const style = doc.createElement("style");
775
+ style.id = STYLE_ID;
776
+ style.textContent = FIND_STYLES;
777
+ doc.head.append(style);
778
+ return () => {
779
+ style.remove();
780
+ };
781
+ }
782
+ // src/client/index.ts
783
+ /**
784
+ * Toolbar-cell priority: the preview's own renderer-specific controls render
785
+ * first, and this control renders where no renderer owns the cell.
786
+ */
787
+ const CELL_PRIORITY = 100;
788
+ /**
789
+ * Suffixes whose preview reads bytes yet still lays text into the document:
790
+ * the PDF body renders pdf.js's text layer, so its words are searchable.
791
+ * Every other byte or renderer-owned body draws to a canvas or a frame.
792
+ */
793
+ const TEXT_LAYER_SUFFIXES = /* @__PURE__ */ new Set(["pdf"]);
794
+ /**
795
+ * Whether an implementation's preview puts searchable text in the document.
796
+ *
797
+ * Only such an implementation registers a control; the rest get none at all,
798
+ * rather than a button that always reports no results. Paged-text bodies
799
+ * (Markdown, code, plain text) qualify by their loader mode; PDF qualifies by
800
+ * keeping a text layer; images, Office, Excel, and HTML do not.
801
+ * @param definition - one registered implementation.
802
+ * @returns true when the preview's text is in the document this control reads.
803
+ */
804
+ function rendersText(definition) {
805
+ return definition.loading === "text-pages" || definition.extensions.some((extension) => TEXT_LAYER_SUFFIXES.has(extension.toLowerCase()));
806
+ }
807
+ /** Services this plugin reads before it can register anything. */
808
+ const inject = [
809
+ "slots",
810
+ "locale",
811
+ "documentPreviews"
812
+ ];
813
+ /**
814
+ * Client plugin body: register copy and styles, then one toolbar control per
815
+ * document renderer implementation.
816
+ * @param ctx - client context carrying the slot, locale, and document preview registries.
817
+ */
818
+ function apply(ctx) {
819
+ ctx.effect(() => ctx.locale.register(NS, {
820
+ en,
821
+ zh
822
+ }), "preview-find: dictionaries");
823
+ ctx.effect(() => installStyles(document), "preview-find: styles");
824
+ const registered = /* @__PURE__ */ new Map();
825
+ const sync = () => {
826
+ const ids = ctx.documentPreviews.getSnapshot().filter((definition) => rendersText(definition)).map((definition) => definition.id);
827
+ for (const [id, dispose] of [...registered]) {
828
+ if (ids.includes(id)) continue;
829
+ dispose();
830
+ registered.delete(id);
831
+ }
832
+ for (const id of ids) {
833
+ if (registered.has(id)) continue;
834
+ registered.set(id, ctx.slots.inject("sidebar.right.tab.document.action", () => ctx.slots.register({
835
+ name: "sidebar.right.tab.document.action",
836
+ key: id,
837
+ locale: NS,
838
+ priority: CELL_PRIORITY
839
+ }, PreviewFind)));
840
+ }
841
+ };
842
+ ctx.effect(() => {
843
+ const disposer = ctx.documentPreviews.subscribe(sync);
844
+ sync();
845
+ return () => {
846
+ disposer();
847
+ for (const dispose of registered.values()) dispose();
848
+ registered.clear();
849
+ };
850
+ }, "preview-find: toolbar controls");
851
+ }
852
+ exports.apply = apply;
853
+ exports.inject = inject;
854
+
855
+ return module.exports;
856
+ } });
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // src/index.ts
2
+ /**
3
+ * Host half. The plugin is browser-only: its behavior arrives over
4
+ * `exports["./client"]` because `package.json` declares `dsh.client.platform:
5
+ * "web"`. This empty apply exists so the bundle entry the loader patch inserts
6
+ * activates cleanly.
7
+ */
8
+ /** Host plugin body — no host-side behavior for this surface plugin. */
9
+ function apply() {}
10
+ export { apply };
package/package.json CHANGED
@@ -1,6 +1,85 @@
1
1
  {
2
2
  "name": "dsh-preview-find",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "DeepSeek Harness plugin: find-in-preview for the file preview, with a toolbar search button, a VS Code-style panel, regular expressions, match highlighting, and previous/next navigation.",
5
+ "keywords": [
6
+ "deepseek-harness",
7
+ "deepseek-harness-plugin",
8
+ "dsh-plugin",
9
+ "find",
10
+ "search"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/driekey/dsh-preview-find.git"
16
+ },
17
+ "homepage": "https://github.com/driekey/dsh-preview-find#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/driekey/dsh-preview-find/issues"
20
+ },
21
+ "type": "module",
22
+ "engines": {
23
+ "dsh": ">=0.2.2-rc.5 <0.3.0-0"
24
+ },
25
+ "main": "./lib/index.js",
26
+ "exports": {
27
+ ".": {
28
+ "default": "./lib/index.js"
29
+ },
30
+ "./client": {
31
+ "default": "./lib/client.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "lib",
37
+ "cordis.patch.yml",
38
+ "README.md",
39
+ "README.zh.md"
40
+ ],
41
+ "dsh": {
42
+ "bundle": {
43
+ "patch": "./cordis.patch.yml"
44
+ },
45
+ "client": {
46
+ "platform": "web",
47
+ "inject": [
48
+ "@deepseek-ai/dsh-client-locale",
49
+ "@deepseek-ai/dsh-client-ui-sidebar-right",
50
+ "@deepseek-ai/dsh-client-ui-sidebar-documentpreview"
51
+ ]
52
+ }
53
+ },
54
+ "scripts": {
55
+ "build": "tsdown",
56
+ "pretest": "tsdown",
57
+ "typecheck": "tsc -p tsconfig.json --noEmit",
58
+ "test": "vitest run",
59
+ "prepack": "pnpm run build"
60
+ },
61
+ "peerDependencies": {
62
+ "@deepseek-ai/cordis": ">=4.0.0"
63
+ },
64
+ "devDependencies": {
65
+ "@deepseek-ai/cordis": "^4.0.1",
66
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
67
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.5",
68
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
69
+ "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "0.2.2-rc.5",
70
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.5",
71
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
72
+ "@types/node": "^22.15.21",
73
+ "@types/react": "^18.3.3",
74
+ "@types/react-dom": "18.3.7",
75
+ "jsdom": "^29.1.1",
76
+ "react": "^18.3.1",
77
+ "react-dom": "18.3.1",
78
+ "tsdown": "^0.22.14",
79
+ "typescript": "^5.9.3",
80
+ "vitest": "^4.1.12"
81
+ },
82
+ "publishConfig": {
83
+ "access": "public"
84
+ }
85
+ }