@mercurjs/vendor 2.2.0-canary.11 → 2.2.0-canary.12
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/{[id]-B4YZTANM.js → [id]-OWENEUQB.js} +58 -43
- package/dist/{[id]-EKLRGVBA.js → [id]-Q4HX3TQU.js} +3 -3
- package/dist/{[id]-U5KZEQDR.js → [id]-WDBUNEJB.js} +2 -2
- package/dist/{add-promotions-3AYXQXTP.js → add-promotions-DH5CD5AT.js} +3 -3
- package/dist/{chunk-LDZCCWJB.js → chunk-23LX6FBE.js} +1 -1
- package/dist/{chunk-FWS4YJ4B.js → chunk-2UXFGPKI.js} +1 -1
- package/dist/{chunk-XP23ZVQT.js → chunk-55OUOPNF.js} +2 -2
- package/dist/{chunk-YGJCJBPM.js → chunk-7DBAV3KH.js} +1 -1
- package/dist/{chunk-25E4KME5.js → chunk-CBRAKSMA.js} +1 -1
- package/dist/{chunk-OYKUQXJX.js → chunk-N77NE6O7.js} +13 -8
- package/dist/{chunk-GN6KB75Z.js → chunk-TM76WRG2.js} +1 -1
- package/dist/{create-7R6CZU53.js → create-WBZJFMA7.js} +12 -3
- package/dist/{create-HVZYJ3YC.js → create-XEQZ6CLI.js} +4 -4
- package/dist/{edit-4G5D7TES.js → edit-2AAEQJEM.js} +2 -2
- package/dist/index.css +0 -3
- package/dist/index.js +19 -19
- package/dist/{media-Z4N5MKFG.js → media-LVQQTWOJ.js} +3 -3
- package/dist/pages/index.js +7 -7
- package/dist/{product-variant-edit-WZNO4CQX.js → product-variant-edit-GACQHD46.js} +9 -20
- package/dist/{products-CPTRYL2Z.js → products-6XWNKRLZ.js} +4 -4
- package/dist/{promotions-4336KI7E.js → promotions-ACIFBWUH.js} +4 -4
- package/dist/{register-OZ5CRANZ.js → register-4AQP5DC3.js} +1 -1
- package/dist/{reset-password-5UHZU4D3.js → reset-password-VSAY3YQX.js} +1 -1
- package/dist/{shipping-profile-ZP7M6VSS.js → shipping-profile-3QKTQI6L.js} +2 -6
- package/package.json +1 -1
|
@@ -325,28 +325,57 @@ var VariantUpdateBlock = ({
|
|
|
325
325
|
}) => {
|
|
326
326
|
const { t } = useTranslation();
|
|
327
327
|
const found = variantsById.get(variantId);
|
|
328
|
-
const
|
|
328
|
+
const variantFallback = t("fields.variant", { defaultValue: "Variant" });
|
|
329
|
+
const title = found?.title || found?.sku || variantId || variantFallback;
|
|
330
|
+
const sku = found?.sku && title !== found.sku ? found.sku : void 0;
|
|
329
331
|
const images = isImageList(found?.images) ? found?.images : void 0;
|
|
330
|
-
return /* @__PURE__ */ jsxs(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
332
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
333
|
+
/* @__PURE__ */ jsxs(
|
|
334
|
+
"div",
|
|
335
|
+
{
|
|
336
|
+
className: "flex items-start gap-4 px-6 py-4",
|
|
337
|
+
"data-testid": `product-active-edit-variant-${variantId}`,
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ jsx(
|
|
340
|
+
Text,
|
|
341
|
+
{
|
|
342
|
+
size: "small",
|
|
343
|
+
weight: "plus",
|
|
344
|
+
leading: "compact",
|
|
345
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
346
|
+
children: variantFallback
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
|
|
350
|
+
images && images.length > 0 && /* @__PURE__ */ jsx(ImageStrip, { images }),
|
|
351
|
+
/* @__PURE__ */ jsx(
|
|
352
|
+
Text,
|
|
353
|
+
{
|
|
354
|
+
size: "small",
|
|
355
|
+
leading: "compact",
|
|
356
|
+
className: "text-ui-fg-base font-medium",
|
|
357
|
+
children: title
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
sku && /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: `\xB7 ${sku}` })
|
|
344
361
|
] })
|
|
345
|
-
]
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
diffs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
366
|
+
/* @__PURE__ */ jsx(
|
|
367
|
+
Text,
|
|
368
|
+
{
|
|
369
|
+
size: "small",
|
|
370
|
+
weight: "plus",
|
|
371
|
+
leading: "compact",
|
|
372
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
373
|
+
children: t("labels.updated")
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
|
|
377
|
+
] })
|
|
378
|
+
] });
|
|
350
379
|
};
|
|
351
380
|
var ProductActiveEditSection = ({
|
|
352
381
|
product
|
|
@@ -449,29 +478,15 @@ var ProductActiveEditSection = ({
|
|
|
449
478
|
),
|
|
450
479
|
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: productUpdated.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${diff.field}-${idx}`)) })
|
|
451
480
|
] }),
|
|
452
|
-
variantsUpdated.size > 0 && /* @__PURE__ */
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
),
|
|
463
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-6", children: Array.from(variantsUpdated.entries()).map(
|
|
464
|
-
([variantId, diffs]) => /* @__PURE__ */ jsx(
|
|
465
|
-
VariantUpdateBlock,
|
|
466
|
-
{
|
|
467
|
-
variantId,
|
|
468
|
-
diffs,
|
|
469
|
-
variantsById
|
|
470
|
-
},
|
|
471
|
-
variantId
|
|
472
|
-
)
|
|
473
|
-
) })
|
|
474
|
-
] }),
|
|
481
|
+
variantsUpdated.size > 0 && Array.from(variantsUpdated.entries()).map(([variantId, diffs]) => /* @__PURE__ */ jsx(
|
|
482
|
+
VariantUpdateBlock,
|
|
483
|
+
{
|
|
484
|
+
variantId,
|
|
485
|
+
diffs,
|
|
486
|
+
variantsById
|
|
487
|
+
},
|
|
488
|
+
variantId
|
|
489
|
+
)),
|
|
475
490
|
added.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
476
491
|
/* @__PURE__ */ jsx(
|
|
477
492
|
Text,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
usePromotionTableColumns,
|
|
9
9
|
usePromotionTableQuery
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-7DBAV3KH.js";
|
|
11
|
+
import "./chunk-2UXFGPKI.js";
|
|
12
12
|
import "./chunk-JHIMVLB2.js";
|
|
13
13
|
import {
|
|
14
14
|
usePromotionTableFilters
|
|
@@ -27,7 +27,7 @@ import "./chunk-3EF54XFY.js";
|
|
|
27
27
|
import {
|
|
28
28
|
currencies
|
|
29
29
|
} from "./chunk-IQPN4PZJ.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-N77NE6O7.js";
|
|
31
31
|
import {
|
|
32
32
|
TwoColumnPage
|
|
33
33
|
} from "./chunk-YV6MK4PZ.js";
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-BWGPN6XV.js";
|
|
7
7
|
import {
|
|
8
8
|
StatusCell
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2UXFGPKI.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import {
|
|
13
13
|
NoRecords
|
|
14
14
|
} from "./chunk-3EF54XFY.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-N77NE6O7.js";
|
|
16
16
|
import {
|
|
17
17
|
TwoColumnPage
|
|
18
18
|
} from "./chunk-YV6MK4PZ.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-7DBAV3KH.js";
|
|
5
|
+
import "./chunk-2UXFGPKI.js";
|
|
6
6
|
import "./chunk-JHIMVLB2.js";
|
|
7
7
|
import {
|
|
8
8
|
usePromotionTableFilters
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import "./chunk-YN3FGNJM.js";
|
|
19
19
|
import "./chunk-6OUPJNYO.js";
|
|
20
20
|
import "./chunk-3EF54XFY.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-N77NE6O7.js";
|
|
22
22
|
import "./chunk-TKGWSUEI.js";
|
|
23
23
|
import {
|
|
24
24
|
KeyboundForm
|
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
} from "./chunk-OVPAOBZB.js";
|
|
20
20
|
import {
|
|
21
21
|
UploadMediaFormItem
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TM76WRG2.js";
|
|
23
23
|
import {
|
|
24
24
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
25
25
|
ProductCreateSchema,
|
|
26
26
|
decorateVariantsWithDefaultValues,
|
|
27
27
|
generateVariantsFromAttributes,
|
|
28
28
|
normalizeProductFormValues
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-23LX6FBE.js";
|
|
30
30
|
import {
|
|
31
31
|
ChipInput
|
|
32
32
|
} from "./chunk-YGRTRAWX.js";
|
|
@@ -9258,7 +9258,7 @@ var en_default = {
|
|
|
9258
9258
|
header: "Edit Product",
|
|
9259
9259
|
description: "Edit the product details.",
|
|
9260
9260
|
successToast: "Product {{title}} was successfully updated.",
|
|
9261
|
-
requestSuccessToast: "Product update
|
|
9261
|
+
requestSuccessToast: "Product update was successfully requested. Once confirmed by the Admin, changes will appear on the storefront.",
|
|
9262
9262
|
duplicateRequestErrorToast: "You already have an active request. You can only have one at a time.",
|
|
9263
9263
|
attributes: {
|
|
9264
9264
|
addAttribute: "Add Attribute",
|
|
@@ -9285,7 +9285,7 @@ var en_default = {
|
|
|
9285
9285
|
cancelDescription: "Are you sure you want to cancel this product update request? This action cannot be undone."
|
|
9286
9286
|
},
|
|
9287
9287
|
toast: {
|
|
9288
|
-
canceledSuccessfully: "Product update request canceled"
|
|
9288
|
+
canceledSuccessfully: "Product update request was successfully canceled."
|
|
9289
9289
|
}
|
|
9290
9290
|
},
|
|
9291
9291
|
create: {
|
|
@@ -9634,9 +9634,14 @@ var en_default = {
|
|
|
9634
9634
|
}
|
|
9635
9635
|
},
|
|
9636
9636
|
variant: {
|
|
9637
|
+
validation: {
|
|
9638
|
+
titleRequired: "Please enter a title",
|
|
9639
|
+
optionRequired: "Please select a value"
|
|
9640
|
+
},
|
|
9637
9641
|
edit: {
|
|
9638
9642
|
header: "Edit Variant",
|
|
9639
|
-
success: "Product variant edited successfully"
|
|
9643
|
+
success: "Product variant edited successfully",
|
|
9644
|
+
attributesTooltip: "These are default values used to describe the item. They are not defined by Marketplace."
|
|
9640
9645
|
},
|
|
9641
9646
|
create: {
|
|
9642
9647
|
header: "Variant details"
|
|
@@ -9677,7 +9682,7 @@ var en_default = {
|
|
|
9677
9682
|
edit: {
|
|
9678
9683
|
header: "Shipping Configuration",
|
|
9679
9684
|
toasts: {
|
|
9680
|
-
success: "
|
|
9685
|
+
success: "Shipping configuration was successfully updated."
|
|
9681
9686
|
}
|
|
9682
9687
|
},
|
|
9683
9688
|
create: {
|
|
@@ -9866,7 +9871,7 @@ var en_default = {
|
|
|
9866
9871
|
subtitle: "Manage your catalog listings",
|
|
9867
9872
|
create: {
|
|
9868
9873
|
header: "Create offer",
|
|
9869
|
-
successToast: "Offer
|
|
9874
|
+
successToast: "Offer was successfully published. Only offers with stock levels and prices set will be visible on the storefront.",
|
|
9870
9875
|
publish: "Publish",
|
|
9871
9876
|
tip: "Select all relevant products that match your inventory, then easily create offers for them by simply adding your stock levels and prices.",
|
|
9872
9877
|
addPrice: "Add price",
|
|
@@ -9893,18 +9898,18 @@ var en_default = {
|
|
|
9893
9898
|
pricing: {
|
|
9894
9899
|
header: "Manage prices",
|
|
9895
9900
|
description: "Add, change, or remove prices on this offer's ladder.",
|
|
9896
|
-
successToast: "Prices updated",
|
|
9901
|
+
successToast: "Prices were successfully updated.",
|
|
9897
9902
|
empty: "No prices configured"
|
|
9898
9903
|
},
|
|
9899
9904
|
inventory: {
|
|
9900
9905
|
header: "Manage inventory items",
|
|
9901
9906
|
description: "Attach, detach, or change the required quantity per item.",
|
|
9902
|
-
successToast: "
|
|
9907
|
+
successToast: "Stock levels were successfully updated.",
|
|
9903
9908
|
empty: "No inventory items attached"
|
|
9904
9909
|
},
|
|
9905
9910
|
delete: {
|
|
9906
9911
|
description: "You are about to delete offer {{sku}}. This cannot be undone.",
|
|
9907
|
-
successToast: "Offer deleted"
|
|
9912
|
+
successToast: "Offer was successfully deleted."
|
|
9908
9913
|
},
|
|
9909
9914
|
bulkDelete: {
|
|
9910
9915
|
description_one: "You are about to delete {{count}} offer. This cannot be undone.",
|
|
@@ -46,11 +46,12 @@ import { Children, useMemo } from "react";
|
|
|
46
46
|
import { useForm } from "react-hook-form";
|
|
47
47
|
|
|
48
48
|
// src/pages/products/[id]/variants/create/create-product-variant-form/constants.ts
|
|
49
|
+
import i18next from "i18next";
|
|
49
50
|
import { z } from "zod";
|
|
50
51
|
var CreateProductVariantSchema = z.object({
|
|
51
|
-
title: z.string().min(1),
|
|
52
|
+
title: z.string().min(1, i18next.t("products.variant.validation.titleRequired")),
|
|
52
53
|
sku: z.string().optional(),
|
|
53
|
-
options: z.record(z.string()).optional()
|
|
54
|
+
options: z.record(z.string().min(1, i18next.t("products.variant.validation.optionRequired"))).optional()
|
|
54
55
|
});
|
|
55
56
|
var CreateVariantDetailsSchema = CreateProductVariantSchema.pick({
|
|
56
57
|
title: true,
|
|
@@ -154,15 +155,23 @@ var CreateProductVariantForm = ({
|
|
|
154
155
|
defaultValues: extraDefaults
|
|
155
156
|
}) => {
|
|
156
157
|
const { handleSuccess } = useRouteModal();
|
|
158
|
+
const variantAttributes = product.attributes?.filter((a) => a.is_variant_axis) ?? [];
|
|
159
|
+
const defaultOptions = variantAttributes.reduce(
|
|
160
|
+
(acc, attribute) => {
|
|
161
|
+
acc[attribute.handle ?? attribute.id] = "";
|
|
162
|
+
return acc;
|
|
163
|
+
},
|
|
164
|
+
{}
|
|
165
|
+
);
|
|
157
166
|
const form = useForm({
|
|
158
167
|
defaultValues: {
|
|
159
168
|
...CREATE_VARIANT_DEFAULTS,
|
|
169
|
+
options: defaultOptions,
|
|
160
170
|
...extraDefaults
|
|
161
171
|
},
|
|
162
172
|
resolver: zodResolver(schema ?? CreateProductVariantSchema)
|
|
163
173
|
});
|
|
164
174
|
const { mutateAsync, isPending } = useCreateProductVariant(product.id);
|
|
165
|
-
const variantAttributes = product.attributes?.filter((a) => a.is_variant_axis) ?? [];
|
|
166
175
|
const handleSubmit = form.handleSubmit(async (data) => {
|
|
167
176
|
const { title, options } = data;
|
|
168
177
|
const cleanedOptions = variantAttributes.reduce(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProductCreate,
|
|
3
3
|
ProductCreatePage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-55OUOPNF.js";
|
|
5
5
|
import "./chunk-4LVP635F.js";
|
|
6
6
|
import "./chunk-HJ56YXBU.js";
|
|
7
7
|
import "./chunk-LEWA4BPH.js";
|
|
@@ -9,20 +9,20 @@ import "./chunk-IQPN4PZJ.js";
|
|
|
9
9
|
import "./chunk-YVCBMOJG.js";
|
|
10
10
|
import "./chunk-GAE6TKOR.js";
|
|
11
11
|
import "./chunk-OVPAOBZB.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-TM76WRG2.js";
|
|
13
13
|
import {
|
|
14
14
|
EditProductMediaSchema,
|
|
15
15
|
MediaSchema,
|
|
16
16
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
17
17
|
ProductCreateSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-23LX6FBE.js";
|
|
19
19
|
import "./chunk-AJLGY3LQ.js";
|
|
20
20
|
import "./chunk-SMQT3ZNO.js";
|
|
21
21
|
import "./chunk-YGRTRAWX.js";
|
|
22
22
|
import "./chunk-HDEOZN2Q.js";
|
|
23
23
|
import "./chunk-VBRTC2VU.js";
|
|
24
24
|
import "./chunk-LQD232FW.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-N77NE6O7.js";
|
|
26
26
|
import "./chunk-TKGWSUEI.js";
|
|
27
27
|
import "./chunk-U2ZFCAPX.js";
|
|
28
28
|
import "./chunk-GDWBOQI5.js";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
FileUpload,
|
|
9
9
|
MediaSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-23LX6FBE.js";
|
|
11
11
|
import "./chunk-AJLGY3LQ.js";
|
|
12
12
|
import "./chunk-SMQT3ZNO.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-N77NE6O7.js";
|
|
14
14
|
import "./chunk-TKGWSUEI.js";
|
|
15
15
|
import {
|
|
16
16
|
KeyboundForm
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-LQD232FW.js";
|
|
9
9
|
import {
|
|
10
10
|
I18n
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-N77NE6O7.js";
|
|
12
12
|
import "./chunk-TKGWSUEI.js";
|
|
13
13
|
import "./chunk-U2ZFCAPX.js";
|
|
14
14
|
import "./chunk-GDWBOQI5.js";
|
|
@@ -2903,7 +2903,7 @@ function getRouteMap({
|
|
|
2903
2903
|
{
|
|
2904
2904
|
path: "",
|
|
2905
2905
|
lazy: async () => {
|
|
2906
|
-
const { ProductListPage } = await import("./products-
|
|
2906
|
+
const { ProductListPage } = await import("./products-6XWNKRLZ.js");
|
|
2907
2907
|
return {
|
|
2908
2908
|
Component: ProductListPage
|
|
2909
2909
|
};
|
|
@@ -2912,7 +2912,7 @@ function getRouteMap({
|
|
|
2912
2912
|
{
|
|
2913
2913
|
path: "create",
|
|
2914
2914
|
lazy: async () => {
|
|
2915
|
-
const { ProductCreatePage } = await import("./create-
|
|
2915
|
+
const { ProductCreatePage } = await import("./create-XEQZ6CLI.js");
|
|
2916
2916
|
return {
|
|
2917
2917
|
Component: ProductCreatePage
|
|
2918
2918
|
};
|
|
@@ -2923,7 +2923,7 @@ function getRouteMap({
|
|
|
2923
2923
|
{
|
|
2924
2924
|
path: ":id",
|
|
2925
2925
|
lazy: async () => {
|
|
2926
|
-
const { loader } = await import("./[id]-
|
|
2926
|
+
const { loader } = await import("./[id]-OWENEUQB.js");
|
|
2927
2927
|
const { Breadcrumb } = await import("./breadcrumb-FPWBT76A.js");
|
|
2928
2928
|
return {
|
|
2929
2929
|
Component: Outlet4,
|
|
@@ -2937,7 +2937,7 @@ function getRouteMap({
|
|
|
2937
2937
|
{
|
|
2938
2938
|
path: "",
|
|
2939
2939
|
lazy: async () => {
|
|
2940
|
-
const { ProductDetailPage } = await import("./[id]-
|
|
2940
|
+
const { ProductDetailPage } = await import("./[id]-OWENEUQB.js");
|
|
2941
2941
|
return {
|
|
2942
2942
|
Component: ProductDetailPage
|
|
2943
2943
|
};
|
|
@@ -2949,7 +2949,7 @@ function getRouteMap({
|
|
|
2949
2949
|
},
|
|
2950
2950
|
{
|
|
2951
2951
|
path: "edit-variant",
|
|
2952
|
-
lazy: () => import("./product-variant-edit-
|
|
2952
|
+
lazy: () => import("./product-variant-edit-GACQHD46.js")
|
|
2953
2953
|
},
|
|
2954
2954
|
{
|
|
2955
2955
|
path: "sales-channels",
|
|
@@ -2961,7 +2961,7 @@ function getRouteMap({
|
|
|
2961
2961
|
},
|
|
2962
2962
|
{
|
|
2963
2963
|
path: "media",
|
|
2964
|
-
lazy: () => import("./media-
|
|
2964
|
+
lazy: () => import("./media-LVQQTWOJ.js")
|
|
2965
2965
|
},
|
|
2966
2966
|
{
|
|
2967
2967
|
path: "attributes",
|
|
@@ -2985,11 +2985,11 @@ function getRouteMap({
|
|
|
2985
2985
|
},
|
|
2986
2986
|
{
|
|
2987
2987
|
path: "shipping-profile",
|
|
2988
|
-
lazy: () => import("./shipping-profile-
|
|
2988
|
+
lazy: () => import("./shipping-profile-3QKTQI6L.js")
|
|
2989
2989
|
},
|
|
2990
2990
|
{
|
|
2991
2991
|
path: "variants/create",
|
|
2992
|
-
lazy: () => import("./create-
|
|
2992
|
+
lazy: () => import("./create-WBZJFMA7.js")
|
|
2993
2993
|
}
|
|
2994
2994
|
]
|
|
2995
2995
|
}
|
|
@@ -3425,7 +3425,7 @@ function getRouteMap({
|
|
|
3425
3425
|
{
|
|
3426
3426
|
path: "",
|
|
3427
3427
|
lazy: async () => {
|
|
3428
|
-
const { PromotionListPage } = await import("./promotions-
|
|
3428
|
+
const { PromotionListPage } = await import("./promotions-ACIFBWUH.js");
|
|
3429
3429
|
return {
|
|
3430
3430
|
Component: PromotionListPage
|
|
3431
3431
|
};
|
|
@@ -3440,7 +3440,7 @@ function getRouteMap({
|
|
|
3440
3440
|
{
|
|
3441
3441
|
path: ":id",
|
|
3442
3442
|
lazy: async () => {
|
|
3443
|
-
const { loader } = await import("./[id]-
|
|
3443
|
+
const { loader } = await import("./[id]-WDBUNEJB.js");
|
|
3444
3444
|
const { Breadcrumb } = await import("./breadcrumb-UAUX7XCV.js");
|
|
3445
3445
|
return {
|
|
3446
3446
|
Component: Outlet4,
|
|
@@ -3454,7 +3454,7 @@ function getRouteMap({
|
|
|
3454
3454
|
{
|
|
3455
3455
|
path: "",
|
|
3456
3456
|
lazy: async () => {
|
|
3457
|
-
const { PromotionDetailPage } = await import("./[id]-
|
|
3457
|
+
const { PromotionDetailPage } = await import("./[id]-WDBUNEJB.js");
|
|
3458
3458
|
return {
|
|
3459
3459
|
Component: PromotionDetailPage
|
|
3460
3460
|
};
|
|
@@ -3502,7 +3502,7 @@ function getRouteMap({
|
|
|
3502
3502
|
{
|
|
3503
3503
|
path: ":id",
|
|
3504
3504
|
lazy: async () => {
|
|
3505
|
-
const { loader } = await import("./[id]-
|
|
3505
|
+
const { loader } = await import("./[id]-Q4HX3TQU.js");
|
|
3506
3506
|
const { Breadcrumb } = await import("./breadcrumb-F3BN5753.js");
|
|
3507
3507
|
return {
|
|
3508
3508
|
Component: Outlet4,
|
|
@@ -3516,7 +3516,7 @@ function getRouteMap({
|
|
|
3516
3516
|
{
|
|
3517
3517
|
path: "",
|
|
3518
3518
|
lazy: async () => {
|
|
3519
|
-
const { CampaignDetailPage } = await import("./[id]-
|
|
3519
|
+
const { CampaignDetailPage } = await import("./[id]-Q4HX3TQU.js");
|
|
3520
3520
|
return {
|
|
3521
3521
|
Component: CampaignDetailPage
|
|
3522
3522
|
};
|
|
@@ -3537,7 +3537,7 @@ function getRouteMap({
|
|
|
3537
3537
|
{
|
|
3538
3538
|
path: "add-promotions",
|
|
3539
3539
|
lazy: async () => {
|
|
3540
|
-
const { AddPromotionsPage } = await import("./add-promotions-
|
|
3540
|
+
const { AddPromotionsPage } = await import("./add-promotions-DH5CD5AT.js");
|
|
3541
3541
|
return {
|
|
3542
3542
|
Component: AddPromotionsPage
|
|
3543
3543
|
};
|
|
@@ -3638,7 +3638,7 @@ function getRouteMap({
|
|
|
3638
3638
|
children: [
|
|
3639
3639
|
{
|
|
3640
3640
|
path: "edit",
|
|
3641
|
-
lazy: () => import("./product-variant-edit-
|
|
3641
|
+
lazy: () => import("./product-variant-edit-GACQHD46.js")
|
|
3642
3642
|
}
|
|
3643
3643
|
]
|
|
3644
3644
|
}
|
|
@@ -3708,7 +3708,7 @@ function getRouteMap({
|
|
|
3708
3708
|
children: [
|
|
3709
3709
|
{
|
|
3710
3710
|
path: "edit",
|
|
3711
|
-
lazy: () => import("./edit-
|
|
3711
|
+
lazy: () => import("./edit-2AAEQJEM.js")
|
|
3712
3712
|
},
|
|
3713
3713
|
{
|
|
3714
3714
|
path: "address",
|
|
@@ -4121,12 +4121,12 @@ function getRouteMap({
|
|
|
4121
4121
|
},
|
|
4122
4122
|
{
|
|
4123
4123
|
path: "/reset-password",
|
|
4124
|
-
lazy: () => import("./reset-password-
|
|
4124
|
+
lazy: () => import("./reset-password-VSAY3YQX.js")
|
|
4125
4125
|
},
|
|
4126
4126
|
{
|
|
4127
4127
|
path: "/register",
|
|
4128
4128
|
lazy: async () => {
|
|
4129
|
-
const { RegisterPage } = await import("./register-
|
|
4129
|
+
const { RegisterPage } = await import("./register-4AQP5DC3.js");
|
|
4130
4130
|
return { Component: RegisterPage };
|
|
4131
4131
|
}
|
|
4132
4132
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UploadMediaFormItem
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TM76WRG2.js";
|
|
4
4
|
import {
|
|
5
5
|
EditProductMediaSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-23LX6FBE.js";
|
|
7
7
|
import "./chunk-AJLGY3LQ.js";
|
|
8
8
|
import "./chunk-SMQT3ZNO.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-N77NE6O7.js";
|
|
10
10
|
import "./chunk-TKGWSUEI.js";
|
|
11
11
|
import {
|
|
12
12
|
KeyboundForm
|
package/dist/pages/index.js
CHANGED
|
@@ -36,9 +36,9 @@ import {
|
|
|
36
36
|
import "../chunk-7TIZP4YG.js";
|
|
37
37
|
import {
|
|
38
38
|
PromotionListPage
|
|
39
|
-
} from "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
39
|
+
} from "../chunk-CBRAKSMA.js";
|
|
40
|
+
import "../chunk-7DBAV3KH.js";
|
|
41
|
+
import "../chunk-2UXFGPKI.js";
|
|
42
42
|
import {
|
|
43
43
|
InventoryListPage
|
|
44
44
|
} from "../chunk-DQKK43PR.js";
|
|
@@ -115,7 +115,7 @@ import "../chunk-3EF54XFY.js";
|
|
|
115
115
|
import {
|
|
116
116
|
ProductCreate,
|
|
117
117
|
ProductCreatePage
|
|
118
|
-
} from "../chunk-
|
|
118
|
+
} from "../chunk-55OUOPNF.js";
|
|
119
119
|
import "../chunk-4LVP635F.js";
|
|
120
120
|
import "../chunk-HJ56YXBU.js";
|
|
121
121
|
import "../chunk-LEWA4BPH.js";
|
|
@@ -123,20 +123,20 @@ import "../chunk-IQPN4PZJ.js";
|
|
|
123
123
|
import "../chunk-YVCBMOJG.js";
|
|
124
124
|
import "../chunk-GAE6TKOR.js";
|
|
125
125
|
import "../chunk-OVPAOBZB.js";
|
|
126
|
-
import "../chunk-
|
|
126
|
+
import "../chunk-TM76WRG2.js";
|
|
127
127
|
import {
|
|
128
128
|
EditProductMediaSchema,
|
|
129
129
|
MediaSchema,
|
|
130
130
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
131
131
|
ProductCreateSchema
|
|
132
|
-
} from "../chunk-
|
|
132
|
+
} from "../chunk-23LX6FBE.js";
|
|
133
133
|
import "../chunk-AJLGY3LQ.js";
|
|
134
134
|
import "../chunk-SMQT3ZNO.js";
|
|
135
135
|
import "../chunk-YGRTRAWX.js";
|
|
136
136
|
import "../chunk-HDEOZN2Q.js";
|
|
137
137
|
import "../chunk-VBRTC2VU.js";
|
|
138
138
|
import "../chunk-LQD232FW.js";
|
|
139
|
-
import "../chunk-
|
|
139
|
+
import "../chunk-N77NE6O7.js";
|
|
140
140
|
import "../chunk-TKGWSUEI.js";
|
|
141
141
|
import "../chunk-U2ZFCAPX.js";
|
|
142
142
|
import "../chunk-GDWBOQI5.js";
|
|
@@ -55,14 +55,15 @@ import { useLoaderData, useParams, useSearchParams } from "react-router-dom";
|
|
|
55
55
|
// src/pages/product-variants/product-variant-edit/components/product-edit-variant-form/product-edit-variant-form.tsx
|
|
56
56
|
var import_types = __toESM(require_dist(), 1);
|
|
57
57
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
58
|
-
import {
|
|
58
|
+
import { InformationCircleSolid } from "@medusajs/icons";
|
|
59
|
+
import { Button, Divider, Heading, Input, Tooltip, toast } from "@medusajs/ui";
|
|
60
|
+
import i18next from "i18next";
|
|
59
61
|
import { useForm } from "react-hook-form";
|
|
60
62
|
import { useTranslation } from "react-i18next";
|
|
61
63
|
import { z } from "zod";
|
|
62
64
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
63
65
|
var ProductEditVariantSchema = z.object({
|
|
64
|
-
title: z.string().min(1),
|
|
65
|
-
material: z.string().optional(),
|
|
66
|
+
title: z.string().min(1, i18next.t("products.variant.validation.titleRequired")),
|
|
66
67
|
sku: z.string().optional(),
|
|
67
68
|
ean: z.string().optional(),
|
|
68
69
|
upc: z.string().optional(),
|
|
@@ -74,7 +75,7 @@ var ProductEditVariantSchema = z.object({
|
|
|
74
75
|
mid_code: z.string().optional(),
|
|
75
76
|
hs_code: z.string().optional(),
|
|
76
77
|
origin_country: z.string().optional(),
|
|
77
|
-
options: z.record(z.string()).optional()
|
|
78
|
+
options: z.record(z.string().min(1, i18next.t("products.variant.validation.optionRequired"))).optional()
|
|
78
79
|
});
|
|
79
80
|
var ProductEditVariantForm = ({
|
|
80
81
|
variant,
|
|
@@ -97,7 +98,6 @@ var ProductEditVariantForm = ({
|
|
|
97
98
|
const form = useForm({
|
|
98
99
|
defaultValues: {
|
|
99
100
|
title: variant.title || "",
|
|
100
|
-
material: variant.material || "",
|
|
101
101
|
sku: variant.sku || "",
|
|
102
102
|
ean: variant.ean || "",
|
|
103
103
|
upc: variant.upc || "",
|
|
@@ -180,20 +180,6 @@ var ProductEditVariantForm = ({
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
),
|
|
183
|
-
/* @__PURE__ */ jsx(
|
|
184
|
-
Form.Field,
|
|
185
|
-
{
|
|
186
|
-
control: form.control,
|
|
187
|
-
name: "material",
|
|
188
|
-
render: ({ field }) => {
|
|
189
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
190
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.material") }),
|
|
191
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
192
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
193
|
-
] });
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
),
|
|
197
183
|
variantAttributes.map((attribute) => {
|
|
198
184
|
const fieldKey = attribute.handle ?? attribute.id;
|
|
199
185
|
return /* @__PURE__ */ jsx(
|
|
@@ -287,7 +273,10 @@ var ProductEditVariantForm = ({
|
|
|
287
273
|
] }) }),
|
|
288
274
|
/* @__PURE__ */ jsx(Divider, {}),
|
|
289
275
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
290
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
|
|
277
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("products.attributes") }),
|
|
278
|
+
/* @__PURE__ */ jsx(Tooltip, { content: t("products.variant.edit.attributesTooltip"), children: /* @__PURE__ */ jsx(InformationCircleSolid, { className: "text-ui-fg-muted" }) })
|
|
279
|
+
] }),
|
|
291
280
|
/* @__PURE__ */ jsx(
|
|
292
281
|
Form.Field,
|
|
293
282
|
{
|
|
@@ -16,7 +16,7 @@ import "./chunk-3EF54XFY.js";
|
|
|
16
16
|
import {
|
|
17
17
|
ProductCreate,
|
|
18
18
|
ProductCreatePage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-55OUOPNF.js";
|
|
20
20
|
import "./chunk-4LVP635F.js";
|
|
21
21
|
import "./chunk-HJ56YXBU.js";
|
|
22
22
|
import "./chunk-LEWA4BPH.js";
|
|
@@ -24,20 +24,20 @@ import "./chunk-IQPN4PZJ.js";
|
|
|
24
24
|
import "./chunk-YVCBMOJG.js";
|
|
25
25
|
import "./chunk-GAE6TKOR.js";
|
|
26
26
|
import "./chunk-OVPAOBZB.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-TM76WRG2.js";
|
|
28
28
|
import {
|
|
29
29
|
EditProductMediaSchema,
|
|
30
30
|
MediaSchema,
|
|
31
31
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
32
32
|
ProductCreateSchema
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-23LX6FBE.js";
|
|
34
34
|
import "./chunk-AJLGY3LQ.js";
|
|
35
35
|
import "./chunk-SMQT3ZNO.js";
|
|
36
36
|
import "./chunk-YGRTRAWX.js";
|
|
37
37
|
import "./chunk-HDEOZN2Q.js";
|
|
38
38
|
import "./chunk-VBRTC2VU.js";
|
|
39
39
|
import "./chunk-LQD232FW.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-N77NE6O7.js";
|
|
41
41
|
import "./chunk-TKGWSUEI.js";
|
|
42
42
|
import "./chunk-U2ZFCAPX.js";
|
|
43
43
|
import "./chunk-GDWBOQI5.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromotionListPage
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CBRAKSMA.js";
|
|
4
|
+
import "./chunk-7DBAV3KH.js";
|
|
5
|
+
import "./chunk-2UXFGPKI.js";
|
|
6
6
|
import "./chunk-JHIMVLB2.js";
|
|
7
7
|
import "./chunk-S2WEYEQR.js";
|
|
8
8
|
import "./chunk-FMFVTERD.js";
|
|
@@ -13,7 +13,7 @@ import "./chunk-SSUUT5LK.js";
|
|
|
13
13
|
import "./chunk-YN3FGNJM.js";
|
|
14
14
|
import "./chunk-6OUPJNYO.js";
|
|
15
15
|
import "./chunk-3EF54XFY.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-N77NE6O7.js";
|
|
17
17
|
import "./chunk-YV6MK4PZ.js";
|
|
18
18
|
import "./chunk-THHRRYRS.js";
|
|
19
19
|
import "./chunk-LRD242C7.js";
|
|
@@ -73,12 +73,8 @@ var ProductShippingProfileForm = ({
|
|
|
73
73
|
shipping_profile_id: data.shipping_profile_id === "" ? null : data.shipping_profile_id
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
onSuccess: (
|
|
77
|
-
toast.success(
|
|
78
|
-
t("products.shippingProfile.edit.toasts.success", {
|
|
79
|
-
title: product2.title
|
|
80
|
-
})
|
|
81
|
-
);
|
|
76
|
+
onSuccess: () => {
|
|
77
|
+
toast.success(t("products.shippingProfile.edit.toasts.success"));
|
|
82
78
|
handleSuccess();
|
|
83
79
|
},
|
|
84
80
|
onError: (error) => {
|