@shophost/react 2.0.31 → 2.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as i, c as r, a as o, g as d } from "./admin-client.js";
1
+ import { A as a, c as r, b as o, g as d } from "./admin-client.js";
2
2
  function t(e) {
3
3
  return {
4
4
  basePath: "/admin",
@@ -6,7 +6,7 @@ function t(e) {
6
6
  };
7
7
  }
8
8
  export {
9
- i as AdminProvider,
9
+ a as AdminProvider,
10
10
  r as createAdminAuthClient,
11
11
  o as createRoutes,
12
12
  t as defineConfig,
package/next/server.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("../admin-client.cjs"),f=require("next/navigation.js"),w=require("react");function V(s){if(s.length===0)return{type:"home"};const[a,n,i,o,c]=s;if(a==="auth")return n==="sign-in"?{type:"sign-in"}:n==="sign-up"?{type:"sign-up"}:{type:"not-found"};if(a==="organizations")return{type:"organizations"};const r=a;return n?n==="dashboard"?{type:"dashboard",orgId:r}:n==="orders"?{type:"orders",orgId:r}:n==="reservations"?{type:"reservations",orgId:r}:n==="products"?i?i==="create"?{type:"product-create",orgId:r}:{type:"product-edit",orgId:r,id:i}:{type:"products-list",orgId:r}:n==="product-categories"?i?i==="create"?{type:"product-category-create",orgId:r}:{type:"product-category-edit",orgId:r,id:i}:{type:"product-categories-list",orgId:r}:n==="manufacturers"?i?i==="create"?{type:"manufacturer-create",orgId:r}:{type:"manufacturer-edit",orgId:r,id:i}:{type:"manufacturers-list",orgId:r}:n==="settings"?i?i==="opening-times"?{type:"settings-opening-times",orgId:r}:i==="shipping-methods"?o?o==="create"?{type:"shipping-method-create",orgId:r}:{type:"shipping-method-edit",orgId:r,id:o}:{type:"shipping-methods-list",orgId:r}:i==="access"?o?o==="invite"?{type:"access-invite",orgId:r}:{type:"access-member-edit",orgId:r,id:o}:{type:"access-list",orgId:r}:{type:"settings",orgId:r}:{type:"settings",orgId:r}:{type:"not-found"}:{type:"not-found"}}function v({segments:s}){const a=e.useAdminAuth(),n=e.useAdminRoutes(),i=f.useRouter(),o=f.usePathname(),c=f.useSearchParams(),{data:r,isPending:p}=a.useSession(),u=V(s),d=u.type==="sign-in"||u.type==="sign-up",l=u.type==="home"||u.type==="organizations",y=c==null?void 0:c.get("redirect"),h=c==null?void 0:c.toString(),m=o?`${o}${h?`?${h}`:""}`:n.home,g=d?e.resolveAdminRedirectPath(y,n):m;if(w.useEffect(()=>{if(!p){if(!r&&!d){i.replace(e.buildAdminAuthHref(n.signIn,g));return}r&&d&&i.replace(g)}},[r,p,d,i,n.signIn,g]),p)return t.jsx("div",{className:"flex justify-center items-center h-screen",children:t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})});if(d){if(u.type==="sign-in")return t.jsx(e.SignInView,{});if(u.type==="sign-up")return t.jsx(e.SignUpView,{})}if(!r)return null;if(l)return t.jsx(e.OrganizationProvider,{children:t.jsx(e.OrganizationsView,{})});if(u.type==="not-found")return t.jsx(e.ErrorView,{});const j="orgId"in u?u.orgId:void 0,x="id"in u?u.id:void 0;return t.jsx(e.RouteParamsProvider,{organizationId:j,id:x,children:t.jsx(e.OrganizationProvider,{children:t.jsx(e.FlyoutProvider,{children:t.jsx(e.AdminShell,{children:P(u)})})})})}function P(s){switch(s.type){case"dashboard":return t.jsx(e.DashboardView,{});case"orders":return t.jsx(e.OrdersView,{});case"reservations":return t.jsx(e.ReservationsView,{});case"products-list":return t.jsx(e.ProductsListView,{});case"product-create":return t.jsx(e.ProductCreateView,{});case"product-edit":return t.jsx(e.ProductEditView,{});case"product-categories-list":return t.jsx(e.ProductCategoriesListView,{});case"product-category-create":return t.jsx(e.ProductCategoryCreateView,{});case"product-category-edit":return t.jsx(e.ProductCategoryEditView,{});case"manufacturers-list":return t.jsx(e.ManufacturersListView,{});case"manufacturer-create":return t.jsx(e.ManufacturerCreateView,{});case"manufacturer-edit":return t.jsx(e.ManufacturerEditView,{});case"settings":return t.jsx(e.SettingsLayout,{children:t.jsx(e.SettingsView,{})});case"settings-opening-times":return t.jsx(e.SettingsLayout,{children:t.jsx(e.OpeningTimesView,{})});case"shipping-methods-list":return t.jsx(e.SettingsLayout,{children:t.jsx(e.ShippingMethodsListView,{})});case"shipping-method-create":return t.jsx(e.SettingsLayout,{children:t.jsx(e.ShippingMethodCreateView,{})});case"shipping-method-edit":return t.jsx(e.SettingsLayout,{children:t.jsx(e.ShippingMethodEditView,{})});case"access-list":return t.jsx(e.SettingsLayout,{children:t.jsx(e.AccessListView,{})});case"access-invite":return t.jsx(e.SettingsLayout,{children:t.jsx(e.AccessInviteView,{})});case"access-member-edit":return t.jsx(e.SettingsLayout,{children:t.jsx(e.AccessMemberEditView,{})});default:return t.jsx(e.ErrorView,{})}}async function S({config:s,params:a}){const{segments:n=[]}=await a;return t.jsx(e.AdminProvider,{config:s,children:t.jsx(v,{segments:n})})}function b(s,a){var i;return{title:(i=s.branding)!=null&&i.name?`${s.branding.name} Admin`:"Admin",robots:{index:!1,follow:!1},...s.metadata,...a}}exports.NotFoundPage=e.ErrorView;exports.RootPage=S;exports.generatePageMetadata=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("../admin-client.cjs");async function o({config:e,params:t}){const{segments:n=[]}=await t;return i.jsx(a.AdminProvider,{config:e,children:i.jsx(a.AdminRouter,{segments:n})})}function d(e,t){var r;return{title:(r=e.branding)!=null&&r.name?`${e.branding.name} Admin`:"Admin",robots:{index:!1,follow:!1},...e.metadata,...t}}exports.NotFoundPage=a.ErrorView;exports.RootPage=o;exports.generatePageMetadata=d;
package/next/server.mjs CHANGED
@@ -1,102 +1,21 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { u as P, b, r as A, d as S, S as R, e as C, O as h, f as I, E as l, R as M, F as z, h as E, i as o, j as O, k as L, l as x, m as $, n as j, o as F, p as N, q as T, M as q, s as D, t as H, P as k, v as B, w as U, x as G, y as J, z as K, B as Q, C as W, D as X, A as Y } from "../admin-client.js";
3
- import { useRouter as Z, usePathname as _, useSearchParams as ee } from "next/navigation.js";
4
- import { useEffect as te } from "react";
5
- function re(n) {
6
- if (n.length === 0) return { type: "home" };
7
- const [a, i, r, u, c] = n;
8
- if (a === "auth")
9
- return i === "sign-in" ? { type: "sign-in" } : i === "sign-up" ? { type: "sign-up" } : { type: "not-found" };
10
- if (a === "organizations") return { type: "organizations" };
11
- const t = a;
12
- return i ? i === "dashboard" ? { type: "dashboard", orgId: t } : i === "orders" ? { type: "orders", orgId: t } : i === "reservations" ? { type: "reservations", orgId: t } : i === "products" ? r ? r === "create" ? { type: "product-create", orgId: t } : { type: "product-edit", orgId: t, id: r } : { type: "products-list", orgId: t } : i === "product-categories" ? r ? r === "create" ? { type: "product-category-create", orgId: t } : { type: "product-category-edit", orgId: t, id: r } : { type: "product-categories-list", orgId: t } : i === "manufacturers" ? r ? r === "create" ? { type: "manufacturer-create", orgId: t } : { type: "manufacturer-edit", orgId: t, id: r } : { type: "manufacturers-list", orgId: t } : i === "settings" ? r ? r === "opening-times" ? { type: "settings-opening-times", orgId: t } : r === "shipping-methods" ? u ? u === "create" ? { type: "shipping-method-create", orgId: t } : { type: "shipping-method-edit", orgId: t, id: u } : { type: "shipping-methods-list", orgId: t } : r === "access" ? u ? u === "invite" ? { type: "access-invite", orgId: t } : { type: "access-member-edit", orgId: t, id: u } : { type: "access-list", orgId: t } : { type: "settings", orgId: t } : { type: "settings", orgId: t } : { type: "not-found" } : { type: "not-found" };
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { A as r, a as i } from "../admin-client.js";
3
+ import { E as g } from "../admin-client.js";
4
+ async function s({ config: e, params: t }) {
5
+ const { segments: a = [] } = await t;
6
+ return /* @__PURE__ */ o(r, { config: e, children: /* @__PURE__ */ o(i, { segments: a }) });
13
7
  }
14
- function ie({ segments: n }) {
15
- const a = P(), i = b(), r = Z(), u = _(), c = ee(), { data: t, isPending: p } = a.useSession(), s = re(n), d = s.type === "sign-in" || s.type === "sign-up", m = s.type === "home" || s.type === "organizations", y = c == null ? void 0 : c.get("redirect"), g = c == null ? void 0 : c.toString(), w = u ? `${u}${g ? `?${g}` : ""}` : i.home, f = d ? A(y, i) : w;
16
- if (te(() => {
17
- if (!p) {
18
- if (!t && !d) {
19
- r.replace(S(i.signIn, f));
20
- return;
21
- }
22
- t && d && r.replace(f);
23
- }
24
- }, [t, p, d, r, i.signIn, f]), p)
25
- return /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen", children: /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600" }) });
26
- if (d) {
27
- if (s.type === "sign-in") return /* @__PURE__ */ e(R, {});
28
- if (s.type === "sign-up") return /* @__PURE__ */ e(C, {});
29
- }
30
- if (!t)
31
- return null;
32
- if (m)
33
- return /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(I, {}) });
34
- if (s.type === "not-found")
35
- return /* @__PURE__ */ e(l, {});
36
- const V = "orgId" in s ? s.orgId : void 0, v = "id" in s ? s.id : void 0;
37
- return /* @__PURE__ */ e(M, { organizationId: V, id: v, children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(E, { children: ne(s) }) }) }) });
38
- }
39
- function ne(n) {
40
- switch (n.type) {
41
- case "dashboard":
42
- return /* @__PURE__ */ e(X, {});
43
- case "orders":
44
- return /* @__PURE__ */ e(W, {});
45
- case "reservations":
46
- return /* @__PURE__ */ e(Q, {});
47
- case "products-list":
48
- return /* @__PURE__ */ e(K, {});
49
- case "product-create":
50
- return /* @__PURE__ */ e(J, {});
51
- case "product-edit":
52
- return /* @__PURE__ */ e(G, {});
53
- case "product-categories-list":
54
- return /* @__PURE__ */ e(U, {});
55
- case "product-category-create":
56
- return /* @__PURE__ */ e(B, {});
57
- case "product-category-edit":
58
- return /* @__PURE__ */ e(k, {});
59
- case "manufacturers-list":
60
- return /* @__PURE__ */ e(H, {});
61
- case "manufacturer-create":
62
- return /* @__PURE__ */ e(D, {});
63
- case "manufacturer-edit":
64
- return /* @__PURE__ */ e(q, {});
65
- case "settings":
66
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(T, {}) });
67
- case "settings-opening-times":
68
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(N, {}) });
69
- case "shipping-methods-list":
70
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(F, {}) });
71
- case "shipping-method-create":
72
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(j, {}) });
73
- case "shipping-method-edit":
74
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e($, {}) });
75
- case "access-list":
76
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(x, {}) });
77
- case "access-invite":
78
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(L, {}) });
79
- case "access-member-edit":
80
- return /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(O, {}) });
81
- default:
82
- return /* @__PURE__ */ e(l, {});
83
- }
84
- }
85
- async function ce({ config: n, params: a }) {
86
- const { segments: i = [] } = await a;
87
- return /* @__PURE__ */ e(Y, { config: n, children: /* @__PURE__ */ e(ie, { segments: i }) });
88
- }
89
- function de(n, a) {
90
- var r;
8
+ function l(e, t) {
9
+ var n;
91
10
  return {
92
- title: (r = n.branding) != null && r.name ? `${n.branding.name} Admin` : "Admin",
11
+ title: (n = e.branding) != null && n.name ? `${e.branding.name} Admin` : "Admin",
93
12
  robots: { index: !1, follow: !1 },
94
- ...n.metadata,
95
- ...a
13
+ ...e.metadata,
14
+ ...t
96
15
  };
97
16
  }
98
17
  export {
99
- l as NotFoundPage,
100
- ce as RootPage,
101
- de as generatePageMetadata
18
+ g as NotFoundPage,
19
+ s as RootPage,
20
+ l as generatePageMetadata
102
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shophost/react",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.mjs",
@@ -58,16 +58,11 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.9",
61
- "@atlaskit/pragmatic-drag-and-drop-flourish": "^2.0.12",
62
61
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
63
62
  "@atlaskit/pragmatic-drag-and-drop-live-region": "^1.3.3",
64
63
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.12",
65
64
  "@headlessui/react": "^2.2.0",
66
65
  "@hookform/resolvers": "^3.9.0",
67
- "@react-aria/datepicker": "^3.16.1",
68
- "@react-stately/datepicker": "^3.16.1",
69
- "@shophost/client": "^2.0.31",
70
- "@shophost/rest-api": "^2.0.31",
71
66
  "@internationalized/date": "^3.12.0",
72
67
  "@radix-ui/react-checkbox": "^1.3.3",
73
68
  "@radix-ui/react-dialog": "^1.1.6",
@@ -80,9 +75,13 @@
80
75
  "@radix-ui/react-slot": "^1.1.2",
81
76
  "@radix-ui/react-switch": "^1.1.3",
82
77
  "@radix-ui/react-tooltip": "^1.2.8",
83
- "@tanstack/react-table": "^8.21.3",
78
+ "@react-aria/datepicker": "^3.16.1",
79
+ "@react-stately/datepicker": "^3.16.1",
84
80
  "@remixicon/react": "^4.6.0",
81
+ "@shophost/client": "^2.0.33",
82
+ "@shophost/rest-api": "^2.0.33",
85
83
  "@tanstack/react-query": "^5.67.2",
84
+ "@tanstack/react-table": "^8.21.3",
86
85
  "@vercel/blob": "^0.27.2",
87
86
  "better-auth": "^1.5.5",
88
87
  "classnames": "^2.5.1",
@@ -91,11 +90,11 @@
91
90
  "date-fns": "^3.6.0",
92
91
  "lucide-react": "^0.479.0",
93
92
  "next-themes": "^0.4.6",
94
- "react-day-picker": "^8.10.1",
93
+ "react-day-picker": "^9.14.0",
95
94
  "react-hook-form": "^7.54.2",
96
- "recharts": "^3.8.0",
97
95
  "react-hot-toast": "^2.5.2",
98
96
  "react-phone-number-input": "^3.4.12",
97
+ "recharts": "^3.8.0",
99
98
  "tailwind-merge": "^3.0.2",
100
99
  "tailwind-variants": "^1.0.0",
101
100
  "tiny-invariant": "^1.3.3",
@@ -104,8 +103,8 @@
104
103
  "zod": "^4.1.11"
105
104
  },
106
105
  "peerDependencies": {
106
+ "next": ">=14.0.0",
107
107
  "react": ">=18.0.0",
108
- "react-dom": ">=18.0.0",
109
- "next": ">=14.0.0"
108
+ "react-dom": ">=18.0.0"
110
109
  }
111
110
  }
package/storefront.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { ac as o, V as e, aZ as r, af as t, N as i, Q as n, K as d, L as m, G as u, W as C, au as l, aR as p, aS as g, aT as I, aU as P, aV as c, av as D, ay as f, az as M, aw as v, aA as S, ax as h, aC as B, aB as T, al as G, T as A, aD as L, aE as b, aF as y, aG as R, aH as V, aI as w, aJ as x, aK as E, a$ as F, ak as O, ap as k, ah as z, at as H, ar as N, ai as Q, Y as U, X as q, _ as J, a0 as K, $ as W, aj as X, aL as Y, aM as Z, aN as _, aO as $, aP as j, Z as aa, aW as sa, aX as oa, aY as ea, am as ra, U as ta, ab as ia, aQ as na, an as da, ao as ma, aq as ua, a_ as Ca, ag as la, a5 as pa, a8 as ga, a6 as Ia, as as Pa, a7 as ca, aa as Da, a9 as fa, ad as Ma, I as va, H as Sa, a4 as ha, a3 as Ba, J as Ta, a2 as Ga, ae as Aa, a1 as La } from "./admin-client.js";
2
+ import { G as o, l as e, au as r, J as t, i, j as n, f as d, h as m, C as u, m as C, $ as l, am as p, an as g, ao as P, ap as c, aq as I, a0 as D, a3 as f, a4 as v, a1 as M, a5 as h, a2 as S, a7 as B, a6 as T, R as G, k as b, a8 as w, a9 as y, aa as A, ab as L, ac as R, ad as k, ae as x, af as F, aw as O, O as V, W as q, L as z, _ as E, Y as j, N as H, n as N, M as Q, o as U, q as J, p as K, P as W, ag as X, ah as Y, ai as Z, aj as _, ak as $, Q as aa, ar as sa, as as oa, at as ea, T as ra, S as ta, F as ia, al as na, U as da, V as ma, X as ua, av as Ca, K as la, w as pa, z as ga, x as Pa, Z as ca, y as Ia, D as Da, B as fa, H as va, d as Ma, u as ha, v as Sa, t as Ba, e as Ta, s as Ga, I as ba, r as wa } from "./admin-client.js";
3
3
  export {
4
4
  o as APIProvider,
5
5
  e as AccountPages,
@@ -14,45 +14,45 @@ export {
14
14
  l as Command,
15
15
  p as CommandBar,
16
16
  g as CommandBarBar,
17
- I as CommandBarCommand,
18
- P as CommandBarSeperator,
19
- c as CommandBarValue,
17
+ P as CommandBarCommand,
18
+ c as CommandBarSeperator,
19
+ I as CommandBarValue,
20
20
  D as CommandDialog,
21
21
  f as CommandEmpty,
22
- M as CommandGroup,
23
- v as CommandInput,
24
- S as CommandItem,
25
- h as CommandList,
22
+ v as CommandGroup,
23
+ M as CommandInput,
24
+ h as CommandItem,
25
+ S as CommandList,
26
26
  B as CommandSeparator,
27
27
  T as CommandShortcut,
28
28
  G as CountryInput,
29
- A as CustomerDetailsPage,
30
- L as Dialog,
31
- b as DialogClose,
32
- y as DialogContent,
33
- R as DialogDescription,
34
- V as DialogFooter,
35
- w as DialogHeader,
29
+ b as CustomerDetailsPage,
30
+ w as Dialog,
31
+ y as DialogClose,
32
+ A as DialogContent,
33
+ L as DialogDescription,
34
+ R as DialogFooter,
35
+ k as DialogHeader,
36
36
  x as DialogTitle,
37
- E as DialogTrigger,
38
- F as Divider,
39
- O as EmailInput,
40
- k as ImageUploadInput,
37
+ F as DialogTrigger,
38
+ O as Divider,
39
+ V as EmailInput,
40
+ q as ImageUploadInput,
41
41
  z as Input,
42
- H as InputGroup,
43
- N as Label,
44
- Q as LocationInput,
45
- U as ModifierContainer,
46
- q as ModifiersDialog,
47
- J as ModifiersGroup,
48
- K as ModifiersModal,
49
- W as ModifiersOption,
50
- X as PhoneNumberInput,
51
- Y as Popover,
52
- Z as PopoverAnchor,
53
- _ as PopoverClose,
54
- $ as PopoverContent,
55
- j as PopoverTrigger,
42
+ E as InputGroup,
43
+ j as Label,
44
+ H as LocationInput,
45
+ N as ModifierContainer,
46
+ Q as ModifiersDialog,
47
+ U as ModifiersGroup,
48
+ J as ModifiersModal,
49
+ K as ModifiersOption,
50
+ W as PhoneNumberInput,
51
+ X as Popover,
52
+ Y as PopoverAnchor,
53
+ Z as PopoverClose,
54
+ _ as PopoverContent,
55
+ $ as PopoverTrigger,
56
56
  aa as QuantityControl,
57
57
  sa as RadioCardGroup,
58
58
  oa as RadioCardGroupIndicator,
@@ -68,18 +68,18 @@ export {
68
68
  la as buttonVariants,
69
69
  pa as calculateCartTotal,
70
70
  ga as findCartItem,
71
- Ia as formatPrice,
72
- Pa as getFieldError,
73
- ca as getFormattedModifiers,
71
+ Pa as formatPrice,
72
+ ca as getFieldError,
73
+ Ia as getFormattedModifiers,
74
74
  Da as mockProducts,
75
75
  fa as productRequiresModifiers,
76
- Ma as useAPI,
77
- va as useCart,
78
- Sa as useCartContext,
79
- ha as useLocalization,
76
+ va as useAPI,
77
+ Ma as useCart,
78
+ ha as useCartContext,
79
+ Sa as useLocalization,
80
80
  Ba as useModifierSelection,
81
81
  Ta as useModifiers,
82
82
  Ga as useMultipleProductDetails,
83
- Aa as useOrganization,
84
- La as useProductDetails
83
+ ba as useOrganization,
84
+ wa as useProductDetails
85
85
  };