@medusajs/dashboard 3.0.0-snapshot-20251215083939 → 3.0.0-snapshot-20251215162333
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/{api-key-management-detail-7T6OT2S2.mjs → api-key-management-detail-NRGL7HHX.mjs} +1 -1
- package/dist/app.js +144 -155
- package/dist/app.mjs +2 -2
- package/dist/{campaign-detail-RT3BIGQA.mjs → campaign-detail-22Q6XWGL.mjs} +1 -1
- package/dist/{categories-metadata-QHA62GA3.mjs → categories-metadata-J7M3XWI7.mjs} +1 -1
- package/dist/{category-detail-TDB4GR5S.mjs → category-detail-RRKJPMEG.mjs} +2 -2
- package/dist/{category-products-KRSKJDWS.mjs → category-products-EFZRTCSF.mjs} +2 -2
- package/dist/{chunk-WJKYXU6P.mjs → chunk-DK7IWUMK.mjs} +1 -1
- package/dist/{chunk-7ESWXA2P.mjs → chunk-GRZSG4EP.mjs} +31 -9
- package/dist/{chunk-7ZJK3NWL.mjs → chunk-OHY2N2Q4.mjs} +2 -2
- package/dist/{chunk-QCRM6BTM.mjs → chunk-PHLCT2HA.mjs} +1 -1
- package/dist/{chunk-6EFHOMPL.mjs → chunk-RL5EYTP6.mjs} +1 -1
- package/dist/{chunk-P5TFUYGS.mjs → chunk-YTYDWNYA.mjs} +98 -98
- package/dist/{chunk-SKA4MWCK.mjs → chunk-YYOPBKME.mjs} +1 -1
- package/dist/{chunk-QBDKK5O4.mjs → chunk-ZMG5B4FG.mjs} +1 -1
- package/dist/{collection-add-products-4RJKJ7XJ.mjs → collection-add-products-XUMV6XR7.mjs} +2 -2
- package/dist/{collection-detail-IR23ZT2F.mjs → collection-detail-ONRBKJLN.mjs} +2 -2
- package/dist/{collection-list-J4OTLQQL.mjs → collection-list-XCC4SIPJ.mjs} +2 -2
- package/dist/{collection-metadata-6XWOWMBN.mjs → collection-metadata-QK7MI3D2.mjs} +1 -1
- package/dist/{customer-detail-ZHU4NN7E.mjs → customer-detail-FR6J37ZC.mjs} +1 -1
- package/dist/{customer-group-detail-NGJXBGGG.mjs → customer-group-detail-YSKSNETG.mjs} +1 -1
- package/dist/{customer-group-list-YLAMT3ZQ.mjs → customer-group-list-XBCD4FZH.mjs} +1 -1
- package/dist/{customers-add-customer-group-A2EPZW26.mjs → customers-add-customer-group-Q7FMR2Y5.mjs} +1 -1
- package/dist/{edit-rules-4UN6YMCZ.mjs → edit-rules-SMVRTCUP.mjs} +1 -1
- package/dist/{inventory-create-UB3TTWPQ.mjs → inventory-create-3XONKYMZ.mjs} +1 -1
- package/dist/{inventory-detail-FIC7BFZ7.mjs → inventory-detail-6A6GOLB6.mjs} +1 -1
- package/dist/{inventory-metadata-WP73FZBX.mjs → inventory-metadata-FNEJ3RAT.mjs} +1 -1
- package/dist/{inventory-stock-RR4F6HGF.mjs → inventory-stock-S3ZYYCMZ.mjs} +1 -1
- package/dist/{location-detail-MLYCXNYR.mjs → location-detail-N3GUZSY7.mjs} +1 -1
- package/dist/{location-fulfillment-providers-CAAUD5VG.mjs → location-fulfillment-providers-WM6DT252.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-create-HHEGEBVB.mjs → location-service-zone-shipping-option-create-MJPH3WKX.mjs} +1 -1
- package/dist/{login-C7GZL37K.mjs → login-VNOLI5YG.mjs} +1 -1
- package/dist/{order-create-claim-2RQ4SFKM.mjs → order-create-claim-GUYTLVPB.mjs} +1 -1
- package/dist/{order-create-edit-JL7FWVNC.mjs → order-create-edit-ODIN6GRW.mjs} +1 -1
- package/dist/{order-create-exchange-7EPUMDFZ.mjs → order-create-exchange-ZT5RBRKL.mjs} +1 -1
- package/dist/{order-create-fulfillment-5PUUSLCV.mjs → order-create-fulfillment-OWUVTZXW.mjs} +1 -1
- package/dist/{order-create-refund-3NYCD4UR.mjs → order-create-refund-Q6HQY42R.mjs} +1 -1
- package/dist/{order-create-shipment-PWT3BPP6.mjs → order-create-shipment-WAGGEPRW.mjs} +1 -1
- package/dist/{order-detail-CN7VCKHF.mjs → order-detail-HFJONELJ.mjs} +1 -1
- package/dist/{order-edit-billing-address-PLAKMBVH.mjs → order-edit-billing-address-UM76J4KX.mjs} +1 -1
- package/dist/{order-edit-email-UAP26F5X.mjs → order-edit-email-CL3KNOCM.mjs} +1 -1
- package/dist/{order-edit-shipping-address-HAC7UQZS.mjs → order-edit-shipping-address-PIESTGVL.mjs} +1 -1
- package/dist/{order-export-ZI4QK6OQ.mjs → order-export-4MZUPMGD.mjs} +1 -1
- package/dist/{order-metadata-VQJWKPQC.mjs → order-metadata-FHBB7MTG.mjs} +1 -1
- package/dist/{order-receive-return-VTHRRRAB.mjs → order-receive-return-PRVKP6J2.mjs} +1 -1
- package/dist/{order-request-transfer-MCWICULW.mjs → order-request-transfer-XSAGRUMT.mjs} +1 -1
- package/dist/{price-list-create-KF4BTDBF.mjs → price-list-create-YHXRQSC3.mjs} +2 -2
- package/dist/{price-list-detail-UHJWBRBT.mjs → price-list-detail-FR3FQR3H.mjs} +2 -2
- package/dist/{price-list-prices-add-YHPWWETC.mjs → price-list-prices-add-GJVI47OY.mjs} +2 -2
- package/dist/{product-attributes-CCRPVPA3.mjs → product-attributes-TKCE2M63.mjs} +2 -2
- package/dist/{product-create-TIJWWJEC.mjs → product-create-OLDZPMLW.mjs} +2 -2
- package/dist/{product-create-variant-EBVDKJA2.mjs → product-create-variant-KEBN5OR7.mjs} +1 -1
- package/dist/{product-detail-MFRDWD74.mjs → product-detail-O6QWJIKR.mjs} +2 -2
- package/dist/{product-edit-VRUDQ3JT.mjs → product-edit-56XDGDUN.mjs} +2 -2
- package/dist/{product-export-DZKMXMUX.mjs → product-export-WUZYHPS5.mjs} +2 -2
- package/dist/{product-image-variants-edit-NN76FX7Y.mjs → product-image-variants-edit-Y363J5NG.mjs} +1 -1
- package/dist/{product-import-24JJ73RO.mjs → product-import-V3KQN4TV.mjs} +1 -1
- package/dist/{product-list-YMCK3X7X.mjs → product-list-DNTS7WUN.mjs} +2 -2
- package/dist/{product-metadata-KFBUYD7A.mjs → product-metadata-GL2MVPDI.mjs} +1 -1
- package/dist/{product-organization-BYRWH4KK.mjs → product-organization-PNKWRNHC.mjs} +2 -2
- package/dist/{product-stock-YEHDIJQI.mjs → product-stock-NYUFMEVG.mjs} +1 -1
- package/dist/{product-tag-create-BPU54Y3F.mjs → product-tag-create-PQMDDKWH.mjs} +1 -1
- package/dist/{product-tag-detail-SYQWG3AL.mjs → product-tag-detail-EHBB3WUB.mjs} +3 -3
- package/dist/{product-tag-edit-5XEMIUW6.mjs → product-tag-edit-K3BBQLJR.mjs} +1 -1
- package/dist/{product-tag-list-7SQNKPJQ.mjs → product-tag-list-LSW5FFVN.mjs} +3 -3
- package/dist/{product-tag-metadata-ZB56PD4G.mjs → product-tag-metadata-MJH5LH7E.mjs} +1 -1
- package/dist/{product-type-detail-RMYDLMPI.mjs → product-type-detail-3VB6AWUW.mjs} +2 -2
- package/dist/{product-type-metadata-UKF26V3N.mjs → product-type-metadata-CDJDFFGQ.mjs} +1 -1
- package/dist/{product-variant-detail-56MJKJZQ.mjs → product-variant-detail-43T33AQP.mjs} +1 -1
- package/dist/{product-variant-edit-PVZNSIIQ.mjs → product-variant-edit-DEZEY2H2.mjs} +1 -1
- package/dist/{product-variant-metadata-PNFRS7SQ.mjs → product-variant-metadata-VTZDNWUT.mjs} +1 -1
- package/dist/{promotion-create-RGLB6D7K.mjs → promotion-create-HWFNUQXG.mjs} +1 -1
- package/dist/{promotion-detail-MCCRIT2M.mjs → promotion-detail-VJB55PJK.mjs} +1 -1
- package/dist/{refund-reason-create-JYY2USGC.mjs → refund-reason-create-YHCDEHGQ.mjs} +1 -1
- package/dist/{refund-reason-edit-5NFS4TQ7.mjs → refund-reason-edit-CZ5QZ2SZ.mjs} +1 -1
- package/dist/{refund-reason-list-SDLJWAV3.mjs → refund-reason-list-URYYYEK6.mjs} +1 -1
- package/dist/{region-metadata-YBOCBHWP.mjs → region-metadata-H6XXUQ4S.mjs} +1 -1
- package/dist/{reservation-detail-7MXAMP3C.mjs → reservation-detail-LZAQL4XA.mjs} +1 -1
- package/dist/{reservation-metadata-6NZUP64D.mjs → reservation-metadata-5HZSDDOK.mjs} +1 -1
- package/dist/{sales-channel-add-products-BELGXDPF.mjs → sales-channel-add-products-VH5T3GDA.mjs} +2 -2
- package/dist/{sales-channel-detail-FAGKAQK2.mjs → sales-channel-detail-I2ZHVXMG.mjs} +2 -2
- package/dist/{sales-channel-list-E5QO23E5.mjs → sales-channel-list-3FV4S2NN.mjs} +1 -1
- package/dist/{sales-channel-metadata-AXAQY4MY.mjs → sales-channel-metadata-M364R4RJ.mjs} +1 -1
- package/dist/{shipping-option-type-create-YTBF47L7.mjs → shipping-option-type-create-C5WUWON7.mjs} +1 -1
- package/dist/{shipping-option-type-detail-XJFVNP2V.mjs → shipping-option-type-detail-PENS2K73.mjs} +2 -2
- package/dist/{shipping-option-type-edit-DFXO32AG.mjs → shipping-option-type-edit-CIU5EHRP.mjs} +1 -1
- package/dist/{shipping-option-type-list-UI7ZTCO7.mjs → shipping-option-type-list-ZMZMXFME.mjs} +2 -2
- package/dist/{shipping-profile-metadata-FGZRQKNN.mjs → shipping-profile-metadata-75G2NNMA.mjs} +1 -1
- package/dist/{store-add-locales-3MSEBHQG.mjs → store-add-locales-IZOZP5C6.mjs} +1 -1
- package/dist/{store-detail-MLYFQGBC.mjs → store-detail-4IBAEVSD.mjs} +1 -1
- package/dist/{store-metadata-ITA6AL6H.mjs → store-metadata-CYXTVJUE.mjs} +1 -1
- package/dist/{tax-region-create-AXM2SE4T.mjs → tax-region-create-DWGL4EUT.mjs} +1 -1
- package/dist/{tax-region-detail-WFXSRH3U.mjs → tax-region-detail-O2T7BI3V.mjs} +5 -5
- package/dist/{tax-region-edit-CZ4EDU4K.mjs → tax-region-edit-EEVEEU2Q.mjs} +1 -1
- package/dist/{tax-region-province-detail-4B5GWCY7.mjs → tax-region-province-detail-2W7RXAM5.mjs} +5 -5
- package/dist/{tax-region-tax-override-create-GDDSUSHK.mjs → tax-region-tax-override-create-7IM4ZVPH.mjs} +3 -3
- package/dist/{tax-region-tax-override-edit-QXCSGDVG.mjs → tax-region-tax-override-edit-3ZT5IZYR.mjs} +4 -4
- package/dist/{translation-list-S4477JFR.mjs → translation-list-AFK5MGSH.mjs} +56 -68
- package/dist/{translations-edit-S3V7SSDA.mjs → translations-edit-EN47PWTO.mjs} +24 -26
- package/dist/{user-metadata-SILGZHTG.mjs → user-metadata-2WPJOEJA.mjs} +1 -1
- package/dist/{workflow-execution-detail-GJTST4GO.mjs → workflow-execution-detail-H2AKEZJX.mjs} +1 -1
- package/package.json +9 -9
- package/src/hooks/api/translations.tsx +61 -31
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +1 -8
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +10 -4
- package/src/routes/translations/translation-list/translation-list.tsx +66 -68
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +4 -2
- package/src/routes/translations/translations-edit/translations-edit.tsx +27 -12
- package/src/routes/translations/translations-edit/utils/index.ts +0 -1
- package/src/routes/translations/translations-edit/utils/reference-label-map.ts +0 -10
package/dist/app.js
CHANGED
|
@@ -93634,7 +93634,7 @@ var init_tax_rates = __esm({
|
|
|
93634
93634
|
});
|
|
93635
93635
|
|
|
93636
93636
|
// src/hooks/api/translations.tsx
|
|
93637
|
-
var import_react_query43, TRANSLATIONS_QUERY_KEY, translationsQueryKeys, useReferenceTranslations, useBatchTranslations;
|
|
93637
|
+
var import_react_query43, TRANSLATIONS_QUERY_KEY, translationsQueryKeys, TRANSLATION_SETTINGS_QUERY_KEY, translationSettingsQueryKeys, TRANSLATION_STATISTICS_QUERY_KEY, translationStatisticsQueryKeys, useReferenceTranslations, useBatchTranslations, useTranslationSettings, useTranslationStatistics;
|
|
93638
93638
|
var init_translations2 = __esm({
|
|
93639
93639
|
"src/hooks/api/translations.tsx"() {
|
|
93640
93640
|
"use strict";
|
|
@@ -93650,12 +93650,19 @@ var init_translations2 = __esm({
|
|
|
93650
93650
|
init_product_types();
|
|
93651
93651
|
TRANSLATIONS_QUERY_KEY = "translations";
|
|
93652
93652
|
translationsQueryKeys = queryKeysFactory(TRANSLATIONS_QUERY_KEY);
|
|
93653
|
-
|
|
93653
|
+
TRANSLATION_SETTINGS_QUERY_KEY = "translation_settings";
|
|
93654
|
+
translationSettingsQueryKeys = queryKeysFactory(
|
|
93655
|
+
TRANSLATION_SETTINGS_QUERY_KEY
|
|
93656
|
+
);
|
|
93657
|
+
TRANSLATION_STATISTICS_QUERY_KEY = "translation_statistics";
|
|
93658
|
+
translationStatisticsQueryKeys = queryKeysFactory(
|
|
93659
|
+
TRANSLATION_STATISTICS_QUERY_KEY
|
|
93660
|
+
);
|
|
93661
|
+
useReferenceTranslations = (reference, translatableFields, referenceId, options) => {
|
|
93654
93662
|
const referenceHookMap = /* @__PURE__ */ new Map([
|
|
93655
93663
|
[
|
|
93656
93664
|
"product",
|
|
93657
93665
|
() => {
|
|
93658
|
-
const translatableFields = ["title", "description"];
|
|
93659
93666
|
const fields = translatableFields.concat(["translations.*"]).join(",");
|
|
93660
93667
|
const { data: data2, ...rest2 } = useInfiniteProducts(
|
|
93661
93668
|
{ fields, id: referenceId ?? [] },
|
|
@@ -93667,7 +93674,6 @@ var init_translations2 = __esm({
|
|
|
93667
93674
|
data: {
|
|
93668
93675
|
translations: products?.flatMap((product) => product.translations ?? []) ?? [],
|
|
93669
93676
|
references: products ?? [],
|
|
93670
|
-
translatableFields,
|
|
93671
93677
|
count: data2?.pages[0]?.count ?? 0
|
|
93672
93678
|
}
|
|
93673
93679
|
};
|
|
@@ -93676,7 +93682,6 @@ var init_translations2 = __esm({
|
|
|
93676
93682
|
[
|
|
93677
93683
|
"product_variant",
|
|
93678
93684
|
() => {
|
|
93679
|
-
const translatableFields = ["title"];
|
|
93680
93685
|
const fields = translatableFields.concat(["translations.*"]).join(",");
|
|
93681
93686
|
const { data: data2, ...rest2 } = useInfiniteVariants(
|
|
93682
93687
|
{ id: referenceId ?? [], fields },
|
|
@@ -93697,7 +93702,6 @@ var init_translations2 = __esm({
|
|
|
93697
93702
|
[
|
|
93698
93703
|
"product_category",
|
|
93699
93704
|
() => {
|
|
93700
|
-
const translatableFields = ["name", "description"];
|
|
93701
93705
|
const fields = translatableFields.concat(["translations.*"]).join(",");
|
|
93702
93706
|
const { data: data2, ...rest2 } = useInfiniteCategories(
|
|
93703
93707
|
{ id: referenceId ?? [], fields },
|
|
@@ -93718,7 +93722,6 @@ var init_translations2 = __esm({
|
|
|
93718
93722
|
[
|
|
93719
93723
|
"product_collection",
|
|
93720
93724
|
() => {
|
|
93721
|
-
const translatableFields = ["title"];
|
|
93722
93725
|
const fields = translatableFields.concat(["translations.*"]).join(",");
|
|
93723
93726
|
const { data: data2, ...rest2 } = useInfiniteCollections(
|
|
93724
93727
|
{ id: referenceId ?? [], fields },
|
|
@@ -93741,7 +93744,6 @@ var init_translations2 = __esm({
|
|
|
93741
93744
|
[
|
|
93742
93745
|
"product_type",
|
|
93743
93746
|
() => {
|
|
93744
|
-
const translatableFields = ["value"];
|
|
93745
93747
|
const fields = translatableFields.concat(["translations.*"]).join(",");
|
|
93746
93748
|
const { data: data2, ...rest2 } = useInfiniteProductTypes(
|
|
93747
93749
|
{ id: referenceId ?? [], fields },
|
|
@@ -93762,7 +93764,6 @@ var init_translations2 = __esm({
|
|
|
93762
93764
|
[
|
|
93763
93765
|
"product_tag",
|
|
93764
93766
|
() => {
|
|
93765
|
-
const translatableFields = ["value"];
|
|
93766
93767
|
const fields = translatableFields.concat(["translations.*"]).join(",");
|
|
93767
93768
|
const { data: data2, ...rest2 } = useInfiniteProductTags(
|
|
93768
93769
|
{ id: referenceId ?? [], fields },
|
|
@@ -93804,11 +93805,30 @@ var init_translations2 = __esm({
|
|
|
93804
93805
|
queryClient.invalidateQueries({
|
|
93805
93806
|
queryKey: referenceInvalidationKeysMap.get(reference)
|
|
93806
93807
|
});
|
|
93808
|
+
queryClient.invalidateQueries({
|
|
93809
|
+
queryKey: translationStatisticsQueryKeys.lists()
|
|
93810
|
+
});
|
|
93807
93811
|
options?.onSuccess?.(data, variables, context);
|
|
93808
93812
|
},
|
|
93809
93813
|
...options
|
|
93810
93814
|
});
|
|
93811
93815
|
};
|
|
93816
|
+
useTranslationSettings = (query, options) => {
|
|
93817
|
+
const { data, ...rest } = (0, import_react_query43.useQuery)({
|
|
93818
|
+
queryKey: translationSettingsQueryKeys.list(query),
|
|
93819
|
+
queryFn: () => sdk.admin.translation.settings(query),
|
|
93820
|
+
...options
|
|
93821
|
+
});
|
|
93822
|
+
return { ...data, ...rest };
|
|
93823
|
+
};
|
|
93824
|
+
useTranslationStatistics = (query, options) => {
|
|
93825
|
+
const { data, ...rest } = (0, import_react_query43.useQuery)({
|
|
93826
|
+
queryKey: translationStatisticsQueryKeys.list(query),
|
|
93827
|
+
queryFn: () => sdk.admin.translation.statistics(query),
|
|
93828
|
+
...options
|
|
93829
|
+
});
|
|
93830
|
+
return { ...data, ...rest };
|
|
93831
|
+
};
|
|
93812
93832
|
}
|
|
93813
93833
|
});
|
|
93814
93834
|
|
|
@@ -187322,10 +187342,16 @@ var init_translations_completion_section = __esm({
|
|
|
187322
187342
|
import_react_i18next484 = require("react-i18next");
|
|
187323
187343
|
import_jsx_runtime687 = require("react/jsx-runtime");
|
|
187324
187344
|
TranslationsCompletionSection = ({
|
|
187325
|
-
|
|
187326
|
-
totalCount = 0
|
|
187345
|
+
statistics
|
|
187327
187346
|
}) => {
|
|
187328
187347
|
const { t: t5 } = (0, import_react_i18next484.useTranslation)();
|
|
187348
|
+
const { translatedCount, totalCount } = Object.values(statistics).reduce(
|
|
187349
|
+
(acc, curr) => ({
|
|
187350
|
+
translatedCount: acc.translatedCount + curr.translated,
|
|
187351
|
+
totalCount: acc.totalCount + curr.expected
|
|
187352
|
+
}),
|
|
187353
|
+
{ totalCount: 0, translatedCount: 0 }
|
|
187354
|
+
);
|
|
187329
187355
|
const percentage = totalCount > 0 ? translatedCount / totalCount * 100 : 0;
|
|
187330
187356
|
const remaining = Math.max(0, totalCount - translatedCount);
|
|
187331
187357
|
return /* @__PURE__ */ (0, import_jsx_runtime687.jsxs)(import_ui451.Container, { className: "flex flex-col gap-y-3 px-6 py-4", children: [
|
|
@@ -187387,89 +187413,68 @@ var init_translations_completion_section = __esm({
|
|
|
187387
187413
|
});
|
|
187388
187414
|
|
|
187389
187415
|
// src/routes/translations/translation-list/translation-list.tsx
|
|
187390
|
-
var import_ui452, import_react_i18next485,
|
|
187416
|
+
var import_ui452, import_react_i18next485, import_react304, import_jsx_runtime688, TranslationList;
|
|
187391
187417
|
var init_translation_list = __esm({
|
|
187392
187418
|
"src/routes/translations/translation-list/translation-list.tsx"() {
|
|
187393
187419
|
"use strict";
|
|
187394
187420
|
import_ui452 = require("@medusajs/ui");
|
|
187395
187421
|
init_pages();
|
|
187396
187422
|
import_react_i18next485 = require("react-i18next");
|
|
187397
|
-
import_icons175 = require("@medusajs/icons");
|
|
187398
187423
|
init_api();
|
|
187399
187424
|
init_active_locales_section();
|
|
187400
187425
|
init_translation_list_section();
|
|
187401
187426
|
init_translations_completion_section();
|
|
187402
187427
|
init_skeleton2();
|
|
187428
|
+
import_react304 = require("react");
|
|
187403
187429
|
import_jsx_runtime688 = require("react/jsx-runtime");
|
|
187404
|
-
TRANSLATABLE_ENTITIES = [
|
|
187405
|
-
{
|
|
187406
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187407
|
-
label: "Product",
|
|
187408
|
-
reference: "product",
|
|
187409
|
-
translatedCount: 4,
|
|
187410
|
-
totalCount: 96
|
|
187411
|
-
},
|
|
187412
|
-
{
|
|
187413
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187414
|
-
label: "Product Variants",
|
|
187415
|
-
reference: "product_variant",
|
|
187416
|
-
translatedCount: 4,
|
|
187417
|
-
totalCount: 2e5
|
|
187418
|
-
},
|
|
187419
|
-
{
|
|
187420
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187421
|
-
label: "Product Categories",
|
|
187422
|
-
reference: "product_category",
|
|
187423
|
-
translatedCount: 96,
|
|
187424
|
-
totalCount: 96
|
|
187425
|
-
},
|
|
187426
|
-
{
|
|
187427
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187428
|
-
label: "Product Collections",
|
|
187429
|
-
reference: "product_collection",
|
|
187430
|
-
translatedCount: 4,
|
|
187431
|
-
totalCount: 96
|
|
187432
|
-
},
|
|
187433
|
-
{
|
|
187434
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187435
|
-
label: "Product Types",
|
|
187436
|
-
reference: "product_type",
|
|
187437
|
-
translatedCount: 4,
|
|
187438
|
-
totalCount: 96
|
|
187439
|
-
},
|
|
187440
|
-
{
|
|
187441
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187442
|
-
label: "Product Tags",
|
|
187443
|
-
reference: "product_tag",
|
|
187444
|
-
translatedCount: 96,
|
|
187445
|
-
totalCount: 96
|
|
187446
|
-
},
|
|
187447
|
-
{
|
|
187448
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187449
|
-
label: "Product Options",
|
|
187450
|
-
reference: "product_option",
|
|
187451
|
-
translatedCount: 96,
|
|
187452
|
-
totalCount: 96
|
|
187453
|
-
},
|
|
187454
|
-
{
|
|
187455
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_icons175.Buildings, {}),
|
|
187456
|
-
label: "Product Option Values",
|
|
187457
|
-
reference: "product_option_value",
|
|
187458
|
-
translatedCount: 96,
|
|
187459
|
-
totalCount: 96
|
|
187460
|
-
}
|
|
187461
|
-
];
|
|
187462
187430
|
TranslationList = () => {
|
|
187463
187431
|
const { t: t5 } = (0, import_react_i18next485.useTranslation)();
|
|
187464
187432
|
const { store, isPending, isError, error } = useStore();
|
|
187465
|
-
|
|
187466
|
-
|
|
187433
|
+
const {
|
|
187434
|
+
translatable_fields,
|
|
187435
|
+
isPending: isTranslationSettingsPending,
|
|
187436
|
+
isError: isTranslationSettingsError,
|
|
187437
|
+
error: translationSettingsError
|
|
187438
|
+
} = useTranslationSettings();
|
|
187439
|
+
const {
|
|
187440
|
+
statistics,
|
|
187441
|
+
isPending: isTranslationStatisticsPending,
|
|
187442
|
+
isError: isTranslationStatisticsError,
|
|
187443
|
+
error: translationStatisticsError
|
|
187444
|
+
} = useTranslationStatistics(
|
|
187445
|
+
{
|
|
187446
|
+
locales: store?.supported_locales?.map(
|
|
187447
|
+
(suportedLocale) => suportedLocale.locale_code
|
|
187448
|
+
) ?? [],
|
|
187449
|
+
entity_types: Object.keys(translatable_fields ?? {})
|
|
187450
|
+
},
|
|
187451
|
+
{
|
|
187452
|
+
enabled: !!translatable_fields && !!store
|
|
187453
|
+
}
|
|
187454
|
+
);
|
|
187455
|
+
if (isError || isTranslationSettingsError || isTranslationStatisticsError) {
|
|
187456
|
+
throw error || translationSettingsError || translationStatisticsError;
|
|
187467
187457
|
}
|
|
187468
|
-
const
|
|
187458
|
+
const hasLocales = (store?.supported_locales ?? []).length > 0;
|
|
187459
|
+
const translatableEntities = (0, import_react304.useMemo)(() => {
|
|
187460
|
+
if (!translatable_fields || !statistics) {
|
|
187461
|
+
return [];
|
|
187462
|
+
}
|
|
187463
|
+
return Object.entries(translatable_fields).map(([entity, fields]) => {
|
|
187464
|
+
const entityStatistics = statistics[entity];
|
|
187465
|
+
return {
|
|
187466
|
+
label: entity.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" "),
|
|
187467
|
+
reference: entity,
|
|
187468
|
+
translatableFields: fields,
|
|
187469
|
+
translatedCount: entityStatistics.translated,
|
|
187470
|
+
totalCount: entityStatistics.expected
|
|
187471
|
+
};
|
|
187472
|
+
});
|
|
187473
|
+
}, [translatable_fields, statistics]);
|
|
187474
|
+
const isReady = !!store && !isPending && !isTranslationSettingsPending && !isTranslationStatisticsPending && !!translatable_fields && !!statistics;
|
|
187469
187475
|
if (!isReady) {
|
|
187470
187476
|
return /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(TwoColumnPageSkeleton, { sidebarSections: 2 });
|
|
187471
187477
|
}
|
|
187472
|
-
const hasLocales = (store?.supported_locales ?? []).length > 0;
|
|
187473
187478
|
return /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(
|
|
187474
187479
|
TwoColumnPage,
|
|
187475
187480
|
{
|
|
@@ -187491,7 +187496,7 @@ var init_translation_list = __esm({
|
|
|
187491
187496
|
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
187492
187497
|
TranslationListSection,
|
|
187493
187498
|
{
|
|
187494
|
-
entities:
|
|
187499
|
+
entities: translatableEntities,
|
|
187495
187500
|
hasLocales
|
|
187496
187501
|
}
|
|
187497
187502
|
)
|
|
@@ -187505,7 +187510,7 @@ var init_translation_list = __esm({
|
|
|
187505
187510
|
) ?? []
|
|
187506
187511
|
}
|
|
187507
187512
|
),
|
|
187508
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(TranslationsCompletionSection, {})
|
|
187513
|
+
statistics && /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(TranslationsCompletionSection, { statistics })
|
|
187509
187514
|
] })
|
|
187510
187515
|
]
|
|
187511
187516
|
}
|
|
@@ -187526,32 +187531,6 @@ var init_translation_list2 = __esm({
|
|
|
187526
187531
|
}
|
|
187527
187532
|
});
|
|
187528
187533
|
|
|
187529
|
-
// src/routes/translations/translations-edit/utils/reference-label-map.ts
|
|
187530
|
-
var REFERENCE_LABEL_MAP;
|
|
187531
|
-
var init_reference_label_map = __esm({
|
|
187532
|
-
"src/routes/translations/translations-edit/utils/reference-label-map.ts"() {
|
|
187533
|
-
"use strict";
|
|
187534
|
-
REFERENCE_LABEL_MAP = {
|
|
187535
|
-
product: "Products",
|
|
187536
|
-
product_variant: "Product Variants",
|
|
187537
|
-
product_category: "Product Categories",
|
|
187538
|
-
product_collection: "Product Collections",
|
|
187539
|
-
product_type: "Product Types",
|
|
187540
|
-
product_tag: "Product Tags",
|
|
187541
|
-
product_option: "Product Options",
|
|
187542
|
-
product_option_value: "Product Option Values"
|
|
187543
|
-
};
|
|
187544
|
-
}
|
|
187545
|
-
});
|
|
187546
|
-
|
|
187547
|
-
// src/routes/translations/translations-edit/utils/index.ts
|
|
187548
|
-
var init_utils14 = __esm({
|
|
187549
|
-
"src/routes/translations/translations-edit/utils/index.ts"() {
|
|
187550
|
-
"use strict";
|
|
187551
|
-
init_reference_label_map();
|
|
187552
|
-
}
|
|
187553
|
-
});
|
|
187554
|
-
|
|
187555
187534
|
// src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx
|
|
187556
187535
|
function isEntityRow(row) {
|
|
187557
187536
|
return row._type === "entity";
|
|
@@ -187641,7 +187620,7 @@ function useTranslationsGridColumns({
|
|
|
187641
187620
|
modalFields = []
|
|
187642
187621
|
}) {
|
|
187643
187622
|
const { t: t5 } = (0, import_react_i18next486.useTranslation)();
|
|
187644
|
-
const columns = (0,
|
|
187623
|
+
const columns = (0, import_react305.useMemo)(() => {
|
|
187645
187624
|
return [
|
|
187646
187625
|
columnHelper93.column({
|
|
187647
187626
|
id: "field",
|
|
@@ -187717,13 +187696,13 @@ function useTranslationsGridColumns({
|
|
|
187717
187696
|
}, [t5, translatableFields, availableLocales, modalFields]);
|
|
187718
187697
|
return columns;
|
|
187719
187698
|
}
|
|
187720
|
-
var import_zod166, import_ui453,
|
|
187699
|
+
var import_zod166, import_ui453, import_react305, import_react_hook_form144, import_react_i18next486, import_zod167, import_jsx_runtime689, LocaleTranslationSchema, EntityTranslationsSchema, TranslationsFormSchema, columnHelper93, TranslationsEditForm;
|
|
187721
187700
|
var init_translations_edit_form = __esm({
|
|
187722
187701
|
"src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx"() {
|
|
187723
187702
|
"use strict";
|
|
187724
187703
|
import_zod166 = require("@hookform/resolvers/zod");
|
|
187725
187704
|
import_ui453 = require("@medusajs/ui");
|
|
187726
|
-
|
|
187705
|
+
import_react305 = require("react");
|
|
187727
187706
|
import_react_hook_form144 = require("react-hook-form");
|
|
187728
187707
|
import_react_i18next486 = require("react-i18next");
|
|
187729
187708
|
import_zod167 = require("zod");
|
|
@@ -187732,7 +187711,6 @@ var init_translations_edit_form = __esm({
|
|
|
187732
187711
|
init_keybound_form2();
|
|
187733
187712
|
init_translations2();
|
|
187734
187713
|
init_use_document_direction();
|
|
187735
|
-
init_utils14();
|
|
187736
187714
|
import_jsx_runtime689 = require("react/jsx-runtime");
|
|
187737
187715
|
LocaleTranslationSchema = import_zod167.z.object({
|
|
187738
187716
|
id: import_zod167.z.string().nullish(),
|
|
@@ -187761,12 +187739,12 @@ var init_translations_edit_form = __esm({
|
|
|
187761
187739
|
const { t: t5 } = (0, import_react_i18next486.useTranslation)();
|
|
187762
187740
|
const { handleSuccess, setCloseOnEscape } = useRouteModal();
|
|
187763
187741
|
const direction = useDocumentDirection();
|
|
187764
|
-
const entities = (0,
|
|
187765
|
-
const totalCount = (0,
|
|
187742
|
+
const entities = (0, import_react305.useMemo)(() => references, [references]);
|
|
187743
|
+
const totalCount = (0, import_react305.useMemo)(
|
|
187766
187744
|
() => referenceCount * (translatableFields.length + 1),
|
|
187767
187745
|
[referenceCount, translatableFields]
|
|
187768
187746
|
);
|
|
187769
|
-
const initialState = (0,
|
|
187747
|
+
const initialState = (0, import_react305.useRef)(
|
|
187770
187748
|
initTranslationsFormState(
|
|
187771
187749
|
translations,
|
|
187772
187750
|
entities,
|
|
@@ -187778,7 +187756,7 @@ var init_translations_edit_form = __esm({
|
|
|
187778
187756
|
resolver: (0, import_zod166.zodResolver)(TranslationsFormSchema),
|
|
187779
187757
|
defaultValues: initialState.current
|
|
187780
187758
|
});
|
|
187781
|
-
const rows = (0,
|
|
187759
|
+
const rows = (0, import_react305.useMemo)(
|
|
187782
187760
|
() => buildTranslationRows(entities, translatableFields),
|
|
187783
187761
|
[entities, translatableFields]
|
|
187784
187762
|
);
|
|
@@ -187847,7 +187825,7 @@ var init_translations_edit_form = __esm({
|
|
|
187847
187825
|
defaultValue: entityType,
|
|
187848
187826
|
className: "flex h-full flex-col overflow-hidden",
|
|
187849
187827
|
children: [
|
|
187850
|
-
/* @__PURE__ */ (0, import_jsx_runtime689.jsx)(RouteFocusModal.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)(import_ui453.ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)(import_ui453.ProgressTabs.Trigger, { value: entityType, children:
|
|
187828
|
+
/* @__PURE__ */ (0, import_jsx_runtime689.jsx)(RouteFocusModal.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)(import_ui453.ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)(import_ui453.ProgressTabs.Trigger, { value: entityType, children: entityType.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ") }) }) }) }),
|
|
187851
187829
|
/* @__PURE__ */ (0, import_jsx_runtime689.jsx)(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime689.jsx)(
|
|
187852
187830
|
import_ui453.ProgressTabs.Content,
|
|
187853
187831
|
{
|
|
@@ -187893,14 +187871,14 @@ var init_translations_edit_form2 = __esm({
|
|
|
187893
187871
|
});
|
|
187894
187872
|
|
|
187895
187873
|
// src/routes/translations/translations-edit/translations-edit.tsx
|
|
187896
|
-
var import_react_router_dom247,
|
|
187874
|
+
var import_react_router_dom247, import_react306, import_react_query105, import_jsx_runtime690, TranslationsEdit;
|
|
187897
187875
|
var init_translations_edit = __esm({
|
|
187898
187876
|
"src/routes/translations/translations-edit/translations-edit.tsx"() {
|
|
187899
187877
|
"use strict";
|
|
187900
187878
|
import_react_router_dom247 = require("react-router-dom");
|
|
187901
187879
|
init_api();
|
|
187902
187880
|
init_translations_edit_form2();
|
|
187903
|
-
|
|
187881
|
+
import_react306 = require("react");
|
|
187904
187882
|
init_modals();
|
|
187905
187883
|
init_feature_flag_provider();
|
|
187906
187884
|
import_react_query105 = require("@tanstack/react-query");
|
|
@@ -187911,16 +187889,21 @@ var init_translations_edit = __esm({
|
|
|
187911
187889
|
const [searchParams] = (0, import_react_router_dom247.useSearchParams)();
|
|
187912
187890
|
const reference = searchParams.get("reference");
|
|
187913
187891
|
const referenceIdParam = searchParams.getAll("reference_id");
|
|
187914
|
-
(0,
|
|
187892
|
+
(0, import_react306.useEffect)(() => {
|
|
187915
187893
|
if (!reference || !isTranslationsEnabled) {
|
|
187916
187894
|
navigate(-1);
|
|
187917
187895
|
return;
|
|
187918
187896
|
}
|
|
187919
187897
|
}, [reference, navigate, isTranslationsEnabled]);
|
|
187898
|
+
const {
|
|
187899
|
+
translatable_fields,
|
|
187900
|
+
isPending: isTranslationSettingsPending,
|
|
187901
|
+
isError: isTranslationSettingsError,
|
|
187902
|
+
error: translationSettingsError
|
|
187903
|
+
} = useTranslationSettings({ entity_type: reference });
|
|
187920
187904
|
const {
|
|
187921
187905
|
translations,
|
|
187922
187906
|
references,
|
|
187923
|
-
translatableFields,
|
|
187924
187907
|
fetchNextPage,
|
|
187925
187908
|
count,
|
|
187926
187909
|
isFetchingNextPage,
|
|
@@ -187928,18 +187911,24 @@ var init_translations_edit = __esm({
|
|
|
187928
187911
|
isPending,
|
|
187929
187912
|
isError,
|
|
187930
187913
|
error
|
|
187931
|
-
} = useReferenceTranslations(
|
|
187932
|
-
|
|
187933
|
-
|
|
187914
|
+
} = useReferenceTranslations(
|
|
187915
|
+
reference,
|
|
187916
|
+
translatable_fields?.[reference] ?? [],
|
|
187917
|
+
referenceIdParam,
|
|
187918
|
+
{
|
|
187919
|
+
enabled: !!translatable_fields && !!reference,
|
|
187920
|
+
placeholderData: import_react_query105.keepPreviousData
|
|
187921
|
+
}
|
|
187922
|
+
);
|
|
187934
187923
|
const {
|
|
187935
187924
|
store,
|
|
187936
187925
|
isPending: isStorePending,
|
|
187937
187926
|
isError: isStoreError,
|
|
187938
187927
|
error: storeError
|
|
187939
187928
|
} = useStore();
|
|
187940
|
-
const ready = !isPending && !!translations && !!
|
|
187941
|
-
if (isError || isStoreError) {
|
|
187942
|
-
throw error || storeError;
|
|
187929
|
+
const ready = !isPending && !!translations && !!translatable_fields && !isTranslationSettingsPending && !!references && !isStorePending && !!store;
|
|
187930
|
+
if (isError || isStoreError || isTranslationSettingsError) {
|
|
187931
|
+
throw error || storeError || translationSettingsError;
|
|
187943
187932
|
}
|
|
187944
187933
|
return /* @__PURE__ */ (0, import_jsx_runtime690.jsx)(RouteFocusModal, { prev: referenceIdParam.length ? -1 : "..", children: ready && /* @__PURE__ */ (0, import_jsx_runtime690.jsx)(
|
|
187945
187934
|
TranslationsEditForm,
|
|
@@ -187948,8 +187937,8 @@ var init_translations_edit = __esm({
|
|
|
187948
187937
|
references,
|
|
187949
187938
|
entityType: reference,
|
|
187950
187939
|
availableLocales: store?.supported_locales ?? [],
|
|
187951
|
-
translatableFields,
|
|
187952
|
-
modalFields:
|
|
187940
|
+
translatableFields: translatable_fields[reference],
|
|
187941
|
+
modalFields: translatable_fields[reference],
|
|
187953
187942
|
fetchNextPage,
|
|
187954
187943
|
hasNextPage,
|
|
187955
187944
|
isFetchingNextPage,
|
|
@@ -187981,7 +187970,7 @@ function AvatarBox({ checked }) {
|
|
|
187981
187970
|
className: "bg-ui-button-neutral shadow-buttons-neutral after:button-neutral-gradient relative mb-4 flex h-[50px] w-[50px] items-center justify-center rounded-xl after:inset-0 after:content-['']",
|
|
187982
187971
|
children: [
|
|
187983
187972
|
checked && /* @__PURE__ */ (0, import_jsx_runtime691.jsx)(
|
|
187984
|
-
|
|
187973
|
+
import_react307.motion.div,
|
|
187985
187974
|
{
|
|
187986
187975
|
className: "absolute -right-[5px] -top-1 flex size-5 items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]",
|
|
187987
187976
|
initial: { opacity: 0, scale: 0.5 },
|
|
@@ -188000,7 +187989,7 @@ function AvatarBox({ checked }) {
|
|
|
188000
187989
|
viewBox: "0 0 20 20",
|
|
188001
187990
|
fill: "none",
|
|
188002
187991
|
children: /* @__PURE__ */ (0, import_jsx_runtime691.jsx)(
|
|
188003
|
-
|
|
187992
|
+
import_react307.motion.path,
|
|
188004
187993
|
{
|
|
188005
187994
|
d: "M5.8335 10.4167L9.16683 13.75L14.1668 6.25",
|
|
188006
187995
|
stroke: "white",
|
|
@@ -188078,11 +188067,11 @@ function AvatarBox({ checked }) {
|
|
|
188078
188067
|
}
|
|
188079
188068
|
);
|
|
188080
188069
|
}
|
|
188081
|
-
var
|
|
188070
|
+
var import_react307, import_jsx_runtime691;
|
|
188082
188071
|
var init_avatar_box = __esm({
|
|
188083
188072
|
"src/components/common/logo-box/avatar-box.tsx"() {
|
|
188084
188073
|
"use strict";
|
|
188085
|
-
|
|
188074
|
+
import_react307 = require("motion/react");
|
|
188086
188075
|
init_icon_avatar2();
|
|
188087
188076
|
import_jsx_runtime691 = require("react/jsx-runtime");
|
|
188088
188077
|
}
|
|
@@ -188263,12 +188252,12 @@ var init_login2 = __esm({
|
|
|
188263
188252
|
});
|
|
188264
188253
|
|
|
188265
188254
|
// src/components/common/logo-box/logo-box.tsx
|
|
188266
|
-
var import_ui455,
|
|
188255
|
+
var import_ui455, import_react308, import_jsx_runtime693, LogoBox;
|
|
188267
188256
|
var init_logo_box = __esm({
|
|
188268
188257
|
"src/components/common/logo-box/logo-box.tsx"() {
|
|
188269
188258
|
"use strict";
|
|
188270
188259
|
import_ui455 = require("@medusajs/ui");
|
|
188271
|
-
|
|
188260
|
+
import_react308 = require("motion/react");
|
|
188272
188261
|
import_jsx_runtime693 = require("react/jsx-runtime");
|
|
188273
188262
|
LogoBox = ({
|
|
188274
188263
|
className,
|
|
@@ -188294,7 +188283,7 @@ var init_logo_box = __esm({
|
|
|
188294
188283
|
),
|
|
188295
188284
|
children: [
|
|
188296
188285
|
checked && /* @__PURE__ */ (0, import_jsx_runtime693.jsx)(
|
|
188297
|
-
|
|
188286
|
+
import_react308.motion.div,
|
|
188298
188287
|
{
|
|
188299
188288
|
className: "size-5 absolute -right-[5px] -top-1 flex items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]",
|
|
188300
188289
|
initial: { opacity: 0, scale: 0.5 },
|
|
@@ -188309,7 +188298,7 @@ var init_logo_box = __esm({
|
|
|
188309
188298
|
viewBox: "0 0 20 20",
|
|
188310
188299
|
fill: "none",
|
|
188311
188300
|
children: /* @__PURE__ */ (0, import_jsx_runtime693.jsx)(
|
|
188312
|
-
|
|
188301
|
+
import_react308.motion.path,
|
|
188313
188302
|
{
|
|
188314
188303
|
d: "M5.8335 10.4167L9.16683 13.75L14.1668 6.25",
|
|
188315
188304
|
stroke: "white",
|
|
@@ -188359,7 +188348,7 @@ var init_logo_box2 = __esm({
|
|
|
188359
188348
|
});
|
|
188360
188349
|
|
|
188361
188350
|
// src/routes/reset-password/reset-password.tsx
|
|
188362
|
-
var import_zod169, import_ui456, import_react_hook_form146, import_react_i18next488, import_react_router_dom249, z65,
|
|
188351
|
+
var import_zod169, import_ui456, import_react_hook_form146, import_react_i18next488, import_react_router_dom249, z65, import_react309, import_react_jwt, import_jsx_runtime694, ResetPasswordInstructionsSchema, ResetPasswordSchema, ResetPasswordTokenSchema, validateDecodedResetPasswordToken, InvalidResetToken, ChooseNewPassword, ResetPassword;
|
|
188363
188352
|
var init_reset_password = __esm({
|
|
188364
188353
|
"src/routes/reset-password/reset-password.tsx"() {
|
|
188365
188354
|
"use strict";
|
|
@@ -188369,7 +188358,7 @@ var init_reset_password = __esm({
|
|
|
188369
188358
|
import_react_i18next488 = require("react-i18next");
|
|
188370
188359
|
import_react_router_dom249 = require("react-router-dom");
|
|
188371
188360
|
z65 = __toESM(require("zod"));
|
|
188372
|
-
|
|
188361
|
+
import_react309 = require("react");
|
|
188373
188362
|
import_react_jwt = require("react-jwt");
|
|
188374
188363
|
init_form2();
|
|
188375
188364
|
init_logo_box2();
|
|
@@ -188438,7 +188427,7 @@ var init_reset_password = __esm({
|
|
|
188438
188427
|
};
|
|
188439
188428
|
ChooseNewPassword = ({ token }) => {
|
|
188440
188429
|
const { t: t5 } = (0, import_react_i18next488.useTranslation)();
|
|
188441
|
-
const [showAlert, setShowAlert] = (0,
|
|
188430
|
+
const [showAlert, setShowAlert] = (0, import_react309.useState)(false);
|
|
188442
188431
|
const invite = token ? (0, import_react_jwt.decodeToken)(token) : null;
|
|
188443
188432
|
const isValidResetPasswordToken = invite && validateDecodedResetPasswordToken(invite);
|
|
188444
188433
|
const form = (0, import_react_hook_form146.useForm)({
|
|
@@ -188558,7 +188547,7 @@ var init_reset_password = __esm({
|
|
|
188558
188547
|
ResetPassword = () => {
|
|
188559
188548
|
const { t: t5 } = (0, import_react_i18next488.useTranslation)();
|
|
188560
188549
|
const [searchParams] = (0, import_react_router_dom249.useSearchParams)();
|
|
188561
|
-
const [showAlert, setShowAlert] = (0,
|
|
188550
|
+
const [showAlert, setShowAlert] = (0, import_react309.useState)(false);
|
|
188562
188551
|
const token = searchParams.get("token");
|
|
188563
188552
|
const form = (0, import_react_hook_form146.useForm)({
|
|
188564
188553
|
resolver: (0, import_zod169.zodResolver)(ResetPasswordInstructionsSchema),
|
|
@@ -188660,15 +188649,15 @@ var init_reset_password2 = __esm({
|
|
|
188660
188649
|
});
|
|
188661
188650
|
|
|
188662
188651
|
// src/routes/invite/invite.tsx
|
|
188663
|
-
var import_zod170, import_ui457, import_i18next8,
|
|
188652
|
+
var import_zod170, import_ui457, import_i18next8, import_react310, import_react311, import_react_hook_form147, import_react_i18next489, import_react_jwt2, import_react_router_dom250, z66, import_jsx_runtime695, CreateAccountSchema, Invite, LoginLink, InvalidView, CreateView, SuccessView, InviteSchema, validateDecodedInvite;
|
|
188664
188653
|
var init_invite = __esm({
|
|
188665
188654
|
"src/routes/invite/invite.tsx"() {
|
|
188666
188655
|
"use strict";
|
|
188667
188656
|
import_zod170 = require("@hookform/resolvers/zod");
|
|
188668
188657
|
import_ui457 = require("@medusajs/ui");
|
|
188669
188658
|
import_i18next8 = __toESM(require("i18next"));
|
|
188670
|
-
|
|
188671
|
-
|
|
188659
|
+
import_react310 = require("motion/react");
|
|
188660
|
+
import_react311 = require("react");
|
|
188672
188661
|
import_react_hook_form147 = require("react-hook-form");
|
|
188673
188662
|
import_react_i18next489 = require("react-i18next");
|
|
188674
188663
|
import_react_jwt2 = require("react-jwt");
|
|
@@ -188697,14 +188686,14 @@ var init_invite = __esm({
|
|
|
188697
188686
|
});
|
|
188698
188687
|
Invite = () => {
|
|
188699
188688
|
const [searchParams] = (0, import_react_router_dom250.useSearchParams)();
|
|
188700
|
-
const [success, setSuccess] = (0,
|
|
188689
|
+
const [success, setSuccess] = (0, import_react311.useState)(false);
|
|
188701
188690
|
const token = searchParams.get("token");
|
|
188702
188691
|
const invite = token ? (0, import_react_jwt2.decodeToken)(token) : null;
|
|
188703
188692
|
const isValidInvite = invite && validateDecodedInvite(invite);
|
|
188704
188693
|
return /* @__PURE__ */ (0, import_jsx_runtime695.jsx)("div", { className: "bg-ui-bg-subtle relative flex min-h-dvh w-dvw items-center justify-center p-4", children: /* @__PURE__ */ (0, import_jsx_runtime695.jsxs)("div", { className: "flex w-full max-w-[360px] flex-col items-center", children: [
|
|
188705
188694
|
/* @__PURE__ */ (0, import_jsx_runtime695.jsx)(AvatarBox, { checked: success }),
|
|
188706
|
-
/* @__PURE__ */ (0, import_jsx_runtime695.jsx)("div", { className: "max-h-[557px] w-full will-change-contents", children: isValidInvite ? /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
188707
|
-
|
|
188695
|
+
/* @__PURE__ */ (0, import_jsx_runtime695.jsx)("div", { className: "max-h-[557px] w-full will-change-contents", children: isValidInvite ? /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(import_react310.AnimatePresence, { children: !success ? /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
188696
|
+
import_react310.motion.div,
|
|
188708
188697
|
{
|
|
188709
188698
|
initial: false,
|
|
188710
188699
|
animate: {
|
|
@@ -188722,7 +188711,7 @@ var init_invite = __esm({
|
|
|
188722
188711
|
},
|
|
188723
188712
|
className: "w-full will-change-transform",
|
|
188724
188713
|
children: /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
188725
|
-
|
|
188714
|
+
import_react310.motion.div,
|
|
188726
188715
|
{
|
|
188727
188716
|
initial: false,
|
|
188728
188717
|
animate: {
|
|
@@ -188752,7 +188741,7 @@ var init_invite = __esm({
|
|
|
188752
188741
|
},
|
|
188753
188742
|
"create-account"
|
|
188754
188743
|
) : /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
188755
|
-
|
|
188744
|
+
import_react310.motion.div,
|
|
188756
188745
|
{
|
|
188757
188746
|
initial: {
|
|
188758
188747
|
opacity: 0,
|
|
@@ -188805,7 +188794,7 @@ var init_invite = __esm({
|
|
|
188805
188794
|
invite
|
|
188806
188795
|
}) => {
|
|
188807
188796
|
const { t: t5 } = (0, import_react_i18next489.useTranslation)();
|
|
188808
|
-
const [invalid, setInvalid] = (0,
|
|
188797
|
+
const [invalid, setInvalid] = (0, import_react311.useState)(false);
|
|
188809
188798
|
const [params2] = (0, import_react_router_dom250.useSearchParams)();
|
|
188810
188799
|
const isFirstRun = params2.get("first_run") === "true";
|
|
188811
188800
|
const form = (0, import_react_hook_form147.useForm)({
|
|
@@ -189022,11 +189011,11 @@ var init_invite2 = __esm({
|
|
|
189022
189011
|
});
|
|
189023
189012
|
|
|
189024
189013
|
// src/routes/no-match/no-match.tsx
|
|
189025
|
-
var
|
|
189014
|
+
var import_icons175, import_ui458, import_react_i18next490, import_react_router_dom251, import_jsx_runtime696, NoMatch;
|
|
189026
189015
|
var init_no_match = __esm({
|
|
189027
189016
|
"src/routes/no-match/no-match.tsx"() {
|
|
189028
189017
|
"use strict";
|
|
189029
|
-
|
|
189018
|
+
import_icons175 = require("@medusajs/icons");
|
|
189030
189019
|
import_ui458 = require("@medusajs/ui");
|
|
189031
189020
|
import_react_i18next490 = require("react-i18next");
|
|
189032
189021
|
import_react_router_dom251 = require("react-router-dom");
|
|
@@ -189037,7 +189026,7 @@ var init_no_match = __esm({
|
|
|
189037
189026
|
const message = t5("errorBoundary.noMatchMessage");
|
|
189038
189027
|
return /* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "flex size-full min-h-screen items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "flex flex-col items-center gap-y-6", children: [
|
|
189039
189028
|
/* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "text-ui-fg-subtle flex flex-col items-center gap-y-3", children: [
|
|
189040
|
-
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
189029
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_icons175.ExclamationCircle, {}),
|
|
189041
189030
|
/* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "flex flex-col items-center justify-center gap-y-1", children: [
|
|
189042
189031
|
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui458.Text, { size: "small", leading: "compact", weight: "plus", children: title }),
|
|
189043
189032
|
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
@@ -190548,7 +190537,7 @@ var init_get_route_map = __esm({
|
|
|
190548
190537
|
|
|
190549
190538
|
// src/dashboard-app/routes/utils.ts
|
|
190550
190539
|
var settingsRouteRegex, getRouteExtensions, createBranchRoute, createLeafRoute, createParallelRoute, processParallelRoutes, addRoute, createRouteMap;
|
|
190551
|
-
var
|
|
190540
|
+
var init_utils14 = __esm({
|
|
190552
190541
|
"src/dashboard-app/routes/utils.ts"() {
|
|
190553
190542
|
"use strict";
|
|
190554
190543
|
init_error_boundary2();
|
|
@@ -190715,7 +190704,7 @@ var init_dashboard_app = __esm({
|
|
|
190715
190704
|
init_providers2();
|
|
190716
190705
|
init_translations();
|
|
190717
190706
|
init_get_route_map();
|
|
190718
|
-
|
|
190707
|
+
init_utils14();
|
|
190719
190708
|
init_sort_menu_items_by_rank();
|
|
190720
190709
|
import_jsx_runtime698 = require("react/jsx-runtime");
|
|
190721
190710
|
OPTIONAL_LAST_SEGMENT_MATCH = /\/([^\/])+\?$/;
|
|
@@ -191065,7 +191054,7 @@ function getFieldType(type) {
|
|
|
191065
191054
|
return "unsupported";
|
|
191066
191055
|
}
|
|
191067
191056
|
var import_zod171;
|
|
191068
|
-
var
|
|
191057
|
+
var init_utils15 = __esm({
|
|
191069
191058
|
"src/dashboard-app/forms/form-extension-zone/utils.ts"() {
|
|
191070
191059
|
"use strict";
|
|
191071
191060
|
import_zod171 = require("zod");
|
|
@@ -191086,7 +191075,7 @@ var init_form_extension_zone = __esm({
|
|
|
191086
191075
|
import_ui459 = require("@medusajs/ui");
|
|
191087
191076
|
import_react_i18next491 = require("react-i18next");
|
|
191088
191077
|
init_form2();
|
|
191089
|
-
|
|
191078
|
+
init_utils15();
|
|
191090
191079
|
import_jsx_runtime699 = require("react/jsx-runtime");
|
|
191091
191080
|
FormExtensionZone = ({ fields, form }) => {
|
|
191092
191081
|
return /* @__PURE__ */ (0, import_jsx_runtime699.jsx)("div", { children: fields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(FormExtensionField, { field, form }, index)) });
|
|
@@ -191180,7 +191169,7 @@ function getLinkedFields(model, fields = "") {
|
|
|
191180
191169
|
return appendLinkableFields(fields, links);
|
|
191181
191170
|
}
|
|
191182
191171
|
var import_links;
|
|
191183
|
-
var
|
|
191172
|
+
var init_utils16 = __esm({
|
|
191184
191173
|
"src/dashboard-app/links/utils.ts"() {
|
|
191185
191174
|
"use strict";
|
|
191186
191175
|
import_links = __toESM(require("virtual:medusa/links"));
|
|
@@ -191193,8 +191182,8 @@ var init_dashboard_app2 = __esm({
|
|
|
191193
191182
|
"use strict";
|
|
191194
191183
|
init_dashboard_app();
|
|
191195
191184
|
init_forms();
|
|
191196
|
-
|
|
191197
|
-
|
|
191185
|
+
init_utils16();
|
|
191186
|
+
init_utils14();
|
|
191198
191187
|
}
|
|
191199
191188
|
});
|
|
191200
191189
|
|