@medusajs/loyalty-plugin 2.14.1-preview-20260424092954 → 2.14.1

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.
@@ -25934,6 +25934,73 @@ const KeyboundForm = React__namespace.default.forwardRef(({ onSubmit, onKeyDown,
25934
25934
  );
25935
25935
  });
25936
25936
  KeyboundForm.displayName = "KeyboundForm";
25937
+ const Note$1 = () => {
25938
+ const { id } = reactRouterDom.useParams();
25939
+ const {
25940
+ gift_card: giftCard,
25941
+ isPending,
25942
+ isError,
25943
+ error
25944
+ } = useGiftCard(id, {});
25945
+ if (isError) {
25946
+ throw error;
25947
+ }
25948
+ const isReady = !isPending && !!giftCard;
25949
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
25950
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
25951
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit note" }) }),
25952
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
25953
+ ] }),
25954
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(GiftCardNoteForm, { giftCard })
25955
+ ] });
25956
+ };
25957
+ const GiftCardNoteForm = ({ giftCard }) => {
25958
+ const form = useForm({
25959
+ defaultValues: {
25960
+ note: giftCard.note ?? ""
25961
+ },
25962
+ resolver: t(schema$2)
25963
+ });
25964
+ const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
25965
+ const { handleSuccess } = useRouteModal();
25966
+ const onSubmit = form.handleSubmit(async (data) => {
25967
+ await mutateAsync(
25968
+ { note: data.note },
25969
+ {
25970
+ onSuccess: () => handleSuccess(),
25971
+ onError: (error) => ui.toast.error(error.message)
25972
+ }
25973
+ );
25974
+ });
25975
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
25976
+ KeyboundForm,
25977
+ {
25978
+ className: "flex flex-1 flex-col overflow-hidden",
25979
+ onSubmit,
25980
+ children: [
25981
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
25982
+ Form$2.Field,
25983
+ {
25984
+ control: form.control,
25985
+ name: "note",
25986
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
25987
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Note" }),
25988
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Textarea, { ...field }) }),
25989
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
25990
+ ] })
25991
+ }
25992
+ ) }),
25993
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
25994
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
25995
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
25996
+ ] }) })
25997
+ ]
25998
+ }
25999
+ ) });
26000
+ };
26001
+ const schema$2 = zod.z.object({
26002
+ note: zod.z.string().optional()
26003
+ });
25937
26004
  const GiftCardExpiration = () => {
25938
26005
  const { id } = reactRouterDom.useParams();
25939
26006
  const { gift_card: giftCard, isPending, isError, error } = useGiftCard(id);
@@ -25954,7 +26021,7 @@ const GiftCardExpirationForm = ({ giftCard }) => {
25954
26021
  defaultValues: {
25955
26022
  expires_at: giftCard.expires_at ? new Date(giftCard.expires_at) : null
25956
26023
  },
25957
- resolver: t(schema$2)
26024
+ resolver: t(schema$1)
25958
26025
  });
25959
26026
  const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
25960
26027
  const { handleSuccess } = useRouteModal();
@@ -26049,75 +26116,8 @@ const GiftCardExpirationForm = ({ giftCard }) => {
26049
26116
  }
26050
26117
  ) });
26051
26118
  };
26052
- const schema$2 = zod.z.object({
26053
- expires_at: zod.z.date().nullish()
26054
- });
26055
- const Note$1 = () => {
26056
- const { id } = reactRouterDom.useParams();
26057
- const {
26058
- gift_card: giftCard,
26059
- isPending,
26060
- isError,
26061
- error
26062
- } = useGiftCard(id, {});
26063
- if (isError) {
26064
- throw error;
26065
- }
26066
- const isReady = !isPending && !!giftCard;
26067
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
26068
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
26069
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit note" }) }),
26070
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
26071
- ] }),
26072
- isReady && /* @__PURE__ */ jsxRuntime.jsx(GiftCardNoteForm, { giftCard })
26073
- ] });
26074
- };
26075
- const GiftCardNoteForm = ({ giftCard }) => {
26076
- const form = useForm({
26077
- defaultValues: {
26078
- note: giftCard.note ?? ""
26079
- },
26080
- resolver: t(schema$1)
26081
- });
26082
- const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
26083
- const { handleSuccess } = useRouteModal();
26084
- const onSubmit = form.handleSubmit(async (data) => {
26085
- await mutateAsync(
26086
- { note: data.note },
26087
- {
26088
- onSuccess: () => handleSuccess(),
26089
- onError: (error) => ui.toast.error(error.message)
26090
- }
26091
- );
26092
- });
26093
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
26094
- KeyboundForm,
26095
- {
26096
- className: "flex flex-1 flex-col overflow-hidden",
26097
- onSubmit,
26098
- children: [
26099
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
26100
- Form$2.Field,
26101
- {
26102
- control: form.control,
26103
- name: "note",
26104
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
26105
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Note" }),
26106
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Textarea, { ...field }) }),
26107
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
26108
- ] })
26109
- }
26110
- ) }),
26111
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
26112
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
26113
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
26114
- ] }) })
26115
- ]
26116
- }
26117
- ) });
26118
- };
26119
26119
  const schema$1 = zod.z.object({
26120
- note: zod.z.string().optional()
26120
+ expires_at: zod.z.date().nullish()
26121
26121
  });
26122
26122
  const columnHelper$7 = createColumnHelper();
26123
26123
  const useGiftCardProductsTableColumns = () => {
@@ -41476,13 +41476,13 @@ const routeModule = {
41476
41476
  Component: GiftCardDetailsPage,
41477
41477
  path: "/gift-cards/:id",
41478
41478
  children: [
41479
- {
41480
- Component: GiftCardExpiration,
41481
- path: "/gift-cards/:id/expiration"
41482
- },
41483
41479
  {
41484
41480
  Component: Note$1,
41485
41481
  path: "/gift-cards/:id/note"
41482
+ },
41483
+ {
41484
+ Component: GiftCardExpiration,
41485
+ path: "/gift-cards/:id/expiration"
41486
41486
  }
41487
41487
  ]
41488
41488
  },
@@ -41537,17 +41537,17 @@ const routeModule = {
41537
41537
  const menuItemModule = {
41538
41538
  menuItems: [
41539
41539
  {
41540
- label: config$3.label,
41541
- icon: config$3.icon,
41542
- path: "/gift-cards",
41540
+ label: config$1.label,
41541
+ icon: config$1.icon,
41542
+ path: "/store-credit-accounts",
41543
41543
  nested: void 0,
41544
41544
  rank: void 0,
41545
41545
  translationNs: void 0
41546
41546
  },
41547
41547
  {
41548
- label: config$1.label,
41549
- icon: config$1.icon,
41550
- path: "/store-credit-accounts",
41548
+ label: config$3.label,
41549
+ icon: config$3.icon,
41550
+ path: "/gift-cards",
41551
41551
  nested: void 0,
41552
41552
  rank: void 0,
41553
41553
  translationNs: void 0
@@ -25914,6 +25914,73 @@ const KeyboundForm = React__default.forwardRef(({ onSubmit, onKeyDown, ...rest }
25914
25914
  );
25915
25915
  });
25916
25916
  KeyboundForm.displayName = "KeyboundForm";
25917
+ const Note$1 = () => {
25918
+ const { id } = useParams();
25919
+ const {
25920
+ gift_card: giftCard,
25921
+ isPending,
25922
+ isError,
25923
+ error
25924
+ } = useGiftCard(id, {});
25925
+ if (isError) {
25926
+ throw error;
25927
+ }
25928
+ const isReady = !isPending && !!giftCard;
25929
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
25930
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
25931
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit note" }) }),
25932
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
25933
+ ] }),
25934
+ isReady && /* @__PURE__ */ jsx(GiftCardNoteForm, { giftCard })
25935
+ ] });
25936
+ };
25937
+ const GiftCardNoteForm = ({ giftCard }) => {
25938
+ const form = useForm({
25939
+ defaultValues: {
25940
+ note: giftCard.note ?? ""
25941
+ },
25942
+ resolver: t(schema$2)
25943
+ });
25944
+ const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
25945
+ const { handleSuccess } = useRouteModal();
25946
+ const onSubmit = form.handleSubmit(async (data) => {
25947
+ await mutateAsync(
25948
+ { note: data.note },
25949
+ {
25950
+ onSuccess: () => handleSuccess(),
25951
+ onError: (error) => toast.error(error.message)
25952
+ }
25953
+ );
25954
+ });
25955
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
25956
+ KeyboundForm,
25957
+ {
25958
+ className: "flex flex-1 flex-col overflow-hidden",
25959
+ onSubmit,
25960
+ children: [
25961
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
25962
+ Form$2.Field,
25963
+ {
25964
+ control: form.control,
25965
+ name: "note",
25966
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
25967
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Note" }),
25968
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
25969
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
25970
+ ] })
25971
+ }
25972
+ ) }),
25973
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
25974
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
25975
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
25976
+ ] }) })
25977
+ ]
25978
+ }
25979
+ ) });
25980
+ };
25981
+ const schema$2 = z.object({
25982
+ note: z.string().optional()
25983
+ });
25917
25984
  const GiftCardExpiration = () => {
25918
25985
  const { id } = useParams();
25919
25986
  const { gift_card: giftCard, isPending, isError, error } = useGiftCard(id);
@@ -25934,7 +26001,7 @@ const GiftCardExpirationForm = ({ giftCard }) => {
25934
26001
  defaultValues: {
25935
26002
  expires_at: giftCard.expires_at ? new Date(giftCard.expires_at) : null
25936
26003
  },
25937
- resolver: t(schema$2)
26004
+ resolver: t(schema$1)
25938
26005
  });
25939
26006
  const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
25940
26007
  const { handleSuccess } = useRouteModal();
@@ -26029,75 +26096,8 @@ const GiftCardExpirationForm = ({ giftCard }) => {
26029
26096
  }
26030
26097
  ) });
26031
26098
  };
26032
- const schema$2 = z.object({
26033
- expires_at: z.date().nullish()
26034
- });
26035
- const Note$1 = () => {
26036
- const { id } = useParams();
26037
- const {
26038
- gift_card: giftCard,
26039
- isPending,
26040
- isError,
26041
- error
26042
- } = useGiftCard(id, {});
26043
- if (isError) {
26044
- throw error;
26045
- }
26046
- const isReady = !isPending && !!giftCard;
26047
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
26048
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
26049
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit note" }) }),
26050
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
26051
- ] }),
26052
- isReady && /* @__PURE__ */ jsx(GiftCardNoteForm, { giftCard })
26053
- ] });
26054
- };
26055
- const GiftCardNoteForm = ({ giftCard }) => {
26056
- const form = useForm({
26057
- defaultValues: {
26058
- note: giftCard.note ?? ""
26059
- },
26060
- resolver: t(schema$1)
26061
- });
26062
- const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
26063
- const { handleSuccess } = useRouteModal();
26064
- const onSubmit = form.handleSubmit(async (data) => {
26065
- await mutateAsync(
26066
- { note: data.note },
26067
- {
26068
- onSuccess: () => handleSuccess(),
26069
- onError: (error) => toast.error(error.message)
26070
- }
26071
- );
26072
- });
26073
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
26074
- KeyboundForm,
26075
- {
26076
- className: "flex flex-1 flex-col overflow-hidden",
26077
- onSubmit,
26078
- children: [
26079
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
26080
- Form$2.Field,
26081
- {
26082
- control: form.control,
26083
- name: "note",
26084
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
26085
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Note" }),
26086
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
26087
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
26088
- ] })
26089
- }
26090
- ) }),
26091
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
26092
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
26093
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
26094
- ] }) })
26095
- ]
26096
- }
26097
- ) });
26098
- };
26099
26099
  const schema$1 = z.object({
26100
- note: z.string().optional()
26100
+ expires_at: z.date().nullish()
26101
26101
  });
26102
26102
  const columnHelper$7 = createColumnHelper();
26103
26103
  const useGiftCardProductsTableColumns = () => {
@@ -41456,13 +41456,13 @@ const routeModule = {
41456
41456
  Component: GiftCardDetailsPage,
41457
41457
  path: "/gift-cards/:id",
41458
41458
  children: [
41459
- {
41460
- Component: GiftCardExpiration,
41461
- path: "/gift-cards/:id/expiration"
41462
- },
41463
41459
  {
41464
41460
  Component: Note$1,
41465
41461
  path: "/gift-cards/:id/note"
41462
+ },
41463
+ {
41464
+ Component: GiftCardExpiration,
41465
+ path: "/gift-cards/:id/expiration"
41466
41466
  }
41467
41467
  ]
41468
41468
  },
@@ -41517,17 +41517,17 @@ const routeModule = {
41517
41517
  const menuItemModule = {
41518
41518
  menuItems: [
41519
41519
  {
41520
- label: config$3.label,
41521
- icon: config$3.icon,
41522
- path: "/gift-cards",
41520
+ label: config$1.label,
41521
+ icon: config$1.icon,
41522
+ path: "/store-credit-accounts",
41523
41523
  nested: void 0,
41524
41524
  rank: void 0,
41525
41525
  translationNs: void 0
41526
41526
  },
41527
41527
  {
41528
- label: config$1.label,
41529
- icon: config$1.icon,
41530
- path: "/store-credit-accounts",
41528
+ label: config$3.label,
41529
+ icon: config$3.icon,
41530
+ path: "/gift-cards",
41531
41531
  nested: void 0,
41532
41532
  rank: void 0,
41533
41533
  translationNs: void 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/loyalty-plugin",
3
- "version": "2.14.1-preview-20260424092954",
3
+ "version": "2.14.1",
4
4
  "description": "Medusa Plugin: Loyalty - Gift Cards",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",
@@ -49,14 +49,14 @@
49
49
  "prepare": "cross-env NODE_ENV=production yarn run build"
50
50
  },
51
51
  "devDependencies": {
52
- "@medusajs/admin-sdk": "2.14.1-preview-20260424092954",
53
- "@medusajs/cli": "2.14.1-preview-20260424092954",
54
- "@medusajs/framework": "2.14.1-preview-20260424092954",
55
- "@medusajs/icons": "2.14.1-preview-20260424092954",
56
- "@medusajs/test-utils": "2.14.1-preview-20260424092954",
57
- "@medusajs/types": "2.14.1-preview-20260424092954",
58
- "@medusajs/ui": "4.1.8-preview-20260424092954",
59
- "@medusajs/ui-preset": "2.14.1-preview-20260424092954",
52
+ "@medusajs/admin-sdk": "2.14.1",
53
+ "@medusajs/cli": "2.14.1",
54
+ "@medusajs/framework": "2.14.1",
55
+ "@medusajs/icons": "2.14.1",
56
+ "@medusajs/test-utils": "2.14.1",
57
+ "@medusajs/types": "2.14.1",
58
+ "@medusajs/ui": "4.1.8",
59
+ "@medusajs/ui-preset": "2.14.1",
60
60
  "@swc/core": "1.5.7",
61
61
  "@types/node": "^20.0.0",
62
62
  "cross-env": "^7.0.3",
@@ -64,12 +64,12 @@
64
64
  "typescript": "^5.7.3"
65
65
  },
66
66
  "peerDependencies": {
67
- "@medusajs/admin-sdk": "2.14.1-preview-20260424092954",
68
- "@medusajs/cli": "2.14.1-preview-20260424092954",
69
- "@medusajs/framework": "2.14.1-preview-20260424092954",
70
- "@medusajs/icons": "2.14.1-preview-20260424092954",
71
- "@medusajs/test-utils": "2.14.1-preview-20260424092954",
72
- "@medusajs/ui": "4.1.8-preview-20260424092954",
67
+ "@medusajs/admin-sdk": "2.14.1",
68
+ "@medusajs/cli": "2.14.1",
69
+ "@medusajs/framework": "2.14.1",
70
+ "@medusajs/icons": "2.14.1",
71
+ "@medusajs/test-utils": "2.14.1",
72
+ "@medusajs/ui": "4.1.8",
73
73
  "react": "^18.3.1",
74
74
  "react-dom": "^18.3.1",
75
75
  "react-router-dom": "6.30.3"