@mercurjs/admin 2.2.0-canary.31 → 2.2.0-canary.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-7VQ4YSDF.js → add-campaign-promotions-7BYQKRUZ.js} +3 -3
- package/dist/{campaign-detail-YEX2W33U.js → campaign-detail-GHOCDVFB.js} +4 -4
- package/dist/{chunk-LPETBANQ.js → chunk-ALWVYVVE.js} +1 -1
- package/dist/{chunk-BVWAWPJO.js → chunk-ESMELONQ.js} +1 -1
- package/dist/{chunk-MHTSIOQS.js → chunk-FDUI5O6O.js} +1 -1
- package/dist/{chunk-KOOVZT22.js → chunk-IY4YSNII.js} +11 -7
- package/dist/{chunk-GFMTZ5O3.js → chunk-M65DM6ZW.js} +1 -0
- package/dist/{chunk-GME72WUF.js → chunk-PPA2GIDD.js} +1 -1
- package/dist/{chunk-3KL4OL3I.js → chunk-Z22L2GBO.js} +1 -1
- package/dist/{chunk-Y7KAW3E7.js → chunk-ZFGT6GRK.js} +1 -1
- package/dist/index.js +15 -15
- package/dist/{order-edit-billing-address-ER7MGZEB.js → order-edit-billing-address-AI2RKKDX.js} +1 -1
- package/dist/pages/index.js +8 -8
- package/dist/{product-create-BJPAN5FR.js → product-create-WMQIZ3SG.js} +3 -3
- package/dist/{product-edit-attribute-VGOXQKZ3.js → product-edit-attribute-P5WL2DXX.js} +44 -53
- package/dist/{product-media-AH6H4HJX.js → product-media-OIXTLFLT.js} +2 -2
- package/dist/{product-organization-CKUJWI3D.js → product-organization-VPVBTBRC.js} +1 -1
- package/dist/{promotion-detail-NFNBZ6YZ.js → promotion-detail-BHTLPDRI.js} +3 -3
- package/dist/{promotion-list-QWALFJWV.js → promotion-list-OSHDGBKU.js} +4 -4
- package/dist/{reset-password-37QWVIGC.js → reset-password-JIIE5WI5.js} +1 -1
- package/dist/{store-edit-G6JFYGXK.js → store-edit-TTJVA3YL.js} +2 -2
- package/dist/{tax-region-create-HUF2FCLU.js → tax-region-create-73QPM3S3.js} +1 -1
- package/package.json +6 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZFGT6GRK.js";
|
|
5
5
|
import {
|
|
6
6
|
usePromotionTableFilters
|
|
7
7
|
} from "./chunk-S2WEYEQR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Z22L2GBO.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-M65DM6ZW.js";
|
|
14
14
|
import "./chunk-TKGWSUEI.js";
|
|
15
15
|
import {
|
|
16
16
|
KeyboundForm
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAMPAIGN_DETAIL_FIELDS,
|
|
3
3
|
CampaignDetailPage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ALWVYVVE.js";
|
|
5
|
+
import "./chunk-ZFGT6GRK.js";
|
|
6
6
|
import "./chunk-S2WEYEQR.js";
|
|
7
7
|
import "./chunk-RK5N3XIX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Z22L2GBO.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-M65DM6ZW.js";
|
|
14
14
|
import "./chunk-IQPN4PZJ.js";
|
|
15
15
|
import "./chunk-E74OUNA3.js";
|
|
16
16
|
import "./chunk-FQERBIVS.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
decorateVariantsWithDefaultValues,
|
|
11
11
|
generateVariantsFromAttributes,
|
|
12
12
|
normalizeProductFormValues
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PPA2GIDD.js";
|
|
14
14
|
import {
|
|
15
15
|
HandleInput
|
|
16
16
|
} from "./chunk-HJ56YXBU.js";
|
|
@@ -91,7 +91,7 @@ import { useTranslation as useTranslation10 } from "react-i18next";
|
|
|
91
91
|
// src/pages/products/product-create/components/product-create-form/product-create-form.tsx
|
|
92
92
|
import { Button as Button3, toast } from "@medusajs/ui";
|
|
93
93
|
import { useEffect as useEffect3, useMemo as useMemo4, Children } from "react";
|
|
94
|
-
import { useForm, useWatch as
|
|
94
|
+
import { useForm, useWatch as useWatch4 } from "react-hook-form";
|
|
95
95
|
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
96
96
|
|
|
97
97
|
// src/pages/products/product-create/components/product-create-attributes-form/product-create-attributes-form.tsx
|
|
@@ -1505,6 +1505,7 @@ var Header = () => {
|
|
|
1505
1505
|
|
|
1506
1506
|
// src/pages/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx
|
|
1507
1507
|
import { Heading as Heading4 } from "@medusajs/ui";
|
|
1508
|
+
import { useWatch as useWatch2 } from "react-hook-form";
|
|
1508
1509
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
1509
1510
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1510
1511
|
var ProductCreateOrganizationSection = () => {
|
|
@@ -1542,7 +1543,10 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1542
1543
|
value: seller.id
|
|
1543
1544
|
}))
|
|
1544
1545
|
});
|
|
1545
|
-
const isGloballyAvailable =
|
|
1546
|
+
const isGloballyAvailable = useWatch2({
|
|
1547
|
+
control: form.control,
|
|
1548
|
+
name: "globally_available"
|
|
1549
|
+
});
|
|
1546
1550
|
return /* @__PURE__ */ jsxs7("div", { id: "organize", className: "flex flex-col gap-y-8", "data-testid": "product-create-organize-section", children: [
|
|
1547
1551
|
/* @__PURE__ */ jsx7(Heading4, { "data-testid": "product-create-organize-section-heading", children: t("products.organization.header") }),
|
|
1548
1552
|
/* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", "data-testid": "product-create-organize-section-category-collection", children: [
|
|
@@ -1734,18 +1738,18 @@ var ProductCreateOrganizeForm = Root3;
|
|
|
1734
1738
|
|
|
1735
1739
|
// src/pages/products/product-create/components/product-create-variants-form/product-create-variants-form.tsx
|
|
1736
1740
|
import { useMemo as useMemo3 } from "react";
|
|
1737
|
-
import { useWatch as
|
|
1741
|
+
import { useWatch as useWatch3 } from "react-hook-form";
|
|
1738
1742
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
1739
1743
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1740
1744
|
var Root4 = () => {
|
|
1741
1745
|
const form = useTabbedForm();
|
|
1742
1746
|
const { setCloseOnEscape } = useRouteModal();
|
|
1743
|
-
const variants =
|
|
1747
|
+
const variants = useWatch3({
|
|
1744
1748
|
control: form.control,
|
|
1745
1749
|
name: "variants",
|
|
1746
1750
|
defaultValue: []
|
|
1747
1751
|
});
|
|
1748
|
-
const watchedAttributes =
|
|
1752
|
+
const watchedAttributes = useWatch3({
|
|
1749
1753
|
control: form.control,
|
|
1750
1754
|
name: "attributes",
|
|
1751
1755
|
defaultValue: []
|
|
@@ -1870,7 +1874,7 @@ var ProductCreateForm = ({
|
|
|
1870
1874
|
{}
|
|
1871
1875
|
);
|
|
1872
1876
|
}, [regions]);
|
|
1873
|
-
const watchedAttributes =
|
|
1877
|
+
const watchedAttributes = useWatch4({
|
|
1874
1878
|
control: form.control,
|
|
1875
1879
|
name: "attributes"
|
|
1876
1880
|
});
|
|
@@ -9285,6 +9285,7 @@ var en_default = {
|
|
|
9285
9285
|
useForVariantsDescription: "If checked, you will be able to create variants using this attribute. If not, the attribute will be used for informational purposes only.",
|
|
9286
9286
|
tip: "Tip",
|
|
9287
9287
|
variantAxisTip: "This attribute will create variants. You can define them in the next step.",
|
|
9288
|
+
editVariantAxisTip: "You will be able to create variants using this attribute.",
|
|
9288
9289
|
warning: "Warning",
|
|
9289
9290
|
editWarning: "Changes to this attribute may affect existing product variants or details. Review your variants and product details after saving.",
|
|
9290
9291
|
errors: {
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-KDE4HKH2.js";
|
|
25
25
|
import {
|
|
26
26
|
I18n
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-M65DM6ZW.js";
|
|
28
28
|
import {
|
|
29
29
|
SwitchBox
|
|
30
30
|
} from "./chunk-2EME4AWX.js";
|
|
@@ -3476,7 +3476,7 @@ function getRouteMap({
|
|
|
3476
3476
|
children: [
|
|
3477
3477
|
{
|
|
3478
3478
|
path: "create",
|
|
3479
|
-
lazy: () => import("./product-create-
|
|
3479
|
+
lazy: () => import("./product-create-WMQIZ3SG.js")
|
|
3480
3480
|
},
|
|
3481
3481
|
{
|
|
3482
3482
|
path: "bulk-edit",
|
|
@@ -3528,11 +3528,11 @@ function getRouteMap({
|
|
|
3528
3528
|
},
|
|
3529
3529
|
{
|
|
3530
3530
|
path: "attributes/:attribute_id/edit",
|
|
3531
|
-
lazy: () => import("./product-edit-attribute-
|
|
3531
|
+
lazy: () => import("./product-edit-attribute-P5WL2DXX.js")
|
|
3532
3532
|
},
|
|
3533
3533
|
{
|
|
3534
3534
|
path: "organization",
|
|
3535
|
-
lazy: () => import("./product-organization-
|
|
3535
|
+
lazy: () => import("./product-organization-VPVBTBRC.js")
|
|
3536
3536
|
},
|
|
3537
3537
|
{
|
|
3538
3538
|
path: "shipping-profile",
|
|
@@ -3540,7 +3540,7 @@ function getRouteMap({
|
|
|
3540
3540
|
},
|
|
3541
3541
|
{
|
|
3542
3542
|
path: "media",
|
|
3543
|
-
lazy: () => import("./product-media-
|
|
3543
|
+
lazy: () => import("./product-media-OIXTLFLT.js")
|
|
3544
3544
|
},
|
|
3545
3545
|
{
|
|
3546
3546
|
path: "variants/create",
|
|
@@ -3715,7 +3715,7 @@ function getRouteMap({
|
|
|
3715
3715
|
},
|
|
3716
3716
|
{
|
|
3717
3717
|
path: "billing-address",
|
|
3718
|
-
lazy: () => import("./order-edit-billing-address-
|
|
3718
|
+
lazy: () => import("./order-edit-billing-address-AI2RKKDX.js")
|
|
3719
3719
|
},
|
|
3720
3720
|
{
|
|
3721
3721
|
path: "metadata/edit",
|
|
@@ -3736,7 +3736,7 @@ function getRouteMap({
|
|
|
3736
3736
|
children: [
|
|
3737
3737
|
{
|
|
3738
3738
|
path: "",
|
|
3739
|
-
lazy: () => import("./promotion-list-
|
|
3739
|
+
lazy: () => import("./promotion-list-OSHDGBKU.js")
|
|
3740
3740
|
},
|
|
3741
3741
|
{
|
|
3742
3742
|
path: "create",
|
|
@@ -3745,7 +3745,7 @@ function getRouteMap({
|
|
|
3745
3745
|
{
|
|
3746
3746
|
path: ":id",
|
|
3747
3747
|
lazy: async () => {
|
|
3748
|
-
const { Breadcrumb, loader } = await import("./promotion-detail-
|
|
3748
|
+
const { Breadcrumb, loader } = await import("./promotion-detail-BHTLPDRI.js");
|
|
3749
3749
|
return {
|
|
3750
3750
|
Component: Outlet4,
|
|
3751
3751
|
loader,
|
|
@@ -3757,7 +3757,7 @@ function getRouteMap({
|
|
|
3757
3757
|
children: [
|
|
3758
3758
|
{
|
|
3759
3759
|
path: "",
|
|
3760
|
-
lazy: () => import("./promotion-detail-
|
|
3760
|
+
lazy: () => import("./promotion-detail-BHTLPDRI.js"),
|
|
3761
3761
|
children: [
|
|
3762
3762
|
{
|
|
3763
3763
|
path: "edit",
|
|
@@ -3796,7 +3796,7 @@ function getRouteMap({
|
|
|
3796
3796
|
{
|
|
3797
3797
|
path: ":id",
|
|
3798
3798
|
lazy: async () => {
|
|
3799
|
-
const { Breadcrumb, loader } = await import("./campaign-detail-
|
|
3799
|
+
const { Breadcrumb, loader } = await import("./campaign-detail-GHOCDVFB.js");
|
|
3800
3800
|
return {
|
|
3801
3801
|
Component: Outlet4,
|
|
3802
3802
|
loader,
|
|
@@ -3808,7 +3808,7 @@ function getRouteMap({
|
|
|
3808
3808
|
children: [
|
|
3809
3809
|
{
|
|
3810
3810
|
path: "",
|
|
3811
|
-
lazy: () => import("./campaign-detail-
|
|
3811
|
+
lazy: () => import("./campaign-detail-GHOCDVFB.js"),
|
|
3812
3812
|
children: [
|
|
3813
3813
|
{
|
|
3814
3814
|
path: "edit",
|
|
@@ -3824,7 +3824,7 @@ function getRouteMap({
|
|
|
3824
3824
|
},
|
|
3825
3825
|
{
|
|
3826
3826
|
path: "add-promotions",
|
|
3827
|
-
lazy: () => import("./add-campaign-promotions-
|
|
3827
|
+
lazy: () => import("./add-campaign-promotions-7BYQKRUZ.js")
|
|
3828
3828
|
}
|
|
3829
3829
|
]
|
|
3830
3830
|
}
|
|
@@ -4103,7 +4103,7 @@ function getRouteMap({
|
|
|
4103
4103
|
children: [
|
|
4104
4104
|
{
|
|
4105
4105
|
path: "edit",
|
|
4106
|
-
lazy: () => import("./store-edit-
|
|
4106
|
+
lazy: () => import("./store-edit-TTJVA3YL.js")
|
|
4107
4107
|
},
|
|
4108
4108
|
{
|
|
4109
4109
|
path: "edit-address",
|
|
@@ -5071,7 +5071,7 @@ function getRouteMap({
|
|
|
5071
5071
|
children: [
|
|
5072
5072
|
{
|
|
5073
5073
|
path: "create",
|
|
5074
|
-
lazy: () => import("./tax-region-create-
|
|
5074
|
+
lazy: () => import("./tax-region-create-73QPM3S3.js")
|
|
5075
5075
|
}
|
|
5076
5076
|
]
|
|
5077
5077
|
},
|
|
@@ -5237,7 +5237,7 @@ function getRouteMap({
|
|
|
5237
5237
|
},
|
|
5238
5238
|
{
|
|
5239
5239
|
path: "/reset-password",
|
|
5240
|
-
lazy: () => import("./reset-password-
|
|
5240
|
+
lazy: () => import("./reset-password-JIIE5WI5.js")
|
|
5241
5241
|
},
|
|
5242
5242
|
{
|
|
5243
5243
|
path: "/invite",
|
package/dist/pages/index.js
CHANGED
|
@@ -192,11 +192,11 @@ import {
|
|
|
192
192
|
import "../chunk-HINXQTCW.js";
|
|
193
193
|
import {
|
|
194
194
|
CampaignDetailPage
|
|
195
|
-
} from "../chunk-
|
|
195
|
+
} from "../chunk-ALWVYVVE.js";
|
|
196
196
|
import {
|
|
197
197
|
PromotionListPage
|
|
198
|
-
} from "../chunk-
|
|
199
|
-
import "../chunk-
|
|
198
|
+
} from "../chunk-ESMELONQ.js";
|
|
199
|
+
import "../chunk-ZFGT6GRK.js";
|
|
200
200
|
import "../chunk-S2WEYEQR.js";
|
|
201
201
|
import {
|
|
202
202
|
CreatePromotionSchema,
|
|
@@ -207,9 +207,9 @@ import "../chunk-SKKF3CU6.js";
|
|
|
207
207
|
import "../chunk-54TMLQH3.js";
|
|
208
208
|
import {
|
|
209
209
|
PromotionDetailPage
|
|
210
|
-
} from "../chunk-
|
|
210
|
+
} from "../chunk-FDUI5O6O.js";
|
|
211
211
|
import "../chunk-RK5N3XIX.js";
|
|
212
|
-
import "../chunk-
|
|
212
|
+
import "../chunk-Z22L2GBO.js";
|
|
213
213
|
import "../chunk-MAEP2UCK.js";
|
|
214
214
|
import "../chunk-LHVXXHPO.js";
|
|
215
215
|
import "../chunk-WQFFCK3R.js";
|
|
@@ -295,12 +295,12 @@ import "../chunk-DB6ANJBO.js";
|
|
|
295
295
|
import "../chunk-PHOCVOZ5.js";
|
|
296
296
|
import {
|
|
297
297
|
ProductCreatePage
|
|
298
|
-
} from "../chunk-
|
|
298
|
+
} from "../chunk-IY4YSNII.js";
|
|
299
299
|
import "../chunk-IIFQ7KYL.js";
|
|
300
300
|
import "../chunk-32URSQ4F.js";
|
|
301
301
|
import {
|
|
302
302
|
ProductCreateSchema
|
|
303
|
-
} from "../chunk-
|
|
303
|
+
} from "../chunk-PPA2GIDD.js";
|
|
304
304
|
import "../chunk-HJ56YXBU.js";
|
|
305
305
|
import "../chunk-AJLGY3LQ.js";
|
|
306
306
|
import "../chunk-SMQT3ZNO.js";
|
|
@@ -314,7 +314,7 @@ import "../chunk-AW77UWCZ.js";
|
|
|
314
314
|
import "../chunk-FREUYHMS.js";
|
|
315
315
|
import "../chunk-VSLHL2AZ.js";
|
|
316
316
|
import "../chunk-KDE4HKH2.js";
|
|
317
|
-
import "../chunk-
|
|
317
|
+
import "../chunk-M65DM6ZW.js";
|
|
318
318
|
import "../chunk-2EME4AWX.js";
|
|
319
319
|
import "../chunk-LO2ZWQGL.js";
|
|
320
320
|
import "../chunk-HHW4PPNH.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProductCreate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IY4YSNII.js";
|
|
4
4
|
import "./chunk-IIFQ7KYL.js";
|
|
5
5
|
import "./chunk-32URSQ4F.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-PPA2GIDD.js";
|
|
7
7
|
import "./chunk-HJ56YXBU.js";
|
|
8
8
|
import "./chunk-AJLGY3LQ.js";
|
|
9
9
|
import "./chunk-SMQT3ZNO.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-AW77UWCZ.js";
|
|
|
17
17
|
import "./chunk-FREUYHMS.js";
|
|
18
18
|
import "./chunk-VSLHL2AZ.js";
|
|
19
19
|
import "./chunk-KDE4HKH2.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-M65DM6ZW.js";
|
|
21
21
|
import "./chunk-2EME4AWX.js";
|
|
22
22
|
import "./chunk-HHW4PPNH.js";
|
|
23
23
|
import "./chunk-IQPN4PZJ.js";
|
|
@@ -34,18 +34,27 @@ import {
|
|
|
34
34
|
} from "./chunk-NBMM2TZK.js";
|
|
35
35
|
|
|
36
36
|
// src/pages/products/product-edit-attribute/product-edit-attribute.tsx
|
|
37
|
-
import { Heading, Text
|
|
37
|
+
import { Heading, Text } from "@medusajs/ui";
|
|
38
38
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
39
39
|
import { useParams } from "react-router-dom";
|
|
40
40
|
|
|
41
41
|
// src/pages/products/product-edit-attribute/components/edit-attribute-form/edit-attribute-form.tsx
|
|
42
42
|
var import_types = __toESM(require_dist(), 1);
|
|
43
43
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
44
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
Button,
|
|
46
|
+
Hint,
|
|
47
|
+
InlineTip,
|
|
48
|
+
Input,
|
|
49
|
+
Label,
|
|
50
|
+
Switch,
|
|
51
|
+
toast
|
|
52
|
+
} from "@medusajs/ui";
|
|
45
53
|
import { useForm } from "react-hook-form";
|
|
46
54
|
import { useTranslation } from "react-i18next";
|
|
47
55
|
import * as zod from "zod";
|
|
48
56
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
57
|
+
var isVariantAxis = (attribute) => attribute.type === import_types.AttributeType.MULTI_SELECT || !!attribute.is_variant_axis;
|
|
49
58
|
var EditAttributeForm = ({
|
|
50
59
|
productId,
|
|
51
60
|
attribute
|
|
@@ -55,13 +64,28 @@ var EditAttributeForm = ({
|
|
|
55
64
|
}
|
|
56
65
|
return /* @__PURE__ */ jsx(EditCatalogAttributeForm, { productId, attribute });
|
|
57
66
|
};
|
|
67
|
+
var AttributeWarning = () => {
|
|
68
|
+
const { t } = useTranslation();
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
InlineTip,
|
|
71
|
+
{
|
|
72
|
+
variant: "warning",
|
|
73
|
+
label: t("products.create.attributes.warning"),
|
|
74
|
+
children: t("products.create.attributes.editWarning")
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
var VariantAxisTip = () => {
|
|
79
|
+
const { t } = useTranslation();
|
|
80
|
+
return /* @__PURE__ */ jsx(InlineTip, { label: t("products.create.attributes.tip"), children: t("products.create.attributes.editVariantAxisTip") });
|
|
81
|
+
};
|
|
58
82
|
var EditScopedAttributeForm = ({
|
|
59
83
|
productId,
|
|
60
84
|
attribute
|
|
61
85
|
}) => {
|
|
62
86
|
const { t } = useTranslation();
|
|
63
87
|
const { handleSuccess } = useRouteModal();
|
|
64
|
-
const isAxis = attribute
|
|
88
|
+
const isAxis = isVariantAxis(attribute);
|
|
65
89
|
const currentValues = attribute.values ?? attribute.all_values ?? [];
|
|
66
90
|
const schema = zod.object({
|
|
67
91
|
title: zod.string().trim().min(1, { message: t("products.create.attributes.errors.titleRequired") }),
|
|
@@ -159,16 +183,14 @@ var EditScopedAttributeForm = ({
|
|
|
159
183
|
)
|
|
160
184
|
}
|
|
161
185
|
) : /* @__PURE__ */ jsx(
|
|
162
|
-
|
|
186
|
+
AttributeValueInput,
|
|
163
187
|
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
onChange: (e) => onChange(e.target.value),
|
|
188
|
+
type: attribute.type,
|
|
189
|
+
value,
|
|
190
|
+
onChange,
|
|
168
191
|
placeholder: t(
|
|
169
192
|
"products.create.attributes.valuePlaceholder"
|
|
170
|
-
)
|
|
171
|
-
"data-testid": "edit-attribute-values-input"
|
|
193
|
+
)
|
|
172
194
|
}
|
|
173
195
|
) }),
|
|
174
196
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
@@ -191,17 +213,8 @@ var EditScopedAttributeForm = ({
|
|
|
191
213
|
] })
|
|
192
214
|
] })
|
|
193
215
|
] }) }),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
196
|
-
/* @__PURE__ */ jsxs(Text, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
197
|
-
/* @__PURE__ */ jsxs("span", { className: "text-ui-fg-base txt-compact-small-plus", children: [
|
|
198
|
-
t("products.create.attributes.warning"),
|
|
199
|
-
":",
|
|
200
|
-
" "
|
|
201
|
-
] }),
|
|
202
|
-
t("products.create.attributes.editWarning")
|
|
203
|
-
] })
|
|
204
|
-
] })
|
|
216
|
+
isAxis && /* @__PURE__ */ jsx(VariantAxisTip, {}),
|
|
217
|
+
/* @__PURE__ */ jsx(AttributeWarning, {})
|
|
205
218
|
] }) }),
|
|
206
219
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
207
220
|
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
@@ -224,7 +237,9 @@ var EditCatalogAttributeForm = ({
|
|
|
224
237
|
}) => {
|
|
225
238
|
const { t } = useTranslation();
|
|
226
239
|
const { handleSuccess } = useRouteModal();
|
|
240
|
+
const isAxis = isVariantAxis(attribute);
|
|
227
241
|
const hasPresetValues = attribute.type === import_types.AttributeType.SINGLE_SELECT || attribute.type === import_types.AttributeType.MULTI_SELECT;
|
|
242
|
+
const labelTooltip = attribute.description || (attribute.is_required ? t("products.attributeRequiredByMarketplace") : void 0);
|
|
228
243
|
const initialValues = (() => {
|
|
229
244
|
const selected = attribute.values ?? [];
|
|
230
245
|
if (attribute.type === import_types.AttributeType.MULTI_SELECT) {
|
|
@@ -275,40 +290,14 @@ var EditCatalogAttributeForm = ({
|
|
|
275
290
|
});
|
|
276
291
|
});
|
|
277
292
|
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
|
|
278
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx(
|
|
280
|
-
Label,
|
|
281
|
-
{
|
|
282
|
-
size: "xsmall",
|
|
283
|
-
weight: "plus",
|
|
284
|
-
className: "text-ui-fg-subtle",
|
|
285
|
-
children: t("fields.title")
|
|
286
|
-
}
|
|
287
|
-
) }),
|
|
288
|
-
/* @__PURE__ */ jsx(
|
|
289
|
-
Input,
|
|
290
|
-
{
|
|
291
|
-
className: "bg-ui-bg-field-component",
|
|
292
|
-
value: attribute.name,
|
|
293
|
-
disabled: true,
|
|
294
|
-
"data-testid": "edit-attribute-title-input"
|
|
295
|
-
}
|
|
296
|
-
),
|
|
297
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx(
|
|
298
|
-
Label,
|
|
299
|
-
{
|
|
300
|
-
size: "xsmall",
|
|
301
|
-
weight: "plus",
|
|
302
|
-
className: "text-ui-fg-subtle",
|
|
303
|
-
children: t("fields.values")
|
|
304
|
-
}
|
|
305
|
-
) }),
|
|
293
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
306
294
|
/* @__PURE__ */ jsx(
|
|
307
295
|
Form.Field,
|
|
308
296
|
{
|
|
309
297
|
control: form.control,
|
|
310
298
|
name: "values",
|
|
311
299
|
render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
300
|
+
/* @__PURE__ */ jsx(Form.Label, { tooltip: labelTooltip, children: attribute.name }),
|
|
312
301
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
313
302
|
AttributeValueInput,
|
|
314
303
|
{
|
|
@@ -318,11 +307,13 @@ var EditCatalogAttributeForm = ({
|
|
|
318
307
|
availableValues: attribute.all_values ?? []
|
|
319
308
|
}
|
|
320
309
|
) }),
|
|
321
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
310
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {}),
|
|
311
|
+
isAxis && /* @__PURE__ */ jsx(VariantAxisTip, {})
|
|
322
312
|
] })
|
|
323
313
|
}
|
|
324
|
-
)
|
|
325
|
-
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ jsx(AttributeWarning, {})
|
|
316
|
+
] }) }),
|
|
326
317
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
327
318
|
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
328
319
|
/* @__PURE__ */ jsx(
|
|
@@ -358,7 +349,7 @@ var ProductEditAttribute = () => {
|
|
|
358
349
|
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
359
350
|
/* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
|
|
360
351
|
/* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("products.editAttribute") }) }),
|
|
361
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
352
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx2(Text, { size: "small", className: "text-ui-fg-subtle", children: t("products.editAttributeHint") }) })
|
|
362
353
|
] }),
|
|
363
354
|
ready && /* @__PURE__ */ jsx2(EditAttributeForm, { productId: id, attribute })
|
|
364
355
|
] });
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-32URSQ4F.js";
|
|
4
4
|
import {
|
|
5
5
|
EditProductMediaSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PPA2GIDD.js";
|
|
7
7
|
import "./chunk-AJLGY3LQ.js";
|
|
8
8
|
import "./chunk-SMQT3ZNO.js";
|
|
9
9
|
import "./chunk-VSLHL2AZ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-M65DM6ZW.js";
|
|
11
11
|
import "./chunk-TKGWSUEI.js";
|
|
12
12
|
import {
|
|
13
13
|
KeyboundForm
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromotionDetailPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FDUI5O6O.js";
|
|
4
4
|
import "./chunk-RK5N3XIX.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-Z22L2GBO.js";
|
|
6
6
|
import "./chunk-QDPLZDMX.js";
|
|
7
7
|
import "./chunk-XSX255FK.js";
|
|
8
8
|
import "./chunk-FMFVTERD.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-M65DM6ZW.js";
|
|
10
10
|
import "./chunk-E74OUNA3.js";
|
|
11
11
|
import "./chunk-PAYQJPGK.js";
|
|
12
12
|
import "./chunk-H6MYB7GB.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromotionListPage
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ESMELONQ.js";
|
|
4
|
+
import "./chunk-ZFGT6GRK.js";
|
|
5
5
|
import "./chunk-S2WEYEQR.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-Z22L2GBO.js";
|
|
7
7
|
import "./chunk-JHIMVLB2.js";
|
|
8
8
|
import "./chunk-FMFVTERD.js";
|
|
9
9
|
import "./chunk-DB6ANJBO.js";
|
|
10
10
|
import "./chunk-PHOCVOZ5.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-M65DM6ZW.js";
|
|
12
12
|
import "./chunk-E74OUNA3.js";
|
|
13
13
|
import "./chunk-FQERBIVS.js";
|
|
14
14
|
import "./chunk-JGCGVEFZ.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MediaSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PPA2GIDD.js";
|
|
4
4
|
import {
|
|
5
5
|
HandleInput
|
|
6
6
|
} from "./chunk-HJ56YXBU.js";
|
|
@@ -9,7 +9,7 @@ import "./chunk-SMQT3ZNO.js";
|
|
|
9
9
|
import {
|
|
10
10
|
FileUpload
|
|
11
11
|
} from "./chunk-VSLHL2AZ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-M65DM6ZW.js";
|
|
13
13
|
import {
|
|
14
14
|
SwitchBox
|
|
15
15
|
} from "./chunk-2EME4AWX.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/admin",
|
|
3
|
-
"version": "2.2.0-canary.
|
|
3
|
+
"version": "2.2.0-canary.33",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"lint": "oxlint --max-warnings 0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mercurjs/dashboard-shared": "
|
|
33
|
-
"@mercurjs/client": "
|
|
32
|
+
"@mercurjs/dashboard-shared": "2.2.0-canary.33",
|
|
33
|
+
"@mercurjs/client": "2.2.0-canary.33",
|
|
34
34
|
"@ariakit/react": "^0.4.15",
|
|
35
35
|
"@babel/runtime": "^7.26.10",
|
|
36
36
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"tsup": "^8.0.2",
|
|
81
81
|
"typescript": "5.9.3",
|
|
82
82
|
"@medusajs/types": "options-preview",
|
|
83
|
-
"@mercurjs/core": "
|
|
84
|
-
"@mercurjs/dashboard-sdk": "
|
|
85
|
-
"@mercurjs/types": "
|
|
83
|
+
"@mercurjs/core": "2.2.0-canary.33",
|
|
84
|
+
"@mercurjs/dashboard-sdk": "2.2.0-canary.33",
|
|
85
|
+
"@mercurjs/types": "2.2.0-canary.33"
|
|
86
86
|
}
|
|
87
87
|
}
|