@huyooo/file-explorer-frontend-vue 0.4.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/dist/components/Breadcrumb.vue.d.ts +11 -0
- package/dist/components/Breadcrumb.vue.d.ts.map +1 -0
- package/dist/components/CompressDialog.vue.d.ts +16 -0
- package/dist/components/CompressDialog.vue.d.ts.map +1 -0
- package/dist/components/ContextMenu.vue.d.ts +18 -0
- package/dist/components/ContextMenu.vue.d.ts.map +1 -0
- package/dist/components/FileGrid.vue.d.ts +40 -0
- package/dist/components/FileGrid.vue.d.ts.map +1 -0
- package/dist/components/FileIcon.vue.d.ts +13 -0
- package/dist/components/FileIcon.vue.d.ts.map +1 -0
- package/dist/components/FileInfoDialog.vue.d.ts +14 -0
- package/dist/components/FileInfoDialog.vue.d.ts.map +1 -0
- package/dist/components/FileList.vue.d.ts +37 -0
- package/dist/components/FileList.vue.d.ts.map +1 -0
- package/dist/components/FileListView.vue.d.ts +43 -0
- package/dist/components/FileListView.vue.d.ts.map +1 -0
- package/dist/components/FileSidebar.vue.d.ts +17 -0
- package/dist/components/FileSidebar.vue.d.ts.map +1 -0
- package/dist/components/ProgressDialog.vue.d.ts +28 -0
- package/dist/components/ProgressDialog.vue.d.ts.map +1 -0
- package/dist/components/SortIndicator.vue.d.ts +6 -0
- package/dist/components/SortIndicator.vue.d.ts.map +1 -0
- package/dist/components/StatusBar.vue.d.ts +27 -0
- package/dist/components/StatusBar.vue.d.ts.map +1 -0
- package/dist/components/Toolbar.vue.d.ts +60 -0
- package/dist/components/Toolbar.vue.d.ts.map +1 -0
- package/dist/components/Window.vue.d.ts +65 -0
- package/dist/components/Window.vue.d.ts.map +1 -0
- package/dist/composables/useApplicationIcon.d.ts +16 -0
- package/dist/composables/useApplicationIcon.d.ts.map +1 -0
- package/dist/composables/useDragAndDrop.d.ts +14 -0
- package/dist/composables/useDragAndDrop.d.ts.map +1 -0
- package/dist/composables/useMediaPlayer.d.ts +24 -0
- package/dist/composables/useMediaPlayer.d.ts.map +1 -0
- package/dist/composables/useSelection.d.ts +15 -0
- package/dist/composables/useSelection.d.ts.map +1 -0
- package/dist/composables/useWindowDrag.d.ts +18 -0
- package/dist/composables/useWindowDrag.d.ts.map +1 -0
- package/dist/composables/useWindowResize.d.ts +12 -0
- package/dist/composables/useWindowResize.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4051 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +268 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/fileTypeIcon.d.ts +6 -0
- package/dist/utils/fileTypeIcon.d.ts.map +1 -0
- package/dist/utils/folderTypeIcon.d.ts +14 -0
- package/dist/utils/folderTypeIcon.d.ts.map +1 -0
- package/package.json +55 -0
- package/src/components/Breadcrumb.vue +111 -0
- package/src/components/CompressDialog.vue +478 -0
- package/src/components/ContextMenu.vue +550 -0
- package/src/components/FileGrid.vue +504 -0
- package/src/components/FileIcon.vue +132 -0
- package/src/components/FileInfoDialog.vue +465 -0
- package/src/components/FileList.vue +421 -0
- package/src/components/FileListView.vue +321 -0
- package/src/components/FileSidebar.vue +158 -0
- package/src/components/ProgressDialog.vue +368 -0
- package/src/components/SortIndicator.vue +22 -0
- package/src/components/StatusBar.vue +43 -0
- package/src/components/Toolbar.vue +271 -0
- package/src/components/Window.vue +561 -0
- package/src/composables/useApplicationIcon.ts +79 -0
- package/src/composables/useDragAndDrop.ts +103 -0
- package/src/composables/useMediaPlayer.ts +174 -0
- package/src/composables/useSelection.ts +107 -0
- package/src/composables/useWindowDrag.ts +66 -0
- package/src/composables/useWindowResize.ts +134 -0
- package/src/index.ts +32 -0
- package/src/types/index.ts +273 -0
- package/src/utils/fileTypeIcon.ts +309 -0
- package/src/utils/folderTypeIcon.ts +132 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文件夹图标映射(基于 material-icon-theme.json)
|
|
3
|
+
*
|
|
4
|
+
* 原理:
|
|
5
|
+
* 1. KNOWN_TYPES:从 material-icon-theme.json 提取的所有 folder-{type} 类型
|
|
6
|
+
* 2. ALIASES:常见变体映射到标准名
|
|
7
|
+
* 3. 逻辑:目录名小写 → 查别名 → 查白名单 → 命中则返回 material-icon-theme:folder-{type}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// 从 material-icon-theme.json 提取的所有 folder-* 类型(去掉 folder- 前缀和 -open 后缀)
|
|
11
|
+
const KNOWN_TYPES = new Set([
|
|
12
|
+
'admin', 'android', 'angular', 'animation', 'ansible', 'api', 'apollo', 'app',
|
|
13
|
+
'archive', 'astro', 'atom', 'attachment', 'audio', 'aurelia', 'aws',
|
|
14
|
+
'azure-pipelines', 'backup', 'base', 'batch', 'benchmark', 'bibliography',
|
|
15
|
+
'bicep', 'blender', 'bloc', 'bower', 'buildkite', 'cart', 'changesets', 'ci',
|
|
16
|
+
'circleci', 'class', 'claude', 'client', 'cline', 'cloud-functions', 'cloudflare',
|
|
17
|
+
'cluster', 'cobol', 'command', 'components', 'config', 'connection', 'console',
|
|
18
|
+
'constant', 'container', 'content', 'context', 'contract', 'controller', 'core',
|
|
19
|
+
'coverage', 'css', 'cue', 'cursor', 'custom', 'cypress', 'dal', 'dart', 'database',
|
|
20
|
+
'debug', 'decorators', 'delta', 'desktop', 'directive', 'dist', 'docker', 'docs',
|
|
21
|
+
'download', 'drizzle', 'dump', 'element', 'enum', 'environment', 'error', 'eslint',
|
|
22
|
+
'event', 'examples', 'expo', 'export', 'fastlane', 'favicon', 'features', 'filter',
|
|
23
|
+
'firebase', 'firestore', 'flow', 'flutter', 'font', 'forgejo', 'functions',
|
|
24
|
+
'gamemaker', 'generator', 'gh-workflows', 'git', 'gitea', 'github', 'gitlab',
|
|
25
|
+
'global', 'godot', 'gradle', 'graphql', 'guard', 'gulp', 'helm', 'helper', 'home',
|
|
26
|
+
'hook', 'husky', 'i18n', 'images', 'import', 'include', 'input', 'intellij',
|
|
27
|
+
'interceptor', 'interface', 'ios', 'java', 'javascript', 'jinja', 'job', 'json',
|
|
28
|
+
'jupyter', 'keys', 'kubernetes', 'kusto', 'layout', 'lefthook', 'less', 'lib',
|
|
29
|
+
'license', 'link', 'linux', 'liquibase', 'log', 'lottie', 'lua', 'luau', 'macos',
|
|
30
|
+
'mail', 'mappings', 'markdown', 'mercurial', 'messages', 'meta', 'metro',
|
|
31
|
+
'middleware', 'migrations', 'mjml', 'mobile', 'mock', 'mojo', 'molecule', 'moon',
|
|
32
|
+
'netlify', 'next', 'ngrx-store', 'node', 'nuxt', 'obsidian', 'organism', 'other',
|
|
33
|
+
'packages', 'pdf', 'pdm', 'php', 'phpmailer', 'pipe', 'plastic', 'plugin', 'policy',
|
|
34
|
+
'powershell', 'prisma', 'private', 'project', 'prompts', 'proto', 'public', 'python',
|
|
35
|
+
'pytorch', 'quasar', 'queue', 'react-components', 'redux-reducer', 'repository',
|
|
36
|
+
'resolver', 'resource', 'review', 'robot', 'routes', 'rules', 'rust', 'salt',
|
|
37
|
+
'sandbox', 'sass', 'scala', 'scons', 'scripts', 'secure', 'seeders', 'server',
|
|
38
|
+
'serverless', 'shader', 'shared', 'simulations', 'snapcraft', 'snippet', 'src',
|
|
39
|
+
'src-tauri', 'stack', 'stencil', 'store', 'storybook', 'stylus', 'sublime',
|
|
40
|
+
'supabase', 'svelte', 'svg', 'syntax', 'target', 'taskfile', 'tasks', 'television',
|
|
41
|
+
'temp', 'template', 'terraform', 'test', 'theme', 'toc', 'tools', 'trash', 'trigger',
|
|
42
|
+
'turborepo', 'typescript', 'ui', 'unity', 'update', 'upload', 'utils', 'vercel',
|
|
43
|
+
'verdaccio', 'video', 'views', 'vm', 'vscode', 'vue', 'vue-directives', 'vuepress',
|
|
44
|
+
'vuex-store', 'wakatime', 'webpack', 'windows', 'wordpress', 'yarn', 'zeabur',
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
// 别名映射
|
|
48
|
+
const ALIASES: Record<string, string> = {
|
|
49
|
+
// 复数/变体
|
|
50
|
+
'tests': 'test', '__tests__': 'test', '__test__': 'test', 'spec': 'test', 'specs': 'test',
|
|
51
|
+
'script': 'scripts',
|
|
52
|
+
'configs': 'config', 'configuration': 'config', 'configurations': 'config',
|
|
53
|
+
'route': 'routes', 'routing': 'routes',
|
|
54
|
+
'stories': 'storybook', 'story': 'storybook',
|
|
55
|
+
'templates': 'template',
|
|
56
|
+
'themes': 'theme',
|
|
57
|
+
'videos': 'video',
|
|
58
|
+
'imgs': 'images', 'img': 'images', 'image': 'images',
|
|
59
|
+
'fonts': 'font',
|
|
60
|
+
'styles': 'css', 'style': 'css', 'styling': 'css', 'stylesheets': 'css',
|
|
61
|
+
'view': 'views', 'pages': 'views', 'page': 'views',
|
|
62
|
+
'layouts': 'layout',
|
|
63
|
+
'models': 'database', 'model': 'database',
|
|
64
|
+
'modules': 'lib', 'module': 'lib', 'mods': 'lib',
|
|
65
|
+
'plugins': 'plugin', 'addons': 'plugin', 'extensions': 'plugin',
|
|
66
|
+
'middlewares': 'middleware',
|
|
67
|
+
'helpers': 'helper', 'utilities': 'utils', 'util': 'utils',
|
|
68
|
+
'tool': 'tools', 'tooling': 'tools',
|
|
69
|
+
'resources': 'resource', 'res': 'resource', 'assets': 'resource', 'asset': 'resource',
|
|
70
|
+
'hooks': 'hook', 'composables': 'hook',
|
|
71
|
+
'mocks': 'mock', '__mocks__': 'mock', 'fixtures': 'mock', '__fixtures__': 'mock',
|
|
72
|
+
'logs': 'log',
|
|
73
|
+
'uploads': 'upload',
|
|
74
|
+
'function': 'functions', 'func': 'functions', 'fns': 'functions',
|
|
75
|
+
'services': 'server', 'service': 'server',
|
|
76
|
+
'component': 'components', 'comp': 'components', 'comps': 'components',
|
|
77
|
+
'controllers': 'controller',
|
|
78
|
+
// 常见变体
|
|
79
|
+
'source': 'src', 'sources': 'src',
|
|
80
|
+
'distribution': 'dist', 'build': 'dist', 'builds': 'dist', 'out': 'dist', 'output': 'dist',
|
|
81
|
+
'documentation': 'docs', 'doc': 'docs', 'document': 'docs', 'documents': 'docs',
|
|
82
|
+
'static': 'public', 'statics': 'public', 'publics': 'public',
|
|
83
|
+
'libs': 'lib', 'library': 'lib', 'vendor': 'lib', 'vendors': 'lib',
|
|
84
|
+
'bin': 'scripts', 'binaries': 'scripts',
|
|
85
|
+
'tmp': 'temp', 'temporary': 'temp', 'cache': 'temp', 'caches': 'temp', '.cache': 'temp', '.turbo': 'temp',
|
|
86
|
+
'types': 'typescript', '@types': 'typescript', 'typings': 'typescript', 'dts': 'typescript',
|
|
87
|
+
'locales': 'i18n', 'locale': 'i18n', 'lang': 'i18n', 'languages': 'i18n', 'translations': 'i18n',
|
|
88
|
+
'db': 'database', 'databases': 'database', 'sql': 'database', 'queries': 'database',
|
|
89
|
+
'migration': 'migrations', 'seeds': 'seeders', 'seed': 'seeders',
|
|
90
|
+
// 技术栈
|
|
91
|
+
'.vscode': 'vscode',
|
|
92
|
+
'.github': 'github',
|
|
93
|
+
'.gitlab': 'gitlab',
|
|
94
|
+
'.circleci': 'circleci',
|
|
95
|
+
'.husky': 'husky',
|
|
96
|
+
'.docker': 'docker',
|
|
97
|
+
'node_modules': 'node',
|
|
98
|
+
'scss': 'sass',
|
|
99
|
+
'renderer': 'client', 'frontend': 'client', 'web': 'client', 'webapp': 'client', 'website': 'client',
|
|
100
|
+
'backend': 'server', 'main': 'server',
|
|
101
|
+
'preload': 'scripts',
|
|
102
|
+
'.idea': 'intellij',
|
|
103
|
+
'.git': 'git',
|
|
104
|
+
'k8s': 'kubernetes', 'kube': 'kubernetes',
|
|
105
|
+
'mongo': 'database', 'mongodb': 'database', 'mysql': 'database', 'postgres': 'database',
|
|
106
|
+
'api': 'api', 'apis': 'api',
|
|
107
|
+
'interfaces': 'interface',
|
|
108
|
+
'notebook': 'jupyter', 'notebooks': 'jupyter', 'ipynb': 'jupyter',
|
|
109
|
+
'notification': 'messages', 'notifications': 'messages',
|
|
110
|
+
'env': 'environment', 'envs': 'environment',
|
|
111
|
+
'redux': 'redux-reducer', 'store': 'store', 'stores': 'store',
|
|
112
|
+
'electron': 'desktop',
|
|
113
|
+
'tauri': 'src-tauri',
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 根据文件夹名称获取对应的 material-icon-theme 图标名
|
|
118
|
+
* @returns 图标名 或 undefined(让上层兜底默认图标)
|
|
119
|
+
*/
|
|
120
|
+
export function getFolderTypeIcon(folderName: string): string | undefined {
|
|
121
|
+
const name = (folderName || '').trim();
|
|
122
|
+
if (!name) return undefined;
|
|
123
|
+
|
|
124
|
+
const lower = name.replace(/[\\/]+$/, '').toLowerCase();
|
|
125
|
+
const standardName = ALIASES[lower] ?? lower;
|
|
126
|
+
|
|
127
|
+
if (KNOWN_TYPES.has(standardName)) {
|
|
128
|
+
return `material-icon-theme:folder-${standardName}`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|