@brftech/filex-core 0.1.56 → 0.1.61

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.
Files changed (82) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +108 -108
  3. package/dist/{ArchiveViewer-CJdaw5x3.js → ArchiveViewer-CbUUEREI.js} +20 -20
  4. package/dist/ArchiveViewer-CbUUEREI.js.map +1 -0
  5. package/dist/{CsvViewer-QYx_tePQ.js → CsvViewer-72rDsQJX.js} +3 -3
  6. package/dist/CsvViewer-72rDsQJX.js.map +1 -0
  7. package/dist/{DrawioViewer-GWt0TyB7.js → DrawioViewer-DSyMwGvg.js} +7 -7
  8. package/dist/DrawioViewer-DSyMwGvg.js.map +1 -0
  9. package/dist/{EpubViewer-Je0ywklQ.js → EpubViewer-DvDa17d7.js} +3 -3
  10. package/dist/EpubViewer-DvDa17d7.js.map +1 -0
  11. package/dist/{IpynbViewer-TsB4gqP-.js → IpynbViewer-DibIkdsz.js} +3 -3
  12. package/dist/IpynbViewer-DibIkdsz.js.map +1 -0
  13. package/dist/{MermaidViewer-CXfeDS-7.js → MermaidViewer-BoFLtGvl.js} +3 -3
  14. package/dist/MermaidViewer-BoFLtGvl.js.map +1 -0
  15. package/dist/{PsdViewer-VtPpxKVe.js → PsdViewer-K2iZkwax.js} +3 -3
  16. package/dist/PsdViewer-K2iZkwax.js.map +1 -0
  17. package/dist/{TiffViewer-OINn9bbb.js → TiffViewer-JzDzbqpO.js} +3 -3
  18. package/dist/TiffViewer-JzDzbqpO.js.map +1 -0
  19. package/dist/{Viewer3D-xvvyiWHd.js → Viewer3D-WEMYCP8l.js} +7 -7
  20. package/dist/Viewer3D-WEMYCP8l.js.map +1 -0
  21. package/dist/filex-core.js +1 -1
  22. package/dist/filex-core.umd.cjs +4 -4
  23. package/dist/filex-core.umd.cjs.map +1 -1
  24. package/dist/{index-CmSYzt6L.js → index-B5YT-m5Q.js} +209 -209
  25. package/dist/index-B5YT-m5Q.js.map +1 -0
  26. package/dist/style.css +1 -1
  27. package/dist/useViewerFetch-czqbd2Lj.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/components/Breadcrumb.vue +282 -282
  30. package/src/components/ContextMenu.vue +152 -152
  31. package/src/components/GridView.vue +166 -166
  32. package/src/components/ListView.vue +212 -212
  33. package/src/components/PendingOpsTray.vue +91 -91
  34. package/src/components/RecentlyOpened.vue +155 -155
  35. package/src/components/StarButton.vue +101 -101
  36. package/src/components/TagPicker.vue +184 -184
  37. package/src/components/Toolbar.vue +220 -220
  38. package/src/components/UploadProgress.vue +78 -78
  39. package/src/composables/useFileApi.ts +692 -692
  40. package/src/composables/useKeyboardShortcuts.ts +144 -144
  41. package/src/composables/useLocale.ts +60 -60
  42. package/src/composables/useMonacoLoader.ts +98 -98
  43. package/src/composables/usePendingOps.ts +200 -200
  44. package/src/composables/useSelection.ts +81 -81
  45. package/src/composables/useUploadChunked.ts +250 -250
  46. package/src/composables/useViewerFetch.ts +58 -58
  47. package/src/index.ts +80 -80
  48. package/src/locales/en.ts +122 -122
  49. package/src/locales/index.ts +12 -12
  50. package/src/locales/tr.ts +122 -122
  51. package/src/modals/DeleteConfirmModal.vue +32 -32
  52. package/src/modals/Modal.vue +104 -104
  53. package/src/modals/NewFolderModal.vue +64 -64
  54. package/src/modals/PermissionsModal.vue +815 -815
  55. package/src/modals/PreviewModal.vue +1070 -1070
  56. package/src/modals/RenameModal.vue +58 -58
  57. package/src/modals/ShareModal.vue +135 -135
  58. package/src/styles/base.css +1224 -1224
  59. package/src/styles/variables.css +90 -90
  60. package/src/types/FileNode.ts +136 -136
  61. package/src/types/index.ts +27 -27
  62. package/src/types/peers.d.ts +45 -45
  63. package/src/viewers/ArchiveViewer.vue +186 -186
  64. package/src/viewers/CsvViewer.vue +319 -319
  65. package/src/viewers/DrawioViewer.vue +243 -243
  66. package/src/viewers/EpubViewer.vue +307 -307
  67. package/src/viewers/IpynbViewer.vue +365 -365
  68. package/src/viewers/MermaidViewer.vue +259 -259
  69. package/src/viewers/PdfViewer.vue +562 -562
  70. package/src/viewers/PsdViewer.vue +264 -264
  71. package/src/viewers/TiffViewer.vue +273 -273
  72. package/src/viewers/Viewer3D.vue +120 -120
  73. package/dist/ArchiveViewer-CJdaw5x3.js.map +0 -1
  74. package/dist/CsvViewer-QYx_tePQ.js.map +0 -1
  75. package/dist/DrawioViewer-GWt0TyB7.js.map +0 -1
  76. package/dist/EpubViewer-Je0ywklQ.js.map +0 -1
  77. package/dist/IpynbViewer-TsB4gqP-.js.map +0 -1
  78. package/dist/MermaidViewer-CXfeDS-7.js.map +0 -1
  79. package/dist/PsdViewer-VtPpxKVe.js.map +0 -1
  80. package/dist/TiffViewer-OINn9bbb.js.map +0 -1
  81. package/dist/Viewer3D-xvvyiWHd.js.map +0 -1
  82. package/dist/index-CmSYzt6L.js.map +0 -1
@@ -1,212 +1,212 @@
1
- <script setup lang="ts">
2
- /**
3
- * ListView — tabular layout (name / size / modified).
4
- *
5
- * Selection + context menu + double-click open are caller-owned — we
6
- * just emit the events and let FileExplorer.vue handle them uniformly
7
- * across List and Grid.
8
- */
9
- import { computed } from 'vue';
10
- import type { FileNode } from '../types/FileNode';
11
- import type { LocaleCode } from '../types/ExplorerConfig';
12
- import { useLocale } from '../composables/useLocale';
13
- import StarButton from './StarButton.vue';
14
-
15
- const props = defineProps<{
16
- files: FileNode[];
17
- selected: Set<string>;
18
- /** Paths that were cut → dim them so the user sees the pending move. */
19
- clipped?: Set<string>;
20
- /**
21
- * Show each row's parent directory under the basename. Caller flips
22
- * this on while a search filter is active so the user can tell
23
- * `invoice.pdf` (in 2024/) apart from `invoice.pdf` (in 2025/) when
24
- * both match the same query.
25
- */
26
- showParentPath?: boolean;
27
- locale: LocaleCode;
28
- loading?: boolean;
29
- /** Set of node IDs flagged starred by the user — render an inline
30
- * filled star indicator and let the user toggle it from the row. */
31
- starredIds?: Set<number>;
32
- /** Backend base URL + auth header builder forwarded to StarButton
33
- * so it can POST /api/files/manager/star on click. Optional —
34
- * embedders without auth wire-up pass nothing and the star column
35
- * hides itself. */
36
- apiBase?: string;
37
- authHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
38
- }>();
39
-
40
- const emit = defineEmits<{
41
- (e: 'click-row', node: FileNode, mod: { ctrl: boolean; shift: boolean }): void;
42
- (e: 'dbl-row', node: FileNode): void;
43
- (e: 'context-row', node: FileNode, ev: MouseEvent): void;
44
- (e: 'item-drag-start', node: FileNode, ev: DragEvent): void;
45
- (e: 'item-drop-into', target: FileNode, ev: DragEvent): void;
46
- (e: 'star-change', node: FileNode, value: boolean): void;
47
- }>();
48
-
49
- const { t, formatSize, nodeDisplayName } = useLocale(() => props.locale);
50
-
51
- function isSelected(n: FileNode): boolean {
52
- return props.selected.has(n.path);
53
- }
54
-
55
- function onRowClick(n: FileNode, ev: MouseEvent) {
56
- emit('click-row', n, { ctrl: ev.ctrlKey || ev.metaKey, shift: ev.shiftKey });
57
- }
58
-
59
- function onRowDbl(n: FileNode) {
60
- emit('dbl-row', n);
61
- }
62
-
63
- function onRowCtx(n: FileNode, ev: MouseEvent) {
64
- // Stop bubbling so the root `@contextmenu` handler doesn't fire and
65
- // clear the selection we just set.
66
- ev.preventDefault();
67
- ev.stopPropagation();
68
- emit('context-row', n, ev);
69
- }
70
-
71
- function onItemDragStart(n: FileNode, ev: DragEvent) {
72
- emit('item-drag-start', n, ev);
73
- }
74
-
75
- function onItemDragOver(n: FileNode, ev: DragEvent) {
76
- if (n.type !== 'dir') return;
77
- if (!ev.dataTransfer?.types.includes('application/x-brf-files')) return;
78
- ev.preventDefault();
79
- ev.stopPropagation();
80
- if (ev.dataTransfer) ev.dataTransfer.dropEffect = 'move';
81
- }
82
-
83
- function onItemDrop(n: FileNode, ev: DragEvent) {
84
- if (n.type !== 'dir') return;
85
- if (!ev.dataTransfer?.types.includes('application/x-brf-files')) return;
86
- ev.preventDefault();
87
- ev.stopPropagation();
88
- emit('item-drop-into', n, ev);
89
- }
90
-
91
- let pressTimer: ReturnType<typeof setTimeout> | undefined;
92
- let pressTarget: FileNode | null = null;
93
-
94
- function onTouchStart(n: FileNode, ev: TouchEvent) {
95
- pressTarget = n;
96
- if (pressTimer) clearTimeout(pressTimer);
97
- pressTimer = setTimeout(() => {
98
- if (pressTarget) {
99
- const t0 = ev.touches[0];
100
- emit('context-row', pressTarget, {
101
- clientX: t0.clientX,
102
- clientY: t0.clientY,
103
- preventDefault: () => {},
104
- } as unknown as MouseEvent);
105
- }
106
- }, 500);
107
- }
108
-
109
- function cancelPress() {
110
- if (pressTimer) clearTimeout(pressTimer);
111
- pressTarget = null;
112
- }
113
-
114
- function iconFor(n: FileNode): string {
115
- if (n.mime_type === 'inode/storage') return '💾';
116
- if (n.type === 'dir') return '📁';
117
- const e = (n.extension || '').toLowerCase();
118
- if (['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'avif', 'heic', 'svg'].includes(e)) return '🖼';
119
- if (['mp4', 'webm', 'mov', 'mkv', 'avi', 'ogv', 'm4v'].includes(e)) return '🎞';
120
- if (['mp3', 'wav', 'flac', 'ogg', 'm4a', 'aac', 'opus'].includes(e)) return '🎵';
121
- if (e === 'pdf') return '📕';
122
- if (['doc', 'docx', 'odt', 'rtf'].includes(e)) return '📄';
123
- if (['xls', 'xlsx', 'ods', 'csv'].includes(e)) return '📊';
124
- if (['ppt', 'pptx', 'odp'].includes(e)) return '📽';
125
- if (['zip', 'tar', 'gz', 'bz2', '7z', 'rar'].includes(e)) return '🗜';
126
- if (['txt', 'md', 'log', 'json', 'yml', 'yaml', 'xml'].includes(e)) return '📝';
127
- return '📎';
128
- }
129
-
130
- function displayDate(ms: number | undefined): string {
131
- if (!ms) return '—';
132
- const d = new Date(ms * (ms < 1e12 ? 1000 : 1));
133
- return d.toLocaleString();
134
- }
135
-
136
- function parentDir(path: string): string {
137
- const stripped = path.replace(/^[a-z][a-z0-9+.-]*:\/\//i, '');
138
- const idx = stripped.lastIndexOf('/');
139
- if (idx === -1) return '';
140
- return stripped.slice(0, idx);
141
- }
142
-
143
- const rows = computed(() => props.files);
144
- </script>
145
-
146
- <template>
147
- <div class="fe-list" :class="{ 'is-loading': loading, 'has-star-col': !!apiBase || apiBase === '' }">
148
- <div class="fe-list__head" role="row">
149
- <div class="fe-list__col fe-list__col--star" role="columnheader" aria-label="Star"></div>
150
- <div class="fe-list__col fe-list__col--name" role="columnheader">{{ t('col.name') }}</div>
151
- <div class="fe-list__col fe-list__col--size" role="columnheader">{{ t('col.size') }}</div>
152
- <div class="fe-list__col fe-list__col--mod" role="columnheader">{{ t('col.modified') }}</div>
153
- </div>
154
- <div class="fe-list__body" role="rowgroup">
155
- <div
156
- v-for="n in rows"
157
- :key="n.path"
158
- class="fe-list__row"
159
- :class="{
160
- 'is-selected': isSelected(n),
161
- 'is-dir': n.type === 'dir',
162
- 'is-trash': n.trashed,
163
- 'is-clipped': clipped?.has(n.path),
164
- }"
165
- role="row"
166
- tabindex="0"
167
- draggable="true"
168
- @click="onRowClick(n, $event)"
169
- @dblclick="onRowDbl(n)"
170
- @contextmenu="onRowCtx(n, $event)"
171
- @dragstart="onItemDragStart(n, $event)"
172
- @dragover="onItemDragOver(n, $event)"
173
- @drop="onItemDrop(n, $event)"
174
- @touchstart.passive="onTouchStart(n, $event)"
175
- @touchend="cancelPress"
176
- @touchmove="cancelPress"
177
- >
178
- <div class="fe-list__col fe-list__col--star" @click.stop>
179
- <StarButton
180
- v-if="typeof n.id === 'number' && n.type === 'file'"
181
- :starred="!!starredIds?.has(n.id)"
182
- :node-id="n.id"
183
- :api-base="apiBase"
184
- :auth-headers="authHeaders"
185
- compact
186
- @change="(val: boolean) => emit('star-change', n, val)"
187
- />
188
- </div>
189
- <div class="fe-list__col fe-list__col--name">
190
- <span class="fe-list__icon" aria-hidden="true">{{ iconFor(n) }}</span>
191
- <div class="fe-list__name-wrap">
192
- <span class="fe-list__name" :title="n.basename">{{ nodeDisplayName(n) }}</span>
193
- <span
194
- v-if="showParentPath"
195
- class="fe-list__parent"
196
- :title="parentDir(n.path)"
197
- >{{ parentDir(n.path) || '—' }}</span>
198
- </div>
199
- </div>
200
- <div class="fe-list__col fe-list__col--size">
201
- {{ n.type === 'dir' ? '—' : formatSize(n.size) }}
202
- </div>
203
- <div class="fe-list__col fe-list__col--mod">
204
- {{ displayDate(n.last_modified) }}
205
- </div>
206
- </div>
207
- <div v-if="!loading && rows.length === 0" class="fe-list__empty">
208
- {{ t('empty.folder') }}
209
- </div>
210
- </div>
211
- </div>
212
- </template>
1
+ <script setup lang="ts">
2
+ /**
3
+ * ListView — tabular layout (name / size / modified).
4
+ *
5
+ * Selection + context menu + double-click open are caller-owned — we
6
+ * just emit the events and let FileExplorer.vue handle them uniformly
7
+ * across List and Grid.
8
+ */
9
+ import { computed } from 'vue';
10
+ import type { FileNode } from '../types/FileNode';
11
+ import type { LocaleCode } from '../types/ExplorerConfig';
12
+ import { useLocale } from '../composables/useLocale';
13
+ import StarButton from './StarButton.vue';
14
+
15
+ const props = defineProps<{
16
+ files: FileNode[];
17
+ selected: Set<string>;
18
+ /** Paths that were cut → dim them so the user sees the pending move. */
19
+ clipped?: Set<string>;
20
+ /**
21
+ * Show each row's parent directory under the basename. Caller flips
22
+ * this on while a search filter is active so the user can tell
23
+ * `invoice.pdf` (in 2024/) apart from `invoice.pdf` (in 2025/) when
24
+ * both match the same query.
25
+ */
26
+ showParentPath?: boolean;
27
+ locale: LocaleCode;
28
+ loading?: boolean;
29
+ /** Set of node IDs flagged starred by the user — render an inline
30
+ * filled star indicator and let the user toggle it from the row. */
31
+ starredIds?: Set<number>;
32
+ /** Backend base URL + auth header builder forwarded to StarButton
33
+ * so it can POST /api/files/manager/star on click. Optional —
34
+ * embedders without auth wire-up pass nothing and the star column
35
+ * hides itself. */
36
+ apiBase?: string;
37
+ authHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
38
+ }>();
39
+
40
+ const emit = defineEmits<{
41
+ (e: 'click-row', node: FileNode, mod: { ctrl: boolean; shift: boolean }): void;
42
+ (e: 'dbl-row', node: FileNode): void;
43
+ (e: 'context-row', node: FileNode, ev: MouseEvent): void;
44
+ (e: 'item-drag-start', node: FileNode, ev: DragEvent): void;
45
+ (e: 'item-drop-into', target: FileNode, ev: DragEvent): void;
46
+ (e: 'star-change', node: FileNode, value: boolean): void;
47
+ }>();
48
+
49
+ const { t, formatSize, nodeDisplayName } = useLocale(() => props.locale);
50
+
51
+ function isSelected(n: FileNode): boolean {
52
+ return props.selected.has(n.path);
53
+ }
54
+
55
+ function onRowClick(n: FileNode, ev: MouseEvent) {
56
+ emit('click-row', n, { ctrl: ev.ctrlKey || ev.metaKey, shift: ev.shiftKey });
57
+ }
58
+
59
+ function onRowDbl(n: FileNode) {
60
+ emit('dbl-row', n);
61
+ }
62
+
63
+ function onRowCtx(n: FileNode, ev: MouseEvent) {
64
+ // Stop bubbling so the root `@contextmenu` handler doesn't fire and
65
+ // clear the selection we just set.
66
+ ev.preventDefault();
67
+ ev.stopPropagation();
68
+ emit('context-row', n, ev);
69
+ }
70
+
71
+ function onItemDragStart(n: FileNode, ev: DragEvent) {
72
+ emit('item-drag-start', n, ev);
73
+ }
74
+
75
+ function onItemDragOver(n: FileNode, ev: DragEvent) {
76
+ if (n.type !== 'dir') return;
77
+ if (!ev.dataTransfer?.types.includes('application/x-brf-files')) return;
78
+ ev.preventDefault();
79
+ ev.stopPropagation();
80
+ if (ev.dataTransfer) ev.dataTransfer.dropEffect = 'move';
81
+ }
82
+
83
+ function onItemDrop(n: FileNode, ev: DragEvent) {
84
+ if (n.type !== 'dir') return;
85
+ if (!ev.dataTransfer?.types.includes('application/x-brf-files')) return;
86
+ ev.preventDefault();
87
+ ev.stopPropagation();
88
+ emit('item-drop-into', n, ev);
89
+ }
90
+
91
+ let pressTimer: ReturnType<typeof setTimeout> | undefined;
92
+ let pressTarget: FileNode | null = null;
93
+
94
+ function onTouchStart(n: FileNode, ev: TouchEvent) {
95
+ pressTarget = n;
96
+ if (pressTimer) clearTimeout(pressTimer);
97
+ pressTimer = setTimeout(() => {
98
+ if (pressTarget) {
99
+ const t0 = ev.touches[0];
100
+ emit('context-row', pressTarget, {
101
+ clientX: t0.clientX,
102
+ clientY: t0.clientY,
103
+ preventDefault: () => {},
104
+ } as unknown as MouseEvent);
105
+ }
106
+ }, 500);
107
+ }
108
+
109
+ function cancelPress() {
110
+ if (pressTimer) clearTimeout(pressTimer);
111
+ pressTarget = null;
112
+ }
113
+
114
+ function iconFor(n: FileNode): string {
115
+ if (n.mime_type === 'inode/storage') return '💾';
116
+ if (n.type === 'dir') return '📁';
117
+ const e = (n.extension || '').toLowerCase();
118
+ if (['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'avif', 'heic', 'svg'].includes(e)) return '🖼';
119
+ if (['mp4', 'webm', 'mov', 'mkv', 'avi', 'ogv', 'm4v'].includes(e)) return '🎞';
120
+ if (['mp3', 'wav', 'flac', 'ogg', 'm4a', 'aac', 'opus'].includes(e)) return '🎵';
121
+ if (e === 'pdf') return '📕';
122
+ if (['doc', 'docx', 'odt', 'rtf'].includes(e)) return '📄';
123
+ if (['xls', 'xlsx', 'ods', 'csv'].includes(e)) return '📊';
124
+ if (['ppt', 'pptx', 'odp'].includes(e)) return '📽';
125
+ if (['zip', 'tar', 'gz', 'bz2', '7z', 'rar'].includes(e)) return '🗜';
126
+ if (['txt', 'md', 'log', 'json', 'yml', 'yaml', 'xml'].includes(e)) return '📝';
127
+ return '📎';
128
+ }
129
+
130
+ function displayDate(ms: number | undefined): string {
131
+ if (!ms) return '—';
132
+ const d = new Date(ms * (ms < 1e12 ? 1000 : 1));
133
+ return d.toLocaleString();
134
+ }
135
+
136
+ function parentDir(path: string): string {
137
+ const stripped = path.replace(/^[a-z][a-z0-9+.-]*:\/\//i, '');
138
+ const idx = stripped.lastIndexOf('/');
139
+ if (idx === -1) return '';
140
+ return stripped.slice(0, idx);
141
+ }
142
+
143
+ const rows = computed(() => props.files);
144
+ </script>
145
+
146
+ <template>
147
+ <div class="fe-list" :class="{ 'is-loading': loading, 'has-star-col': !!apiBase || apiBase === '' }">
148
+ <div class="fe-list__head" role="row">
149
+ <div class="fe-list__col fe-list__col--star" role="columnheader" aria-label="Star"></div>
150
+ <div class="fe-list__col fe-list__col--name" role="columnheader">{{ t('col.name') }}</div>
151
+ <div class="fe-list__col fe-list__col--size" role="columnheader">{{ t('col.size') }}</div>
152
+ <div class="fe-list__col fe-list__col--mod" role="columnheader">{{ t('col.modified') }}</div>
153
+ </div>
154
+ <div class="fe-list__body" role="rowgroup">
155
+ <div
156
+ v-for="n in rows"
157
+ :key="n.path"
158
+ class="fe-list__row"
159
+ :class="{
160
+ 'is-selected': isSelected(n),
161
+ 'is-dir': n.type === 'dir',
162
+ 'is-trash': n.trashed,
163
+ 'is-clipped': clipped?.has(n.path),
164
+ }"
165
+ role="row"
166
+ tabindex="0"
167
+ draggable="true"
168
+ @click="onRowClick(n, $event)"
169
+ @dblclick="onRowDbl(n)"
170
+ @contextmenu="onRowCtx(n, $event)"
171
+ @dragstart="onItemDragStart(n, $event)"
172
+ @dragover="onItemDragOver(n, $event)"
173
+ @drop="onItemDrop(n, $event)"
174
+ @touchstart.passive="onTouchStart(n, $event)"
175
+ @touchend="cancelPress"
176
+ @touchmove="cancelPress"
177
+ >
178
+ <div class="fe-list__col fe-list__col--star" @click.stop>
179
+ <StarButton
180
+ v-if="typeof n.id === 'number' && n.type === 'file'"
181
+ :starred="!!starredIds?.has(n.id)"
182
+ :node-id="n.id"
183
+ :api-base="apiBase"
184
+ :auth-headers="authHeaders"
185
+ compact
186
+ @change="(val: boolean) => emit('star-change', n, val)"
187
+ />
188
+ </div>
189
+ <div class="fe-list__col fe-list__col--name">
190
+ <span class="fe-list__icon" aria-hidden="true">{{ iconFor(n) }}</span>
191
+ <div class="fe-list__name-wrap">
192
+ <span class="fe-list__name" :title="n.basename">{{ nodeDisplayName(n) }}</span>
193
+ <span
194
+ v-if="showParentPath"
195
+ class="fe-list__parent"
196
+ :title="parentDir(n.path)"
197
+ >{{ parentDir(n.path) || '—' }}</span>
198
+ </div>
199
+ </div>
200
+ <div class="fe-list__col fe-list__col--size">
201
+ {{ formatSize(n.size) }}
202
+ </div>
203
+ <div class="fe-list__col fe-list__col--mod">
204
+ {{ displayDate(n.last_modified) }}
205
+ </div>
206
+ </div>
207
+ <div v-if="!loading && rows.length === 0" class="fe-list__empty">
208
+ {{ t('empty.folder') }}
209
+ </div>
210
+ </div>
211
+ </div>
212
+ </template>
@@ -1,91 +1,91 @@
1
- <script setup lang="ts">
2
- /**
3
- * PendingOpsTray — bottom-left toast list for queued copy/move/delete.
4
- *
5
- * Sits next to UploadProgress visually (offset to its left when both
6
- * are open). Each row shows op type + a progress bar driven by
7
- * `progress_done / progress_total`. Terminal rows linger for a moment
8
- * (RETAIN_MS in usePendingOps) so the final state is visible before
9
- * they fade out.
10
- */
11
- import { computed } from 'vue';
12
- import type { LocaleCode } from '../types/ExplorerConfig';
13
- import type { PendingOp } from '../composables/usePendingOps';
14
- import { useLocale } from '../composables/useLocale';
15
-
16
- const props = defineProps<{
17
- ops: PendingOp[];
18
- locale: LocaleCode;
19
- }>();
20
-
21
- const emit = defineEmits<{
22
- (e: 'dismiss', id: number): void;
23
- }>();
24
-
25
- const { t } = useLocale(() => props.locale);
26
-
27
- const sorted = computed(() => [...props.ops].sort((a, b) => b.id - a.id));
28
-
29
- function percent(op: PendingOp): number {
30
- if (op.status === 'done') return 100;
31
- if (op.progress_total <= 0) return 0;
32
- return Math.min(100, Math.round((op.progress_done / op.progress_total) * 100));
33
- }
34
-
35
- function statusClass(op: PendingOp): string {
36
- if (op.status === 'done') return 'is-done';
37
- if (op.status === 'error') return 'is-error';
38
- return '';
39
- }
40
-
41
- function summary(op: PendingOp): string {
42
- const verb =
43
- op.op_type === 'copy'
44
- ? t('ops.copy')
45
- : op.op_type === 'move'
46
- ? t('ops.move')
47
- : t('ops.delete');
48
- if (op.status === 'pending') return `${verb} (${t('ops.queued')})`;
49
- if (op.status === 'running') return `${verb} ${op.progress_done}/${op.progress_total}`;
50
- if (op.status === 'done') return `${verb} ${t('ops.done')} (${op.progress_total})`;
51
- if (op.status === 'error') return `${verb} ${t('ops.error')}`;
52
- return verb;
53
- }
54
- </script>
55
-
56
- <template>
57
- <transition-group
58
- v-if="sorted.length > 0"
59
- name="fe-ops-slide"
60
- tag="div"
61
- class="fe-ops"
62
- role="status"
63
- aria-live="polite"
64
- >
65
- <div
66
- v-for="op in sorted"
67
- :key="op.id"
68
- class="fe-ops__item"
69
- :class="statusClass(op)"
70
- >
71
- <div class="fe-ops__row">
72
- <span class="fe-ops__title" :title="op.target_path || op.source_dir || ''">
73
- {{ summary(op) }}
74
- </span>
75
- <button
76
- v-if="op.status === 'done' || op.status === 'error'"
77
- type="button"
78
- class="fe-ops__dismiss"
79
- aria-label="Dismiss"
80
- @click="emit('dismiss', op.id)"
81
- >×</button>
82
- </div>
83
- <div class="fe-ops__bar">
84
- <div class="fe-ops__bar-fill" :style="{ width: percent(op) + '%' }" />
85
- </div>
86
- <div v-if="op.status === 'error' && op.error_message" class="fe-ops__error">
87
- {{ op.error_message }}
88
- </div>
89
- </div>
90
- </transition-group>
91
- </template>
1
+ <script setup lang="ts">
2
+ /**
3
+ * PendingOpsTray — bottom-left toast list for queued copy/move/delete.
4
+ *
5
+ * Sits next to UploadProgress visually (offset to its left when both
6
+ * are open). Each row shows op type + a progress bar driven by
7
+ * `progress_done / progress_total`. Terminal rows linger for a moment
8
+ * (RETAIN_MS in usePendingOps) so the final state is visible before
9
+ * they fade out.
10
+ */
11
+ import { computed } from 'vue';
12
+ import type { LocaleCode } from '../types/ExplorerConfig';
13
+ import type { PendingOp } from '../composables/usePendingOps';
14
+ import { useLocale } from '../composables/useLocale';
15
+
16
+ const props = defineProps<{
17
+ ops: PendingOp[];
18
+ locale: LocaleCode;
19
+ }>();
20
+
21
+ const emit = defineEmits<{
22
+ (e: 'dismiss', id: number): void;
23
+ }>();
24
+
25
+ const { t } = useLocale(() => props.locale);
26
+
27
+ const sorted = computed(() => [...props.ops].sort((a, b) => b.id - a.id));
28
+
29
+ function percent(op: PendingOp): number {
30
+ if (op.status === 'done') return 100;
31
+ if (op.progress_total <= 0) return 0;
32
+ return Math.min(100, Math.round((op.progress_done / op.progress_total) * 100));
33
+ }
34
+
35
+ function statusClass(op: PendingOp): string {
36
+ if (op.status === 'done') return 'is-done';
37
+ if (op.status === 'error') return 'is-error';
38
+ return '';
39
+ }
40
+
41
+ function summary(op: PendingOp): string {
42
+ const verb =
43
+ op.op_type === 'copy'
44
+ ? t('ops.copy')
45
+ : op.op_type === 'move'
46
+ ? t('ops.move')
47
+ : t('ops.delete');
48
+ if (op.status === 'pending') return `${verb} (${t('ops.queued')})`;
49
+ if (op.status === 'running') return `${verb} ${op.progress_done}/${op.progress_total}`;
50
+ if (op.status === 'done') return `${verb} ${t('ops.done')} (${op.progress_total})`;
51
+ if (op.status === 'error') return `${verb} ${t('ops.error')}`;
52
+ return verb;
53
+ }
54
+ </script>
55
+
56
+ <template>
57
+ <transition-group
58
+ v-if="sorted.length > 0"
59
+ name="fe-ops-slide"
60
+ tag="div"
61
+ class="fe-ops"
62
+ role="status"
63
+ aria-live="polite"
64
+ >
65
+ <div
66
+ v-for="op in sorted"
67
+ :key="op.id"
68
+ class="fe-ops__item"
69
+ :class="statusClass(op)"
70
+ >
71
+ <div class="fe-ops__row">
72
+ <span class="fe-ops__title" :title="op.target_path || op.source_dir || ''">
73
+ {{ summary(op) }}
74
+ </span>
75
+ <button
76
+ v-if="op.status === 'done' || op.status === 'error'"
77
+ type="button"
78
+ class="fe-ops__dismiss"
79
+ aria-label="Dismiss"
80
+ @click="emit('dismiss', op.id)"
81
+ >×</button>
82
+ </div>
83
+ <div class="fe-ops__bar">
84
+ <div class="fe-ops__bar-fill" :style="{ width: percent(op) + '%' }" />
85
+ </div>
86
+ <div v-if="op.status === 'error' && op.error_message" class="fe-ops__error">
87
+ {{ op.error_message }}
88
+ </div>
89
+ </div>
90
+ </transition-group>
91
+ </template>