@medusajs/loyalty-plugin 2.17.1 → 2.17.2-preview-20260625100139

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.
@@ -25947,73 +25947,6 @@ const KeyboundForm = React__namespace.default.forwardRef(({ onSubmit, onKeyDown,
25947
25947
  );
25948
25948
  });
25949
25949
  KeyboundForm.displayName = "KeyboundForm";
25950
- const Note$1 = () => {
25951
- const { id } = reactRouterDom.useParams();
25952
- const {
25953
- gift_card: giftCard,
25954
- isPending,
25955
- isError,
25956
- error
25957
- } = useGiftCard(id, {});
25958
- if (isError) {
25959
- throw error;
25960
- }
25961
- const isReady = !isPending && !!giftCard;
25962
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
25963
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
25964
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit note" }) }),
25965
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
25966
- ] }),
25967
- isReady && /* @__PURE__ */ jsxRuntime.jsx(GiftCardNoteForm, { giftCard })
25968
- ] });
25969
- };
25970
- const GiftCardNoteForm = ({ giftCard }) => {
25971
- const form = useForm({
25972
- defaultValues: {
25973
- note: giftCard.note ?? ""
25974
- },
25975
- resolver: t(schema$2)
25976
- });
25977
- const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
25978
- const { handleSuccess } = useRouteModal();
25979
- const onSubmit = form.handleSubmit(async (data) => {
25980
- await mutateAsync(
25981
- { note: data.note },
25982
- {
25983
- onSuccess: () => handleSuccess(),
25984
- onError: (error) => ui.toast.error(error.message)
25985
- }
25986
- );
25987
- });
25988
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
25989
- KeyboundForm,
25990
- {
25991
- className: "flex flex-1 flex-col overflow-hidden",
25992
- onSubmit,
25993
- children: [
25994
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
25995
- Form$2.Field,
25996
- {
25997
- control: form.control,
25998
- name: "note",
25999
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
26000
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Note" }),
26001
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Textarea, { ...field }) }),
26002
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
26003
- ] })
26004
- }
26005
- ) }),
26006
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
26007
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
26008
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
26009
- ] }) })
26010
- ]
26011
- }
26012
- ) });
26013
- };
26014
- const schema$2 = zod.z.object({
26015
- note: zod.z.string().optional()
26016
- });
26017
25950
  const GiftCardExpiration = () => {
26018
25951
  const { id } = reactRouterDom.useParams();
26019
25952
  const { gift_card: giftCard, isPending, isError, error } = useGiftCard(id);
@@ -26034,7 +25967,7 @@ const GiftCardExpirationForm = ({ giftCard }) => {
26034
25967
  defaultValues: {
26035
25968
  expires_at: giftCard.expires_at ? new Date(giftCard.expires_at) : null
26036
25969
  },
26037
- resolver: t(schema$1)
25970
+ resolver: t(schema$2)
26038
25971
  });
26039
25972
  const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
26040
25973
  const { handleSuccess } = useRouteModal();
@@ -26129,9 +26062,76 @@ const GiftCardExpirationForm = ({ giftCard }) => {
26129
26062
  }
26130
26063
  ) });
26131
26064
  };
26132
- const schema$1 = zod.z.object({
26065
+ const schema$2 = zod.z.object({
26133
26066
  expires_at: zod.z.date().nullish()
26134
26067
  });
26068
+ const Note$1 = () => {
26069
+ const { id } = reactRouterDom.useParams();
26070
+ const {
26071
+ gift_card: giftCard,
26072
+ isPending,
26073
+ isError,
26074
+ error
26075
+ } = useGiftCard(id, {});
26076
+ if (isError) {
26077
+ throw error;
26078
+ }
26079
+ const isReady = !isPending && !!giftCard;
26080
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
26081
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
26082
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit note" }) }),
26083
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
26084
+ ] }),
26085
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(GiftCardNoteForm, { giftCard })
26086
+ ] });
26087
+ };
26088
+ const GiftCardNoteForm = ({ giftCard }) => {
26089
+ const form = useForm({
26090
+ defaultValues: {
26091
+ note: giftCard.note ?? ""
26092
+ },
26093
+ resolver: t(schema$1)
26094
+ });
26095
+ const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
26096
+ const { handleSuccess } = useRouteModal();
26097
+ const onSubmit = form.handleSubmit(async (data) => {
26098
+ await mutateAsync(
26099
+ { note: data.note },
26100
+ {
26101
+ onSuccess: () => handleSuccess(),
26102
+ onError: (error) => ui.toast.error(error.message)
26103
+ }
26104
+ );
26105
+ });
26106
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
26107
+ KeyboundForm,
26108
+ {
26109
+ className: "flex flex-1 flex-col overflow-hidden",
26110
+ onSubmit,
26111
+ children: [
26112
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
26113
+ Form$2.Field,
26114
+ {
26115
+ control: form.control,
26116
+ name: "note",
26117
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
26118
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Note" }),
26119
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Textarea, { ...field }) }),
26120
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
26121
+ ] })
26122
+ }
26123
+ ) }),
26124
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
26125
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
26126
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
26127
+ ] }) })
26128
+ ]
26129
+ }
26130
+ ) });
26131
+ };
26132
+ const schema$1 = zod.z.object({
26133
+ note: zod.z.string().optional()
26134
+ });
26135
26135
  const columnHelper$7 = createColumnHelper();
26136
26136
  const useGiftCardProductsTableColumns = () => {
26137
26137
  return React.useMemo(
@@ -41505,13 +41505,13 @@ const routeModule = {
41505
41505
  Component: GiftCardDetailsPage,
41506
41506
  path: "/gift-cards/:id",
41507
41507
  children: [
41508
- {
41509
- Component: Note$1,
41510
- path: "/gift-cards/:id/note"
41511
- },
41512
41508
  {
41513
41509
  Component: GiftCardExpiration,
41514
41510
  path: "/gift-cards/:id/expiration"
41511
+ },
41512
+ {
41513
+ Component: Note$1,
41514
+ path: "/gift-cards/:id/note"
41515
41515
  }
41516
41516
  ]
41517
41517
  },
@@ -25927,73 +25927,6 @@ const KeyboundForm = React__default.forwardRef(({ onSubmit, onKeyDown, ...rest }
25927
25927
  );
25928
25928
  });
25929
25929
  KeyboundForm.displayName = "KeyboundForm";
25930
- const Note$1 = () => {
25931
- const { id } = useParams();
25932
- const {
25933
- gift_card: giftCard,
25934
- isPending,
25935
- isError,
25936
- error
25937
- } = useGiftCard(id, {});
25938
- if (isError) {
25939
- throw error;
25940
- }
25941
- const isReady = !isPending && !!giftCard;
25942
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
25943
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
25944
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit note" }) }),
25945
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
25946
- ] }),
25947
- isReady && /* @__PURE__ */ jsx(GiftCardNoteForm, { giftCard })
25948
- ] });
25949
- };
25950
- const GiftCardNoteForm = ({ giftCard }) => {
25951
- const form = useForm({
25952
- defaultValues: {
25953
- note: giftCard.note ?? ""
25954
- },
25955
- resolver: t(schema$2)
25956
- });
25957
- const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
25958
- const { handleSuccess } = useRouteModal();
25959
- const onSubmit = form.handleSubmit(async (data) => {
25960
- await mutateAsync(
25961
- { note: data.note },
25962
- {
25963
- onSuccess: () => handleSuccess(),
25964
- onError: (error) => toast.error(error.message)
25965
- }
25966
- );
25967
- });
25968
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
25969
- KeyboundForm,
25970
- {
25971
- className: "flex flex-1 flex-col overflow-hidden",
25972
- onSubmit,
25973
- children: [
25974
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
25975
- Form$2.Field,
25976
- {
25977
- control: form.control,
25978
- name: "note",
25979
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
25980
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Note" }),
25981
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
25982
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
25983
- ] })
25984
- }
25985
- ) }),
25986
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
25987
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
25988
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
25989
- ] }) })
25990
- ]
25991
- }
25992
- ) });
25993
- };
25994
- const schema$2 = z.object({
25995
- note: z.string().optional()
25996
- });
25997
25930
  const GiftCardExpiration = () => {
25998
25931
  const { id } = useParams();
25999
25932
  const { gift_card: giftCard, isPending, isError, error } = useGiftCard(id);
@@ -26014,7 +25947,7 @@ const GiftCardExpirationForm = ({ giftCard }) => {
26014
25947
  defaultValues: {
26015
25948
  expires_at: giftCard.expires_at ? new Date(giftCard.expires_at) : null
26016
25949
  },
26017
- resolver: t(schema$1)
25950
+ resolver: t(schema$2)
26018
25951
  });
26019
25952
  const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
26020
25953
  const { handleSuccess } = useRouteModal();
@@ -26109,9 +26042,76 @@ const GiftCardExpirationForm = ({ giftCard }) => {
26109
26042
  }
26110
26043
  ) });
26111
26044
  };
26112
- const schema$1 = z.object({
26045
+ const schema$2 = z.object({
26113
26046
  expires_at: z.date().nullish()
26114
26047
  });
26048
+ const Note$1 = () => {
26049
+ const { id } = useParams();
26050
+ const {
26051
+ gift_card: giftCard,
26052
+ isPending,
26053
+ isError,
26054
+ error
26055
+ } = useGiftCard(id, {});
26056
+ if (isError) {
26057
+ throw error;
26058
+ }
26059
+ const isReady = !isPending && !!giftCard;
26060
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
26061
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
26062
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit note" }) }),
26063
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the note for the gift card" }) })
26064
+ ] }),
26065
+ isReady && /* @__PURE__ */ jsx(GiftCardNoteForm, { giftCard })
26066
+ ] });
26067
+ };
26068
+ const GiftCardNoteForm = ({ giftCard }) => {
26069
+ const form = useForm({
26070
+ defaultValues: {
26071
+ note: giftCard.note ?? ""
26072
+ },
26073
+ resolver: t(schema$1)
26074
+ });
26075
+ const { mutateAsync, isPending } = useUpdateGiftCard(giftCard.id);
26076
+ const { handleSuccess } = useRouteModal();
26077
+ const onSubmit = form.handleSubmit(async (data) => {
26078
+ await mutateAsync(
26079
+ { note: data.note },
26080
+ {
26081
+ onSuccess: () => handleSuccess(),
26082
+ onError: (error) => toast.error(error.message)
26083
+ }
26084
+ );
26085
+ });
26086
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
26087
+ KeyboundForm,
26088
+ {
26089
+ className: "flex flex-1 flex-col overflow-hidden",
26090
+ onSubmit,
26091
+ children: [
26092
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
26093
+ Form$2.Field,
26094
+ {
26095
+ control: form.control,
26096
+ name: "note",
26097
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
26098
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Note" }),
26099
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
26100
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
26101
+ ] })
26102
+ }
26103
+ ) }),
26104
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
26105
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
26106
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
26107
+ ] }) })
26108
+ ]
26109
+ }
26110
+ ) });
26111
+ };
26112
+ const schema$1 = z.object({
26113
+ note: z.string().optional()
26114
+ });
26115
26115
  const columnHelper$7 = createColumnHelper();
26116
26116
  const useGiftCardProductsTableColumns = () => {
26117
26117
  return useMemo(
@@ -41485,13 +41485,13 @@ const routeModule = {
41485
41485
  Component: GiftCardDetailsPage,
41486
41486
  path: "/gift-cards/:id",
41487
41487
  children: [
41488
- {
41489
- Component: Note$1,
41490
- path: "/gift-cards/:id/note"
41491
- },
41492
41488
  {
41493
41489
  Component: GiftCardExpiration,
41494
41490
  path: "/gift-cards/:id/expiration"
41491
+ },
41492
+ {
41493
+ Component: Note$1,
41494
+ path: "/gift-cards/:id/note"
41495
41495
  }
41496
41496
  ]
41497
41497
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/loyalty-plugin",
3
- "version": "2.17.1",
3
+ "version": "2.17.2-preview-20260625100139",
4
4
  "description": "Medusa Plugin: Loyalty - Gift Cards",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",
@@ -51,15 +51,15 @@
51
51
  "watch": "medusa plugin:develop"
52
52
  },
53
53
  "devDependencies": {
54
- "@medusajs/admin-sdk": "2.17.1",
55
- "@medusajs/cli": "2.17.1",
56
- "@medusajs/dashboard": "2.17.1",
57
- "@medusajs/framework": "2.17.1",
58
- "@medusajs/icons": "2.17.1",
59
- "@medusajs/test-utils": "2.17.1",
60
- "@medusajs/types": "2.17.1",
61
- "@medusajs/ui": "4.1.18",
62
- "@medusajs/ui-preset": "2.17.1",
54
+ "@medusajs/admin-sdk": "2.17.2-preview-20260625100139",
55
+ "@medusajs/cli": "2.17.2-preview-20260625100139",
56
+ "@medusajs/dashboard": "2.17.2-preview-20260625100139",
57
+ "@medusajs/framework": "2.17.2-preview-20260625100139",
58
+ "@medusajs/icons": "2.17.2-preview-20260625100139",
59
+ "@medusajs/test-utils": "2.17.2-preview-20260625100139",
60
+ "@medusajs/types": "2.17.2-preview-20260625100139",
61
+ "@medusajs/ui": "4.1.19-preview-20260625100139",
62
+ "@medusajs/ui-preset": "2.17.2-preview-20260625100139",
63
63
  "@swc/core": "1.5.7",
64
64
  "@types/node": "^20.0.0",
65
65
  "cross-env": "^7.0.3",
@@ -67,13 +67,13 @@
67
67
  "typescript": "^5.7.3"
68
68
  },
69
69
  "peerDependencies": {
70
- "@medusajs/admin-sdk": "2.17.1",
71
- "@medusajs/cli": "2.17.1",
72
- "@medusajs/dashboard": "2.17.1",
73
- "@medusajs/framework": "2.17.1",
74
- "@medusajs/icons": "2.17.1",
75
- "@medusajs/test-utils": "2.17.1",
76
- "@medusajs/ui": "4.1.18",
70
+ "@medusajs/admin-sdk": "2.17.2-preview-20260625100139",
71
+ "@medusajs/cli": "2.17.2-preview-20260625100139",
72
+ "@medusajs/dashboard": "2.17.2-preview-20260625100139",
73
+ "@medusajs/framework": "2.17.2-preview-20260625100139",
74
+ "@medusajs/icons": "2.17.2-preview-20260625100139",
75
+ "@medusajs/test-utils": "2.17.2-preview-20260625100139",
76
+ "@medusajs/ui": "4.1.19-preview-20260625100139",
77
77
  "react": "^18.3.1",
78
78
  "react-dom": "^18.3.1",
79
79
  "react-router-dom": "6.30.4"