hazo_files 3.3.0 → 3.4.0
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/CHANGE_LOG.md +16 -0
- package/dist/background-upload/react/index.js +114 -5
- package/dist/background-upload/react/index.mjs +114 -5
- package/dist/ui/index.js +235 -109
- package/dist/ui/index.mjs +235 -109
- package/package.json +17 -13
package/dist/ui/index.mjs
CHANGED
|
@@ -623,7 +623,109 @@ function PathBreadcrumb({ currentPath, onNavigate, className = "" }) {
|
|
|
623
623
|
// src/ui/components/FolderTree.tsx
|
|
624
624
|
import { useCallback } from "react";
|
|
625
625
|
import { useDroppable } from "@dnd-kit/core";
|
|
626
|
+
|
|
627
|
+
// src/locales/en.json
|
|
628
|
+
var en_default = {
|
|
629
|
+
"upload_dialog.title": "Upload Files",
|
|
630
|
+
"upload_dialog.uploading_to": "Uploading to:",
|
|
631
|
+
"upload_dialog.drop_text": "Drag and drop files here, or",
|
|
632
|
+
"upload_dialog.browse": "browse",
|
|
633
|
+
"upload_dialog.files_selected": "{{count}} file(s) selected",
|
|
634
|
+
"upload_dialog.total": "Total:",
|
|
635
|
+
"upload_dialog.cancel": "Cancel",
|
|
636
|
+
"upload_dialog.upload": "Upload",
|
|
637
|
+
"upload_dialog.select_files_error": "Please select files to upload",
|
|
638
|
+
"create_folder_dialog.title": "Create New Folder",
|
|
639
|
+
"create_folder_dialog.creating_in": "Creating folder in:",
|
|
640
|
+
"create_folder_dialog.name_label": "Folder Name",
|
|
641
|
+
"create_folder_dialog.name_placeholder": "Enter folder name",
|
|
642
|
+
"create_folder_dialog.cancel": "Cancel",
|
|
643
|
+
"create_folder_dialog.submit": "Create Folder",
|
|
644
|
+
"create_folder_dialog.name_required_error": "Please enter a folder name",
|
|
645
|
+
"create_folder_dialog.invalid_chars_error": "Folder name contains invalid characters",
|
|
646
|
+
"rename_dialog.title_folder": "Rename Folder",
|
|
647
|
+
"rename_dialog.title_file": "Rename File",
|
|
648
|
+
"rename_dialog.name_label": "New Name",
|
|
649
|
+
"rename_dialog.name_placeholder": "Enter new name",
|
|
650
|
+
"rename_dialog.cancel": "Cancel",
|
|
651
|
+
"rename_dialog.submit": "Rename",
|
|
652
|
+
"rename_dialog.name_required_error": "Please enter a name",
|
|
653
|
+
"rename_dialog.invalid_chars_error": "Name contains invalid characters",
|
|
654
|
+
"delete_confirm_dialog.title_folder": "Delete Folder",
|
|
655
|
+
"delete_confirm_dialog.title_file": "Delete File",
|
|
656
|
+
"delete_confirm_dialog.confirm_message": "Are you sure you want to delete",
|
|
657
|
+
"delete_confirm_dialog.folder_warning": "Warning: This folder and all its contents will be permanently deleted.",
|
|
658
|
+
"delete_confirm_dialog.cancel": "Cancel",
|
|
659
|
+
"delete_confirm_dialog.submit": "Delete",
|
|
660
|
+
"metadata_dialog.title": "File Metadata",
|
|
661
|
+
"metadata_dialog.close": "Close",
|
|
662
|
+
"file_actions.new_folder": "New Folder",
|
|
663
|
+
"file_actions.upload": "Upload",
|
|
664
|
+
"file_actions.download": "Download",
|
|
665
|
+
"file_actions.rename": "Rename",
|
|
666
|
+
"file_actions.delete": "Delete",
|
|
667
|
+
"file_actions.refresh": "Refresh",
|
|
668
|
+
"file_list.empty": "This folder is empty",
|
|
669
|
+
"file_list.header_name": "Name",
|
|
670
|
+
"file_list.header_size": "Size",
|
|
671
|
+
"file_list.header_modified": "Modified",
|
|
672
|
+
"folder_tree.root": "Root",
|
|
673
|
+
"file_preview.select_prompt": "Select a file to preview",
|
|
674
|
+
"file_preview.folder_label": "Folder",
|
|
675
|
+
"file_preview.created_label": "Created:",
|
|
676
|
+
"file_preview.modified_label": "Modified:",
|
|
677
|
+
"file_preview.error_loading": "Error loading preview",
|
|
678
|
+
"file_preview.video_unsupported": "Your browser does not support video playback.",
|
|
679
|
+
"file_preview.audio_unsupported": "Your browser does not support audio playback.",
|
|
680
|
+
"file_preview.no_preview": "No preview available",
|
|
681
|
+
"file_preview.size_label": "Size:",
|
|
682
|
+
"file_preview.type_label": "Type:",
|
|
683
|
+
"file_info_panel.no_item_selected": "No item selected",
|
|
684
|
+
"file_info_panel.no_custom_metadata": "No custom metadata",
|
|
685
|
+
"file_info_panel.name_label": "Name:",
|
|
686
|
+
"file_info_panel.path_label": "Path:",
|
|
687
|
+
"file_info_panel.type_label": "Type:",
|
|
688
|
+
"file_info_panel.size_label": "Size:",
|
|
689
|
+
"file_info_panel.created_label": "Created:",
|
|
690
|
+
"file_info_panel.modified_label": "Modified:",
|
|
691
|
+
"file_info_panel.storage_label": "Storage:",
|
|
692
|
+
"file_info_panel.custom_metadata_title": "Custom Metadata",
|
|
693
|
+
"file_info_panel.type_folder": "Folder",
|
|
694
|
+
"file_info_panel.type_unknown": "Unknown",
|
|
695
|
+
"file_browser.load_directory_error": "Failed to load directory",
|
|
696
|
+
"file_browser.move_item_error": "Failed to move item",
|
|
697
|
+
"file_browser.upload_file_error": "Failed to upload {{name}}",
|
|
698
|
+
"file_browser.download_file_error": "Failed to download file",
|
|
699
|
+
"file_browser.create_folder_error": "Failed to create folder",
|
|
700
|
+
"file_browser.delete_error": "Failed to delete",
|
|
701
|
+
"file_browser.rename_error": "Failed to rename",
|
|
702
|
+
"file_browser.context_menu_view_metadata": "View Metadata",
|
|
703
|
+
"file_browser.context_menu_rename": "Rename",
|
|
704
|
+
"file_browser.context_menu_download": "Download",
|
|
705
|
+
"file_browser.context_menu_delete": "Delete",
|
|
706
|
+
"use_file_upload_toasts.job_completed": "{{count}} {{file_word}} processed for {{label}}",
|
|
707
|
+
"use_file_upload_toasts.upload_failed": "Upload failed for {{label}}: {{error}}",
|
|
708
|
+
"use_file_upload_toasts.action_required": "Action required for {{label}}",
|
|
709
|
+
"use_file_upload_toasts.action_required_description": "Review and confirm data conflicts",
|
|
710
|
+
"use_file_upload_toasts.batch_complete": "Batch complete: {{completed}}/{{total}} succeeded",
|
|
711
|
+
"pattern_preview.title": "Preview",
|
|
712
|
+
"pattern_preview.no_pattern": "(no pattern defined)",
|
|
713
|
+
"pattern_preview.file_label": "File:",
|
|
714
|
+
"pattern_preview.folder_label": "Folder:",
|
|
715
|
+
"pattern_preview.full_path_label": "Full path:",
|
|
716
|
+
"pattern_preview.example_note": "Preview uses example values from your variables",
|
|
717
|
+
"separator_picker.add_label": "Add:",
|
|
718
|
+
"separator_picker.title_hyphen": "Hyphen",
|
|
719
|
+
"separator_picker.title_underscore": "Underscore",
|
|
720
|
+
"separator_picker.title_slash": "Slash (for folder paths)",
|
|
721
|
+
"separator_picker.title_space": "Space",
|
|
722
|
+
"separator_picker.title_period": "Period"
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
// src/ui/components/FolderTree.tsx
|
|
726
|
+
import { createPackageT } from "hazo_core/i18n";
|
|
626
727
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
728
|
+
var t = createPackageT("hazo_files", en_default);
|
|
627
729
|
function TreeNodeItem({
|
|
628
730
|
node,
|
|
629
731
|
level,
|
|
@@ -714,7 +816,7 @@ function FolderTree({
|
|
|
714
816
|
}) {
|
|
715
817
|
const rootNode = {
|
|
716
818
|
id: "root",
|
|
717
|
-
name: "
|
|
819
|
+
name: t("folder_tree.root"),
|
|
718
820
|
path: "/",
|
|
719
821
|
children: tree,
|
|
720
822
|
isExpanded: true
|
|
@@ -749,7 +851,9 @@ function formatBytes(bytes, decimals = 2) {
|
|
|
749
851
|
}
|
|
750
852
|
|
|
751
853
|
// src/ui/components/FileList.tsx
|
|
854
|
+
import { createPackageT as createPackageT2, resolvePackageLocale } from "hazo_core/i18n";
|
|
752
855
|
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
856
|
+
var t2 = createPackageT2("hazo_files", en_default);
|
|
753
857
|
function FileItemCard({
|
|
754
858
|
item,
|
|
755
859
|
isSelected,
|
|
@@ -865,7 +969,7 @@ function FileItemCard({
|
|
|
865
969
|
/* @__PURE__ */ jsx4("span", { className: "ml-3 flex-1 truncate text-sm", title: item.name, children: item.name }),
|
|
866
970
|
!item.isDirectory && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
867
971
|
/* @__PURE__ */ jsx4("span", { className: "text-xs text-gray-400 ml-4", children: formatBytes(item.size) }),
|
|
868
|
-
/* @__PURE__ */ jsx4("span", { className: "text-xs text-gray-400 ml-4 w-32 truncate", children: new Date(item.modifiedAt).toLocaleDateString() })
|
|
972
|
+
/* @__PURE__ */ jsx4("span", { className: "text-xs text-gray-400 ml-4 w-32 truncate", children: new Date(item.modifiedAt).toLocaleDateString(resolvePackageLocale("en-US")) })
|
|
869
973
|
] })
|
|
870
974
|
]
|
|
871
975
|
}
|
|
@@ -914,7 +1018,7 @@ function FileList({
|
|
|
914
1018
|
)
|
|
915
1019
|
}
|
|
916
1020
|
),
|
|
917
|
-
/* @__PURE__ */ jsx4("p", { children: "
|
|
1021
|
+
/* @__PURE__ */ jsx4("p", { children: t2("file_list.empty") })
|
|
918
1022
|
]
|
|
919
1023
|
}
|
|
920
1024
|
);
|
|
@@ -949,9 +1053,9 @@ function FileList({
|
|
|
949
1053
|
onClick: handleBackgroundClick,
|
|
950
1054
|
children: [
|
|
951
1055
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center p-2 border-b text-xs text-gray-500 font-medium", children: [
|
|
952
|
-
/* @__PURE__ */ jsx4("span", { className: "flex-1 ml-8", children: "
|
|
953
|
-
/* @__PURE__ */ jsx4("span", { className: "w-20 ml-4", children: "
|
|
954
|
-
/* @__PURE__ */ jsx4("span", { className: "w-32 ml-4", children: "
|
|
1056
|
+
/* @__PURE__ */ jsx4("span", { className: "flex-1 ml-8", children: t2("file_list.header_name") }),
|
|
1057
|
+
/* @__PURE__ */ jsx4("span", { className: "w-20 ml-4", children: t2("file_list.header_size") }),
|
|
1058
|
+
/* @__PURE__ */ jsx4("span", { className: "w-32 ml-4", children: t2("file_list.header_modified") })
|
|
955
1059
|
] }),
|
|
956
1060
|
/* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-auto", children: files.map((file) => /* @__PURE__ */ jsx4(
|
|
957
1061
|
FileItemCard,
|
|
@@ -1072,7 +1176,9 @@ function isPreviewable(filenameOrMime) {
|
|
|
1072
1176
|
}
|
|
1073
1177
|
|
|
1074
1178
|
// src/ui/components/FilePreview.tsx
|
|
1179
|
+
import { createPackageT as createPackageT3, resolvePackageLocale as resolvePackageLocale2 } from "hazo_core/i18n";
|
|
1075
1180
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1181
|
+
var t3 = createPackageT3("hazo_files", en_default);
|
|
1076
1182
|
function FilePreview({
|
|
1077
1183
|
item,
|
|
1078
1184
|
getPreviewUrl,
|
|
@@ -1113,22 +1219,24 @@ function FilePreview({
|
|
|
1113
1219
|
}
|
|
1114
1220
|
}, [item, getPreviewUrl, getFileContent]);
|
|
1115
1221
|
if (!item) {
|
|
1116
|
-
return /* @__PURE__ */ jsx5("div", { className: `flex items-center justify-center h-full text-gray-400 ${className}`, children: /* @__PURE__ */ jsx5("p", { children: "
|
|
1222
|
+
return /* @__PURE__ */ jsx5("div", { className: `flex items-center justify-center h-full text-gray-400 ${className}`, children: /* @__PURE__ */ jsx5("p", { children: t3("file_preview.select_prompt") }) });
|
|
1117
1223
|
}
|
|
1118
1224
|
if (item.isDirectory) {
|
|
1119
1225
|
const Icon2 = getFileIcon("folder", true);
|
|
1120
1226
|
return /* @__PURE__ */ jsxs5("div", { className: `flex flex-col items-center justify-center h-full p-4 ${className}`, children: [
|
|
1121
1227
|
/* @__PURE__ */ jsx5(Icon2, { size: 64, className: "text-yellow-500 mb-4" }),
|
|
1122
1228
|
/* @__PURE__ */ jsx5("h3", { className: "text-lg font-medium", children: item.name }),
|
|
1123
|
-
/* @__PURE__ */ jsx5("p", { className: "text-sm text-gray-500 mt-2", children: "
|
|
1229
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm text-gray-500 mt-2", children: t3("file_preview.folder_label") }),
|
|
1124
1230
|
/* @__PURE__ */ jsxs5("div", { className: "mt-4 text-xs text-gray-400 space-y-1", children: [
|
|
1125
1231
|
/* @__PURE__ */ jsxs5("p", { children: [
|
|
1126
|
-
"
|
|
1127
|
-
|
|
1232
|
+
t3("file_preview.created_label"),
|
|
1233
|
+
" ",
|
|
1234
|
+
new Date(item.createdAt).toLocaleString(resolvePackageLocale2("en-US"))
|
|
1128
1235
|
] }),
|
|
1129
1236
|
/* @__PURE__ */ jsxs5("p", { children: [
|
|
1130
|
-
"
|
|
1131
|
-
|
|
1237
|
+
t3("file_preview.modified_label"),
|
|
1238
|
+
" ",
|
|
1239
|
+
new Date(item.modifiedAt).toLocaleString(resolvePackageLocale2("en-US"))
|
|
1132
1240
|
] })
|
|
1133
1241
|
] })
|
|
1134
1242
|
] });
|
|
@@ -1141,7 +1249,7 @@ function FilePreview({
|
|
|
1141
1249
|
}
|
|
1142
1250
|
if (error) {
|
|
1143
1251
|
return /* @__PURE__ */ jsxs5("div", { className: `flex flex-col items-center justify-center h-full p-4 text-red-500 ${className}`, children: [
|
|
1144
|
-
/* @__PURE__ */ jsx5("p", { children: "
|
|
1252
|
+
/* @__PURE__ */ jsx5("p", { children: t3("file_preview.error_loading") }),
|
|
1145
1253
|
/* @__PURE__ */ jsx5("p", { className: "text-sm mt-2", children: error })
|
|
1146
1254
|
] });
|
|
1147
1255
|
}
|
|
@@ -1161,41 +1269,41 @@ function FilePreview({
|
|
|
1161
1269
|
src: previewUrl,
|
|
1162
1270
|
controls: true,
|
|
1163
1271
|
className: "max-w-full max-h-full",
|
|
1164
|
-
children: "
|
|
1272
|
+
children: t3("file_preview.video_unsupported")
|
|
1165
1273
|
}
|
|
1166
1274
|
),
|
|
1167
1275
|
isAudio(mimeType) && previewUrl && /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center", children: [
|
|
1168
1276
|
/* @__PURE__ */ jsx5(Icon, { size: 64, className: "text-gray-400 mb-4" }),
|
|
1169
|
-
/* @__PURE__ */ jsx5("audio", { src: previewUrl, controls: true, className: "w-full max-w-md", children: "
|
|
1277
|
+
/* @__PURE__ */ jsx5("audio", { src: previewUrl, controls: true, className: "w-full max-w-md", children: t3("file_preview.audio_unsupported") })
|
|
1170
1278
|
] }),
|
|
1171
1279
|
isText(mimeType) && textContent !== null && /* @__PURE__ */ jsx5("pre", { className: "w-full h-full overflow-auto text-sm bg-white p-4 rounded border font-mono whitespace-pre-wrap", children: textContent }),
|
|
1172
1280
|
!previewUrl && textContent === null && /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center text-gray-400", children: [
|
|
1173
1281
|
/* @__PURE__ */ jsx5(Icon, { size: 64, className: "mb-4" }),
|
|
1174
|
-
/* @__PURE__ */ jsx5("p", { children: "
|
|
1282
|
+
/* @__PURE__ */ jsx5("p", { children: t3("file_preview.no_preview") })
|
|
1175
1283
|
] })
|
|
1176
1284
|
] }),
|
|
1177
1285
|
/* @__PURE__ */ jsxs5("div", { className: "border-t bg-white p-4", children: [
|
|
1178
1286
|
/* @__PURE__ */ jsx5("h3", { className: "font-medium truncate", title: item.name, children: item.name }),
|
|
1179
1287
|
/* @__PURE__ */ jsxs5("div", { className: "mt-2 text-sm text-gray-500 grid grid-cols-2 gap-2", children: [
|
|
1180
1288
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1181
|
-
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: "
|
|
1289
|
+
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: t3("file_preview.size_label") }),
|
|
1182
1290
|
" ",
|
|
1183
1291
|
formatBytes(fileItem.size)
|
|
1184
1292
|
] }),
|
|
1185
1293
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1186
|
-
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: "
|
|
1294
|
+
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: t3("file_preview.type_label") }),
|
|
1187
1295
|
" ",
|
|
1188
1296
|
mimeType
|
|
1189
1297
|
] }),
|
|
1190
1298
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1191
|
-
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: "
|
|
1299
|
+
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: t3("file_preview.created_label") }),
|
|
1192
1300
|
" ",
|
|
1193
|
-
new Date(item.createdAt).toLocaleDateString()
|
|
1301
|
+
new Date(item.createdAt).toLocaleDateString(resolvePackageLocale2("en-US"))
|
|
1194
1302
|
] }),
|
|
1195
1303
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1196
|
-
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: "
|
|
1304
|
+
/* @__PURE__ */ jsx5("span", { className: "text-gray-400", children: t3("file_preview.modified_label") }),
|
|
1197
1305
|
" ",
|
|
1198
|
-
new Date(item.modifiedAt).toLocaleDateString()
|
|
1306
|
+
new Date(item.modifiedAt).toLocaleDateString(resolvePackageLocale2("en-US"))
|
|
1199
1307
|
] })
|
|
1200
1308
|
] })
|
|
1201
1309
|
] })
|
|
@@ -1204,7 +1312,9 @@ function FilePreview({
|
|
|
1204
1312
|
|
|
1205
1313
|
// src/ui/components/FileActions.tsx
|
|
1206
1314
|
import { useRef } from "react";
|
|
1315
|
+
import { createPackageT as createPackageT4 } from "hazo_core/i18n";
|
|
1207
1316
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1317
|
+
var t4 = createPackageT4("hazo_files", en_default);
|
|
1208
1318
|
function ActionButton({ icon, label, onClick, disabled, variant = "default" }) {
|
|
1209
1319
|
return /* @__PURE__ */ jsxs6(
|
|
1210
1320
|
"button",
|
|
@@ -1261,7 +1371,7 @@ function FileActions({
|
|
|
1261
1371
|
ActionButton,
|
|
1262
1372
|
{
|
|
1263
1373
|
icon: /* @__PURE__ */ jsx6(PlusIcon, { size: 18 }),
|
|
1264
|
-
label: "
|
|
1374
|
+
label: t4("file_actions.new_folder"),
|
|
1265
1375
|
onClick: onCreateFolder,
|
|
1266
1376
|
disabled: isLoading
|
|
1267
1377
|
}
|
|
@@ -1270,7 +1380,7 @@ function FileActions({
|
|
|
1270
1380
|
ActionButton,
|
|
1271
1381
|
{
|
|
1272
1382
|
icon: /* @__PURE__ */ jsx6(UploadIcon, { size: 18 }),
|
|
1273
|
-
label: "
|
|
1383
|
+
label: t4("file_actions.upload"),
|
|
1274
1384
|
onClick: handleUploadClick,
|
|
1275
1385
|
disabled: isLoading
|
|
1276
1386
|
}
|
|
@@ -1280,7 +1390,7 @@ function FileActions({
|
|
|
1280
1390
|
ActionButton,
|
|
1281
1391
|
{
|
|
1282
1392
|
icon: /* @__PURE__ */ jsx6(DownloadIcon, { size: 18 }),
|
|
1283
|
-
label: "
|
|
1393
|
+
label: t4("file_actions.download"),
|
|
1284
1394
|
onClick: onDownload,
|
|
1285
1395
|
disabled: !isFile || isLoading
|
|
1286
1396
|
}
|
|
@@ -1289,7 +1399,7 @@ function FileActions({
|
|
|
1289
1399
|
ActionButton,
|
|
1290
1400
|
{
|
|
1291
1401
|
icon: /* @__PURE__ */ jsx6(PencilIcon, { size: 18 }),
|
|
1292
|
-
label: "
|
|
1402
|
+
label: t4("file_actions.rename"),
|
|
1293
1403
|
onClick: onRename,
|
|
1294
1404
|
disabled: !hasSelection || isLoading
|
|
1295
1405
|
}
|
|
@@ -1298,7 +1408,7 @@ function FileActions({
|
|
|
1298
1408
|
ActionButton,
|
|
1299
1409
|
{
|
|
1300
1410
|
icon: /* @__PURE__ */ jsx6(TrashIcon, { size: 18 }),
|
|
1301
|
-
label: "
|
|
1411
|
+
label: t4("file_actions.delete"),
|
|
1302
1412
|
onClick: onDelete,
|
|
1303
1413
|
disabled: !hasSelection || isLoading,
|
|
1304
1414
|
variant: "danger"
|
|
@@ -1309,7 +1419,7 @@ function FileActions({
|
|
|
1309
1419
|
ActionButton,
|
|
1310
1420
|
{
|
|
1311
1421
|
icon: /* @__PURE__ */ jsx6(RefreshIcon, { size: 18, className: isLoading ? "animate-spin" : "" }),
|
|
1312
|
-
label: "
|
|
1422
|
+
label: t4("file_actions.refresh"),
|
|
1313
1423
|
onClick: onRefresh,
|
|
1314
1424
|
disabled: isLoading
|
|
1315
1425
|
}
|
|
@@ -1456,7 +1566,9 @@ function DragPreview({ item, className = "" }) {
|
|
|
1456
1566
|
|
|
1457
1567
|
// src/ui/components/dialogs/CreateFolderDialog.tsx
|
|
1458
1568
|
import { useState as useState2, useCallback as useCallback4, useEffect as useEffect3 } from "react";
|
|
1569
|
+
import { createPackageT as createPackageT5 } from "hazo_core/i18n";
|
|
1459
1570
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1571
|
+
var t5 = createPackageT5("hazo_files", en_default);
|
|
1460
1572
|
function CreateFolderDialog({
|
|
1461
1573
|
isOpen,
|
|
1462
1574
|
onClose,
|
|
@@ -1475,11 +1587,11 @@ function CreateFolderDialog({
|
|
|
1475
1587
|
const handleSubmit = useCallback4(async (e) => {
|
|
1476
1588
|
e.preventDefault();
|
|
1477
1589
|
if (!name.trim()) {
|
|
1478
|
-
setError("
|
|
1590
|
+
setError(t5("create_folder_dialog.name_required_error"));
|
|
1479
1591
|
return;
|
|
1480
1592
|
}
|
|
1481
1593
|
if (/[<>:"/\\|?*]/.test(name)) {
|
|
1482
|
-
setError("
|
|
1594
|
+
setError(t5("create_folder_dialog.invalid_chars_error"));
|
|
1483
1595
|
return;
|
|
1484
1596
|
}
|
|
1485
1597
|
setIsLoading(true);
|
|
@@ -1506,7 +1618,7 @@ function CreateFolderDialog({
|
|
|
1506
1618
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
1507
1619
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
1508
1620
|
/* @__PURE__ */ jsx9(FolderIcon, { size: 20, className: "text-yellow-500" }),
|
|
1509
|
-
/* @__PURE__ */ jsx9("h2", { className: "text-lg font-medium", children: "
|
|
1621
|
+
/* @__PURE__ */ jsx9("h2", { className: "text-lg font-medium", children: t5("create_folder_dialog.title") })
|
|
1510
1622
|
] }),
|
|
1511
1623
|
/* @__PURE__ */ jsx9(
|
|
1512
1624
|
"button",
|
|
@@ -1520,18 +1632,19 @@ function CreateFolderDialog({
|
|
|
1520
1632
|
/* @__PURE__ */ jsxs9("form", { onSubmit: handleSubmit, children: [
|
|
1521
1633
|
/* @__PURE__ */ jsxs9("div", { className: "p-4", children: [
|
|
1522
1634
|
/* @__PURE__ */ jsxs9("div", { className: "text-sm text-gray-500 mb-4", children: [
|
|
1523
|
-
"
|
|
1635
|
+
t5("create_folder_dialog.creating_in"),
|
|
1636
|
+
" ",
|
|
1524
1637
|
/* @__PURE__ */ jsx9("span", { className: "font-medium", children: currentPath })
|
|
1525
1638
|
] }),
|
|
1526
1639
|
/* @__PURE__ */ jsxs9("label", { className: "block", children: [
|
|
1527
|
-
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-gray-700", children: "
|
|
1640
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-gray-700", children: t5("create_folder_dialog.name_label") }),
|
|
1528
1641
|
/* @__PURE__ */ jsx9(
|
|
1529
1642
|
"input",
|
|
1530
1643
|
{
|
|
1531
1644
|
type: "text",
|
|
1532
1645
|
value: name,
|
|
1533
1646
|
onChange: (e) => setName(e.target.value),
|
|
1534
|
-
placeholder: "
|
|
1647
|
+
placeholder: t5("create_folder_dialog.name_placeholder"),
|
|
1535
1648
|
className: "mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
1536
1649
|
autoFocus: true,
|
|
1537
1650
|
disabled: isLoading
|
|
@@ -1548,7 +1661,7 @@ function CreateFolderDialog({
|
|
|
1548
1661
|
onClick: onClose,
|
|
1549
1662
|
className: "px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-md transition-colors",
|
|
1550
1663
|
disabled: isLoading,
|
|
1551
|
-
children: "
|
|
1664
|
+
children: t5("create_folder_dialog.cancel")
|
|
1552
1665
|
}
|
|
1553
1666
|
),
|
|
1554
1667
|
/* @__PURE__ */ jsxs9(
|
|
@@ -1559,7 +1672,7 @@ function CreateFolderDialog({
|
|
|
1559
1672
|
disabled: isLoading || !name.trim(),
|
|
1560
1673
|
children: [
|
|
1561
1674
|
isLoading && /* @__PURE__ */ jsx9(LoaderIcon, { size: 16 }),
|
|
1562
|
-
"
|
|
1675
|
+
t5("create_folder_dialog.submit")
|
|
1563
1676
|
]
|
|
1564
1677
|
}
|
|
1565
1678
|
)
|
|
@@ -1571,7 +1684,9 @@ function CreateFolderDialog({
|
|
|
1571
1684
|
|
|
1572
1685
|
// src/ui/components/dialogs/RenameDialog.tsx
|
|
1573
1686
|
import { useState as useState3, useCallback as useCallback5, useEffect as useEffect4 } from "react";
|
|
1687
|
+
import { createPackageT as createPackageT6 } from "hazo_core/i18n";
|
|
1574
1688
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1689
|
+
var t6 = createPackageT6("hazo_files", en_default);
|
|
1575
1690
|
function RenameDialog({
|
|
1576
1691
|
isOpen,
|
|
1577
1692
|
item,
|
|
@@ -1590,11 +1705,11 @@ function RenameDialog({
|
|
|
1590
1705
|
const handleSubmit = useCallback5(async (e) => {
|
|
1591
1706
|
e.preventDefault();
|
|
1592
1707
|
if (!name.trim()) {
|
|
1593
|
-
setError("
|
|
1708
|
+
setError(t6("rename_dialog.name_required_error"));
|
|
1594
1709
|
return;
|
|
1595
1710
|
}
|
|
1596
1711
|
if (/[<>:"/\\|?*]/.test(name)) {
|
|
1597
|
-
setError("
|
|
1712
|
+
setError(t6("rename_dialog.invalid_chars_error"));
|
|
1598
1713
|
return;
|
|
1599
1714
|
}
|
|
1600
1715
|
if (name.trim() === item?.name) {
|
|
@@ -1625,10 +1740,7 @@ function RenameDialog({
|
|
|
1625
1740
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
1626
1741
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
|
|
1627
1742
|
/* @__PURE__ */ jsx10(PencilIcon, { size: 20, className: "text-gray-500" }),
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
"Rename ",
|
|
1630
|
-
item.isDirectory ? "Folder" : "File"
|
|
1631
|
-
] })
|
|
1743
|
+
/* @__PURE__ */ jsx10("h2", { className: "text-lg font-medium", children: item.isDirectory ? t6("rename_dialog.title_folder") : t6("rename_dialog.title_file") })
|
|
1632
1744
|
] }),
|
|
1633
1745
|
/* @__PURE__ */ jsx10(
|
|
1634
1746
|
"button",
|
|
@@ -1642,14 +1754,14 @@ function RenameDialog({
|
|
|
1642
1754
|
/* @__PURE__ */ jsxs10("form", { onSubmit: handleSubmit, children: [
|
|
1643
1755
|
/* @__PURE__ */ jsxs10("div", { className: "p-4", children: [
|
|
1644
1756
|
/* @__PURE__ */ jsxs10("label", { className: "block", children: [
|
|
1645
|
-
/* @__PURE__ */ jsx10("span", { className: "text-sm font-medium text-gray-700", children: "
|
|
1757
|
+
/* @__PURE__ */ jsx10("span", { className: "text-sm font-medium text-gray-700", children: t6("rename_dialog.name_label") }),
|
|
1646
1758
|
/* @__PURE__ */ jsx10(
|
|
1647
1759
|
"input",
|
|
1648
1760
|
{
|
|
1649
1761
|
type: "text",
|
|
1650
1762
|
value: name,
|
|
1651
1763
|
onChange: (e) => setName(e.target.value),
|
|
1652
|
-
placeholder: "
|
|
1764
|
+
placeholder: t6("rename_dialog.name_placeholder"),
|
|
1653
1765
|
className: "mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
1654
1766
|
autoFocus: true,
|
|
1655
1767
|
disabled: isLoading
|
|
@@ -1666,7 +1778,7 @@ function RenameDialog({
|
|
|
1666
1778
|
onClick: onClose,
|
|
1667
1779
|
className: "px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-md transition-colors",
|
|
1668
1780
|
disabled: isLoading,
|
|
1669
|
-
children: "
|
|
1781
|
+
children: t6("rename_dialog.cancel")
|
|
1670
1782
|
}
|
|
1671
1783
|
),
|
|
1672
1784
|
/* @__PURE__ */ jsxs10(
|
|
@@ -1677,7 +1789,7 @@ function RenameDialog({
|
|
|
1677
1789
|
disabled: isLoading || !name.trim(),
|
|
1678
1790
|
children: [
|
|
1679
1791
|
isLoading && /* @__PURE__ */ jsx10(LoaderIcon, { size: 16 }),
|
|
1680
|
-
"
|
|
1792
|
+
t6("rename_dialog.submit")
|
|
1681
1793
|
]
|
|
1682
1794
|
}
|
|
1683
1795
|
)
|
|
@@ -1689,7 +1801,9 @@ function RenameDialog({
|
|
|
1689
1801
|
|
|
1690
1802
|
// src/ui/components/dialogs/DeleteConfirmDialog.tsx
|
|
1691
1803
|
import { useState as useState4, useCallback as useCallback6 } from "react";
|
|
1804
|
+
import { createPackageT as createPackageT7 } from "hazo_core/i18n";
|
|
1692
1805
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1806
|
+
var t7 = createPackageT7("hazo_files", en_default);
|
|
1693
1807
|
function DeleteConfirmDialog({
|
|
1694
1808
|
isOpen,
|
|
1695
1809
|
item,
|
|
@@ -1723,10 +1837,7 @@ function DeleteConfirmDialog({
|
|
|
1723
1837
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
1724
1838
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
1725
1839
|
/* @__PURE__ */ jsx11(TrashIcon, { size: 20, className: "text-red-500" }),
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
"Delete ",
|
|
1728
|
-
item.isDirectory ? "Folder" : "File"
|
|
1729
|
-
] })
|
|
1840
|
+
/* @__PURE__ */ jsx11("h2", { className: "text-lg font-medium", children: item.isDirectory ? t7("delete_confirm_dialog.title_folder") : t7("delete_confirm_dialog.title_file") })
|
|
1730
1841
|
] }),
|
|
1731
1842
|
/* @__PURE__ */ jsx11(
|
|
1732
1843
|
"button",
|
|
@@ -1739,12 +1850,12 @@ function DeleteConfirmDialog({
|
|
|
1739
1850
|
] }),
|
|
1740
1851
|
/* @__PURE__ */ jsxs11("div", { className: "p-4", children: [
|
|
1741
1852
|
/* @__PURE__ */ jsxs11("p", { className: "text-gray-700", children: [
|
|
1742
|
-
"
|
|
1853
|
+
t7("delete_confirm_dialog.confirm_message"),
|
|
1743
1854
|
" ",
|
|
1744
1855
|
/* @__PURE__ */ jsx11("span", { className: "font-medium", children: item.name }),
|
|
1745
1856
|
"?"
|
|
1746
1857
|
] }),
|
|
1747
|
-
item.isDirectory && /* @__PURE__ */ jsx11("p", { className: "mt-2 text-sm text-amber-600 bg-amber-50 p-3 rounded", children: "
|
|
1858
|
+
item.isDirectory && /* @__PURE__ */ jsx11("p", { className: "mt-2 text-sm text-amber-600 bg-amber-50 p-3 rounded", children: t7("delete_confirm_dialog.folder_warning") }),
|
|
1748
1859
|
error && /* @__PURE__ */ jsx11("p", { className: "mt-2 text-sm text-red-600", children: error })
|
|
1749
1860
|
] }),
|
|
1750
1861
|
/* @__PURE__ */ jsxs11("div", { className: "flex justify-end gap-2 p-4 border-t bg-gray-50 rounded-b-lg", children: [
|
|
@@ -1755,7 +1866,7 @@ function DeleteConfirmDialog({
|
|
|
1755
1866
|
onClick: onClose,
|
|
1756
1867
|
className: "px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-md transition-colors",
|
|
1757
1868
|
disabled: isLoading,
|
|
1758
|
-
children: "
|
|
1869
|
+
children: t7("delete_confirm_dialog.cancel")
|
|
1759
1870
|
}
|
|
1760
1871
|
),
|
|
1761
1872
|
/* @__PURE__ */ jsxs11(
|
|
@@ -1767,7 +1878,7 @@ function DeleteConfirmDialog({
|
|
|
1767
1878
|
disabled: isLoading,
|
|
1768
1879
|
children: [
|
|
1769
1880
|
isLoading && /* @__PURE__ */ jsx11(LoaderIcon, { size: 16 }),
|
|
1770
|
-
"
|
|
1881
|
+
t7("delete_confirm_dialog.submit")
|
|
1771
1882
|
]
|
|
1772
1883
|
}
|
|
1773
1884
|
)
|
|
@@ -1778,7 +1889,9 @@ function DeleteConfirmDialog({
|
|
|
1778
1889
|
|
|
1779
1890
|
// src/ui/components/dialogs/UploadDialog.tsx
|
|
1780
1891
|
import { useState as useState5, useCallback as useCallback7, useRef as useRef3 } from "react";
|
|
1892
|
+
import { createPackageT as createPackageT8 } from "hazo_core/i18n";
|
|
1781
1893
|
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1894
|
+
var t8 = createPackageT8("hazo_files", en_default);
|
|
1782
1895
|
function UploadDialog({
|
|
1783
1896
|
isOpen,
|
|
1784
1897
|
currentPath,
|
|
@@ -1814,7 +1927,7 @@ function UploadDialog({
|
|
|
1814
1927
|
}, []);
|
|
1815
1928
|
const handleUpload = useCallback7(async () => {
|
|
1816
1929
|
if (selectedFiles.length === 0) {
|
|
1817
|
-
setError("
|
|
1930
|
+
setError(t8("upload_dialog.select_files_error"));
|
|
1818
1931
|
return;
|
|
1819
1932
|
}
|
|
1820
1933
|
setIsLoading(true);
|
|
@@ -1850,7 +1963,7 @@ function UploadDialog({
|
|
|
1850
1963
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
1851
1964
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
|
|
1852
1965
|
/* @__PURE__ */ jsx12(UploadIcon, { size: 20, className: "text-blue-500" }),
|
|
1853
|
-
/* @__PURE__ */ jsx12("h2", { className: "text-lg font-medium", children: "
|
|
1966
|
+
/* @__PURE__ */ jsx12("h2", { className: "text-lg font-medium", children: t8("upload_dialog.title") })
|
|
1854
1967
|
] }),
|
|
1855
1968
|
/* @__PURE__ */ jsx12(
|
|
1856
1969
|
"button",
|
|
@@ -1863,7 +1976,8 @@ function UploadDialog({
|
|
|
1863
1976
|
] }),
|
|
1864
1977
|
/* @__PURE__ */ jsxs12("div", { className: "p-4", children: [
|
|
1865
1978
|
/* @__PURE__ */ jsxs12("div", { className: "text-sm text-gray-500 mb-4", children: [
|
|
1866
|
-
"
|
|
1979
|
+
t8("upload_dialog.uploading_to"),
|
|
1980
|
+
" ",
|
|
1867
1981
|
/* @__PURE__ */ jsx12("span", { className: "font-medium", children: currentPath })
|
|
1868
1982
|
] }),
|
|
1869
1983
|
/* @__PURE__ */ jsxs12(
|
|
@@ -1890,21 +2004,19 @@ function UploadDialog({
|
|
|
1890
2004
|
),
|
|
1891
2005
|
/* @__PURE__ */ jsx12(UploadIcon, { size: 40, className: "mx-auto text-gray-400 mb-4" }),
|
|
1892
2006
|
/* @__PURE__ */ jsxs12("p", { className: "text-gray-600", children: [
|
|
1893
|
-
"
|
|
2007
|
+
t8("upload_dialog.drop_text"),
|
|
1894
2008
|
" ",
|
|
1895
|
-
/* @__PURE__ */ jsx12("span", { className: "text-blue-500 cursor-pointer", children: "browse" })
|
|
2009
|
+
/* @__PURE__ */ jsx12("span", { className: "text-blue-500 cursor-pointer", children: t8("upload_dialog.browse") })
|
|
1896
2010
|
] })
|
|
1897
2011
|
]
|
|
1898
2012
|
}
|
|
1899
2013
|
),
|
|
1900
2014
|
selectedFiles.length > 0 && /* @__PURE__ */ jsxs12("div", { className: "mt-4", children: [
|
|
1901
2015
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between mb-2", children: [
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
selectedFiles.length,
|
|
1904
|
-
" file(s) selected"
|
|
1905
|
-
] }),
|
|
2016
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm font-medium text-gray-700", children: t8("upload_dialog.files_selected", { count: String(selectedFiles.length) }) }),
|
|
1906
2017
|
/* @__PURE__ */ jsxs12("span", { className: "text-sm text-gray-500", children: [
|
|
1907
|
-
"
|
|
2018
|
+
t8("upload_dialog.total"),
|
|
2019
|
+
" ",
|
|
1908
2020
|
formatBytes(totalSize)
|
|
1909
2021
|
] })
|
|
1910
2022
|
] }),
|
|
@@ -1941,7 +2053,7 @@ function UploadDialog({
|
|
|
1941
2053
|
onClick: handleClose,
|
|
1942
2054
|
className: "px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-md transition-colors",
|
|
1943
2055
|
disabled: isLoading,
|
|
1944
|
-
children: "
|
|
2056
|
+
children: t8("upload_dialog.cancel")
|
|
1945
2057
|
}
|
|
1946
2058
|
),
|
|
1947
2059
|
/* @__PURE__ */ jsxs12(
|
|
@@ -1953,7 +2065,8 @@ function UploadDialog({
|
|
|
1953
2065
|
disabled: isLoading || selectedFiles.length === 0,
|
|
1954
2066
|
children: [
|
|
1955
2067
|
isLoading && /* @__PURE__ */ jsx12(LoaderIcon, { size: 16 }),
|
|
1956
|
-
"
|
|
2068
|
+
t8("upload_dialog.upload"),
|
|
2069
|
+
" ",
|
|
1957
2070
|
selectedFiles.length > 0 && `(${selectedFiles.length})`
|
|
1958
2071
|
]
|
|
1959
2072
|
}
|
|
@@ -1964,15 +2077,17 @@ function UploadDialog({
|
|
|
1964
2077
|
}
|
|
1965
2078
|
|
|
1966
2079
|
// src/ui/components/FileInfoPanel.tsx
|
|
2080
|
+
import { createPackageT as createPackageT9, resolvePackageLocale as resolvePackageLocale3 } from "hazo_core/i18n";
|
|
1967
2081
|
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2082
|
+
var t9 = createPackageT9("hazo_files", en_default);
|
|
1968
2083
|
function formatDate(date) {
|
|
1969
2084
|
if (!date) return "-";
|
|
1970
2085
|
const d = date instanceof Date ? date : new Date(date);
|
|
1971
|
-
return d.toLocaleString();
|
|
2086
|
+
return d.toLocaleString(resolvePackageLocale3("en-US"));
|
|
1972
2087
|
}
|
|
1973
2088
|
function formatJSON(data) {
|
|
1974
2089
|
if (!data || Object.keys(data).length === 0) {
|
|
1975
|
-
return "
|
|
2090
|
+
return t9("file_info_panel.no_custom_metadata");
|
|
1976
2091
|
}
|
|
1977
2092
|
return JSON.stringify(data, null, 2);
|
|
1978
2093
|
}
|
|
@@ -1984,12 +2099,12 @@ function FileInfoPanel({
|
|
|
1984
2099
|
className = ""
|
|
1985
2100
|
}) {
|
|
1986
2101
|
if (!item) {
|
|
1987
|
-
return /* @__PURE__ */ jsx13("div", { className: `text-sm text-gray-500 ${className}`, children: "
|
|
2102
|
+
return /* @__PURE__ */ jsx13("div", { className: `text-sm text-gray-500 ${className}`, children: t9("file_info_panel.no_item_selected") });
|
|
1988
2103
|
}
|
|
1989
2104
|
const displayData = {
|
|
1990
2105
|
name: item.name || "-",
|
|
1991
2106
|
path: item.path || "-",
|
|
1992
|
-
type: item.isDirectory ? "
|
|
2107
|
+
type: item.isDirectory ? t9("file_info_panel.type_folder") : item?.mimeType || t9("file_info_panel.type_unknown"),
|
|
1993
2108
|
size: item.isDirectory ? void 0 : item?.size,
|
|
1994
2109
|
createdAt: item.createdAt,
|
|
1995
2110
|
modifiedAt: item.modifiedAt,
|
|
@@ -1999,43 +2114,45 @@ function FileInfoPanel({
|
|
|
1999
2114
|
return /* @__PURE__ */ jsxs13("div", { className, children: [
|
|
2000
2115
|
/* @__PURE__ */ jsxs13("dl", { className: "space-y-3", children: [
|
|
2001
2116
|
/* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2002
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2117
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.name_label") }),
|
|
2003
2118
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900 break-all", children: displayData.name })
|
|
2004
2119
|
] }),
|
|
2005
2120
|
/* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2006
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2121
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.path_label") }),
|
|
2007
2122
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900 break-all font-mono text-xs", children: displayData.path })
|
|
2008
2123
|
] }),
|
|
2009
2124
|
/* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2010
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2125
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.type_label") }),
|
|
2011
2126
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900", children: displayData.type })
|
|
2012
2127
|
] }),
|
|
2013
2128
|
displayData.size !== void 0 && /* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2014
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2129
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.size_label") }),
|
|
2015
2130
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900", children: formatBytes(displayData.size) })
|
|
2016
2131
|
] }),
|
|
2017
2132
|
/* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2018
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2133
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.created_label") }),
|
|
2019
2134
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900", children: formatDate(displayData.createdAt) })
|
|
2020
2135
|
] }),
|
|
2021
2136
|
/* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2022
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2137
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.modified_label") }),
|
|
2023
2138
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900", children: formatDate(displayData.modifiedAt) })
|
|
2024
2139
|
] }),
|
|
2025
2140
|
displayData.storageType && /* @__PURE__ */ jsxs13("div", { className: "flex", children: [
|
|
2026
|
-
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: "
|
|
2141
|
+
/* @__PURE__ */ jsx13("dt", { className: "w-24 text-sm font-medium text-gray-500", children: t9("file_info_panel.storage_label") }),
|
|
2027
2142
|
/* @__PURE__ */ jsx13("dd", { className: "flex-1 text-sm text-gray-900 capitalize", children: displayData.storageType.replace("_", " ") })
|
|
2028
2143
|
] })
|
|
2029
2144
|
] }),
|
|
2030
2145
|
showCustomMetadata && /* @__PURE__ */ jsxs13("div", { className: "mt-6", children: [
|
|
2031
|
-
/* @__PURE__ */ jsx13("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: "
|
|
2146
|
+
/* @__PURE__ */ jsx13("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: t9("file_info_panel.custom_metadata_title") }),
|
|
2032
2147
|
isLoading ? /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsx13(LoaderIcon, { size: 24, className: "text-gray-400" }) }) : /* @__PURE__ */ jsx13("div", { className: "bg-gray-50 rounded-lg p-3 border", children: /* @__PURE__ */ jsx13("pre", { className: "text-xs text-gray-700 font-mono whitespace-pre-wrap overflow-auto max-h-48", children: formatJSON(displayData.fileData) }) })
|
|
2033
2148
|
] })
|
|
2034
2149
|
] });
|
|
2035
2150
|
}
|
|
2036
2151
|
|
|
2037
2152
|
// src/ui/components/dialogs/MetadataDialog.tsx
|
|
2153
|
+
import { createPackageT as createPackageT10 } from "hazo_core/i18n";
|
|
2038
2154
|
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2155
|
+
var t10 = createPackageT10("hazo_files", en_default);
|
|
2039
2156
|
function MetadataDialog({
|
|
2040
2157
|
isOpen,
|
|
2041
2158
|
item,
|
|
@@ -2056,7 +2173,7 @@ function MetadataDialog({
|
|
|
2056
2173
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between p-4 border-b", children: [
|
|
2057
2174
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
|
|
2058
2175
|
/* @__PURE__ */ jsx14(InfoIcon, { size: 20, className: "text-blue-500" }),
|
|
2059
|
-
/* @__PURE__ */ jsx14("h2", { className: "text-lg font-medium", children: "
|
|
2176
|
+
/* @__PURE__ */ jsx14("h2", { className: "text-lg font-medium", children: t10("metadata_dialog.title") })
|
|
2060
2177
|
] }),
|
|
2061
2178
|
/* @__PURE__ */ jsx14(
|
|
2062
2179
|
"button",
|
|
@@ -2082,7 +2199,7 @@ function MetadataDialog({
|
|
|
2082
2199
|
type: "button",
|
|
2083
2200
|
onClick: onClose,
|
|
2084
2201
|
className: "px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded-md transition-colors",
|
|
2085
|
-
children: "
|
|
2202
|
+
children: t10("metadata_dialog.close")
|
|
2086
2203
|
}
|
|
2087
2204
|
) })
|
|
2088
2205
|
] })
|
|
@@ -2090,7 +2207,9 @@ function MetadataDialog({
|
|
|
2090
2207
|
}
|
|
2091
2208
|
|
|
2092
2209
|
// src/ui/components/FileBrowser.tsx
|
|
2210
|
+
import { createPackageT as createPackageT11 } from "hazo_core/i18n";
|
|
2093
2211
|
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2212
|
+
var t11 = createPackageT11("hazo_files", en_default);
|
|
2094
2213
|
function FileBrowser({
|
|
2095
2214
|
api,
|
|
2096
2215
|
initialPath = "/",
|
|
@@ -2138,7 +2257,7 @@ function FileBrowser({
|
|
|
2138
2257
|
setSelectedItem(null);
|
|
2139
2258
|
onNavigate?.(path);
|
|
2140
2259
|
} else {
|
|
2141
|
-
onError?.(result.error || "
|
|
2260
|
+
onError?.(result.error || t11("file_browser.load_directory_error"));
|
|
2142
2261
|
}
|
|
2143
2262
|
} finally {
|
|
2144
2263
|
setIsLoading(false);
|
|
@@ -2222,7 +2341,7 @@ function FileBrowser({
|
|
|
2222
2341
|
await loadTree();
|
|
2223
2342
|
}
|
|
2224
2343
|
} else {
|
|
2225
|
-
onError?.(result.error || "
|
|
2344
|
+
onError?.(result.error || t11("file_browser.move_item_error"));
|
|
2226
2345
|
}
|
|
2227
2346
|
}, [draggedItem, isValidDropTarget, api, currentPath, showTree, loadDirectory, loadTree, onError]);
|
|
2228
2347
|
const handleSelect = useCallback8((item) => {
|
|
@@ -2259,7 +2378,7 @@ function FileBrowser({
|
|
|
2259
2378
|
setFiles((prev) => sortItems([...prev, result.data]));
|
|
2260
2379
|
await loadTree();
|
|
2261
2380
|
} else {
|
|
2262
|
-
throw new Error(result.error || "
|
|
2381
|
+
throw new Error(result.error || t11("file_browser.create_folder_error"));
|
|
2263
2382
|
}
|
|
2264
2383
|
}, [api, currentPath, loadTree]);
|
|
2265
2384
|
const handleUpload = useCallback8(async (fileList) => {
|
|
@@ -2270,7 +2389,7 @@ function FileBrowser({
|
|
|
2270
2389
|
if (result.success && result.data) {
|
|
2271
2390
|
setFiles((prev) => sortItems([...prev, result.data]));
|
|
2272
2391
|
} else {
|
|
2273
|
-
onError?.(result.error ||
|
|
2392
|
+
onError?.(result.error || t11("file_browser.upload_file_error", { name: file.name }));
|
|
2274
2393
|
}
|
|
2275
2394
|
}
|
|
2276
2395
|
}, [api, currentPath, onError]);
|
|
@@ -2288,7 +2407,7 @@ function FileBrowser({
|
|
|
2288
2407
|
document.body.removeChild(a);
|
|
2289
2408
|
URL.revokeObjectURL(url);
|
|
2290
2409
|
} else {
|
|
2291
|
-
onError?.(result.error || "
|
|
2410
|
+
onError?.(result.error || t11("file_browser.download_file_error"));
|
|
2292
2411
|
}
|
|
2293
2412
|
}, [api, selectedItem, onError]);
|
|
2294
2413
|
const handleDelete = useCallback8(async () => {
|
|
@@ -2306,7 +2425,7 @@ function FileBrowser({
|
|
|
2306
2425
|
await loadTree();
|
|
2307
2426
|
}
|
|
2308
2427
|
} else {
|
|
2309
|
-
throw new Error(result.error || "
|
|
2428
|
+
throw new Error(result.error || t11("file_browser.delete_error"));
|
|
2310
2429
|
}
|
|
2311
2430
|
}, [api, selectedItem, loadTree]);
|
|
2312
2431
|
const handleRename = useCallback8(async (newName) => {
|
|
@@ -2324,7 +2443,7 @@ function FileBrowser({
|
|
|
2324
2443
|
await loadTree();
|
|
2325
2444
|
}
|
|
2326
2445
|
} else {
|
|
2327
|
-
throw new Error(result.error || "
|
|
2446
|
+
throw new Error(result.error || t11("file_browser.rename_error"));
|
|
2328
2447
|
}
|
|
2329
2448
|
}, [api, selectedItem, loadTree]);
|
|
2330
2449
|
const handleContextMenu = useCallback8((item, event) => {
|
|
@@ -2356,7 +2475,7 @@ function FileBrowser({
|
|
|
2356
2475
|
const contextMenuItems = contextMenuItem ? [
|
|
2357
2476
|
{
|
|
2358
2477
|
id: "metadata",
|
|
2359
|
-
label: "
|
|
2478
|
+
label: t11("file_browser.context_menu_view_metadata"),
|
|
2360
2479
|
icon: InfoIcon,
|
|
2361
2480
|
onClick: handleViewMetadata
|
|
2362
2481
|
},
|
|
@@ -2369,7 +2488,7 @@ function FileBrowser({
|
|
|
2369
2488
|
},
|
|
2370
2489
|
{
|
|
2371
2490
|
id: "rename",
|
|
2372
|
-
label: "
|
|
2491
|
+
label: t11("file_browser.context_menu_rename"),
|
|
2373
2492
|
icon: PencilIcon,
|
|
2374
2493
|
onClick: () => {
|
|
2375
2494
|
setSelectedItem(contextMenuItem);
|
|
@@ -2378,7 +2497,7 @@ function FileBrowser({
|
|
|
2378
2497
|
},
|
|
2379
2498
|
{
|
|
2380
2499
|
id: "download",
|
|
2381
|
-
label: "
|
|
2500
|
+
label: t11("file_browser.context_menu_download"),
|
|
2382
2501
|
icon: DownloadIcon,
|
|
2383
2502
|
onClick: async () => {
|
|
2384
2503
|
if (contextMenuItem.isDirectory) return;
|
|
@@ -2394,7 +2513,7 @@ function FileBrowser({
|
|
|
2394
2513
|
document.body.removeChild(a);
|
|
2395
2514
|
URL.revokeObjectURL(url);
|
|
2396
2515
|
} else {
|
|
2397
|
-
onError?.(result.error || "
|
|
2516
|
+
onError?.(result.error || t11("file_browser.download_file_error"));
|
|
2398
2517
|
}
|
|
2399
2518
|
},
|
|
2400
2519
|
disabled: contextMenuItem.isDirectory
|
|
@@ -2408,7 +2527,7 @@ function FileBrowser({
|
|
|
2408
2527
|
},
|
|
2409
2528
|
{
|
|
2410
2529
|
id: "delete",
|
|
2411
|
-
label: "
|
|
2530
|
+
label: t11("file_browser.context_menu_delete"),
|
|
2412
2531
|
icon: TrashIcon,
|
|
2413
2532
|
danger: true,
|
|
2414
2533
|
onClick: () => {
|
|
@@ -3963,22 +4082,27 @@ function PatternSegmentItem({
|
|
|
3963
4082
|
}
|
|
3964
4083
|
|
|
3965
4084
|
// src/ui/components/naming/SeparatorPicker.tsx
|
|
4085
|
+
import { createPackageT as createPackageT12 } from "hazo_core/i18n";
|
|
3966
4086
|
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3967
|
-
var
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
4087
|
+
var t12 = createPackageT12("hazo_files", en_default);
|
|
4088
|
+
function getCommonSeparators() {
|
|
4089
|
+
return [
|
|
4090
|
+
{ value: "-", label: "-", title: t12("separator_picker.title_hyphen") },
|
|
4091
|
+
{ value: "_", label: "_", title: t12("separator_picker.title_underscore") },
|
|
4092
|
+
{ value: "/", label: "/", title: t12("separator_picker.title_slash") },
|
|
4093
|
+
{ value: " ", label: "\u2423", title: t12("separator_picker.title_space") },
|
|
4094
|
+
{ value: ".", label: ".", title: t12("separator_picker.title_period") }
|
|
4095
|
+
];
|
|
4096
|
+
}
|
|
3974
4097
|
function SeparatorPicker({
|
|
3975
4098
|
onSelect,
|
|
3976
4099
|
disabled = false,
|
|
3977
4100
|
className = ""
|
|
3978
4101
|
}) {
|
|
4102
|
+
const commonSeparators = getCommonSeparators();
|
|
3979
4103
|
return /* @__PURE__ */ jsxs19("div", { className: `flex items-center gap-1 ${className}`, children: [
|
|
3980
|
-
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 mr-1", children: "
|
|
3981
|
-
|
|
4104
|
+
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 mr-1", children: t12("separator_picker.add_label") }),
|
|
4105
|
+
commonSeparators.map(({ value, label, title }) => /* @__PURE__ */ jsx20(
|
|
3982
4106
|
"button",
|
|
3983
4107
|
{
|
|
3984
4108
|
type: "button",
|
|
@@ -4096,7 +4220,9 @@ function PatternBuilder({
|
|
|
4096
4220
|
|
|
4097
4221
|
// src/ui/components/naming/PatternPreview.tsx
|
|
4098
4222
|
import { useMemo } from "react";
|
|
4223
|
+
import { createPackageT as createPackageT13, resolvePackageLocale as resolvePackageLocale4 } from "hazo_core/i18n";
|
|
4099
4224
|
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4225
|
+
var t13 = createPackageT13("hazo_files", en_default);
|
|
4100
4226
|
function PatternPreview({
|
|
4101
4227
|
filePattern,
|
|
4102
4228
|
folderPattern,
|
|
@@ -4109,7 +4235,7 @@ function PatternPreview({
|
|
|
4109
4235
|
const date = previewDate || /* @__PURE__ */ new Date();
|
|
4110
4236
|
const filePreview = useMemo(() => {
|
|
4111
4237
|
if (filePattern.length === 0) {
|
|
4112
|
-
return { name: "
|
|
4238
|
+
return { name: t13("pattern_preview.no_pattern"), isEmpty: true };
|
|
4113
4239
|
}
|
|
4114
4240
|
const baseName = generatePreviewName(filePattern, userVariables, {
|
|
4115
4241
|
date,
|
|
@@ -4125,7 +4251,7 @@ function PatternPreview({
|
|
|
4125
4251
|
}, [filePattern, userVariables, date, counterValue, sampleFileName]);
|
|
4126
4252
|
const folderPreview = useMemo(() => {
|
|
4127
4253
|
if (folderPattern.length === 0) {
|
|
4128
|
-
return { name: "
|
|
4254
|
+
return { name: t13("pattern_preview.no_pattern"), isEmpty: true };
|
|
4129
4255
|
}
|
|
4130
4256
|
return {
|
|
4131
4257
|
name: generatePreviewName(folderPattern, userVariables, {
|
|
@@ -4136,7 +4262,7 @@ function PatternPreview({
|
|
|
4136
4262
|
isEmpty: false
|
|
4137
4263
|
};
|
|
4138
4264
|
}, [folderPattern, userVariables, date, counterValue, sampleFileName]);
|
|
4139
|
-
const dateDisplay = date.toLocaleDateString("en-US", {
|
|
4265
|
+
const dateDisplay = date.toLocaleDateString(resolvePackageLocale4("en-US"), {
|
|
4140
4266
|
weekday: "short",
|
|
4141
4267
|
year: "numeric",
|
|
4142
4268
|
month: "short",
|
|
@@ -4148,12 +4274,12 @@ function PatternPreview({
|
|
|
4148
4274
|
className: `bg-gradient-to-br from-gray-50 to-gray-100 rounded-lg border border-gray-200 p-4 ${className}`,
|
|
4149
4275
|
children: [
|
|
4150
4276
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between mb-3", children: [
|
|
4151
|
-
/* @__PURE__ */ jsx22("h3", { className: "text-sm font-medium text-gray-700", children: "
|
|
4277
|
+
/* @__PURE__ */ jsx22("h3", { className: "text-sm font-medium text-gray-700", children: t13("pattern_preview.title") }),
|
|
4152
4278
|
/* @__PURE__ */ jsx22("span", { className: "text-xs text-gray-400", children: dateDisplay })
|
|
4153
4279
|
] }),
|
|
4154
4280
|
/* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
|
|
4155
4281
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3", children: [
|
|
4156
|
-
/* @__PURE__ */ jsx22("div", { className: "flex-shrink-0 w-16 text-xs text-gray-500 pt-0.5", children: "
|
|
4282
|
+
/* @__PURE__ */ jsx22("div", { className: "flex-shrink-0 w-16 text-xs text-gray-500 pt-0.5", children: t13("pattern_preview.file_label") }),
|
|
4157
4283
|
/* @__PURE__ */ jsx22(
|
|
4158
4284
|
"div",
|
|
4159
4285
|
{
|
|
@@ -4187,7 +4313,7 @@ function PatternPreview({
|
|
|
4187
4313
|
)
|
|
4188
4314
|
] }),
|
|
4189
4315
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3", children: [
|
|
4190
|
-
/* @__PURE__ */ jsx22("div", { className: "flex-shrink-0 w-16 text-xs text-gray-500 pt-0.5", children: "
|
|
4316
|
+
/* @__PURE__ */ jsx22("div", { className: "flex-shrink-0 w-16 text-xs text-gray-500 pt-0.5", children: t13("pattern_preview.folder_label") }),
|
|
4191
4317
|
/* @__PURE__ */ jsx22(
|
|
4192
4318
|
"div",
|
|
4193
4319
|
{
|
|
@@ -4218,7 +4344,7 @@ function PatternPreview({
|
|
|
4218
4344
|
)
|
|
4219
4345
|
] }),
|
|
4220
4346
|
!filePreview.isEmpty && !folderPreview.isEmpty && /* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3 pt-2 border-t border-gray-200", children: [
|
|
4221
|
-
/* @__PURE__ */ jsx22("div", { className: "flex-shrink-0 w-16 text-xs text-gray-500 pt-0.5", children: "
|
|
4347
|
+
/* @__PURE__ */ jsx22("div", { className: "flex-shrink-0 w-16 text-xs text-gray-500 pt-0.5", children: t13("pattern_preview.full_path_label") }),
|
|
4222
4348
|
/* @__PURE__ */ jsxs21("div", { className: "flex-1 font-mono text-xs text-gray-600 px-3 py-2 rounded bg-gray-100 border border-gray-200 overflow-x-auto", children: [
|
|
4223
4349
|
"/",
|
|
4224
4350
|
folderPreview.name,
|
|
@@ -4227,7 +4353,7 @@ function PatternPreview({
|
|
|
4227
4353
|
] })
|
|
4228
4354
|
] })
|
|
4229
4355
|
] }),
|
|
4230
|
-
/* @__PURE__ */ jsx22("p", { className: "text-xs text-gray-400 mt-3 text-center", children: "
|
|
4356
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs text-gray-400 mt-3 text-center", children: t13("pattern_preview.example_note") })
|
|
4231
4357
|
]
|
|
4232
4358
|
}
|
|
4233
4359
|
);
|