@lijian-ui/dsh-file-manager 0.2.2 → 0.2.4
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/LICENSE +38 -38
- package/README.i18n.yaml +6 -6
- package/README.md +66 -66
- package/README.zh.md +66 -66
- package/cordis.patch.yml +13 -13
- package/lib/client.js +27354 -355
- package/lib/client.js.map +1 -1
- package/lib/index.js +474 -42
- package/lib/tsconfig.client.tsbuildinfo +1 -1
- package/lib/tsconfig.host.tsbuildinfo +1 -1
- package/lib/types/client/file-source.d.ts +10 -0
- package/lib/types/client/file-source.d.ts.map +1 -1
- package/lib/types/client/fileType.d.ts +19 -4
- package/lib/types/client/fileType.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +0 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +3 -0
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/mount.d.ts +1 -1
- package/lib/types/client/mount.d.ts.map +1 -1
- package/lib/types/client/picker/FilePickerModal.d.ts +8 -6
- package/lib/types/client/picker/FilePickerModal.d.ts.map +1 -1
- package/lib/types/client/preview/PreviewPanel.d.ts +2 -1
- package/lib/types/client/preview/PreviewPanel.d.ts.map +1 -1
- package/lib/types/client/preview/PreviewToolbar.d.ts +3 -1
- package/lib/types/client/preview/PreviewToolbar.d.ts.map +1 -1
- package/lib/types/client/preview/content.d.ts +3 -1
- package/lib/types/client/preview/content.d.ts.map +1 -1
- package/lib/types/client/preview/office.d.ts +23 -0
- package/lib/types/client/preview/office.d.ts.map +1 -0
- package/lib/types/client/reference.d.ts +23 -10
- package/lib/types/client/reference.d.ts.map +1 -1
- package/lib/types/client/store.d.ts.map +1 -1
- package/lib/types/host/fs-service.d.ts.map +1 -1
- package/lib/types/host/office-preview.d.ts +13 -0
- package/lib/types/host/office-preview.d.ts.map +1 -0
- package/lib/types/host/routes.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +19 -4
- package/src/client/DockItem.tsx +1 -1
- package/src/client/FileManagerSettingsCard.tsx +117 -117
- package/src/client/PluginSettingsCard.tsx +337 -337
- package/src/client/chat/file-ref.ts +144 -144
- package/src/client/chat/mermaid-chat.tsx +102 -102
- package/src/client/chat/placeholder-hint.tsx +46 -46
- package/src/client/components/ExplorerPanel.tsx +534 -534
- package/src/client/components/FileIcon.tsx +46 -46
- package/src/client/components/ScmPanel.tsx +480 -480
- package/src/client/components/a11y.ts +20 -20
- package/src/client/components/icons.tsx +274 -274
- package/src/client/components/overlay.tsx +225 -225
- package/src/client/drag/DragFileInlay.tsx +89 -89
- package/src/client/drag/file-drag.ts +67 -67
- package/src/client/drag.ts +154 -154
- package/src/client/file-source.ts +34 -0
- package/src/client/fileType.ts +32 -5
- package/src/client/hooks/useResizableSplit.ts +91 -91
- package/src/client/hooks/useStore.ts +15 -15
- package/src/client/index.ts +45 -17
- package/src/client/layout.ts +523 -523
- package/src/client/locales.ts +6 -0
- package/src/client/maximize.ts +34 -34
- package/src/client/mount.tsx +2 -1
- package/src/client/persist.ts +194 -194
- package/src/client/picker/FilePickerModal.tsx +526 -507
- package/src/client/picker/file-picker.ts +86 -86
- package/src/client/preview/PreviewPanel.tsx +8 -1
- package/src/client/preview/PreviewTabs.tsx +159 -159
- package/src/client/preview/PreviewToolbar.tsx +3 -2
- package/src/client/preview/content.tsx +7 -2
- package/src/client/preview/markdown.ts +351 -351
- package/src/client/preview/mermaid.ts +274 -274
- package/src/client/preview/office.tsx +321 -0
- package/src/client/reference.ts +62 -8
- package/src/client/settings-card.module.css +316 -316
- package/src/client/settings-form.ts +451 -451
- package/src/client/store.ts +17 -12
- package/src/client/styles/drag.module.css +30 -30
- package/src/client/styles/explorer.module.css +371 -371
- package/src/client/styles/picker.module.css +344 -344
- package/src/client/styles/preview.module.css +18 -11
- package/src/client/styles/scm.module.css +380 -380
- package/src/client/styles/tokens.module.css +376 -367
- package/src/core/types.ts +162 -162
- package/src/host/fs-service.ts +7 -1
- package/src/host/gate.ts +73 -73
- package/src/host/git-runner.ts +116 -116
- package/src/host/git-service.ts +395 -395
- package/src/host/loopback.ts +63 -63
- package/src/host/office-preview.ts +399 -0
- package/src/host/poll-guard.ts +109 -109
- package/src/host/routes.ts +72 -1
- package/src/index.ts +3 -1
- package/src/mount-once.ts +48 -48
- package/lib/types/client/chat/AttachedFilesDock.d.ts +0 -51
- package/lib/types/client/chat/AttachedFilesDock.d.ts.map +0 -1
- package/lib/types/client/floating.d.ts +0 -27
- package/lib/types/client/floating.d.ts.map +0 -1
- package/lib/types/client/mention.d.ts +0 -44
- package/lib/types/client/mention.d.ts.map +0 -1
- package/src/client/styles/chip.module.css +0 -38
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 16x16 file/folder icons for the tree — a small built-in set (folder
|
|
3
|
-
* open/closed, file variants by kind) using the token colors, so both themes
|
|
4
|
-
* stay consistent without pulling in a vscode-icons package.
|
|
5
|
-
* @module dsh-filemgr/client/components/FileIcon
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { JSX } from 'react'
|
|
9
|
-
import { detectContentType } from '../fileType.ts'
|
|
10
|
-
import {
|
|
11
|
-
FileCodeIcon, FileIcon, FileImageIcon, FileTextIcon, FolderIcon, FolderOpenIcon,
|
|
12
|
-
} from './icons.tsx'
|
|
13
|
-
|
|
14
|
-
/** The icon for one tree entry (16x16, currentColor). */
|
|
15
|
-
export function FileTypeIcon({
|
|
16
|
-
name,
|
|
17
|
-
isDir,
|
|
18
|
-
expanded,
|
|
19
|
-
className,
|
|
20
|
-
}: {
|
|
21
|
-
name: string
|
|
22
|
-
isDir: boolean
|
|
23
|
-
expanded: boolean
|
|
24
|
-
className?: string
|
|
25
|
-
}): JSX.Element {
|
|
26
|
-
if (isDir) {
|
|
27
|
-
return expanded
|
|
28
|
-
? <FolderOpenIcon size={16} className={className} />
|
|
29
|
-
: <FolderIcon size={16} className={className} />
|
|
30
|
-
}
|
|
31
|
-
const type = detectContentType(name)
|
|
32
|
-
switch (type) {
|
|
33
|
-
case 'image':
|
|
34
|
-
return <FileImageIcon size={16} className={className} />
|
|
35
|
-
case 'markdown':
|
|
36
|
-
case 'text':
|
|
37
|
-
return <FileTextIcon size={16} className={className} />
|
|
38
|
-
case 'code':
|
|
39
|
-
case 'diff':
|
|
40
|
-
case 'csv':
|
|
41
|
-
case 'html':
|
|
42
|
-
return <FileCodeIcon size={16} className={className} />
|
|
43
|
-
default:
|
|
44
|
-
return <FileIcon size={16} className={className} />
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 16x16 file/folder icons for the tree — a small built-in set (folder
|
|
3
|
+
* open/closed, file variants by kind) using the token colors, so both themes
|
|
4
|
+
* stay consistent without pulling in a vscode-icons package.
|
|
5
|
+
* @module dsh-filemgr/client/components/FileIcon
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { JSX } from 'react'
|
|
9
|
+
import { detectContentType } from '../fileType.ts'
|
|
10
|
+
import {
|
|
11
|
+
FileCodeIcon, FileIcon, FileImageIcon, FileTextIcon, FolderIcon, FolderOpenIcon,
|
|
12
|
+
} from './icons.tsx'
|
|
13
|
+
|
|
14
|
+
/** The icon for one tree entry (16x16, currentColor). */
|
|
15
|
+
export function FileTypeIcon({
|
|
16
|
+
name,
|
|
17
|
+
isDir,
|
|
18
|
+
expanded,
|
|
19
|
+
className,
|
|
20
|
+
}: {
|
|
21
|
+
name: string
|
|
22
|
+
isDir: boolean
|
|
23
|
+
expanded: boolean
|
|
24
|
+
className?: string
|
|
25
|
+
}): JSX.Element {
|
|
26
|
+
if (isDir) {
|
|
27
|
+
return expanded
|
|
28
|
+
? <FolderOpenIcon size={16} className={className} />
|
|
29
|
+
: <FolderIcon size={16} className={className} />
|
|
30
|
+
}
|
|
31
|
+
const type = detectContentType(name)
|
|
32
|
+
switch (type) {
|
|
33
|
+
case 'image':
|
|
34
|
+
return <FileImageIcon size={16} className={className} />
|
|
35
|
+
case 'markdown':
|
|
36
|
+
case 'text':
|
|
37
|
+
return <FileTextIcon size={16} className={className} />
|
|
38
|
+
case 'code':
|
|
39
|
+
case 'diff':
|
|
40
|
+
case 'csv':
|
|
41
|
+
case 'html':
|
|
42
|
+
return <FileCodeIcon size={16} className={className} />
|
|
43
|
+
default:
|
|
44
|
+
return <FileIcon size={16} className={className} />
|
|
45
|
+
}
|
|
46
|
+
}
|