@medusajs/dashboard 2.11.4-preview-20251106120154 → 2.11.4-preview-20251106180145
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/dist/{add-campaign-promotions-LEOARUW3.mjs → add-campaign-promotions-UR3UM3MV.mjs} +4 -4
- package/dist/{api-key-management-detail-RLTUSE44.mjs → api-key-management-detail-Z6V22XWR.mjs} +5 -5
- package/dist/{api-key-management-list-4KEBDRVQ.mjs → api-key-management-list-TVLEYYQO.mjs} +5 -5
- package/dist/{api-key-management-sales-channels-IGRPAJJ2.mjs → api-key-management-sales-channels-Y25FWD5A.mjs} +5 -5
- package/dist/app.js +51 -20
- package/dist/app.mjs +2 -2
- package/dist/{campaign-detail-VM2EHCYQ.mjs → campaign-detail-YDLSCIRO.mjs} +5 -5
- package/dist/{campaign-list-XRDVPCXE.mjs → campaign-list-M2462W5W.mjs} +6 -6
- package/dist/{category-detail-ZXA36JL5.mjs → category-detail-IZ3AWOCP.mjs} +4 -4
- package/dist/{category-list-AI2IGO67.mjs → category-list-BJLRBYZC.mjs} +4 -4
- package/dist/{category-products-Z5LZJ32F.mjs → category-products-55LDLRRQ.mjs} +4 -4
- package/dist/{chunk-6WFWT22M.mjs → chunk-2GWGNMAA.mjs} +1 -1
- package/dist/{chunk-76FLG6KU.mjs → chunk-2X25XWOW.mjs} +1 -1
- package/dist/{chunk-R7OR4HQQ.mjs → chunk-3BE5PBQZ.mjs} +1 -1
- package/dist/{chunk-N32YWZXM.mjs → chunk-5IFK2ZTA.mjs} +2 -2
- package/dist/{chunk-3JJBLFYN.mjs → chunk-7M7DFNIM.mjs} +21 -8
- package/dist/{chunk-TYTNUPXB.mjs → chunk-BYOPZAGX.mjs} +13 -4
- package/dist/{chunk-L7BOZCK7.mjs → chunk-CV65NY6Y.mjs} +1 -1
- package/dist/{chunk-E2J2KSDG.mjs → chunk-DCY4DKCQ.mjs} +97 -89
- package/dist/{chunk-3OGLDF4U.mjs → chunk-DZWH2RV6.mjs} +1 -1
- package/dist/{chunk-A4C2VYJH.mjs → chunk-GA3UMQMZ.mjs} +1 -1
- package/dist/{chunk-CB3UMLV2.mjs → chunk-GU5PJRPM.mjs} +1 -1
- package/dist/{chunk-IFICCCPS.mjs → chunk-IHH6OCSU.mjs} +1 -1
- package/dist/{chunk-RXXSK34K.mjs → chunk-M4Q5Q4I3.mjs} +2 -2
- package/dist/{chunk-EZNWSOIF.mjs → chunk-NL376WAO.mjs} +1 -1
- package/dist/{chunk-YNULA6PU.mjs → chunk-PVW6M64S.mjs} +1 -1
- package/dist/{chunk-BBLXCYME.mjs → chunk-ROKB75YP.mjs} +1 -1
- package/dist/{chunk-QPMPMKGJ.mjs → chunk-S5GNHYAG.mjs} +3 -3
- package/dist/{chunk-MHC2COUJ.mjs → chunk-SUYYSKCB.mjs} +18 -18
- package/dist/{chunk-F7E4I7W6.mjs → chunk-T57MRRCF.mjs} +1 -1
- package/dist/{chunk-BT4EIAAA.mjs → chunk-VEYZCWO5.mjs} +3 -3
- package/dist/{chunk-UDR6GM4C.mjs → chunk-WGIRB6HY.mjs} +1 -1
- package/dist/{chunk-UQKW4TKL.mjs → chunk-YA5PS6KW.mjs} +1 -1
- package/dist/{chunk-NJ6OPV6N.mjs → chunk-YGLRZQ4C.mjs} +1 -1
- package/dist/{chunk-43WSJSKM.mjs → chunk-YTN73JYH.mjs} +1 -1
- package/dist/{collection-add-products-T2N7QSJ3.mjs → collection-add-products-7CFVTCLK.mjs} +4 -4
- package/dist/{collection-detail-G6XV2433.mjs → collection-detail-3NMMB3CC.mjs} +4 -4
- package/dist/{collection-list-5UAWKYF3.mjs → collection-list-VNKB3725.mjs} +4 -4
- package/dist/{customer-detail-47EEVPS2.mjs → customer-detail-PAYUFGP6.mjs} +6 -6
- package/dist/{customer-group-add-customers-TPKDPKQB.mjs → customer-group-add-customers-MW2XH2F6.mjs} +6 -6
- package/dist/{customer-group-detail-B2OAKFTS.mjs → customer-group-detail-LJ6YVB2C.mjs} +6 -6
- package/dist/{customer-group-list-BOJHNJII.mjs → customer-group-list-M2OOZLIZ.mjs} +3 -3
- package/dist/{customer-list-7K5U27LG.mjs → customer-list-MZ7ZRERV.mjs} +6 -6
- package/dist/{customers-add-customer-group-K6TUA74U.mjs → customers-add-customer-group-IAIRRQ2I.mjs} +4 -4
- package/dist/en.json +1 -0
- package/dist/{inventory-detail-ASB73KWV.mjs → inventory-detail-ZJ5U5FSA.mjs} +4 -4
- package/dist/{inventory-list-C2MMQTES.mjs → inventory-list-HHTQRKQW.mjs} +4 -4
- package/dist/{location-fulfillment-providers-XP6WHPBF.mjs → location-fulfillment-providers-DNIVH7XD.mjs} +4 -4
- package/dist/{location-sales-channels-56Q6CXKL.mjs → location-sales-channels-3JAXXM3Q.mjs} +5 -5
- package/dist/{location-service-zone-create-ULDHY2U2.mjs → location-service-zone-create-D2HXXX63.mjs} +5 -5
- package/dist/{location-service-zone-manage-areas-IYJNAX7D.mjs → location-service-zone-manage-areas-LVVT6XBE.mjs} +5 -5
- package/dist/{order-create-claim-7NKA24P7.mjs → order-create-claim-2FPE6XP2.mjs} +4 -4
- package/dist/{order-create-edit-LJX4W7NG.mjs → order-create-edit-PVGKIS6G.mjs} +4 -4
- package/dist/{order-create-exchange-3SGVPVEW.mjs → order-create-exchange-G4JY4FSX.mjs} +4 -4
- package/dist/{order-create-return-D46V464L.mjs → order-create-return-VEUCH5BA.mjs} +4 -4
- package/dist/{order-detail-D32BXAWE.mjs → order-detail-2EFNG3UB.mjs} +2 -2
- package/dist/{order-list-E6MQYTOJ.mjs → order-list-EEC3VSLN.mjs} +8 -8
- package/dist/{price-list-configuration-5AMFLA3C.mjs → price-list-configuration-WQEQFG6M.mjs} +5 -5
- package/dist/{price-list-create-SF6ELAMF.mjs → price-list-create-36BOXETM.mjs} +5 -5
- package/dist/{price-list-detail-ESVZHRYB.mjs → price-list-detail-6CJ63F65.mjs} +5 -5
- package/dist/{price-list-list-JANFOZQI.mjs → price-list-list-2HDOJIC6.mjs} +4 -4
- package/dist/{price-list-prices-add-5FADNOGB.mjs → price-list-prices-add-AVPP57TL.mjs} +4 -4
- package/dist/{product-attributes-5MY4SGFX.mjs → product-attributes-IT2R62P3.mjs} +3 -3
- package/dist/{product-create-OWPAOIJU.mjs → product-create-X7MYHYRX.mjs} +8 -8
- package/dist/{product-detail-XLUTUYUE.mjs → product-detail-ZOO3E5SI.mjs} +5 -5
- package/dist/{product-edit-XDWFGRKM.mjs → product-edit-LX6OFTYL.mjs} +3 -3
- package/dist/{product-export-NVWDLE4I.mjs → product-export-5WBXPUYP.mjs} +3 -3
- package/dist/{product-image-variants-edit-E6I5E6QB.mjs → product-image-variants-edit-T3STDZJG.mjs} +4 -4
- package/dist/{product-import-5VLF2ZN4.mjs → product-import-YC7GJ4BW.mjs} +3 -2
- package/dist/{product-list-D2PWRKUE.mjs → product-list-BX2QNNQK.mjs} +7 -7
- package/dist/{product-media-Z3NNTB7H.mjs → product-media-O7M2YCTQ.mjs} +2 -2
- package/dist/{product-organization-NGKGAMVF.mjs → product-organization-AFRDTFZR.mjs} +3 -3
- package/dist/{product-sales-channels-IPOW5T64.mjs → product-sales-channels-LRMOPHMH.mjs} +5 -5
- package/dist/{product-shipping-profile-DHTDAKYL.mjs → product-shipping-profile-XMIIH5QP.mjs} +3 -3
- package/dist/{product-tag-detail-FXWXYI5Z.mjs → product-tag-detail-LDKRRJWH.mjs} +10 -10
- package/dist/{product-tag-list-IVXSYMFL.mjs → product-tag-list-3ERYK5WE.mjs} +10 -10
- package/dist/{product-type-detail-BWLICDYA.mjs → product-type-detail-UJ6QTCGQ.mjs} +4 -4
- package/dist/{product-type-list-LDCQKDKZ.mjs → product-type-list-73DQPW4H.mjs} +6 -6
- package/dist/{product-variant-detail-BSRN246J.mjs → product-variant-detail-JMPD7LEZ.mjs} +4 -4
- package/dist/{profile-detail-5Z3SFDB4.mjs → profile-detail-MEZKVQAB.mjs} +1 -1
- package/dist/{profile-edit-2MJF3JMT.mjs → profile-edit-XAHDV2DG.mjs} +1 -1
- package/dist/{promotion-detail-6HFB6Y6E.mjs → promotion-detail-L3FNHH6O.mjs} +3 -3
- package/dist/{promotion-list-2VADJJQM.mjs → promotion-list-R5JKSO4I.mjs} +4 -4
- package/dist/{refund-reason-list-ZYTUTZBO.mjs → refund-reason-list-NS4SVHGZ.mjs} +8 -8
- package/dist/{region-add-countries-VK4EJ4LD.mjs → region-add-countries-G5BOUL2E.mjs} +4 -4
- package/dist/{region-create-PYW22J5X.mjs → region-create-MLPUWT5W.mjs} +4 -4
- package/dist/{region-detail-6ORFQWHD.mjs → region-detail-RICQRZUA.mjs} +4 -4
- package/dist/{region-list-YLAWL5RJ.mjs → region-list-CJYT43SH.mjs} +4 -4
- package/dist/{reservation-list-4BFZSJIH.mjs → reservation-list-XP4YX4TR.mjs} +5 -5
- package/dist/{return-reason-list-JTXR53J7.mjs → return-reason-list-7MBVORVO.mjs} +10 -10
- package/dist/{sales-channel-add-products-IVZVKUVT.mjs → sales-channel-add-products-GQQ7Z3PT.mjs} +4 -4
- package/dist/{sales-channel-detail-ZRL7SHZV.mjs → sales-channel-detail-P2HXFYB4.mjs} +4 -4
- package/dist/{sales-channel-list-IMUI5QXS.mjs → sales-channel-list-4PJLCQ77.mjs} +5 -5
- package/dist/{shipping-option-type-list-XRDHS2W5.mjs → shipping-option-type-list-AWJRR7U5.mjs} +5 -5
- package/dist/{shipping-profiles-list-2DGSDS7S.mjs → shipping-profiles-list-7SVGIP72.mjs} +4 -4
- package/dist/{store-add-currencies-M6Y2Y5BO.mjs → store-add-currencies-V3IBSI45.mjs} +4 -4
- package/dist/{store-detail-QOCZCOUL.mjs → store-detail-3WFTRPJW.mjs} +4 -4
- package/dist/{tax-region-detail-LUS323UE.mjs → tax-region-detail-HXVZA2PP.mjs} +13 -13
- package/dist/{tax-region-province-detail-SRM2JTYP.mjs → tax-region-province-detail-VT3BUKLS.mjs} +13 -13
- package/dist/{tax-region-tax-override-create-TUJHJXIQ.mjs → tax-region-tax-override-create-RZUVOGNR.mjs} +11 -11
- package/dist/{tax-region-tax-override-edit-H5W5BMGJ.mjs → tax-region-tax-override-edit-OEQOEE6I.mjs} +12 -12
- package/dist/{user-invite-W6QLJ6H4.mjs → user-invite-QK3ZCSGG.mjs} +4 -4
- package/dist/{user-list-V2JUUJID.mjs → user-list-RH43CTBN.mjs} +4 -4
- package/dist/{workflow-execution-list-AULV5YFO.mjs → workflow-execution-list-6UTBTVX4.mjs} +4 -4
- package/package.json +9 -9
- package/src/components/common/file-upload/file-upload.tsx +23 -6
- package/src/components/layout/main-layout/main-layout.tsx +1 -0
- package/src/components/layout/nav-item/nav-item.tsx +14 -4
- package/src/dashboard-app/dashboard-app.tsx +1 -0
- package/src/dashboard-app/types.ts +1 -0
- package/src/i18n/languages.ts +18 -18
- package/src/i18n/translations/$schema.json +3 -0
- package/src/i18n/translations/en.json +1 -0
- package/src/routes/products/common/components/upload-media-form-item/upload-media-form-item.tsx +25 -7
- package/src/routes/products/product-import/components/upload-import.tsx +1 -0
|
@@ -10,15 +10,15 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
10
10
|
import {
|
|
11
11
|
_DataTable,
|
|
12
12
|
useDataTable
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
14
14
|
import "./chunk-HQKGZADC.mjs";
|
|
15
15
|
import "./chunk-EMIHDNB7.mjs";
|
|
16
16
|
import {
|
|
17
17
|
usePromotionTableFilters
|
|
18
18
|
} from "./chunk-LSEYENCI.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
20
20
|
import "./chunk-C76H5USB.mjs";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
22
22
|
import "./chunk-IUCDCPJU.mjs";
|
|
23
23
|
import {
|
|
24
24
|
KeyboundForm
|
|
@@ -33,7 +33,7 @@ import "./chunk-C5P5PL3E.mjs";
|
|
|
33
33
|
import "./chunk-LPEUYMRK.mjs";
|
|
34
34
|
import "./chunk-OC7BQLYI.mjs";
|
|
35
35
|
import "./chunk-S4DMV3ZT.mjs";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
37
37
|
import "./chunk-OBQI23QM.mjs";
|
|
38
38
|
import {
|
|
39
39
|
useAddOrRemoveCampaignPromotions,
|
package/dist/{api-key-management-detail-RLTUSE44.mjs → api-key-management-detail-Z6V22XWR.mjs}
RENAMED
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
useSalesChannelTableEmptyState,
|
|
12
12
|
useSalesChannelTableFilters,
|
|
13
13
|
useSalesChannelTableQuery
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-5IFK2ZTA.mjs";
|
|
15
|
+
import "./chunk-2X25XWOW.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SingleColumnPage
|
|
18
18
|
} from "./chunk-GIZFNLKK.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-2GWGNMAA.mjs";
|
|
20
20
|
import {
|
|
21
21
|
DataTable
|
|
22
22
|
} from "./chunk-GRNWRTT3.mjs";
|
|
23
23
|
import "./chunk-C76H5USB.mjs";
|
|
24
24
|
import {
|
|
25
25
|
useDate
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DZWH2RV6.mjs";
|
|
27
27
|
import "./chunk-RM6NY572.mjs";
|
|
28
28
|
import {
|
|
29
29
|
useExtension
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
} from "./chunk-OZPB6JBL.mjs";
|
|
38
38
|
import "./chunk-OC7BQLYI.mjs";
|
|
39
39
|
import "./chunk-S4DMV3ZT.mjs";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
41
41
|
import "./chunk-KXRW6JRE.mjs";
|
|
42
42
|
import "./chunk-KOSCMAIC.mjs";
|
|
43
43
|
import "./chunk-X6DSNTTX.mjs";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-MSDRGCRR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
DateCell
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ROKB75YP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
StatusCell
|
|
15
15
|
} from "./chunk-ADOCJB6L.mjs";
|
|
@@ -18,17 +18,17 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
18
18
|
import {
|
|
19
19
|
_DataTable,
|
|
20
20
|
useDataTable
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
22
22
|
import "./chunk-HQKGZADC.mjs";
|
|
23
23
|
import "./chunk-EMIHDNB7.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
25
25
|
import {
|
|
26
26
|
SingleColumnPage
|
|
27
27
|
} from "./chunk-GIZFNLKK.mjs";
|
|
28
28
|
import {
|
|
29
29
|
useQueryParams
|
|
30
30
|
} from "./chunk-C76H5USB.mjs";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
32
32
|
import {
|
|
33
33
|
useExtension
|
|
34
34
|
} from "./chunk-C5P5PL3E.mjs";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-OZPB6JBL.mjs";
|
|
39
39
|
import "./chunk-OC7BQLYI.mjs";
|
|
40
40
|
import "./chunk-S4DMV3ZT.mjs";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
42
42
|
import {
|
|
43
43
|
useApiKeys,
|
|
44
44
|
useDeleteApiKey,
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
useSalesChannelTableEmptyState,
|
|
7
7
|
useSalesChannelTableFilters,
|
|
8
8
|
useSalesChannelTableQuery
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-5IFK2ZTA.mjs";
|
|
10
|
+
import "./chunk-2X25XWOW.mjs";
|
|
11
|
+
import "./chunk-2GWGNMAA.mjs";
|
|
12
12
|
import {
|
|
13
13
|
DataTable
|
|
14
14
|
} from "./chunk-GRNWRTT3.mjs";
|
|
15
15
|
import "./chunk-C76H5USB.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
17
17
|
import "./chunk-IUCDCPJU.mjs";
|
|
18
18
|
import {
|
|
19
19
|
KeyboundForm
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
ConditionalTooltip
|
|
29
29
|
} from "./chunk-OC7BQLYI.mjs";
|
|
30
30
|
import "./chunk-S4DMV3ZT.mjs";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
32
32
|
import "./chunk-OBQI23QM.mjs";
|
|
33
33
|
import {
|
|
34
34
|
useApiKey,
|
package/dist/app.js
CHANGED
|
@@ -255,7 +255,7 @@ var init_languages = __esm({
|
|
|
255
255
|
code: "ptPT",
|
|
256
256
|
display_name: "Portugu\xEAs (Portugal)",
|
|
257
257
|
ltr: true,
|
|
258
|
-
date_locale: import_locale.
|
|
258
|
+
date_locale: import_locale.pt
|
|
259
259
|
},
|
|
260
260
|
{
|
|
261
261
|
code: "tr",
|
|
@@ -9880,6 +9880,7 @@ var init_en = __esm({
|
|
|
9880
9880
|
uploadImagesLabel: "Upload images",
|
|
9881
9881
|
uploadImagesHint: "Drag and drop images here or click to upload.",
|
|
9882
9882
|
invalidFileType: "'{{name}}' is not a supported file type. Supported file types are: {{types}}.",
|
|
9883
|
+
fileTooLarge: "'{{name}}' exceeds the maximum file size of {{size}}. Please upload a smaller file.",
|
|
9883
9884
|
failedToUpload: "Failed to upload the added media. Please try again.",
|
|
9884
9885
|
deleteWarning_one: "You are about to delete {{count}} image. This action cannot be undone.",
|
|
9885
9886
|
deleteWarning_other: "You are about to delete {{count}} images. This action cannot be undone.",
|
|
@@ -95408,10 +95409,13 @@ var init_nav_item = __esm({
|
|
|
95408
95409
|
to,
|
|
95409
95410
|
items,
|
|
95410
95411
|
type = "core",
|
|
95411
|
-
from
|
|
95412
|
+
from,
|
|
95413
|
+
translationNs
|
|
95412
95414
|
}) => {
|
|
95415
|
+
const { t: t5 } = (0, import_react_i18next6.useTranslation)(translationNs);
|
|
95413
95416
|
const { pathname } = (0, import_react_router_dom5.useLocation)();
|
|
95414
95417
|
const [open, setOpen] = (0, import_react19.useState)(getIsOpen(to, items, pathname));
|
|
95418
|
+
const displayLabel = translationNs ? t5(label) : label;
|
|
95415
95419
|
(0, import_react19.useEffect)(() => {
|
|
95416
95420
|
setOpen(getIsOpen(to, items, pathname));
|
|
95417
95421
|
}, [pathname, to, items]);
|
|
@@ -95450,7 +95454,7 @@ var init_nav_item = __esm({
|
|
|
95450
95454
|
},
|
|
95451
95455
|
children: [
|
|
95452
95456
|
type !== "setting" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex size-6 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon, type }) }),
|
|
95453
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children:
|
|
95457
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children: displayLabel })
|
|
95454
95458
|
]
|
|
95455
95459
|
}
|
|
95456
95460
|
) }),
|
|
@@ -95464,7 +95468,7 @@ var init_nav_item = __esm({
|
|
|
95464
95468
|
),
|
|
95465
95469
|
children: [
|
|
95466
95470
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex size-6 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon, type }) }),
|
|
95467
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children:
|
|
95471
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children: displayLabel })
|
|
95468
95472
|
]
|
|
95469
95473
|
}
|
|
95470
95474
|
),
|
|
@@ -95484,10 +95488,12 @@ var init_nav_item = __esm({
|
|
|
95484
95488
|
})
|
|
95485
95489
|
);
|
|
95486
95490
|
},
|
|
95487
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children:
|
|
95491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children: displayLabel })
|
|
95488
95492
|
}
|
|
95489
95493
|
) }) }),
|
|
95490
95494
|
items.map((item) => {
|
|
95495
|
+
const { t: itemT } = (0, import_react_i18next6.useTranslation)(item.translationNs);
|
|
95496
|
+
const itemLabel = item.translationNs ? itemT(item.label) : item.label;
|
|
95491
95497
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { className: "flex h-7 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NavItemTooltip, { to: item.to, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
95492
95498
|
import_react_router_dom5.NavLink,
|
|
95493
95499
|
{
|
|
@@ -95503,7 +95509,7 @@ var init_nav_item = __esm({
|
|
|
95503
95509
|
})
|
|
95504
95510
|
);
|
|
95505
95511
|
},
|
|
95506
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children:
|
|
95512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui7.Text, { size: "small", weight: "plus", leading: "compact", children: itemLabel })
|
|
95507
95513
|
}
|
|
95508
95514
|
) }) }, item.to);
|
|
95509
95515
|
})
|
|
@@ -96945,6 +96951,7 @@ var init_main_layout = __esm({
|
|
|
96945
96951
|
label: item.label,
|
|
96946
96952
|
icon: item.icon ? item.icon : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons10.SquaresPlus, {}),
|
|
96947
96953
|
items: item.items,
|
|
96954
|
+
translationNs: item.translationNs,
|
|
96948
96955
|
type: "extension"
|
|
96949
96956
|
},
|
|
96950
96957
|
i
|
|
@@ -106820,7 +106827,7 @@ var init_product_create_details_general_section = __esm({
|
|
|
106820
106827
|
});
|
|
106821
106828
|
|
|
106822
106829
|
// src/components/common/file-upload/file-upload.tsx
|
|
106823
|
-
var import_icons26, import_ui55, import_react71, import_jsx_runtime77, FileUpload;
|
|
106830
|
+
var import_icons26, import_ui55, import_react71, import_jsx_runtime77, DEFAULT_MAX_FILE_SIZE, FileUpload;
|
|
106824
106831
|
var init_file_upload = __esm({
|
|
106825
106832
|
"src/components/common/file-upload/file-upload.tsx"() {
|
|
106826
106833
|
"use strict";
|
|
@@ -106828,12 +106835,14 @@ var init_file_upload = __esm({
|
|
|
106828
106835
|
import_ui55 = require("@medusajs/ui");
|
|
106829
106836
|
import_react71 = require("react");
|
|
106830
106837
|
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
106838
|
+
DEFAULT_MAX_FILE_SIZE = 1024 * 1024;
|
|
106831
106839
|
FileUpload = ({
|
|
106832
106840
|
label,
|
|
106833
106841
|
hint,
|
|
106834
106842
|
multiple = true,
|
|
106835
106843
|
hasError,
|
|
106836
106844
|
formats,
|
|
106845
|
+
maxFileSize = DEFAULT_MAX_FILE_SIZE,
|
|
106837
106846
|
onUploaded
|
|
106838
106847
|
}) => {
|
|
106839
106848
|
const [isDragOver, setIsDragOver] = (0, import_react71.useState)(false);
|
|
@@ -106864,16 +106873,23 @@ var init_file_upload = __esm({
|
|
|
106864
106873
|
return;
|
|
106865
106874
|
}
|
|
106866
106875
|
const fileList = Array.from(files);
|
|
106867
|
-
const
|
|
106876
|
+
const validFiles = [];
|
|
106877
|
+
const rejectedFiles = [];
|
|
106878
|
+
const normalizedMaxFileSize = Math.min(maxFileSize, Infinity);
|
|
106879
|
+
fileList.forEach((file) => {
|
|
106880
|
+
if (file.size > normalizedMaxFileSize) {
|
|
106881
|
+
rejectedFiles.push({ file, reason: "size" });
|
|
106882
|
+
return;
|
|
106883
|
+
}
|
|
106868
106884
|
const id2 = Math.random().toString(36).substring(7);
|
|
106869
106885
|
const previewUrl = URL.createObjectURL(file);
|
|
106870
|
-
|
|
106886
|
+
validFiles.push({
|
|
106871
106887
|
id: id2,
|
|
106872
106888
|
url: previewUrl,
|
|
106873
106889
|
file
|
|
106874
|
-
};
|
|
106890
|
+
});
|
|
106875
106891
|
});
|
|
106876
|
-
onUploaded(
|
|
106892
|
+
onUploaded(validFiles, rejectedFiles);
|
|
106877
106893
|
};
|
|
106878
106894
|
const handleDrop = (event) => {
|
|
106879
106895
|
event.preventDefault();
|
|
@@ -106978,10 +106994,11 @@ var init_upload_media_form_item = __esm({
|
|
|
106978
106994
|
}) => {
|
|
106979
106995
|
const { t: t5 } = (0, import_react_i18next45.useTranslation)();
|
|
106980
106996
|
const hasInvalidFiles = (0, import_react72.useCallback)(
|
|
106981
|
-
(fileList) => {
|
|
106997
|
+
(fileList = [], rejectedFiles = []) => {
|
|
106982
106998
|
const invalidFile = fileList.find(
|
|
106983
|
-
(f) => !SUPPORTED_FORMATS.includes(f
|
|
106999
|
+
(f) => !SUPPORTED_FORMATS.includes(f?.file?.type)
|
|
106984
107000
|
);
|
|
107001
|
+
let hasInvalidFile = false;
|
|
106985
107002
|
if (invalidFile) {
|
|
106986
107003
|
form.setError("media", {
|
|
106987
107004
|
type: "invalid_file",
|
|
@@ -106990,19 +107007,31 @@ var init_upload_media_form_item = __esm({
|
|
|
106990
107007
|
types: SUPPORTED_FORMATS_FILE_EXTENSIONS.join(", ")
|
|
106991
107008
|
})
|
|
106992
107009
|
});
|
|
106993
|
-
|
|
107010
|
+
hasInvalidFile = true;
|
|
106994
107011
|
}
|
|
106995
|
-
|
|
107012
|
+
const fileSizeRejections = rejectedFiles.filter((f) => f?.reason === "size");
|
|
107013
|
+
if (fileSizeRejections.length) {
|
|
107014
|
+
const fileNames = fileSizeRejections.map((f) => f.file.name).join(", ");
|
|
107015
|
+
form.setError("media", {
|
|
107016
|
+
type: "file_too_large",
|
|
107017
|
+
message: t5("products.media.fileTooLarge", {
|
|
107018
|
+
name: fileNames,
|
|
107019
|
+
size: "1MB"
|
|
107020
|
+
})
|
|
107021
|
+
});
|
|
107022
|
+
hasInvalidFile = true;
|
|
107023
|
+
}
|
|
107024
|
+
return hasInvalidFile;
|
|
106996
107025
|
},
|
|
106997
107026
|
[form, t5]
|
|
106998
107027
|
);
|
|
106999
107028
|
const onUploaded = (0, import_react72.useCallback)(
|
|
107000
|
-
(files) => {
|
|
107029
|
+
(files = [], rejectedFiles = []) => {
|
|
107001
107030
|
form.clearErrors("media");
|
|
107002
|
-
if (hasInvalidFiles(files)) {
|
|
107031
|
+
if (hasInvalidFiles(files, rejectedFiles)) {
|
|
107003
107032
|
return;
|
|
107004
107033
|
}
|
|
107005
|
-
files
|
|
107034
|
+
files?.forEach((f) => append({ ...f, isThumbnail: false }));
|
|
107006
107035
|
},
|
|
107007
107036
|
[form, append, hasInvalidFiles]
|
|
107008
107037
|
);
|
|
@@ -114569,7 +114598,8 @@ var init_upload_import = __esm({
|
|
|
114569
114598
|
return;
|
|
114570
114599
|
}
|
|
114571
114600
|
onUploaded(files[0].file);
|
|
114572
|
-
}
|
|
114601
|
+
},
|
|
114602
|
+
maxFileSize: Infinity
|
|
114573
114603
|
}
|
|
114574
114604
|
),
|
|
114575
114605
|
error && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_ui82.Hint, { variant: "error", children: error }) })
|
|
@@ -188119,7 +188149,8 @@ var init_dashboard_app = __esm({
|
|
|
188119
188149
|
to: item.path,
|
|
188120
188150
|
icon: item.icon ? /* @__PURE__ */ (0, import_jsx_runtime684.jsx)(item.icon, {}) : void 0,
|
|
188121
188151
|
items: [],
|
|
188122
|
-
nested: item.nested
|
|
188152
|
+
nested: item.nested,
|
|
188153
|
+
translationNs: item.translationNs
|
|
188123
188154
|
};
|
|
188124
188155
|
if (parentPath !== "/" && tempRegistry[parentPath]) {
|
|
188125
188156
|
if (!tempRegistry[parentPath].items) {
|
package/dist/app.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DashboardApp
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DCY4DKCQ.mjs";
|
|
4
4
|
import "./chunk-NQIC7ZFS.mjs";
|
|
5
5
|
import "./chunk-ONB3JEHR.mjs";
|
|
6
6
|
import "./chunk-YCDDT44O.mjs";
|
|
@@ -17,7 +17,7 @@ import "./chunk-ZCARHA6C.mjs";
|
|
|
17
17
|
import "./chunk-OZPB6JBL.mjs";
|
|
18
18
|
import "./chunk-OC7BQLYI.mjs";
|
|
19
19
|
import "./chunk-S4DMV3ZT.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
21
21
|
import "./chunk-OBQI23QM.mjs";
|
|
22
22
|
import "./chunk-KXRW6JRE.mjs";
|
|
23
23
|
import "./chunk-KOSCMAIC.mjs";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-CBYAN3G4.mjs";
|
|
5
5
|
import {
|
|
6
6
|
DateRangeDisplay
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NL376WAO.mjs";
|
|
8
8
|
import "./chunk-SC6BSTC7.mjs";
|
|
9
9
|
import "./chunk-MSDRGCRR.mjs";
|
|
10
10
|
import "./chunk-ADOCJB6L.mjs";
|
|
@@ -13,7 +13,7 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
13
13
|
import {
|
|
14
14
|
_DataTable,
|
|
15
15
|
useDataTable
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
17
17
|
import "./chunk-HQKGZADC.mjs";
|
|
18
18
|
import "./chunk-EMIHDNB7.mjs";
|
|
19
19
|
import {
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
usePromotionTableFilters
|
|
24
24
|
} from "./chunk-LSEYENCI.mjs";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
26
26
|
import {
|
|
27
27
|
TwoColumnPage
|
|
28
28
|
} from "./chunk-GIZFNLKK.mjs";
|
|
29
29
|
import "./chunk-C76H5USB.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
31
31
|
import "./chunk-4GQOUCX6.mjs";
|
|
32
32
|
import "./chunk-PMA2D6IL.mjs";
|
|
33
33
|
import {
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
} from "./chunk-OZPB6JBL.mjs";
|
|
42
42
|
import "./chunk-OC7BQLYI.mjs";
|
|
43
43
|
import "./chunk-S4DMV3ZT.mjs";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
45
45
|
import "./chunk-KXRW6JRE.mjs";
|
|
46
46
|
import "./chunk-KOSCMAIC.mjs";
|
|
47
47
|
import "./chunk-X6DSNTTX.mjs";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCampaignTableColumns
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GA3UMQMZ.mjs";
|
|
4
4
|
import "./chunk-MSDRGCRR.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-ROKB75YP.mjs";
|
|
6
6
|
import "./chunk-P3UUX2T6.mjs";
|
|
7
7
|
import "./chunk-LQTHYS2Z.mjs";
|
|
8
8
|
import {
|
|
9
9
|
_DataTable,
|
|
10
10
|
useDataTable
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
12
12
|
import "./chunk-HQKGZADC.mjs";
|
|
13
13
|
import "./chunk-EMIHDNB7.mjs";
|
|
14
14
|
import {
|
|
15
15
|
useCampaignTableQuery
|
|
16
16
|
} from "./chunk-OMC5JCQH.mjs";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SingleColumnPage
|
|
20
20
|
} from "./chunk-GIZFNLKK.mjs";
|
|
21
21
|
import "./chunk-C76H5USB.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
23
23
|
import {
|
|
24
24
|
useExtension
|
|
25
25
|
} from "./chunk-C5P5PL3E.mjs";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-OZPB6JBL.mjs";
|
|
30
30
|
import "./chunk-OC7BQLYI.mjs";
|
|
31
31
|
import "./chunk-S4DMV3ZT.mjs";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
33
33
|
import {
|
|
34
34
|
useCampaigns,
|
|
35
35
|
useDeleteCampaign
|
|
@@ -21,7 +21,7 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
21
21
|
import {
|
|
22
22
|
_DataTable,
|
|
23
23
|
useDataTable
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
25
25
|
import "./chunk-HQKGZADC.mjs";
|
|
26
26
|
import "./chunk-EMIHDNB7.mjs";
|
|
27
27
|
import {
|
|
@@ -30,12 +30,12 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
useProductTableFilters
|
|
32
32
|
} from "./chunk-6IXLTZ2H.mjs";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
34
34
|
import {
|
|
35
35
|
TwoColumnPage
|
|
36
36
|
} from "./chunk-GIZFNLKK.mjs";
|
|
37
37
|
import "./chunk-C76H5USB.mjs";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
39
39
|
import "./chunk-MNXC6Q4F.mjs";
|
|
40
40
|
import {
|
|
41
41
|
useExtension
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
} from "./chunk-OZPB6JBL.mjs";
|
|
50
50
|
import "./chunk-OC7BQLYI.mjs";
|
|
51
51
|
import "./chunk-S4DMV3ZT.mjs";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
53
53
|
import "./chunk-KXRW6JRE.mjs";
|
|
54
54
|
import "./chunk-KOSCMAIC.mjs";
|
|
55
55
|
import "./chunk-X6DSNTTX.mjs";
|
|
@@ -18,17 +18,17 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
18
18
|
import {
|
|
19
19
|
_DataTable,
|
|
20
20
|
useDataTable
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
22
22
|
import "./chunk-HQKGZADC.mjs";
|
|
23
23
|
import "./chunk-EMIHDNB7.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
25
25
|
import {
|
|
26
26
|
SingleColumnPage
|
|
27
27
|
} from "./chunk-GIZFNLKK.mjs";
|
|
28
28
|
import {
|
|
29
29
|
useQueryParams
|
|
30
30
|
} from "./chunk-C76H5USB.mjs";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
32
32
|
import {
|
|
33
33
|
useExtension
|
|
34
34
|
} from "./chunk-C5P5PL3E.mjs";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-OZPB6JBL.mjs";
|
|
39
39
|
import "./chunk-OC7BQLYI.mjs";
|
|
40
40
|
import "./chunk-S4DMV3ZT.mjs";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
42
42
|
import {
|
|
43
43
|
useProductCategories
|
|
44
44
|
} from "./chunk-MQALAB34.mjs";
|
|
@@ -9,7 +9,7 @@ import "./chunk-LQTHYS2Z.mjs";
|
|
|
9
9
|
import {
|
|
10
10
|
_DataTable,
|
|
11
11
|
useDataTable
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YTN73JYH.mjs";
|
|
13
13
|
import "./chunk-HQKGZADC.mjs";
|
|
14
14
|
import "./chunk-EMIHDNB7.mjs";
|
|
15
15
|
import {
|
|
@@ -18,9 +18,9 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
useProductTableFilters
|
|
20
20
|
} from "./chunk-6IXLTZ2H.mjs";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-GU5PJRPM.mjs";
|
|
22
22
|
import "./chunk-C76H5USB.mjs";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-DZWH2RV6.mjs";
|
|
24
24
|
import "./chunk-IUCDCPJU.mjs";
|
|
25
25
|
import {
|
|
26
26
|
KeyboundForm
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import "./chunk-MNXC6Q4F.mjs";
|
|
33
33
|
import "./chunk-LPEUYMRK.mjs";
|
|
34
34
|
import "./chunk-S4DMV3ZT.mjs";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-SUYYSKCB.mjs";
|
|
36
36
|
import "./chunk-OBQI23QM.mjs";
|
|
37
37
|
import "./chunk-KXRW6JRE.mjs";
|
|
38
38
|
import "./chunk-KOSCMAIC.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDataTableDateColumns
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2X25XWOW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useDataTableDateFilters
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2GWGNMAA.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useQueryParams
|
|
9
9
|
} from "./chunk-C76H5USB.mjs";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZQRKUG6J.mjs";
|
|
5
5
|
import {
|
|
6
6
|
FileUpload
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BYOPZAGX.mjs";
|
|
8
8
|
import {
|
|
9
9
|
castNumber
|
|
10
10
|
} from "./chunk-6GU6IDUA.mjs";
|
|
@@ -266,10 +266,11 @@ var UploadMediaFormItem = ({
|
|
|
266
266
|
}) => {
|
|
267
267
|
const { t } = useTranslation();
|
|
268
268
|
const hasInvalidFiles = useCallback(
|
|
269
|
-
(fileList) => {
|
|
269
|
+
(fileList = [], rejectedFiles = []) => {
|
|
270
270
|
const invalidFile = fileList.find(
|
|
271
|
-
(f) => !SUPPORTED_FORMATS.includes(f
|
|
271
|
+
(f) => !SUPPORTED_FORMATS.includes(f?.file?.type)
|
|
272
272
|
);
|
|
273
|
+
let hasInvalidFile = false;
|
|
273
274
|
if (invalidFile) {
|
|
274
275
|
form.setError("media", {
|
|
275
276
|
type: "invalid_file",
|
|
@@ -278,19 +279,31 @@ var UploadMediaFormItem = ({
|
|
|
278
279
|
types: SUPPORTED_FORMATS_FILE_EXTENSIONS.join(", ")
|
|
279
280
|
})
|
|
280
281
|
});
|
|
281
|
-
|
|
282
|
+
hasInvalidFile = true;
|
|
282
283
|
}
|
|
283
|
-
|
|
284
|
+
const fileSizeRejections = rejectedFiles.filter((f) => f?.reason === "size");
|
|
285
|
+
if (fileSizeRejections.length) {
|
|
286
|
+
const fileNames = fileSizeRejections.map((f) => f.file.name).join(", ");
|
|
287
|
+
form.setError("media", {
|
|
288
|
+
type: "file_too_large",
|
|
289
|
+
message: t("products.media.fileTooLarge", {
|
|
290
|
+
name: fileNames,
|
|
291
|
+
size: "1MB"
|
|
292
|
+
})
|
|
293
|
+
});
|
|
294
|
+
hasInvalidFile = true;
|
|
295
|
+
}
|
|
296
|
+
return hasInvalidFile;
|
|
284
297
|
},
|
|
285
298
|
[form, t]
|
|
286
299
|
);
|
|
287
300
|
const onUploaded = useCallback(
|
|
288
|
-
(files) => {
|
|
301
|
+
(files = [], rejectedFiles = []) => {
|
|
289
302
|
form.clearErrors("media");
|
|
290
|
-
if (hasInvalidFiles(files)) {
|
|
303
|
+
if (hasInvalidFiles(files, rejectedFiles)) {
|
|
291
304
|
return;
|
|
292
305
|
}
|
|
293
|
-
files
|
|
306
|
+
files?.forEach((f) => append({ ...f, isThumbnail: false }));
|
|
294
307
|
},
|
|
295
308
|
[form, append, hasInvalidFiles]
|
|
296
309
|
);
|
|
@@ -3,12 +3,14 @@ import { ArrowDownTray } from "@medusajs/icons";
|
|
|
3
3
|
import { Text, clx } from "@medusajs/ui";
|
|
4
4
|
import { useRef, useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var DEFAULT_MAX_FILE_SIZE = 1024 * 1024;
|
|
6
7
|
var FileUpload = ({
|
|
7
8
|
label,
|
|
8
9
|
hint,
|
|
9
10
|
multiple = true,
|
|
10
11
|
hasError,
|
|
11
12
|
formats,
|
|
13
|
+
maxFileSize = DEFAULT_MAX_FILE_SIZE,
|
|
12
14
|
onUploaded
|
|
13
15
|
}) => {
|
|
14
16
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
@@ -39,16 +41,23 @@ var FileUpload = ({
|
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
43
|
const fileList = Array.from(files);
|
|
42
|
-
const
|
|
44
|
+
const validFiles = [];
|
|
45
|
+
const rejectedFiles = [];
|
|
46
|
+
const normalizedMaxFileSize = Math.min(maxFileSize, Infinity);
|
|
47
|
+
fileList.forEach((file) => {
|
|
48
|
+
if (file.size > normalizedMaxFileSize) {
|
|
49
|
+
rejectedFiles.push({ file, reason: "size" });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
43
52
|
const id = Math.random().toString(36).substring(7);
|
|
44
53
|
const previewUrl = URL.createObjectURL(file);
|
|
45
|
-
|
|
54
|
+
validFiles.push({
|
|
46
55
|
id,
|
|
47
56
|
url: previewUrl,
|
|
48
57
|
file
|
|
49
|
-
};
|
|
58
|
+
});
|
|
50
59
|
});
|
|
51
|
-
onUploaded(
|
|
60
|
+
onUploaded(validFiles, rejectedFiles);
|
|
52
61
|
};
|
|
53
62
|
const handleDrop = (event) => {
|
|
54
63
|
event.preventDefault();
|