@lijian-ui/dsh-file-manager 0.2.1 → 0.2.3

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.
@@ -1,83 +1,44 @@
1
1
  /**
2
- * The panel design system: FileManager's measured tokens (light/dark), scoped to
3
- * the plugin's own root elements so they never leak into the shell. Light
4
- * values are the defaults; the controller flips `data-filemgr-dark` on every
5
- * root element when the GUI theme is dark (the shell's theme service emits
6
- * theme/change; the controller mirrors it).
2
+ * The panel design system: FileManager's tokens, scoped to the plugin's own
3
+ * root elements so they never leak into the shell. The `--aion-*` names are
4
+ * kept as an alias layer that forwards to the official `--dsw-*` token system
5
+ * dark-mode adaptation is handled by `--dsw-*` itself, so no per-theme
6
+ * override block is needed.
7
7
  *
8
- * The two rules at the top are intentionally GLOBAL (hence the :global()
9
- * wrapper): the token variables must be readable by DOM-created chrome the
10
- * panel columns and drag handles are appended by the layout controller outside
11
- * any React subtree so they live on :root. Every other rule below is still
12
- * scoped to `.filemgr-root` / the plugin's own class names.
13
- *
14
- * Values are the browser-measured ones from the research report (section 5.2)
15
- * — including the aou ramp reversal in dark mode and the missing --bg-7.
8
+ * Scoped to BODY, not :root: since the official theme rc.2 the `--dsw-*`
9
+ * semantic tokens live on `body` (not html), so an alias defined at :root
10
+ * would substitute var() against an undefined name and compute to the
11
+ * guaranteed-invalid value (""), killing every background that consumes it.
12
+ * On body the dsw tokens resolve and the aliases inherit to all visible
13
+ * elements — including the DOM-created chrome (panel columns, drag handles,
14
+ * the '@' picker portal) appended outside any React subtree.
16
15
  */
17
- :global(:root) {
18
- --aion-bg-base: #ffffff;
19
- --aion-bg-1: #f9fafb;
20
- --aion-bg-2: #f2f3f5;
21
- --aion-bg-3: #e5e6eb;
22
- --aion-bg-hover: #f3f4f6;
23
- --aion-bg-active: #e5e6eb;
24
- --aion-text-primary: #000000;
25
- --aion-text-secondary: #454d5f;
26
- --aion-text-tertiary: #86909c;
27
- --aion-text-disabled: #c9cdd4;
28
- --aion-primary: #165dff;
29
- --aion-success: #00b42a;
30
- --aion-warning: #ff7d00;
31
- --aion-danger: #f53f3f;
32
- --aion-brand: #7583b2;
33
- --aion-aou-1: #eff0f6;
34
- --aion-aou-2: #e5e7f0;
35
- --aion-aou-3: #d1d5e5;
36
- --aion-aou-4: #b5bcd6;
37
- --aion-aou-5: #97a0c5;
38
- --aion-aou-6: #7583b2;
39
- --aion-fill-2: #f2f3f5;
40
- --aion-fill-3: #e5e6eb;
41
- --aion-border-base: #e5e6eb;
42
- --aion-overlay-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
43
- --aion-font-sans: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue",
44
- "PingFang SC", "Microsoft YaHei", sans-serif;
45
- --aion-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
46
- "Liberation Mono", monospace;
47
- }
48
-
49
- /* The shell marks dark mode with body[data-ds-dark-theme]; the panel tokens
50
- follow it with zero JS wiring (the theme service toggles the attribute).
51
- Scoped to body so third-party themes cannot override them from :root.
52
- Global by intent (tokens reach the DOM-added columns/handles); the dark
53
- color-scheme is only asserted here so the host's own light default wins. */
54
- :global(body[data-ds-dark-theme]) {
55
- --aion-bg-base: #0e0e0e;
56
- --aion-bg-1: #1a1a1a;
57
- --aion-bg-2: #262626;
58
- --aion-bg-3: #333333;
59
- --aion-bg-hover: #1f1f1f;
60
- --aion-bg-active: #2d2d2d;
61
- --aion-text-primary: #ffffff;
62
- --aion-text-secondary: #ced3da;
63
- --aion-text-tertiary: #737373;
64
- --aion-text-disabled: #737373;
65
- --aion-primary: #4d9fff;
66
- --aion-success: #23c343;
67
- --aion-warning: #ff9a2e;
68
- --aion-danger: #f76560;
69
- --aion-brand: #a1aacb;
70
- --aion-aou-1: #2a2a2a;
71
- --aion-aou-2: #3d4150;
72
- --aion-aou-3: #525a77;
73
- --aion-aou-4: #6a749b;
74
- --aion-aou-5: #838fba;
75
- --aion-aou-6: #a1aacb;
76
- --aion-fill-2: rgba(255, 255, 255, 0.08);
77
- --aion-fill-3: rgba(255, 255, 255, 0.12);
78
- --aion-border-base: #333333;
79
- --aion-overlay-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
80
- color-scheme: dark;
16
+ :global(body) {
17
+ --aion-bg-base: var(--dsw-alias-bg-base);
18
+ --aion-bg-1: var(--dsw-alias-bg-layer-1);
19
+ --aion-bg-2: var(--dsw-alias-bg-layer-2);
20
+ --aion-bg-3: var(--dsw-alias-bg-layer-3);
21
+ --aion-bg-4: var(--dsw-alias-label-dimmed);
22
+ --aion-bg-hover: var(--dsw-alias-interactive-bg-hover);
23
+ --aion-bg-active: var(--dsw-alias-interactive-bg-active);
24
+ --aion-text-primary: var(--dsw-alias-label-primary);
25
+ --aion-text-secondary: var(--dsw-alias-label-secondary);
26
+ --aion-text-tertiary: var(--dsw-alias-label-tertiary);
27
+ --aion-text-disabled: var(--dsw-alias-label-dimmed);
28
+ --aion-primary: var(--dsw-alias-state-business-primary);
29
+ --aion-success: var(--dsw-alias-state-success-primary);
30
+ --aion-warning: var(--dsw-alias-state-warn-primary);
31
+ --aion-danger: var(--dsw-alias-state-error-primary);
32
+ --aion-brand: var(--dsw-alias-brand-primary);
33
+ --aion-aou-2: var(--dsw-alias-bg-layer-2);
34
+ --aion-aou-6: var(--dsw-alias-brand-primary);
35
+ --aion-fill-2: var(--dsw-alias-interactive-bg-hover);
36
+ --aion-fill-3: var(--dsw-alias-interactive-bg-hover-solid);
37
+ --aion-border-base: var(--dsw-alias-border-l2);
38
+ --aion-overlay-shadow: var(--dsw-shadow-lv2);
39
+ /* 官方字体 token;mono 用本地栈 —— 当前主题版本尚无 --dsw-alias-font-family-mono */
40
+ --aion-font-sans: var(--dsw-font-family);
41
+ --aion-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
81
42
  }
82
43
 
83
44
 
@@ -105,7 +66,7 @@
105
66
  border-radius: 4px;
106
67
  }
107
68
  :global(.filemgr-root ::-webkit-scrollbar-thumb:hover) {
108
- background: var(--aion-bg-4, #c9cdd4);
69
+ background: var(--aion-bg-4);
109
70
  }
110
71
  :global(.filemgr-root ::-webkit-scrollbar-track) {
111
72
  background: transparent;
@@ -242,7 +203,7 @@
242
203
  display: flex;
243
204
  align-items: center;
244
205
  justify-content: center;
245
- background: rgba(0, 0, 0, 0.35);
206
+ background: var(--dsw-alias-bg-mask-1);
246
207
  }
247
208
  :global(.filemgr-dialog) {
248
209
  width: 400px;
@@ -293,28 +254,30 @@
293
254
  outline-offset: 2px;
294
255
  }
295
256
  :global(.filemgr-btn-primary) {
296
- background: var(--aion-primary);
297
- border-color: var(--aion-primary);
298
- color: #ffffff;
257
+ background: var(--dsw-alias-button-primary-fill);
258
+ border-color: var(--dsw-alias-button-primary-fill);
259
+ color: var(--dsw-alias-label-primary-foreground);
299
260
  }
300
261
  :global(.filemgr-btn-primary:hover) {
301
- background: var(--aion-primary);
302
- opacity: 0.9;
262
+ background: var(--dsw-alias-button-primary-hover);
263
+ border-color: var(--dsw-alias-button-primary-hover);
303
264
  }
304
265
  :global(.filemgr-btn-primary:active) {
305
- opacity: 0.75;
306
- filter: saturate(0.9);
266
+ background: var(--dsw-alias-button-primary-hover);
267
+ border-color: var(--dsw-alias-button-primary-hover);
307
268
  }
308
269
  :global(.filemgr-btn-danger) {
309
270
  background: var(--aion-danger);
310
271
  border-color: var(--aion-danger);
311
- color: #ffffff;
272
+ color: var(--dsw-alias-label-primary-foreground);
312
273
  }
313
274
  :global(.filemgr-btn-danger:hover) {
314
- opacity: 0.9;
275
+ background: color-mix(in srgb, var(--aion-danger) 88%, black);
276
+ border-color: color-mix(in srgb, var(--aion-danger) 88%, black);
315
277
  }
316
278
  :global(.filemgr-btn-danger:active) {
317
- opacity: 0.75;
279
+ background: color-mix(in srgb, var(--aion-danger) 78%, black);
280
+ border-color: color-mix(in srgb, var(--aion-danger) 78%, black);
318
281
  }
319
282
 
320
283
  /* Context menu (tab right-click / tree right-click). */
@@ -1,38 +0,0 @@
1
- /**
2
- * Global restyle of the shell's reference chips to the file-reference look
3
- * (the user's screenshot): a muted rounded pill with a green `</>` code
4
- * glyph. The shell renders every U+FFFC chip with `data-decoration="chip"`
5
- * (InputBar), so this file overrides its default blue tint through that
6
- * attribute — the hash-scoped `.chip` class stays untouched and alignment
7
- * (the U+FFFC advance cell) is preserved because the glyph comes from the
8
- * label cell's ::before, not the placeholder cell's.
9
- *
10
- * Side effect: chips of other sources (skills, subagents) pick up the same
11
- * pill look — a uniform, muted family, which the shell's default blue
12
- * already intended.
13
- * @module dsh-filemgr/client/styles/chip
14
- */
15
-
16
- :global([data-decoration="chip"]) {
17
- background: rgba(15, 23, 42, 0.06);
18
- border-radius: 6px;
19
- }
20
-
21
- :global(body[data-ds-dark-theme] [data-decoration="chip"]) {
22
- background: rgba(255, 255, 255, 0.1);
23
- }
24
-
25
- /* The label cell keeps the shell's default 0.72 compensated scale (no
26
- override here) — the pill text renders at the composer's native size. */
27
-
28
- /* The green `</>` glyph, drawn inside the label cell (absolute-positioned by
29
- the shell, so this never shifts the placeholder advance). */
30
- :global([data-decoration="chip"] > span::before) {
31
- content: "</>";
32
- color: var(--aion-success, #16a34a);
33
- font-family: var(--aion-font-mono, ui-monospace, Menlo, Consolas, monospace);
34
- font-size: 0.85em;
35
- font-weight: 700;
36
- margin-right: 4px;
37
- letter-spacing: -0.5px;
38
- }