@brftech/filex-core 0.1.56 → 0.1.60

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,58 +1,58 @@
1
- <script setup lang="ts">
2
- import { ref, watch } from 'vue';
3
- import type { LocaleCode } from '../types/ExplorerConfig';
4
- import { useLocale } from '../composables/useLocale';
5
- import Modal from './Modal.vue';
6
-
7
- const props = defineProps<{
8
- open: boolean;
9
- locale: LocaleCode;
10
- currentName: string;
11
- }>();
12
-
13
- const emit = defineEmits<{
14
- (e: 'close'): void;
15
- (e: 'submit', name: string): void;
16
- }>();
17
-
18
- const { t } = useLocale(() => props.locale);
19
- const name = ref('');
20
-
21
- watch(
22
- () => [props.open, props.currentName] as const,
23
- ([isOpen, cur]) => {
24
- if (isOpen) {
25
- name.value = cur;
26
- }
27
- },
28
- );
29
-
30
- function submit() {
31
- const clean = name.value.trim();
32
- if (!clean) return;
33
- if (/[\\/]/.test(clean) || clean === '.' || clean === '..') return;
34
- emit('submit', clean);
35
- }
36
- </script>
37
-
38
- <template>
39
- <Modal :open="open" :title="t('modal.rename.title')" size="sm" @close="emit('close')">
40
- <form @submit.prevent="submit">
41
- <input
42
- v-model="name"
43
- type="text"
44
- class="fe-input"
45
- autocomplete="off"
46
- @keydown.enter.prevent="submit"
47
- />
48
- </form>
49
- <template #actions>
50
- <button type="button" class="fe-btn" @click="emit('close')">
51
- {{ t('modal.rename.cancel') }}
52
- </button>
53
- <button type="button" class="fe-btn fe-btn--primary" @click="submit">
54
- {{ t('modal.rename.save') }}
55
- </button>
56
- </template>
57
- </Modal>
58
- </template>
1
+ <script setup lang="ts">
2
+ import { ref, watch } from 'vue';
3
+ import type { LocaleCode } from '../types/ExplorerConfig';
4
+ import { useLocale } from '../composables/useLocale';
5
+ import Modal from './Modal.vue';
6
+
7
+ const props = defineProps<{
8
+ open: boolean;
9
+ locale: LocaleCode;
10
+ currentName: string;
11
+ }>();
12
+
13
+ const emit = defineEmits<{
14
+ (e: 'close'): void;
15
+ (e: 'submit', name: string): void;
16
+ }>();
17
+
18
+ const { t } = useLocale(() => props.locale);
19
+ const name = ref('');
20
+
21
+ watch(
22
+ () => [props.open, props.currentName] as const,
23
+ ([isOpen, cur]) => {
24
+ if (isOpen) {
25
+ name.value = cur;
26
+ }
27
+ },
28
+ );
29
+
30
+ function submit() {
31
+ const clean = name.value.trim();
32
+ if (!clean) return;
33
+ if (/[\\/]/.test(clean) || clean === '.' || clean === '..') return;
34
+ emit('submit', clean);
35
+ }
36
+ </script>
37
+
38
+ <template>
39
+ <Modal :open="open" :title="t('modal.rename.title')" size="sm" @close="emit('close')">
40
+ <form @submit.prevent="submit">
41
+ <input
42
+ v-model="name"
43
+ type="text"
44
+ class="fe-input"
45
+ autocomplete="off"
46
+ @keydown.enter.prevent="submit"
47
+ />
48
+ </form>
49
+ <template #actions>
50
+ <button type="button" class="fe-btn" @click="emit('close')">
51
+ {{ t('modal.rename.cancel') }}
52
+ </button>
53
+ <button type="button" class="fe-btn fe-btn--primary" @click="submit">
54
+ {{ t('modal.rename.save') }}
55
+ </button>
56
+ </template>
57
+ </Modal>
58
+ </template>
@@ -1,135 +1,135 @@
1
- <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue';
3
- import type { LocaleCode } from '../types/ExplorerConfig';
4
- import type { ShareInfo } from '../types/FileNode';
5
- import { useLocale } from '../composables/useLocale';
6
- import Modal from './Modal.vue';
7
-
8
- const props = defineProps<{
9
- open: boolean;
10
- locale: LocaleCode;
11
- share?: (ShareInfo & { url: string; filename?: string }) | null;
12
- }>();
13
-
14
- const emit = defineEmits<{
15
- (e: 'close'): void;
16
- (
17
- e: 'submit',
18
- payload: { password: boolean; expires_at: string | null; max_downloads: number | null },
19
- ): void;
20
- (e: 'toast', msg: string): void;
21
- }>();
22
-
23
- const { t } = useLocale(() => props.locale);
24
-
25
- const usePin = ref(false);
26
- const expiresAt = ref<string>('');
27
- const maxDownloads = ref<string>('');
28
-
29
- watch(() => props.open, (v) => {
30
- if (v) {
31
- usePin.value = false;
32
- expiresAt.value = '';
33
- maxDownloads.value = '';
34
- }
35
- });
36
-
37
- function submit() {
38
- emit('submit', {
39
- password: usePin.value,
40
- expires_at: expiresAt.value ? new Date(expiresAt.value).toISOString() : null,
41
- max_downloads: maxDownloads.value ? Number(maxDownloads.value) : null,
42
- });
43
- }
44
-
45
- async function copy(value: string, toast: string) {
46
- try {
47
- await navigator.clipboard.writeText(value);
48
- emit('toast', toast);
49
- } catch {
50
- /* no-op */
51
- }
52
- }
53
-
54
- // Wrap a value in single quotes for safe paste into a POSIX shell —
55
- // embedded single quotes become the standard '\'' dance.
56
- function shQuote(value: string): string {
57
- return `'${value.replace(/'/g, `'\\''`)}'`;
58
- }
59
-
60
- // One-line curl that downloads the shared file straight onto a server.
61
- // The PIN (if any) rides in the querystring — HandleDownload accepts
62
- // ?pin=, and -L follows the 302 to the presigned URL for S3 storages.
63
- const cliCommand = computed(() => {
64
- const sh = props.share;
65
- if (!sh) return '';
66
- let url = sh.url;
67
- if (sh.password_pin) {
68
- url += (url.includes('?') ? '&' : '?') + 'pin=' + encodeURIComponent(sh.password_pin);
69
- }
70
- // Prefer an explicit output name; fall back to the server's
71
- // Content-Disposition filename (-OJ) when we don't know it.
72
- const target = sh.filename ? `-o ${shQuote(sh.filename)} ` : '-OJ ';
73
- return `curl -fSL ${target}${shQuote(url)}`;
74
- });
75
- </script>
76
-
77
- <template>
78
- <Modal :open="open" :title="t('modal.share.title')" size="md" @close="emit('close')">
79
- <template v-if="!share">
80
- <form class="fe-form" @submit.prevent="submit">
81
- <label class="fe-form__row">
82
- <input v-model="usePin" type="checkbox" />
83
- <span>{{ t('modal.share.pin') }}</span>
84
- </label>
85
- <label class="fe-form__row fe-form__row--stack">
86
- <span>{{ t('modal.share.expires') }}</span>
87
- <input v-model="expiresAt" type="datetime-local" class="fe-input" />
88
- </label>
89
- <label class="fe-form__row fe-form__row--stack">
90
- <span>{{ t('modal.share.max_downloads') }}</span>
91
- <input v-model="maxDownloads" type="number" min="1" class="fe-input" />
92
- </label>
93
- </form>
94
- </template>
95
- <template v-else>
96
- <div class="fe-share-result">
97
- <div class="fe-share-result__row">
98
- <label>Link</label>
99
- <div class="fe-share-result__copy">
100
- <input :value="share.url" readonly class="fe-input" />
101
- <button type="button" class="fe-btn" @click="copy(share.url, t('modal.share.url_copied'))">
102
- {{ t('modal.share.copy') }}
103
- </button>
104
- </div>
105
- </div>
106
- <div v-if="share.password_pin" class="fe-share-result__row">
107
- <label>PIN</label>
108
- <div class="fe-share-result__copy">
109
- <input :value="share.password_pin" readonly class="fe-input fe-input--mono" />
110
- <button type="button" class="fe-btn" @click="copy(share.password_pin, t('modal.share.pin_copied'))">
111
- {{ t('modal.share.copy') }}
112
- </button>
113
- </div>
114
- </div>
115
- <div class="fe-share-result__row">
116
- <label>CLI</label>
117
- <div class="fe-share-result__copy">
118
- <input :value="cliCommand" readonly class="fe-input fe-input--mono" />
119
- <button type="button" class="fe-btn" @click="copy(cliCommand, t('modal.share.cli_copied'))">
120
- {{ t('modal.share.copy') }}
121
- </button>
122
- </div>
123
- </div>
124
- </div>
125
- </template>
126
- <template #actions>
127
- <button type="button" class="fe-btn" @click="emit('close')">
128
- {{ share ? 'Kapat' : t('modal.share.cancel') }}
129
- </button>
130
- <button v-if="!share" type="button" class="fe-btn fe-btn--primary" @click="submit">
131
- {{ t('modal.share.create') }}
132
- </button>
133
- </template>
134
- </Modal>
135
- </template>
1
+ <script setup lang="ts">
2
+ import { computed, ref, watch } from 'vue';
3
+ import type { LocaleCode } from '../types/ExplorerConfig';
4
+ import type { ShareInfo } from '../types/FileNode';
5
+ import { useLocale } from '../composables/useLocale';
6
+ import Modal from './Modal.vue';
7
+
8
+ const props = defineProps<{
9
+ open: boolean;
10
+ locale: LocaleCode;
11
+ share?: (ShareInfo & { url: string; filename?: string }) | null;
12
+ }>();
13
+
14
+ const emit = defineEmits<{
15
+ (e: 'close'): void;
16
+ (
17
+ e: 'submit',
18
+ payload: { password: boolean; expires_at: string | null; max_downloads: number | null },
19
+ ): void;
20
+ (e: 'toast', msg: string): void;
21
+ }>();
22
+
23
+ const { t } = useLocale(() => props.locale);
24
+
25
+ const usePin = ref(false);
26
+ const expiresAt = ref<string>('');
27
+ const maxDownloads = ref<string>('');
28
+
29
+ watch(() => props.open, (v) => {
30
+ if (v) {
31
+ usePin.value = false;
32
+ expiresAt.value = '';
33
+ maxDownloads.value = '';
34
+ }
35
+ });
36
+
37
+ function submit() {
38
+ emit('submit', {
39
+ password: usePin.value,
40
+ expires_at: expiresAt.value ? new Date(expiresAt.value).toISOString() : null,
41
+ max_downloads: maxDownloads.value ? Number(maxDownloads.value) : null,
42
+ });
43
+ }
44
+
45
+ async function copy(value: string, toast: string) {
46
+ try {
47
+ await navigator.clipboard.writeText(value);
48
+ emit('toast', toast);
49
+ } catch {
50
+ /* no-op */
51
+ }
52
+ }
53
+
54
+ // Wrap a value in single quotes for safe paste into a POSIX shell —
55
+ // embedded single quotes become the standard '\'' dance.
56
+ function shQuote(value: string): string {
57
+ return `'${value.replace(/'/g, `'\\''`)}'`;
58
+ }
59
+
60
+ // One-line curl that downloads the shared file straight onto a server.
61
+ // The PIN (if any) rides in the querystring — HandleDownload accepts
62
+ // ?pin=, and -L follows the 302 to the presigned URL for S3 storages.
63
+ const cliCommand = computed(() => {
64
+ const sh = props.share;
65
+ if (!sh) return '';
66
+ let url = sh.url;
67
+ if (sh.password_pin) {
68
+ url += (url.includes('?') ? '&' : '?') + 'pin=' + encodeURIComponent(sh.password_pin);
69
+ }
70
+ // Prefer an explicit output name; fall back to the server's
71
+ // Content-Disposition filename (-OJ) when we don't know it.
72
+ const target = sh.filename ? `-o ${shQuote(sh.filename)} ` : '-OJ ';
73
+ return `curl -fSL ${target}${shQuote(url)}`;
74
+ });
75
+ </script>
76
+
77
+ <template>
78
+ <Modal :open="open" :title="t('modal.share.title')" size="md" @close="emit('close')">
79
+ <template v-if="!share">
80
+ <form class="fe-form" @submit.prevent="submit">
81
+ <label class="fe-form__row">
82
+ <input v-model="usePin" type="checkbox" />
83
+ <span>{{ t('modal.share.pin') }}</span>
84
+ </label>
85
+ <label class="fe-form__row fe-form__row--stack">
86
+ <span>{{ t('modal.share.expires') }}</span>
87
+ <input v-model="expiresAt" type="datetime-local" class="fe-input" />
88
+ </label>
89
+ <label class="fe-form__row fe-form__row--stack">
90
+ <span>{{ t('modal.share.max_downloads') }}</span>
91
+ <input v-model="maxDownloads" type="number" min="1" class="fe-input" />
92
+ </label>
93
+ </form>
94
+ </template>
95
+ <template v-else>
96
+ <div class="fe-share-result">
97
+ <div class="fe-share-result__row">
98
+ <label>Link</label>
99
+ <div class="fe-share-result__copy">
100
+ <input :value="share.url" readonly class="fe-input" />
101
+ <button type="button" class="fe-btn" @click="copy(share.url, t('modal.share.url_copied'))">
102
+ {{ t('modal.share.copy') }}
103
+ </button>
104
+ </div>
105
+ </div>
106
+ <div v-if="share.password_pin" class="fe-share-result__row">
107
+ <label>PIN</label>
108
+ <div class="fe-share-result__copy">
109
+ <input :value="share.password_pin" readonly class="fe-input fe-input--mono" />
110
+ <button type="button" class="fe-btn" @click="copy(share.password_pin, t('modal.share.pin_copied'))">
111
+ {{ t('modal.share.copy') }}
112
+ </button>
113
+ </div>
114
+ </div>
115
+ <div class="fe-share-result__row">
116
+ <label>CLI</label>
117
+ <div class="fe-share-result__copy">
118
+ <input :value="cliCommand" readonly class="fe-input fe-input--mono" />
119
+ <button type="button" class="fe-btn" @click="copy(cliCommand, t('modal.share.cli_copied'))">
120
+ {{ t('modal.share.copy') }}
121
+ </button>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ </template>
126
+ <template #actions>
127
+ <button type="button" class="fe-btn" @click="emit('close')">
128
+ {{ share ? 'Kapat' : t('modal.share.cancel') }}
129
+ </button>
130
+ <button v-if="!share" type="button" class="fe-btn fe-btn--primary" @click="submit">
131
+ {{ t('modal.share.create') }}
132
+ </button>
133
+ </template>
134
+ </Modal>
135
+ </template>