@brftech/filex-core 0.1.56

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 (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +108 -0
  3. package/dist/ArchiveViewer-CJdaw5x3.js +99 -0
  4. package/dist/ArchiveViewer-CJdaw5x3.js.map +1 -0
  5. package/dist/CsvViewer-QYx_tePQ.js +132 -0
  6. package/dist/CsvViewer-QYx_tePQ.js.map +1 -0
  7. package/dist/DrawioViewer-GWt0TyB7.js +141 -0
  8. package/dist/DrawioViewer-GWt0TyB7.js.map +1 -0
  9. package/dist/EpubViewer-Je0ywklQ.js +146 -0
  10. package/dist/EpubViewer-Je0ywklQ.js.map +1 -0
  11. package/dist/IpynbViewer-TsB4gqP-.js +175 -0
  12. package/dist/IpynbViewer-TsB4gqP-.js.map +1 -0
  13. package/dist/MermaidViewer-CXfeDS-7.js +128 -0
  14. package/dist/MermaidViewer-CXfeDS-7.js.map +1 -0
  15. package/dist/PsdViewer-VtPpxKVe.js +113 -0
  16. package/dist/PsdViewer-VtPpxKVe.js.map +1 -0
  17. package/dist/TiffViewer-OINn9bbb.js +133 -0
  18. package/dist/TiffViewer-OINn9bbb.js.map +1 -0
  19. package/dist/UTIF-Cjsrlm0l.js +3104 -0
  20. package/dist/UTIF-Cjsrlm0l.js.map +1 -0
  21. package/dist/Viewer3D-xvvyiWHd.js +61 -0
  22. package/dist/Viewer3D-xvvyiWHd.js.map +1 -0
  23. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  24. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  25. package/dist/filex-core.js +26 -0
  26. package/dist/filex-core.js.map +1 -0
  27. package/dist/filex-core.umd.cjs +285 -0
  28. package/dist/filex-core.umd.cjs.map +1 -0
  29. package/dist/index-CmSYzt6L.js +5404 -0
  30. package/dist/index-CmSYzt6L.js.map +1 -0
  31. package/dist/index-UFULWo35.js +10736 -0
  32. package/dist/index-UFULWo35.js.map +1 -0
  33. package/dist/index.d.ts +1089 -0
  34. package/dist/katex-yuB6V-q6.js +11616 -0
  35. package/dist/katex-yuB6V-q6.js.map +1 -0
  36. package/dist/papaparse.min-VB1HBwYX.js +441 -0
  37. package/dist/papaparse.min-VB1HBwYX.js.map +1 -0
  38. package/dist/style.css +1 -0
  39. package/dist/useViewerFetch-czqbd2Lj.js +25 -0
  40. package/dist/useViewerFetch-czqbd2Lj.js.map +1 -0
  41. package/package.json +113 -0
  42. package/src/FileExplorer.vue +1872 -0
  43. package/src/components/Breadcrumb.vue +282 -0
  44. package/src/components/ContextMenu.vue +152 -0
  45. package/src/components/GridView.vue +166 -0
  46. package/src/components/ListView.vue +212 -0
  47. package/src/components/PendingOpsTray.vue +91 -0
  48. package/src/components/RecentlyOpened.vue +155 -0
  49. package/src/components/StarButton.vue +101 -0
  50. package/src/components/TagPicker.vue +184 -0
  51. package/src/components/Toolbar.vue +220 -0
  52. package/src/components/UploadProgress.vue +78 -0
  53. package/src/composables/useFileApi.ts +692 -0
  54. package/src/composables/useKeyboardShortcuts.ts +144 -0
  55. package/src/composables/useLocale.ts +60 -0
  56. package/src/composables/useMonacoLoader.ts +98 -0
  57. package/src/composables/usePendingOps.ts +200 -0
  58. package/src/composables/useSelection.ts +81 -0
  59. package/src/composables/useUploadChunked.ts +250 -0
  60. package/src/composables/useViewerFetch.ts +58 -0
  61. package/src/index.ts +80 -0
  62. package/src/locales/en.ts +122 -0
  63. package/src/locales/index.ts +12 -0
  64. package/src/locales/tr.ts +122 -0
  65. package/src/modals/ConvertModal.vue +254 -0
  66. package/src/modals/DeleteConfirmModal.vue +32 -0
  67. package/src/modals/Modal.vue +104 -0
  68. package/src/modals/NewFolderModal.vue +64 -0
  69. package/src/modals/PermissionsModal.vue +815 -0
  70. package/src/modals/PreviewModal.vue +1070 -0
  71. package/src/modals/RenameModal.vue +58 -0
  72. package/src/modals/ShareModal.vue +135 -0
  73. package/src/styles/base.css +1224 -0
  74. package/src/styles/variables.css +90 -0
  75. package/src/types/ExplorerConfig.ts +282 -0
  76. package/src/types/FileNode.ts +136 -0
  77. package/src/types/index.ts +27 -0
  78. package/src/types/peers.d.ts +45 -0
  79. package/src/viewers/ArchiveViewer.vue +186 -0
  80. package/src/viewers/CsvViewer.vue +319 -0
  81. package/src/viewers/DrawioViewer.vue +243 -0
  82. package/src/viewers/EpubViewer.vue +307 -0
  83. package/src/viewers/IpynbViewer.vue +365 -0
  84. package/src/viewers/MermaidViewer.vue +259 -0
  85. package/src/viewers/PdfViewer.vue +562 -0
  86. package/src/viewers/PsdViewer.vue +264 -0
  87. package/src/viewers/TiffViewer.vue +273 -0
  88. package/src/viewers/Viewer3D.vue +120 -0
@@ -0,0 +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>
@@ -0,0 +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>