dsh-multipane 1.1.9 → 1.1.10
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/LICENSE +0 -0
- package/README.en.md +7 -1
- package/README.md +7 -1
- package/cordis.patch.yml +0 -0
- package/lib/client.js +103 -1
- package/lib/index.js +0 -0
- package/locale/en.json +0 -0
- package/locale/zh.json +0 -0
- package/package.json +4 -4
package/LICENSE
CHANGED
|
File without changes
|
package/README.en.md
CHANGED
|
@@ -116,7 +116,7 @@ The settings page shows the current version and offers a "Check for updates" act
|
|
|
116
116
|
|
|
117
117
|
## Compatibility
|
|
118
118
|
|
|
119
|
-
- DSH `>= 0.2.
|
|
119
|
+
- DSH `>= 0.2.3-alpha.2` (desktop and web profiles)
|
|
120
120
|
- Client platform: `web` (the Chromium runtime inside DSH desktop)
|
|
121
121
|
- Four panes maximum; pane widths are stored as ratios so resizing the window does not break the layout
|
|
122
122
|
|
|
@@ -163,6 +163,12 @@ node scripts/check-names.cjs # package name / version / release-age allowanc
|
|
|
163
163
|
|
|
164
164
|
> 1.0.57–1.1.8 were internal iterations and were not published to npm; 1.1.9 is the first public release after 1.0.56.
|
|
165
165
|
|
|
166
|
+
### 1.1.10 (2026-11-27)
|
|
167
|
+
|
|
168
|
+
- **Fix: a pasted screenshot landed in another pane, or nowhere at all.** By replacing the Host `main` slot with its own workspace, the plugin leaves no composer rendered with `occurrence === "main"`. The Host's document-level paste router only addresses two candidates — the composer that most recently held focus, or the `main` one. So a screenshot pasted while the caret sits outside the editor went to **the pane whose composer was focused last**, or was dropped without any message. (A paste with the caret inside the editor goes through the editor's own paste command, which is why the bug looked intermittent and vanished when the plugin was off.)
|
|
169
|
+
The plugin now installs a capture-phase `paste` listener on `window`, running before the Host's bubble listener on `document`, and does exactly one thing: it focuses the composer of the current pane's active tab. That `focus()` fires `focusin` synchronously, so the Host router's "last focused" candidate is updated before its own listener runs, and the paste is delivered to the right pane. No `preventDefault`, no `stopPropagation`, the clipboard is never read. It steps aside entirely when the paste carries no file, when the origin is an editable, when focus is already in an editable, when a modal is in the foreground, or when no pane or editor can be found. Installed and removed with the master switch, so a disabled plugin leaves no listener behind.
|
|
170
|
+
- **Host requirement raised to `>=0.2.3-alpha.2`**: `engines.dsh` and `peerDependencies` now name the oldest Host this release was verified against, so 0.2.2 and earlier are refused in the plugin manager instead of installing half-working. Old Hosts are no longer compatibility-tested; the fix itself uses only capture-phase listening, `focus()` and the plugin's own "current pane" resolution, so it adds no new Host API dependency.
|
|
171
|
+
|
|
166
172
|
### 1.1.9 (2026-11-23)
|
|
167
173
|
|
|
168
174
|
- **Fix: after disabling and re-enabling in the plugin manager, the panes did not return and the colors turned gray.** On 0.2.3 a disable stops only the Host entry; the client code is never unloaded. The Host `/dsh-multipane/status` now reads the profile `package.json` `bundles` directly (the manager removes the plugin there), and the client watches it through a `globalThis` watchdog that survives a ctx disposal. A disable clears the styles, row marks, `data-dsv-*` and `--dsv-*`; a re-enable revives in place: restores `prefs.enabled`, reinstalls the stylesheet, rewrites the color variables, and removes the stale inline `display:none` on `.dsv-root`.
|
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ npx @deepseek-ai/dsh plugin --profile desktop remove dsh-multipane
|
|
|
115
115
|
|
|
116
116
|
## 兼容性
|
|
117
117
|
|
|
118
|
-
- DSH `>= 0.2.
|
|
118
|
+
- DSH `>= 0.2.3-alpha.2`(desktop / web profile 均可)
|
|
119
119
|
- 客户端平台:`web`(DSH 桌面端内嵌 Chromium)
|
|
120
120
|
- 最多四栏;栏宽按容器宽度归一化保存,换窗口尺寸不会错位
|
|
121
121
|
|
|
@@ -162,6 +162,12 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
|
|
|
162
162
|
|
|
163
163
|
> 1.0.57–1.1.8 是内部迭代版本,未发布到 npm;1.1.9 是 1.0.56 之后的首个公开发布。
|
|
164
164
|
|
|
165
|
+
### 1.1.10(2026-11-27)
|
|
166
|
+
|
|
167
|
+
- **修「截图 Ctrl+V 粘不进当前栏,或者粘到别的栏」**:多栏把宿主的 `main` 槽整条换成自己的面板后,全页没有按 `occurrence === "main"` 渲染的 composer;宿主的 document 层粘贴路由只认两种人——「最近持有过焦点的 composer」或「`main` 那一个」。于是光标不在输入框里时,截图会落进**上一次点过的那个栏**,或者谁都不认、直接丢弃(光标在输入框里时走编辑器自己的粘贴命令,一切正常,所以这个毛病看起来时好时坏,关掉插件就消失)。
|
|
168
|
+
现在插件在 `window` 捕获阶段抢在宿主(document 冒泡)之前,把**当前栏激活标签的输入框** `focus()` 一下:focus 同步触发 `focusin`,宿主路由的「最后焦点」当场更新,这次粘贴就投给了正确的栏。不 `preventDefault`、不 `stopPropagation`、不读文件内容;无文件 / 落点在输入框里 / 焦点已在某个输入框 / 前台有模态框 / 找不到栏或编辑器 —— 任一命中即整体让路。随总开关装/卸,关掉插件不留任何监听。
|
|
169
|
+
- **宿主版本要求收紧到 `>=0.2.3-alpha.2`**:`engines.dsh` 与 `peerDependencies` 同步改成「实测通过的最低版本」,0.2.2 及更早的宿主会在插件管理器里被直接拦下,不再出现「装上了但半坏」。代价是不再对旧宿主做兼容验证;本次修复本身只用 `window` 捕获、`focus()` 与插件原有的「当前栏」判定,没有引入新的宿主接口。
|
|
170
|
+
|
|
165
171
|
### 1.1.9(2026-11-23)
|
|
166
172
|
|
|
167
173
|
- **修「插件管理里禁用后再启用,分栏不回来 / 颜色变灰」**:0.2.3 禁用时只停宿主入口,不卸载客户端。现在宿主 `/dsh-multipane/status` 直接读 profile `package.json` 的 `bundles`(管理器禁用就是从这里删),客户端用挂在 `globalThis` 上的看门狗(不随 ctx 销毁)判断;禁用后清样式、行标记、`data-dsv-*` 与 `--dsv-*`,重新启用时原地复活:恢复 `prefs.enabled`、重装样式、重写颜色变量、摘掉 `.dsv-root` 上残留的内联 `display:none`。
|
package/cordis.patch.yml
CHANGED
|
File without changes
|
package/lib/client.js
CHANGED
|
@@ -19,7 +19,7 @@ window.__ModuleLoader__.load({
|
|
|
19
19
|
*/
|
|
20
20
|
const PLUGIN_LABEL = "多栏视图";
|
|
21
21
|
/* 与 package.json 的 version 必须一致(发版时两处同改;check-names.cjs 会校验)。 */
|
|
22
|
-
const PLUGIN_VERSION = "1.1.
|
|
22
|
+
const PLUGIN_VERSION = "1.1.10";
|
|
23
23
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
24
24
|
|
|
25
25
|
|
|
@@ -4644,6 +4644,61 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
4644
4644
|
};
|
|
4645
4645
|
}
|
|
4646
4646
|
|
|
4647
|
+
/* ===== 粘贴定向:落在输入框之外的截图粘贴,交给**当前栏** =====
|
|
4648
|
+
*
|
|
4649
|
+
* 宿主的 document 层粘贴路由(`createComposerFileIntake`,0.2.2-rc.5 与
|
|
4650
|
+
* 0.2.3-alpha.2 是同一份实现)只认两种人:① 最近持有过焦点的那个 composer;
|
|
4651
|
+
* ② `occurrence === 'main'` 的那一个。多栏把宿主的 `main` 槽整条换成自己的面板,
|
|
4652
|
+
* 每栏的输入框都是按 `variant: "embedded"` 渲染的 → 全页没有 `main`。于是:
|
|
4653
|
+
* · 光标不在输入框里、但别的栏点过输入框 → 图跑进**那个栏**(错栏,实测复现);
|
|
4654
|
+
* · 从没点过输入框 → 谁都不认,路由直接放弃,连提示都没有。
|
|
4655
|
+
* 而光标落在输入框里时走的是编辑器自己的粘贴命令,一切正常 ——
|
|
4656
|
+
* 所以这个毛病看起来「时好时坏」,且关掉插件就消失(宿主原生面板是 `main`)。
|
|
4657
|
+
*
|
|
4658
|
+
* 修法:在 window **捕获**阶段抢在宿主(document 冒泡)之前,只做一件事 ——
|
|
4659
|
+
* 把当前栏激活标签的输入框 focus() 一下。focus 会同步触发 focusin,
|
|
4660
|
+
* 宿主路由的 `focused` 当场更新,紧接着它自己的监听就把这次粘贴投给正确的栏。
|
|
4661
|
+
* 不 preventDefault、不 stopPropagation、不读文件内容;任何一步对不上就整个让路。
|
|
4662
|
+
*
|
|
4663
|
+
* @returns 卸载函数(只拆这一个监听)
|
|
4664
|
+
*/
|
|
4665
|
+
function installPastePaneRouting() {
|
|
4666
|
+
const EDITABLE = 'input, textarea, select, [contenteditable]:not([contenteditable="false"])';
|
|
4667
|
+
const focusOwner = (node) => (node !== null && node !== void 0 && typeof node.closest === "function" ? node.closest(EDITABLE) : null);
|
|
4668
|
+
const onPaste = (event) => {
|
|
4669
|
+
try {
|
|
4670
|
+
const dt = event.clipboardData;
|
|
4671
|
+
if (dt === null || dt === void 0 || dt.files === void 0 || dt.files.length === 0) return;
|
|
4672
|
+
/* 落点本身在可编辑元素里 → 编辑器自己会处理(含文本优先的规则),别插手。 */
|
|
4673
|
+
const path = typeof event.composedPath === "function" ? event.composedPath() : [];
|
|
4674
|
+
const origin = path.length > 0 ? path[0] : event.target;
|
|
4675
|
+
if (focusOwner(origin) !== null) return;
|
|
4676
|
+
const active = document.activeElement;
|
|
4677
|
+
/* 焦点已经在某个输入框里 → 宿主认的就是它,不改判。 */
|
|
4678
|
+
if (focusOwner(active) !== null) return;
|
|
4679
|
+
/* 前台有模态框/菜单时抢焦点会打架,让路。 */
|
|
4680
|
+
if (active !== null && active !== void 0 && typeof active.closest === "function"
|
|
4681
|
+
&& active.closest('[role="dialog"], dialog[open], [aria-modal="true"]') !== null) return;
|
|
4682
|
+
const pane = currentPaneEl();
|
|
4683
|
+
if (pane === null || pane === void 0) return;
|
|
4684
|
+
/* 注意:这里不能因为「焦点已经在本栏」就提前收手 —— 焦点可能停在本栏的
|
|
4685
|
+
某个按钮上而不是输入框里,此时宿主仍然会把粘贴投给**上次**持有焦点的
|
|
4686
|
+
composer(可能在别的栏)。只有「焦点已经在某个可编辑元素里」才让路
|
|
4687
|
+
(上面已判),其余情况一律把当前栏的输入框扶正。 */
|
|
4688
|
+
const editor = pane.querySelector('.dsv-tab-slot[data-active="1"] [contenteditable="true"]')
|
|
4689
|
+
?? pane.querySelector('[contenteditable="true"]');
|
|
4690
|
+
if (editor === null || editor === void 0 || typeof editor.focus !== "function") return;
|
|
4691
|
+
editor.focus({ preventScroll: true });
|
|
4692
|
+
} catch {
|
|
4693
|
+
/* 任何异常都只是「让路」:绝不吞掉这次粘贴,最坏退回宿主原行为。 */
|
|
4694
|
+
}
|
|
4695
|
+
};
|
|
4696
|
+
window.addEventListener("paste", onPaste, true);
|
|
4697
|
+
return () => {
|
|
4698
|
+
window.removeEventListener("paste", onPaste, true);
|
|
4699
|
+
};
|
|
4700
|
+
}
|
|
4701
|
+
|
|
4647
4702
|
/* Ctrl+Tab 跨栏跳过去之后**不抢键盘焦点**(插入符留在原栏的输入框里,回头再按一次
|
|
4648
4703
|
就能接着打字)。但「当前栏」原本是按 document.activeElement 判的 —— 不记一笔,
|
|
4649
4704
|
连按 Ctrl+Tab 会每次都从旧栏重新算,在两栏之间打乒乓;Ctrl+W 也会关掉旧栏的标签。
|
|
@@ -11484,6 +11539,53 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
11484
11539
|
};
|
|
11485
11540
|
}, "dsh-split-view: attachments drop routing");
|
|
11486
11541
|
|
|
11542
|
+
/* 粘贴定向:跟随总开关装/卸。关掉插件时这条监听必须消失,宿主的原生粘贴路由
|
|
11543
|
+
才能原样工作(与上面的拖放定向同一个纪律:关掉后不许留任何痕迹)。 */
|
|
11544
|
+
ctx.effect(() => {
|
|
11545
|
+
let stopPaste = null;
|
|
11546
|
+
const sync = () => {
|
|
11547
|
+
const want = prefs.state.enabled === true;
|
|
11548
|
+
if (want === true) {
|
|
11549
|
+
if (stopPaste === null) {
|
|
11550
|
+
try {
|
|
11551
|
+
stopPaste = installPastePaneRouting();
|
|
11552
|
+
} catch (error) {
|
|
11553
|
+
console.warn("[split-view] 粘贴定向未启用:", error);
|
|
11554
|
+
stopPaste = null;
|
|
11555
|
+
}
|
|
11556
|
+
}
|
|
11557
|
+
return;
|
|
11558
|
+
}
|
|
11559
|
+
if (stopPaste !== null) {
|
|
11560
|
+
try {
|
|
11561
|
+
stopPaste();
|
|
11562
|
+
} catch {
|
|
11563
|
+
/* 忽略 */
|
|
11564
|
+
}
|
|
11565
|
+
stopPaste = null;
|
|
11566
|
+
}
|
|
11567
|
+
};
|
|
11568
|
+
const off = prefs.subscribe(sync);
|
|
11569
|
+
sync();
|
|
11570
|
+
return () => {
|
|
11571
|
+
if (typeof off === "function") {
|
|
11572
|
+
try {
|
|
11573
|
+
off();
|
|
11574
|
+
} catch {
|
|
11575
|
+
/* 忽略 */
|
|
11576
|
+
}
|
|
11577
|
+
}
|
|
11578
|
+
if (stopPaste !== null) {
|
|
11579
|
+
try {
|
|
11580
|
+
stopPaste();
|
|
11581
|
+
} catch {
|
|
11582
|
+
/* 忽略 */
|
|
11583
|
+
}
|
|
11584
|
+
stopPaste = null;
|
|
11585
|
+
}
|
|
11586
|
+
};
|
|
11587
|
+
}, "dsh-split-view: paste pane routing");
|
|
11588
|
+
|
|
11487
11589
|
/* 跨栏标签切换:Ctrl+Tab / Ctrl+Shift+Tab。设置页没有 .dsv-pane,自然不会触发。 */
|
|
11488
11590
|
ctx.effect(() => installTabCycling(), "dsh-split-view: tab cycling shortcut");
|
|
11489
11591
|
ctx.effect(() => installCloseTabShortcut(), "dsh-split-view: ctrl+w closes the tab");
|
package/lib/index.js
CHANGED
|
File without changes
|
package/locale/en.json
CHANGED
|
File without changes
|
package/locale/zh.json
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-multipane",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Split the DSH main area into up to four panes, each with its own tab strip, composer and view switcher. Drag a tab to a pane edge to split. Bilingual (zh/en).",
|
|
5
5
|
"displayName": "多栏视图",
|
|
6
6
|
"dshhub": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dsh": {
|
|
23
23
|
"engines": {
|
|
24
|
-
"dsh": "\u003e=0.2.
|
|
24
|
+
"dsh": "\u003e=0.2.3-alpha.2"
|
|
25
25
|
},
|
|
26
26
|
"bundle": {
|
|
27
27
|
"patch": "./cordis.patch.yml"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@deepseek-ai/dsh": "\u003e=0.2.
|
|
49
|
+
"@deepseek-ai/dsh": "\u003e=0.2.3-alpha.2",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
|
-
"@deepseek-ai/dsh-client-ui-context-menu": "\u003e=0.2.
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-context-menu": "\u003e=0.2.3-alpha.2"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
54
|
"locale",
|