@mercurjs/admin 2.2.0-canary.23 → 2.2.0-canary.26
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-2IOKLEMG.js → add-campaign-promotions-BGM7SY5H.js} +3 -3
- package/dist/{attribute-create-Q3IEGYRG.js → attribute-create-VR3TJH5H.js} +14 -15
- package/dist/{attribute-edit-4YPWXZRX.js → attribute-edit-3PISS3NP.js} +1 -1
- package/dist/{attribute-edit-possible-value-YHEWXK6L.js → attribute-edit-possible-value-QZWGVFK2.js} +1 -1
- package/dist/{campaign-detail-5WNSQVKG.js → campaign-detail-GCBZC4AK.js} +4 -4
- package/dist/{chunk-K7EOVKKV.js → chunk-2K7FJQGS.js} +1 -1
- package/dist/{chunk-7PAVVX2P.js → chunk-4GPLGY6N.js} +1 -1
- package/dist/{chunk-FP6YPFKF.js → chunk-63LSFKES.js} +6 -5
- package/dist/{chunk-2H3KXP53.js → chunk-FDMMEAI7.js} +1 -1
- package/dist/{chunk-RXZZEPW3.js → chunk-JKFCU3LQ.js} +1 -1
- package/dist/{chunk-LYCKVPWQ.js → chunk-RJNZPFXH.js} +4 -4
- package/dist/{chunk-5PWXUMCA.js → chunk-S23K2LUH.js} +1 -1
- package/dist/{chunk-3ZCBTIIC.js → chunk-WQZIFZW3.js} +1 -1
- package/dist/{chunk-ZIIZGCTQ.js → chunk-XDCY2FSG.js} +1 -1
- package/dist/index.js +16 -16
- package/dist/{order-edit-billing-address-5XHAAGT7.js → order-edit-billing-address-MNBJ6F3S.js} +1 -1
- package/dist/pages/index.d.ts +333 -333
- package/dist/pages/index.js +8 -8
- package/dist/{product-create-LY3HDOLG.js → product-create-4P7XFKE5.js} +3 -3
- package/dist/{product-media-PWPVCTC2.js → product-media-RUHCF3BH.js} +2 -2
- package/dist/{promotion-detail-ORDL76NG.js → promotion-detail-R24ZU5GF.js} +3 -3
- package/dist/{promotion-list-NMD23NXJ.js → promotion-list-LXSHJ65M.js} +4 -4
- package/dist/{reset-password-GA3NEKEX.js → reset-password-BROULSO2.js} +1 -1
- package/dist/{store-edit-QJXV27DI.js → store-edit-ETQ5MZUP.js} +2 -2
- package/dist/{tax-region-create-MS6G5YVE.js → tax-region-create-3JJHFERV.js} +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4GPLGY6N.js";
|
|
5
5
|
import {
|
|
6
6
|
usePromotionTableFilters
|
|
7
7
|
} from "./chunk-S2WEYEQR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-2K7FJQGS.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import "./chunk-YN3FGNJM.js";
|
|
19
19
|
import "./chunk-KAZ5BYTQ.js";
|
|
20
20
|
import "./chunk-634XVU3D.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-63LSFKES.js";
|
|
22
22
|
import "./chunk-TKGWSUEI.js";
|
|
23
23
|
import {
|
|
24
24
|
KeyboundForm
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ATTRIBUTE_TYPE_OPTIONS,
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
createAttributeSchema
|
|
4
|
+
} from "./chunk-RJNZPFXH.js";
|
|
5
5
|
import {
|
|
6
6
|
SortableList
|
|
7
7
|
} from "./chunk-IIFQ7KYL.js";
|
|
@@ -86,23 +86,21 @@ import { useTranslation as useTranslation4 } from "react-i18next";
|
|
|
86
86
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
87
87
|
|
|
88
88
|
// src/pages/attributes/attribute-create/components/attribute-create-details-tab.tsx
|
|
89
|
-
import { Heading, Input,
|
|
89
|
+
import { Heading, Input, Textarea } from "@medusajs/ui";
|
|
90
|
+
import { useWatch } from "react-hook-form";
|
|
90
91
|
import { useTranslation } from "react-i18next";
|
|
91
92
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
92
93
|
var Root = () => {
|
|
93
94
|
const { t } = useTranslation();
|
|
94
95
|
const form = useTabbedForm();
|
|
95
|
-
const isGlobal = form.
|
|
96
|
+
const isGlobal = useWatch({ control: form.control, name: "is_global" });
|
|
96
97
|
return /* @__PURE__ */ jsx(
|
|
97
98
|
"div",
|
|
98
99
|
{
|
|
99
100
|
className: "flex flex-col items-center p-16",
|
|
100
101
|
"data-testid": "attribute-create-details-tab",
|
|
101
102
|
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("attributes.create.header") }),
|
|
104
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle mt-1", children: t("attributes.create.subtitle") })
|
|
105
|
-
] }),
|
|
103
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Heading, { level: "h2", children: t("attributes.create.tabs.details") }) }),
|
|
106
104
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
107
105
|
/* @__PURE__ */ jsx(
|
|
108
106
|
Form.Field,
|
|
@@ -110,7 +108,7 @@ var Root = () => {
|
|
|
110
108
|
control: form.control,
|
|
111
109
|
name: "name",
|
|
112
110
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
113
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("
|
|
111
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.title") }),
|
|
114
112
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field, "data-testid": "attribute-create-name-input" }) }),
|
|
115
113
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
116
114
|
] })
|
|
@@ -228,14 +226,14 @@ var Root = () => {
|
|
|
228
226
|
Root._tabMeta = defineTabMeta({
|
|
229
227
|
id: "details",
|
|
230
228
|
labelKey: "attributes.create.tabs.details",
|
|
231
|
-
validationFields: ["name"]
|
|
229
|
+
validationFields: ["name", "category_ids"]
|
|
232
230
|
});
|
|
233
231
|
var AttributeCreateDetailsTab = Root;
|
|
234
232
|
|
|
235
233
|
// src/pages/attributes/attribute-create/components/attribute-create-type-tab.tsx
|
|
236
234
|
var import_types2 = __toESM(require_dist(), 1);
|
|
237
|
-
import { Heading as Heading2, Select, Text
|
|
238
|
-
import { useWatch } from "react-hook-form";
|
|
235
|
+
import { Heading as Heading2, Select, Text } from "@medusajs/ui";
|
|
236
|
+
import { useWatch as useWatch2 } from "react-hook-form";
|
|
239
237
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
240
238
|
|
|
241
239
|
// src/pages/attributes/attribute-create/components/possible-values-list.tsx
|
|
@@ -384,7 +382,7 @@ var ATTRIBUTE_TYPE_LABELS = {
|
|
|
384
382
|
var Root2 = () => {
|
|
385
383
|
const { t } = useTranslation3();
|
|
386
384
|
const form = useTabbedForm();
|
|
387
|
-
const type =
|
|
385
|
+
const type = useWatch2({ control: form.control, name: "type" });
|
|
388
386
|
const showValues = type === import_types2.AttributeType.SINGLE_SELECT || type === import_types2.AttributeType.MULTI_SELECT;
|
|
389
387
|
return /* @__PURE__ */ jsx3(
|
|
390
388
|
"div",
|
|
@@ -394,7 +392,7 @@ var Root2 = () => {
|
|
|
394
392
|
children: /* @__PURE__ */ jsxs3("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
395
393
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
396
394
|
/* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("attributes.fields.type") }),
|
|
397
|
-
/* @__PURE__ */ jsx3(
|
|
395
|
+
/* @__PURE__ */ jsx3(Text, { size: "small", className: "text-ui-fg-subtle mt-1", children: t(
|
|
398
396
|
"attributes.create.typeDescription",
|
|
399
397
|
"Select the type of this attribute and define its values."
|
|
400
398
|
) })
|
|
@@ -468,6 +466,7 @@ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
|
468
466
|
var AttributeCreateForm = ({ children }) => {
|
|
469
467
|
const { t } = useTranslation4();
|
|
470
468
|
const { handleSuccess } = useRouteModal();
|
|
469
|
+
const schema = useMemo(() => createAttributeSchema(t), [t]);
|
|
471
470
|
const form = useForm({
|
|
472
471
|
defaultValues: {
|
|
473
472
|
name: "",
|
|
@@ -482,7 +481,7 @@ var AttributeCreateForm = ({ children }) => {
|
|
|
482
481
|
category_ids: [],
|
|
483
482
|
metadata: {}
|
|
484
483
|
},
|
|
485
|
-
resolver: zodResolver(
|
|
484
|
+
resolver: zodResolver(schema)
|
|
486
485
|
});
|
|
487
486
|
const { mutateAsync, isPending } = useCreateProductAttribute();
|
|
488
487
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAMPAIGN_DETAIL_FIELDS,
|
|
3
3
|
CampaignDetailPage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JKFCU3LQ.js";
|
|
5
|
+
import "./chunk-4GPLGY6N.js";
|
|
6
6
|
import "./chunk-S2WEYEQR.js";
|
|
7
7
|
import "./chunk-RK5N3XIX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-2K7FJQGS.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
@@ -15,7 +15,7 @@ import "./chunk-NQEXDLYH.js";
|
|
|
15
15
|
import "./chunk-YN3FGNJM.js";
|
|
16
16
|
import "./chunk-KAZ5BYTQ.js";
|
|
17
17
|
import "./chunk-634XVU3D.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-63LSFKES.js";
|
|
19
19
|
import "./chunk-IQPN4PZJ.js";
|
|
20
20
|
import "./chunk-E74OUNA3.js";
|
|
21
21
|
import "./chunk-H6MYB7GB.js";
|
|
@@ -11932,9 +11932,9 @@ var en_default = {
|
|
|
11932
11932
|
details: "Details",
|
|
11933
11933
|
type: "Type"
|
|
11934
11934
|
},
|
|
11935
|
-
|
|
11936
|
-
possibleValuesRequired: "
|
|
11937
|
-
categoriesRequired: "Please select at least one category
|
|
11935
|
+
titleRequired: "Please enter a title",
|
|
11936
|
+
possibleValuesRequired: "Please add at least one value",
|
|
11937
|
+
categoriesRequired: "Please select at least one category",
|
|
11938
11938
|
successToast: 'Attribute "{{name}}" was successfully created.'
|
|
11939
11939
|
},
|
|
11940
11940
|
edit: {
|
|
@@ -12277,6 +12277,8 @@ var en_default = {
|
|
|
12277
12277
|
selectValues: "Select Values"
|
|
12278
12278
|
},
|
|
12279
12279
|
fields: {
|
|
12280
|
+
yes: "Yes",
|
|
12281
|
+
no: "No",
|
|
12280
12282
|
amount: "Amount",
|
|
12281
12283
|
reference: "Reference",
|
|
12282
12284
|
reference_id: "Reference ID",
|
|
@@ -33639,8 +33641,7 @@ var pl_default = {
|
|
|
33639
33641
|
details: "Szczeg\xF3\u0142y",
|
|
33640
33642
|
type: "Typ"
|
|
33641
33643
|
},
|
|
33642
|
-
|
|
33643
|
-
possibleValuesRequired: "Dla tego typu wymagana jest co najmniej jedna mo\u017Cliwa warto\u015B\u0107",
|
|
33644
|
+
possibleValuesRequired: "Dodaj co najmniej jedn\u0105 warto\u015B\u0107",
|
|
33644
33645
|
successToast: 'Atrybut "{{name}}" zosta\u0142 pomy\u015Blnie utworzony.'
|
|
33645
33646
|
},
|
|
33646
33647
|
edit: {
|
|
@@ -15,8 +15,8 @@ var ATTRIBUTE_TYPE_OPTIONS = [
|
|
|
15
15
|
import_types.AttributeType.TOGGLE,
|
|
16
16
|
import_types.AttributeType.TEXT
|
|
17
17
|
];
|
|
18
|
-
var
|
|
19
|
-
name: z.string().min(1),
|
|
18
|
+
var createAttributeSchema = (t) => z.object({
|
|
19
|
+
name: z.string().min(1, { message: t("attributes.create.titleRequired") }),
|
|
20
20
|
description: z.string().max(250).optional(),
|
|
21
21
|
handle: z.string().optional(),
|
|
22
22
|
is_filterable: z.boolean().default(false),
|
|
@@ -52,7 +52,7 @@ var CreateAttributeSchema = z.object({
|
|
|
52
52
|
if (!data.is_global && (data.category_ids ?? []).length === 0) {
|
|
53
53
|
ctx.addIssue({
|
|
54
54
|
code: z.ZodIssueCode.custom,
|
|
55
|
-
message: "attributes.create.categoriesRequired",
|
|
55
|
+
message: t("attributes.create.categoriesRequired"),
|
|
56
56
|
path: ["category_ids"]
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -81,7 +81,7 @@ var UpdatePossibleValueSchema = z.object({
|
|
|
81
81
|
|
|
82
82
|
export {
|
|
83
83
|
ATTRIBUTE_TYPE_OPTIONS,
|
|
84
|
-
|
|
84
|
+
createAttributeSchema,
|
|
85
85
|
UpdateAttributeSchema,
|
|
86
86
|
UpdatePossibleValueSchema
|
|
87
87
|
};
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import "./chunk-KAZ5BYTQ.js";
|
|
|
21
21
|
import "./chunk-634XVU3D.js";
|
|
22
22
|
import {
|
|
23
23
|
I18n
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-63LSFKES.js";
|
|
25
25
|
import {
|
|
26
26
|
TabbedForm,
|
|
27
27
|
defineTabMeta,
|
|
@@ -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-4P7XFKE5.js")
|
|
3480
3480
|
},
|
|
3481
3481
|
{
|
|
3482
3482
|
path: "bulk-edit",
|
|
@@ -3540,7 +3540,7 @@ function getRouteMap({
|
|
|
3540
3540
|
},
|
|
3541
3541
|
{
|
|
3542
3542
|
path: "media",
|
|
3543
|
-
lazy: () => import("./product-media-
|
|
3543
|
+
lazy: () => import("./product-media-RUHCF3BH.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-MNBJ6F3S.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-LXSHJ65M.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-R24ZU5GF.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-R24ZU5GF.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-GCBZC4AK.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-GCBZC4AK.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-BGM7SY5H.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-ETQ5MZUP.js")
|
|
4107
4107
|
},
|
|
4108
4108
|
{
|
|
4109
4109
|
path: "edit-address",
|
|
@@ -4862,7 +4862,7 @@ function getRouteMap({
|
|
|
4862
4862
|
children: [
|
|
4863
4863
|
{
|
|
4864
4864
|
path: "create",
|
|
4865
|
-
lazy: () => import("./attribute-create-
|
|
4865
|
+
lazy: () => import("./attribute-create-VR3TJH5H.js")
|
|
4866
4866
|
}
|
|
4867
4867
|
]
|
|
4868
4868
|
},
|
|
@@ -4885,11 +4885,11 @@ function getRouteMap({
|
|
|
4885
4885
|
children: [
|
|
4886
4886
|
{
|
|
4887
4887
|
path: "edit",
|
|
4888
|
-
lazy: () => import("./attribute-edit-
|
|
4888
|
+
lazy: () => import("./attribute-edit-3PISS3NP.js")
|
|
4889
4889
|
},
|
|
4890
4890
|
{
|
|
4891
4891
|
path: "edit-possible-value",
|
|
4892
|
-
lazy: () => import("./attribute-edit-possible-value-
|
|
4892
|
+
lazy: () => import("./attribute-edit-possible-value-QZWGVFK2.js")
|
|
4893
4893
|
},
|
|
4894
4894
|
{
|
|
4895
4895
|
path: "create-possible-value",
|
|
@@ -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-3JJHFERV.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-BROULSO2.js")
|
|
5241
5241
|
},
|
|
5242
5242
|
{
|
|
5243
5243
|
path: "/invite",
|