@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/lib/assets/mermaid.min.js +3587 -0
- package/lib/client.js +11 -11
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
- package/src/client/DockItem.tsx +1 -1
- package/src/client/components/ExplorerPanel.tsx +1 -1
- package/src/client/components/ScmPanel.tsx +4 -4
- package/src/client/layout.ts +2 -2
- package/src/client/preview/content.tsx +1 -1
- package/src/client/styles/chip.module.css +2 -2
- package/src/client/styles/tokens.module.css +29 -70
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.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
package/src/client/DockItem.tsx
CHANGED
|
@@ -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
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
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(--
|
|
362
|
+
<span style={{ fontSize: 13, color: 'var(--dsw-alias-label-primary)' }}>{label}</span>
|
|
363
363
|
</div>
|
|
364
364
|
{expanded &&
|
|
365
365
|
rows.map((row) => (
|
package/src/client/layout.ts
CHANGED
|
@@ -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(--
|
|
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(--
|
|
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
|
|
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
|
|
33
|
-
font-family: var(--aion-font-mono
|
|
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
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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:
|
|
19
|
-
--aion-bg-1:
|
|
20
|
-
--aion-bg-2:
|
|
21
|
-
--aion-bg-3:
|
|
22
|
-
--aion-bg-
|
|
23
|
-
--aion-bg-
|
|
24
|
-
--aion-
|
|
25
|
-
--aion-text-
|
|
26
|
-
--aion-text-
|
|
27
|
-
--aion-text-
|
|
28
|
-
--aion-
|
|
29
|
-
--aion-
|
|
30
|
-
--aion-
|
|
31
|
-
--aion-
|
|
32
|
-
--aion-
|
|
33
|
-
--aion-
|
|
34
|
-
--aion-aou-2:
|
|
35
|
-
--aion-aou-
|
|
36
|
-
--aion-
|
|
37
|
-
--aion-
|
|
38
|
-
--aion-
|
|
39
|
-
--aion-
|
|
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:
|
|
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
|
|
67
|
+
background: var(--aion-bg-4);
|
|
109
68
|
}
|
|
110
69
|
:global(.filemgr-root ::-webkit-scrollbar-track) {
|
|
111
70
|
background: transparent;
|