habarico 7.3.0-beta.6 → 7.3.0-beta.7
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/lib/index.cjs +101 -90
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +12 -9
- package/lib/index.esm.js +101 -91
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -15600,6 +15600,18 @@ const TabsLocationProvider = ({ children, syncWithLocation }) => {
|
|
|
15600
15600
|
const getExt = (filename) => {
|
|
15601
15601
|
return filename.split(".").pop()?.toLowerCase() ?? "";
|
|
15602
15602
|
};
|
|
15603
|
+
const IMAGE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
15604
|
+
"png",
|
|
15605
|
+
"jpg",
|
|
15606
|
+
"jpeg",
|
|
15607
|
+
"gif",
|
|
15608
|
+
"webp",
|
|
15609
|
+
"avif",
|
|
15610
|
+
"svg",
|
|
15611
|
+
"bmp",
|
|
15612
|
+
"ico"
|
|
15613
|
+
]);
|
|
15614
|
+
const isImageFilename = (filename) => IMAGE_EXTENSIONS.has(getExt(filename));
|
|
15603
15615
|
const isFileAccepted = (file, accept) => {
|
|
15604
15616
|
const types = accept.map((t) => t.trim().toLowerCase());
|
|
15605
15617
|
const ext = "." + getExt(file.name);
|
|
@@ -16119,12 +16131,12 @@ const csMessages = {
|
|
|
16119
16131
|
new_conversation: "Nov\xE1 konverzace",
|
|
16120
16132
|
error_message: "Omlouv\xE1m se, do\u0161lo k chyb\u011B p\u0159i komunikaci s AI. Zkuste to pros\xEDm znovu."
|
|
16121
16133
|
},
|
|
16122
|
-
|
|
16123
|
-
dialog_title: "Nahr\xE1t
|
|
16134
|
+
upload_files: {
|
|
16135
|
+
dialog_title: "Nahr\xE1t soubory",
|
|
16124
16136
|
select_files: "Vybrat soubory",
|
|
16125
|
-
remove_all_tooltip: "Odstranit v\u0161echny
|
|
16137
|
+
remove_all_tooltip: "Odstranit v\u0161echny soubory",
|
|
16126
16138
|
remove_all: "Smazat v\u0161e",
|
|
16127
|
-
upload_success: "
|
|
16139
|
+
upload_success: "Soubory byly \xFAsp\u011B\u0161n\u011B nahr\xE1ny.",
|
|
16128
16140
|
upload_error: "P\u0159i nahr\xE1v\xE1n\xED do\u0161lo k chyb\u011B.",
|
|
16129
16141
|
uploading: "Nahr\xE1v\xE1m\u2026",
|
|
16130
16142
|
processing: "Zpracov\xE1v\xE1 se\u2026",
|
|
@@ -16670,12 +16682,12 @@ const deMessages = {
|
|
|
16670
16682
|
new_conversation: "Neues Gespr\xE4ch",
|
|
16671
16683
|
error_message: "Entschuldigung, beim Kommunizieren mit der KI ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut."
|
|
16672
16684
|
},
|
|
16673
|
-
|
|
16674
|
-
dialog_title: "
|
|
16685
|
+
upload_files: {
|
|
16686
|
+
dialog_title: "Dateien hochladen",
|
|
16675
16687
|
select_files: "Dateien ausw\xE4hlen",
|
|
16676
|
-
remove_all_tooltip: "Alle
|
|
16688
|
+
remove_all_tooltip: "Alle Dateien entfernen",
|
|
16677
16689
|
remove_all: "Alle l\xF6schen",
|
|
16678
|
-
upload_success: "
|
|
16690
|
+
upload_success: "Dateien wurden erfolgreich hochgeladen.",
|
|
16679
16691
|
upload_error: "Beim Hochladen ist ein Fehler aufgetreten.",
|
|
16680
16692
|
uploading: "Hochladen\u2026",
|
|
16681
16693
|
processing: "Wird verarbeitet\u2026",
|
|
@@ -17223,12 +17235,12 @@ const enMessages = {
|
|
|
17223
17235
|
new_conversation: "New conversation",
|
|
17224
17236
|
error_message: "Sorry, an error occurred while communicating with AI. Please try again."
|
|
17225
17237
|
},
|
|
17226
|
-
|
|
17227
|
-
dialog_title: "Upload
|
|
17238
|
+
upload_files: {
|
|
17239
|
+
dialog_title: "Upload files",
|
|
17228
17240
|
select_files: "Select files",
|
|
17229
|
-
remove_all_tooltip: "Remove all
|
|
17241
|
+
remove_all_tooltip: "Remove all files",
|
|
17230
17242
|
remove_all: "Remove all",
|
|
17231
|
-
upload_success: "
|
|
17243
|
+
upload_success: "Files uploaded successfully.",
|
|
17232
17244
|
upload_error: "An error occurred during upload.",
|
|
17233
17245
|
uploading: "Uploading\u2026",
|
|
17234
17246
|
processing: "Processing\u2026",
|
|
@@ -17777,13 +17789,13 @@ const esMessages = {
|
|
|
17777
17789
|
new_conversation: "Nueva conversaci\xF3n",
|
|
17778
17790
|
error_message: "Lo sentimos, se produjo un error al comunicarse con la IA. Por favor, int\xE9ntelo de nuevo."
|
|
17779
17791
|
},
|
|
17780
|
-
|
|
17781
|
-
dialog_title: "Subir
|
|
17792
|
+
upload_files: {
|
|
17793
|
+
dialog_title: "Subir archivos",
|
|
17782
17794
|
select_files: "Seleccionar archivos",
|
|
17783
|
-
remove_all_tooltip: "Eliminar
|
|
17795
|
+
remove_all_tooltip: "Eliminar todos los archivos",
|
|
17784
17796
|
remove_all: "Eliminar todo",
|
|
17785
|
-
upload_success: "
|
|
17786
|
-
upload_error: "Se produjo un error al subir
|
|
17797
|
+
upload_success: "Los archivos se subieron correctamente.",
|
|
17798
|
+
upload_error: "Se produjo un error al subir los archivos.",
|
|
17787
17799
|
uploading: "Subiendo\u2026",
|
|
17788
17800
|
processing: "Procesando\u2026",
|
|
17789
17801
|
upload_count: "Subir (%{count})",
|
|
@@ -18361,12 +18373,12 @@ const frMessages = {
|
|
|
18361
18373
|
new_conversation: "Nouvelle conversation",
|
|
18362
18374
|
error_message: "D\xE9sol\xE9, une erreur s'est produite lors de la communication avec l'IA. Veuillez r\xE9essayer."
|
|
18363
18375
|
},
|
|
18364
|
-
|
|
18365
|
-
dialog_title: "T\xE9l\xE9charger des
|
|
18376
|
+
upload_files: {
|
|
18377
|
+
dialog_title: "T\xE9l\xE9charger des fichiers",
|
|
18366
18378
|
select_files: "S\xE9lectionner des fichiers",
|
|
18367
|
-
remove_all_tooltip: "Supprimer
|
|
18379
|
+
remove_all_tooltip: "Supprimer tous les fichiers",
|
|
18368
18380
|
remove_all: "Tout supprimer",
|
|
18369
|
-
upload_success: "
|
|
18381
|
+
upload_success: "Fichiers t\xE9l\xE9charg\xE9s avec succ\xE8s.",
|
|
18370
18382
|
upload_error: "Une erreur s'est produite lors du t\xE9l\xE9chargement.",
|
|
18371
18383
|
uploading: "T\xE9l\xE9chargement\u2026",
|
|
18372
18384
|
processing: "Traitement\u2026",
|
|
@@ -18929,12 +18941,12 @@ const itMessages = {
|
|
|
18929
18941
|
new_conversation: "Nuova conversazione",
|
|
18930
18942
|
error_message: "Spiacenti, si \xE8 verificato un errore durante la comunicazione con l'IA. Riprova."
|
|
18931
18943
|
},
|
|
18932
|
-
|
|
18933
|
-
dialog_title: "Carica
|
|
18944
|
+
upload_files: {
|
|
18945
|
+
dialog_title: "Carica file",
|
|
18934
18946
|
select_files: "Seleziona file",
|
|
18935
|
-
remove_all_tooltip: "Rimuovi
|
|
18947
|
+
remove_all_tooltip: "Rimuovi tutti i file",
|
|
18936
18948
|
remove_all: "Rimuovi tutto",
|
|
18937
|
-
upload_success: "
|
|
18949
|
+
upload_success: "I file sono stati caricati con successo.",
|
|
18938
18950
|
upload_error: "Si \xE8 verificato un errore durante il caricamento.",
|
|
18939
18951
|
uploading: "Caricamento\u2026",
|
|
18940
18952
|
processing: "Elaborazione\u2026",
|
|
@@ -19527,12 +19539,12 @@ const jaMessages = {
|
|
|
19527
19539
|
new_conversation: "\u65B0\u3057\u3044\u4F1A\u8A71",
|
|
19528
19540
|
error_message: "\u7533\u3057\u8A33\u3042\u308A\u307E\u305B\u3093\u304C\u3001AI\u3068\u306E\u901A\u4FE1\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"
|
|
19529
19541
|
},
|
|
19530
|
-
|
|
19531
|
-
dialog_title: "\
|
|
19542
|
+
upload_files: {
|
|
19543
|
+
dialog_title: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
|
|
19532
19544
|
select_files: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E",
|
|
19533
|
-
remove_all_tooltip: "\u3059\u3079\u3066\u306E\
|
|
19545
|
+
remove_all_tooltip: "\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664",
|
|
19534
19546
|
remove_all: "\u3059\u3079\u3066\u524A\u9664",
|
|
19535
|
-
upload_success: "\
|
|
19547
|
+
upload_success: "\u30D5\u30A1\u30A4\u30EB\u304C\u6B63\u5E38\u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3055\u308C\u307E\u3057\u305F\u3002",
|
|
19536
19548
|
upload_error: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002",
|
|
19537
19549
|
uploading: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u2026",
|
|
19538
19550
|
processing: "\u51E6\u7406\u4E2D\u2026",
|
|
@@ -20156,12 +20168,12 @@ const nlMessages = {
|
|
|
20156
20168
|
new_conversation: "Nieuw gesprek",
|
|
20157
20169
|
error_message: "Sorry, er is een fout opgetreden tijdens de communicatie met AI. Probeer het opnieuw."
|
|
20158
20170
|
},
|
|
20159
|
-
|
|
20160
|
-
dialog_title: "
|
|
20171
|
+
upload_files: {
|
|
20172
|
+
dialog_title: "Bestanden uploaden",
|
|
20161
20173
|
select_files: "Bestanden selecteren",
|
|
20162
|
-
remove_all_tooltip: "Alle
|
|
20174
|
+
remove_all_tooltip: "Alle bestanden verwijderen",
|
|
20163
20175
|
remove_all: "Alles verwijderen",
|
|
20164
|
-
upload_success: "
|
|
20176
|
+
upload_success: "Bestanden zijn succesvol ge\xFCpload.",
|
|
20165
20177
|
upload_error: "Er is een fout opgetreden tijdens het uploaden.",
|
|
20166
20178
|
uploading: "Uploaden\u2026",
|
|
20167
20179
|
processing: "Verwerken\u2026",
|
|
@@ -20735,12 +20747,12 @@ const plMessages = {
|
|
|
20735
20747
|
new_conversation: "Nowa rozmowa",
|
|
20736
20748
|
error_message: "Przepraszamy, wyst\u0105pi\u0142 b\u0142\u0105d podczas komunikacji z AI. Spr\xF3buj ponownie."
|
|
20737
20749
|
},
|
|
20738
|
-
|
|
20739
|
-
dialog_title: "Prze\u015Blij
|
|
20750
|
+
upload_files: {
|
|
20751
|
+
dialog_title: "Prze\u015Blij pliki",
|
|
20740
20752
|
select_files: "Wybierz pliki",
|
|
20741
|
-
remove_all_tooltip: "Usu\u0144 wszystkie
|
|
20753
|
+
remove_all_tooltip: "Usu\u0144 wszystkie pliki",
|
|
20742
20754
|
remove_all: "Usu\u0144 wszystko",
|
|
20743
|
-
upload_success: "
|
|
20755
|
+
upload_success: "Pliki zosta\u0142y przes\u0142ane pomy\u015Blnie.",
|
|
20744
20756
|
upload_error: "Wyst\u0105pi\u0142 b\u0142\u0105d podczas przesy\u0142ania.",
|
|
20745
20757
|
uploading: "Przesy\u0142anie\u2026",
|
|
20746
20758
|
processing: "Przetwarzanie\u2026",
|
|
@@ -21285,13 +21297,13 @@ const ptMessages = {
|
|
|
21285
21297
|
new_conversation: "Nova conversa",
|
|
21286
21298
|
error_message: "Desculpe, ocorreu um erro ao comunicar com a IA. Por favor, tente novamente."
|
|
21287
21299
|
},
|
|
21288
|
-
|
|
21289
|
-
dialog_title: "Enviar
|
|
21300
|
+
upload_files: {
|
|
21301
|
+
dialog_title: "Enviar arquivos",
|
|
21290
21302
|
select_files: "Selecionar arquivos",
|
|
21291
|
-
remove_all_tooltip: "Remover
|
|
21303
|
+
remove_all_tooltip: "Remover todos os arquivos",
|
|
21292
21304
|
remove_all: "Remover tudo",
|
|
21293
|
-
upload_success: "
|
|
21294
|
-
upload_error: "Ocorreu um erro ao enviar
|
|
21305
|
+
upload_success: "Arquivos enviados com sucesso.",
|
|
21306
|
+
upload_error: "Ocorreu um erro ao enviar os arquivos.",
|
|
21295
21307
|
uploading: "Enviando\u2026",
|
|
21296
21308
|
processing: "Processando\u2026",
|
|
21297
21309
|
upload_count: "Enviar (%{count})",
|
|
@@ -21780,13 +21792,13 @@ const roMessages = {
|
|
|
21780
21792
|
new_conversation: "Conversa\u021Bie nou\u0103",
|
|
21781
21793
|
error_message: "Ne pare r\u0103u, a ap\u0103rut o eroare \xEEn timpul comunic\u0103rii cu AI. V\u0103 rug\u0103m s\u0103 \xEEncerca\u021Bi din nou."
|
|
21782
21794
|
},
|
|
21783
|
-
|
|
21784
|
-
dialog_title: "\xCEncarc\u0103
|
|
21795
|
+
upload_files: {
|
|
21796
|
+
dialog_title: "\xCEncarc\u0103 fi\u0219iere",
|
|
21785
21797
|
select_files: "Selecteaz\u0103 fi\u0219iere",
|
|
21786
|
-
remove_all_tooltip: "Elimin\u0103 toate
|
|
21798
|
+
remove_all_tooltip: "Elimin\u0103 toate fi\u0219ierele",
|
|
21787
21799
|
remove_all: "Elimin\u0103 tot",
|
|
21788
|
-
upload_success: "
|
|
21789
|
-
upload_error: "A ap\u0103rut o eroare la \xEEnc\u0103rcarea
|
|
21800
|
+
upload_success: "Fi\u0219ierele au fost \xEEnc\u0103rcate cu succes.",
|
|
21801
|
+
upload_error: "A ap\u0103rut o eroare la \xEEnc\u0103rcarea fi\u0219ierelor.",
|
|
21790
21802
|
uploading: "Se \xEEncarc\u0103\u2026",
|
|
21791
21803
|
processing: "Se proceseaz\u0103\u2026",
|
|
21792
21804
|
upload_count: "\xCEncarc\u0103 (%{count})",
|
|
@@ -22329,12 +22341,12 @@ const skMessages = {
|
|
|
22329
22341
|
new_conversation: "Nov\xE1 konverz\xE1cia",
|
|
22330
22342
|
error_message: "Ospravedl\u0148ujem sa, pri komunik\xE1cii s AI do\u0161lo k chybe. Sk\xFAste to pros\xEDm znovu."
|
|
22331
22343
|
},
|
|
22332
|
-
|
|
22333
|
-
dialog_title: "Nahra\u0165
|
|
22344
|
+
upload_files: {
|
|
22345
|
+
dialog_title: "Nahra\u0165 s\xFAbory",
|
|
22334
22346
|
select_files: "Vybra\u0165 s\xFAbory",
|
|
22335
|
-
remove_all_tooltip: "Odstr\xE1ni\u0165 v\u0161etky
|
|
22347
|
+
remove_all_tooltip: "Odstr\xE1ni\u0165 v\u0161etky s\xFAbory",
|
|
22336
22348
|
remove_all: "Zmaza\u0165 v\u0161etko",
|
|
22337
|
-
upload_success: "
|
|
22349
|
+
upload_success: "S\xFAbory boli \xFAspe\u0161ne nahran\xE9.",
|
|
22338
22350
|
upload_error: "Pri nahr\xE1van\xED do\u0161lo k chybe.",
|
|
22339
22351
|
uploading: "Nahr\xE1vam\u2026",
|
|
22340
22352
|
processing: "Spracov\xE1va sa\u2026",
|
|
@@ -22952,12 +22964,12 @@ const ukMessages = {
|
|
|
22952
22964
|
new_conversation: "\u041D\u043E\u0432\u0430 \u0440\u043E\u0437\u043C\u043E\u0432\u0430",
|
|
22953
22965
|
error_message: "\u0412\u0438\u0431\u0430\u0447\u0442\u0435, \u043F\u0456\u0434 \u0447\u0430\u0441 \u0441\u043F\u0456\u043B\u043A\u0443\u0432\u0430\u043D\u043D\u044F \u0437 AI \u0441\u0442\u0430\u043B\u0430\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u0430. \u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \u0441\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437."
|
|
22954
22966
|
},
|
|
22955
|
-
|
|
22956
|
-
dialog_title: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\
|
|
22967
|
+
upload_files: {
|
|
22968
|
+
dialog_title: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043B\u0438",
|
|
22957
22969
|
select_files: "\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0444\u0430\u0439\u043B\u0438",
|
|
22958
|
-
remove_all_tooltip: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0441\u0456 \u0444\
|
|
22970
|
+
remove_all_tooltip: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0441\u0456 \u0444\u0430\u0439\u043B\u0438",
|
|
22959
22971
|
remove_all: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0441\u0435",
|
|
22960
|
-
upload_success: "\u0424\
|
|
22972
|
+
upload_success: "\u0424\u0430\u0439\u043B\u0438 \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u0456.",
|
|
22961
22973
|
upload_error: "\u041F\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0441\u0442\u0430\u043B\u0430\u0441\u044F \u043F\u043E\u043C\u0438\u043B\u043A\u0430.",
|
|
22962
22974
|
uploading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F\u2026",
|
|
22963
22975
|
processing: "\u041E\u0431\u0440\u043E\u0431\u043A\u0430\u2026",
|
|
@@ -28657,6 +28669,7 @@ var IconType = /* @__PURE__ */ ((IconType2) => {
|
|
|
28657
28669
|
IconType2["Task"] = "Task";
|
|
28658
28670
|
IconType2["Tune"] = "Tune";
|
|
28659
28671
|
IconType2["UnfoldMore"] = "UnfoldMore";
|
|
28672
|
+
IconType2["UploadFile"] = "UploadFile";
|
|
28660
28673
|
IconType2["ViewList"] = "ViewList";
|
|
28661
28674
|
IconType2["ViewWeek"] = "ViewWeek";
|
|
28662
28675
|
IconType2["Visibility"] = "Visibility";
|
|
@@ -53680,7 +53693,7 @@ const FileRow = ({
|
|
|
53680
53693
|
const hasSize = fileSize != null;
|
|
53681
53694
|
return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: rowSx(!!error, padding, singleFile, noBorder, !!disabled), children: [
|
|
53682
53695
|
/* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
53683
|
-
previewUrl ? /* @__PURE__ */ jsxRuntime.jsx(FileImagePreview, { src: previewUrl, alt: filename }) : /* @__PURE__ */ jsxRuntime.jsx(FileTypePreview, { filename }),
|
|
53696
|
+
previewUrl && isImageFilename(filename) ? /* @__PURE__ */ jsxRuntime.jsx(FileImagePreview, { src: previewUrl, alt: filename }) : /* @__PURE__ */ jsxRuntime.jsx(FileTypePreview, { filename }),
|
|
53684
53697
|
/* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
53685
53698
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53686
53699
|
material.Typography,
|
|
@@ -64845,15 +64858,15 @@ const TriStateBooleanInput = ({ sx, ...props }) => {
|
|
|
64845
64858
|
const useUploadAreaLabels = () => {
|
|
64846
64859
|
const translate = reactAdmin.useTranslate();
|
|
64847
64860
|
return {
|
|
64848
|
-
clickToUpload: translate("ra.
|
|
64849
|
-
orDragAndDrop: translate("ra.
|
|
64850
|
-
removeAll: translate("ra.
|
|
64851
|
-
filesRemainingHint: (count) => translate("ra.
|
|
64861
|
+
clickToUpload: translate("ra.upload_files.click_to_upload"),
|
|
64862
|
+
orDragAndDrop: translate("ra.upload_files.or_drag_and_drop"),
|
|
64863
|
+
removeAll: translate("ra.upload_files.remove_all"),
|
|
64864
|
+
filesRemainingHint: (count) => translate("ra.upload_files.files_remaining_hint", { count }),
|
|
64852
64865
|
maxFileSizeHint: (size) => `max. ${size}`,
|
|
64853
|
-
uploading: translate("ra.
|
|
64854
|
-
processing: translate("ra.
|
|
64855
|
-
uploadComplete: translate("ra.
|
|
64856
|
-
tryAgain: translate("ra.
|
|
64866
|
+
uploading: translate("ra.upload_files.uploading"),
|
|
64867
|
+
processing: translate("ra.upload_files.processing"),
|
|
64868
|
+
uploadComplete: translate("ra.upload_files.upload_complete"),
|
|
64869
|
+
tryAgain: translate("ra.upload_files.try_again")
|
|
64857
64870
|
};
|
|
64858
64871
|
};
|
|
64859
64872
|
|
|
@@ -64930,10 +64943,10 @@ const useUploadQueue = ({
|
|
|
64930
64943
|
};
|
|
64931
64944
|
const getUploadErrorMsg = (e) => {
|
|
64932
64945
|
if (e instanceof Error) return e.message;
|
|
64933
|
-
return translate("ra.
|
|
64946
|
+
return translate("ra.upload_files.upload_error");
|
|
64934
64947
|
};
|
|
64935
|
-
const validateFileType = (file) => accept && !isFileAccepted(file, accept) ? translate("ra.
|
|
64936
|
-
const validateFileSize = (file) => maxFileSize != null && file.size > maxFileSize ? translate("ra.
|
|
64948
|
+
const validateFileType = (file) => accept && !isFileAccepted(file, accept) ? translate("ra.upload_files.file_type_not_allowed") : null;
|
|
64949
|
+
const validateFileSize = (file) => maxFileSize != null && file.size > maxFileSize ? translate("ra.upload_files.file_too_large") : null;
|
|
64937
64950
|
const prepareAndUpload = async (id, picked) => {
|
|
64938
64951
|
const pickedError = validateFileType(picked);
|
|
64939
64952
|
if (pickedError) {
|
|
@@ -64947,7 +64960,7 @@ const useUploadQueue = ({
|
|
|
64947
64960
|
} catch {
|
|
64948
64961
|
updateEntry(id, {
|
|
64949
64962
|
processing: false,
|
|
64950
|
-
error: translate("ra.
|
|
64963
|
+
error: translate("ra.upload_files.image_processing_failed")
|
|
64951
64964
|
});
|
|
64952
64965
|
return;
|
|
64953
64966
|
}
|
|
@@ -65015,7 +65028,7 @@ const UploadInput = ({
|
|
|
65015
65028
|
const isMulti = maxFiles !== 1;
|
|
65016
65029
|
const defaultLabels = useUploadAreaLabels();
|
|
65017
65030
|
const failedCountRef = React.useRef(0);
|
|
65018
|
-
const validateUploads = () => failedCountRef.current > 0 ? "ra.
|
|
65031
|
+
const validateUploads = () => failedCountRef.current > 0 ? "ra.upload_files.unresolved_errors" : void 0;
|
|
65019
65032
|
const {
|
|
65020
65033
|
field: { onChange, value },
|
|
65021
65034
|
fieldState: { error, invalid }
|
|
@@ -74583,10 +74596,7 @@ const defaultBoxProvider = ({ schema, excludeFields, props }) => {
|
|
|
74583
74596
|
|
|
74584
74597
|
const DEFAULT_IMAGE_ACCEPT = [".png", ".jpg", ".jpeg", ".bmp", ".gif"];
|
|
74585
74598
|
|
|
74586
|
-
const
|
|
74587
|
-
uploadImages,
|
|
74588
|
-
...props
|
|
74589
|
-
}) => {
|
|
74599
|
+
const SchemaUploadFilesButton = ({ uploadFiles, ...props }) => {
|
|
74590
74600
|
const {
|
|
74591
74601
|
reference,
|
|
74592
74602
|
target,
|
|
@@ -74597,14 +74607,14 @@ const SchemaUploadImagesButton = ({
|
|
|
74597
74607
|
maxFiles,
|
|
74598
74608
|
upload: uploadParam,
|
|
74599
74609
|
data,
|
|
74600
|
-
|
|
74601
|
-
} =
|
|
74610
|
+
fileField
|
|
74611
|
+
} = uploadFiles ?? {};
|
|
74602
74612
|
const { getMethodSchema } = useGetLocalResourceSchema({ resource: reference });
|
|
74603
|
-
const
|
|
74604
|
-
(f) => f.name ===
|
|
74613
|
+
const fileFieldOptions = fileField ? (getMethodSchema("post")?.fields ?? getMethodSchema("get")?.fields)?.find(
|
|
74614
|
+
(f) => f.name === fileField
|
|
74605
74615
|
)?.options : void 0;
|
|
74606
|
-
const upload = uploadParam ??
|
|
74607
|
-
const accept = acceptParam ??
|
|
74616
|
+
const upload = uploadParam ?? fileFieldOptions?.upload;
|
|
74617
|
+
const accept = acceptParam ?? fileFieldOptions?.accept ?? DEFAULT_IMAGE_ACCEPT;
|
|
74608
74618
|
const translate = reactAdmin.useTranslate();
|
|
74609
74619
|
const { Dialog, openDialog, closeDialog } = useDialog();
|
|
74610
74620
|
const uploadResource = useResourceContext(reference);
|
|
@@ -74632,14 +74642,14 @@ const SchemaUploadImagesButton = ({
|
|
|
74632
74642
|
fileModifier
|
|
74633
74643
|
});
|
|
74634
74644
|
const handleConfirm = async () => {
|
|
74635
|
-
if (!
|
|
74645
|
+
if (!fileField) return;
|
|
74636
74646
|
setSaving(true);
|
|
74637
74647
|
let anyFailed = false;
|
|
74638
74648
|
const readyEntries = entries.filter((e) => e.uploadResult && !e.error && !e.done);
|
|
74639
74649
|
for (const entry of readyEntries) {
|
|
74640
74650
|
try {
|
|
74641
74651
|
await dataProvider.create(uploadResource, {
|
|
74642
|
-
data: { ...data, ...uploadTargetValues, [
|
|
74652
|
+
data: { ...data, ...uploadTargetValues, [fileField]: entry.uploadResult }
|
|
74643
74653
|
});
|
|
74644
74654
|
updateEntry(entry.id, { done: true });
|
|
74645
74655
|
} catch (e) {
|
|
@@ -74649,14 +74659,14 @@ const SchemaUploadImagesButton = ({
|
|
|
74649
74659
|
}
|
|
74650
74660
|
setSaving(false);
|
|
74651
74661
|
if (!anyFailed) {
|
|
74652
|
-
notify(translate("ra.
|
|
74662
|
+
notify(translate("ra.upload_files.upload_success"), { type: "success" });
|
|
74653
74663
|
refresh();
|
|
74654
74664
|
removeAll();
|
|
74655
74665
|
closeDialog();
|
|
74656
74666
|
}
|
|
74657
74667
|
};
|
|
74658
74668
|
const handleRetryEntry = async (id) => {
|
|
74659
|
-
if (!
|
|
74669
|
+
if (!fileField) return;
|
|
74660
74670
|
const entry = entries.find((e) => e.id === id);
|
|
74661
74671
|
if (!entry || entry.progress !== null) return;
|
|
74662
74672
|
if (entry.uploadResult) {
|
|
@@ -74664,10 +74674,10 @@ const SchemaUploadImagesButton = ({
|
|
|
74664
74674
|
setSaving(true);
|
|
74665
74675
|
try {
|
|
74666
74676
|
await dataProvider.create(uploadResource, {
|
|
74667
|
-
data: { ...data, ...uploadTargetValues, [
|
|
74677
|
+
data: { ...data, ...uploadTargetValues, [fileField]: entry.uploadResult }
|
|
74668
74678
|
});
|
|
74669
74679
|
updateEntry(id, { done: true });
|
|
74670
|
-
notify(translate("ra.
|
|
74680
|
+
notify(translate("ra.upload_files.upload_success"), { type: "success" });
|
|
74671
74681
|
refresh();
|
|
74672
74682
|
} catch (e) {
|
|
74673
74683
|
updateEntry(id, { error: getUploadErrorMsg(e) });
|
|
@@ -74688,12 +74698,12 @@ const SchemaUploadImagesButton = ({
|
|
|
74688
74698
|
variant: "text",
|
|
74689
74699
|
size: "medium",
|
|
74690
74700
|
...props,
|
|
74691
|
-
icon: props.icon ?? /* @__PURE__ */ jsxRuntime.jsx(Icon$1, { icon: IconType.
|
|
74701
|
+
icon: props.icon ?? /* @__PURE__ */ jsxRuntime.jsx(Icon$1, { icon: IconType.UploadFile }),
|
|
74692
74702
|
onClick: openDialog
|
|
74693
74703
|
}
|
|
74694
74704
|
),
|
|
74695
74705
|
/* @__PURE__ */ jsxRuntime.jsxs(Dialog, { maxWidth: "sm", fullWidth: true, disableClose: isDisabled, children: [
|
|
74696
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.DialogTitle, { children: translate("ra.
|
|
74706
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.DialogTitle, { children: translate("ra.upload_files.dialog_title") }),
|
|
74697
74707
|
/* @__PURE__ */ jsxRuntime.jsx(material.DialogContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
74698
74708
|
UploadArea,
|
|
74699
74709
|
{
|
|
@@ -74729,7 +74739,7 @@ const SchemaUploadImagesButton = ({
|
|
|
74729
74739
|
onClick: handleConfirm,
|
|
74730
74740
|
disabled: readyCount === 0 || isDisabled,
|
|
74731
74741
|
startIcon: saving ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 16 }) : void 0,
|
|
74732
|
-
children: saving ? translate("ra.
|
|
74742
|
+
children: saving ? translate("ra.upload_files.uploading") : translate("ra.upload_files.upload_count", { count: readyCount })
|
|
74733
74743
|
}
|
|
74734
74744
|
)
|
|
74735
74745
|
] })
|
|
@@ -74786,8 +74796,8 @@ const defaultButtonProvider = ({
|
|
|
74786
74796
|
return;
|
|
74787
74797
|
case "save":
|
|
74788
74798
|
return /* @__PURE__ */ jsxRuntime.jsx(SaveButton, { data: schema.save?.data, ...props });
|
|
74789
|
-
case "upload-
|
|
74790
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
74799
|
+
case "upload-files":
|
|
74800
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SchemaUploadFilesButton, { uploadFiles: schema.uploadFiles, ...props });
|
|
74791
74801
|
case "export":
|
|
74792
74802
|
return /* @__PURE__ */ jsxRuntime.jsx(ExportButton, { format: schema.export?.format, fields: schema.export?.fields, ...props });
|
|
74793
74803
|
}
|
|
@@ -106165,6 +106175,7 @@ exports.hideScrollY = hideScrollY;
|
|
|
106165
106175
|
exports.isBoxSchema = isBoxSchema;
|
|
106166
106176
|
exports.isFieldDescriptor = isFieldDescriptor;
|
|
106167
106177
|
exports.isFileAccepted = isFileAccepted;
|
|
106178
|
+
exports.isImageFilename = isImageFilename;
|
|
106168
106179
|
exports.isRoutedViewMode = isRoutedViewMode;
|
|
106169
106180
|
exports.isSafeUrl = isSafeUrl;
|
|
106170
106181
|
exports.isSelfHighlightingField = isSelfHighlightingField;
|