@lijian-ui/dsh-file-manager 0.2.0 → 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 +321 -278
- package/lib/client.js.map +1 -1
- package/lib/tsconfig.client.tsbuildinfo +1 -1
- package/lib/types/client/FilePanelDockItem.d.ts.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +21 -0
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/mount.d.ts +2 -1
- package/lib/types/client/mount.d.ts.map +1 -1
- package/lib/types/client/picker/FilePickerModal.d.ts.map +1 -1
- package/lib/types/client/store.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/DockItem.tsx +1 -1
- package/src/client/FilePanelDockItem.tsx +2 -1
- package/src/client/components/ExplorerPanel.tsx +1 -1
- package/src/client/components/ScmPanel.tsx +4 -4
- package/src/client/index.ts +8 -2
- package/src/client/layout.ts +2 -2
- package/src/client/locales.ts +46 -0
- package/src/client/mount.tsx +18 -2
- package/src/client/picker/FilePickerModal.tsx +15 -14
- package/src/client/preview/PreviewPanel.tsx +1 -1
- package/src/client/preview/content.tsx +1 -1
- package/src/client/store.ts +2 -1
- package/src/client/styles/chip.module.css +2 -2
- package/src/client/styles/tokens.module.css +29 -70
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* failure degrades the panels, never the GUI boot.
|
|
6
6
|
* @module dsh-filemgr/client/mount
|
|
7
7
|
*/
|
|
8
|
+
import type { LocaleFace } from '@deepseek-ai/dsh-client-ui-slots';
|
|
8
9
|
import type { PanelStores } from './store.ts';
|
|
9
10
|
import type { FileReferenceSelection } from './preview/selection.ts';
|
|
10
11
|
/**
|
|
@@ -18,5 +19,5 @@ import type { FileReferenceSelection } from './preview/selection.ts';
|
|
|
18
19
|
* a preview selection (path + start/end line).
|
|
19
20
|
* @returns a disposer unmounting both trees.
|
|
20
21
|
*/
|
|
21
|
-
export declare function mountPanels(stores: PanelStores, onToggleExplorer: () => void, onReference: (path: string, isDir: boolean) => void, onAddFileReference: (selection: FileReferenceSelection) => boolean): () => void;
|
|
22
|
+
export declare function mountPanels(stores: PanelStores, onToggleExplorer: () => void, onReference: (path: string, isDir: boolean) => void, onAddFileReference: (selection: FileReferenceSelection) => boolean, locale: LocaleFace): () => void;
|
|
22
23
|
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/client/mount.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/client/mount.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAuCpE;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,WAAW,EACnB,gBAAgB,EAAE,MAAM,IAAI,EAC5B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,EACnD,kBAAkB,EAAE,CAAC,SAAS,EAAE,sBAAsB,KAAK,OAAO,EAClE,MAAM,EAAE,UAAU,GACjB,MAAM,IAAI,CAmBZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerModal.d.ts","sourceRoot":"","sources":["../../../../src/client/picker/FilePickerModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/client/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAY,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/client/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAY,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAYxC,iEAAiE;AACjE,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC,CAAA;IACpB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;IAC/C,wEAAwE;IACxE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;CACrC;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAgBzD;AAID,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,MAAM,CAAA;AACpC,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,MAAM,CAAA;AACvC,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAC5C,eAAO,MAAM,qBAAqB,OAAO,CAAA;AACzC,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,MAAM,CAAA;AACzC,eAAO,MAAM,sBAAsB,MAAM,CAAA;AACzC,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAC7C,gF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ACZ,WAAW,EAAE,kBAAkB,CAAA;IAC/B,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAwB5D;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,YAAY,CAoZ9D;AAED,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,EAAE,aAAa,CAAA;IACvB,GAAG,EAAE,QAAQ,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB;AAED,8CAA8C;AAC9C,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,iFAAiF;IACjF,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,oCAAoC;AACpC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,oBAAoB,CAarE"}
|
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
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { useEffect, useState, type ReactElement } from 'react'
|
|
15
15
|
import { DockItem } from './DockItem.tsx'
|
|
16
|
+
import { t } from './locales.ts'
|
|
16
17
|
|
|
17
18
|
const EV = {
|
|
18
19
|
toggleFile: 'dsh-dock:toggle-filepanel',
|
|
@@ -29,7 +30,7 @@ export function FilePanelDockItem(): ReactElement {
|
|
|
29
30
|
return (
|
|
30
31
|
<DockItem
|
|
31
32
|
active={active}
|
|
32
|
-
label=
|
|
33
|
+
label={t('dock.filePanel.label')}
|
|
33
34
|
onClick={() => window.dispatchEvent(new CustomEvent(EV.toggleFile))}
|
|
34
35
|
>
|
|
35
36
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
@@ -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/index.ts
CHANGED
|
@@ -27,7 +27,7 @@ import { FileManagerSettingsCard, FileManagerSettingsCardController, type FileMa
|
|
|
27
27
|
import { PanelLayoutController } from './layout.ts'
|
|
28
28
|
import { createPanelStores, layoutSetRoot } from './store.ts'
|
|
29
29
|
import { mountPanels } from './mount.tsx'
|
|
30
|
-
import { NS, dictionaries, setLanguage, type FileManagerPanelKey } from './locales.ts'
|
|
30
|
+
import { NS, dictionaries, setLanguage, bindT, type FileManagerPanelKey } from './locales.ts'
|
|
31
31
|
import { DragFileInlay, type DragFileInjected } from './drag/DragFileInlay.tsx'
|
|
32
32
|
import { insertPathIntoDraft } from './drag/file-drag.ts'
|
|
33
33
|
import { MermaidChatEnhancer } from './chat/mermaid-chat.tsx'
|
|
@@ -97,6 +97,12 @@ export function apply(ctx: ClientContext): void {
|
|
|
97
97
|
|
|
98
98
|
ctx.effect(() => ctx.locale.register(NS, dictionaries), 'dsh-filemgr: dictionaries')
|
|
99
99
|
|
|
100
|
+
// Bind the reactive translate function from the locale service so every
|
|
101
|
+
// `t()` call reads the active locale at call time (same mechanism as
|
|
102
|
+
// session-cleaner / im-gateway). The legacy `currentLanguage` + `setLanguage`
|
|
103
|
+
// path in locales.ts remains as a fallback.
|
|
104
|
+
bindT(ctx.locale.bind(NS))
|
|
105
|
+
|
|
100
106
|
// The `file` reference source: registers the codec that serializes file
|
|
101
107
|
// chips on submit (`@path:lines`), which the shell requires before any
|
|
102
108
|
// `slash/input-insert-reference` chip can send. Inert as a menu
|
|
@@ -352,7 +358,7 @@ export function apply(ctx: ClientContext): void {
|
|
|
352
358
|
// Mount everything. DOM failures degrade the panels, never the GUI.
|
|
353
359
|
try {
|
|
354
360
|
layout.mount()
|
|
355
|
-
mountPanels(stores, () => layout.toggleExplorer(), onReference, onAddFileReference)
|
|
361
|
+
mountPanels(stores, () => layout.toggleExplorer(), onReference, onAddFileReference, ctx.locale)
|
|
356
362
|
} catch (error) {
|
|
357
363
|
console.error('[dsh-filemgr] mount failed:', error)
|
|
358
364
|
}
|
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)
|
package/src/client/locales.ts
CHANGED
|
@@ -110,6 +110,23 @@ const zh = {
|
|
|
110
110
|
'settings.unsaved': '未保存',
|
|
111
111
|
'settings.saveFailed': '部署未接受这些值,已保留供你修改。',
|
|
112
112
|
'settings.invalidNumber': '请输入数字,留空则使用默认值。',
|
|
113
|
+
|
|
114
|
+
// ── FilePanelDockItem.tsx ──
|
|
115
|
+
'dock.filePanel.label': '文件面板',
|
|
116
|
+
|
|
117
|
+
// ── PreviewPanel.tsx ──
|
|
118
|
+
'preview.addToChat': '添加到对话',
|
|
119
|
+
|
|
120
|
+
// ── FilePickerModal.tsx ──
|
|
121
|
+
'picker.title': '引用项目文件',
|
|
122
|
+
'picker.searchPlaceholder': '搜索工作区文件…',
|
|
123
|
+
'picker.loading': '加载中…',
|
|
124
|
+
'picker.emptyDir': '(空目录)',
|
|
125
|
+
'picker.emptySelection': '选择文件或目录(可多选)',
|
|
126
|
+
'picker.insert': '插入',
|
|
127
|
+
'picker.removeAria': '移除',
|
|
128
|
+
'picker.clearAria': '清空',
|
|
129
|
+
'picker.closeAria': '关闭',
|
|
113
130
|
} as const
|
|
114
131
|
|
|
115
132
|
const en: Record<keyof typeof zh, string> = {
|
|
@@ -217,6 +234,18 @@ const en: Record<keyof typeof zh, string> = {
|
|
|
217
234
|
'settings.unsaved': 'Unsaved',
|
|
218
235
|
'settings.saveFailed': 'The deployment rejected these values; your edits are kept.',
|
|
219
236
|
'settings.invalidNumber': 'Enter a number, or leave it empty to use the default.',
|
|
237
|
+
|
|
238
|
+
'dock.filePanel.label': 'File Panel',
|
|
239
|
+
'preview.addToChat': 'Add to Chat',
|
|
240
|
+
'picker.title': 'Reference Project Files',
|
|
241
|
+
'picker.searchPlaceholder': 'Search workspace files…',
|
|
242
|
+
'picker.loading': 'Loading…',
|
|
243
|
+
'picker.emptyDir': '(empty directory)',
|
|
244
|
+
'picker.emptySelection': 'Select files or directories (multi-select)',
|
|
245
|
+
'picker.insert': 'Insert',
|
|
246
|
+
'picker.removeAria': 'Remove',
|
|
247
|
+
'picker.clearAria': 'Clear',
|
|
248
|
+
'picker.closeAria': 'Close',
|
|
220
249
|
}
|
|
221
250
|
|
|
222
251
|
export type FileManagerPanelKey = keyof typeof zh
|
|
@@ -239,8 +268,25 @@ export function setLanguage(language: string): void {
|
|
|
239
268
|
currentLanguage = language === 'en' ? 'en' : 'zh'
|
|
240
269
|
}
|
|
241
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Reactive translate function bound by the client entry via
|
|
273
|
+
* `ctx.locale.bind(NS)`. When set, `t` delegates to it so every call reads
|
|
274
|
+
* the active locale at call time (re-evaluated on each render). This is the
|
|
275
|
+
* same mechanism session-cleaner / im-gateway use; the legacy
|
|
276
|
+
* `currentLanguage` + `setLanguage` path remains as a fallback for any code
|
|
277
|
+
* path that runs before `bindT` is called.
|
|
278
|
+
*/
|
|
279
|
+
import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'
|
|
280
|
+
|
|
281
|
+
let _boundT: TranslateNS<'filemgr'> | null = null
|
|
282
|
+
|
|
283
|
+
export function bindT(t: TranslateNS<'filemgr'>): void {
|
|
284
|
+
_boundT = t
|
|
285
|
+
}
|
|
286
|
+
|
|
242
287
|
/** Translate one key with optional params. */
|
|
243
288
|
export function t(key: FileManagerPanelKey, params?: Record<string, string | number>): string {
|
|
289
|
+
if (_boundT !== null) return _boundT(key, params)
|
|
244
290
|
const table = dictionaries[currentLanguage] ?? zh
|
|
245
291
|
const template = table[key] ?? zh[key]
|
|
246
292
|
return params === undefined ? template : format(template, params)
|
package/src/client/mount.tsx
CHANGED
|
@@ -6,12 +6,27 @@
|
|
|
6
6
|
* @module dsh-filemgr/client/mount
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { useSyncExternalStore, type ReactElement } from 'react'
|
|
9
10
|
import { createRoot, type Root } from 'react-dom/client'
|
|
11
|
+
import type { LocaleFace } from '@deepseek-ai/dsh-client-ui-slots'
|
|
10
12
|
import type { PanelStores } from './store.ts'
|
|
11
13
|
import { ExplorerPanel } from './components/ExplorerPanel.tsx'
|
|
12
14
|
import { PreviewPanel } from './preview/PreviewPanel.tsx'
|
|
13
15
|
import type { FileReferenceSelection } from './preview/selection.ts'
|
|
14
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Wrapper that subscribes to locale revision so createRoot-mounted panels
|
|
19
|
+
* re-render on language switch (slot outlets do this automatically via
|
|
20
|
+
* useLocaleRevision; createRoot trees must opt in explicitly).
|
|
21
|
+
*/
|
|
22
|
+
function LocaleAwareRoot({ children, locale }: { children: ReactElement; locale: LocaleFace }): ReactElement {
|
|
23
|
+
useSyncExternalStore(
|
|
24
|
+
(cb: () => void) => locale.subscribe(cb),
|
|
25
|
+
() => locale.getSnapshot().revision,
|
|
26
|
+
)
|
|
27
|
+
return children
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
const EXPLORER_COL_SELECTOR = '[data-filemgr-explorer-col]'
|
|
16
31
|
const PREVIEW_COL_SELECTOR = '[data-filemgr-preview-col]'
|
|
17
32
|
|
|
@@ -52,6 +67,7 @@ export function mountPanels(
|
|
|
52
67
|
onToggleExplorer: () => void,
|
|
53
68
|
onReference: (path: string, isDir: boolean) => void,
|
|
54
69
|
onAddFileReference: (selection: FileReferenceSelection) => boolean,
|
|
70
|
+
locale: LocaleFace,
|
|
55
71
|
): () => void {
|
|
56
72
|
let explorerRoot: Root | undefined
|
|
57
73
|
let previewRoot: Root | undefined
|
|
@@ -59,11 +75,11 @@ export function mountPanels(
|
|
|
59
75
|
|
|
60
76
|
disposers.push(waitForElement(EXPLORER_COL_SELECTOR, (el) => {
|
|
61
77
|
explorerRoot = createRoot(el)
|
|
62
|
-
explorerRoot.render(<ExplorerPanel stores={stores} onToggleCollapse={onToggleExplorer} onReference={onReference}
|
|
78
|
+
explorerRoot.render(<LocaleAwareRoot locale={locale}><ExplorerPanel stores={stores} onToggleCollapse={onToggleExplorer} onReference={onReference} /></LocaleAwareRoot>)
|
|
63
79
|
}))
|
|
64
80
|
disposers.push(waitForElement(PREVIEW_COL_SELECTOR, (el) => {
|
|
65
81
|
previewRoot = createRoot(el)
|
|
66
|
-
previewRoot.render(<PreviewPanel stores={stores} onAddFileReference={onAddFileReference}
|
|
82
|
+
previewRoot.render(<LocaleAwareRoot locale={locale}><PreviewPanel stores={stores} onAddFileReference={onAddFileReference} /></LocaleAwareRoot>)
|
|
67
83
|
}))
|
|
68
84
|
|
|
69
85
|
return () => {
|
|
@@ -23,6 +23,7 @@ import type { PanelApi } from '../api.ts'
|
|
|
23
23
|
import { filePicker, type PickState } from './file-picker.ts'
|
|
24
24
|
import { ChevronDownIcon, ChevronRightIcon, CloseIcon, FileIcon, FolderIcon, FolderOpenIcon, SearchIcon } from '../components/icons.tsx'
|
|
25
25
|
import { appendToDraft, insertFileReference, type RefSpan } from '../reference.ts'
|
|
26
|
+
import { t } from '../locales.ts'
|
|
26
27
|
import pickerCss from '../styles/picker.module.css'
|
|
27
28
|
|
|
28
29
|
/** Debounce for the workspace search box. */
|
|
@@ -194,9 +195,9 @@ export function FilePickerModal({
|
|
|
194
195
|
{isDir && isOpen && (
|
|
195
196
|
<div>
|
|
196
197
|
{isLoading ? (
|
|
197
|
-
<div className={pickerCss.note} style={{ paddingLeft: 8 + (depth + 1) * 16 }}
|
|
198
|
+
<div className={pickerCss.note} style={{ paddingLeft: 8 + (depth + 1) * 16 }}>{t('picker.loading')}</div>
|
|
198
199
|
) : children.length === 0 ? (
|
|
199
|
-
<div className={pickerCss.note} style={{ paddingLeft: 8 + (depth + 1) * 16 }}
|
|
200
|
+
<div className={pickerCss.note} style={{ paddingLeft: 8 + (depth + 1) * 16 }}>{t('picker.emptyDir')}</div>
|
|
200
201
|
) : (
|
|
201
202
|
children.map((child) => renderNode(child, depth + 1))
|
|
202
203
|
)}
|
|
@@ -218,8 +219,8 @@ export function FilePickerModal({
|
|
|
218
219
|
<div className={pickerCss.modal} onClick={(e) => e.stopPropagation()}>
|
|
219
220
|
<div className={pickerCss.header}>
|
|
220
221
|
<div className={pickerCss.titleRow}>
|
|
221
|
-
<span className={pickerCss.title}
|
|
222
|
-
<button type="button" className={pickerCss.closeBtn} onClick={onClose} aria-label=
|
|
222
|
+
<span className={pickerCss.title}>{t('picker.title')}</span>
|
|
223
|
+
<button type="button" className={pickerCss.closeBtn} onClick={onClose} aria-label={t('picker.closeAria')}>
|
|
223
224
|
<CloseIcon size={16} />
|
|
224
225
|
</button>
|
|
225
226
|
</div>
|
|
@@ -227,13 +228,13 @@ export function FilePickerModal({
|
|
|
227
228
|
<span className={pickerCss.searchIcon}><SearchIcon size={14} /></span>
|
|
228
229
|
<input
|
|
229
230
|
className={pickerCss.searchInput}
|
|
230
|
-
placeholder=
|
|
231
|
+
placeholder={t('picker.searchPlaceholder')}
|
|
231
232
|
value={search}
|
|
232
233
|
onChange={(e) => setSearch(e.target.value)}
|
|
233
234
|
autoFocus
|
|
234
235
|
/>
|
|
235
236
|
{search !== '' && (
|
|
236
|
-
<button type="button" className={pickerCss.searchClear} onClick={() => setSearch('')} aria-label=
|
|
237
|
+
<button type="button" className={pickerCss.searchClear} onClick={() => setSearch('')} aria-label={t('picker.clearAria')}>
|
|
237
238
|
<CloseIcon size={13} />
|
|
238
239
|
</button>
|
|
239
240
|
)}
|
|
@@ -244,9 +245,9 @@ export function FilePickerModal({
|
|
|
244
245
|
<div className={pickerCss.body}>
|
|
245
246
|
{searchResults !== null ? (
|
|
246
247
|
searching ? (
|
|
247
|
-
<div className={pickerCss.note}
|
|
248
|
+
<div className={pickerCss.note}>{t('explorer.search.searching')}</div>
|
|
248
249
|
) : searchResults.length === 0 ? (
|
|
249
|
-
<div className={pickerCss.note}
|
|
250
|
+
<div className={pickerCss.note}>{t('explorer.search.empty')}</div>
|
|
250
251
|
) : (
|
|
251
252
|
searchResults.map((hit) => {
|
|
252
253
|
const isSel = selected.has(hit.path)
|
|
@@ -276,9 +277,9 @@ export function FilePickerModal({
|
|
|
276
277
|
})
|
|
277
278
|
)
|
|
278
279
|
) : rootLoading ? (
|
|
279
|
-
<div className={pickerCss.note}
|
|
280
|
+
<div className={pickerCss.note}>{t('picker.loading')}</div>
|
|
280
281
|
) : rootEntries.length === 0 ? (
|
|
281
|
-
<div className={pickerCss.note}
|
|
282
|
+
<div className={pickerCss.note}>{t('picker.emptyDir')}</div>
|
|
282
283
|
) : (
|
|
283
284
|
rootEntries.map((entry) => tree(entry, 0))
|
|
284
285
|
)}
|
|
@@ -287,7 +288,7 @@ export function FilePickerModal({
|
|
|
287
288
|
<div className={pickerCss.footer}>
|
|
288
289
|
<div className={pickerCss.chips}>
|
|
289
290
|
{selectedList.length === 0 ? (
|
|
290
|
-
<span className={pickerCss.chipsEmpty}
|
|
291
|
+
<span className={pickerCss.chipsEmpty}>{t('picker.emptySelection')}</span>
|
|
291
292
|
) : (
|
|
292
293
|
selectedList.map((pick) => (
|
|
293
294
|
<span key={pick.path} className={pickerCss.chip}>
|
|
@@ -296,7 +297,7 @@ export function FilePickerModal({
|
|
|
296
297
|
type="button"
|
|
297
298
|
className={pickerCss.chipX}
|
|
298
299
|
onClick={() => toggleSelect(pick.path, pick.isDir)}
|
|
299
|
-
aria-label=
|
|
300
|
+
aria-label={t('picker.removeAria')}
|
|
300
301
|
>
|
|
301
302
|
<CloseIcon size={11} />
|
|
302
303
|
</button>
|
|
@@ -305,14 +306,14 @@ export function FilePickerModal({
|
|
|
305
306
|
)}
|
|
306
307
|
</div>
|
|
307
308
|
<div className={pickerCss.footerActions}>
|
|
308
|
-
<button type="button" className={pickerCss.cancelBtn} onClick={onClose}
|
|
309
|
+
<button type="button" className={pickerCss.cancelBtn} onClick={onClose}>{t('common.cancel')}</button>
|
|
309
310
|
<button
|
|
310
311
|
type="button"
|
|
311
312
|
className={pickerCss.insertBtn}
|
|
312
313
|
disabled={selectedList.length === 0}
|
|
313
314
|
onClick={() => onInsert(selectedList)}
|
|
314
315
|
>
|
|
315
|
-
|
|
316
|
+
{t('picker.insert')}{selectedList.length > 0 ? ` (${selectedList.length})` : ''}
|
|
316
317
|
</button>
|
|
317
318
|
</div>
|
|
318
319
|
</div>
|
|
@@ -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 (
|
package/src/client/store.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import type { FileRead, FsEntry, GitStatusView, PreviewContentType, SearchHit } from '../core/types.ts'
|
|
14
14
|
import type { PanelApi } from './api.ts'
|
|
15
15
|
import { detectContentType, isTextType, pdfPreviewUrl, tabIdOf } from './fileType.ts'
|
|
16
|
+
import { t } from './locales.ts'
|
|
16
17
|
import {
|
|
17
18
|
createDebounced, evictPreviewScopes, readJson, readStoredNumber, writeJson, writeStoredNumber,
|
|
18
19
|
} from './persist.ts'
|
|
@@ -1133,7 +1134,7 @@ export function createPreviewStore(api: PanelApi): PreviewStore {
|
|
|
1133
1134
|
...item,
|
|
1134
1135
|
loading: false,
|
|
1135
1136
|
error: result.error.code === 'write-conflict'
|
|
1136
|
-
? '
|
|
1137
|
+
? t('preview.saveConflict')
|
|
1137
1138
|
: result.error.message,
|
|
1138
1139
|
}
|
|
1139
1140
|
}
|
|
@@ -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;
|