dsh-width-tiers 1.0.3 → 1.0.5
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 +2 -9
- package/README.zh.md +2 -8
- package/cordis.patch.yml +9 -0
- package/lib/client.js +19 -9
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -34,14 +34,8 @@ a glance.
|
|
|
34
34
|
dsh plugin --profile web add dsh-width-tiers
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```yaml
|
|
41
|
-
- insert:
|
|
42
|
-
- id: dsh-width-tiers
|
|
43
|
-
name: dsh-width-tiers
|
|
44
|
-
```
|
|
37
|
+
The bundle patch then inserts the `dsh-width-tiers` loader entry itself — no
|
|
38
|
+
manual `cordis.patch.yml` edits needed.
|
|
45
39
|
|
|
46
40
|
Restart `dsh web` (the plugin loads at boot) and hard-refresh the page
|
|
47
41
|
(Ctrl+Shift+R). A round button with five bars appears at the bottom-right.
|
|
@@ -98,7 +92,6 @@ language, and Chinese is the last resort. No plugin-side setting needed.
|
|
|
98
92
|
dsh plugin --profile web remove dsh-width-tiers
|
|
99
93
|
```
|
|
100
94
|
|
|
101
|
-
Remove the `dsh-width-tiers` row from `~/.dsh/profiles/web/cordis.patch.yml`,
|
|
102
95
|
then restart `dsh web`.
|
|
103
96
|
|
|
104
97
|
## License
|
package/README.zh.md
CHANGED
|
@@ -31,13 +31,8 @@ DSH Web 在会话根元素上硬编码了一个阅读宽度
|
|
|
31
31
|
dsh plugin --profile web add dsh-width-tiers
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```yaml
|
|
37
|
-
- insert:
|
|
38
|
-
- id: dsh-width-tiers
|
|
39
|
-
name: dsh-width-tiers
|
|
40
|
-
```
|
|
34
|
+
bundle patch 会自动插入 `dsh-width-tiers` 加载项——无需手动改
|
|
35
|
+
`cordis.patch.yml`。
|
|
41
36
|
|
|
42
37
|
**重启 `dsh web`**(插件在启动时加载),再硬刷新页面(Ctrl+Shift+R)。
|
|
43
38
|
右下角会出现五条横条的圆形按钮。
|
|
@@ -85,7 +80,6 @@ dsh plugin --profile web add dsh-width-tiers
|
|
|
85
80
|
dsh plugin --profile web remove dsh-width-tiers
|
|
86
81
|
```
|
|
87
82
|
|
|
88
|
-
删除 `~/.dsh/profiles/web/cordis.patch.yml` 里的 `dsh-width-tiers` 行,
|
|
89
83
|
然后重启 `dsh web`。
|
|
90
84
|
|
|
91
85
|
## 许可证
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# dsh-width-tiers bundle patch — automatically applied when this package is
|
|
2
|
+
# added as a profile bundle (e.g. `dsh plugin add dsh-width-tiers`).
|
|
3
|
+
#
|
|
4
|
+
# It registers this plugin's own loader entry (a web client plugin carried by
|
|
5
|
+
# its node-half row). Because bundle patches apply after the shipped base
|
|
6
|
+
# layers, no manual `cordis.patch.yml` edit is needed in the profile.
|
|
7
|
+
- insert:
|
|
8
|
+
- id: dsh-width-tiers
|
|
9
|
+
name: 'dsh-width-tiers'
|
package/lib/client.js
CHANGED
|
@@ -31,8 +31,8 @@ window.__ModuleLoader__.load({
|
|
|
31
31
|
* - The sidebar is only ever collapsed by the `full` tier, through the
|
|
32
32
|
* app's own toggle — never force-hidden, never locked. Going back to
|
|
33
33
|
* `standard` restores it only if this plugin collapsed it.
|
|
34
|
-
* - Non-standard tiers close the
|
|
35
|
-
* active); `standard` leaves everything to the app.
|
|
34
|
+
* - Non-standard tiers close the right panel (rightbar, self-heal
|
|
35
|
+
* while active); `standard` leaves everything to the app.
|
|
36
36
|
* - The chosen tier persists in localStorage and is restored on the
|
|
37
37
|
* next visit.
|
|
38
38
|
* - All copy is localized through the app's locale service: tier
|
|
@@ -159,14 +159,17 @@ window.__ModuleLoader__.load({
|
|
|
159
159
|
return "standard";
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
/* The AppFrame sets data-sidebar-collapsed
|
|
163
|
-
*
|
|
162
|
+
/* The AppFrame sets data-sidebar-collapsed on the frame element
|
|
163
|
+
* (conditionally, only while collapsed) after each render. */
|
|
164
164
|
function isSidebarCollapsed() {
|
|
165
165
|
return document.querySelector("[data-sidebar-collapsed]") !== null;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
/* 0.1.5-rc.2 replaced the details panel with the rightbar and
|
|
169
|
+
* dropped `data-details-collapsed` entirely; closeRightbar is
|
|
170
|
+
* idempotent, so it is called unconditionally. */
|
|
171
|
+
function closeRightbar() {
|
|
172
|
+
layout.closeRightbar?.();
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
function collapseSidebar() {
|
|
@@ -178,7 +181,7 @@ window.__ModuleLoader__.load({
|
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
function closeDetails() {
|
|
181
|
-
|
|
184
|
+
closeRightbar();
|
|
182
185
|
}
|
|
183
186
|
|
|
184
187
|
/* Locate the element that defines --dsh-chat-content-width at
|
|
@@ -399,9 +402,16 @@ window.__ModuleLoader__.load({
|
|
|
399
402
|
/* ---- attach once the app shell has mounted ---- */
|
|
400
403
|
let attached = false;
|
|
401
404
|
|
|
405
|
+
/* The old gate matched [data-sidebar-collapsed] /
|
|
406
|
+
* [data-details-collapsed]. 0.1.5-rc.2 renders collapsed
|
|
407
|
+
* markers conditionally (`sidebarCollapsed || void 0`) and
|
|
408
|
+
* removed data-details-collapsed, so with the sidebar expanded
|
|
409
|
+
* nothing ever matched and the button never mounted. Wait for
|
|
410
|
+
* the AppFrame overlay layer instead — `data-shell-overlay` is
|
|
411
|
+
* rendered unconditionally once the shell exists. */
|
|
402
412
|
function attach() {
|
|
403
413
|
if (attached || !body()) return;
|
|
404
|
-
if (document.querySelector("[data-
|
|
414
|
+
if (document.querySelector("[data-shell-overlay]") === null) return;
|
|
405
415
|
attached = true;
|
|
406
416
|
try {
|
|
407
417
|
window.localStorage.removeItem(OLD_KEY);
|
|
@@ -508,7 +518,7 @@ window.__ModuleLoader__.load({
|
|
|
508
518
|
subtree: true,
|
|
509
519
|
childList: true,
|
|
510
520
|
attributes: true,
|
|
511
|
-
attributeFilter: ["data-
|
|
521
|
+
attributeFilter: ["data-sidebar-collapsed", "data-rightbar-collapsed"]
|
|
512
522
|
});
|
|
513
523
|
}
|
|
514
524
|
/* Low-frequency fallback so self-heal still runs if the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-width-tiers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "DSH Web client plugin: chat content width tiers (standard / medium / wide / ultra / full) with a floating picker button. Frees wide tables from the app's hard-coded 748px content cap. UI copy follows the app language (zh / en).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "aaronlei",
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"lib",
|
|
19
|
+
"cordis.patch.yml",
|
|
19
20
|
"LICENSE",
|
|
20
21
|
"README.md",
|
|
21
22
|
"README.zh.md"
|
|
22
23
|
],
|
|
23
24
|
"dsh": {
|
|
25
|
+
"bundle": {
|
|
26
|
+
"patch": "./cordis.patch.yml"
|
|
27
|
+
},
|
|
24
28
|
"client": {
|
|
25
29
|
"platform": "web",
|
|
26
30
|
"inject": [
|