dsh-width-tiers 1.0.4 → 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/lib/client.js +19 -9
- package/package.json +1 -1
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",
|