dsh-sidebar-fold 0.1.6 → 0.1.13

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/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Recolhimento de «Mais» da barra lateral",
4
+ "description": "Adiciona um comutador de seta quadrada na linha «Mais» para recolher as linhas de painéis adicionados da barra lateral em uma única linha; estado padrão e lista de exceções configuráveis."
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-sidebar-fold",
3
- "version": "0.1.6",
4
- "description": "Folds the sidebar's add-on panel rows (schedules, agent teams, plugin market, context pages, …) under the shipped \"More\" row: a 28×28 square toggle collapses them to that single header line and expands them back. The fold state persists per window, kept-visible rows are picked from the live sidebar, and the managed rows' icon + label can be aligned left, centre or right.",
3
+ "version": "0.1.13",
4
+ "description": "Folds the sidebar's add-on panel rows under the shipped \"More\" row, and from host 0.2.2 on gives every row three states — show, fold, or hide in the host's own \"More\" list. The fold state persists per window, rows are read from the live sidebar, and the managed rows' icon + label can be aligned left, centre or right.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "exports": {
@@ -19,7 +19,8 @@
19
19
  "cordis.patch.yml",
20
20
  "dsh.plugin.json",
21
21
  "README.md",
22
- "README.zh.md"
22
+ "README.zh.md",
23
+ "README.pt.md"
23
24
  ],
24
25
  "dsh": {
25
26
  "bundle": {
@@ -57,7 +58,7 @@
57
58
  ],
58
59
  "engines": {
59
60
  "node": ">=22.6.0",
60
- "dsh": ">=0.2.1-rc.3 <0.3.0"
61
+ "dsh": ">=0.2.1-rc.3 <0.3.0-0"
61
62
  },
62
63
  "license": "MIT",
63
64
  "repository": {
@@ -73,7 +74,7 @@
73
74
  "@deepseek-ai/schemastery": "^3.18.4"
74
75
  },
75
76
  "peerDependencies": {
76
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5 || 0.2.2-rc.1"
77
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.3 || 0.2.1-rc.4 || 0.2.1-rc.5 || 0.2.2-rc.1 || 0.2.2-rc.2 || 0.2.2-rc.3 || 0.2.2-rc.4 || 0.2.2-rc.5"
77
78
  },
78
79
  "devDependencies": {
79
80
  "@types/node": "^22.20.5",
@@ -1,237 +1,319 @@
1
- /**
2
- * Browser-half constants: the anchors this plugin reads and the surfaces it owns.
3
- *
4
- * Every selector here is measured against the shipped rc.3 runtime (host-farm
5
- * `0.2.1-rc.3`, http://127.0.0.1:3093) and quoted from `dsh-client-ui-sidebar`
6
- * `lib/client.js`. CSS-module hashes drift per build — rc.2 emitted `wtg9ga_`,
7
- * the rc.3 runtime emits `hHd-Xa_` — so all class matching uses the *fragment*
8
- * after the underscore and never a full class name.
9
- */
10
-
11
- /** Package name / settings namespace / module-loader id (must equal package.json `name`). */
12
- export const PKG_NAME = 'dsh-sidebar-fold'
13
-
14
- /** One style tag, identified by the same convention the host uses for its own injected CSS. */
15
- export const STYLE_TAG_ID = `${PKG_NAME}/SidebarFold.css`
16
-
17
- /** Prefix for every class this plugin owns. */
18
- export const CLS = Object.freeze({
19
- toggle: 'dshsf-fold-toggle',
20
- toggleIdle: 'dshsf-fold-idle',
21
- icon: 'dshsf-fold-icon',
22
- card: 'dshsf-card',
23
- cardHost: 'dshsf-card-host',
24
- row: 'dshsf-row',
25
- rowMain: 'dshsf-row-main',
26
- label: 'dshsf-label',
27
- hint: 'dshsf-hint',
28
- control: 'dshsf-control',
29
- switch: 'dshsf-switch',
30
- switchKnob: 'dshsf-switch-knob',
31
- segmentGroup: 'dshsf-segment-group',
32
- segment: 'dshsf-segment',
33
- })
34
-
35
- /**
36
- * Alignment of a panel row's content (icon + label) inside the row.
37
- *
38
- * `start` is the host's own layout and is applied as a no-op-ish value (the nav
39
- * still carries the attribute so the CSS can stay declarative). `center` and
40
- * `end` are ours: the host row is `display:flex` with `justify-content:normal`
41
- * and the title does not stretch (`flex:0 1 auto`, measured on rc.3), so moving
42
- * the pair only takes one `justify-content` override.
43
- */
44
- export const ALIGN_MODES = Object.freeze(['start', 'center', 'end'] as const)
45
-
46
- /** One of {@link ALIGN_MODES}. */
47
- export type AlignMode = (typeof ALIGN_MODES)[number]
48
-
49
- /** Attribute marks this plugin writes (and removes on dispose). */
50
- export const ATTR = Object.freeze({
51
- /** On the nav: the fold header, i.e. the shipped "More" row. */
52
- header: 'data-dshsf-header',
53
- /** On the nav: `folded` while the group is collapsed. */
54
- state: 'data-dshsf-state',
55
- /** On a panel row taken into the fold. */
56
- folded: 'data-dshsf-folded',
57
- /** On every element this plugin created — the dispose sweep key. */
58
- own: 'data-dshsf-own',
59
- /** On the nav: row-content alignment (`start` | `center` | `end`). */
60
- align: 'data-dshsf-align',
61
- })
62
-
63
- /** Selector fragments (hash-tolerant). */
64
- export const SEL = Object.freeze({
65
- /** The panel-list `<nav>` and a collapsed rail's root carry these. */
66
- panelList: '[class*="_panelList"]',
67
- panelRow: 'button[class*="_panelRow"]',
68
- panelTitle: '[class*="_panelTitle"]',
69
- /** The `Menu` host element wrapping the "More" anchor: our toggle's parent. */
70
- moreAnchor: '[class*="_moreAnchor"]',
71
- /** Sidebar root modifier present exactly while the column is a narrow rail. */
72
- collapsed: '[class*="_collapsed"]',
73
- })
74
-
75
- /** `localStorage` key for the open/closed state (window-level UI state, by design). */
76
- export const STORAGE_KEY = `${PKG_NAME}.v1.folded`
77
-
78
- /** Accessible-name strings of the shipped "More" row (`client.js:528-544` zh/en dictionaries). */
79
- export const MORE_LABELS = Object.freeze(['更多', 'More'])
80
-
81
- /** Accessible-name strings of the "Global panels" nav label (`client.js:533`). */
82
- export const PANELS_LABELS = Object.freeze(['全局面板', 'Global panels'])
83
-
84
- /** Self-drawn chevron geometry: the host `primitives` package is off-limits to plugins. */
85
- export const ICON_PATH = Object.freeze({
86
- up: 'M3.5 10 8 5.5 12.5 10',
87
- down: 'M3.5 6 8 10.5 12.5 6',
88
- })
89
-
90
- /** Measured host geometry this plugin matches instead of inventing (findings §2.6). */
91
- export const TOGGLE_PX = 28
92
- export const ICON_PX = 16
93
-
94
- /** The CSS this plugin injects. Tokens are host-public aliases only; the anchor
95
- * override keeps the row's height so the portal menu's anchor box is unchanged.
96
- *
97
- * Every rule is one joined string built from an explicit declaration list — the
98
- * first smoke run shipped a sheet whose declarations ran together (no `;`),
99
- * so `transform`/`cursor`/`padding` were all dropped and the toggle sat 14px low.
100
- * Declarations are joined here, never by string concatenation across lines. */
101
- const rule = (selector: string, declarations: string[]): string =>
102
- `${selector}{${declarations.join(';')}}`
103
-
104
- export const SHEET = [
105
- // The header keeps `position:relative` so the toggle (a sibling inside the
106
- // Menu's anchor span) is positioned against the row, not the span.
107
- //
108
- // Its horizontal padding is per alignment: at `start` the toggle sits on the
109
- // right and needs a gutter; at `center` the gutter would push the labeled pair
110
- // off-centre (measured +19px), so the padding has to be symmetric; at `end` the
111
- // toggle mirrors to the left and the gutter moves with it. `padding-top/bottom`
112
- // from the host (`7px 8px`) is untouched by these longhands.
113
- rule(`[${ATTR.header}]`, ['position:relative']),
114
- rule(`[${ATTR.align}="start"] [${ATTR.header}]`, [`padding-right:${TOGGLE_PX + 10}px`]),
115
- rule(`[${ATTR.align}="center"] [${ATTR.header}]`, ['padding-left:8px', 'padding-right:8px']),
116
- rule(`[${ATTR.align}="end"] [${ATTR.header}]`, [`padding-left:${TOGGLE_PX + 10}px`, 'padding-right:8px']),
117
- rule(`[${ATTR.align}="end"] .${CLS.toggle}`, ['left:4px', 'right:auto']),
118
- // Row-content alignment. The whitespace after `:` is deliberate — a bare
119
- // `center!important` is a parse error in some engines and silently dropped.
120
- rule(`[${ATTR.align}="center"] ${SEL.panelRow}`, ['justify-content: center !important']),
121
- rule(`[${ATTR.align}="end"] ${SEL.panelRow}`, ['justify-content: flex-end !important']),
122
- rule(`.${CLS.toggle}`, [
123
- 'position:absolute',
124
- 'right:4px',
125
- 'top:50%',
126
- 'transform:translateY(-50%)',
127
- 'box-sizing:border-box',
128
- `width:${TOGGLE_PX}px`,
129
- `height:${TOGGLE_PX}px`,
130
- 'border:0',
131
- 'padding:0',
132
- 'display:inline-flex',
133
- 'align-items:center',
134
- 'justify-content:center',
135
- 'border-radius:var(--dsw-radius-sm,6px)',
136
- 'background:transparent',
137
- 'color:var(--dsw-alias-label-secondary,currentColor)',
138
- 'cursor:pointer',
139
- '-webkit-app-region:no-drag',
140
- ]),
141
- rule(`.${CLS.toggle}:hover`, ['background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.16))']),
142
- rule(`.${CLS.toggleIdle}`, ['opacity:.45', 'cursor:default']),
143
- rule(`.${CLS.toggleIdle}:hover`, ['background:transparent']),
144
- rule(`.${CLS.toggle}:focus-visible`, [
145
- 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
146
- 'outline-offset:-2px',
147
- ]),
148
- rule(`.${CLS.icon}`, ['display:inline-flex', 'align-items:center', 'justify-content:center']),
149
- rule(`[${ATTR.state}="folded"] [${ATTR.folded}]`, ['display:none']),
150
- // Settings card (bundle detail page): spacing only, colours come from tokens.
151
- rule(`.${CLS.card}`, ['display:flex', 'flex-direction:column', 'gap:12px', 'min-width:0']),
152
- rule(`.${CLS.cardHost}`, ['display:block', 'min-width:0', 'width:100%']),
153
- rule(`.${CLS.row}`, ['display:flex', 'align-items:flex-start', 'justify-content:space-between', 'gap:16px']),
154
- rule(`.${CLS.rowMain}`, ['display:flex', 'flex-direction:column', 'gap:2px', 'min-width:0']),
155
- rule(`.${CLS.label}`, ['font-size:13px', 'line-height:20px']),
156
- rule(`.${CLS.hint}`, ['font-size:12px', 'line-height:16px', 'opacity:.72']),
157
- rule(`.${CLS.control}`, [
158
- 'box-sizing:border-box',
159
- 'flex:none',
160
- 'font:inherit',
161
- 'font-size:13px',
162
- 'padding:4px 8px',
163
- 'border-radius:8px',
164
- 'border:.5px solid var(--dsw-alias-border-l3,rgba(127,127,127,.35))',
165
- 'background:var(--dsw-specific-input-major,transparent)',
166
- 'color:inherit',
167
- 'max-width:280px',
168
- ]),
169
- rule(`.${CLS.control}[type="checkbox"]`, ['width:16px', 'height:16px', 'margin-top:3px']),
170
- // Pill switch (the shape this plugin family uses for on/off rows): the track is
171
- // 36×20, the knob 16px, and the whole thing is a real button with role="switch".
172
- rule(`.${CLS.switch}`, [
173
- 'position:relative',
174
- 'display:inline-block',
175
- 'flex:none',
176
- 'box-sizing:border-box',
177
- 'width:36px',
178
- 'height:20px',
179
- 'margin-top:2px',
180
- 'border:0',
181
- 'padding:0',
182
- 'border-radius:999px',
183
- 'background:var(--dsw-alias-border-l3,rgba(127,127,127,.35))',
184
- 'cursor:pointer',
185
- 'transition:background .15s ease',
186
- ]),
187
- rule(`.${CLS.switch}[aria-checked="true"]`, ['background:var(--dsw-alias-state-business-primary,#4d6bfe)']),
188
- rule(`.${CLS.switch}[disabled]`, ['opacity:.5', 'cursor:default']),
189
- rule(`.${CLS.switch}:focus-visible`, [
190
- 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
191
- 'outline-offset:2px',
192
- ]),
193
- rule(`.${CLS.switchKnob}`, [
194
- 'position:absolute',
195
- 'top:2px',
196
- 'left:2px',
197
- 'width:16px',
198
- 'height:16px',
199
- 'border-radius:50%',
200
- 'background:#fff',
201
- 'box-shadow:0 1px 2px rgba(0,0,0,.2)',
202
- 'transition:transform .15s ease',
203
- 'pointer-events:none',
204
- ]),
205
- rule(`.${CLS.switch}[aria-checked="true"] .${CLS.switchKnob}`, ['transform:translateX(16px)']),
206
- // Segmented control (three-state alignment): a track holding one button per
207
- // option, the chosen one raised. Same family shape as the pill switch above.
208
- rule(`.${CLS.segmentGroup}`, [
209
- 'display:inline-flex',
210
- 'flex:none',
211
- 'gap:2px',
212
- 'padding:2px',
213
- 'border-radius:9px',
214
- 'background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.12))',
215
- ]),
216
- rule(`.${CLS.segment}`, [
217
- 'border:0',
218
- 'background:transparent',
219
- 'border-radius:7px',
220
- 'padding:3px 10px',
221
- 'font:inherit',
222
- 'font-size:12px',
223
- 'line-height:16px',
224
- 'color:var(--dsw-alias-label-secondary,inherit)',
225
- 'cursor:pointer',
226
- ]),
227
- rule(`.${CLS.segment}[aria-checked="true"]`, [
228
- 'background:var(--dsw-alias-bg-layer-1,#fff)',
229
- 'color:var(--dsw-alias-label-primary,inherit)',
230
- 'box-shadow:0 1px 2px rgba(0,0,0,.12)',
231
- ]),
232
- rule(`.${CLS.segment}[disabled]`, ['opacity:.5', 'cursor:default']),
233
- rule(`.${CLS.segment}:focus-visible`, [
234
- 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
235
- 'outline-offset:1px',
236
- ]),
237
- ].join('')
1
+ /**
2
+ * Browser-half constants: the anchors this plugin reads and the surfaces it owns.
3
+ *
4
+ * Every selector here is measured against the shipped rc.3 runtime (host-farm
5
+ * `0.2.1-rc.3`, http://127.0.0.1:3093) and quoted from `dsh-client-ui-sidebar`
6
+ * `lib/client.js`. CSS-module hashes drift per build — rc.2 emitted `wtg9ga_`,
7
+ * the rc.3 runtime emits `hHd-Xa_` — so all class matching uses the *fragment*
8
+ * after the underscore and never a full class name.
9
+ */
10
+
11
+ /** Package name / settings namespace / module-loader id (must equal package.json `name`). */
12
+ export const PKG_NAME = 'dsh-sidebar-fold'
13
+
14
+ /** One style tag, identified by the same convention the host uses for its own injected CSS. */
15
+ export const STYLE_TAG_ID = `${PKG_NAME}/SidebarFold.css`
16
+
17
+ /** Prefix for every class this plugin owns. */
18
+ export const CLS = Object.freeze({
19
+ toggle: 'dshsf-fold-toggle',
20
+ toggleIdle: 'dshsf-fold-idle',
21
+ icon: 'dshsf-fold-icon',
22
+ card: 'dshsf-card',
23
+ cardHost: 'dshsf-card-host',
24
+ row: 'dshsf-row',
25
+ rowMain: 'dshsf-row-main',
26
+ label: 'dshsf-label',
27
+ hint: 'dshsf-hint',
28
+ control: 'dshsf-control',
29
+ switch: 'dshsf-switch',
30
+ switchKnob: 'dshsf-switch-knob',
31
+ segmentGroup: 'dshsf-segment-group',
32
+ segment: 'dshsf-segment',
33
+ /** "More" menu shortcut row: its group wrapper, the row, its text and glyph. */
34
+ menuGroup: 'dshsf-menu-group',
35
+ menuRow: 'dshsf-menu-row',
36
+ menuText: 'dshsf-menu-text',
37
+ menuIcon: 'dshsf-menu-icon',
38
+ })
39
+
40
+ /**
41
+ * Alignment of a panel row's content (icon + label) inside the row.
42
+ *
43
+ * `start` is the host's own layout and is applied as a no-op-ish value (the nav
44
+ * still carries the attribute so the CSS can stay declarative). `center` and
45
+ * `end` are ours: the host row is `display:flex` with `justify-content:normal`
46
+ * and the title does not stretch (`flex:0 1 auto`, measured on rc.3), so moving
47
+ * the pair only takes one `justify-content` override.
48
+ */
49
+ export const ALIGN_MODES = Object.freeze(['start', 'center', 'end'] as const)
50
+
51
+ /** One of {@link ALIGN_MODES}. */
52
+ export type AlignMode = (typeof ALIGN_MODES)[number]
53
+
54
+ /** Attribute marks this plugin writes (and removes on dispose). */
55
+ export const ATTR = Object.freeze({
56
+ /** On the nav: the fold header, i.e. the shipped "More" row. */
57
+ header: 'data-dshsf-header',
58
+ /** On the nav: `folded` while the group is collapsed. */
59
+ state: 'data-dshsf-state',
60
+ /** On a panel row taken into the fold. */
61
+ folded: 'data-dshsf-folded',
62
+ /** On every element this plugin created — the dispose sweep key. */
63
+ own: 'data-dshsf-own',
64
+ /** On the nav: row-content alignment (`start` | `center` | `end`). */
65
+ align: 'data-dshsf-align',
66
+ /** On the toggle: the folded group holds the panel the user is looking at. */
67
+ activeInside: 'data-dshsf-active-inside',
68
+ })
69
+
70
+ /** Selector fragments (hash-tolerant). */
71
+ export const SEL = Object.freeze({
72
+ /** The panel-list `<nav>` and a collapsed rail's root carry these. */
73
+ panelList: '[class*="_panelList"]',
74
+ panelRow: 'button[class*="_panelRow"]',
75
+ panelTitle: '[class*="_panelTitle"]',
76
+ /** The `Menu` host element wrapping the "More" anchor: our toggle's parent. */
77
+ moreAnchor: '[class*="_moreAnchor"]',
78
+ /** Sidebar root modifier present exactly while the column is a narrow rail. */
79
+ collapsed: '[class*="_collapsed"]',
80
+ /**
81
+ * Per-row wrapper shipped from the 0.2.2 line on (`div._panelEntry`): the row
82
+ * button is its child, and it carries the host's own row fill. Hiding only the
83
+ * button there leaves an empty entry (plus its pin control) behind, so the fold
84
+ * mark has to land on this wrapper when it exists.
85
+ */
86
+ panelEntry: 'div[class*="_panelEntry"]',
87
+ /** The host's own "unpin" control inside a row — rendered at the wide width only. */
88
+ panelUnpin: 'button[class*="_panelUnpin"]',
89
+ /** The "pin back" control inside the portalled "More" list (0.2.2 on). */
90
+ pinButton: 'button[class*="_pinButton"]',
91
+ })
92
+
93
+ /** `localStorage` key for the open/closed state (window-level UI state, by design). */
94
+ export const STORAGE_KEY = `${PKG_NAME}.v1.folded`
95
+
96
+ /** Accessible-name strings of the shipped "More" row (`client.js:528-544` zh/en dictionaries). */
97
+ export const MORE_LABELS = Object.freeze(['更多', 'More'])
98
+
99
+ /** Accessible-name strings of the "Global panels" nav label (`client.js:533`). */
100
+ export const PANELS_LABELS = Object.freeze(['全局面板', 'Global panels'])
101
+
102
+ /**
103
+ * The host's own fixed panel row — `FIXED_PANEL_ID = 'plugins'` in the 0.2.2
104
+ * sidebar (`SidebarRoot.tsx`: `canUnpin = hasEntryActions && id !== FIXED_PANEL_ID`).
105
+ *
106
+ * It is the one entry the host never unpins, so offering “hide in More” for it
107
+ * would be a promise the host silently refuses. The names are the only handle we
108
+ * have: the id never reaches the DOM.
109
+ */
110
+ export const FIXED_LABELS = Object.freeze(['插件', 'Plugins'])
111
+
112
+ /** Self-drawn chevron geometry: the host `primitives` package is off-limits to plugins. */
113
+ export const ICON_PATH = Object.freeze({
114
+ up: 'M3.5 10 8 5.5 12.5 10',
115
+ down: 'M3.5 6 8 10.5 12.5 6',
116
+ })
117
+
118
+ /** Measured host geometry this plugin matches instead of inventing (findings §2.6). */
119
+ export const TOGGLE_PX = 28
120
+ export const ICON_PX = 16
121
+
122
+ /** The CSS this plugin injects. Tokens are host-public aliases only; the anchor
123
+ * override keeps the row's height so the portal menu's anchor box is unchanged.
124
+ *
125
+ * Every rule is one joined string built from an explicit declaration list — the
126
+ * first smoke run shipped a sheet whose declarations ran together (no `;`),
127
+ * so `transform`/`cursor`/`padding` were all dropped and the toggle sat 14px low.
128
+ * Declarations are joined here, never by string concatenation across lines. */
129
+ const rule = (selector: string, declarations: string[]): string =>
130
+ `${selector}{${declarations.join(';')}}`
131
+
132
+ export const SHEET = [
133
+ // The header keeps `position:relative` so the toggle (a sibling inside the
134
+ // Menu's anchor span) is positioned against the row, not the span.
135
+ //
136
+ // Its horizontal padding is per alignment: at `start` the toggle sits on the
137
+ // right and needs a gutter; at `center` the gutter would push the labeled pair
138
+ // off-centre (measured +19px), so the padding has to be symmetric; at `end` the
139
+ // toggle mirrors to the left and the gutter moves with it. `padding-top/bottom`
140
+ // from the host (`7px 8px`) is untouched by these longhands.
141
+ rule(`[${ATTR.header}]`, ['position:relative']),
142
+ rule(`[${ATTR.align}="start"] [${ATTR.header}]`, [`padding-right:${TOGGLE_PX + 10}px`]),
143
+ rule(`[${ATTR.align}="center"] [${ATTR.header}]`, ['padding-left:8px', 'padding-right:8px']),
144
+ rule(`[${ATTR.align}="end"] [${ATTR.header}]`, [`padding-left:${TOGGLE_PX + 10}px`, 'padding-right:8px']),
145
+ rule(`[${ATTR.align}="end"] .${CLS.toggle}`, ['left:4px', 'right:auto']),
146
+ // Row-content alignment. The whitespace after `:` is deliberate — a bare
147
+ // `center!important` is a parse error in some engines and silently dropped.
148
+ rule(`[${ATTR.align}="center"] ${SEL.panelRow}`, ['justify-content: center !important']),
149
+ rule(`[${ATTR.align}="end"] ${SEL.panelRow}`, ['justify-content: flex-end !important']),
150
+ // 0.2.2 reserves the row's right gutter for its own pin control (host rule:
151
+ // `.panelEntryWide .panelRow { padding-right: 38px }`). That gutter is real for
152
+ // `start`/`end`, but at `center` it pushes the labelled pair off-centre, so the
153
+ // gutter is folded back into the row's shipped inset there. This selector is
154
+ // more specific than the host rule, so no `!important` is needed.
155
+ rule(`[${ATTR.align}="center"] ${SEL.panelEntry} ${SEL.panelRow}`, [
156
+ 'padding-right: calc(var(--dsh-sidebar-row-padding, 12px) - var(--dsh-sidebar-paint-inset, 3px))',
157
+ ]),
158
+ rule(`.${CLS.toggle}`, [
159
+ 'position:absolute',
160
+ 'right:4px',
161
+ 'top:50%',
162
+ 'transform:translateY(-50%)',
163
+ 'box-sizing:border-box',
164
+ `width:${TOGGLE_PX}px`,
165
+ `height:${TOGGLE_PX}px`,
166
+ 'border:0',
167
+ 'padding:0',
168
+ 'display:inline-flex',
169
+ 'align-items:center',
170
+ 'justify-content:center',
171
+ 'border-radius:var(--dsw-radius-sm,6px)',
172
+ 'background:transparent',
173
+ 'color:var(--dsw-alias-label-secondary,currentColor)',
174
+ 'cursor:pointer',
175
+ '-webkit-app-region:no-drag',
176
+ ]),
177
+ rule(`.${CLS.toggle}:hover`, ['background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.16))']),
178
+ rule(`.${CLS.toggleIdle}`, ['opacity:.45', 'cursor:default']),
179
+ rule(`.${CLS.toggleIdle}:hover`, ['background:transparent']),
180
+ // Folded, but the panel being looked at is one of the folded rows: a 5px dot
181
+ // says “what you are reading is inside here”, which a bare chevron cannot.
182
+ rule(`.${CLS.toggle}[${ATTR.activeInside}]::after`, [
183
+ 'content:""',
184
+ 'position:absolute',
185
+ 'top:4px',
186
+ 'right:4px',
187
+ 'width:5px',
188
+ 'height:5px',
189
+ 'border-radius:50%',
190
+ 'background:var(--dsw-alias-accent,var(--dsw-alias-state-business-primary,#4d6bfe))',
191
+ ]),
192
+ rule(`.${CLS.toggle}:focus-visible`, [
193
+ 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
194
+ 'outline-offset:-2px',
195
+ ]),
196
+ rule(`.${CLS.icon}`, ['display:inline-flex', 'align-items:center', 'justify-content:center']),
197
+ rule(`[${ATTR.state}="folded"] [${ATTR.folded}]`, ['display:none']),
198
+ // Settings card (bundle detail page): spacing only, colours come from tokens.
199
+ rule(`.${CLS.card}`, ['display:flex', 'flex-direction:column', 'gap:12px', 'min-width:0']),
200
+ rule(`.${CLS.cardHost}`, ['display:block', 'min-width:0', 'width:100%']),
201
+ rule(`.${CLS.row}`, ['display:flex', 'align-items:flex-start', 'justify-content:space-between', 'gap:16px']),
202
+ rule(`.${CLS.rowMain}`, ['display:flex', 'flex-direction:column', 'gap:2px', 'min-width:0']),
203
+ rule(`.${CLS.label}`, ['font-size:13px', 'line-height:20px']),
204
+ rule(`.${CLS.hint}`, ['font-size:12px', 'line-height:16px', 'opacity:.72']),
205
+ rule(`.${CLS.control}`, [
206
+ 'box-sizing:border-box',
207
+ 'flex:none',
208
+ 'font:inherit',
209
+ 'font-size:13px',
210
+ 'padding:4px 8px',
211
+ 'border-radius:8px',
212
+ 'border:.5px solid var(--dsw-alias-border-l3,rgba(127,127,127,.35))',
213
+ 'background:var(--dsw-specific-input-major,transparent)',
214
+ 'color:inherit',
215
+ 'max-width:280px',
216
+ ]),
217
+ rule(`.${CLS.control}[type="checkbox"]`, ['width:16px', 'height:16px', 'margin-top:3px']),
218
+ // Pill switch (the shape this plugin family uses for on/off rows): the track is
219
+ // 36×20, the knob 16px, and the whole thing is a real button with role="switch".
220
+ rule(`.${CLS.switch}`, [
221
+ 'position:relative',
222
+ 'display:inline-block',
223
+ 'flex:none',
224
+ 'box-sizing:border-box',
225
+ 'width:36px',
226
+ 'height:20px',
227
+ 'margin-top:2px',
228
+ 'border:0',
229
+ 'padding:0',
230
+ 'border-radius:999px',
231
+ 'background:var(--dsw-alias-border-l3,rgba(127,127,127,.35))',
232
+ 'cursor:pointer',
233
+ 'transition:background .15s ease',
234
+ ]),
235
+ rule(`.${CLS.switch}[aria-checked="true"]`, ['background:var(--dsw-alias-state-business-primary,#4d6bfe)']),
236
+ rule(`.${CLS.switch}[disabled]`, ['opacity:.5', 'cursor:default']),
237
+ rule(`.${CLS.switch}:focus-visible`, [
238
+ 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
239
+ 'outline-offset:2px',
240
+ ]),
241
+ rule(`.${CLS.switchKnob}`, [
242
+ 'position:absolute',
243
+ 'top:2px',
244
+ 'left:2px',
245
+ 'width:16px',
246
+ 'height:16px',
247
+ 'border-radius:50%',
248
+ 'background:#fff',
249
+ 'box-shadow:0 1px 2px rgba(0,0,0,.2)',
250
+ 'transition:transform .15s ease',
251
+ 'pointer-events:none',
252
+ ]),
253
+ rule(`.${CLS.switch}[aria-checked="true"] .${CLS.switchKnob}`, ['transform:translateX(16px)']),
254
+ // Segmented control (three-state alignment): a track holding one button per
255
+ // option, the chosen one raised. Same family shape as the pill switch above.
256
+ rule(`.${CLS.segmentGroup}`, [
257
+ 'display:inline-flex',
258
+ 'flex:none',
259
+ 'gap:2px',
260
+ 'padding:2px',
261
+ 'border-radius:9px',
262
+ 'background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.12))',
263
+ ]),
264
+ rule(`.${CLS.segment}`, [
265
+ 'border:0',
266
+ 'background:transparent',
267
+ 'border-radius:7px',
268
+ 'padding:3px 10px',
269
+ 'font:inherit',
270
+ 'font-size:12px',
271
+ 'line-height:16px',
272
+ 'color:var(--dsw-alias-label-secondary,inherit)',
273
+ 'cursor:pointer',
274
+ ]),
275
+ rule(`.${CLS.segment}[aria-checked="true"]`, [
276
+ 'background:var(--dsw-alias-bg-layer-1,#fff)',
277
+ 'color:var(--dsw-alias-label-primary,inherit)',
278
+ 'box-shadow:0 1px 2px rgba(0,0,0,.12)',
279
+ ]),
280
+ rule(`.${CLS.segment}[disabled]`, ['opacity:.5', 'cursor:default']),
281
+ rule(`.${CLS.segment}:focus-visible`, [
282
+ 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
283
+ 'outline-offset:1px',
284
+ ]),
285
+ // "More" menu shortcut row. The host's own action rows live in that list behind
286
+ // their own hairline; a list seat can only append, so this row carries the
287
+ // hairline itself and closes the action group.
288
+ rule(`.${CLS.menuGroup}`, [
289
+ 'margin-top:6px',
290
+ 'padding-top:6px',
291
+ 'border-top:1px solid var(--dsw-alias-hairline,rgba(127,127,127,.22))',
292
+ ]),
293
+ rule(`.${CLS.menuRow}`, [
294
+ 'box-sizing:border-box',
295
+ 'display:flex',
296
+ 'align-items:center',
297
+ 'gap:8px',
298
+ 'width:100%',
299
+ 'height:32px',
300
+ 'margin:0',
301
+ 'padding:0 10px',
302
+ 'border:0',
303
+ 'border-radius:var(--dsw-radius-md,8px)',
304
+ 'background:transparent',
305
+ 'font:inherit',
306
+ 'font-size:13px',
307
+ 'color:var(--dsw-alias-label-primary,inherit)',
308
+ 'text-align:left',
309
+ 'cursor:pointer',
310
+ '-webkit-app-region:no-drag',
311
+ ]),
312
+ rule(`.${CLS.menuRow}:hover`, ['background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.16))']),
313
+ rule(`.${CLS.menuRow}:focus-visible`, [
314
+ 'outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#666))',
315
+ 'outline-offset:-2px',
316
+ ]),
317
+ rule(`.${CLS.menuText}`, ['overflow:hidden', 'text-overflow:ellipsis', 'white-space:nowrap']),
318
+ rule(`.${CLS.menuIcon}`, ['flex:none', 'display:block']),
319
+ ].join('')