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/CHANGE_LOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 3.4.0 — 2026-09-19
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Migrated onto the canonical `hazo_core/i18n` bridge (`createPackageT` /
|
|
13
|
+
`resolvePackageLocale`), replacing this package's local ~120-line copy at
|
|
14
|
+
`src/lib/create_package_t.ts` (now deleted). All 13 call sites across
|
|
15
|
+
`src/ui/components/**` and `src/background_upload/react/use-file-upload-toasts.ts`
|
|
16
|
+
now import directly from `hazo_core/i18n`. Behavior is unchanged — same
|
|
17
|
+
flat `src/locales/en.json` fallback catalog, same `{{var}}` mustache
|
|
18
|
+
interpolation, same optional/no-op `hazo_i18n` registration side effect.
|
|
19
|
+
`hazo_core` peer bumped to `^2.4.0` (first version shipping the `/i18n`
|
|
20
|
+
subpath) and `hazo_i18n` peer bumped to `^0.5.0`. Added an "i18n bridge"
|
|
21
|
+
autotest scenario group to the test-app covering catalog load, key
|
|
22
|
+
coverage, and interpolation.
|
|
23
|
+
|
|
8
24
|
## 3.3.0 — 2026-08-13
|
|
9
25
|
|
|
10
26
|
### Fixed
|
|
@@ -320,6 +320,108 @@ var FileUploadContext = (0, import_react.createContext)(null);
|
|
|
320
320
|
|
|
321
321
|
// src/background_upload/react/use-file-upload-toasts.ts
|
|
322
322
|
var import_react2 = require("react");
|
|
323
|
+
|
|
324
|
+
// src/locales/en.json
|
|
325
|
+
var en_default = {
|
|
326
|
+
"upload_dialog.title": "Upload Files",
|
|
327
|
+
"upload_dialog.uploading_to": "Uploading to:",
|
|
328
|
+
"upload_dialog.drop_text": "Drag and drop files here, or",
|
|
329
|
+
"upload_dialog.browse": "browse",
|
|
330
|
+
"upload_dialog.files_selected": "{{count}} file(s) selected",
|
|
331
|
+
"upload_dialog.total": "Total:",
|
|
332
|
+
"upload_dialog.cancel": "Cancel",
|
|
333
|
+
"upload_dialog.upload": "Upload",
|
|
334
|
+
"upload_dialog.select_files_error": "Please select files to upload",
|
|
335
|
+
"create_folder_dialog.title": "Create New Folder",
|
|
336
|
+
"create_folder_dialog.creating_in": "Creating folder in:",
|
|
337
|
+
"create_folder_dialog.name_label": "Folder Name",
|
|
338
|
+
"create_folder_dialog.name_placeholder": "Enter folder name",
|
|
339
|
+
"create_folder_dialog.cancel": "Cancel",
|
|
340
|
+
"create_folder_dialog.submit": "Create Folder",
|
|
341
|
+
"create_folder_dialog.name_required_error": "Please enter a folder name",
|
|
342
|
+
"create_folder_dialog.invalid_chars_error": "Folder name contains invalid characters",
|
|
343
|
+
"rename_dialog.title_folder": "Rename Folder",
|
|
344
|
+
"rename_dialog.title_file": "Rename File",
|
|
345
|
+
"rename_dialog.name_label": "New Name",
|
|
346
|
+
"rename_dialog.name_placeholder": "Enter new name",
|
|
347
|
+
"rename_dialog.cancel": "Cancel",
|
|
348
|
+
"rename_dialog.submit": "Rename",
|
|
349
|
+
"rename_dialog.name_required_error": "Please enter a name",
|
|
350
|
+
"rename_dialog.invalid_chars_error": "Name contains invalid characters",
|
|
351
|
+
"delete_confirm_dialog.title_folder": "Delete Folder",
|
|
352
|
+
"delete_confirm_dialog.title_file": "Delete File",
|
|
353
|
+
"delete_confirm_dialog.confirm_message": "Are you sure you want to delete",
|
|
354
|
+
"delete_confirm_dialog.folder_warning": "Warning: This folder and all its contents will be permanently deleted.",
|
|
355
|
+
"delete_confirm_dialog.cancel": "Cancel",
|
|
356
|
+
"delete_confirm_dialog.submit": "Delete",
|
|
357
|
+
"metadata_dialog.title": "File Metadata",
|
|
358
|
+
"metadata_dialog.close": "Close",
|
|
359
|
+
"file_actions.new_folder": "New Folder",
|
|
360
|
+
"file_actions.upload": "Upload",
|
|
361
|
+
"file_actions.download": "Download",
|
|
362
|
+
"file_actions.rename": "Rename",
|
|
363
|
+
"file_actions.delete": "Delete",
|
|
364
|
+
"file_actions.refresh": "Refresh",
|
|
365
|
+
"file_list.empty": "This folder is empty",
|
|
366
|
+
"file_list.header_name": "Name",
|
|
367
|
+
"file_list.header_size": "Size",
|
|
368
|
+
"file_list.header_modified": "Modified",
|
|
369
|
+
"folder_tree.root": "Root",
|
|
370
|
+
"file_preview.select_prompt": "Select a file to preview",
|
|
371
|
+
"file_preview.folder_label": "Folder",
|
|
372
|
+
"file_preview.created_label": "Created:",
|
|
373
|
+
"file_preview.modified_label": "Modified:",
|
|
374
|
+
"file_preview.error_loading": "Error loading preview",
|
|
375
|
+
"file_preview.video_unsupported": "Your browser does not support video playback.",
|
|
376
|
+
"file_preview.audio_unsupported": "Your browser does not support audio playback.",
|
|
377
|
+
"file_preview.no_preview": "No preview available",
|
|
378
|
+
"file_preview.size_label": "Size:",
|
|
379
|
+
"file_preview.type_label": "Type:",
|
|
380
|
+
"file_info_panel.no_item_selected": "No item selected",
|
|
381
|
+
"file_info_panel.no_custom_metadata": "No custom metadata",
|
|
382
|
+
"file_info_panel.name_label": "Name:",
|
|
383
|
+
"file_info_panel.path_label": "Path:",
|
|
384
|
+
"file_info_panel.type_label": "Type:",
|
|
385
|
+
"file_info_panel.size_label": "Size:",
|
|
386
|
+
"file_info_panel.created_label": "Created:",
|
|
387
|
+
"file_info_panel.modified_label": "Modified:",
|
|
388
|
+
"file_info_panel.storage_label": "Storage:",
|
|
389
|
+
"file_info_panel.custom_metadata_title": "Custom Metadata",
|
|
390
|
+
"file_info_panel.type_folder": "Folder",
|
|
391
|
+
"file_info_panel.type_unknown": "Unknown",
|
|
392
|
+
"file_browser.load_directory_error": "Failed to load directory",
|
|
393
|
+
"file_browser.move_item_error": "Failed to move item",
|
|
394
|
+
"file_browser.upload_file_error": "Failed to upload {{name}}",
|
|
395
|
+
"file_browser.download_file_error": "Failed to download file",
|
|
396
|
+
"file_browser.create_folder_error": "Failed to create folder",
|
|
397
|
+
"file_browser.delete_error": "Failed to delete",
|
|
398
|
+
"file_browser.rename_error": "Failed to rename",
|
|
399
|
+
"file_browser.context_menu_view_metadata": "View Metadata",
|
|
400
|
+
"file_browser.context_menu_rename": "Rename",
|
|
401
|
+
"file_browser.context_menu_download": "Download",
|
|
402
|
+
"file_browser.context_menu_delete": "Delete",
|
|
403
|
+
"use_file_upload_toasts.job_completed": "{{count}} {{file_word}} processed for {{label}}",
|
|
404
|
+
"use_file_upload_toasts.upload_failed": "Upload failed for {{label}}: {{error}}",
|
|
405
|
+
"use_file_upload_toasts.action_required": "Action required for {{label}}",
|
|
406
|
+
"use_file_upload_toasts.action_required_description": "Review and confirm data conflicts",
|
|
407
|
+
"use_file_upload_toasts.batch_complete": "Batch complete: {{completed}}/{{total}} succeeded",
|
|
408
|
+
"pattern_preview.title": "Preview",
|
|
409
|
+
"pattern_preview.no_pattern": "(no pattern defined)",
|
|
410
|
+
"pattern_preview.file_label": "File:",
|
|
411
|
+
"pattern_preview.folder_label": "Folder:",
|
|
412
|
+
"pattern_preview.full_path_label": "Full path:",
|
|
413
|
+
"pattern_preview.example_note": "Preview uses example values from your variables",
|
|
414
|
+
"separator_picker.add_label": "Add:",
|
|
415
|
+
"separator_picker.title_hyphen": "Hyphen",
|
|
416
|
+
"separator_picker.title_underscore": "Underscore",
|
|
417
|
+
"separator_picker.title_slash": "Slash (for folder paths)",
|
|
418
|
+
"separator_picker.title_space": "Space",
|
|
419
|
+
"separator_picker.title_period": "Period"
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// src/background_upload/react/use-file-upload-toasts.ts
|
|
423
|
+
var import_i18n = require("hazo_core/i18n");
|
|
424
|
+
var t_pkg = (0, import_i18n.createPackageT)("hazo_files", en_default);
|
|
323
425
|
var toast_promise = null;
|
|
324
426
|
function get_toast() {
|
|
325
427
|
if (!toast_promise) {
|
|
@@ -335,22 +437,26 @@ function useFileUploadToasts(manager) {
|
|
|
335
437
|
if (!t) return;
|
|
336
438
|
const label = job.group_label || job.group_id;
|
|
337
439
|
const n = job.files.length;
|
|
338
|
-
t.success(
|
|
440
|
+
t.success(t_pkg("use_file_upload_toasts.job_completed", {
|
|
441
|
+
count: String(n),
|
|
442
|
+
file_word: n > 1 ? "files" : "file",
|
|
443
|
+
label
|
|
444
|
+
}));
|
|
339
445
|
});
|
|
340
446
|
}));
|
|
341
447
|
unsubs.push(manager.on("job:error", ({ job, error }) => {
|
|
342
448
|
void get_toast().then((t) => {
|
|
343
449
|
if (!t) return;
|
|
344
450
|
const label = job.group_label || job.group_id;
|
|
345
|
-
t.error(
|
|
451
|
+
t.error(t_pkg("use_file_upload_toasts.upload_failed", { label, error: String(error) }));
|
|
346
452
|
});
|
|
347
453
|
}));
|
|
348
454
|
unsubs.push(manager.on("job:confirmation_needed", ({ job }) => {
|
|
349
455
|
void get_toast().then((t) => {
|
|
350
456
|
if (!t) return;
|
|
351
457
|
const label = job.group_label || job.group_id;
|
|
352
|
-
t.info(
|
|
353
|
-
description: "
|
|
458
|
+
t.info(t_pkg("use_file_upload_toasts.action_required", { label }), {
|
|
459
|
+
description: t_pkg("use_file_upload_toasts.action_required_description"),
|
|
354
460
|
duration: 1e4
|
|
355
461
|
});
|
|
356
462
|
});
|
|
@@ -359,7 +465,10 @@ function useFileUploadToasts(manager) {
|
|
|
359
465
|
void get_toast().then((t) => {
|
|
360
466
|
if (!t) return;
|
|
361
467
|
if (batch.failed > 0) {
|
|
362
|
-
t.warning(
|
|
468
|
+
t.warning(t_pkg("use_file_upload_toasts.batch_complete", {
|
|
469
|
+
completed: String(batch.completed),
|
|
470
|
+
total: String(batch.total)
|
|
471
|
+
}));
|
|
363
472
|
}
|
|
364
473
|
});
|
|
365
474
|
}));
|
|
@@ -280,6 +280,108 @@ var FileUploadContext = createContext(null);
|
|
|
280
280
|
|
|
281
281
|
// src/background_upload/react/use-file-upload-toasts.ts
|
|
282
282
|
import { useEffect } from "react";
|
|
283
|
+
|
|
284
|
+
// src/locales/en.json
|
|
285
|
+
var en_default = {
|
|
286
|
+
"upload_dialog.title": "Upload Files",
|
|
287
|
+
"upload_dialog.uploading_to": "Uploading to:",
|
|
288
|
+
"upload_dialog.drop_text": "Drag and drop files here, or",
|
|
289
|
+
"upload_dialog.browse": "browse",
|
|
290
|
+
"upload_dialog.files_selected": "{{count}} file(s) selected",
|
|
291
|
+
"upload_dialog.total": "Total:",
|
|
292
|
+
"upload_dialog.cancel": "Cancel",
|
|
293
|
+
"upload_dialog.upload": "Upload",
|
|
294
|
+
"upload_dialog.select_files_error": "Please select files to upload",
|
|
295
|
+
"create_folder_dialog.title": "Create New Folder",
|
|
296
|
+
"create_folder_dialog.creating_in": "Creating folder in:",
|
|
297
|
+
"create_folder_dialog.name_label": "Folder Name",
|
|
298
|
+
"create_folder_dialog.name_placeholder": "Enter folder name",
|
|
299
|
+
"create_folder_dialog.cancel": "Cancel",
|
|
300
|
+
"create_folder_dialog.submit": "Create Folder",
|
|
301
|
+
"create_folder_dialog.name_required_error": "Please enter a folder name",
|
|
302
|
+
"create_folder_dialog.invalid_chars_error": "Folder name contains invalid characters",
|
|
303
|
+
"rename_dialog.title_folder": "Rename Folder",
|
|
304
|
+
"rename_dialog.title_file": "Rename File",
|
|
305
|
+
"rename_dialog.name_label": "New Name",
|
|
306
|
+
"rename_dialog.name_placeholder": "Enter new name",
|
|
307
|
+
"rename_dialog.cancel": "Cancel",
|
|
308
|
+
"rename_dialog.submit": "Rename",
|
|
309
|
+
"rename_dialog.name_required_error": "Please enter a name",
|
|
310
|
+
"rename_dialog.invalid_chars_error": "Name contains invalid characters",
|
|
311
|
+
"delete_confirm_dialog.title_folder": "Delete Folder",
|
|
312
|
+
"delete_confirm_dialog.title_file": "Delete File",
|
|
313
|
+
"delete_confirm_dialog.confirm_message": "Are you sure you want to delete",
|
|
314
|
+
"delete_confirm_dialog.folder_warning": "Warning: This folder and all its contents will be permanently deleted.",
|
|
315
|
+
"delete_confirm_dialog.cancel": "Cancel",
|
|
316
|
+
"delete_confirm_dialog.submit": "Delete",
|
|
317
|
+
"metadata_dialog.title": "File Metadata",
|
|
318
|
+
"metadata_dialog.close": "Close",
|
|
319
|
+
"file_actions.new_folder": "New Folder",
|
|
320
|
+
"file_actions.upload": "Upload",
|
|
321
|
+
"file_actions.download": "Download",
|
|
322
|
+
"file_actions.rename": "Rename",
|
|
323
|
+
"file_actions.delete": "Delete",
|
|
324
|
+
"file_actions.refresh": "Refresh",
|
|
325
|
+
"file_list.empty": "This folder is empty",
|
|
326
|
+
"file_list.header_name": "Name",
|
|
327
|
+
"file_list.header_size": "Size",
|
|
328
|
+
"file_list.header_modified": "Modified",
|
|
329
|
+
"folder_tree.root": "Root",
|
|
330
|
+
"file_preview.select_prompt": "Select a file to preview",
|
|
331
|
+
"file_preview.folder_label": "Folder",
|
|
332
|
+
"file_preview.created_label": "Created:",
|
|
333
|
+
"file_preview.modified_label": "Modified:",
|
|
334
|
+
"file_preview.error_loading": "Error loading preview",
|
|
335
|
+
"file_preview.video_unsupported": "Your browser does not support video playback.",
|
|
336
|
+
"file_preview.audio_unsupported": "Your browser does not support audio playback.",
|
|
337
|
+
"file_preview.no_preview": "No preview available",
|
|
338
|
+
"file_preview.size_label": "Size:",
|
|
339
|
+
"file_preview.type_label": "Type:",
|
|
340
|
+
"file_info_panel.no_item_selected": "No item selected",
|
|
341
|
+
"file_info_panel.no_custom_metadata": "No custom metadata",
|
|
342
|
+
"file_info_panel.name_label": "Name:",
|
|
343
|
+
"file_info_panel.path_label": "Path:",
|
|
344
|
+
"file_info_panel.type_label": "Type:",
|
|
345
|
+
"file_info_panel.size_label": "Size:",
|
|
346
|
+
"file_info_panel.created_label": "Created:",
|
|
347
|
+
"file_info_panel.modified_label": "Modified:",
|
|
348
|
+
"file_info_panel.storage_label": "Storage:",
|
|
349
|
+
"file_info_panel.custom_metadata_title": "Custom Metadata",
|
|
350
|
+
"file_info_panel.type_folder": "Folder",
|
|
351
|
+
"file_info_panel.type_unknown": "Unknown",
|
|
352
|
+
"file_browser.load_directory_error": "Failed to load directory",
|
|
353
|
+
"file_browser.move_item_error": "Failed to move item",
|
|
354
|
+
"file_browser.upload_file_error": "Failed to upload {{name}}",
|
|
355
|
+
"file_browser.download_file_error": "Failed to download file",
|
|
356
|
+
"file_browser.create_folder_error": "Failed to create folder",
|
|
357
|
+
"file_browser.delete_error": "Failed to delete",
|
|
358
|
+
"file_browser.rename_error": "Failed to rename",
|
|
359
|
+
"file_browser.context_menu_view_metadata": "View Metadata",
|
|
360
|
+
"file_browser.context_menu_rename": "Rename",
|
|
361
|
+
"file_browser.context_menu_download": "Download",
|
|
362
|
+
"file_browser.context_menu_delete": "Delete",
|
|
363
|
+
"use_file_upload_toasts.job_completed": "{{count}} {{file_word}} processed for {{label}}",
|
|
364
|
+
"use_file_upload_toasts.upload_failed": "Upload failed for {{label}}: {{error}}",
|
|
365
|
+
"use_file_upload_toasts.action_required": "Action required for {{label}}",
|
|
366
|
+
"use_file_upload_toasts.action_required_description": "Review and confirm data conflicts",
|
|
367
|
+
"use_file_upload_toasts.batch_complete": "Batch complete: {{completed}}/{{total}} succeeded",
|
|
368
|
+
"pattern_preview.title": "Preview",
|
|
369
|
+
"pattern_preview.no_pattern": "(no pattern defined)",
|
|
370
|
+
"pattern_preview.file_label": "File:",
|
|
371
|
+
"pattern_preview.folder_label": "Folder:",
|
|
372
|
+
"pattern_preview.full_path_label": "Full path:",
|
|
373
|
+
"pattern_preview.example_note": "Preview uses example values from your variables",
|
|
374
|
+
"separator_picker.add_label": "Add:",
|
|
375
|
+
"separator_picker.title_hyphen": "Hyphen",
|
|
376
|
+
"separator_picker.title_underscore": "Underscore",
|
|
377
|
+
"separator_picker.title_slash": "Slash (for folder paths)",
|
|
378
|
+
"separator_picker.title_space": "Space",
|
|
379
|
+
"separator_picker.title_period": "Period"
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
// src/background_upload/react/use-file-upload-toasts.ts
|
|
383
|
+
import { createPackageT } from "hazo_core/i18n";
|
|
384
|
+
var t_pkg = createPackageT("hazo_files", en_default);
|
|
283
385
|
var toast_promise = null;
|
|
284
386
|
function get_toast() {
|
|
285
387
|
if (!toast_promise) {
|
|
@@ -295,22 +397,26 @@ function useFileUploadToasts(manager) {
|
|
|
295
397
|
if (!t) return;
|
|
296
398
|
const label = job.group_label || job.group_id;
|
|
297
399
|
const n = job.files.length;
|
|
298
|
-
t.success(
|
|
400
|
+
t.success(t_pkg("use_file_upload_toasts.job_completed", {
|
|
401
|
+
count: String(n),
|
|
402
|
+
file_word: n > 1 ? "files" : "file",
|
|
403
|
+
label
|
|
404
|
+
}));
|
|
299
405
|
});
|
|
300
406
|
}));
|
|
301
407
|
unsubs.push(manager.on("job:error", ({ job, error }) => {
|
|
302
408
|
void get_toast().then((t) => {
|
|
303
409
|
if (!t) return;
|
|
304
410
|
const label = job.group_label || job.group_id;
|
|
305
|
-
t.error(
|
|
411
|
+
t.error(t_pkg("use_file_upload_toasts.upload_failed", { label, error: String(error) }));
|
|
306
412
|
});
|
|
307
413
|
}));
|
|
308
414
|
unsubs.push(manager.on("job:confirmation_needed", ({ job }) => {
|
|
309
415
|
void get_toast().then((t) => {
|
|
310
416
|
if (!t) return;
|
|
311
417
|
const label = job.group_label || job.group_id;
|
|
312
|
-
t.info(
|
|
313
|
-
description: "
|
|
418
|
+
t.info(t_pkg("use_file_upload_toasts.action_required", { label }), {
|
|
419
|
+
description: t_pkg("use_file_upload_toasts.action_required_description"),
|
|
314
420
|
duration: 1e4
|
|
315
421
|
});
|
|
316
422
|
});
|
|
@@ -319,7 +425,10 @@ function useFileUploadToasts(manager) {
|
|
|
319
425
|
void get_toast().then((t) => {
|
|
320
426
|
if (!t) return;
|
|
321
427
|
if (batch.failed > 0) {
|
|
322
|
-
t.warning(
|
|
428
|
+
t.warning(t_pkg("use_file_upload_toasts.batch_complete", {
|
|
429
|
+
completed: String(batch.completed),
|
|
430
|
+
total: String(batch.total)
|
|
431
|
+
}));
|
|
323
432
|
}
|
|
324
433
|
});
|
|
325
434
|
}));
|