@mercurjs/vendor 2.0.2 → 2.1.0-canary.5
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]-DCCF7277.js → [id]-57VYN5YF.js} +2 -3
- package/dist/{[id]-UAOAQVEM.js → [id]-FWI6NCSF.js} +3 -4
- package/dist/{[id]-6WYSWXWC.js → [id]-IQNYVYZU.js} +1 -2
- package/dist/{[id]-LZPT5Y55.js → [id]-KCUHMQWF.js} +1 -2
- package/dist/{[id]-ENTJSLN2.js → [id]-KMRB5RAW.js} +3 -3
- package/dist/{[id]-PHS2WYFX.js → [id]-LCMQBEOS.js} +2 -3
- package/dist/{[id]-OGHRZ2VY.js → [id]-LJJPLKJ6.js} +5 -4
- package/dist/{[id]-VKG2WEIR.js → [id]-M3PNP527.js} +1 -2
- package/dist/{[id]-EJAHMOOE.js → [id]-MZOT4GAO.js} +2 -3
- package/dist/{[id]-TLZZ53G7.js → [id]-WYIWRY5O.js} +2 -2
- package/dist/{[province_id]-XGA44S7P.js → [province_id]-2MRNXHKU.js} +1 -2
- package/dist/{add-7ZTE42IE.js → add-RDOKD6CX.js} +2 -2
- package/dist/{add-AKC7LTK3.js → add-W7ATBCKS.js} +2 -3
- package/dist/{add-customer-groups-BRC3DKQ2.js → add-customer-groups-ZZVSJJH3.js} +1 -2
- package/dist/{add-products-ZSULNZVI.js → add-products-PINICUAZ.js} +2 -3
- package/dist/{add-promotions-TNFVT5ST.js → add-promotions-W57766OG.js} +3 -3
- package/dist/{address-3DSJESKM.js → address-MQS4I2N6.js} +58 -71
- package/dist/{breadcrumb-ZMVHXCOX.js → breadcrumb-A3XUO3R2.js} +2 -3
- package/dist/{breadcrumb-UH7FAYU2.js → breadcrumb-MPXARU5F.js} +1 -2
- package/dist/{breadcrumb-D6QNYOAO.js → breadcrumb-Q5KJBAPD.js} +1 -2
- package/dist/{chunk-CUMY2VZ5.js → chunk-5LKZCG77.js} +1 -96
- package/dist/{chunk-7XC7ZRG7.js → chunk-5VBEGZ5W.js} +1 -1
- package/dist/{chunk-573EQEW2.js → chunk-6HPF5UZA.js} +1 -1
- package/dist/{chunk-RV5UTYBG.js → chunk-EQQ3BLQ3.js} +2 -2
- package/dist/{chunk-LA6XSPQG.js → chunk-FI2RBY7M.js} +287 -309
- package/dist/{chunk-RMBCBXWD.js → chunk-GQFNE5VL.js} +1 -1
- package/dist/chunk-HFRHHT36.js +98 -0
- package/dist/{chunk-O7E4KQAK.js → chunk-I4F7UYZE.js} +1 -1
- package/dist/chunk-JWB2HSCJ.js +30 -0
- package/dist/{chunk-FNG7ZA7N.js → chunk-NCQBAHWT.js} +1 -1
- package/dist/{chunk-T7LEJIIM.js → chunk-PT3UQCSN.js} +1 -1
- package/dist/chunk-TLE6YHGH.js +26 -0
- package/dist/{chunk-JRT2U4UI.js → chunk-TRKJKAM6.js} +130 -33
- package/dist/{chunk-ASEVHHCT.js → chunk-UDG47AEE.js} +1 -1
- package/dist/{chunk-XZG2HZYW.js → chunk-WFE6CT6M.js} +1 -1
- package/dist/{chunk-N2WKLVUX.js → chunk-XF3W2U3Q.js} +1 -1
- package/dist/{chunk-JKKRKFCS.js → chunk-YPSJN3XT.js} +29 -32
- package/dist/{chunk-NYRRRCJS.js → chunk-ZCJ737TR.js} +66 -21
- package/dist/{collections-2M4RFH4P.js → collections-NNFGWUTW.js} +2 -3
- package/dist/{create-D4F457BD.js → create-GCSVAMEH.js} +1 -2
- package/dist/{create-2TUWGQ2D.js → create-N3WNCW7U.js} +1 -2
- package/dist/{create-QK2SSLZK.js → create-T73PSKIV.js} +3 -4
- package/dist/{create-OF2OZ7EI.js → create-TXBY6W3X.js} +1 -2
- package/dist/{create-6IRE6AMF.js → create-V3TFI4BJ.js} +8 -7
- package/dist/{create-IFMEEHN4.js → create-VPG7P53M.js} +2 -3
- package/dist/{create-YITFTHMA.js → create-WY4KXB66.js} +1 -2
- package/dist/{create-3WUTLUJO.js → create-YCOR6HY3.js} +1 -2
- package/dist/{edit-SGEECDCR.js → edit-2QUFOE5S.js} +1 -2
- package/dist/{edit-UQAQVEUI.js → edit-62WJ7SBJ.js} +27 -10
- package/dist/{edit-QRJIWTU2.js → edit-B245OLC7.js} +1 -2
- package/dist/{edit-PIE7Y73J.js → edit-CPVFMQEI.js} +3 -4
- package/dist/{edit-ONSN756P.js → edit-F4F6EQDZ.js} +1 -1
- package/dist/{edit-Z7EZRPUP.js → edit-JGBH64CC.js} +1 -1
- package/dist/{edit-J5SC7GHQ.js → edit-KWSXWWOA.js} +1 -2
- package/dist/{edit-ZEIL7EQW.js → edit-QYKH2ZZA.js} +1 -2
- package/dist/{edit-stocks-and-prices-543AYFDJ.js → edit-stocks-and-prices-Y233WVZ3.js} +1 -2
- package/dist/{fulfillment-5LNFBSBS.js → fulfillment-FBF3MITY.js} +1 -2
- package/dist/{fulfillment-providers-U7Z7QMOQ.js → fulfillment-providers-Y2YOREHX.js} +2 -3
- package/dist/index.css +35 -29
- package/dist/index.js +86 -87
- package/dist/invite-G7WOO5RZ.js +368 -0
- package/dist/{invite-SI2KIPWI.js → invite-Y2TACGCW.js} +3 -5
- package/dist/{login-QDS5UXKV.js → login-3U4XGDAD.js} +3 -3
- package/dist/{media-RDXCLPKQ.js → media-O2GIGGFG.js} +2 -2
- package/dist/{metadata-7JKDCVYY.js → metadata-7RA6MXW7.js} +1 -2
- package/dist/{metadata-ZV5RYLKR.js → metadata-GSBDSRNM.js} +1 -2
- package/dist/{metadata-X4UIPNL6.js → metadata-JXRXW6UQ.js} +1 -2
- package/dist/{metadata-W5XIPFVU.js → metadata-QM4UGMX5.js} +1 -2
- package/dist/{metadata-UKBRUFH2.js → metadata-RODKLIDO.js} +1 -2
- package/dist/onboarding-7XHOLSKH.js +943 -0
- package/dist/{orders-IAL3JNPU.js → orders-HKUVFCTQ.js} +2 -3
- package/dist/pages/index.d.ts +140 -140
- package/dist/pages/index.js +16 -14
- package/dist/{payment-details-ATUYMVJX.js → payment-details-VWR2S32W.js} +1 -2
- package/dist/{pricing-RBESFX5P.js → pricing-6UZ6SXIE.js} +1 -2
- package/dist/{product-tags-W4BL6RWV.js → product-tags-YXVFIPGQ.js} +3 -4
- package/dist/{product-variant-detail-KU5OCL7E.js → product-variant-detail-O2NOUFFC.js} +1 -2
- package/dist/{products-3VVYJUH7.js → products-3NIIOQBB.js} +2 -3
- package/dist/{products-YYLVCOOY.js → products-T2EMLRXQ.js} +10 -9
- package/dist/{professional-details-6Y5K6GBL.js → professional-details-SJ4AF5TM.js} +1 -2
- package/dist/{promotions-NBJTFP6N.js → promotions-ZEH4RHL3.js} +4 -4
- package/dist/register-4SX23YPM.js +210 -0
- package/dist/{reset-password-PLCDLFL4.js → reset-password-4LWDUVMH.js} +1 -1
- package/dist/{sales-channels-UIDLFCX6.js → sales-channels-2OVI6RTV.js} +3 -2
- package/dist/{sales-channels-UWPEFKAO.js → sales-channels-BKOYQXVC.js} +3 -2
- package/dist/{settings-5MNWE5CR.js → settings-F6KJREHK.js} +3 -4
- package/dist/{shipping-profiles-O7XB2DTE.js → shipping-profiles-AQMJSXDB.js} +1 -2
- package/dist/{stock-VJAAYYW5.js → stock-4G4WQIR7.js} +1 -2
- package/dist/{stock-2CGEFBXO.js → stock-NJADHNRP.js} +1 -2
- package/dist/{store-ZBSMNWFT.js → store-E4JEK2CQ.js} +220 -118
- package/dist/{store-closure-43FK32AQ.js → store-closure-QPK4LBBZ.js} +35 -19
- package/dist/{store-select-Q2HE572R.js → store-select-XPC6NIV5.js} +31 -22
- package/dist/{team-ZLZJJWIY.js → team-DZ5CV3LG.js} +1 -2
- package/package.json +5 -5
- package/dist/chunk-STBCWNZQ.js +0 -57
- package/dist/invite-P6HTOEIV.js +0 -301
- package/dist/onboarding-DLIBZRKE.js +0 -873
- package/dist/register-ZLE6MNPF.js +0 -223
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HandleInput
|
|
3
|
+
} from "./chunk-TLE6YHGH.js";
|
|
1
4
|
import {
|
|
2
5
|
useSalesChannelTableColumns,
|
|
3
6
|
useSalesChannelTableEmptyState,
|
|
4
7
|
useSalesChannelTableFilters,
|
|
5
8
|
useSalesChannelTableQuery
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WFE6CT6M.js";
|
|
7
10
|
import {
|
|
8
11
|
CategoryCombobox
|
|
9
12
|
} from "./chunk-TZTKHOEK.js";
|
|
@@ -23,7 +26,7 @@ import {
|
|
|
23
26
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
24
27
|
ProductCreateSchema,
|
|
25
28
|
decorateVariantsWithDefaultValues
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5VBEGZ5W.js";
|
|
27
30
|
import {
|
|
28
31
|
NumericInput
|
|
29
32
|
} from "./chunk-DLNNTQRY.js";
|
|
@@ -58,7 +61,7 @@ import {
|
|
|
58
61
|
} from "./chunk-3QSRE5LS.js";
|
|
59
62
|
import {
|
|
60
63
|
DataTable
|
|
61
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-5LKZCG77.js";
|
|
62
65
|
import {
|
|
63
66
|
useStockLocations
|
|
64
67
|
} from "./chunk-NBPMNUKZ.js";
|
|
@@ -902,74 +905,49 @@ import { Children } from "react";
|
|
|
902
905
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
903
906
|
|
|
904
907
|
// src/pages/products/create/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx
|
|
905
|
-
import { Input as
|
|
908
|
+
import { Input as Input2, Textarea as Textarea2 } from "@medusajs/ui";
|
|
906
909
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
907
|
-
|
|
908
|
-
// src/components/inputs/handle-input/handle-input.tsx
|
|
909
|
-
import { Input as Input2, Text as Text3 } from "@medusajs/ui";
|
|
910
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
911
910
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
912
|
-
var HandleInput = forwardRef3(
|
|
913
|
-
(props, ref) => {
|
|
914
|
-
return /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
915
|
-
/* @__PURE__ */ jsx4("div", { className: "absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-center border-r", children: /* @__PURE__ */ jsx4(
|
|
916
|
-
Text3,
|
|
917
|
-
{
|
|
918
|
-
className: "text-ui-fg-muted",
|
|
919
|
-
size: "small",
|
|
920
|
-
leading: "compact",
|
|
921
|
-
weight: "plus",
|
|
922
|
-
children: "/"
|
|
923
|
-
}
|
|
924
|
-
) }),
|
|
925
|
-
/* @__PURE__ */ jsx4(Input2, { ref, ...props, className: "pl-10" })
|
|
926
|
-
] });
|
|
927
|
-
}
|
|
928
|
-
);
|
|
929
|
-
HandleInput.displayName = "HandleInput";
|
|
930
|
-
|
|
931
|
-
// src/pages/products/create/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx
|
|
932
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
933
911
|
var ProductCreateGeneralSection = () => {
|
|
934
912
|
const { t } = useTranslation4();
|
|
935
913
|
const form = useTabbedForm();
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ jsxs4("div", { id: "general", className: "flex flex-col gap-y-6", children: [
|
|
915
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-2", children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: [
|
|
916
|
+
/* @__PURE__ */ jsx4(
|
|
939
917
|
Form.Field,
|
|
940
918
|
{
|
|
941
919
|
control: form.control,
|
|
942
920
|
name: "title",
|
|
943
921
|
render: ({ field }) => {
|
|
944
|
-
return /* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
922
|
+
return /* @__PURE__ */ jsxs4(Form.Item, { children: [
|
|
923
|
+
/* @__PURE__ */ jsx4(Form.Label, { children: t("products.fields.title.label") }),
|
|
924
|
+
/* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(Input2, { ...field, placeholder: "Winter jacket" }) }),
|
|
925
|
+
/* @__PURE__ */ jsx4(Form.ErrorMessage, { children: form.formState.errors.title?.message })
|
|
948
926
|
] });
|
|
949
927
|
}
|
|
950
928
|
}
|
|
951
929
|
),
|
|
952
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ jsx4(
|
|
953
931
|
Form.Field,
|
|
954
932
|
{
|
|
955
933
|
control: form.control,
|
|
956
934
|
name: "subtitle",
|
|
957
935
|
render: ({ field }) => {
|
|
958
|
-
return /* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ jsxs4(Form.Item, { children: [
|
|
937
|
+
/* @__PURE__ */ jsx4(Form.Label, { optional: true, children: t("products.fields.subtitle.label") }),
|
|
938
|
+
/* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(Input2, { ...field, placeholder: "Warm and cosy" }) })
|
|
961
939
|
] });
|
|
962
940
|
}
|
|
963
941
|
}
|
|
964
942
|
),
|
|
965
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ jsx4(
|
|
966
944
|
Form.Field,
|
|
967
945
|
{
|
|
968
946
|
control: form.control,
|
|
969
947
|
name: "handle",
|
|
970
948
|
render: ({ field }) => {
|
|
971
|
-
return /* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ jsxs4(Form.Item, { children: [
|
|
950
|
+
/* @__PURE__ */ jsx4(
|
|
973
951
|
Form.Label,
|
|
974
952
|
{
|
|
975
953
|
tooltip: t("products.fields.handle.tooltip"),
|
|
@@ -977,22 +955,22 @@ var ProductCreateGeneralSection = () => {
|
|
|
977
955
|
children: t("fields.handle")
|
|
978
956
|
}
|
|
979
957
|
),
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(HandleInput, { ...field, placeholder: "winter-jacket" }) }),
|
|
959
|
+
/* @__PURE__ */ jsx4(Form.ErrorMessage, { children: form.formState.errors.handle?.message })
|
|
982
960
|
] });
|
|
983
961
|
}
|
|
984
962
|
}
|
|
985
963
|
)
|
|
986
964
|
] }) }),
|
|
987
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ jsx4(
|
|
988
966
|
Form.Field,
|
|
989
967
|
{
|
|
990
968
|
control: form.control,
|
|
991
969
|
name: "description",
|
|
992
970
|
render: ({ field }) => {
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ jsxs4(Form.Item, { children: [
|
|
972
|
+
/* @__PURE__ */ jsx4(Form.Label, { optional: true, children: t("products.fields.description.label") }),
|
|
973
|
+
/* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(Textarea2, { ...field, placeholder: "A warm and cozy jacket" }) })
|
|
996
974
|
] });
|
|
997
975
|
}
|
|
998
976
|
}
|
|
@@ -1024,11 +1002,11 @@ import {
|
|
|
1024
1002
|
Trash,
|
|
1025
1003
|
XMark
|
|
1026
1004
|
} from "@medusajs/icons";
|
|
1027
|
-
import { IconButton, Text as
|
|
1005
|
+
import { IconButton, Text as Text3 } from "@medusajs/ui";
|
|
1028
1006
|
import { useState as useState2 } from "react";
|
|
1029
1007
|
import { useFieldArray as useFieldArray2 } from "react-hook-form";
|
|
1030
1008
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
1031
|
-
import { jsx as
|
|
1009
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1032
1010
|
var dropAnimationConfig = {
|
|
1033
1011
|
sideEffects: defaultDropAnimationSideEffects({
|
|
1034
1012
|
styles: {
|
|
@@ -1095,9 +1073,9 @@ var ProductCreateMediaSection = () => {
|
|
|
1095
1073
|
onMakeThumbnail: getMakeThumbnail(index)
|
|
1096
1074
|
};
|
|
1097
1075
|
};
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsxs5("div", { id: "media", className: "flex flex-col gap-y-2", children: [
|
|
1077
|
+
/* @__PURE__ */ jsx5(UploadMediaFormItem, { form, append, showHint: false }),
|
|
1078
|
+
/* @__PURE__ */ jsxs5(
|
|
1101
1079
|
DndContext,
|
|
1102
1080
|
{
|
|
1103
1081
|
sensors,
|
|
@@ -1105,15 +1083,15 @@ var ProductCreateMediaSection = () => {
|
|
|
1105
1083
|
onDragStart: handleDragStart,
|
|
1106
1084
|
onDragCancel: handleDragCancel,
|
|
1107
1085
|
children: [
|
|
1108
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ jsx5(DragOverlay, { dropAnimation: dropAnimationConfig, children: activeId ? /* @__PURE__ */ jsx5(
|
|
1109
1087
|
MediaGridItemOverlay,
|
|
1110
1088
|
{
|
|
1111
1089
|
field: fields.find((m) => m.field_id === activeId)
|
|
1112
1090
|
}
|
|
1113
1091
|
) : null }),
|
|
1114
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ jsx5("ul", { className: "flex flex-col gap-y-2", children: /* @__PURE__ */ jsx5(SortableContext, { items: fields.map((field) => field.field_id), children: fields.map((field, index) => {
|
|
1115
1093
|
const { onDelete, onMakeThumbnail } = getItemHandlers(index);
|
|
1116
|
-
return /* @__PURE__ */
|
|
1094
|
+
return /* @__PURE__ */ jsx5(
|
|
1117
1095
|
MediaItem,
|
|
1118
1096
|
{
|
|
1119
1097
|
field,
|
|
@@ -1147,15 +1125,15 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1147
1125
|
if (!field.file) {
|
|
1148
1126
|
return null;
|
|
1149
1127
|
}
|
|
1150
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ jsxs5(
|
|
1151
1129
|
"li",
|
|
1152
1130
|
{
|
|
1153
1131
|
className: "bg-ui-bg-component shadow-elevation-card-rest flex items-center justify-between rounded-lg px-3 py-2",
|
|
1154
1132
|
ref: setNodeRef,
|
|
1155
1133
|
style,
|
|
1156
1134
|
children: [
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-2", children: [
|
|
1136
|
+
/* @__PURE__ */ jsx5(
|
|
1159
1137
|
IconButton,
|
|
1160
1138
|
{
|
|
1161
1139
|
variant: "transparent",
|
|
@@ -1165,17 +1143,17 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1165
1143
|
...listeners,
|
|
1166
1144
|
ref: setActivatorNodeRef,
|
|
1167
1145
|
className: "cursor-grab touch-none active:cursor-grabbing",
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1146
|
+
children: /* @__PURE__ */ jsx5(DotsSix, { className: "text-ui-fg-muted" })
|
|
1169
1147
|
}
|
|
1170
1148
|
),
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
field.isThumbnail && /* @__PURE__ */
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
|
|
1149
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-3", children: [
|
|
1150
|
+
/* @__PURE__ */ jsx5("div", { className: "bg-ui-bg-base h-10 w-[30px] overflow-hidden rounded-md", children: /* @__PURE__ */ jsx5(ThumbnailPreview, { url: field.url }) }),
|
|
1151
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
|
|
1152
|
+
/* @__PURE__ */ jsx5(Text3, { size: "small", leading: "compact", children: field.file.name }),
|
|
1153
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-1", children: [
|
|
1154
|
+
field.isThumbnail && /* @__PURE__ */ jsx5(ThumbnailBadge, {}),
|
|
1155
|
+
/* @__PURE__ */ jsx5(
|
|
1156
|
+
Text3,
|
|
1179
1157
|
{
|
|
1180
1158
|
size: "xsmall",
|
|
1181
1159
|
leading: "compact",
|
|
@@ -1187,8 +1165,8 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1187
1165
|
] })
|
|
1188
1166
|
] })
|
|
1189
1167
|
] }),
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-1", children: [
|
|
1169
|
+
/* @__PURE__ */ jsx5(
|
|
1192
1170
|
ActionMenu,
|
|
1193
1171
|
{
|
|
1194
1172
|
groups: [
|
|
@@ -1196,7 +1174,7 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1196
1174
|
actions: [
|
|
1197
1175
|
{
|
|
1198
1176
|
label: t("products.media.makeThumbnail"),
|
|
1199
|
-
icon: /* @__PURE__ */
|
|
1177
|
+
icon: /* @__PURE__ */ jsx5(StackPerspective, {}),
|
|
1200
1178
|
onClick: onMakeThumbnail
|
|
1201
1179
|
}
|
|
1202
1180
|
]
|
|
@@ -1204,7 +1182,7 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1204
1182
|
{
|
|
1205
1183
|
actions: [
|
|
1206
1184
|
{
|
|
1207
|
-
icon: /* @__PURE__ */
|
|
1185
|
+
icon: /* @__PURE__ */ jsx5(Trash, {}),
|
|
1208
1186
|
label: t("actions.delete"),
|
|
1209
1187
|
onClick: onDelete
|
|
1210
1188
|
}
|
|
@@ -1213,14 +1191,14 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1213
1191
|
]
|
|
1214
1192
|
}
|
|
1215
1193
|
),
|
|
1216
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ jsx5(
|
|
1217
1195
|
IconButton,
|
|
1218
1196
|
{
|
|
1219
1197
|
type: "button",
|
|
1220
1198
|
size: "small",
|
|
1221
1199
|
variant: "transparent",
|
|
1222
1200
|
onClick: onDelete,
|
|
1223
|
-
children: /* @__PURE__ */
|
|
1201
|
+
children: /* @__PURE__ */ jsx5(XMark, {})
|
|
1224
1202
|
}
|
|
1225
1203
|
)
|
|
1226
1204
|
] })
|
|
@@ -1229,25 +1207,25 @@ var MediaItem = ({ field, onDelete, onMakeThumbnail }) => {
|
|
|
1229
1207
|
);
|
|
1230
1208
|
};
|
|
1231
1209
|
var MediaGridItemOverlay = ({ field }) => {
|
|
1232
|
-
return /* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsxs5("li", { className: "bg-ui-bg-component shadow-elevation-card-rest flex items-center justify-between rounded-lg px-3 py-2", children: [
|
|
1211
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-2", children: [
|
|
1212
|
+
/* @__PURE__ */ jsx5(
|
|
1235
1213
|
IconButton,
|
|
1236
1214
|
{
|
|
1237
1215
|
variant: "transparent",
|
|
1238
1216
|
size: "small",
|
|
1239
1217
|
className: "cursor-grab touch-none active:cursor-grabbing",
|
|
1240
|
-
children: /* @__PURE__ */
|
|
1218
|
+
children: /* @__PURE__ */ jsx5(DotsSix, { className: "text-ui-fg-muted" })
|
|
1241
1219
|
}
|
|
1242
1220
|
),
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
field.isThumbnail && /* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
|
|
1221
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-3", children: [
|
|
1222
|
+
/* @__PURE__ */ jsx5("div", { className: "bg-ui-bg-base h-10 w-[30px] overflow-hidden rounded-md", children: /* @__PURE__ */ jsx5(ThumbnailPreview, { url: field.url }) }),
|
|
1223
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
|
|
1224
|
+
/* @__PURE__ */ jsx5(Text3, { size: "small", leading: "compact", children: field.file?.name }),
|
|
1225
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-1", children: [
|
|
1226
|
+
field.isThumbnail && /* @__PURE__ */ jsx5(ThumbnailBadge, {}),
|
|
1227
|
+
/* @__PURE__ */ jsx5(
|
|
1228
|
+
Text3,
|
|
1251
1229
|
{
|
|
1252
1230
|
size: "xsmall",
|
|
1253
1231
|
leading: "compact",
|
|
@@ -1259,9 +1237,9 @@ var MediaGridItemOverlay = ({ field }) => {
|
|
|
1259
1237
|
] })
|
|
1260
1238
|
] })
|
|
1261
1239
|
] }),
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-1", children: [
|
|
1241
|
+
/* @__PURE__ */ jsx5(ActionMenu, { groups: [] }),
|
|
1242
|
+
/* @__PURE__ */ jsx5(
|
|
1265
1243
|
IconButton,
|
|
1266
1244
|
{
|
|
1267
1245
|
type: "button",
|
|
@@ -1269,7 +1247,7 @@ var MediaGridItemOverlay = ({ field }) => {
|
|
|
1269
1247
|
variant: "transparent",
|
|
1270
1248
|
onClick: () => {
|
|
1271
1249
|
},
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1250
|
+
children: /* @__PURE__ */ jsx5(XMark, {})
|
|
1273
1251
|
}
|
|
1274
1252
|
)
|
|
1275
1253
|
] })
|
|
@@ -1279,7 +1257,7 @@ var ThumbnailPreview = ({ url }) => {
|
|
|
1279
1257
|
if (!url) {
|
|
1280
1258
|
return null;
|
|
1281
1259
|
}
|
|
1282
|
-
return /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ jsx5("img", { src: url, alt: "", className: "size-full object-cover object-center" });
|
|
1283
1261
|
};
|
|
1284
1262
|
function formatFileSize(bytes, decimalPlaces = 2) {
|
|
1285
1263
|
if (bytes === 0) {
|
|
@@ -1292,19 +1270,19 @@ function formatFileSize(bytes, decimalPlaces = 2) {
|
|
|
1292
1270
|
}
|
|
1293
1271
|
|
|
1294
1272
|
// src/pages/products/create/product-create-details-form/product-create-details-form.tsx
|
|
1295
|
-
import { jsx as
|
|
1273
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1296
1274
|
var Root = ({ children }) => {
|
|
1297
1275
|
if (Children.count(children) > 0) {
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ jsx6("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs6("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
1277
|
+
/* @__PURE__ */ jsx6(Header2, {}),
|
|
1300
1278
|
children
|
|
1301
1279
|
] }) });
|
|
1302
1280
|
}
|
|
1303
|
-
return /* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
/* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ jsx6("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs6("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
1282
|
+
/* @__PURE__ */ jsx6(Header2, {}),
|
|
1283
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-y-6", children: [
|
|
1284
|
+
/* @__PURE__ */ jsx6(ProductCreateGeneralSection, {}),
|
|
1285
|
+
/* @__PURE__ */ jsx6(ProductCreateMediaSection, {})
|
|
1308
1286
|
] })
|
|
1309
1287
|
] }) });
|
|
1310
1288
|
};
|
|
@@ -1315,7 +1293,7 @@ Root._tabMeta = {
|
|
|
1315
1293
|
};
|
|
1316
1294
|
var Header2 = () => {
|
|
1317
1295
|
const { t } = useTranslation6();
|
|
1318
|
-
return /* @__PURE__ */
|
|
1296
|
+
return /* @__PURE__ */ jsx6("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx6(Heading2, { children: t("products.create.tabs.details") }) });
|
|
1319
1297
|
};
|
|
1320
1298
|
var ProductCreateDetailsForm = Object.assign(Root, {
|
|
1321
1299
|
_tabMeta: Root._tabMeta,
|
|
@@ -1327,11 +1305,11 @@ var ProductCreateDetailsForm = Object.assign(Root, {
|
|
|
1327
1305
|
import { Children as Children2 } from "react";
|
|
1328
1306
|
|
|
1329
1307
|
// src/pages/products/create/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx
|
|
1330
|
-
import { Button as Button2, Heading as Heading3, IconButton as IconButton2, Input as
|
|
1308
|
+
import { Button as Button2, Heading as Heading3, IconButton as IconButton2, Input as Input3, Label } from "@medusajs/ui";
|
|
1331
1309
|
import { useFieldArray as useFieldArray3, useWatch } from "react-hook-form";
|
|
1332
1310
|
import { XMarkMini as XMarkMini2 } from "@medusajs/icons";
|
|
1333
1311
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
1334
|
-
import { jsx as
|
|
1312
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1335
1313
|
function VariantSection({ variant, index }) {
|
|
1336
1314
|
const { t } = useTranslation7();
|
|
1337
1315
|
const form = useTabbedForm();
|
|
@@ -1359,13 +1337,13 @@ function VariantSection({ variant, index }) {
|
|
|
1359
1337
|
(i, index2) => index2 != inventoryIndex && i.inventory_item_id === option.value
|
|
1360
1338
|
);
|
|
1361
1339
|
};
|
|
1362
|
-
return /* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1340
|
+
return /* @__PURE__ */ jsxs7("div", { className: "grid gap-y-4", children: [
|
|
1341
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
1342
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
|
|
1343
|
+
/* @__PURE__ */ jsx7(Form.Label, { children: variant.title }),
|
|
1344
|
+
/* @__PURE__ */ jsx7(Form.Hint, { children: t("products.create.inventory.label") })
|
|
1367
1345
|
] }),
|
|
1368
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ jsx7(
|
|
1369
1347
|
Button2,
|
|
1370
1348
|
{
|
|
1371
1349
|
size: "small",
|
|
@@ -1381,13 +1359,13 @@ function VariantSection({ variant, index }) {
|
|
|
1381
1359
|
}
|
|
1382
1360
|
)
|
|
1383
1361
|
] }),
|
|
1384
|
-
inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */
|
|
1362
|
+
inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */ jsxs7(
|
|
1385
1363
|
"li",
|
|
1386
1364
|
{
|
|
1387
1365
|
className: "bg-ui-bg-component shadow-elevation-card-rest grid grid-cols-[1fr_28px] items-center gap-1.5 rounded-xl p-1.5",
|
|
1388
1366
|
children: [
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
|
|
1368
|
+
/* @__PURE__ */ jsx7("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx7(
|
|
1391
1369
|
Label,
|
|
1392
1370
|
{
|
|
1393
1371
|
size: "xsmall",
|
|
@@ -1397,13 +1375,13 @@ function VariantSection({ variant, index }) {
|
|
|
1397
1375
|
children: t("fields.item")
|
|
1398
1376
|
}
|
|
1399
1377
|
) }),
|
|
1400
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ jsx7(
|
|
1401
1379
|
Form.Field,
|
|
1402
1380
|
{
|
|
1403
1381
|
control: form.control,
|
|
1404
1382
|
name: `variants.${index}.inventory.${inventoryIndex}.inventory_item_id`,
|
|
1405
1383
|
render: ({ field }) => {
|
|
1406
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ jsx7(Form.Item, { children: /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1407
1385
|
Combobox,
|
|
1408
1386
|
{
|
|
1409
1387
|
...field,
|
|
@@ -1423,7 +1401,7 @@ function VariantSection({ variant, index }) {
|
|
|
1423
1401
|
}
|
|
1424
1402
|
}
|
|
1425
1403
|
),
|
|
1426
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ jsx7("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx7(
|
|
1427
1405
|
Label,
|
|
1428
1406
|
{
|
|
1429
1407
|
size: "xsmall",
|
|
@@ -1433,15 +1411,15 @@ function VariantSection({ variant, index }) {
|
|
|
1433
1411
|
children: t("fields.quantity")
|
|
1434
1412
|
}
|
|
1435
1413
|
) }),
|
|
1436
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ jsx7(
|
|
1437
1415
|
Form.Field,
|
|
1438
1416
|
{
|
|
1439
1417
|
control: form.control,
|
|
1440
1418
|
name: `variants.${index}.inventory.${inventoryIndex}.required_quantity`,
|
|
1441
1419
|
render: ({ field: { onChange, value, ...field } }) => {
|
|
1442
|
-
return /* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
|
|
1420
|
+
return /* @__PURE__ */ jsxs7(Form.Item, { children: [
|
|
1421
|
+
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1422
|
+
Input3,
|
|
1445
1423
|
{
|
|
1446
1424
|
type: "number",
|
|
1447
1425
|
className: "bg-ui-bg-field-component",
|
|
@@ -1461,13 +1439,13 @@ function VariantSection({ variant, index }) {
|
|
|
1461
1439
|
)
|
|
1462
1440
|
}
|
|
1463
1441
|
) }),
|
|
1464
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ jsx7(Form.ErrorMessage, {})
|
|
1465
1443
|
] });
|
|
1466
1444
|
}
|
|
1467
1445
|
}
|
|
1468
1446
|
)
|
|
1469
1447
|
] }),
|
|
1470
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ jsx7(
|
|
1471
1449
|
IconButton2,
|
|
1472
1450
|
{
|
|
1473
1451
|
type: "button",
|
|
@@ -1475,7 +1453,7 @@ function VariantSection({ variant, index }) {
|
|
|
1475
1453
|
variant: "transparent",
|
|
1476
1454
|
className: "text-ui-fg-muted",
|
|
1477
1455
|
onClick: () => inventory.remove(inventoryIndex),
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1456
|
+
children: /* @__PURE__ */ jsx7(XMarkMini2, {})
|
|
1479
1457
|
}
|
|
1480
1458
|
)
|
|
1481
1459
|
]
|
|
@@ -1491,9 +1469,9 @@ var ProductCreateInventoryKitSection = () => {
|
|
|
1491
1469
|
control: form.control,
|
|
1492
1470
|
name: "variants"
|
|
1493
1471
|
});
|
|
1494
|
-
return /* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ jsxs7("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
|
|
1473
|
+
/* @__PURE__ */ jsx7(Heading3, { children: t("products.create.inventory.heading") }),
|
|
1474
|
+
variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */ jsx7(
|
|
1497
1475
|
VariantSection,
|
|
1498
1476
|
{
|
|
1499
1477
|
variant,
|
|
@@ -1505,12 +1483,12 @@ var ProductCreateInventoryKitSection = () => {
|
|
|
1505
1483
|
};
|
|
1506
1484
|
|
|
1507
1485
|
// src/pages/products/create/product-create-inventory-kit-form/product-create-inventory-kit-form.tsx
|
|
1508
|
-
import { jsx as
|
|
1486
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1509
1487
|
var Root2 = ({ children }) => {
|
|
1510
1488
|
if (Children2.count(children) > 0) {
|
|
1511
|
-
return /* @__PURE__ */
|
|
1489
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx8("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children }) });
|
|
1512
1490
|
}
|
|
1513
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx8("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx8(ProductCreateInventoryKitSection, {}) }) });
|
|
1514
1492
|
};
|
|
1515
1493
|
Root2._tabMeta = {
|
|
1516
1494
|
id: "inventory",
|
|
@@ -1529,7 +1507,7 @@ import { Children as Children3 } from "react";
|
|
|
1529
1507
|
import { useState as useState3 } from "react";
|
|
1530
1508
|
import { Heading as Heading4 } from "@medusajs/ui";
|
|
1531
1509
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
1532
|
-
import { jsx as
|
|
1510
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1533
1511
|
var ProductCreateOrganizationSection = () => {
|
|
1534
1512
|
const { t } = useTranslation8();
|
|
1535
1513
|
const form = useTabbedForm();
|
|
@@ -1563,9 +1541,9 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1563
1541
|
value: tag.id
|
|
1564
1542
|
}))
|
|
1565
1543
|
});
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ jsxs8("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
|
|
1545
|
+
/* @__PURE__ */ jsx9(Heading4, { children: t("products.organization.header") }),
|
|
1546
|
+
/* @__PURE__ */ jsx9(
|
|
1569
1547
|
SwitchBox,
|
|
1570
1548
|
{
|
|
1571
1549
|
control: form.control,
|
|
@@ -1575,16 +1553,16 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1575
1553
|
optional: true
|
|
1576
1554
|
}
|
|
1577
1555
|
),
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1557
|
+
/* @__PURE__ */ jsx9(
|
|
1580
1558
|
Form.Field,
|
|
1581
1559
|
{
|
|
1582
1560
|
control: form.control,
|
|
1583
1561
|
name: "tags",
|
|
1584
1562
|
render: ({ field }) => {
|
|
1585
|
-
return /* @__PURE__ */
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ jsxs8(Form.Item, { children: [
|
|
1564
|
+
/* @__PURE__ */ jsx9(Form.Label, { optional: true, children: t("products.fields.tags.label") }),
|
|
1565
|
+
/* @__PURE__ */ jsx9(Form.Control, { children: /* @__PURE__ */ jsx9(
|
|
1588
1566
|
Combobox,
|
|
1589
1567
|
{
|
|
1590
1568
|
...field,
|
|
@@ -1594,20 +1572,20 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1594
1572
|
fetchNextPage: tags.fetchNextPage
|
|
1595
1573
|
}
|
|
1596
1574
|
) }),
|
|
1597
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ jsx9(Form.ErrorMessage, {})
|
|
1598
1576
|
] });
|
|
1599
1577
|
}
|
|
1600
1578
|
}
|
|
1601
1579
|
),
|
|
1602
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ jsx9(
|
|
1603
1581
|
Form.Field,
|
|
1604
1582
|
{
|
|
1605
1583
|
control: form.control,
|
|
1606
1584
|
name: "type_id",
|
|
1607
1585
|
render: ({ field }) => {
|
|
1608
|
-
return /* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1586
|
+
return /* @__PURE__ */ jsxs8(Form.Item, { children: [
|
|
1587
|
+
/* @__PURE__ */ jsx9(Form.Label, { optional: true, children: t("products.fields.type.label") }),
|
|
1588
|
+
/* @__PURE__ */ jsx9(Form.Control, { children: /* @__PURE__ */ jsx9(
|
|
1611
1589
|
Combobox,
|
|
1612
1590
|
{
|
|
1613
1591
|
...field,
|
|
@@ -1618,23 +1596,23 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1618
1596
|
allowClear: true
|
|
1619
1597
|
}
|
|
1620
1598
|
) }),
|
|
1621
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ jsx9(Form.ErrorMessage, {})
|
|
1622
1600
|
] });
|
|
1623
1601
|
}
|
|
1624
1602
|
}
|
|
1625
1603
|
)
|
|
1626
1604
|
] }),
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1606
|
+
/* @__PURE__ */ jsx9(
|
|
1629
1607
|
Form.Field,
|
|
1630
1608
|
{
|
|
1631
1609
|
control: form.control,
|
|
1632
1610
|
name: "categories",
|
|
1633
1611
|
render: ({ field }) => {
|
|
1634
1612
|
const [isFocused, setIsFocused] = useState3(false);
|
|
1635
|
-
return /* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ jsxs8(Form.Item, { children: [
|
|
1614
|
+
/* @__PURE__ */ jsx9(Form.Label, { tooltip: t("products.fields.primaryCategory.tooltip"), children: t("products.fields.primaryCategory.label") }),
|
|
1615
|
+
/* @__PURE__ */ jsx9(Form.Control, { children: /* @__PURE__ */ jsx9(
|
|
1638
1616
|
CategoryCombobox,
|
|
1639
1617
|
{
|
|
1640
1618
|
...field,
|
|
@@ -1647,41 +1625,41 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1647
1625
|
allowClear: false
|
|
1648
1626
|
}
|
|
1649
1627
|
) }),
|
|
1650
|
-
!isFocused && /* @__PURE__ */
|
|
1628
|
+
!isFocused && /* @__PURE__ */ jsx9(Form.ErrorMessage, {})
|
|
1651
1629
|
] });
|
|
1652
1630
|
}
|
|
1653
1631
|
}
|
|
1654
1632
|
),
|
|
1655
|
-
/* @__PURE__ */
|
|
1633
|
+
/* @__PURE__ */ jsx9(
|
|
1656
1634
|
Form.Field,
|
|
1657
1635
|
{
|
|
1658
1636
|
control: form.control,
|
|
1659
1637
|
name: "secondary_categories",
|
|
1660
1638
|
render: ({ field }) => {
|
|
1661
|
-
return /* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsxs8(Form.Item, { children: [
|
|
1640
|
+
/* @__PURE__ */ jsx9(Form.Label, { optional: true, children: t("products.fields.secondaryCategories.label", "Secondary Categories") }),
|
|
1641
|
+
/* @__PURE__ */ jsx9(Form.Control, { children: /* @__PURE__ */ jsx9(
|
|
1664
1642
|
CategoryCombobox,
|
|
1665
1643
|
{
|
|
1666
1644
|
...field,
|
|
1667
1645
|
value: field.value || []
|
|
1668
1646
|
}
|
|
1669
1647
|
) }),
|
|
1670
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsx9(Form.ErrorMessage, {})
|
|
1671
1649
|
] });
|
|
1672
1650
|
}
|
|
1673
1651
|
}
|
|
1674
1652
|
)
|
|
1675
1653
|
] }),
|
|
1676
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ jsx9("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: /* @__PURE__ */ jsx9(
|
|
1677
1655
|
Form.Field,
|
|
1678
1656
|
{
|
|
1679
1657
|
control: form.control,
|
|
1680
1658
|
name: "collection_id",
|
|
1681
1659
|
render: ({ field }) => {
|
|
1682
|
-
return /* @__PURE__ */
|
|
1683
|
-
/* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ jsxs8(Form.Item, { children: [
|
|
1661
|
+
/* @__PURE__ */ jsx9(Form.Label, { optional: true, children: t("products.fields.collection.label") }),
|
|
1662
|
+
/* @__PURE__ */ jsx9(Form.Control, { children: /* @__PURE__ */ jsx9(
|
|
1685
1663
|
Combobox,
|
|
1686
1664
|
{
|
|
1687
1665
|
...field,
|
|
@@ -1692,7 +1670,7 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1692
1670
|
allowClear: true
|
|
1693
1671
|
}
|
|
1694
1672
|
) }),
|
|
1695
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ jsx9(Form.ErrorMessage, {})
|
|
1696
1674
|
] });
|
|
1697
1675
|
}
|
|
1698
1676
|
}
|
|
@@ -1701,117 +1679,117 @@ var ProductCreateOrganizationSection = () => {
|
|
|
1701
1679
|
};
|
|
1702
1680
|
|
|
1703
1681
|
// src/pages/products/create/product-create-organize-form/components/product-create-organize-attribute-section/product-create-details-attribute-section.tsx
|
|
1704
|
-
import { Heading as Heading5, Input as
|
|
1682
|
+
import { Heading as Heading5, Input as Input4 } from "@medusajs/ui";
|
|
1705
1683
|
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
1706
|
-
import { jsx as
|
|
1684
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1707
1685
|
var ProductCreateAttributeSection = () => {
|
|
1708
1686
|
const { t } = useTranslation9();
|
|
1709
1687
|
const form = useTabbedForm();
|
|
1710
|
-
return /* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1688
|
+
return /* @__PURE__ */ jsxs9("div", { id: "attributes", className: "flex flex-col gap-y-8", children: [
|
|
1689
|
+
/* @__PURE__ */ jsx10(Heading5, { level: "h2", children: t("products.attributes") }),
|
|
1690
|
+
/* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-2 gap-x-4 gap-y-8", children: [
|
|
1691
|
+
/* @__PURE__ */ jsx10(
|
|
1714
1692
|
Form.Field,
|
|
1715
1693
|
{
|
|
1716
1694
|
control: form.control,
|
|
1717
1695
|
name: "origin_country",
|
|
1718
1696
|
render: ({ field }) => {
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1698
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.countryOrigin.label") }),
|
|
1699
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(CountrySelect, { ...field }) })
|
|
1722
1700
|
] });
|
|
1723
1701
|
}
|
|
1724
1702
|
}
|
|
1725
1703
|
),
|
|
1726
|
-
/* @__PURE__ */
|
|
1704
|
+
/* @__PURE__ */ jsx10(
|
|
1727
1705
|
Form.Field,
|
|
1728
1706
|
{
|
|
1729
1707
|
control: form.control,
|
|
1730
1708
|
name: "material",
|
|
1731
1709
|
render: ({ field }) => {
|
|
1732
|
-
return /* @__PURE__ */
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1711
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.material.label") }),
|
|
1712
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field }) })
|
|
1735
1713
|
] });
|
|
1736
1714
|
}
|
|
1737
1715
|
}
|
|
1738
1716
|
)
|
|
1739
1717
|
] }),
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-2 gap-x-4 gap-y-8", children: [
|
|
1719
|
+
/* @__PURE__ */ jsx10(
|
|
1742
1720
|
Form.Field,
|
|
1743
1721
|
{
|
|
1744
1722
|
control: form.control,
|
|
1745
1723
|
name: "width",
|
|
1746
1724
|
render: ({ field }) => {
|
|
1747
|
-
return /* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1726
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.width.label") }),
|
|
1727
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field, type: "number", min: 0 }) })
|
|
1750
1728
|
] });
|
|
1751
1729
|
}
|
|
1752
1730
|
}
|
|
1753
1731
|
),
|
|
1754
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsx10(
|
|
1755
1733
|
Form.Field,
|
|
1756
1734
|
{
|
|
1757
1735
|
control: form.control,
|
|
1758
1736
|
name: "length",
|
|
1759
1737
|
render: ({ field }) => {
|
|
1760
|
-
return /* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1739
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.length.label") }),
|
|
1740
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field, type: "number", min: 0 }) })
|
|
1763
1741
|
] });
|
|
1764
1742
|
}
|
|
1765
1743
|
}
|
|
1766
1744
|
),
|
|
1767
|
-
/* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ jsx10(
|
|
1768
1746
|
Form.Field,
|
|
1769
1747
|
{
|
|
1770
1748
|
control: form.control,
|
|
1771
1749
|
name: "height",
|
|
1772
1750
|
render: ({ field }) => {
|
|
1773
|
-
return /* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1752
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.height.label") }),
|
|
1753
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field, type: "number", min: 0 }) })
|
|
1776
1754
|
] });
|
|
1777
1755
|
}
|
|
1778
1756
|
}
|
|
1779
1757
|
),
|
|
1780
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ jsx10(
|
|
1781
1759
|
Form.Field,
|
|
1782
1760
|
{
|
|
1783
1761
|
control: form.control,
|
|
1784
1762
|
name: "weight",
|
|
1785
1763
|
render: ({ field }) => {
|
|
1786
|
-
return /* @__PURE__ */
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1764
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1765
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.weight.label") }),
|
|
1766
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field, type: "number", min: 0 }) })
|
|
1789
1767
|
] });
|
|
1790
1768
|
}
|
|
1791
1769
|
}
|
|
1792
1770
|
),
|
|
1793
|
-
/* @__PURE__ */
|
|
1771
|
+
/* @__PURE__ */ jsx10(
|
|
1794
1772
|
Form.Field,
|
|
1795
1773
|
{
|
|
1796
1774
|
control: form.control,
|
|
1797
1775
|
name: "mid_code",
|
|
1798
1776
|
render: ({ field }) => {
|
|
1799
|
-
return /* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1778
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.mid_code.label") }),
|
|
1779
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field }) })
|
|
1802
1780
|
] });
|
|
1803
1781
|
}
|
|
1804
1782
|
}
|
|
1805
1783
|
),
|
|
1806
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ jsx10(
|
|
1807
1785
|
Form.Field,
|
|
1808
1786
|
{
|
|
1809
1787
|
control: form.control,
|
|
1810
1788
|
name: "hs_code",
|
|
1811
1789
|
render: ({ field }) => {
|
|
1812
|
-
return /* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ jsxs9(Form.Item, { children: [
|
|
1791
|
+
/* @__PURE__ */ jsx10(Form.Label, { optional: true, children: t("products.fields.hs_code.label") }),
|
|
1792
|
+
/* @__PURE__ */ jsx10(Form.Control, { children: /* @__PURE__ */ jsx10(Input4, { ...field }) })
|
|
1815
1793
|
] });
|
|
1816
1794
|
}
|
|
1817
1795
|
}
|
|
@@ -1833,7 +1811,7 @@ import { keepPreviousData } from "@tanstack/react-query";
|
|
|
1833
1811
|
var SC_STACKED_MODAL_ID = "sc";
|
|
1834
1812
|
|
|
1835
1813
|
// src/pages/products/create/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
|
|
1836
|
-
import { jsx as
|
|
1814
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1837
1815
|
var PAGE_SIZE = 50;
|
|
1838
1816
|
var ProductCreateSalesChannelStackedModal = () => {
|
|
1839
1817
|
const { t } = useTranslation10();
|
|
@@ -1906,9 +1884,9 @@ var ProductCreateSalesChannelStackedModal = () => {
|
|
|
1906
1884
|
if (isError) {
|
|
1907
1885
|
throw error;
|
|
1908
1886
|
}
|
|
1909
|
-
return /* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
1887
|
+
return /* @__PURE__ */ jsxs10(StackedFocusModal.Content, { className: "flex flex-col overflow-hidden", children: [
|
|
1888
|
+
/* @__PURE__ */ jsx11(StackedFocusModal.Header, {}),
|
|
1889
|
+
/* @__PURE__ */ jsx11(StackedFocusModal.Body, { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx11(
|
|
1912
1890
|
DataTable,
|
|
1913
1891
|
{
|
|
1914
1892
|
data: sales_channels,
|
|
@@ -1927,9 +1905,9 @@ var ProductCreateSalesChannelStackedModal = () => {
|
|
|
1927
1905
|
prefix: SC_STACKED_MODAL_ID
|
|
1928
1906
|
}
|
|
1929
1907
|
) }),
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
/* @__PURE__ */
|
|
1932
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsx11(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
1909
|
+
/* @__PURE__ */ jsx11(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx11(Button3, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
|
|
1910
|
+
/* @__PURE__ */ jsx11(Button3, { size: "small", onClick: handleAdd, type: "button", children: t("actions.save") })
|
|
1933
1911
|
] }) })
|
|
1934
1912
|
] });
|
|
1935
1913
|
};
|
|
@@ -1940,17 +1918,17 @@ var useColumns = () => {
|
|
|
1940
1918
|
};
|
|
1941
1919
|
|
|
1942
1920
|
// src/pages/products/create/product-create-organize-form/product-create-organize-form.tsx
|
|
1943
|
-
import { jsx as
|
|
1921
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1944
1922
|
var Root3 = ({ children }) => {
|
|
1945
1923
|
if (Children3.count(children) > 0) {
|
|
1946
|
-
return /* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
1924
|
+
return /* @__PURE__ */ jsxs11(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
|
|
1925
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx12("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children }) }),
|
|
1926
|
+
/* @__PURE__ */ jsx12(ProductCreateSalesChannelStackedModal, {})
|
|
1949
1927
|
] });
|
|
1950
1928
|
}
|
|
1951
|
-
return /* @__PURE__ */
|
|
1952
|
-
/* @__PURE__ */
|
|
1953
|
-
/* @__PURE__ */
|
|
1929
|
+
return /* @__PURE__ */ jsxs11(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
|
|
1930
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx12("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx12(ProductCreateOrganizationSection, {}) }) }),
|
|
1931
|
+
/* @__PURE__ */ jsx12(ProductCreateSalesChannelStackedModal, {})
|
|
1954
1932
|
] });
|
|
1955
1933
|
};
|
|
1956
1934
|
Root3._tabMeta = {
|
|
@@ -1970,7 +1948,7 @@ import { useCallback, useEffect as useEffect4, useMemo as useMemo3, useRef as us
|
|
|
1970
1948
|
import { Checkbox, Tooltip as Tooltip2 } from "@medusajs/ui";
|
|
1971
1949
|
import { useWatch as useWatch2 } from "react-hook-form";
|
|
1972
1950
|
import { useTranslation as useTranslation11 } from "react-i18next";
|
|
1973
|
-
import { jsx as
|
|
1951
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1974
1952
|
var ProductCreateVariantsForm = ({
|
|
1975
1953
|
form,
|
|
1976
1954
|
store,
|
|
@@ -2188,7 +2166,7 @@ var ProductCreateVariantsForm = ({
|
|
|
2188
2166
|
}
|
|
2189
2167
|
}
|
|
2190
2168
|
}, [variantStructureKey, form]);
|
|
2191
|
-
return /* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ jsx13("div", { className: "border-ui-border flex h-full flex-col justify-between divide-y", children: /* @__PURE__ */ jsx13(
|
|
2192
2170
|
DataGrid,
|
|
2193
2171
|
{
|
|
2194
2172
|
columns,
|
|
@@ -2239,7 +2217,7 @@ var useColumns2 = ({
|
|
|
2239
2217
|
() => [
|
|
2240
2218
|
columnHelper2.column({
|
|
2241
2219
|
id: "checkbox",
|
|
2242
|
-
header: () => /* @__PURE__ */
|
|
2220
|
+
header: () => /* @__PURE__ */ jsx13(
|
|
2243
2221
|
Checkbox,
|
|
2244
2222
|
{
|
|
2245
2223
|
checked: allSelected ? true : someSelected ? "indeterminate" : false,
|
|
@@ -2251,7 +2229,7 @@ var useColumns2 = ({
|
|
|
2251
2229
|
return `variants.${rowData.originalIndex}.should_create`;
|
|
2252
2230
|
},
|
|
2253
2231
|
type: "boolean",
|
|
2254
|
-
cell: (context) => /* @__PURE__ */
|
|
2232
|
+
cell: (context) => /* @__PURE__ */ jsx13(DataGrid.BooleanCell, { context }),
|
|
2255
2233
|
disableHiding: true,
|
|
2256
2234
|
size: 52,
|
|
2257
2235
|
pin: "left"
|
|
@@ -2261,17 +2239,17 @@ var useColumns2 = ({
|
|
|
2261
2239
|
name: variantAttributes.length > 0 ? variantAttributes.map((attr) => attr.name).join(" / ") : "Options",
|
|
2262
2240
|
header: () => {
|
|
2263
2241
|
const label = variantAttributes.length > 0 ? variantAttributes.map((attr) => attr.name).join(" / ") : "Options";
|
|
2264
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ jsx13(Tooltip2, { content: label, children: /* @__PURE__ */ jsx13("span", { className: "w-full truncate", children: label }) });
|
|
2265
2243
|
},
|
|
2266
2244
|
cell: (context) => {
|
|
2267
2245
|
if (variantAttributes.length === 0) {
|
|
2268
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ jsx13(DataGrid.ReadonlyCell, { context });
|
|
2269
2247
|
}
|
|
2270
2248
|
const rowData = context.row.original;
|
|
2271
2249
|
const combinedValue = variantAttributes.map(
|
|
2272
2250
|
(attr) => rowData.options?.[attr.name] || ""
|
|
2273
2251
|
).filter(Boolean).join(" / ");
|
|
2274
|
-
return /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ jsx13(DataGrid.ReadonlyCell, { context, children: combinedValue });
|
|
2275
2253
|
},
|
|
2276
2254
|
disableHiding: true,
|
|
2277
2255
|
pin: "left"
|
|
@@ -2285,7 +2263,7 @@ var useColumns2 = ({
|
|
|
2285
2263
|
return `variants.${rowData.originalIndex}.title`;
|
|
2286
2264
|
},
|
|
2287
2265
|
type: "text",
|
|
2288
|
-
cell: (context) => /* @__PURE__ */
|
|
2266
|
+
cell: (context) => /* @__PURE__ */ jsx13(DataGrid.TextCell, { context }),
|
|
2289
2267
|
disableHiding: true,
|
|
2290
2268
|
pin: "left"
|
|
2291
2269
|
}),
|
|
@@ -2304,7 +2282,7 @@ var useColumns2 = ({
|
|
|
2304
2282
|
type: "media",
|
|
2305
2283
|
cell: (context) => {
|
|
2306
2284
|
const rowData = context.row.original;
|
|
2307
|
-
return /* @__PURE__ */
|
|
2285
|
+
return /* @__PURE__ */ jsx13(
|
|
2308
2286
|
DataGridMediaCell,
|
|
2309
2287
|
{
|
|
2310
2288
|
context,
|
|
@@ -2331,7 +2309,7 @@ var useColumns2 = ({
|
|
|
2331
2309
|
return `variants.${rowData.originalIndex}.sku`;
|
|
2332
2310
|
},
|
|
2333
2311
|
type: "text",
|
|
2334
|
-
cell: (context) => /* @__PURE__ */
|
|
2312
|
+
cell: (context) => /* @__PURE__ */ jsx13(DataGrid.TextCell, { context })
|
|
2335
2313
|
}),
|
|
2336
2314
|
...createDataGridPriceColumns({
|
|
2337
2315
|
currencies: store?.supported_currencies?.map(
|
|
@@ -2363,7 +2341,7 @@ var useColumns2 = ({
|
|
|
2363
2341
|
};
|
|
2364
2342
|
|
|
2365
2343
|
// src/pages/products/create/product-create-form/product-create-form.tsx
|
|
2366
|
-
import { jsx as
|
|
2344
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2367
2345
|
var SAVE_DRAFT_BUTTON = "save-draft-button";
|
|
2368
2346
|
var SEC_CAT_PRODUCT_KEY = "sec_cat_product_key";
|
|
2369
2347
|
var TAB_ORDER = [
|
|
@@ -2966,7 +2944,7 @@ var ProductCreateForm = ({
|
|
|
2966
2944
|
});
|
|
2967
2945
|
setTabState(currentState);
|
|
2968
2946
|
}, [tab, maxReachedTab]);
|
|
2969
|
-
return /* @__PURE__ */
|
|
2947
|
+
return /* @__PURE__ */ jsx14(TabbedFormContext.Provider, { value: form, children: /* @__PURE__ */ jsx14(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs12(
|
|
2970
2948
|
KeyboundForm,
|
|
2971
2949
|
{
|
|
2972
2950
|
onKeyDown: (e) => {
|
|
@@ -2988,7 +2966,7 @@ var ProductCreateForm = ({
|
|
|
2988
2966
|
onSubmit: handleSubmit,
|
|
2989
2967
|
className: "flex h-full flex-col",
|
|
2990
2968
|
children: [
|
|
2991
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ jsxs12(
|
|
2992
2970
|
ProgressTabs,
|
|
2993
2971
|
{
|
|
2994
2972
|
value: tab,
|
|
@@ -3039,8 +3017,8 @@ var ProductCreateForm = ({
|
|
|
3039
3017
|
},
|
|
3040
3018
|
className: "flex h-full flex-col overflow-hidden",
|
|
3041
3019
|
children: [
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3020
|
+
/* @__PURE__ */ jsx14(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx14("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsxs12(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: [
|
|
3021
|
+
/* @__PURE__ */ jsx14(
|
|
3044
3022
|
ProgressTabs.Trigger,
|
|
3045
3023
|
{
|
|
3046
3024
|
status: tabState["details" /* DETAILS */],
|
|
@@ -3049,7 +3027,7 @@ var ProductCreateForm = ({
|
|
|
3049
3027
|
children: t("products.create.tabs.details")
|
|
3050
3028
|
}
|
|
3051
3029
|
),
|
|
3052
|
-
/* @__PURE__ */
|
|
3030
|
+
/* @__PURE__ */ jsx14(
|
|
3053
3031
|
ProgressTabs.Trigger,
|
|
3054
3032
|
{
|
|
3055
3033
|
status: tabState["organize" /* ORGANIZE */],
|
|
@@ -3058,7 +3036,7 @@ var ProductCreateForm = ({
|
|
|
3058
3036
|
children: t("products.create.tabs.organize")
|
|
3059
3037
|
}
|
|
3060
3038
|
),
|
|
3061
|
-
/* @__PURE__ */
|
|
3039
|
+
/* @__PURE__ */ jsx14(
|
|
3062
3040
|
ProgressTabs.Trigger,
|
|
3063
3041
|
{
|
|
3064
3042
|
status: tabState["attributes" /* ATTRIBUTES */],
|
|
@@ -3067,7 +3045,7 @@ var ProductCreateForm = ({
|
|
|
3067
3045
|
children: t("products.create.tabs.attributes")
|
|
3068
3046
|
}
|
|
3069
3047
|
),
|
|
3070
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx14(
|
|
3071
3049
|
ProgressTabs.Trigger,
|
|
3072
3050
|
{
|
|
3073
3051
|
status: tabState["variants" /* VARIANTS */],
|
|
@@ -3076,7 +3054,7 @@ var ProductCreateForm = ({
|
|
|
3076
3054
|
children: t("products.create.tabs.variants")
|
|
3077
3055
|
}
|
|
3078
3056
|
),
|
|
3079
|
-
showInventoryTab && /* @__PURE__ */
|
|
3057
|
+
showInventoryTab && /* @__PURE__ */ jsx14(
|
|
3080
3058
|
ProgressTabs.Trigger,
|
|
3081
3059
|
{
|
|
3082
3060
|
status: tabState["inventory" /* INVENTORY */],
|
|
@@ -3086,21 +3064,21 @@ var ProductCreateForm = ({
|
|
|
3086
3064
|
}
|
|
3087
3065
|
)
|
|
3088
3066
|
] }) }) }),
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ jsxs12(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: [
|
|
3068
|
+
/* @__PURE__ */ jsx14(
|
|
3091
3069
|
ProgressTabs.Content,
|
|
3092
3070
|
{
|
|
3093
3071
|
className: "size-full overflow-y-auto",
|
|
3094
3072
|
value: "details" /* DETAILS */,
|
|
3095
|
-
children: /* @__PURE__ */
|
|
3073
|
+
children: /* @__PURE__ */ jsx14(ProductCreateDetailsForm, { form })
|
|
3096
3074
|
}
|
|
3097
3075
|
),
|
|
3098
|
-
/* @__PURE__ */
|
|
3076
|
+
/* @__PURE__ */ jsx14(
|
|
3099
3077
|
ProgressTabs.Content,
|
|
3100
3078
|
{
|
|
3101
3079
|
className: "size-full overflow-y-auto",
|
|
3102
3080
|
value: "organize" /* ORGANIZE */,
|
|
3103
|
-
children: /* @__PURE__ */
|
|
3081
|
+
children: /* @__PURE__ */ jsx14(
|
|
3104
3082
|
ProductCreateOrganizeForm,
|
|
3105
3083
|
{
|
|
3106
3084
|
form
|
|
@@ -3108,12 +3086,12 @@ var ProductCreateForm = ({
|
|
|
3108
3086
|
)
|
|
3109
3087
|
}
|
|
3110
3088
|
),
|
|
3111
|
-
/* @__PURE__ */
|
|
3089
|
+
/* @__PURE__ */ jsx14(
|
|
3112
3090
|
ProgressTabs.Content,
|
|
3113
3091
|
{
|
|
3114
3092
|
className: "size-full overflow-y-auto",
|
|
3115
3093
|
value: "attributes" /* ATTRIBUTES */,
|
|
3116
|
-
children: /* @__PURE__ */
|
|
3094
|
+
children: /* @__PURE__ */ jsx14(
|
|
3117
3095
|
ProductCreateAttributesForm,
|
|
3118
3096
|
{
|
|
3119
3097
|
form,
|
|
@@ -3122,12 +3100,12 @@ var ProductCreateForm = ({
|
|
|
3122
3100
|
)
|
|
3123
3101
|
}
|
|
3124
3102
|
),
|
|
3125
|
-
/* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ jsx14(
|
|
3126
3104
|
ProgressTabs.Content,
|
|
3127
3105
|
{
|
|
3128
3106
|
className: "size-full overflow-y-auto",
|
|
3129
3107
|
value: "variants" /* VARIANTS */,
|
|
3130
|
-
children: /* @__PURE__ */
|
|
3108
|
+
children: /* @__PURE__ */ jsx14(
|
|
3131
3109
|
ProductCreateVariantsForm,
|
|
3132
3110
|
{
|
|
3133
3111
|
form,
|
|
@@ -3140,12 +3118,12 @@ var ProductCreateForm = ({
|
|
|
3140
3118
|
)
|
|
3141
3119
|
}
|
|
3142
3120
|
),
|
|
3143
|
-
showInventoryTab && /* @__PURE__ */
|
|
3121
|
+
showInventoryTab && /* @__PURE__ */ jsx14(
|
|
3144
3122
|
ProgressTabs.Content,
|
|
3145
3123
|
{
|
|
3146
3124
|
className: "size-full overflow-y-auto",
|
|
3147
3125
|
value: "inventory" /* INVENTORY */,
|
|
3148
|
-
children: /* @__PURE__ */
|
|
3126
|
+
children: /* @__PURE__ */ jsx14(
|
|
3149
3127
|
ProductCreateInventoryKitForm,
|
|
3150
3128
|
{
|
|
3151
3129
|
form
|
|
@@ -3157,9 +3135,9 @@ var ProductCreateForm = ({
|
|
|
3157
3135
|
]
|
|
3158
3136
|
}
|
|
3159
3137
|
),
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsx14(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
3139
|
+
/* @__PURE__ */ jsx14(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx14(Button4, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
|
|
3140
|
+
/* @__PURE__ */ jsx14(
|
|
3163
3141
|
Button4,
|
|
3164
3142
|
{
|
|
3165
3143
|
"data-name": SAVE_DRAFT_BUTTON,
|
|
@@ -3178,7 +3156,7 @@ var ProductCreateForm = ({
|
|
|
3178
3156
|
children: t("actions.saveAsDraft")
|
|
3179
3157
|
}
|
|
3180
3158
|
),
|
|
3181
|
-
/* @__PURE__ */
|
|
3159
|
+
/* @__PURE__ */ jsx14(
|
|
3182
3160
|
PrimaryButton,
|
|
3183
3161
|
{
|
|
3184
3162
|
tab,
|
|
@@ -3200,7 +3178,7 @@ var PrimaryButton = ({
|
|
|
3200
3178
|
}) => {
|
|
3201
3179
|
const { t } = useTranslation12();
|
|
3202
3180
|
if (tab === "variants" /* VARIANTS */ && !showInventoryTab || tab === "inventory" /* INVENTORY */ && showInventoryTab) {
|
|
3203
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ jsx14(
|
|
3204
3182
|
Button4,
|
|
3205
3183
|
{
|
|
3206
3184
|
"data-name": "publish-button",
|
|
@@ -3213,7 +3191,7 @@ var PrimaryButton = ({
|
|
|
3213
3191
|
"submit-button"
|
|
3214
3192
|
);
|
|
3215
3193
|
}
|
|
3216
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ jsx14(
|
|
3217
3195
|
Button4,
|
|
3218
3196
|
{
|
|
3219
3197
|
type: "button",
|
|
@@ -3236,7 +3214,7 @@ import { Fragment as Fragment4, useCallback as useCallback3, useEffect as useEff
|
|
|
3236
3214
|
import { ThumbnailBadge as ThumbnailBadge2 } from "@medusajs/icons";
|
|
3237
3215
|
import { Checkbox as Checkbox2, clx, CommandBar, Tooltip as Tooltip3 } from "@medusajs/ui";
|
|
3238
3216
|
import { useTranslation as useTranslation13 } from "react-i18next";
|
|
3239
|
-
import { jsx as
|
|
3217
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3240
3218
|
var EditVariantMediaForm = ({
|
|
3241
3219
|
variantIndex,
|
|
3242
3220
|
onSaveMedia,
|
|
@@ -3339,12 +3317,12 @@ var EditVariantMediaForm = ({
|
|
|
3339
3317
|
saveRef.current = handleSave;
|
|
3340
3318
|
}, [handleSave, saveRef]);
|
|
3341
3319
|
const checkedCount = Object.keys(checkedUrls).length;
|
|
3342
|
-
return /* @__PURE__ */
|
|
3343
|
-
/* @__PURE__ */
|
|
3344
|
-
/* @__PURE__ */
|
|
3320
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex size-full flex-col overflow-hidden", children: [
|
|
3321
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex size-full", children: [
|
|
3322
|
+
/* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-auto bg-ui-bg-subtle p-6", children: /* @__PURE__ */ jsx15("div", { className: "flex flex-wrap content-start gap-6", children: selectedImages.map((img) => {
|
|
3345
3323
|
const effectiveThumb = getEffectiveThumbnailUrl();
|
|
3346
3324
|
const isThumb = img.url === effectiveThumb;
|
|
3347
|
-
return /* @__PURE__ */
|
|
3325
|
+
return /* @__PURE__ */ jsx15(
|
|
3348
3326
|
SelectedImageCard,
|
|
3349
3327
|
{
|
|
3350
3328
|
image: img,
|
|
@@ -3355,14 +3333,14 @@ var EditVariantMediaForm = ({
|
|
|
3355
3333
|
img.url
|
|
3356
3334
|
);
|
|
3357
3335
|
}) }) }),
|
|
3358
|
-
/* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
/* @__PURE__ */
|
|
3362
|
-
/* @__PURE__ */
|
|
3336
|
+
/* @__PURE__ */ jsx15("div", { className: "w-px shrink-0 bg-ui-border-base" }),
|
|
3337
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex w-[318px] shrink-0 flex-col", children: [
|
|
3338
|
+
/* @__PURE__ */ jsxs13("div", { className: "p-4", children: [
|
|
3339
|
+
/* @__PURE__ */ jsx15("p", { className: "txt-compact-small-plus text-ui-fg-base", children: t("products.media.selectImages") }),
|
|
3340
|
+
/* @__PURE__ */ jsx15("p", { className: "txt-small mt-1 text-ui-fg-subtle", children: t("products.media.selectImagesHint") })
|
|
3363
3341
|
] }),
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3342
|
+
/* @__PURE__ */ jsx15("div", { className: "h-px bg-ui-border-base" }),
|
|
3343
|
+
/* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ jsx15("div", { className: "grid grid-cols-2 gap-4", children: unselectedImages.map((img) => /* @__PURE__ */ jsx15(
|
|
3366
3344
|
UnselectedImageCard,
|
|
3367
3345
|
{
|
|
3368
3346
|
image: img,
|
|
@@ -3372,13 +3350,13 @@ var EditVariantMediaForm = ({
|
|
|
3372
3350
|
)) }) })
|
|
3373
3351
|
] })
|
|
3374
3352
|
] }),
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
/* @__PURE__ */
|
|
3353
|
+
/* @__PURE__ */ jsx15(CommandBar, { open: !!checkedCount, children: /* @__PURE__ */ jsxs13(CommandBar.Bar, { children: [
|
|
3354
|
+
/* @__PURE__ */ jsx15(CommandBar.Value, { children: t("general.countSelected", {
|
|
3377
3355
|
count: checkedCount
|
|
3378
3356
|
}) }),
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
checkedCount === 1 && /* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3357
|
+
/* @__PURE__ */ jsx15(CommandBar.Seperator, {}),
|
|
3358
|
+
checkedCount === 1 && /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
3359
|
+
/* @__PURE__ */ jsx15(
|
|
3382
3360
|
CommandBar.Command,
|
|
3383
3361
|
{
|
|
3384
3362
|
action: handlePromoteToThumbnail,
|
|
@@ -3386,9 +3364,9 @@ var EditVariantMediaForm = ({
|
|
|
3386
3364
|
shortcut: "t"
|
|
3387
3365
|
}
|
|
3388
3366
|
),
|
|
3389
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ jsx15(CommandBar.Seperator, {})
|
|
3390
3368
|
] }),
|
|
3391
|
-
/* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ jsx15(
|
|
3392
3370
|
CommandBar.Command,
|
|
3393
3371
|
{
|
|
3394
3372
|
action: () => {
|
|
@@ -3411,7 +3389,7 @@ var SelectedImageCard = ({
|
|
|
3411
3389
|
onCheckedChange
|
|
3412
3390
|
}) => {
|
|
3413
3391
|
const { t } = useTranslation13();
|
|
3414
|
-
return /* @__PURE__ */
|
|
3392
|
+
return /* @__PURE__ */ jsxs13(
|
|
3415
3393
|
"div",
|
|
3416
3394
|
{
|
|
3417
3395
|
className: clx(
|
|
@@ -3419,14 +3397,14 @@ var SelectedImageCard = ({
|
|
|
3419
3397
|
"shadow-elevation-card-rest"
|
|
3420
3398
|
),
|
|
3421
3399
|
children: [
|
|
3422
|
-
isThumbnail && /* @__PURE__ */
|
|
3400
|
+
isThumbnail && /* @__PURE__ */ jsx15("div", { className: "absolute left-2 top-2 z-[1]", children: /* @__PURE__ */ jsx15(
|
|
3423
3401
|
Tooltip3,
|
|
3424
3402
|
{
|
|
3425
3403
|
content: t("products.media.thumbnailTooltip"),
|
|
3426
|
-
children: /* @__PURE__ */
|
|
3404
|
+
children: /* @__PURE__ */ jsx15(ThumbnailBadge2, {})
|
|
3427
3405
|
}
|
|
3428
3406
|
) }),
|
|
3429
|
-
/* @__PURE__ */
|
|
3407
|
+
/* @__PURE__ */ jsx15(
|
|
3430
3408
|
"div",
|
|
3431
3409
|
{
|
|
3432
3410
|
className: clx(
|
|
@@ -3434,7 +3412,7 @@ var SelectedImageCard = ({
|
|
|
3434
3412
|
"group-hover:opacity-100",
|
|
3435
3413
|
{ "opacity-100": checked }
|
|
3436
3414
|
),
|
|
3437
|
-
children: /* @__PURE__ */
|
|
3415
|
+
children: /* @__PURE__ */ jsx15(
|
|
3438
3416
|
Checkbox2,
|
|
3439
3417
|
{
|
|
3440
3418
|
checked,
|
|
@@ -3444,7 +3422,7 @@ var SelectedImageCard = ({
|
|
|
3444
3422
|
)
|
|
3445
3423
|
}
|
|
3446
3424
|
),
|
|
3447
|
-
/* @__PURE__ */
|
|
3425
|
+
/* @__PURE__ */ jsx15(
|
|
3448
3426
|
"img",
|
|
3449
3427
|
{
|
|
3450
3428
|
src: image.url,
|
|
@@ -3461,7 +3439,7 @@ var UnselectedImageCard = ({
|
|
|
3461
3439
|
onSelect
|
|
3462
3440
|
}) => {
|
|
3463
3441
|
const { t } = useTranslation13();
|
|
3464
|
-
return /* @__PURE__ */
|
|
3442
|
+
return /* @__PURE__ */ jsx15(
|
|
3465
3443
|
"button",
|
|
3466
3444
|
{
|
|
3467
3445
|
type: "button",
|
|
@@ -3473,7 +3451,7 @@ var UnselectedImageCard = ({
|
|
|
3473
3451
|
"outline-none focus-visible:shadow-borders-focus"
|
|
3474
3452
|
),
|
|
3475
3453
|
"aria-label": t("products.media.selectImages"),
|
|
3476
|
-
children: /* @__PURE__ */
|
|
3454
|
+
children: /* @__PURE__ */ jsx15(
|
|
3477
3455
|
"img",
|
|
3478
3456
|
{
|
|
3479
3457
|
src: image.url,
|
|
@@ -3492,7 +3470,7 @@ import {
|
|
|
3492
3470
|
TriangleLeftMini,
|
|
3493
3471
|
TriangleRightMini
|
|
3494
3472
|
} from "@medusajs/icons";
|
|
3495
|
-
import { Button as Button5, clx as clx2, IconButton as IconButton3, Text as
|
|
3473
|
+
import { Button as Button5, clx as clx2, IconButton as IconButton3, Text as Text4, Tooltip as Tooltip4 } from "@medusajs/ui";
|
|
3496
3474
|
import { useTranslation as useTranslation14 } from "react-i18next";
|
|
3497
3475
|
|
|
3498
3476
|
// src/pages/products/create/variant-media-view/variant-media-view-context.tsx
|
|
@@ -3500,7 +3478,7 @@ import { createContext } from "react";
|
|
|
3500
3478
|
var VariantMediaViewContext = createContext(null);
|
|
3501
3479
|
|
|
3502
3480
|
// src/pages/products/create/variant-media-view/components/variant-media-gallery/variant-media-gallery.tsx
|
|
3503
|
-
import { Fragment as Fragment5, jsx as
|
|
3481
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3504
3482
|
var VariantMediaGallery = ({
|
|
3505
3483
|
goToEdit,
|
|
3506
3484
|
variantMedia = []
|
|
@@ -3535,16 +3513,16 @@ var VariantMediaGallery = ({
|
|
|
3535
3513
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
3536
3514
|
}, [next, prev]);
|
|
3537
3515
|
const noMedia = !media.length;
|
|
3538
|
-
return /* @__PURE__ */
|
|
3539
|
-
/* @__PURE__ */
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
/* @__PURE__ */
|
|
3516
|
+
return /* @__PURE__ */ jsx16(VariantMediaViewContext.Consumer, { children: () => /* @__PURE__ */ jsx16("div", { className: "flex size-full flex-col bg-ui-bg-subtle", children: noMedia ? /* @__PURE__ */ jsxs14("div", { className: "flex size-full flex-col items-center justify-center gap-y-4 bg-ui-bg-subtle pb-8 pt-6", children: [
|
|
3517
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center", children: [
|
|
3518
|
+
/* @__PURE__ */ jsx16(Text4, { size: "small", leading: "compact", weight: "plus", className: "text-ui-fg-subtle", children: t("products.media.emptyState.header", "No media") }),
|
|
3519
|
+
/* @__PURE__ */ jsx16(Text4, { size: "small", className: "text-ui-fg-muted", children: t("products.media.emptyState.description", "No images assigned to this variant.") })
|
|
3542
3520
|
] }),
|
|
3543
|
-
/* @__PURE__ */
|
|
3544
|
-
] }) : /* @__PURE__ */
|
|
3545
|
-
/* @__PURE__ */
|
|
3546
|
-
media[curr]?.isThumbnail && /* @__PURE__ */
|
|
3547
|
-
/* @__PURE__ */
|
|
3521
|
+
/* @__PURE__ */ jsx16(Button5, { size: "small", variant: "secondary", onClick: goToEdit, children: t("products.media.emptyState.action", "Add images") })
|
|
3522
|
+
] }) : /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3523
|
+
/* @__PURE__ */ jsx16("div", { className: "relative size-full overflow-hidden bg-ui-bg-subtle", children: /* @__PURE__ */ jsx16("div", { className: "flex size-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs14("div", { className: "relative inline-block max-h-full max-w-full", children: [
|
|
3524
|
+
media[curr]?.isThumbnail && /* @__PURE__ */ jsx16("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx16(Tooltip4, { content: t("products.media.thumbnailTooltip"), children: /* @__PURE__ */ jsx16(ThumbnailBadge3, {}) }) }),
|
|
3525
|
+
/* @__PURE__ */ jsx16(
|
|
3548
3526
|
"img",
|
|
3549
3527
|
{
|
|
3550
3528
|
src: media[curr]?.url,
|
|
@@ -3553,12 +3531,12 @@ var VariantMediaGallery = ({
|
|
|
3553
3531
|
}
|
|
3554
3532
|
)
|
|
3555
3533
|
] }) }) }),
|
|
3556
|
-
media.length > 1 && /* @__PURE__ */
|
|
3557
|
-
/* @__PURE__ */
|
|
3558
|
-
/* @__PURE__ */
|
|
3534
|
+
media.length > 1 && /* @__PURE__ */ jsxs14("div", { className: "flex shrink-0 items-center justify-center gap-x-2 border-t p-3", children: [
|
|
3535
|
+
/* @__PURE__ */ jsx16(IconButton3, { size: "small", variant: "transparent", className: "text-ui-fg-muted", type: "button", onClick: prev, children: /* @__PURE__ */ jsx16(TriangleLeftMini, {}) }),
|
|
3536
|
+
/* @__PURE__ */ jsx16("div", { className: "flex items-center gap-x-2", children: media.slice(0, 8).map((item, idx) => {
|
|
3559
3537
|
const isCurrentImage = item.id === media[curr]?.id;
|
|
3560
3538
|
const originalIndex = media.findIndex((i) => i.id === item.id);
|
|
3561
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ jsx16(
|
|
3562
3540
|
"button",
|
|
3563
3541
|
{
|
|
3564
3542
|
type: "button",
|
|
@@ -3566,18 +3544,18 @@ var VariantMediaGallery = ({
|
|
|
3566
3544
|
className: clx2("size-7 overflow-hidden rounded-[4px] outline-none transition-fg", {
|
|
3567
3545
|
"shadow-borders-focus": isCurrentImage
|
|
3568
3546
|
}),
|
|
3569
|
-
children: /* @__PURE__ */
|
|
3547
|
+
children: /* @__PURE__ */ jsx16("img", { src: item.url, alt: "", className: "size-full object-cover" })
|
|
3570
3548
|
},
|
|
3571
3549
|
item.id
|
|
3572
3550
|
);
|
|
3573
3551
|
}) }),
|
|
3574
|
-
/* @__PURE__ */
|
|
3552
|
+
/* @__PURE__ */ jsx16(IconButton3, { size: "small", variant: "transparent", className: "text-ui-fg-muted", type: "button", onClick: next, children: /* @__PURE__ */ jsx16(TriangleRightMini, {}) })
|
|
3575
3553
|
] })
|
|
3576
3554
|
] }) }) });
|
|
3577
3555
|
};
|
|
3578
3556
|
|
|
3579
3557
|
// src/pages/products/create/variant-media-view/variant-media-view.tsx
|
|
3580
|
-
import { jsx as
|
|
3558
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3581
3559
|
var getView = (currentView) => {
|
|
3582
3560
|
if (currentView === "edit" /* EDIT */) return "edit" /* EDIT */;
|
|
3583
3561
|
return "gallery" /* GALLERY */;
|
|
@@ -3604,11 +3582,11 @@ var VariantMediaView = ({
|
|
|
3604
3582
|
const handleFooterSave = () => {
|
|
3605
3583
|
saveRef.current?.();
|
|
3606
3584
|
};
|
|
3607
|
-
return /* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3610
|
-
view === "gallery" /* GALLERY */ && /* @__PURE__ */
|
|
3611
|
-
view === "edit" /* EDIT */ && /* @__PURE__ */
|
|
3585
|
+
return /* @__PURE__ */ jsx17(VariantMediaViewContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs15(StackedFocusModal.Content, { children: [
|
|
3586
|
+
/* @__PURE__ */ jsx17(StackedFocusModal.Header, { children: view === "edit" /* EDIT */ ? /* @__PURE__ */ jsx17(Button6, { variant: "secondary", size: "small", onClick: contextValue.goToGallery, children: t("products.media.galleryLabel", "Gallery") }) : /* @__PURE__ */ jsx17(Button6, { variant: "secondary", size: "small", onClick: contextValue.goToEdit, children: t("products.media.editLabel", "Edit") }) }),
|
|
3587
|
+
/* @__PURE__ */ jsxs15(StackedFocusModal.Body, { className: "flex flex-col overflow-hidden", children: [
|
|
3588
|
+
view === "gallery" /* GALLERY */ && /* @__PURE__ */ jsx17(VariantMediaGallery, { goToEdit: contextValue.goToEdit, variantMedia: initialMedia }),
|
|
3589
|
+
view === "edit" /* EDIT */ && /* @__PURE__ */ jsx17(
|
|
3612
3590
|
EditVariantMediaForm,
|
|
3613
3591
|
{
|
|
3614
3592
|
variantIndex,
|
|
@@ -3621,15 +3599,15 @@ var VariantMediaView = ({
|
|
|
3621
3599
|
}
|
|
3622
3600
|
)
|
|
3623
3601
|
] }),
|
|
3624
|
-
view === "edit" /* EDIT */ && /* @__PURE__ */
|
|
3625
|
-
/* @__PURE__ */
|
|
3626
|
-
/* @__PURE__ */
|
|
3602
|
+
view === "edit" /* EDIT */ && /* @__PURE__ */ jsx17(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs15("div", { className: "flex justify-end gap-x-2", children: [
|
|
3603
|
+
/* @__PURE__ */ jsx17(Button6, { variant: "secondary", size: "small", onClick: onClose, children: t("actions.cancel") }),
|
|
3604
|
+
/* @__PURE__ */ jsx17(Button6, { size: "small", onClick: handleFooterSave, children: t("actions.save") })
|
|
3627
3605
|
] }) })
|
|
3628
3606
|
] }) });
|
|
3629
3607
|
};
|
|
3630
3608
|
|
|
3631
3609
|
// src/pages/products/create/product-create-page.tsx
|
|
3632
|
-
import { Fragment as Fragment6, jsx as
|
|
3610
|
+
import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3633
3611
|
var ProductCreateFormWithModal = ({
|
|
3634
3612
|
defaultChannel,
|
|
3635
3613
|
store
|
|
@@ -3663,8 +3641,8 @@ var ProductCreateFormWithModal = ({
|
|
|
3663
3641
|
}
|
|
3664
3642
|
handleCloseModal();
|
|
3665
3643
|
}, []);
|
|
3666
|
-
return /* @__PURE__ */
|
|
3667
|
-
/* @__PURE__ */
|
|
3644
|
+
return /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
3645
|
+
/* @__PURE__ */ jsx18(
|
|
3668
3646
|
ProductCreateForm,
|
|
3669
3647
|
{
|
|
3670
3648
|
defaultChannel,
|
|
@@ -3673,7 +3651,7 @@ var ProductCreateFormWithModal = ({
|
|
|
3673
3651
|
onSaveVariantMediaRef: saveVariantMediaRef
|
|
3674
3652
|
}
|
|
3675
3653
|
),
|
|
3676
|
-
/* @__PURE__ */
|
|
3654
|
+
/* @__PURE__ */ jsx18(
|
|
3677
3655
|
StackedFocusModal,
|
|
3678
3656
|
{
|
|
3679
3657
|
id: "variant-media-modal",
|
|
@@ -3682,7 +3660,7 @@ var ProductCreateFormWithModal = ({
|
|
|
3682
3660
|
handleCloseModal();
|
|
3683
3661
|
}
|
|
3684
3662
|
},
|
|
3685
|
-
children: selectedVariantIndex !== null && /* @__PURE__ */
|
|
3663
|
+
children: selectedVariantIndex !== null && /* @__PURE__ */ jsx18(
|
|
3686
3664
|
VariantMediaView,
|
|
3687
3665
|
{
|
|
3688
3666
|
variantIndex: selectedVariantIndex,
|
|
@@ -3703,10 +3681,10 @@ var Root4 = ({ children }) => {
|
|
|
3703
3681
|
const { sales_channels, isPending: isSalesChannelPending } = useSalesChannels();
|
|
3704
3682
|
const ready = !!store && !isStorePending && !!sales_channels && !isSalesChannelPending;
|
|
3705
3683
|
const defaultChannel = sales_channels?.[0];
|
|
3706
|
-
return /* @__PURE__ */
|
|
3707
|
-
/* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
3709
|
-
ready && (Children4.count(children) > 0 ? children : /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsxs16(RouteFocusModal, { children: [
|
|
3685
|
+
/* @__PURE__ */ jsx18(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx18("span", { className: "sr-only", children: t("products.create.title") }) }),
|
|
3686
|
+
/* @__PURE__ */ jsx18(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx18("span", { className: "sr-only", children: t("products.create.description") }) }),
|
|
3687
|
+
ready && (Children4.count(children) > 0 ? children : /* @__PURE__ */ jsx18(ProductCreateFormWithModal, { defaultChannel, store }))
|
|
3710
3688
|
] });
|
|
3711
3689
|
};
|
|
3712
3690
|
var ProductCreatePage = Object.assign(Root4, {
|