@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.
- package/LICENSE +21 -21
- package/README.md +108 -108
- package/dist/{ArchiveViewer-CJdaw5x3.js → ArchiveViewer-CbUUEREI.js} +20 -20
- package/dist/ArchiveViewer-CbUUEREI.js.map +1 -0
- package/dist/{CsvViewer-QYx_tePQ.js → CsvViewer-72rDsQJX.js} +3 -3
- package/dist/CsvViewer-72rDsQJX.js.map +1 -0
- package/dist/{DrawioViewer-GWt0TyB7.js → DrawioViewer-DSyMwGvg.js} +7 -7
- package/dist/DrawioViewer-DSyMwGvg.js.map +1 -0
- package/dist/{EpubViewer-Je0ywklQ.js → EpubViewer-DvDa17d7.js} +3 -3
- package/dist/EpubViewer-DvDa17d7.js.map +1 -0
- package/dist/{IpynbViewer-TsB4gqP-.js → IpynbViewer-DibIkdsz.js} +3 -3
- package/dist/IpynbViewer-DibIkdsz.js.map +1 -0
- package/dist/{MermaidViewer-CXfeDS-7.js → MermaidViewer-BoFLtGvl.js} +3 -3
- package/dist/MermaidViewer-BoFLtGvl.js.map +1 -0
- package/dist/{PsdViewer-VtPpxKVe.js → PsdViewer-K2iZkwax.js} +3 -3
- package/dist/PsdViewer-K2iZkwax.js.map +1 -0
- package/dist/{TiffViewer-OINn9bbb.js → TiffViewer-JzDzbqpO.js} +3 -3
- package/dist/TiffViewer-JzDzbqpO.js.map +1 -0
- package/dist/{Viewer3D-xvvyiWHd.js → Viewer3D-WEMYCP8l.js} +7 -7
- package/dist/Viewer3D-WEMYCP8l.js.map +1 -0
- package/dist/filex-core.js +1 -1
- package/dist/filex-core.umd.cjs +4 -4
- package/dist/filex-core.umd.cjs.map +1 -1
- package/dist/{index-CmSYzt6L.js → index-B5YT-m5Q.js} +209 -209
- package/dist/index-B5YT-m5Q.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/useViewerFetch-czqbd2Lj.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Breadcrumb.vue +282 -282
- package/src/components/ContextMenu.vue +152 -152
- package/src/components/GridView.vue +166 -166
- package/src/components/ListView.vue +212 -212
- package/src/components/PendingOpsTray.vue +91 -91
- package/src/components/RecentlyOpened.vue +155 -155
- package/src/components/StarButton.vue +101 -101
- package/src/components/TagPicker.vue +184 -184
- package/src/components/Toolbar.vue +220 -220
- package/src/components/UploadProgress.vue +78 -78
- package/src/composables/useFileApi.ts +692 -692
- package/src/composables/useKeyboardShortcuts.ts +144 -144
- package/src/composables/useLocale.ts +60 -60
- package/src/composables/useMonacoLoader.ts +98 -98
- package/src/composables/usePendingOps.ts +200 -200
- package/src/composables/useSelection.ts +81 -81
- package/src/composables/useUploadChunked.ts +250 -250
- package/src/composables/useViewerFetch.ts +58 -58
- package/src/index.ts +80 -80
- package/src/locales/en.ts +122 -122
- package/src/locales/index.ts +12 -12
- package/src/locales/tr.ts +122 -122
- package/src/modals/DeleteConfirmModal.vue +32 -32
- package/src/modals/Modal.vue +104 -104
- package/src/modals/NewFolderModal.vue +64 -64
- package/src/modals/PermissionsModal.vue +815 -815
- package/src/modals/PreviewModal.vue +1070 -1070
- package/src/modals/RenameModal.vue +58 -58
- package/src/modals/ShareModal.vue +135 -135
- package/src/styles/base.css +1224 -1224
- package/src/styles/variables.css +90 -90
- package/src/types/FileNode.ts +136 -136
- package/src/types/index.ts +27 -27
- package/src/types/peers.d.ts +45 -45
- package/src/viewers/ArchiveViewer.vue +186 -186
- package/src/viewers/CsvViewer.vue +319 -319
- package/src/viewers/DrawioViewer.vue +243 -243
- package/src/viewers/EpubViewer.vue +307 -307
- package/src/viewers/IpynbViewer.vue +365 -365
- package/src/viewers/MermaidViewer.vue +259 -259
- package/src/viewers/PdfViewer.vue +562 -562
- package/src/viewers/PsdViewer.vue +264 -264
- package/src/viewers/TiffViewer.vue +273 -273
- package/src/viewers/Viewer3D.vue +120 -120
- package/dist/ArchiveViewer-CJdaw5x3.js.map +0 -1
- package/dist/CsvViewer-QYx_tePQ.js.map +0 -1
- package/dist/DrawioViewer-GWt0TyB7.js.map +0 -1
- package/dist/EpubViewer-Je0ywklQ.js.map +0 -1
- package/dist/IpynbViewer-TsB4gqP-.js.map +0 -1
- package/dist/MermaidViewer-CXfeDS-7.js.map +0 -1
- package/dist/PsdViewer-VtPpxKVe.js.map +0 -1
- package/dist/TiffViewer-OINn9bbb.js.map +0 -1
- package/dist/Viewer3D-xvvyiWHd.js.map +0 -1
- package/dist/index-CmSYzt6L.js.map +0 -1
package/src/styles/variables.css
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CSS variables — theme hooks.
|
|
3
|
-
*
|
|
4
|
-
* Consumer overrides by setting `--fe-*` on a higher scope.
|
|
5
|
-
*/
|
|
6
|
-
:root {
|
|
7
|
-
--fe-bg: #ffffff;
|
|
8
|
-
--fe-bg-elev: #f7f8fa;
|
|
9
|
-
--fe-bg-hover: #edf0f5;
|
|
10
|
-
--fe-bg-selected: #dfe8ff;
|
|
11
|
-
--fe-border: #e2e6ed;
|
|
12
|
-
--fe-border-strong: #c7ced9;
|
|
13
|
-
--fe-text: #1a1e27;
|
|
14
|
-
--fe-text-muted: #5a6475;
|
|
15
|
-
--fe-text-on-primary: #ffffff;
|
|
16
|
-
--fe-primary: #3b82f6;
|
|
17
|
-
--fe-primary-hover: #2563eb;
|
|
18
|
-
--fe-danger: #dc2626;
|
|
19
|
-
--fe-danger-hover: #b91c1c;
|
|
20
|
-
--fe-shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
|
|
21
|
-
--fe-shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
|
|
22
|
-
--fe-radius: 8px;
|
|
23
|
-
--fe-radius-sm: 4px;
|
|
24
|
-
--fe-radius-lg: 12px;
|
|
25
|
-
--fe-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
26
|
-
--fe-font-mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
|
|
27
|
-
--fe-gap: 12px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.fe--theme-dark,
|
|
31
|
-
:root[data-theme='dark'] .fe,
|
|
32
|
-
.fe.fe--theme-dark,
|
|
33
|
-
/* Tailwind dark-mode class shipped by the host admin shell —
|
|
34
|
-
* web/src/lib/theme.ts toggles document.documentElement.classList
|
|
35
|
-
* .toggle('dark', dark), so we adopt the same hook here. Without
|
|
36
|
-
* this selector the embedded explorer stayed on the :root light
|
|
37
|
-
* defaults even when the rest of the admin UI flipped dark.
|
|
38
|
-
*
|
|
39
|
-
* The bare `:root.dark` / `.dark` selectors (no `.fe` descendant)
|
|
40
|
-
* also publish the variables at the html-level so non-SFC consumers —
|
|
41
|
-
* the standalone /files/edit Editor.vue route, which doesn't wrap its
|
|
42
|
-
* host div in `.fe` — pick up the dark palette via CSS-variable
|
|
43
|
-
* cascade. v0.1.11 added the bare selectors after operators reported
|
|
44
|
-
* the new tab opening light when the admin panel was dark. */
|
|
45
|
-
:root.dark,
|
|
46
|
-
.dark,
|
|
47
|
-
:root.dark .fe,
|
|
48
|
-
.dark .fe,
|
|
49
|
-
/* Teleported context menu lives outside the `.fe` parent, so we have
|
|
50
|
-
* to apply the same dark-mode variable overrides on its backdrop too —
|
|
51
|
-
* otherwise it stays on the :root light defaults and the menu renders
|
|
52
|
-
* as white-on-white inside dark hosts. */
|
|
53
|
-
.fe-ctx-backdrop--theme-dark,
|
|
54
|
-
.fe-ctx-backdrop--theme-auto[data-prefers-dark='1'] {
|
|
55
|
-
--fe-bg: #0f1419;
|
|
56
|
-
--fe-bg-elev: #161c25;
|
|
57
|
-
--fe-bg-hover: #1f2733;
|
|
58
|
-
--fe-bg-selected: #23324a;
|
|
59
|
-
--fe-border: #2a323e;
|
|
60
|
-
--fe-border-strong: #3a4453;
|
|
61
|
-
--fe-text: #e5e9f0;
|
|
62
|
-
--fe-text-muted: #8b95a7;
|
|
63
|
-
--fe-primary: #60a5fa;
|
|
64
|
-
--fe-primary-hover: #3b82f6;
|
|
65
|
-
--fe-danger: #f87171;
|
|
66
|
-
--fe-danger-hover: #ef4444;
|
|
67
|
-
--fe-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
|
|
68
|
-
--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@media (prefers-color-scheme: dark) {
|
|
72
|
-
.fe:not(.fe--theme-light),
|
|
73
|
-
/* Same trick for the teleported backdrop in auto mode. */
|
|
74
|
-
.fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light) {
|
|
75
|
-
--fe-bg: #0f1419;
|
|
76
|
-
--fe-bg-elev: #161c25;
|
|
77
|
-
--fe-bg-hover: #1f2733;
|
|
78
|
-
--fe-bg-selected: #23324a;
|
|
79
|
-
--fe-border: #2a323e;
|
|
80
|
-
--fe-border-strong: #3a4453;
|
|
81
|
-
--fe-text: #e5e9f0;
|
|
82
|
-
--fe-text-muted: #8b95a7;
|
|
83
|
-
--fe-primary: #60a5fa;
|
|
84
|
-
--fe-primary-hover: #3b82f6;
|
|
85
|
-
--fe-danger: #f87171;
|
|
86
|
-
--fe-danger-hover: #ef4444;
|
|
87
|
-
--fe-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
|
|
88
|
-
--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* CSS variables — theme hooks.
|
|
3
|
+
*
|
|
4
|
+
* Consumer overrides by setting `--fe-*` on a higher scope.
|
|
5
|
+
*/
|
|
6
|
+
:root {
|
|
7
|
+
--fe-bg: #ffffff;
|
|
8
|
+
--fe-bg-elev: #f7f8fa;
|
|
9
|
+
--fe-bg-hover: #edf0f5;
|
|
10
|
+
--fe-bg-selected: #dfe8ff;
|
|
11
|
+
--fe-border: #e2e6ed;
|
|
12
|
+
--fe-border-strong: #c7ced9;
|
|
13
|
+
--fe-text: #1a1e27;
|
|
14
|
+
--fe-text-muted: #5a6475;
|
|
15
|
+
--fe-text-on-primary: #ffffff;
|
|
16
|
+
--fe-primary: #3b82f6;
|
|
17
|
+
--fe-primary-hover: #2563eb;
|
|
18
|
+
--fe-danger: #dc2626;
|
|
19
|
+
--fe-danger-hover: #b91c1c;
|
|
20
|
+
--fe-shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
|
|
21
|
+
--fe-shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
|
|
22
|
+
--fe-radius: 8px;
|
|
23
|
+
--fe-radius-sm: 4px;
|
|
24
|
+
--fe-radius-lg: 12px;
|
|
25
|
+
--fe-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
26
|
+
--fe-font-mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
|
|
27
|
+
--fe-gap: 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.fe--theme-dark,
|
|
31
|
+
:root[data-theme='dark'] .fe,
|
|
32
|
+
.fe.fe--theme-dark,
|
|
33
|
+
/* Tailwind dark-mode class shipped by the host admin shell —
|
|
34
|
+
* web/src/lib/theme.ts toggles document.documentElement.classList
|
|
35
|
+
* .toggle('dark', dark), so we adopt the same hook here. Without
|
|
36
|
+
* this selector the embedded explorer stayed on the :root light
|
|
37
|
+
* defaults even when the rest of the admin UI flipped dark.
|
|
38
|
+
*
|
|
39
|
+
* The bare `:root.dark` / `.dark` selectors (no `.fe` descendant)
|
|
40
|
+
* also publish the variables at the html-level so non-SFC consumers —
|
|
41
|
+
* the standalone /files/edit Editor.vue route, which doesn't wrap its
|
|
42
|
+
* host div in `.fe` — pick up the dark palette via CSS-variable
|
|
43
|
+
* cascade. v0.1.11 added the bare selectors after operators reported
|
|
44
|
+
* the new tab opening light when the admin panel was dark. */
|
|
45
|
+
:root.dark,
|
|
46
|
+
.dark,
|
|
47
|
+
:root.dark .fe,
|
|
48
|
+
.dark .fe,
|
|
49
|
+
/* Teleported context menu lives outside the `.fe` parent, so we have
|
|
50
|
+
* to apply the same dark-mode variable overrides on its backdrop too —
|
|
51
|
+
* otherwise it stays on the :root light defaults and the menu renders
|
|
52
|
+
* as white-on-white inside dark hosts. */
|
|
53
|
+
.fe-ctx-backdrop--theme-dark,
|
|
54
|
+
.fe-ctx-backdrop--theme-auto[data-prefers-dark='1'] {
|
|
55
|
+
--fe-bg: #0f1419;
|
|
56
|
+
--fe-bg-elev: #161c25;
|
|
57
|
+
--fe-bg-hover: #1f2733;
|
|
58
|
+
--fe-bg-selected: #23324a;
|
|
59
|
+
--fe-border: #2a323e;
|
|
60
|
+
--fe-border-strong: #3a4453;
|
|
61
|
+
--fe-text: #e5e9f0;
|
|
62
|
+
--fe-text-muted: #8b95a7;
|
|
63
|
+
--fe-primary: #60a5fa;
|
|
64
|
+
--fe-primary-hover: #3b82f6;
|
|
65
|
+
--fe-danger: #f87171;
|
|
66
|
+
--fe-danger-hover: #ef4444;
|
|
67
|
+
--fe-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
|
|
68
|
+
--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (prefers-color-scheme: dark) {
|
|
72
|
+
.fe:not(.fe--theme-light),
|
|
73
|
+
/* Same trick for the teleported backdrop in auto mode. */
|
|
74
|
+
.fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light) {
|
|
75
|
+
--fe-bg: #0f1419;
|
|
76
|
+
--fe-bg-elev: #161c25;
|
|
77
|
+
--fe-bg-hover: #1f2733;
|
|
78
|
+
--fe-bg-selected: #23324a;
|
|
79
|
+
--fe-border: #2a323e;
|
|
80
|
+
--fe-border-strong: #3a4453;
|
|
81
|
+
--fe-text: #e5e9f0;
|
|
82
|
+
--fe-text-muted: #8b95a7;
|
|
83
|
+
--fe-primary: #60a5fa;
|
|
84
|
+
--fe-primary-hover: #3b82f6;
|
|
85
|
+
--fe-danger: #f87171;
|
|
86
|
+
--fe-danger-hover: #ef4444;
|
|
87
|
+
--fe-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
|
|
88
|
+
--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/types/FileNode.ts
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FileNode — node shape returned by the manager endpoint.
|
|
3
|
-
*
|
|
4
|
-
* Backend `?q=index` (or `GET /api/files/manager?action=index`) returns:
|
|
5
|
-
* { adapter, storages, dirname, files: FileNode[] }
|
|
6
|
-
*/
|
|
7
|
-
export interface FileNode {
|
|
8
|
-
/** DB node ID — needed by the per-user meta routes (starred, tags,
|
|
9
|
-
* recently-opened). Backend's projectFileNodes() emits it for every
|
|
10
|
-
* row; only client-synthesized rows (e.g. multi-storage virtual
|
|
11
|
-
* folders) lack one. */
|
|
12
|
-
id?: number;
|
|
13
|
-
/** Full adapter-qualified path: `local://receipts/2024/invoice.pdf` */
|
|
14
|
-
path: string;
|
|
15
|
-
/** Relative basename: `invoice.pdf` */
|
|
16
|
-
basename: string;
|
|
17
|
-
/** Adapter-stripped relative path: `receipts/2024/invoice.pdf` */
|
|
18
|
-
relativePath?: string;
|
|
19
|
-
/** `file` or `dir` */
|
|
20
|
-
type: 'file' | 'dir';
|
|
21
|
-
/** Extension (lowercased, no dot). Empty string = no extension. */
|
|
22
|
-
extension?: string;
|
|
23
|
-
/** Bytes. 0 = directory. */
|
|
24
|
-
size?: number;
|
|
25
|
-
/** Unix ms (backend "last_modified"). */
|
|
26
|
-
last_modified?: number;
|
|
27
|
-
/** MIME. */
|
|
28
|
-
mime_type?: string;
|
|
29
|
-
/** Optional thumbnail URL (backend may inline). */
|
|
30
|
-
thumb_url?: string | null;
|
|
31
|
-
/** Visibility: private | public. */
|
|
32
|
-
visibility?: 'private' | 'public';
|
|
33
|
-
/** File count for directories. */
|
|
34
|
-
count?: number;
|
|
35
|
-
/** Client-side tag (localStorage or backend). */
|
|
36
|
-
starred?: boolean;
|
|
37
|
-
/** Hex color tag. */
|
|
38
|
-
color?: string | null;
|
|
39
|
-
/** Server-side trash marker. */
|
|
40
|
-
trashed?: boolean;
|
|
41
|
-
/** RBAC effective level for the current user on this entry (backend
|
|
42
|
-
* projectFileNodes emits it when a storage has RBAC on). '' / undefined =
|
|
43
|
-
* ACL not enforced. Used to gate edit/manage affordances client-side. */
|
|
44
|
-
perm?: 'none' | 'viewer' | 'editor' | 'owner';
|
|
45
|
-
/** Generic — any additional fields the backend wants to inline. */
|
|
46
|
-
[k: string]: unknown;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface ShareInfo {
|
|
50
|
-
uuid: string;
|
|
51
|
-
url: string;
|
|
52
|
-
password_pin?: string | null;
|
|
53
|
-
expires_at?: string | null;
|
|
54
|
-
max_downloads?: number | null;
|
|
55
|
-
downloads?: number;
|
|
56
|
-
created_at?: string;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface UploadLimits {
|
|
60
|
-
max_upload_mb: number;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export type ExternalServiceState = 'ok' | 'error' | 'disabled' | 'unknown';
|
|
64
|
-
|
|
65
|
-
export interface ExternalServiceStatus {
|
|
66
|
-
enabled: boolean;
|
|
67
|
-
state: ExternalServiceState;
|
|
68
|
-
url?: string;
|
|
69
|
-
last_check?: string;
|
|
70
|
-
detail?: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface Capabilities {
|
|
74
|
-
ffmpeg?: boolean;
|
|
75
|
-
ghostscript?: boolean;
|
|
76
|
-
libreoffice?: boolean;
|
|
77
|
-
onlyoffice_url?: string | null;
|
|
78
|
-
drawio_url?: string | null;
|
|
79
|
-
convert_url?: string | null;
|
|
80
|
-
max_chunk_mb?: number;
|
|
81
|
-
upload_limit_mb?: number;
|
|
82
|
-
external?: {
|
|
83
|
-
onlyoffice?: ExternalServiceStatus;
|
|
84
|
-
drawio?: ExternalServiceStatus;
|
|
85
|
-
mermaid?: ExternalServiceStatus;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** Single source of truth for "is the IdP/editor/diagram service ready?".
|
|
90
|
-
* A capability is usable only when both flags say so — `enabled=true` but
|
|
91
|
-
* `state='error'` means an operator turned it on but a probe just failed,
|
|
92
|
-
* and we'd rather hide the entry than offer a button that 500s on click.
|
|
93
|
-
*/
|
|
94
|
-
export function isExternalUsable(s: ExternalServiceStatus | undefined): boolean {
|
|
95
|
-
return !!s && s.enabled && s.state === 'ok';
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface UploadInitResponse {
|
|
99
|
-
uploadId: string;
|
|
100
|
-
parts: Array<{ partNumber: number; presignedUrl: string }>;
|
|
101
|
-
expiresAt: string;
|
|
102
|
-
s3Key?: string;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface UploadFinalizeResponse {
|
|
106
|
-
s3Key: string;
|
|
107
|
-
url?: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface ArchiveEntry {
|
|
111
|
-
name: string;
|
|
112
|
-
size: number;
|
|
113
|
-
isDir: boolean;
|
|
114
|
-
lastModified?: number;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export type ViewMode = 'list' | 'grid';
|
|
118
|
-
|
|
119
|
-
export interface ClipboardState {
|
|
120
|
-
mode: 'cut' | 'copy' | null;
|
|
121
|
-
items: FileNode[];
|
|
122
|
-
sourcePath: string | null;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** A soft-deleted node as returned by the filex trash listing endpoint. */
|
|
126
|
-
export interface TrashEntry {
|
|
127
|
-
id: number;
|
|
128
|
-
storage_id: number;
|
|
129
|
-
storage_name?: string;
|
|
130
|
-
path: string;
|
|
131
|
-
name: string;
|
|
132
|
-
size: number;
|
|
133
|
-
mime?: string;
|
|
134
|
-
deleted_at: string;
|
|
135
|
-
ttl_days?: number | null;
|
|
136
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* FileNode — node shape returned by the manager endpoint.
|
|
3
|
+
*
|
|
4
|
+
* Backend `?q=index` (or `GET /api/files/manager?action=index`) returns:
|
|
5
|
+
* { adapter, storages, dirname, files: FileNode[] }
|
|
6
|
+
*/
|
|
7
|
+
export interface FileNode {
|
|
8
|
+
/** DB node ID — needed by the per-user meta routes (starred, tags,
|
|
9
|
+
* recently-opened). Backend's projectFileNodes() emits it for every
|
|
10
|
+
* row; only client-synthesized rows (e.g. multi-storage virtual
|
|
11
|
+
* folders) lack one. */
|
|
12
|
+
id?: number;
|
|
13
|
+
/** Full adapter-qualified path: `local://receipts/2024/invoice.pdf` */
|
|
14
|
+
path: string;
|
|
15
|
+
/** Relative basename: `invoice.pdf` */
|
|
16
|
+
basename: string;
|
|
17
|
+
/** Adapter-stripped relative path: `receipts/2024/invoice.pdf` */
|
|
18
|
+
relativePath?: string;
|
|
19
|
+
/** `file` or `dir` */
|
|
20
|
+
type: 'file' | 'dir';
|
|
21
|
+
/** Extension (lowercased, no dot). Empty string = no extension. */
|
|
22
|
+
extension?: string;
|
|
23
|
+
/** Bytes. 0 = directory. */
|
|
24
|
+
size?: number;
|
|
25
|
+
/** Unix ms (backend "last_modified"). */
|
|
26
|
+
last_modified?: number;
|
|
27
|
+
/** MIME. */
|
|
28
|
+
mime_type?: string;
|
|
29
|
+
/** Optional thumbnail URL (backend may inline). */
|
|
30
|
+
thumb_url?: string | null;
|
|
31
|
+
/** Visibility: private | public. */
|
|
32
|
+
visibility?: 'private' | 'public';
|
|
33
|
+
/** File count for directories. */
|
|
34
|
+
count?: number;
|
|
35
|
+
/** Client-side tag (localStorage or backend). */
|
|
36
|
+
starred?: boolean;
|
|
37
|
+
/** Hex color tag. */
|
|
38
|
+
color?: string | null;
|
|
39
|
+
/** Server-side trash marker. */
|
|
40
|
+
trashed?: boolean;
|
|
41
|
+
/** RBAC effective level for the current user on this entry (backend
|
|
42
|
+
* projectFileNodes emits it when a storage has RBAC on). '' / undefined =
|
|
43
|
+
* ACL not enforced. Used to gate edit/manage affordances client-side. */
|
|
44
|
+
perm?: 'none' | 'viewer' | 'editor' | 'owner';
|
|
45
|
+
/** Generic — any additional fields the backend wants to inline. */
|
|
46
|
+
[k: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ShareInfo {
|
|
50
|
+
uuid: string;
|
|
51
|
+
url: string;
|
|
52
|
+
password_pin?: string | null;
|
|
53
|
+
expires_at?: string | null;
|
|
54
|
+
max_downloads?: number | null;
|
|
55
|
+
downloads?: number;
|
|
56
|
+
created_at?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface UploadLimits {
|
|
60
|
+
max_upload_mb: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type ExternalServiceState = 'ok' | 'error' | 'disabled' | 'unknown';
|
|
64
|
+
|
|
65
|
+
export interface ExternalServiceStatus {
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
state: ExternalServiceState;
|
|
68
|
+
url?: string;
|
|
69
|
+
last_check?: string;
|
|
70
|
+
detail?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface Capabilities {
|
|
74
|
+
ffmpeg?: boolean;
|
|
75
|
+
ghostscript?: boolean;
|
|
76
|
+
libreoffice?: boolean;
|
|
77
|
+
onlyoffice_url?: string | null;
|
|
78
|
+
drawio_url?: string | null;
|
|
79
|
+
convert_url?: string | null;
|
|
80
|
+
max_chunk_mb?: number;
|
|
81
|
+
upload_limit_mb?: number;
|
|
82
|
+
external?: {
|
|
83
|
+
onlyoffice?: ExternalServiceStatus;
|
|
84
|
+
drawio?: ExternalServiceStatus;
|
|
85
|
+
mermaid?: ExternalServiceStatus;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Single source of truth for "is the IdP/editor/diagram service ready?".
|
|
90
|
+
* A capability is usable only when both flags say so — `enabled=true` but
|
|
91
|
+
* `state='error'` means an operator turned it on but a probe just failed,
|
|
92
|
+
* and we'd rather hide the entry than offer a button that 500s on click.
|
|
93
|
+
*/
|
|
94
|
+
export function isExternalUsable(s: ExternalServiceStatus | undefined): boolean {
|
|
95
|
+
return !!s && s.enabled && s.state === 'ok';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface UploadInitResponse {
|
|
99
|
+
uploadId: string;
|
|
100
|
+
parts: Array<{ partNumber: number; presignedUrl: string }>;
|
|
101
|
+
expiresAt: string;
|
|
102
|
+
s3Key?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface UploadFinalizeResponse {
|
|
106
|
+
s3Key: string;
|
|
107
|
+
url?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ArchiveEntry {
|
|
111
|
+
name: string;
|
|
112
|
+
size: number;
|
|
113
|
+
isDir: boolean;
|
|
114
|
+
lastModified?: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type ViewMode = 'list' | 'grid';
|
|
118
|
+
|
|
119
|
+
export interface ClipboardState {
|
|
120
|
+
mode: 'cut' | 'copy' | null;
|
|
121
|
+
items: FileNode[];
|
|
122
|
+
sourcePath: string | null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** A soft-deleted node as returned by the filex trash listing endpoint. */
|
|
126
|
+
export interface TrashEntry {
|
|
127
|
+
id: number;
|
|
128
|
+
storage_id: number;
|
|
129
|
+
storage_name?: string;
|
|
130
|
+
path: string;
|
|
131
|
+
name: string;
|
|
132
|
+
size: number;
|
|
133
|
+
mime?: string;
|
|
134
|
+
deleted_at: string;
|
|
135
|
+
ttl_days?: number | null;
|
|
136
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @brftech/filex-core — public types.
|
|
3
|
-
*
|
|
4
|
-
* Types are split across two files for legacy reasons; this barrel
|
|
5
|
-
* re-exports the lot so consumers only ever need the package root.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export type {
|
|
9
|
-
ExplorerConfig,
|
|
10
|
-
ExplorerEmits,
|
|
11
|
-
AuthConfig,
|
|
12
|
-
ThemeMode,
|
|
13
|
-
LocaleCode,
|
|
14
|
-
EndpointMap,
|
|
15
|
-
} from './ExplorerConfig';
|
|
16
|
-
|
|
17
|
-
export type {
|
|
18
|
-
FileNode,
|
|
19
|
-
ShareInfo,
|
|
20
|
-
UploadLimits,
|
|
21
|
-
Capabilities,
|
|
22
|
-
UploadInitResponse,
|
|
23
|
-
UploadFinalizeResponse,
|
|
24
|
-
ArchiveEntry,
|
|
25
|
-
ViewMode,
|
|
26
|
-
ClipboardState,
|
|
27
|
-
} from './FileNode';
|
|
1
|
+
/**
|
|
2
|
+
* @brftech/filex-core — public types.
|
|
3
|
+
*
|
|
4
|
+
* Types are split across two files for legacy reasons; this barrel
|
|
5
|
+
* re-exports the lot so consumers only ever need the package root.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type {
|
|
9
|
+
ExplorerConfig,
|
|
10
|
+
ExplorerEmits,
|
|
11
|
+
AuthConfig,
|
|
12
|
+
ThemeMode,
|
|
13
|
+
LocaleCode,
|
|
14
|
+
EndpointMap,
|
|
15
|
+
} from './ExplorerConfig';
|
|
16
|
+
|
|
17
|
+
export type {
|
|
18
|
+
FileNode,
|
|
19
|
+
ShareInfo,
|
|
20
|
+
UploadLimits,
|
|
21
|
+
Capabilities,
|
|
22
|
+
UploadInitResponse,
|
|
23
|
+
UploadFinalizeResponse,
|
|
24
|
+
ArchiveEntry,
|
|
25
|
+
ViewMode,
|
|
26
|
+
ClipboardState,
|
|
27
|
+
} from './FileNode';
|
package/src/types/peers.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type shims for peer-style optional dependencies.
|
|
3
|
-
*
|
|
4
|
-
* These libraries are lazy-loaded via dynamic import and listed under
|
|
5
|
-
* `peerDependenciesMeta.optional` (and `optionalDependencies` for
|
|
6
|
-
* convenience). We don't want hard `@types/*` deps just to please the
|
|
7
|
-
* compiler, so we declare them as `any` here. The dynamic import call
|
|
8
|
-
* sites cast through `any` anyway.
|
|
9
|
-
*
|
|
10
|
-
* Keep in sync with packages/webcomponent/src/peers.d.ts and
|
|
11
|
-
* packages/react/src/peers.d.ts — the rolled-up `dist/index.d.ts`
|
|
12
|
-
* forwards these references and vue-tsc walks the type graph in the
|
|
13
|
-
* sibling packages, so the same shims must live there too.
|
|
14
|
-
*/
|
|
15
|
-
declare module 'markdown-it';
|
|
16
|
-
declare module 'highlight.js';
|
|
17
|
-
declare module 'monaco-editor';
|
|
18
|
-
declare module '@google/model-viewer';
|
|
19
|
-
declare module 'epubjs';
|
|
20
|
-
declare module 'mermaid';
|
|
21
|
-
declare module 'utif';
|
|
22
|
-
declare module 'ag-psd';
|
|
23
|
-
declare module 'pdfjs-dist';
|
|
24
|
-
declare module 'pdfjs-dist/legacy/build/pdf';
|
|
25
|
-
declare module 'pdfjs-dist/build/pdf.worker.min';
|
|
26
|
-
declare module 'papaparse';
|
|
27
|
-
declare module 'katex';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Custom element registered by `@google/model-viewer` — keeps the
|
|
31
|
-
* compiler happy when the SFC template includes `<model-viewer>`.
|
|
32
|
-
*/
|
|
33
|
-
declare namespace JSX {
|
|
34
|
-
interface IntrinsicElements {
|
|
35
|
-
'model-viewer': {
|
|
36
|
-
src?: string;
|
|
37
|
-
alt?: string;
|
|
38
|
-
'auto-rotate'?: boolean | string;
|
|
39
|
-
'camera-controls'?: boolean | string;
|
|
40
|
-
'touch-action'?: string;
|
|
41
|
-
'shadow-intensity'?: string | number;
|
|
42
|
-
[key: string]: unknown;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Type shims for peer-style optional dependencies.
|
|
3
|
+
*
|
|
4
|
+
* These libraries are lazy-loaded via dynamic import and listed under
|
|
5
|
+
* `peerDependenciesMeta.optional` (and `optionalDependencies` for
|
|
6
|
+
* convenience). We don't want hard `@types/*` deps just to please the
|
|
7
|
+
* compiler, so we declare them as `any` here. The dynamic import call
|
|
8
|
+
* sites cast through `any` anyway.
|
|
9
|
+
*
|
|
10
|
+
* Keep in sync with packages/webcomponent/src/peers.d.ts and
|
|
11
|
+
* packages/react/src/peers.d.ts — the rolled-up `dist/index.d.ts`
|
|
12
|
+
* forwards these references and vue-tsc walks the type graph in the
|
|
13
|
+
* sibling packages, so the same shims must live there too.
|
|
14
|
+
*/
|
|
15
|
+
declare module 'markdown-it';
|
|
16
|
+
declare module 'highlight.js';
|
|
17
|
+
declare module 'monaco-editor';
|
|
18
|
+
declare module '@google/model-viewer';
|
|
19
|
+
declare module 'epubjs';
|
|
20
|
+
declare module 'mermaid';
|
|
21
|
+
declare module 'utif';
|
|
22
|
+
declare module 'ag-psd';
|
|
23
|
+
declare module 'pdfjs-dist';
|
|
24
|
+
declare module 'pdfjs-dist/legacy/build/pdf';
|
|
25
|
+
declare module 'pdfjs-dist/build/pdf.worker.min';
|
|
26
|
+
declare module 'papaparse';
|
|
27
|
+
declare module 'katex';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Custom element registered by `@google/model-viewer` — keeps the
|
|
31
|
+
* compiler happy when the SFC template includes `<model-viewer>`.
|
|
32
|
+
*/
|
|
33
|
+
declare namespace JSX {
|
|
34
|
+
interface IntrinsicElements {
|
|
35
|
+
'model-viewer': {
|
|
36
|
+
src?: string;
|
|
37
|
+
alt?: string;
|
|
38
|
+
'auto-rotate'?: boolean | string;
|
|
39
|
+
'camera-controls'?: boolean | string;
|
|
40
|
+
'touch-action'?: string;
|
|
41
|
+
'shadow-intensity'?: string | number;
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|