@medusajs/dashboard 2.12.3-preview-20251217123836 → 2.12.3-snapshot-20251216185234
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-FRUN2KFK.mjs → api-key-management-detail-6RCDH73M.mjs} +1 -1
- package/dist/app.css +0 -19
- package/dist/app.js +679 -795
- package/dist/app.mjs +2 -2
- package/dist/{campaign-detail-HM3GQJLQ.mjs → campaign-detail-5Q4BYCPX.mjs} +1 -1
- package/dist/{categories-metadata-WKL3MGD7.mjs → categories-metadata-J7M3XWI7.mjs} +1 -1
- package/dist/{category-detail-UTWWDKFP.mjs → category-detail-S5IPXMHX.mjs} +2 -2
- package/dist/{category-products-XXBTCXFF.mjs → category-products-KPW6BA5J.mjs} +2 -2
- package/dist/{chunk-UMCJYHAD.mjs → chunk-CVHJAKLQ.mjs} +1 -1
- package/dist/{chunk-KSDXSKJ7.mjs → chunk-DBXWB3RF.mjs} +1 -1
- package/dist/{chunk-GLBHPDR4.mjs → chunk-GRZSG4EP.mjs} +16 -21
- package/dist/{chunk-FKNW5MLZ.mjs → chunk-LZFWCKOF.mjs} +4 -21
- package/dist/{chunk-5ISRTMYH.mjs → chunk-MJDHVDOW.mjs} +1 -1
- package/dist/{chunk-5F427YCP.mjs → chunk-OL24RDYM.mjs} +2 -2
- package/dist/{chunk-VFF5WB7C.mjs → chunk-OL6MEUKW.mjs} +104 -108
- package/dist/{chunk-OK6NZN2A.mjs → chunk-PHLCT2HA.mjs} +1 -1
- package/dist/{chunk-DQUXK4WW.mjs → chunk-ST4P6BQN.mjs} +1 -1
- package/dist/{chunk-HNJ65IND.mjs → chunk-WYATCUOM.mjs} +1 -1
- package/dist/{chunk-DTCIBQO2.mjs → chunk-YYOPBKME.mjs} +1 -1
- package/dist/{chunk-SG2JZPTG.mjs → chunk-ZMG5B4FG.mjs} +1 -1
- package/dist/{collection-add-products-42F7H77E.mjs → collection-add-products-FU2BS3D3.mjs} +2 -2
- package/dist/{collection-detail-PXIS3G64.mjs → collection-detail-VJE7XHLV.mjs} +2 -2
- package/dist/{collection-list-O74CGY24.mjs → collection-list-IGA6SCNF.mjs} +2 -2
- package/dist/{collection-metadata-U6FMA4IC.mjs → collection-metadata-QK7MI3D2.mjs} +1 -1
- package/dist/{customer-detail-OMTFJ6CE.mjs → customer-detail-MOV2T3LF.mjs} +1 -1
- package/dist/{customer-group-detail-ADK3M5LG.mjs → customer-group-detail-6T7OXGQD.mjs} +1 -1
- package/dist/{customer-group-list-7ZRQ2HWU.mjs → customer-group-list-AJEAF5D2.mjs} +1 -1
- package/dist/{customers-add-customer-group-5U27WHJB.mjs → customers-add-customer-group-QVTVSQYM.mjs} +1 -1
- package/dist/{edit-rules-BM2ERGVJ.mjs → edit-rules-SMVRTCUP.mjs} +1 -1
- package/dist/en.json +1 -1
- package/dist/{inventory-create-7MA7B5N2.mjs → inventory-create-BK52VALF.mjs} +2 -2
- package/dist/{inventory-detail-B4PRHZK3.mjs → inventory-detail-ZPSEMYI2.mjs} +1 -1
- package/dist/{inventory-metadata-C7MJ3GY5.mjs → inventory-metadata-FNEJ3RAT.mjs} +1 -1
- package/dist/{inventory-stock-WVTYPJTX.mjs → inventory-stock-6WYWLWJ7.mjs} +3 -3
- package/dist/{location-detail-KO6EBDK5.mjs → location-detail-N3GUZSY7.mjs} +1 -1
- package/dist/{location-fulfillment-providers-IORBE3E3.mjs → location-fulfillment-providers-7ZUJAGNY.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-create-2R3ZFLVK.mjs → location-service-zone-shipping-option-create-CNRWYZQC.mjs} +3 -3
- package/dist/{location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs → location-service-zone-shipping-option-pricing-OGWI7VPT.mjs} +2 -2
- package/dist/{login-XKB6OR7I.mjs → login-VNOLI5YG.mjs} +1 -1
- package/dist/{order-create-claim-NKCOGF4A.mjs → order-create-claim-SCDJGM46.mjs} +1 -1
- package/dist/{order-create-edit-UNQYXGLL.mjs → order-create-edit-2WALBPXS.mjs} +1 -1
- package/dist/{order-create-exchange-WI7OA2WO.mjs → order-create-exchange-LQU4YN7F.mjs} +1 -1
- package/dist/{order-create-fulfillment-2LJTEWDY.mjs → order-create-fulfillment-OWUVTZXW.mjs} +1 -1
- package/dist/{order-create-refund-7K6UJXGP.mjs → order-create-refund-Q6HQY42R.mjs} +1 -1
- package/dist/{order-create-shipment-ZTDLLUBY.mjs → order-create-shipment-WAGGEPRW.mjs} +1 -1
- package/dist/{order-detail-JTRUMRLO.mjs → order-detail-PVPGEWGY.mjs} +1 -1
- package/dist/{order-edit-billing-address-YHYNVLOE.mjs → order-edit-billing-address-UM76J4KX.mjs} +1 -1
- package/dist/{order-edit-email-TCQPEVZY.mjs → order-edit-email-CL3KNOCM.mjs} +1 -1
- package/dist/{order-edit-shipping-address-CFSYQLKD.mjs → order-edit-shipping-address-PIESTGVL.mjs} +1 -1
- package/dist/{order-export-G4SBNEJ7.mjs → order-export-LE363ZLB.mjs} +1 -1
- package/dist/{order-metadata-KGPB37VL.mjs → order-metadata-FHBB7MTG.mjs} +1 -1
- package/dist/{order-receive-return-JER24SEV.mjs → order-receive-return-PRVKP6J2.mjs} +1 -1
- package/dist/{order-request-transfer-3FBUYZNT.mjs → order-request-transfer-XSAGRUMT.mjs} +1 -1
- package/dist/{price-list-create-CXZCFFTP.mjs → price-list-create-K5JEZT57.mjs} +4 -4
- package/dist/{price-list-detail-XOMU6U5J.mjs → price-list-detail-Q5VG5VGW.mjs} +2 -2
- package/dist/{price-list-prices-add-SDX5CQME.mjs → price-list-prices-add-2MQ226U4.mjs} +4 -4
- package/dist/{price-list-prices-edit-EKB6NI5D.mjs → price-list-prices-edit-OJZLV7OS.mjs} +2 -2
- package/dist/{product-attributes-MXDPSOWM.mjs → product-attributes-YF4TZOIO.mjs} +2 -2
- package/dist/{product-create-3O34JJLS.mjs → product-create-KJML2332.mjs} +3 -3
- package/dist/{product-create-variant-OTJKT6WI.mjs → product-create-variant-5EBCLM54.mjs} +2 -2
- package/dist/{product-detail-SYTLG5D3.mjs → product-detail-QG72542C.mjs} +2 -2
- package/dist/{product-edit-W72S22NM.mjs → product-edit-DZZR775Q.mjs} +2 -2
- package/dist/{product-export-57UUAGXF.mjs → product-export-5AD7NELI.mjs} +2 -2
- package/dist/{product-image-variants-edit-2BW5BJON.mjs → product-image-variants-edit-M6QF2RLE.mjs} +1 -1
- package/dist/{product-import-6EM4VUXP.mjs → product-import-V3KQN4TV.mjs} +1 -1
- package/dist/{product-list-5V5GEH5K.mjs → product-list-EUWZIFTM.mjs} +2 -2
- package/dist/{product-metadata-JZLHBLZQ.mjs → product-metadata-GL2MVPDI.mjs} +1 -1
- package/dist/{product-organization-SVXTCWIF.mjs → product-organization-O7RHELMQ.mjs} +2 -2
- package/dist/{product-prices-5ZL2RP7A.mjs → product-prices-YWV6MSM6.mjs} +1 -1
- package/dist/{product-stock-SJJABF6I.mjs → product-stock-AKEFMK5O.mjs} +3 -3
- package/dist/{product-tag-create-XXO4AQEC.mjs → product-tag-create-PQMDDKWH.mjs} +1 -1
- package/dist/{product-tag-detail-BSK64HXL.mjs → product-tag-detail-I3MBZX7U.mjs} +3 -3
- package/dist/{product-tag-edit-ENCGDT7E.mjs → product-tag-edit-K3BBQLJR.mjs} +1 -1
- package/dist/{product-tag-list-SLQGCNDZ.mjs → product-tag-list-JUWSOMB7.mjs} +3 -3
- package/dist/{product-tag-metadata-EPXHMU2K.mjs → product-tag-metadata-MJH5LH7E.mjs} +1 -1
- package/dist/{product-type-detail-4CRRU7YK.mjs → product-type-detail-RKHT5NBL.mjs} +2 -2
- package/dist/{product-type-metadata-73OKOGPP.mjs → product-type-metadata-CDJDFFGQ.mjs} +1 -1
- package/dist/{product-variant-detail-RPHLG4HU.mjs → product-variant-detail-XAYG5CKE.mjs} +1 -1
- package/dist/{product-variant-edit-JF7NN64Y.mjs → product-variant-edit-DEZEY2H2.mjs} +1 -1
- package/dist/{product-variant-metadata-HU2CXGPO.mjs → product-variant-metadata-VTZDNWUT.mjs} +1 -1
- package/dist/{promotion-create-BHA3FQG2.mjs → promotion-create-HWFNUQXG.mjs} +1 -1
- package/dist/{promotion-detail-F3QSR52W.mjs → promotion-detail-QC36KXB3.mjs} +1 -1
- package/dist/{refund-reason-create-ZA5TKW2Z.mjs → refund-reason-create-YHCDEHGQ.mjs} +1 -1
- package/dist/{refund-reason-edit-N2CRCLKZ.mjs → refund-reason-edit-CZ5QZ2SZ.mjs} +1 -1
- package/dist/{refund-reason-list-SE4TMGMT.mjs → refund-reason-list-OJYYEYJE.mjs} +1 -1
- package/dist/{region-metadata-O5NZBWXP.mjs → region-metadata-H6XXUQ4S.mjs} +1 -1
- package/dist/{reservation-detail-UFK6XIXE.mjs → reservation-detail-LZAQL4XA.mjs} +1 -1
- package/dist/{reservation-metadata-AEJEKGLV.mjs → reservation-metadata-5HZSDDOK.mjs} +1 -1
- package/dist/{sales-channel-add-products-2LMB7EF5.mjs → sales-channel-add-products-F7YV4MO5.mjs} +2 -2
- package/dist/{sales-channel-detail-EUQ4STQI.mjs → sales-channel-detail-MXIPZCGA.mjs} +2 -2
- package/dist/{sales-channel-list-JXKGHX4G.mjs → sales-channel-list-RLGL7FM3.mjs} +1 -1
- package/dist/{sales-channel-metadata-AJMQ5SQ2.mjs → sales-channel-metadata-M364R4RJ.mjs} +1 -1
- package/dist/{shipping-option-type-create-YVVIA2XC.mjs → shipping-option-type-create-C5WUWON7.mjs} +1 -1
- package/dist/{shipping-option-type-detail-ZZW36XLK.mjs → shipping-option-type-detail-PENS2K73.mjs} +2 -2
- package/dist/{shipping-option-type-edit-O6F74T3A.mjs → shipping-option-type-edit-CIU5EHRP.mjs} +1 -1
- package/dist/{shipping-option-type-list-SPTE7MT6.mjs → shipping-option-type-list-DIOX7VG7.mjs} +2 -2
- package/dist/{shipping-profile-metadata-7WFE55VG.mjs → shipping-profile-metadata-75G2NNMA.mjs} +1 -1
- package/dist/{chunk-IKTGFXWR.mjs → store-add-locales-VJ4RJ7UI.mjs} +67 -2
- package/dist/{store-detail-YLJLBBZE.mjs → store-detail-JSNPOB2F.mjs} +1 -1
- package/dist/{store-metadata-BZ57I2E6.mjs → store-metadata-CYXTVJUE.mjs} +1 -1
- package/dist/{tax-region-create-FGTV7VJL.mjs → tax-region-create-DWGL4EUT.mjs} +1 -1
- package/dist/{tax-region-detail-PPIMD7OX.mjs → tax-region-detail-2AE2EFI3.mjs} +5 -5
- package/dist/{tax-region-edit-ELZKA7YH.mjs → tax-region-edit-EEVEEU2Q.mjs} +1 -1
- package/dist/{tax-region-province-detail-FV2NDT3E.mjs → tax-region-province-detail-4ERSEQFF.mjs} +5 -5
- package/dist/{tax-region-tax-override-create-N572MQPZ.mjs → tax-region-tax-override-create-PHCGEF7V.mjs} +3 -3
- package/dist/{tax-region-tax-override-edit-5DCSJW6D.mjs → tax-region-tax-override-edit-SMRPSILC.mjs} +4 -4
- package/dist/{translation-list-FK7XYLHX.mjs → translation-list-UF7FLXOW.mjs} +141 -227
- package/dist/{translations-edit-VRXZI5KW.mjs → translations-edit-USQJNMAY.mjs} +253 -224
- package/dist/{user-metadata-GRJZZ524.mjs → user-metadata-2WPJOEJA.mjs} +1 -1
- package/dist/{workflow-execution-detail-HXTFWGKG.mjs → workflow-execution-detail-H2AKEZJX.mjs} +1 -1
- package/package.json +9 -9
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +0 -1
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +0 -1
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +4 -22
- package/src/dashboard-app/routes/get-route.map.tsx +0 -4
- package/src/hooks/api/translations.tsx +17 -26
- package/src/i18n/translations/en.json +1 -1
- package/src/i18n/translations/es.json +1 -1
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +17 -42
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +1 -5
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +121 -182
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +330 -285
- package/dist/add-locales-GGNZCABB.mjs +0 -81
- package/dist/store-add-locales-GWCGIXHU.mjs +0 -81
- package/src/routes/translations/add-locales/add-locales.tsx +0 -29
- package/src/routes/translations/add-locales/index.tsx +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/dashboard",
|
|
3
|
-
"version": "2.12.3-
|
|
3
|
+
"version": "2.12.3-snapshot-20251216185234",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
|
6
6
|
"dev": "../../../node_modules/.bin/vite",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
47
47
|
"@hookform/error-message": "^2.0.1",
|
|
48
48
|
"@hookform/resolvers": "3.4.2",
|
|
49
|
-
"@medusajs/admin-shared": "2.12.3-
|
|
50
|
-
"@medusajs/icons": "2.12.3-
|
|
51
|
-
"@medusajs/js-sdk": "2.12.3-
|
|
52
|
-
"@medusajs/ui": "4.0.31-
|
|
49
|
+
"@medusajs/admin-shared": "2.12.3-snapshot-20251216185234",
|
|
50
|
+
"@medusajs/icons": "2.12.3-snapshot-20251216185234",
|
|
51
|
+
"@medusajs/js-sdk": "2.12.3-snapshot-20251216185234",
|
|
52
|
+
"@medusajs/ui": "4.0.31-snapshot-20251216185234",
|
|
53
53
|
"@radix-ui/react-dialog": "1.1.4",
|
|
54
54
|
"@radix-ui/react-dismissable-layer": "1.1.4",
|
|
55
55
|
"@tanstack/react-query": "5.64.2",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"zod": "3.25.76"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@medusajs/admin-shared": "2.12.3-
|
|
84
|
-
"@medusajs/admin-vite-plugin": "2.12.3-
|
|
85
|
-
"@medusajs/types": "2.12.3-
|
|
86
|
-
"@medusajs/ui-preset": "2.12.3-
|
|
83
|
+
"@medusajs/admin-shared": "2.12.3-snapshot-20251216185234",
|
|
84
|
+
"@medusajs/admin-vite-plugin": "2.12.3-snapshot-20251216185234",
|
|
85
|
+
"@medusajs/types": "2.12.3-snapshot-20251216185234",
|
|
86
|
+
"@medusajs/ui-preset": "2.12.3-snapshot-20251216185234"
|
|
87
87
|
},
|
|
88
88
|
"packageManager": "yarn@3.2.1"
|
|
89
89
|
}
|
|
@@ -128,7 +128,6 @@ export const useDataGridCell = <TData, TValue>({
|
|
|
128
128
|
case "number":
|
|
129
129
|
return numberCharacterRegex.test(key)
|
|
130
130
|
case "text":
|
|
131
|
-
case "multiline-text":
|
|
132
131
|
return textCharacterRegex.test(key)
|
|
133
132
|
default:
|
|
134
133
|
// KeyboardEvents should not be forwareded to other types of cells
|
|
@@ -211,22 +211,7 @@ export const useDataGridKeydownEvent = <
|
|
|
211
211
|
[rangeEnd, matrix, getSelectionValues, setSelectionValues, execute]
|
|
212
212
|
)
|
|
213
213
|
|
|
214
|
-
const
|
|
215
|
-
(anchor: DataGridCoordinates) => {
|
|
216
|
-
const field = matrix.getCellField(anchor)
|
|
217
|
-
const input = queryTool?.getInput(anchor)
|
|
218
|
-
|
|
219
|
-
if (!field || !input) {
|
|
220
|
-
return
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
createSnapshot(anchor)
|
|
224
|
-
input.focus()
|
|
225
|
-
},
|
|
226
|
-
[matrix, queryTool, createSnapshot]
|
|
227
|
-
)
|
|
228
|
-
|
|
229
|
-
const handleSpaceKeyNumber = useCallback(
|
|
214
|
+
const handleSpaceKeyTextOrNumber = useCallback(
|
|
230
215
|
(anchor: DataGridCoordinates) => {
|
|
231
216
|
const field = matrix.getCellField(anchor)
|
|
232
217
|
const input = queryTool?.getInput(anchor)
|
|
@@ -318,12 +303,10 @@ export const useDataGridKeydownEvent = <
|
|
|
318
303
|
case "togglable-number":
|
|
319
304
|
handleSpaceKeyTogglableNumber(anchor)
|
|
320
305
|
break
|
|
306
|
+
case "number":
|
|
321
307
|
case "text":
|
|
322
308
|
case "multiline-text":
|
|
323
|
-
|
|
324
|
-
break
|
|
325
|
-
case "number":
|
|
326
|
-
handleSpaceKeyNumber(anchor)
|
|
309
|
+
handleSpaceKeyTextOrNumber(anchor)
|
|
327
310
|
break
|
|
328
311
|
}
|
|
329
312
|
},
|
|
@@ -332,8 +315,7 @@ export const useDataGridKeydownEvent = <
|
|
|
332
315
|
isEditing,
|
|
333
316
|
matrix,
|
|
334
317
|
handleSpaceKeyBoolean,
|
|
335
|
-
|
|
336
|
-
handleSpaceKeyNumber,
|
|
318
|
+
handleSpaceKeyTextOrNumber,
|
|
337
319
|
handleSpaceKeyTogglableNumber,
|
|
338
320
|
]
|
|
339
321
|
)
|
|
@@ -1857,10 +1857,6 @@ export function getRouteMap({
|
|
|
1857
1857
|
lazy: () =>
|
|
1858
1858
|
import("../../routes/translations/translations-edit"),
|
|
1859
1859
|
},
|
|
1860
|
-
{
|
|
1861
|
-
path: "add-locales",
|
|
1862
|
-
lazy: () => import("../../routes/translations/add-locales"),
|
|
1863
|
-
},
|
|
1864
1860
|
],
|
|
1865
1861
|
},
|
|
1866
1862
|
...(settingsRoutes?.[0]?.children || []),
|
|
@@ -229,15 +229,6 @@ export const useTranslations = (
|
|
|
229
229
|
return { ...data, ...rest }
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
const referenceInvalidationKeysMap = new Map<string, QueryKey>([
|
|
233
|
-
["product", productsQueryKeys.lists()],
|
|
234
|
-
["product_variant", productVariantQueryKeys.lists()],
|
|
235
|
-
["product_category", categoriesQueryKeys.lists()],
|
|
236
|
-
["product_collection", collectionsQueryKeys.lists()],
|
|
237
|
-
["product_type", productTypesQueryKeys.lists()],
|
|
238
|
-
["product_tag", productTagsQueryKeys.lists()],
|
|
239
|
-
])
|
|
240
|
-
|
|
241
232
|
export const useBatchTranslations = (
|
|
242
233
|
reference: string,
|
|
243
234
|
options?: UseMutationOptions<
|
|
@@ -246,30 +237,30 @@ export const useBatchTranslations = (
|
|
|
246
237
|
HttpTypes.AdminBatchTranslations
|
|
247
238
|
>
|
|
248
239
|
) => {
|
|
249
|
-
const
|
|
240
|
+
const referenceInvalidationKeysMap = new Map<string, QueryKey>([
|
|
241
|
+
["product", productsQueryKeys.lists()],
|
|
242
|
+
["product_variant", productVariantQueryKeys.lists()],
|
|
243
|
+
["product_category", categoriesQueryKeys.lists()],
|
|
244
|
+
["product_collection", collectionsQueryKeys.lists()],
|
|
245
|
+
["product_type", productTypesQueryKeys.lists()],
|
|
246
|
+
["product_tag", productTagsQueryKeys.lists()],
|
|
247
|
+
])
|
|
248
|
+
|
|
249
|
+
return useMutation({
|
|
250
250
|
mutationFn: (payload: HttpTypes.AdminBatchTranslations) =>
|
|
251
251
|
sdk.admin.translation.batch(payload),
|
|
252
|
-
|
|
253
|
-
})
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Useful to call the invalidation separately from the batch request and await the refetch finishes.
|
|
257
|
-
*/
|
|
258
|
-
const invalidateQueries = async () => {
|
|
259
|
-
await Promise.all([
|
|
252
|
+
onSuccess: (data, variables, context) => {
|
|
260
253
|
queryClient.invalidateQueries({
|
|
261
254
|
queryKey: referenceInvalidationKeysMap.get(reference),
|
|
262
|
-
})
|
|
255
|
+
})
|
|
263
256
|
queryClient.invalidateQueries({
|
|
264
257
|
queryKey: translationStatisticsQueryKeys.lists(),
|
|
265
|
-
})
|
|
266
|
-
])
|
|
267
|
-
}
|
|
258
|
+
})
|
|
268
259
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
260
|
+
options?.onSuccess?.(data, variables, context)
|
|
261
|
+
},
|
|
262
|
+
...options,
|
|
263
|
+
})
|
|
273
264
|
}
|
|
274
265
|
|
|
275
266
|
export const useTranslationSettings = (
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { PencilSquare, Language } from "@medusajs/icons"
|
|
2
|
-
import {
|
|
3
|
-
Container,
|
|
4
|
-
Heading,
|
|
5
|
-
IconButton,
|
|
6
|
-
InlineTip,
|
|
7
|
-
Text,
|
|
8
|
-
Tooltip,
|
|
9
|
-
} from "@medusajs/ui"
|
|
2
|
+
import { Container, Heading, IconButton, InlineTip, Text } from "@medusajs/ui"
|
|
10
3
|
import { useTranslation } from "react-i18next"
|
|
11
4
|
import { IconAvatar } from "../../../../../components/common/icon-avatar"
|
|
12
5
|
import { HttpTypes } from "@medusajs/types"
|
|
13
|
-
import { useCallback
|
|
6
|
+
import { useCallback } from "react"
|
|
14
7
|
import { useNavigate } from "react-router-dom"
|
|
15
8
|
|
|
16
9
|
type ActiveLocalesSectionProps = {
|
|
@@ -22,10 +15,9 @@ export const ActiveLocalesSection = ({
|
|
|
22
15
|
}: ActiveLocalesSectionProps) => {
|
|
23
16
|
const { t } = useTranslation()
|
|
24
17
|
const navigate = useNavigate()
|
|
25
|
-
const [isHovered, setIsHovered] = useState(false)
|
|
26
18
|
|
|
27
19
|
const handleManageLocales = useCallback(() => {
|
|
28
|
-
navigate("/settings/
|
|
20
|
+
navigate("/settings/store/locales")
|
|
29
21
|
}, [navigate])
|
|
30
22
|
|
|
31
23
|
const renderLocales = useCallback(() => {
|
|
@@ -45,43 +37,26 @@ export const ActiveLocalesSection = ({
|
|
|
45
37
|
return (
|
|
46
38
|
<Container className="flex flex-col p-0">
|
|
47
39
|
<div className="flex items-center justify-between px-6 py-4">
|
|
48
|
-
<Heading
|
|
40
|
+
<Heading>{t("translations.activeLocales.heading")}</Heading>
|
|
49
41
|
<IconButton variant="transparent" onClick={handleManageLocales}>
|
|
50
42
|
<PencilSquare></PencilSquare>
|
|
51
43
|
</IconButton>
|
|
52
44
|
</div>
|
|
53
45
|
<div className="px-1 pb-1">
|
|
54
46
|
{hasLocales ? (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className="bg-ui-bg-component border-r-1 flex items-center gap-x-4 px-[19px] py-2"
|
|
69
|
-
onMouseEnter={() => setIsHovered(true)}
|
|
70
|
-
onMouseLeave={() => setIsHovered(false)}
|
|
71
|
-
>
|
|
72
|
-
<IconAvatar className="border-ui-border-base border">
|
|
73
|
-
<Language />
|
|
74
|
-
</IconAvatar>
|
|
75
|
-
<div className="flex flex-col">
|
|
76
|
-
<Text size="small" weight="plus">
|
|
77
|
-
{t("translations.activeLocales.subtitle")}
|
|
78
|
-
</Text>
|
|
79
|
-
<Text className="text-ui-fg-subtle" size="small">
|
|
80
|
-
{renderLocales()}
|
|
81
|
-
</Text>
|
|
82
|
-
</div>
|
|
83
|
-
</Container>
|
|
84
|
-
</Tooltip>
|
|
47
|
+
<Container className="bg-ui-bg-component flex items-center gap-x-4 px-6 py-2">
|
|
48
|
+
<IconAvatar>
|
|
49
|
+
<Language />
|
|
50
|
+
</IconAvatar>
|
|
51
|
+
<div className="flex flex-col">
|
|
52
|
+
<Text size="small" weight="plus">
|
|
53
|
+
{t("translations.activeLocales.subtitle")}
|
|
54
|
+
</Text>
|
|
55
|
+
<Text className="text-ui-fg-subtle" size="small">
|
|
56
|
+
{renderLocales()}
|
|
57
|
+
</Text>
|
|
58
|
+
</div>
|
|
59
|
+
</Container>
|
|
85
60
|
) : (
|
|
86
61
|
<InlineTip label="Tip">
|
|
87
62
|
{t("translations.activeLocales.noLocalesTip")}
|
|
@@ -33,11 +33,7 @@ export const TranslationListSection = ({
|
|
|
33
33
|
<Link
|
|
34
34
|
to={`/settings/translations/edit?reference=${entity.reference}`}
|
|
35
35
|
>
|
|
36
|
-
<Button
|
|
37
|
-
variant="secondary"
|
|
38
|
-
size="small"
|
|
39
|
-
disabled={!hasLocales || !entity.totalCount}
|
|
40
|
-
>
|
|
36
|
+
<Button variant="secondary" size="small" disabled={!hasLocales}>
|
|
41
37
|
Edit
|
|
42
38
|
</Button>
|
|
43
39
|
</Link>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdminTranslationEntityStatistics, HttpTypes } from "@medusajs/types"
|
|
2
|
-
import { Container,
|
|
2
|
+
import { Container, Heading, Text, Tooltip } from "@medusajs/ui"
|
|
3
3
|
import { useMemo, useState } from "react"
|
|
4
4
|
import { useTranslation } from "react-i18next"
|
|
5
5
|
|
|
@@ -75,210 +75,149 @@ export const TranslationsCompletionSection = ({
|
|
|
75
75
|
[localeStats]
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
const localeStatsCount = useMemo(() => localeStats.length, [localeStats])
|
|
79
|
-
|
|
80
78
|
return (
|
|
81
|
-
<Container className="
|
|
82
|
-
<div className="flex
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</div>
|
|
79
|
+
<Container className="flex flex-col gap-y-3 px-6 py-4">
|
|
80
|
+
<div className="flex items-center justify-between">
|
|
81
|
+
<Heading>{t("translations.completion.heading")}</Heading>
|
|
82
|
+
<Text size="small" weight="plus" className="text-ui-fg-subtle">
|
|
83
|
+
{translatedCount.toLocaleString()} {t("general.of")}{" "}
|
|
84
|
+
{totalCount.toLocaleString()}
|
|
85
|
+
</Text>
|
|
86
|
+
</div>
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<div
|
|
95
|
-
className="mr-0.5 h-full rounded-sm transition-all"
|
|
96
|
-
style={{
|
|
97
|
-
width: `${percentage}%`,
|
|
98
|
-
backgroundColor: "var(--tag-blue-icon)",
|
|
99
|
-
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
<div
|
|
103
|
-
className="h-full flex-1 rounded-sm"
|
|
104
|
-
style={{
|
|
105
|
-
backgroundColor: "var(--tag-blue-border)",
|
|
106
|
-
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
107
|
-
}}
|
|
108
|
-
/>
|
|
109
|
-
</>
|
|
110
|
-
) : (
|
|
88
|
+
<div className="flex h-3 w-full overflow-hidden">
|
|
89
|
+
{percentage > 0 ? (
|
|
90
|
+
<>
|
|
111
91
|
<div
|
|
112
|
-
className="
|
|
92
|
+
className="mr-0.5 h-full rounded-sm transition-all"
|
|
113
93
|
style={{
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
width: `${percentage}%`,
|
|
95
|
+
backgroundColor: "var(--bg-interactive)",
|
|
116
96
|
}}
|
|
117
97
|
/>
|
|
118
|
-
|
|
119
|
-
|
|
98
|
+
<div
|
|
99
|
+
className="h-full flex-1 rounded-sm"
|
|
100
|
+
style={{
|
|
101
|
+
backgroundColor: "var(--bg-interactive)",
|
|
102
|
+
opacity: 0.3,
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
</>
|
|
106
|
+
) : (
|
|
107
|
+
<div
|
|
108
|
+
className="h-full w-full rounded-full"
|
|
109
|
+
style={{
|
|
110
|
+
backgroundColor: "var(--bg-interactive)",
|
|
111
|
+
opacity: 0.3,
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</div>
|
|
117
|
+
<div className="flex items-center justify-between">
|
|
118
|
+
<Text size="small" weight="plus" className="text-ui-fg-subtle">
|
|
119
|
+
{percentage.toFixed(1)}%
|
|
120
|
+
</Text>
|
|
121
|
+
<Text size="small" weight="plus" className="text-ui-fg-subtle">
|
|
122
|
+
{remaining.toLocaleString()} {t("general.remaining").toLowerCase()}
|
|
123
|
+
</Text>
|
|
129
124
|
</div>
|
|
130
125
|
|
|
131
126
|
{localeStats.length > 0 && (
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<div className="flex
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<div
|
|
155
|
-
className="h-2 w-2 rounded-full"
|
|
156
|
-
style={{
|
|
157
|
-
backgroundColor: "var(--tag-blue-icon)",
|
|
158
|
-
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
159
|
-
}}
|
|
160
|
-
/>
|
|
161
|
-
<Text
|
|
162
|
-
size="small"
|
|
163
|
-
weight="plus"
|
|
164
|
-
className="text-ui-fg-base"
|
|
165
|
-
>
|
|
166
|
-
{t("translations.completion.translated")}
|
|
167
|
-
</Text>
|
|
168
|
-
</div>
|
|
169
|
-
<Text
|
|
170
|
-
size="small"
|
|
171
|
-
weight="plus"
|
|
172
|
-
className="text-ui-fg-base"
|
|
173
|
-
>
|
|
174
|
-
{locale.translated}
|
|
175
|
-
</Text>
|
|
176
|
-
</div>
|
|
177
|
-
<div className="flex items-center justify-between">
|
|
178
|
-
<div className="flex items-center gap-x-2">
|
|
179
|
-
<div
|
|
180
|
-
className="h-2 w-2 rounded-full"
|
|
181
|
-
style={{
|
|
182
|
-
backgroundColor: "var(--tag-blue-border)",
|
|
183
|
-
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
184
|
-
}}
|
|
185
|
-
/>
|
|
186
|
-
<Text
|
|
187
|
-
size="small"
|
|
188
|
-
weight="plus"
|
|
189
|
-
className="text-ui-fg-base"
|
|
190
|
-
>
|
|
191
|
-
{t("translations.completion.toTranslate")}
|
|
192
|
-
</Text>
|
|
193
|
-
</div>
|
|
127
|
+
<div className="mt-4 flex flex-col gap-y-2">
|
|
128
|
+
<div className="flex h-32 w-full items-end gap-1">
|
|
129
|
+
{localeStats.map((locale) => {
|
|
130
|
+
const heightPercent = (locale.total / maxTotal) * 100
|
|
131
|
+
const translatedPercent =
|
|
132
|
+
locale.total > 0 ? (locale.translated / locale.total) * 100 : 0
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<Tooltip
|
|
136
|
+
key={locale.code}
|
|
137
|
+
open={hoveredLocale === locale.code}
|
|
138
|
+
content={
|
|
139
|
+
<div className="flex flex-col gap-y-1 p-1">
|
|
140
|
+
<Text size="small" weight="plus">
|
|
141
|
+
{locale.name}
|
|
142
|
+
</Text>
|
|
143
|
+
<div className="flex items-center justify-between">
|
|
144
|
+
<div className="flex items-center gap-x-2">
|
|
145
|
+
<div
|
|
146
|
+
className="h-2 w-2 rounded-full"
|
|
147
|
+
style={{ backgroundColor: "var(--bg-interactive)" }}
|
|
148
|
+
/>
|
|
194
149
|
<Text
|
|
195
150
|
size="small"
|
|
196
151
|
weight="plus"
|
|
197
|
-
className="text-ui-fg-
|
|
152
|
+
className="text-ui-fg-subtle"
|
|
198
153
|
>
|
|
199
|
-
{
|
|
154
|
+
{t("translations.completion.translated")}
|
|
200
155
|
</Text>
|
|
201
156
|
</div>
|
|
157
|
+
<Text size="small" weight="plus">
|
|
158
|
+
{locale.translated}
|
|
159
|
+
</Text>
|
|
202
160
|
</div>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
) : (
|
|
222
|
-
<>
|
|
223
|
-
<div
|
|
224
|
-
className="w-full rounded-sm"
|
|
225
|
-
style={{
|
|
226
|
-
height: `${100 - translatedPercent}%`,
|
|
227
|
-
backgroundColor: "var(--tag-blue-border)",
|
|
228
|
-
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
229
|
-
minHeight: locale.toTranslate > 0 ? "2px" : "0",
|
|
230
|
-
}}
|
|
231
|
-
/>
|
|
232
|
-
{translatedPercent > 0 && (
|
|
233
|
-
<div
|
|
234
|
-
className="mt-0.5 w-full rounded-sm"
|
|
235
|
-
style={{
|
|
236
|
-
height: `${translatedPercent}%`,
|
|
237
|
-
backgroundColor: "var(--tag-blue-icon)",
|
|
238
|
-
boxShadow:
|
|
239
|
-
"inset 0 0 0 0.5px var(--alpha-250)",
|
|
240
|
-
minHeight:
|
|
241
|
-
locale.translated > 0 ? "2px" : "0",
|
|
242
|
-
}}
|
|
243
|
-
/>
|
|
244
|
-
)}
|
|
245
|
-
</>
|
|
246
|
-
)}
|
|
161
|
+
<div className="flex items-center gap-x-2">
|
|
162
|
+
<div
|
|
163
|
+
className="h-2 w-2 rounded-full"
|
|
164
|
+
style={{
|
|
165
|
+
backgroundColor: "var(--bg-interactive)",
|
|
166
|
+
opacity: 0.3,
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
<Text
|
|
170
|
+
size="small"
|
|
171
|
+
weight="plus"
|
|
172
|
+
className="text-ui-fg-subtle"
|
|
173
|
+
>
|
|
174
|
+
{t("translations.completion.toTranslate")}
|
|
175
|
+
</Text>
|
|
176
|
+
<Text size="small" weight="plus">
|
|
177
|
+
{locale.toTranslate}
|
|
178
|
+
</Text>
|
|
247
179
|
</div>
|
|
248
180
|
</div>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
})}
|
|
252
|
-
</div>
|
|
253
|
-
{localeStatsCount < 9 && (
|
|
254
|
-
<div className="flex w-full gap-1">
|
|
255
|
-
{localeStats.map((locale) => (
|
|
181
|
+
}
|
|
182
|
+
>
|
|
256
183
|
<div
|
|
257
|
-
|
|
258
|
-
|
|
184
|
+
className="flex min-w-2 flex-1 cursor-pointer flex-col justify-end overflow-hidden rounded-t-sm transition-opacity"
|
|
185
|
+
style={{ height: `${heightPercent}%` }}
|
|
186
|
+
onMouseEnter={() => setHoveredLocale(locale.code)}
|
|
187
|
+
onMouseLeave={() => setHoveredLocale(null)}
|
|
259
188
|
>
|
|
260
|
-
<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
189
|
+
<div
|
|
190
|
+
className="w-full rounded-t-sm"
|
|
191
|
+
style={{
|
|
192
|
+
height: `${100 - translatedPercent}%`,
|
|
193
|
+
backgroundColor: "var(--bg-interactive)",
|
|
194
|
+
opacity: 0.3,
|
|
195
|
+
minHeight: locale.toTranslate > 0 ? "2px" : "0",
|
|
196
|
+
}}
|
|
197
|
+
/>
|
|
198
|
+
{translatedPercent > 0 && (
|
|
199
|
+
<div
|
|
200
|
+
className="mt-0.5 w-full rounded-sm"
|
|
201
|
+
style={{
|
|
202
|
+
height: `${translatedPercent}%`,
|
|
203
|
+
backgroundColor: "var(--bg-interactive)",
|
|
204
|
+
minHeight: locale.translated > 0 ? "2px" : "0",
|
|
205
|
+
}}
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
267
208
|
</div>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
)}
|
|
271
|
-
{localeStatsCount > 9 && (
|
|
272
|
-
<Text
|
|
273
|
-
weight="plus"
|
|
274
|
-
size="xsmall"
|
|
275
|
-
className="text-ui-fg-subtle text-center"
|
|
276
|
-
>
|
|
277
|
-
{t("translations.completion.footer")}
|
|
278
|
-
</Text>
|
|
279
|
-
)}
|
|
209
|
+
</Tooltip>
|
|
210
|
+
)
|
|
211
|
+
})}
|
|
280
212
|
</div>
|
|
281
|
-
|
|
213
|
+
<Text
|
|
214
|
+
size="small"
|
|
215
|
+
weight="plus"
|
|
216
|
+
className="text-ui-fg-muted text-center"
|
|
217
|
+
>
|
|
218
|
+
{t("translations.completion.footer")}
|
|
219
|
+
</Text>
|
|
220
|
+
</div>
|
|
282
221
|
)}
|
|
283
222
|
</Container>
|
|
284
223
|
)
|