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

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lijian-ui/dsh-file-manager",
3
3
  "description": "DSH web GUI right-panel system: a pixel-faithful re-implementation of FileManager's Explorer + Preview columns (file tree, filename search, git changes, multi-tab preview of 10+ formats) driven by real host-side fs/git services, hot-pluggable via a profile bundle without any dsh source changes",
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
@@ -14,7 +14,7 @@ function ensureStyle(): void {
14
14
  if (document.getElementById(STYLE_ID) !== null) return
15
15
  const tag = document.createElement('style')
16
16
  tag.id = STYLE_ID
17
- tag.textContent = '.dsh-dock-item{width:32px;height:32px;border:none;border-radius:9999px;background:#000;color:#fff;cursor:pointer;position:relative;transition:transform .15s ease,background .18s ease;display:inline-flex;align-items:center;justify-content:center}.dsh-dock-item:hover{transform:scale(1.15);background:#1a1a1a}.dsh-dock-item-active{background:var(--aion-primary,#6ea0ff)}.dsh-dock-tooltip{position:absolute;top:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:2px 8px;font-size:12px;line-height:1.4;white-space:nowrap;color:#fff;background:rgba(20,20,30,.9);border:1px solid rgba(255,255,255,.12);border-radius:6px;opacity:0;pointer-events:none;transition:opacity .15s}.dsh-dock-item:hover .dsh-dock-tooltip{opacity:1}'
17
+ tag.textContent = '.dsh-dock-item{width:32px;height:32px;border:none;border-radius:9999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);cursor:pointer;position:relative;transition:transform .15s ease,background .18s ease;display:inline-flex;align-items:center;justify-content:center}.dsh-dock-item:hover{transform:scale(1.15);background:var(--dsw-alias-interactive-bg-hover)}.dsh-dock-item-active{background:var(--dsw-alias-state-business-primary)}.dsh-dock-tooltip{position:absolute;top:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:2px 8px;font-size:12px;line-height:1.4;white-space:nowrap;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;opacity:0;pointer-events:none;transition:opacity .15s}.dsh-dock-item:hover .dsh-dock-tooltip{opacity:1}'
18
18
  document.head.appendChild(tag)
19
19
  }
20
20
 
@@ -267,7 +267,7 @@ function SearchArea({
267
267
  <div className={explorerCss.searchArea}>
268
268
  <div
269
269
  className={`${explorerCss.searchBox}${searchFocus ? ` ${explorerCss.searchAreaFocus}` : ''}`}
270
- style={{ borderColor: searchFocus ? 'var(--aion-primary)' : undefined }}
270
+ style={{ borderColor: searchFocus ? 'var(--dsw-alias-state-business-primary)' : undefined }}
271
271
  >
272
272
  <span className={explorerCss.searchIcon}><SearchIcon size={14} /></span>
273
273
  <input
@@ -130,7 +130,7 @@ export function ScmPanel({ stores }: { stores: PanelStores }): JSX.Element {
130
130
  </span>
131
131
  <span className={scmCss.sectionTitle}>{t('scm.changes')}</span>
132
132
  {status.branch !== '' && (
133
- <span className={scmCss.branchName} style={{ fontSize: 11, color: 'var(--aion-text-tertiary)', display: 'flex', alignItems: 'center', gap: 4 }}>
133
+ <span className={scmCss.branchName} style={{ fontSize: 11, color: 'var(--dsw-alias-label-tertiary)', display: 'flex', alignItems: 'center', gap: 4 }}>
134
134
  <BranchIcon size={12} />
135
135
  {status.branch}
136
136
  </span>
@@ -161,7 +161,7 @@ export function ScmPanel({ stores }: { stores: PanelStores }): JSX.Element {
161
161
  type="button"
162
162
  className={scmCss.sectionAction}
163
163
  title={t('scm.viewList')}
164
- style={{ color: state.viewMode === 'list' ? 'var(--aion-brand)' : undefined }}
164
+ style={{ color: state.viewMode === 'list' ? 'var(--dsw-alias-brand-primary)' : undefined }}
165
165
  onClick={() => scm.setViewMode('list')}
166
166
  >
167
167
  <ListIcon size={13} />
@@ -170,7 +170,7 @@ export function ScmPanel({ stores }: { stores: PanelStores }): JSX.Element {
170
170
  type="button"
171
171
  className={scmCss.sectionAction}
172
172
  title={t('scm.viewTree')}
173
- style={{ color: state.viewMode === 'tree' ? 'var(--aion-brand)' : undefined }}
173
+ style={{ color: state.viewMode === 'tree' ? 'var(--dsw-alias-brand-primary)' : undefined }}
174
174
  onClick={() => scm.setViewMode('tree')}
175
175
  >
176
176
  <TreeIcon size={13} />
@@ -359,7 +359,7 @@ function DirNode({
359
359
  <ChevronRightIcon size={13} />
360
360
  </span>
361
361
  <FileTypeIcon name={label} isDir expanded={expanded} />
362
- <span style={{ fontSize: 13, color: 'var(--aion-text-primary)' }}>{label}</span>
362
+ <span style={{ fontSize: 13, color: 'var(--dsw-alias-label-primary)' }}>{label}</span>
363
363
  </div>
364
364
  {expanded &&
365
365
  rows.map((row) => (
@@ -165,7 +165,7 @@ export class PanelLayoutController {
165
165
  previewCol.style.overflow = 'hidden'
166
166
  previewCol.style.display = 'flex'
167
167
  previewCol.style.flexDirection = 'column'
168
- previewCol.style.borderLeft = '1px solid var(--aion-bg-3, #e5e6eb)'
168
+ previewCol.style.borderLeft = '1px solid var(--dsw-alias-bg-layer-3)'
169
169
 
170
170
  const explorerCol = document.createElement('div')
171
171
  explorerCol.dataset.filemgrExplorerCol = ''
@@ -174,7 +174,7 @@ export class PanelLayoutController {
174
174
  explorerCol.style.overflow = 'hidden'
175
175
  explorerCol.style.display = 'flex'
176
176
  explorerCol.style.flexDirection = 'column'
177
- explorerCol.style.borderLeft = '1px solid var(--aion-bg-3, #e5e6eb)'
177
+ explorerCol.style.borderLeft = '1px solid var(--dsw-alias-bg-layer-3)'
178
178
 
179
179
  frame.appendChild(previewCol)
180
180
  frame.appendChild(explorerCol)
@@ -246,7 +246,7 @@ function HtmlViewer({
246
246
  }): JSX.Element {
247
247
  const srcDoc = useMemo(() => {
248
248
  // Base styles so the embedded page inherits the theme background.
249
- return `<!doctype html><html><head><meta charset="utf-8"><style>body{margin:0;font-family:-apple-system,"system-ui","Segoe UI",Roboto,"PingFang SC",sans-serif;color:#1d2129}@media (prefers-color-scheme:dark){body{color:rgba(255,255,255,0.9)}}</style></head><body>${content}</body></html>`
249
+ return `<!doctype html><html><head><meta charset="utf-8"><style>body{margin:0;font-family:-apple-system,"system-ui","Segoe UI",Roboto,"PingFang SC",sans-serif;color:var(--dsw-alias-label-primary)}@media (prefers-color-scheme:dark){body{color:var(--dsw-alias-label-secondary)}}</style></head><body>${content}</body></html>`
250
250
  }, [content])
251
251
  if (sourceMode && onContentChange !== undefined) {
252
252
  return (
@@ -29,8 +29,8 @@
29
29
  the shell, so this never shifts the placeholder advance). */
30
30
  :global([data-decoration="chip"] > span::before) {
31
31
  content: "</>";
32
- color: var(--aion-success, #16a34a);
33
- font-family: var(--aion-font-mono, ui-monospace, Menlo, Consolas, monospace);
32
+ color: var(--aion-success);
33
+ font-family: var(--aion-font-mono);
34
34
  font-size: 0.85em;
35
35
  font-weight: 700;
36
36
  margin-right: 4px;
@@ -1,83 +1,42 @@
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
8
  * The two rules at the top are intentionally GLOBAL (hence the :global()
9
9
  * wrapper): the token variables must be readable by DOM-created chrome — the
10
10
  * panel columns and drag handles are appended by the layout controller outside
11
11
  * any React subtree — so they live on :root. Every other rule below is still
12
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.
16
13
  */
17
14
  :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);
15
+ --aion-bg-base: var(--dsw-alias-bg-base);
16
+ --aion-bg-1: var(--dsw-alias-bg-layer-1);
17
+ --aion-bg-2: var(--dsw-alias-bg-layer-2);
18
+ --aion-bg-3: var(--dsw-alias-bg-layer-3);
19
+ --aion-bg-4: var(--dsw-alias-label-dimmed);
20
+ --aion-bg-hover: var(--dsw-alias-interactive-bg-hover);
21
+ --aion-bg-active: var(--dsw-alias-interactive-bg-active);
22
+ --aion-text-primary: var(--dsw-alias-label-primary);
23
+ --aion-text-secondary: var(--dsw-alias-label-secondary);
24
+ --aion-text-tertiary: var(--dsw-alias-label-tertiary);
25
+ --aion-text-disabled: var(--dsw-alias-label-dimmed);
26
+ --aion-primary: var(--dsw-alias-state-business-primary);
27
+ --aion-success: var(--dsw-alias-state-success-primary);
28
+ --aion-warning: var(--dsw-alias-state-warn-primary);
29
+ --aion-danger: var(--dsw-alias-state-error-primary);
30
+ --aion-brand: var(--dsw-alias-brand-primary);
31
+ --aion-aou-2: var(--dsw-alias-bg-layer-2);
32
+ --aion-aou-6: var(--dsw-alias-brand-primary);
33
+ --aion-fill-2: var(--dsw-alias-interactive-bg-hover);
34
+ --aion-fill-3: var(--dsw-alias-interactive-bg-hover-solid);
35
+ --aion-border-base: var(--dsw-alias-border-l2);
36
+ --aion-overlay-shadow: var(--dsw-shadow-lv2);
43
37
  --aion-font-sans: -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue",
44
38
  "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;
39
+ --aion-font-mono: var(--dsw-alias-font-family-mono);
81
40
  }
82
41
 
83
42
 
@@ -105,7 +64,7 @@
105
64
  border-radius: 4px;
106
65
  }
107
66
  :global(.filemgr-root ::-webkit-scrollbar-thumb:hover) {
108
- background: var(--aion-bg-4, #c9cdd4);
67
+ background: var(--aion-bg-4);
109
68
  }
110
69
  :global(.filemgr-root ::-webkit-scrollbar-track) {
111
70
  background: transparent;