@wangjianxiong/dsh-client-ui-sidebar-auto-collapse 0.1.6-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -0
- package/README.md +14 -0
- package/README.zh.md +14 -0
- package/lib/client.js +23 -0
- package/lib/index.js +6 -0
- package/lib/types/client/index.d.ts +15 -0
- package/lib/types/index.d.ts +4 -0
- package/package.json +54 -0
package/README.i18n.yaml
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Optional Web UI policy plugin that synchronizes the left Sidebar with right-Sidebar presentation."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @wangjianxiong/dsh-client-ui-sidebar-auto-collapse
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
This optional browser plugin collapses the left Sidebar while the right Sidebar is shown and expands it when the right Sidebar is hidden. It consumes the typed `ctx.sidebarRight.onPresentationChange()` subscription from `@deepseek-ai/dsh-client-ui-sidebar-right` and uses the idempotent `ctx.layout.setSidebarExpanded()` action.
|
|
13
|
+
|
|
14
|
+
The policy applies to every right-Sidebar tab type, including file previews. Remove this package from the profile to keep the two sidebars independent.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "可选的 Web UI 策略插件:根据右侧 Sidebar 的呈现状态同步左侧 Sidebar。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @wangjianxiong/dsh-client-ui-sidebar-auto-collapse
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
这是一个可选的浏览器插件:右侧 Sidebar 显示时收起左侧 Sidebar,右侧 Sidebar 隐藏时展开左侧 Sidebar。插件消费 `@deepseek-ai/dsh-client-ui-sidebar-right` 提供的类型化 `ctx.sidebarRight.onPresentationChange()` 订阅,并调用幂等的 `ctx.layout.setSidebarExpanded()`。
|
|
13
|
+
|
|
14
|
+
该策略适用于所有右侧 Sidebar 标签类型,包括文件预览。将本包从 profile 中移除即可让两个 Sidebar 独立工作。
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@wangjianxiong/dsh-client-ui-sidebar-auto-collapse",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
//#region src/client/index.ts
|
|
8
|
+
/** Services required by the presentation synchronizer. */
|
|
9
|
+
const inject = ["layout", "sidebarRight"];
|
|
10
|
+
/** Install the left-sidebar synchronization listener. @param ctx - Client root context. */
|
|
11
|
+
function apply(ctx) {
|
|
12
|
+
ctx.effect(() => ctx.sidebarRight.onPresentationChange(({ shown }) => {
|
|
13
|
+
ctx.layout.setSidebarExpanded(!shown);
|
|
14
|
+
}), "ui-sidebar-auto-collapse: presentation policy");
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.apply = apply;
|
|
18
|
+
exports.inject = inject;
|
|
19
|
+
return module.exports;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=client.js.map
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep the two sidebars readable together: opening the right panel collapses
|
|
3
|
+
* the left panel, and hiding the right panel expands the left panel.
|
|
4
|
+
*
|
|
5
|
+
* This is a separate plugin so deployments can opt out without changing the
|
|
6
|
+
* right-sidebar surface itself. The right-sidebar plugin emits presentation
|
|
7
|
+
* changes; this plugin only consumes that event and writes the explicit layout
|
|
8
|
+
* state.
|
|
9
|
+
*/
|
|
10
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
11
|
+
/** Services required by the presentation synchronizer. */
|
|
12
|
+
export declare const inject: string[];
|
|
13
|
+
/** Install the left-sidebar synchronization listener. @param ctx - Client root context. */
|
|
14
|
+
export declare function apply(ctx: ClientContext): void;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wangjianxiong/dsh-client-ui-sidebar-auto-collapse",
|
|
3
|
+
"description": "Optional UI plugin that collapses the left sidebar while the right sidebar is open",
|
|
4
|
+
"version": "0.1.6-alpha.1",
|
|
5
|
+
"publishConfig": { "access": "public" },
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/DeepSeek-ai/deepseek-harness.git",
|
|
9
|
+
"directory": "packages/client/ui-sidebar-auto-collapse"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "lib/index.js",
|
|
13
|
+
"types": "lib/types/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./lib/types/index.d.ts",
|
|
17
|
+
"default": "./lib/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./client": {
|
|
20
|
+
"types": "./lib/types/client/index.d.ts",
|
|
21
|
+
"default": "./lib/client.js"
|
|
22
|
+
},
|
|
23
|
+
"./src/*": "./src/*",
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"dsh": {
|
|
27
|
+
"client": {
|
|
28
|
+
"inject": [
|
|
29
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
30
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right"
|
|
31
|
+
],
|
|
32
|
+
"platform": "web"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"bundle": "tsdown",
|
|
37
|
+
"watch": "tsdown --watch"
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@deepseek-ai/cordis": "workspace:^"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@deepseek-ai/cordis": "workspace:^",
|
|
45
|
+
"@deepseek-ai/dsh-client-test-runtime": "workspace:^",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-layout": "workspace:^",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "workspace:^"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"lib/index.js",
|
|
51
|
+
"lib/client.js",
|
|
52
|
+
"lib/types/**/*.d.ts"
|
|
53
|
+
]
|
|
54
|
+
}
|