@burdenoff/microfe-coolandlovely 2026.1024.3 → 2026.1026.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.
- package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoutes.js +20 -12
- package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
- package/dist/coolandlovely/components/FulfilmentTimeline.d.ts +7 -0
- package/dist/coolandlovely/components/FulfilmentTimeline.d.ts.map +1 -0
- package/dist/coolandlovely/components/FulfilmentTimeline.js +77 -0
- package/dist/coolandlovely/components/FulfilmentTimeline.js.map +1 -0
- package/dist/coolandlovely/components/StatusBadge.d.ts.map +1 -1
- package/dist/coolandlovely/components/StatusBadge.js +9 -1
- package/dist/coolandlovely/components/StatusBadge.js.map +1 -1
- package/dist/coolandlovely/hooks/useBrandOrdersApi.d.ts +7 -0
- package/dist/coolandlovely/hooks/useBrandOrdersApi.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useBrandOrdersApi.js +92 -0
- package/dist/coolandlovely/hooks/useBrandOrdersApi.js.map +1 -0
- package/dist/coolandlovely/hooks/useCommerceApi.d.ts +2 -0
- package/dist/coolandlovely/hooks/useCommerceApi.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/useCommerceApi.js +26 -22
- package/dist/coolandlovely/hooks/useCommerceApi.js.map +1 -1
- package/dist/coolandlovely/pages/brands/BrandDetailPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/brands/BrandDetailPage.js +157 -148
- package/dist/coolandlovely/pages/brands/BrandDetailPage.js.map +1 -1
- package/dist/coolandlovely/pages/commerce/BrandOrdersPage.d.ts +13 -0
- package/dist/coolandlovely/pages/commerce/BrandOrdersPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/BrandOrdersPage.js +360 -0
- package/dist/coolandlovely/pages/commerce/BrandOrdersPage.js.map +1 -0
- package/dist/coolandlovely/pages/commerce/CartPage.js +4 -4
- package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/commerce/OrdersPage.js +122 -101
- package/dist/coolandlovely/pages/commerce/OrdersPage.js.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemFormPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemFormPage.js +130 -104
- package/dist/coolandlovely/pages/items/StyleItemFormPage.js.map +1 -1
- package/dist/coolandlovely/types/commerce.d.ts +61 -0
- package/dist/coolandlovely/types/commerce.d.ts.map +1 -1
- package/dist/coolandlovely/types/index.d.ts +2 -0
- package/dist/coolandlovely/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoolAndLovelyRoutes.d.ts","sourceRoot":"","sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CoolAndLovelyRoutes.d.ts","sourceRoot":"","sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AA8IhD,eAAO,MAAM,mBAAmB,EAAE,EA0FjC,CAAC"}
|
|
@@ -4,15 +4,15 @@ import { Suspense as n, lazy as r } from "react";
|
|
|
4
4
|
import { Navigate as i, Route as a, Routes as o, useLocation as s } from "react-router";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
//#region src/coolandlovely/CoolAndLovelyRoutes.tsx
|
|
7
|
-
var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ default: e.BrandsListPage }))), d = r(() => import("./pages/brands/BrandDetailPage.js").then((e) => ({ default: e.BrandDetailPage }))), f = r(() => import("./pages/brands/BrandFormPage.js").then((e) => ({ default: e.BrandFormPage }))), p = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), m = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), h = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), g = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), _ = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), v = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), y = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), b = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), x = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), S = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), C = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), w = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), T = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), E = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), D = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), O = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), k = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), A = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), j = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), M = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))), N = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrdersPage }))),
|
|
7
|
+
var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ default: e.BrandsListPage }))), d = r(() => import("./pages/brands/BrandDetailPage.js").then((e) => ({ default: e.BrandDetailPage }))), f = r(() => import("./pages/brands/BrandFormPage.js").then((e) => ({ default: e.BrandFormPage }))), p = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), m = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), h = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), g = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), _ = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), v = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), y = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), b = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), x = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), S = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), C = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), w = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), T = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), E = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), D = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), O = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), k = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), A = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), j = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), M = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))), N = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrdersPage }))), P = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrderDetailPage }))), F = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrdersPage }))), I = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrderDetailPage }))), L = r(() => import("./pages/commerce/CreatorEarningsPage.js").then((e) => ({ default: e.CreatorEarningsPage }))), R = r(() => import("./pages/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))), z = r(() => import("./pages/admin/AdminCollaborationsPage.js").then((e) => ({ default: e.AdminCollaborationsPage }))), B = r(() => import("./pages/admin/AdminFeaturedItemsPage.js").then((e) => ({ default: e.AdminFeaturedItemsPage }))), V = () => /* @__PURE__ */ c("div", {
|
|
8
8
|
className: "flex min-h-[400px] items-center justify-center",
|
|
9
9
|
children: /* @__PURE__ */ c("div", { className: "h-8 w-8 animate-spin rounded-full border-b-2 border-primary" })
|
|
10
|
-
}),
|
|
11
|
-
let { basePath: r, isStandalone:
|
|
12
|
-
return
|
|
10
|
+
}), H = () => {
|
|
11
|
+
let { basePath: r, isStandalone: H } = e(), U = s(), W = r === "/" ? "" : (r ?? "").replace(/\/$/, "");
|
|
12
|
+
return W && !H && !(U.pathname === W || U.pathname.startsWith(W + "/")) ? null : /* @__PURE__ */ c("div", {
|
|
13
13
|
className: "flex min-h-full flex-col",
|
|
14
14
|
children: /* @__PURE__ */ c(n, {
|
|
15
|
-
fallback: /* @__PURE__ */ c(
|
|
15
|
+
fallback: /* @__PURE__ */ c(V, {}),
|
|
16
16
|
children: /* @__PURE__ */ l(o, { children: [
|
|
17
17
|
/* @__PURE__ */ c(a, {
|
|
18
18
|
index: !0,
|
|
@@ -132,15 +132,23 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ c(a, {
|
|
134
134
|
path: "orders",
|
|
135
|
-
element: /* @__PURE__ */ c(
|
|
135
|
+
element: /* @__PURE__ */ c(F, {})
|
|
136
136
|
}),
|
|
137
137
|
/* @__PURE__ */ c(a, {
|
|
138
138
|
path: "orders/:orderId",
|
|
139
|
-
element: /* @__PURE__ */ c(
|
|
139
|
+
element: /* @__PURE__ */ c(I, {})
|
|
140
140
|
}),
|
|
141
141
|
/* @__PURE__ */ c(a, {
|
|
142
142
|
path: "earnings",
|
|
143
|
-
element: /* @__PURE__ */ c(
|
|
143
|
+
element: /* @__PURE__ */ c(L, {})
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ c(a, {
|
|
146
|
+
path: "brand-orders",
|
|
147
|
+
element: /* @__PURE__ */ c(N, {})
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ c(a, {
|
|
150
|
+
path: "brand-orders/:brandId/:orderId",
|
|
151
|
+
element: /* @__PURE__ */ c(P, {})
|
|
144
152
|
}),
|
|
145
153
|
/* @__PURE__ */ c(a, {
|
|
146
154
|
path: "admin",
|
|
@@ -151,15 +159,15 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
151
159
|
}),
|
|
152
160
|
/* @__PURE__ */ c(a, {
|
|
153
161
|
path: "admin/brands",
|
|
154
|
-
element: /* @__PURE__ */ c(
|
|
162
|
+
element: /* @__PURE__ */ c(R, {})
|
|
155
163
|
}),
|
|
156
164
|
/* @__PURE__ */ c(a, {
|
|
157
165
|
path: "admin/collaborations",
|
|
158
|
-
element: /* @__PURE__ */ c(
|
|
166
|
+
element: /* @__PURE__ */ c(z, {})
|
|
159
167
|
}),
|
|
160
168
|
/* @__PURE__ */ c(a, {
|
|
161
169
|
path: "admin/featured-items",
|
|
162
|
-
element: /* @__PURE__ */ c(
|
|
170
|
+
element: /* @__PURE__ */ c(B, {})
|
|
163
171
|
}),
|
|
164
172
|
/* @__PURE__ */ c(a, {
|
|
165
173
|
path: "*",
|
|
@@ -173,6 +181,6 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
173
181
|
});
|
|
174
182
|
};
|
|
175
183
|
//#endregion
|
|
176
|
-
export {
|
|
184
|
+
export { H as CoolAndLovelyRoutes };
|
|
177
185
|
|
|
178
186
|
//# sourceMappingURL=CoolAndLovelyRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoolAndLovelyRoutes.js","names":[],"sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"sourcesContent":["/**\n * CoolAndLovely Routes\n * @module coolandlovely\n *\n * Real fashion-domain routes wired to the live `wspace-coolandlovely-svc`\n * GraphQL contract: overview, brands, collections, style items, looks,\n * collaborations, wardrobe, lookbooks and the shopper's style profile.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useCoolAndLovely } from './context/CoolAndLovelyContext';\n\n// Eager-loaded overview (primary landing page)\nimport { HomePage } from './pages/HomePage';\n\n// Brands\nconst BrandsListPage = lazy(() =>\n import('./pages/brands/BrandsListPage').then((m) => ({ default: m.BrandsListPage }))\n);\nconst BrandDetailPage = lazy(() =>\n import('./pages/brands/BrandDetailPage').then((m) => ({ default: m.BrandDetailPage }))\n);\nconst BrandFormPage = lazy(() =>\n import('./pages/brands/BrandFormPage').then((m) => ({ default: m.BrandFormPage }))\n);\n\n// Collections\nconst CollectionsListPage = lazy(() =>\n import('./pages/collections/CollectionsListPage').then((m) => ({\n default: m.CollectionsListPage,\n }))\n);\nconst CollectionDetailPage = lazy(() =>\n import('./pages/collections/CollectionDetailPage').then((m) => ({\n default: m.CollectionDetailPage,\n }))\n);\nconst CollectionFormPage = lazy(() =>\n import('./pages/collections/CollectionFormPage').then((m) => ({ default: m.CollectionFormPage }))\n);\n\n// Style items\nconst StyleItemsListPage = lazy(() =>\n import('./pages/items/StyleItemsListPage').then((m) => ({ default: m.StyleItemsListPage }))\n);\nconst StyleItemDetailPage = lazy(() =>\n import('./pages/items/StyleItemDetailPage').then((m) => ({ default: m.StyleItemDetailPage }))\n);\nconst StyleItemFormPage = lazy(() =>\n import('./pages/items/StyleItemFormPage').then((m) => ({ default: m.StyleItemFormPage }))\n);\n\n// Looks\nconst LooksListPage = lazy(() =>\n import('./pages/looks/LooksListPage').then((m) => ({ default: m.LooksListPage }))\n);\nconst LookDetailPage = lazy(() =>\n import('./pages/looks/LookDetailPage').then((m) => ({ default: m.LookDetailPage }))\n);\nconst LookFormPage = lazy(() =>\n import('./pages/looks/LookFormPage').then((m) => ({ default: m.LookFormPage }))\n);\n\n// Collaborations\nconst CollaborationsListPage = lazy(() =>\n import('./pages/collaborations/CollaborationsListPage').then((m) => ({\n default: m.CollaborationsListPage,\n }))\n);\nconst CollaborationDetailPage = lazy(() =>\n import('./pages/collaborations/CollaborationDetailPage').then((m) => ({\n default: m.CollaborationDetailPage,\n }))\n);\nconst CollaborationFormPage = lazy(() =>\n import('./pages/collaborations/CollaborationFormPage').then((m) => ({\n default: m.CollaborationFormPage,\n }))\n);\n\n// Wardrobe (self-scoped)\nconst WardrobeListPage = lazy(() =>\n import('./pages/wardrobe/WardrobeListPage').then((m) => ({ default: m.WardrobeListPage }))\n);\nconst WardrobeFormPage = lazy(() =>\n import('./pages/wardrobe/WardrobeFormPage').then((m) => ({ default: m.WardrobeFormPage }))\n);\n\n// Lookbooks\nconst LookbooksListPage = lazy(() =>\n import('./pages/lookbooks/LookbooksListPage').then((m) => ({ default: m.LookbooksListPage }))\n);\nconst LookbookDetailPage = lazy(() =>\n import('./pages/lookbooks/LookbookDetailPage').then((m) => ({ default: m.LookbookDetailPage }))\n);\n\n// Style profile (self-scoped)\nconst StyleProfilePage = lazy(() =>\n import('./pages/profile/StyleProfilePage').then((m) => ({ default: m.StyleProfilePage }))\n);\n\n// Discovery + trends (client-side analytics over the real catalogue/social lists)\nconst DiscoverPage = lazy(() =>\n import('./pages/discover/DiscoverPage').then((m) => ({ default: m.DiscoverPage }))\n);\nconst TrendsPage = lazy(() =>\n import('./pages/trends/TrendsPage').then((m) => ({ default: m.TrendsPage }))\n);\n\n// Commerce (BOFF-3370): cart, orders, creator earnings\nconst CartPage = lazy(() =>\n import('./pages/commerce/CartPage').then((m) => ({ default: m.CartPage }))\n);\nconst OrdersPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrdersPage }))\n);\nconst OrderDetailPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrderDetailPage }))\n);\nconst CreatorEarningsPage = lazy(() =>\n import('./pages/commerce/CreatorEarningsPage').then((m) => ({ default: m.CreatorEarningsPage }))\n);\n\n// Admin curation (gated by the `coolandlovely.admin.curation` feature flag)\nconst AdminBrandsPage = lazy(() =>\n import('./pages/admin/AdminBrandsPage').then((m) => ({ default: m.AdminBrandsPage }))\n);\nconst AdminCollaborationsPage = lazy(() =>\n import('./pages/admin/AdminCollaborationsPage').then((m) => ({\n default: m.AdminCollaborationsPage,\n }))\n);\nconst AdminFeaturedItemsPage = lazy(() =>\n import('./pages/admin/AdminFeaturedItemsPage').then((m) => ({\n default: m.AdminFeaturedItemsPage,\n }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-b-2 border-primary\" />\n </div>\n);\n\nexport const CoolAndLovelyRoutes: FC = () => {\n const { basePath, isStandalone } = useCoolAndLovely();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the path matches the basePath (when integrated).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview */}\n <Route index element={<HomePage />} />\n\n {/* Brands */}\n <Route path=\"brands\" element={<BrandsListPage />} />\n <Route path=\"brands/new\" element={<BrandFormPage />} />\n <Route path=\"brands/:brandId\" element={<BrandDetailPage />} />\n <Route path=\"brands/:brandId/edit\" element={<BrandFormPage />} />\n\n {/* Collections */}\n <Route path=\"collections\" element={<CollectionsListPage />} />\n <Route path=\"collections/new\" element={<CollectionFormPage />} />\n <Route path=\"collections/:collectionId\" element={<CollectionDetailPage />} />\n <Route path=\"collections/:collectionId/edit\" element={<CollectionFormPage />} />\n\n {/* Style items */}\n <Route path=\"items\" element={<StyleItemsListPage />} />\n <Route path=\"items/new\" element={<StyleItemFormPage />} />\n <Route path=\"items/:itemId\" element={<StyleItemDetailPage />} />\n <Route path=\"items/:itemId/edit\" element={<StyleItemFormPage />} />\n\n {/* Looks */}\n <Route path=\"looks\" element={<LooksListPage />} />\n <Route path=\"looks/new\" element={<LookFormPage />} />\n <Route path=\"looks/:lookId\" element={<LookDetailPage />} />\n\n {/* Collaborations */}\n <Route path=\"collaborations\" element={<CollaborationsListPage />} />\n <Route path=\"collaborations/new\" element={<CollaborationFormPage />} />\n <Route path=\"collaborations/:collaborationId\" element={<CollaborationDetailPage />} />\n <Route path=\"collaborations/:collaborationId/edit\" element={<CollaborationFormPage />} />\n\n {/* Wardrobe (self-scoped) */}\n <Route path=\"wardrobe\" element={<WardrobeListPage />} />\n <Route path=\"wardrobe/new\" element={<WardrobeFormPage />} />\n\n {/* Lookbooks */}\n <Route path=\"lookbooks\" element={<LookbooksListPage />} />\n <Route path=\"lookbooks/:lookbookId\" element={<LookbookDetailPage />} />\n\n {/* Style profile (self-scoped) + public profiles */}\n <Route path=\"profile\" element={<StyleProfilePage />} />\n <Route path=\"profile/:userId\" element={<StyleProfilePage />} />\n\n {/* Discovery + trends */}\n <Route path=\"discover\" element={<DiscoverPage />} />\n <Route path=\"trends\" element={<TrendsPage />} />\n\n {/* Commerce */}\n <Route path=\"cart\" element={<CartPage />} />\n <Route path=\"orders\" element={<OrdersPage />} />\n <Route path=\"orders/:orderId\" element={<OrderDetailPage />} />\n <Route path=\"earnings\" element={<CreatorEarningsPage />} />\n\n {/* Admin curation */}\n <Route path=\"admin\" element={<Navigate to=\"admin/brands\" replace />} />\n <Route path=\"admin/brands\" element={<AdminBrandsPage />} />\n <Route path=\"admin/collaborations\" element={<AdminCollaborationsPage />} />\n <Route path=\"admin/featured-items\" element={<AdminFeaturedItemsPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAM,IAAiB,QACrB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACrF,EACK,IAAkB,QACtB,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACvF,EACK,IAAgB,QACpB,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CACnF,EAGK,IAAsB,QAC1B,OAAO,8CAA2C,MAAM,OAAO,EAC7D,SAAS,EAAE,qBACZ,EAAE,CACJ,EACK,IAAuB,QAC3B,OAAO,+CAA4C,MAAM,OAAO,EAC9D,SAAS,EAAE,sBACZ,EAAE,CACJ,EACK,IAAqB,QACzB,OAAO,6CAA0C,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAClG,EAGK,IAAqB,QACzB,OAAO,uCAAoC,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAC5F,EACK,IAAsB,QAC1B,OAAO,wCAAqC,MAAM,OAAO,EAAE,SAAS,EAAE,qB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AAG;MAAe,SAAA;MAAU,CAAA;KAAI,CAAA;IACvE,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC3D,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,EAA2B,CAAA;KAAI,CAAA;IAC3E,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,EAA0B,CAAA;KAAI,CAAA;IAG1E,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
1
|
+
{"version":3,"file":"CoolAndLovelyRoutes.js","names":[],"sources":["../../src/coolandlovely/CoolAndLovelyRoutes.tsx"],"sourcesContent":["/**\n * CoolAndLovely Routes\n * @module coolandlovely\n *\n * Real fashion-domain routes wired to the live `wspace-coolandlovely-svc`\n * GraphQL contract: overview, brands, collections, style items, looks,\n * collaborations, wardrobe, lookbooks and the shopper's style profile.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { useCoolAndLovely } from './context/CoolAndLovelyContext';\n\n// Eager-loaded overview (primary landing page)\nimport { HomePage } from './pages/HomePage';\n\n// Brands\nconst BrandsListPage = lazy(() =>\n import('./pages/brands/BrandsListPage').then((m) => ({ default: m.BrandsListPage }))\n);\nconst BrandDetailPage = lazy(() =>\n import('./pages/brands/BrandDetailPage').then((m) => ({ default: m.BrandDetailPage }))\n);\nconst BrandFormPage = lazy(() =>\n import('./pages/brands/BrandFormPage').then((m) => ({ default: m.BrandFormPage }))\n);\n\n// Collections\nconst CollectionsListPage = lazy(() =>\n import('./pages/collections/CollectionsListPage').then((m) => ({\n default: m.CollectionsListPage,\n }))\n);\nconst CollectionDetailPage = lazy(() =>\n import('./pages/collections/CollectionDetailPage').then((m) => ({\n default: m.CollectionDetailPage,\n }))\n);\nconst CollectionFormPage = lazy(() =>\n import('./pages/collections/CollectionFormPage').then((m) => ({ default: m.CollectionFormPage }))\n);\n\n// Style items\nconst StyleItemsListPage = lazy(() =>\n import('./pages/items/StyleItemsListPage').then((m) => ({ default: m.StyleItemsListPage }))\n);\nconst StyleItemDetailPage = lazy(() =>\n import('./pages/items/StyleItemDetailPage').then((m) => ({ default: m.StyleItemDetailPage }))\n);\nconst StyleItemFormPage = lazy(() =>\n import('./pages/items/StyleItemFormPage').then((m) => ({ default: m.StyleItemFormPage }))\n);\n\n// Looks\nconst LooksListPage = lazy(() =>\n import('./pages/looks/LooksListPage').then((m) => ({ default: m.LooksListPage }))\n);\nconst LookDetailPage = lazy(() =>\n import('./pages/looks/LookDetailPage').then((m) => ({ default: m.LookDetailPage }))\n);\nconst LookFormPage = lazy(() =>\n import('./pages/looks/LookFormPage').then((m) => ({ default: m.LookFormPage }))\n);\n\n// Collaborations\nconst CollaborationsListPage = lazy(() =>\n import('./pages/collaborations/CollaborationsListPage').then((m) => ({\n default: m.CollaborationsListPage,\n }))\n);\nconst CollaborationDetailPage = lazy(() =>\n import('./pages/collaborations/CollaborationDetailPage').then((m) => ({\n default: m.CollaborationDetailPage,\n }))\n);\nconst CollaborationFormPage = lazy(() =>\n import('./pages/collaborations/CollaborationFormPage').then((m) => ({\n default: m.CollaborationFormPage,\n }))\n);\n\n// Wardrobe (self-scoped)\nconst WardrobeListPage = lazy(() =>\n import('./pages/wardrobe/WardrobeListPage').then((m) => ({ default: m.WardrobeListPage }))\n);\nconst WardrobeFormPage = lazy(() =>\n import('./pages/wardrobe/WardrobeFormPage').then((m) => ({ default: m.WardrobeFormPage }))\n);\n\n// Lookbooks\nconst LookbooksListPage = lazy(() =>\n import('./pages/lookbooks/LookbooksListPage').then((m) => ({ default: m.LookbooksListPage }))\n);\nconst LookbookDetailPage = lazy(() =>\n import('./pages/lookbooks/LookbookDetailPage').then((m) => ({ default: m.LookbookDetailPage }))\n);\n\n// Style profile (self-scoped)\nconst StyleProfilePage = lazy(() =>\n import('./pages/profile/StyleProfilePage').then((m) => ({ default: m.StyleProfilePage }))\n);\n\n// Discovery + trends (client-side analytics over the real catalogue/social lists)\nconst DiscoverPage = lazy(() =>\n import('./pages/discover/DiscoverPage').then((m) => ({ default: m.DiscoverPage }))\n);\nconst TrendsPage = lazy(() =>\n import('./pages/trends/TrendsPage').then((m) => ({ default: m.TrendsPage }))\n);\n\n// Commerce (BOFF-3370): cart, orders, creator earnings\nconst CartPage = lazy(() =>\n import('./pages/commerce/CartPage').then((m) => ({ default: m.CartPage }))\n);\nconst BrandOrdersPage = lazy(() =>\n import('./pages/commerce/BrandOrdersPage').then((m) => ({ default: m.BrandOrdersPage }))\n);\nconst BrandOrderDetailPage = lazy(() =>\n import('./pages/commerce/BrandOrdersPage').then((m) => ({ default: m.BrandOrderDetailPage }))\n);\nconst OrdersPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrdersPage }))\n);\nconst OrderDetailPage = lazy(() =>\n import('./pages/commerce/OrdersPage').then((m) => ({ default: m.OrderDetailPage }))\n);\nconst CreatorEarningsPage = lazy(() =>\n import('./pages/commerce/CreatorEarningsPage').then((m) => ({ default: m.CreatorEarningsPage }))\n);\n\n// Admin curation (gated by the `coolandlovely.admin.curation` feature flag)\nconst AdminBrandsPage = lazy(() =>\n import('./pages/admin/AdminBrandsPage').then((m) => ({ default: m.AdminBrandsPage }))\n);\nconst AdminCollaborationsPage = lazy(() =>\n import('./pages/admin/AdminCollaborationsPage').then((m) => ({\n default: m.AdminCollaborationsPage,\n }))\n);\nconst AdminFeaturedItemsPage = lazy(() =>\n import('./pages/admin/AdminFeaturedItemsPage').then((m) => ({\n default: m.AdminFeaturedItemsPage,\n }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-b-2 border-primary\" />\n </div>\n);\n\nexport const CoolAndLovelyRoutes: FC = () => {\n const { basePath, isStandalone } = useCoolAndLovely();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the path matches the basePath (when integrated).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Overview */}\n <Route index element={<HomePage />} />\n\n {/* Brands */}\n <Route path=\"brands\" element={<BrandsListPage />} />\n <Route path=\"brands/new\" element={<BrandFormPage />} />\n <Route path=\"brands/:brandId\" element={<BrandDetailPage />} />\n <Route path=\"brands/:brandId/edit\" element={<BrandFormPage />} />\n\n {/* Collections */}\n <Route path=\"collections\" element={<CollectionsListPage />} />\n <Route path=\"collections/new\" element={<CollectionFormPage />} />\n <Route path=\"collections/:collectionId\" element={<CollectionDetailPage />} />\n <Route path=\"collections/:collectionId/edit\" element={<CollectionFormPage />} />\n\n {/* Style items */}\n <Route path=\"items\" element={<StyleItemsListPage />} />\n <Route path=\"items/new\" element={<StyleItemFormPage />} />\n <Route path=\"items/:itemId\" element={<StyleItemDetailPage />} />\n <Route path=\"items/:itemId/edit\" element={<StyleItemFormPage />} />\n\n {/* Looks */}\n <Route path=\"looks\" element={<LooksListPage />} />\n <Route path=\"looks/new\" element={<LookFormPage />} />\n <Route path=\"looks/:lookId\" element={<LookDetailPage />} />\n\n {/* Collaborations */}\n <Route path=\"collaborations\" element={<CollaborationsListPage />} />\n <Route path=\"collaborations/new\" element={<CollaborationFormPage />} />\n <Route path=\"collaborations/:collaborationId\" element={<CollaborationDetailPage />} />\n <Route path=\"collaborations/:collaborationId/edit\" element={<CollaborationFormPage />} />\n\n {/* Wardrobe (self-scoped) */}\n <Route path=\"wardrobe\" element={<WardrobeListPage />} />\n <Route path=\"wardrobe/new\" element={<WardrobeFormPage />} />\n\n {/* Lookbooks */}\n <Route path=\"lookbooks\" element={<LookbooksListPage />} />\n <Route path=\"lookbooks/:lookbookId\" element={<LookbookDetailPage />} />\n\n {/* Style profile (self-scoped) + public profiles */}\n <Route path=\"profile\" element={<StyleProfilePage />} />\n <Route path=\"profile/:userId\" element={<StyleProfilePage />} />\n\n {/* Discovery + trends */}\n <Route path=\"discover\" element={<DiscoverPage />} />\n <Route path=\"trends\" element={<TrendsPage />} />\n\n {/* Commerce */}\n <Route path=\"cart\" element={<CartPage />} />\n <Route path=\"orders\" element={<OrdersPage />} />\n <Route path=\"orders/:orderId\" element={<OrderDetailPage />} />\n <Route path=\"earnings\" element={<CreatorEarningsPage />} />\n\n {/* Brand-side orders and fulfilment (BOFF-9636) */}\n <Route path=\"brand-orders\" element={<BrandOrdersPage />} />\n <Route path=\"brand-orders/:brandId/:orderId\" element={<BrandOrderDetailPage />} />\n\n {/* Admin curation */}\n <Route path=\"admin\" element={<Navigate to=\"admin/brands\" replace />} />\n <Route path=\"admin/brands\" element={<AdminBrandsPage />} />\n <Route path=\"admin/collaborations\" element={<AdminCollaborationsPage />} />\n <Route path=\"admin/featured-items\" element={<AdminFeaturedItemsPage />} />\n\n {/* Fallback */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAM,IAAiB,QACrB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACrF,EACK,IAAkB,QACtB,OAAO,qCAAkC,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CACvF,EACK,IAAgB,QACpB,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CACnF,EAGK,IAAsB,QAC1B,OAAO,8CAA2C,MAAM,OAAO,EAC7D,SAAS,EAAE,qBACZ,EAAE,CACJ,EACK,IAAuB,QAC3B,OAAO,+CAA4C,M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,MAAK;KAAS,SAAS,kBAAC,GAAD,EAAc,CAAA;KAAI,CAAA;IAGhD,kBAAC,GAAD;KAAO,MAAK;KAAO,SAAS,kBAAC,GAAD,EAAY,CAAA;KAAI,CAAA;IAC5C,kBAAC,GAAD;KAAO,MAAK;KAAS,SAAS,kBAAC,GAAD,EAAc,CAAA;KAAI,CAAA;IAChD,kBAAC,GAAD;KAAO,MAAK;KAAkB,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC9D,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAuB,CAAA;KAAI,CAAA;IAG3D,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC3D,kBAAC,GAAD;KAAO,MAAK;KAAiC,SAAS,kBAAC,GAAD,EAAwB,CAAA;KAAI,CAAA;IAGlF,kBAAC,GAAD;KAAO,MAAK;KAAQ,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAe,SAAA;MAAU,CAAA;KAAI,CAAA;IACvE,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,EAAmB,CAAA;KAAI,CAAA;IAC3D,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,EAA2B,CAAA;KAAI,CAAA;IAC3E,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,EAA0B,CAAA;KAAI,CAAA;IAG1E,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CooOrderFulfilment } from '../types';
|
|
2
|
+
|
|
3
|
+
/** Timeline of one brand's fulfilment, shared with the shopper's order detail. */
|
|
4
|
+
export declare function FulfilmentTimeline({ fulfilment }: {
|
|
5
|
+
fulfilment: CooOrderFulfilment;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=FulfilmentTimeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FulfilmentTimeline.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/FulfilmentTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,kBAAkB,CAAA;CAAE,+BA+DpF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import "../hooks/index.js";
|
|
4
|
+
import { formatDate as n } from "../utils/formatters.js";
|
|
5
|
+
import { CheckCircle2 as r, ExternalLink as i, PackageCheck as a, Truck as o } from "lucide-react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/coolandlovely/components/FulfilmentTimeline.tsx
|
|
8
|
+
function l({ fulfilment: l }) {
|
|
9
|
+
let u = t();
|
|
10
|
+
return /* @__PURE__ */ c("div", {
|
|
11
|
+
className: "space-y-3",
|
|
12
|
+
"data-testid": "fulfilment-timeline",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ s("ol", {
|
|
15
|
+
className: "flex flex-wrap gap-4",
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
key: "coolandlovely.fulfilment.confirmed",
|
|
19
|
+
label: "Confirmed",
|
|
20
|
+
at: l.confirmedAt,
|
|
21
|
+
icon: r
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: "coolandlovely.fulfilment.shipped",
|
|
25
|
+
label: "Shipped",
|
|
26
|
+
at: l.shippedAt,
|
|
27
|
+
icon: o
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "coolandlovely.fulfilment.delivered",
|
|
31
|
+
label: "Delivered",
|
|
32
|
+
at: l.deliveredAt,
|
|
33
|
+
icon: a
|
|
34
|
+
}
|
|
35
|
+
].map(({ key: t, label: r, at: i, icon: a }) => /* @__PURE__ */ c("li", {
|
|
36
|
+
className: e("flex items-center gap-1.5 text-sm", i ? "text-text-primary" : "text-text-secondary opacity-60"),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ s(a, { className: e("h-4 w-4", i && "text-status-success-text") }),
|
|
39
|
+
/* @__PURE__ */ s("span", { children: u(t, r) }),
|
|
40
|
+
i && /* @__PURE__ */ s("span", {
|
|
41
|
+
className: "text-xs text-text-secondary",
|
|
42
|
+
children: n(i)
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}, t))
|
|
46
|
+
}),
|
|
47
|
+
l.trackingNumber && /* @__PURE__ */ c("p", {
|
|
48
|
+
className: "text-sm text-text-primary",
|
|
49
|
+
children: [
|
|
50
|
+
l.carrier,
|
|
51
|
+
" ·",
|
|
52
|
+
" ",
|
|
53
|
+
/* @__PURE__ */ s("span", {
|
|
54
|
+
className: "font-mono",
|
|
55
|
+
"data-testid": "fulfilment-tracking",
|
|
56
|
+
children: l.trackingNumber
|
|
57
|
+
}),
|
|
58
|
+
l.trackingUrl && /* @__PURE__ */ c("a", {
|
|
59
|
+
href: l.trackingUrl,
|
|
60
|
+
target: "_blank",
|
|
61
|
+
rel: "noopener noreferrer",
|
|
62
|
+
className: "ml-2 inline-flex items-center gap-1 text-accent-primary hover:underline",
|
|
63
|
+
children: [u("coolandlovely.fulfilment.track", "Track parcel"), /* @__PURE__ */ s(i, { className: "h-3 w-3" })]
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
}),
|
|
67
|
+
l.note && /* @__PURE__ */ s("p", {
|
|
68
|
+
className: "whitespace-pre-line text-sm text-text-secondary",
|
|
69
|
+
children: l.note
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { l as FulfilmentTimeline };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=FulfilmentTimeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FulfilmentTimeline.js","names":[],"sources":["../../../src/coolandlovely/components/FulfilmentTimeline.tsx"],"sourcesContent":["/**\n * Fulfilment timeline (BOFF-9636)\n * @module coolandlovely/components\n *\n * One brand's progress on an order (confirmed, shipped, delivered) with its tracking details.\n * Shown to the brand on its order detail and to the shopper on theirs.\n */\n\nimport { CheckCircle2, ExternalLink, Package, PackageCheck, Truck } from 'lucide-react';\n\nimport { useTr } from '../hooks';\nimport type { CooOrderFulfilment } from '../types';\nimport { cn } from '../utils/cn';\nimport { formatDate } from '../utils/formatters';\n\n/** Timeline of one brand's fulfilment, shared with the shopper's order detail. */\nexport function FulfilmentTimeline({ fulfilment }: { fulfilment: CooOrderFulfilment }) {\n const tr = useTr();\n const steps: Array<{ key: string; label: string; at: string | null; icon: typeof Package }> = [\n {\n key: 'coolandlovely.fulfilment.confirmed',\n label: 'Confirmed',\n at: fulfilment.confirmedAt,\n icon: CheckCircle2,\n },\n {\n key: 'coolandlovely.fulfilment.shipped',\n label: 'Shipped',\n at: fulfilment.shippedAt,\n icon: Truck,\n },\n {\n key: 'coolandlovely.fulfilment.delivered',\n label: 'Delivered',\n at: fulfilment.deliveredAt,\n icon: PackageCheck,\n },\n ];\n return (\n <div className=\"space-y-3\" data-testid=\"fulfilment-timeline\">\n <ol className=\"flex flex-wrap gap-4\">\n {steps.map(({ key, label, at, icon: Icon }) => (\n <li\n key={key}\n className={cn(\n 'flex items-center gap-1.5 text-sm',\n at ? 'text-text-primary' : 'text-text-secondary opacity-60'\n )}\n >\n <Icon className={cn('h-4 w-4', at && 'text-status-success-text')} />\n <span>{tr(key, label)}</span>\n {at && <span className=\"text-xs text-text-secondary\">{formatDate(at)}</span>}\n </li>\n ))}\n </ol>\n {fulfilment.trackingNumber && (\n <p className=\"text-sm text-text-primary\">\n {fulfilment.carrier} ·{' '}\n <span className=\"font-mono\" data-testid=\"fulfilment-tracking\">\n {fulfilment.trackingNumber}\n </span>\n {fulfilment.trackingUrl && (\n <a\n href={fulfilment.trackingUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"ml-2 inline-flex items-center gap-1 text-accent-primary hover:underline\"\n >\n {tr('coolandlovely.fulfilment.track', 'Track parcel')}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n </p>\n )}\n {fulfilment.note && (\n <p className=\"whitespace-pre-line text-sm text-text-secondary\">{fulfilment.note}</p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,EAAmB,EAAE,iBAAkD;CACrF,IAAM,IAAK,GAAO;AAqBlB,QACE,kBAAC,OAAD;EAAK,WAAU;EAAY,eAAY;YAAvC;GACE,kBAAC,MAAD;IAAI,WAAU;cAtB4E;KAC5F;MACE,KAAK;MACL,OAAO;MACP,IAAI,EAAW;MACf,MAAM;MACP;KACD;MACE,KAAK;MACL,OAAO;MACP,IAAI,EAAW;MACf,MAAM;MACP;KACD;MACE,KAAK;MACL,OAAO;MACP,IAAI,EAAW;MACf,MAAM;MACP;KACF,CAIY,KAAK,EAAE,QAAK,UAAO,OAAI,MAAM,QAClC,kBAAC,MAAD;KAEE,WAAW,EACT,qCACA,IAAK,sBAAsB,iCAC5B;eALH;MAOE,kBAAC,GAAD,EAAM,WAAW,EAAG,WAAW,KAAM,2BAA2B,EAAI,CAAA;MACpE,kBAAC,QAAD,EAAA,UAAO,EAAG,GAAK,EAAM,EAAQ,CAAA;MAC5B,KAAM,kBAAC,QAAD;OAAM,WAAU;iBAA+B,EAAW,EAAG;OAAQ,CAAA;MACzE;OATE,EASF,CACL;IACC,CAAA;GACJ,EAAW,kBACV,kBAAC,KAAD;IAAG,WAAU;cAAb;KACG,EAAW;KAAQ;KAAG;KACvB,kBAAC,QAAD;MAAM,WAAU;MAAY,eAAY;gBACrC,EAAW;MACP,CAAA;KACN,EAAW,eACV,kBAAC,KAAD;MACE,MAAM,EAAW;MACjB,QAAO;MACP,KAAI;MACJ,WAAU;gBAJZ,CAMG,EAAG,kCAAkC,eAAe,EACrD,kBAAC,GAAD,EAAc,WAAU,WAAY,CAAA,CAClC;;KAEJ;;GAEL,EAAW,QACV,kBAAC,KAAD;IAAG,WAAU;cAAmD,EAAW;IAAS,CAAA;GAElF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsHD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2B5C,CAAC"}
|
|
@@ -45,6 +45,10 @@ var i = {
|
|
|
45
45
|
paid: "success",
|
|
46
46
|
pending: "secondary",
|
|
47
47
|
synced: "success",
|
|
48
|
+
unfulfilled: "warning",
|
|
49
|
+
confirmed: "info",
|
|
50
|
+
shipped: "info",
|
|
51
|
+
delivered: "success",
|
|
48
52
|
inactive: "secondary",
|
|
49
53
|
error: "destructive",
|
|
50
54
|
failed: "destructive",
|
|
@@ -81,7 +85,11 @@ var i = {
|
|
|
81
85
|
inactive: "coolandlovely.status.inactive",
|
|
82
86
|
error: "coolandlovely.status.error",
|
|
83
87
|
failed: "coolandlovely.status.failed",
|
|
84
|
-
completed: "coolandlovely.status.completed"
|
|
88
|
+
completed: "coolandlovely.status.completed",
|
|
89
|
+
unfulfilled: "coolandlovely.status.unfulfilled",
|
|
90
|
+
confirmed: "coolandlovely.status.confirmed",
|
|
91
|
+
shipped: "coolandlovely.status.shipped",
|
|
92
|
+
delivered: "coolandlovely.status.delivered"
|
|
85
93
|
};
|
|
86
94
|
function l(e) {
|
|
87
95
|
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module coolandlovely/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-accent-blue-subtle text-accent-blue',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-accent-blue',\n outline: 'bg-text-secondary',\n};\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Brand lifecycle\n draft: 'secondary',\n pending_review: 'warning',\n published: 'success',\n suspended: 'destructive',\n archived: 'outline',\n\n // Collection lifecycle\n scheduled: 'info',\n live: 'success',\n ended: 'outline',\n\n // Style item status\n active: 'success',\n out_of_stock: 'warning',\n retired: 'outline',\n\n // Collaboration lifecycle\n proposed: 'secondary',\n accepted: 'info',\n in_progress: 'warning',\n declined: 'destructive',\n cancelled: 'destructive',\n\n // Visibility\n public: 'success',\n followers: 'info',\n private: 'secondary',\n\n // Wardrobe source\n owned: 'success',\n wishlist: 'info',\n purchased_on_platform: 'success',\n gifted: 'warning',\n\n // Orders + creator commissions (BOFF-3370)\n pending_payment: 'warning',\n paid: 'success',\n pending: 'secondary',\n synced: 'success',\n\n // Generic\n inactive: 'secondary',\n error: 'destructive',\n failed: 'destructive',\n completed: 'success',\n};\n\n/** Statuses that represent a live/active state get a calm opacity pulse on the dot. */\nconst liveStatuses = new Set(['live', 'published', 'active', 'in_progress']);\n\nconst STATUS_LABEL_KEYS: Record<string, string> = {\n draft: 'coolandlovely.status.draft',\n pending_review: 'coolandlovely.status.pendingReview',\n published: 'coolandlovely.status.published',\n suspended: 'coolandlovely.status.suspended',\n archived: 'coolandlovely.status.archived',\n scheduled: 'coolandlovely.status.scheduled',\n live: 'coolandlovely.status.live',\n ended: 'coolandlovely.status.ended',\n active: 'coolandlovely.status.active',\n out_of_stock: 'coolandlovely.status.outOfStock',\n retired: 'coolandlovely.status.retired',\n proposed: 'coolandlovely.status.proposed',\n accepted: 'coolandlovely.status.accepted',\n in_progress: 'coolandlovely.status.inProgress',\n declined: 'coolandlovely.status.declined',\n cancelled: 'coolandlovely.status.cancelled',\n public: 'coolandlovely.status.public',\n followers: 'coolandlovely.status.followers',\n private: 'coolandlovely.status.private',\n owned: 'coolandlovely.status.owned',\n wishlist: 'coolandlovely.status.wishlist',\n purchased_on_platform: 'coolandlovely.status.purchasedOnPlatform',\n gifted: 'coolandlovely.status.gifted',\n inactive: 'coolandlovely.status.inactive',\n error: 'coolandlovely.status.error',\n failed: 'coolandlovely.status.failed',\n completed: 'coolandlovely.status.completed',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase());\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const tr = useTr();\n const key = status.toLowerCase();\n const variant = statusVariantMap[key] || 'secondary';\n const isLive = liveStatuses.has(key);\n const labelKey = STATUS_LABEL_KEYS[key];\n const label = labelKey ? tr(labelKey, formatStatusLabel(status)) : formatStatusLabel(status);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full',\n dotStyles[variant],\n isLive && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;AAmBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAA0C;CAC9C,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAAiD;CAErD,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CAGV,WAAW;CACX,MAAM;CACN,OAAO;CAGP,QAAQ;CACR,cAAc;CACd,SAAS;CAGT,UAAU;CACV,UAAU;CACV,aAAa;CACb,UAAU;CACV,WAAW;CAGX,QAAQ;CACR,WAAW;CACX,SAAS;CAGT,OAAO;CACP,UAAU;CACV,uBAAuB;CACvB,QAAQ;CAGR,iBAAiB;CACjB,MAAM;CACN,SAAS;CACT,QAAQ;CAGR,UAAU;CACV,OAAO;CACP,QAAQ;CACR,WAAW;CACZ,EAGK,IAAe,IAAI,IAAI;CAAC;CAAQ;CAAa;CAAU;CAAc,CAAC,EAEtE,IAA4C;CAChD,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CACV,WAAW;CACX,MAAM;CACN,OAAO;CACP,QAAQ;CACR,cAAc;CACd,SAAS;CACT,UAAU;CACV,UAAU;CACV,aAAa;CACb,UAAU;CACV,WAAW;CACX,QAAQ;CACR,WAAW;CACX,SAAS;CACT,OAAO;CACP,UAAU;CACV,uBAAuB;CACvB,QAAQ;CACR,UAAU;CACV,OAAO;CACP,QAAQ;CACR,WAAW;CACZ;AAED,SAAS,EAAkB,GAAwB;AACjD,QAAO,EAAO,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAS,EAAK,aAAa,CAAC;;AAGjF,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAK,GAAO,EACZ,IAAM,EAAO,aAAa,EAC1B,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,EAAI,EAC9B,IAAW,EAAkB,IAC7B,IAAQ,IAAW,EAAG,GAAU,EAAkB,EAAO,CAAC,GAAG,EAAkB,EAAO;AAE5F,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOE,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,4BACA,EAAU,IACV,KAAU,oCACX;GACD,CAAA,EACD,EACI"}
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module coolandlovely/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-accent-blue-subtle text-accent-blue',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-accent-blue',\n outline: 'bg-text-secondary',\n};\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Brand lifecycle\n draft: 'secondary',\n pending_review: 'warning',\n published: 'success',\n suspended: 'destructive',\n archived: 'outline',\n\n // Collection lifecycle\n scheduled: 'info',\n live: 'success',\n ended: 'outline',\n\n // Style item status\n active: 'success',\n out_of_stock: 'warning',\n retired: 'outline',\n\n // Collaboration lifecycle\n proposed: 'secondary',\n accepted: 'info',\n in_progress: 'warning',\n declined: 'destructive',\n cancelled: 'destructive',\n\n // Visibility\n public: 'success',\n followers: 'info',\n private: 'secondary',\n\n // Wardrobe source\n owned: 'success',\n wishlist: 'info',\n purchased_on_platform: 'success',\n gifted: 'warning',\n\n // Orders + creator commissions (BOFF-3370)\n pending_payment: 'warning',\n paid: 'success',\n pending: 'secondary',\n synced: 'success',\n\n // Brand fulfilment (BOFF-9636)\n unfulfilled: 'warning',\n confirmed: 'info',\n shipped: 'info',\n delivered: 'success',\n\n // Generic\n inactive: 'secondary',\n error: 'destructive',\n failed: 'destructive',\n completed: 'success',\n};\n\n/** Statuses that represent a live/active state get a calm opacity pulse on the dot. */\nconst liveStatuses = new Set(['live', 'published', 'active', 'in_progress']);\n\nconst STATUS_LABEL_KEYS: Record<string, string> = {\n draft: 'coolandlovely.status.draft',\n pending_review: 'coolandlovely.status.pendingReview',\n published: 'coolandlovely.status.published',\n suspended: 'coolandlovely.status.suspended',\n archived: 'coolandlovely.status.archived',\n scheduled: 'coolandlovely.status.scheduled',\n live: 'coolandlovely.status.live',\n ended: 'coolandlovely.status.ended',\n active: 'coolandlovely.status.active',\n out_of_stock: 'coolandlovely.status.outOfStock',\n retired: 'coolandlovely.status.retired',\n proposed: 'coolandlovely.status.proposed',\n accepted: 'coolandlovely.status.accepted',\n in_progress: 'coolandlovely.status.inProgress',\n declined: 'coolandlovely.status.declined',\n cancelled: 'coolandlovely.status.cancelled',\n public: 'coolandlovely.status.public',\n followers: 'coolandlovely.status.followers',\n private: 'coolandlovely.status.private',\n owned: 'coolandlovely.status.owned',\n wishlist: 'coolandlovely.status.wishlist',\n purchased_on_platform: 'coolandlovely.status.purchasedOnPlatform',\n gifted: 'coolandlovely.status.gifted',\n inactive: 'coolandlovely.status.inactive',\n error: 'coolandlovely.status.error',\n failed: 'coolandlovely.status.failed',\n completed: 'coolandlovely.status.completed',\n unfulfilled: 'coolandlovely.status.unfulfilled',\n confirmed: 'coolandlovely.status.confirmed',\n shipped: 'coolandlovely.status.shipped',\n delivered: 'coolandlovely.status.delivered',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase());\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const tr = useTr();\n const key = status.toLowerCase();\n const variant = statusVariantMap[key] || 'secondary';\n const isLive = liveStatuses.has(key);\n const labelKey = STATUS_LABEL_KEYS[key];\n const label = labelKey ? tr(labelKey, formatStatusLabel(status)) : formatStatusLabel(status);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full',\n dotStyles[variant],\n isLive && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;AAmBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAEK,IAA0C;CAC9C,SAAS;CACT,SAAS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C,GAAG,EAAkB,EAAO;AAE5F,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOE,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,4BACA,EAAU,IACV,KAAU,oCACX;GACD,CAAA,EACD,EACI"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CooBrandOrder, CooBrandOrderConnection, CooBrandOrderSummary, CooFulfilmentStatus, CooUpdateOrderFulfilmentInput } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const useBrandOrders: (brandId: string | undefined, fulfilmentStatus?: CooFulfilmentStatus) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooBrandOrderConnection>, Error>;
|
|
4
|
+
export declare const useBrandOrderSummary: (brandId: string | undefined) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooBrandOrderSummary>, Error>;
|
|
5
|
+
export declare const useBrandOrder: (brandId: string | undefined, id: string | undefined) => import('@tanstack/react-query').UseQueryResult<NoInfer<CooBrandOrder | null>, Error>;
|
|
6
|
+
export declare const useUpdateOrderFulfilment: () => import('@tanstack/react-query').UseMutationResult<CooBrandOrder, Error, CooUpdateOrderFulfilmentInput, unknown>;
|
|
7
|
+
//# sourceMappingURL=useBrandOrdersApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBrandOrdersApi.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useBrandOrdersApi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAgBlB,eAAO,MAAM,cAAc,GACzB,SAAS,MAAM,GAAG,SAAS,EAC3B,mBAAmB,mBAAmB,4FAoBvC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,GAAG,SAAS,yFAgB/D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,GAAG,SAAS,EAAE,IAAI,MAAM,GAAG,SAAS,yFAchF,CAAC;AAEF,eAAO,MAAM,wBAAwB,uHAoBpC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useCoolAndLovely as e } from "../context/CoolAndLovelyContext.js";
|
|
2
|
+
import "../context/index.js";
|
|
3
|
+
import { coolQuery as t } from "./useCoolAndLovelyApi.js";
|
|
4
|
+
import { FULFILMENT_FIELDS as n } from "./useCommerceApi.js";
|
|
5
|
+
import { useMutation as r, useQuery as i, useQueryClient as a } from "@tanstack/react-query";
|
|
6
|
+
//#region src/coolandlovely/hooks/useBrandOrdersApi.ts
|
|
7
|
+
var o = "coolandlovely", s = `
|
|
8
|
+
id orderNumber status brandId currency brandSubtotal itemCount
|
|
9
|
+
shippingName shippingAddress buyerNote paidAt createdAt
|
|
10
|
+
items {
|
|
11
|
+
id styleItemId brandId name sku image { id } size colour unitPrice quantity lineTotal
|
|
12
|
+
lookId isCreatorAttributed
|
|
13
|
+
}
|
|
14
|
+
fulfilment { ${n} }
|
|
15
|
+
`, c = (n, r) => {
|
|
16
|
+
let { apiGatewayUrl: a } = e();
|
|
17
|
+
return i({
|
|
18
|
+
queryKey: [
|
|
19
|
+
o,
|
|
20
|
+
"brand-orders",
|
|
21
|
+
n,
|
|
22
|
+
r ?? "ALL"
|
|
23
|
+
],
|
|
24
|
+
enabled: !!n,
|
|
25
|
+
queryFn: async () => (await t(`query CooBrandOrders($brandId: ID!, $fulfilmentStatus: CooFulfilmentStatus, $pagination: PaginationInput) {
|
|
26
|
+
cooBrandOrders(brandId: $brandId, fulfilmentStatus: $fulfilmentStatus, pagination: $pagination) {
|
|
27
|
+
items { ${s} }
|
|
28
|
+
pageInfo { cursor hasMore }
|
|
29
|
+
}
|
|
30
|
+
}`, {
|
|
31
|
+
brandId: n,
|
|
32
|
+
fulfilmentStatus: r,
|
|
33
|
+
pagination: {
|
|
34
|
+
limit: 50,
|
|
35
|
+
offset: 0
|
|
36
|
+
}
|
|
37
|
+
}, a)).cooBrandOrders
|
|
38
|
+
});
|
|
39
|
+
}, l = (n) => {
|
|
40
|
+
let { apiGatewayUrl: r } = e();
|
|
41
|
+
return i({
|
|
42
|
+
queryKey: [
|
|
43
|
+
o,
|
|
44
|
+
"brand-order-summary",
|
|
45
|
+
n
|
|
46
|
+
],
|
|
47
|
+
enabled: !!n,
|
|
48
|
+
queryFn: async () => (await t("query CooBrandOrderSummary($brandId: ID!) {\n cooBrandOrderSummary(brandId: $brandId) { brandId unfulfilled confirmed shipped delivered total }\n }", { brandId: n }, r)).cooBrandOrderSummary
|
|
49
|
+
});
|
|
50
|
+
}, u = (n, r) => {
|
|
51
|
+
let { apiGatewayUrl: a } = e();
|
|
52
|
+
return i({
|
|
53
|
+
queryKey: [
|
|
54
|
+
o,
|
|
55
|
+
"brand-order",
|
|
56
|
+
n,
|
|
57
|
+
r
|
|
58
|
+
],
|
|
59
|
+
enabled: !!n && !!r,
|
|
60
|
+
queryFn: async () => (await t(`query CooBrandOrder($brandId: ID!, $id: ID!) { cooBrandOrder(brandId: $brandId, id: $id) { ${s} } }`, {
|
|
61
|
+
brandId: n,
|
|
62
|
+
id: r
|
|
63
|
+
}, a)).cooBrandOrder
|
|
64
|
+
});
|
|
65
|
+
}, d = () => {
|
|
66
|
+
let { apiGatewayUrl: n } = e(), i = a();
|
|
67
|
+
return r({
|
|
68
|
+
mutationFn: async (e) => (await t(`mutation CooUpdateOrderFulfilment($input: CooUpdateOrderFulfilmentInput!) {
|
|
69
|
+
cooUpdateOrderFulfilment(input: $input) { ${s} }
|
|
70
|
+
}`, { input: e }, n)).cooUpdateOrderFulfilment,
|
|
71
|
+
onSuccess: (e) => {
|
|
72
|
+
i.setQueryData([
|
|
73
|
+
o,
|
|
74
|
+
"brand-order",
|
|
75
|
+
e.brandId,
|
|
76
|
+
e.id
|
|
77
|
+
], e), i.invalidateQueries({ queryKey: [
|
|
78
|
+
o,
|
|
79
|
+
"brand-orders",
|
|
80
|
+
e.brandId
|
|
81
|
+
] }), i.invalidateQueries({ queryKey: [
|
|
82
|
+
o,
|
|
83
|
+
"brand-order-summary",
|
|
84
|
+
e.brandId
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { u as useBrandOrder, l as useBrandOrderSummary, c as useBrandOrders, d as useUpdateOrderFulfilment };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=useBrandOrdersApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBrandOrdersApi.js","names":[],"sources":["../../../src/coolandlovely/hooks/useBrandOrdersApi.ts"],"sourcesContent":["/**\n * Brand order hooks (BOFF-9636)\n * @module coolandlovely/hooks\n *\n * React Query layer over the brand-side order fields of `wspace-coolandlovely-svc`: the paid\n * orders that contain a brand's pieces (only that brand's lines), counts per fulfilment state,\n * and the fulfilment mutation (confirm, ship with tracking, mark delivered).\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useCoolAndLovely } from '../context';\nimport type {\n CooBrandOrder,\n CooBrandOrderConnection,\n CooBrandOrderSummary,\n CooFulfilmentStatus,\n CooUpdateOrderFulfilmentInput,\n} from '../types';\nimport { FULFILMENT_FIELDS } from './useCommerceApi';\nimport { coolQuery } from './useCoolAndLovelyApi';\n\nconst QK = 'coolandlovely';\n\nconst BRAND_ORDER_FIELDS = `\n id orderNumber status brandId currency brandSubtotal itemCount\n shippingName shippingAddress buyerNote paidAt createdAt\n items {\n id styleItemId brandId name sku image { id } size colour unitPrice quantity lineTotal\n lookId isCreatorAttributed\n }\n fulfilment { ${FULFILMENT_FIELDS} }\n`;\n\nexport const useBrandOrders = (\n brandId: string | undefined,\n fulfilmentStatus?: CooFulfilmentStatus\n) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-orders', brandId, fulfilmentStatus ?? 'ALL'],\n enabled: !!brandId,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandOrders: CooBrandOrderConnection }>(\n `query CooBrandOrders($brandId: ID!, $fulfilmentStatus: CooFulfilmentStatus, $pagination: PaginationInput) {\n cooBrandOrders(brandId: $brandId, fulfilmentStatus: $fulfilmentStatus, pagination: $pagination) {\n items { ${BRAND_ORDER_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { brandId, fulfilmentStatus, pagination: { limit: 50, offset: 0 } },\n apiGatewayUrl\n );\n return data.cooBrandOrders;\n },\n });\n};\n\nexport const useBrandOrderSummary = (brandId: string | undefined) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-order-summary', brandId],\n enabled: !!brandId,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandOrderSummary: CooBrandOrderSummary }>(\n `query CooBrandOrderSummary($brandId: ID!) {\n cooBrandOrderSummary(brandId: $brandId) { brandId unfulfilled confirmed shipped delivered total }\n }`,\n { brandId },\n apiGatewayUrl\n );\n return data.cooBrandOrderSummary;\n },\n });\n};\n\nexport const useBrandOrder = (brandId: string | undefined, id: string | undefined) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-order', brandId, id],\n enabled: !!brandId && !!id,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandOrder: CooBrandOrder | null }>(\n `query CooBrandOrder($brandId: ID!, $id: ID!) { cooBrandOrder(brandId: $brandId, id: $id) { ${BRAND_ORDER_FIELDS} } }`,\n { brandId, id },\n apiGatewayUrl\n );\n return data.cooBrandOrder;\n },\n });\n};\n\nexport const useUpdateOrderFulfilment = () => {\n const { apiGatewayUrl } = useCoolAndLovely();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (input: CooUpdateOrderFulfilmentInput) => {\n const data = await coolQuery<{ cooUpdateOrderFulfilment: CooBrandOrder }>(\n `mutation CooUpdateOrderFulfilment($input: CooUpdateOrderFulfilmentInput!) {\n cooUpdateOrderFulfilment(input: $input) { ${BRAND_ORDER_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.cooUpdateOrderFulfilment;\n },\n onSuccess: (order) => {\n queryClient.setQueryData([QK, 'brand-order', order.brandId, order.id], order);\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-orders', order.brandId] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-order-summary', order.brandId] });\n },\n });\n};\n"],"mappings":";;;;;;AAsBA,IAAM,IAAK,iBAEL,IAAqB;;;;;;;iBAOV,EAAkB;GAGtB,KACX,GACA,MACG;CACH,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU;GAAC;GAAI;GAAgB;GAAS,KAAoB;GAAM;EAClE,SAAS,CAAC,CAAC;EACX,SAAS,aACM,MAAM,EACjB;;sBAEc,EAAmB;;;YAIjC;GAAE;GAAS;GAAkB,YAAY;IAAE,OAAO;IAAI,QAAQ;IAAG;GAAE,EACnE,EACD,EACW;EAEf,CAAC;GAGS,KAAwB,MAAgC;CACnE,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU;GAAC;GAAI;GAAuB;GAAQ;EAC9C,SAAS,CAAC,CAAC;EACX,SAAS,aACM,MAAM,EACjB,uKAGA,EAAE,YAAS,EACX,EACD,EACW;EAEf,CAAC;GAGS,KAAiB,GAA6B,MAA2B;CACpF,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU;GAAC;GAAI;GAAe;GAAS;GAAG;EAC1C,SAAS,CAAC,CAAC,KAAW,CAAC,CAAC;EACxB,SAAS,aACM,MAAM,EACjB,8FAA8F,EAAmB,OACjH;GAAE;GAAS;GAAI,EACf,EACD,EACW;EAEf,CAAC;GAGS,UAAiC;CAC5C,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAc,GAAgB;AACpC,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB;sDAC8C,EAAmB;YAEjE,EAAE,UAAO,EACT,EACD,EACW;EAEd,YAAY,MAAU;AAGf,GAFL,EAAY,aAAa;IAAC;IAAI;IAAe,EAAM;IAAS,EAAM;IAAG,EAAE,EAAM,EACxE,EAAY,kBAAkB,EAAE,UAAU;IAAC;IAAI;IAAgB,EAAM;IAAQ,EAAE,CAAC,EAChF,EAAY,kBAAkB,EAAE,UAAU;IAAC;IAAI;IAAuB,EAAM;IAAQ,EAAE,CAAC;;EAE/F,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CooAddToCartInput, CooCart, CooCheckoutInput, CooCreatorEarningConnection, CooCreatorEarningsSummary, CooCreatorPayout, CooOrder, CooOrderCheckout, CooOrderConnection, CooOrderStatus } from '../types';
|
|
2
2
|
|
|
3
|
+
/** Per-brand fulfilment (BOFF-9636): shared by the shopper's order detail and the brand view. */
|
|
4
|
+
export declare const FULFILMENT_FIELDS = "\n id orderId brandId brandName status carrier trackingNumber trackingUrl note\n confirmedAt shippedAt deliveredAt updatedAt\n";
|
|
3
5
|
export declare const useMyCart: () => import('@tanstack/react-query').UseQueryResult<NoInfer<CooCart>, Error>;
|
|
4
6
|
export declare const useAddToCart: () => import('@tanstack/react-query').UseMutationResult<CooCart, Error, {
|
|
5
7
|
input: CooAddToCartInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCommerceApi.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useCommerceApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useCommerceApi.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useCommerceApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAC;AAsBlB,iGAAiG;AACjG,eAAO,MAAM,iBAAiB,qIAG7B,CAAC;AAiBF,eAAO,MAAM,SAAS,+EAarB,CAAC;AAuBF,eAAO,MAAM,YAAY;WACE,iBAAiB;WAGzC,CAAC;AAEJ,eAAO,MAAM,iBAAiB;QACN,MAAM;cAAY,MAAM;WAK7C,CAAC;AAEJ,eAAO,MAAM,iBAAiB;QACN,MAAM;WAG3B,CAAC;AAMJ,eAAO,MAAM,WAAW,GAAI,SAAS,cAAc,uFAkBlD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,GAAG,SAAS,oFAchD,CAAC;AAWF,eAAO,MAAM,WAAW,6GAcvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,mGAcjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,2FAc/B,CAAC;AAEF,eAAO,MAAM,cAAc,2FAc1B,CAAC;AAMF,eAAO,MAAM,oBAAoB,mGAqBhC,CAAC;AAEF,eAAO,MAAM,2BAA2B,iGAkBvC,CAAC;AAEF,eAAO,MAAM,uBAAuB;YAII,MAAM;cAAY,MAAM;YAAU,MAAM,GAAG,IAAI;WActF,CAAC"}
|
|
@@ -3,16 +3,20 @@ import "../context/index.js";
|
|
|
3
3
|
import { coolQuery as t } from "./useCoolAndLovelyApi.js";
|
|
4
4
|
import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
5
|
//#region src/coolandlovely/hooks/useCommerceApi.ts
|
|
6
|
-
var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colour lookId unitPrice currency lineTotal isPurchasable\n styleItem { id name status image { id } brand { id name } }\n }\n itemCount subtotal currency canCheckout blockedReason\n", s = "\n id orderNumber status currency subtotal taxAmount total itemCount\n shippingName shippingAddress buyerNote paymentProvider paidAt cancelledAt createdAt updatedAt\n items {\n id styleItemId brandId name sku image { id } size colour unitPrice quantity lineTotal\n lookId isCreatorAttributed\n }\n", c = `
|
|
6
|
+
var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colour lookId unitPrice currency lineTotal isPurchasable\n styleItem { id name status image { id } brand { id name } }\n }\n itemCount subtotal currency canCheckout blockedReason\n", s = "\n id orderNumber status currency subtotal taxAmount total itemCount\n shippingName shippingAddress buyerNote paymentProvider paidAt cancelledAt createdAt updatedAt\n items {\n id styleItemId brandId name sku image { id } size colour unitPrice quantity lineTotal\n lookId isCreatorAttributed\n }\n", c = "\n id orderId brandId brandName status carrier trackingNumber trackingUrl note\n confirmedAt shippedAt deliveredAt updatedAt\n", l = `
|
|
7
|
+
${s}
|
|
8
|
+
fulfilmentStatus
|
|
9
|
+
fulfilments { ${c} }
|
|
10
|
+
`, u = `
|
|
7
11
|
order { ${s} }
|
|
8
12
|
provider providerOrderId razorpayKeyId clientSecret stripePublishableKey subtotal taxAmount total currency
|
|
9
|
-
`,
|
|
13
|
+
`, d = () => {
|
|
10
14
|
let { apiGatewayUrl: n } = e();
|
|
11
15
|
return r({
|
|
12
16
|
queryKey: [a, "cart"],
|
|
13
17
|
queryFn: async () => (await t(`query CooMyCart { cooMyCart { ${o} } }`, {}, n)).cooMyCart
|
|
14
18
|
});
|
|
15
|
-
},
|
|
19
|
+
}, f = (r, o) => {
|
|
16
20
|
let { apiGatewayUrl: s } = e(), c = i();
|
|
17
21
|
return n({
|
|
18
22
|
mutationFn: async (e) => {
|
|
@@ -24,9 +28,9 @@ var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colo
|
|
|
24
28
|
c.setQueryData([a, "cart"], e);
|
|
25
29
|
}
|
|
26
30
|
});
|
|
27
|
-
},
|
|
31
|
+
}, p = () => f(`mutation CooAddToCart($input: CooAddToCartInput!) { cooAddToCart(input: $input) { ${o} } }`, "cooAddToCart"), m = () => f(`mutation CooUpdateCartItem($id: ID!, $quantity: Int!) {
|
|
28
32
|
cooUpdateCartItem(id: $id, quantity: $quantity) { ${o} }
|
|
29
|
-
}`, "cooUpdateCartItem"),
|
|
33
|
+
}`, "cooUpdateCartItem"), h = () => f(`mutation CooRemoveCartItem($id: ID!) { cooRemoveCartItem(id: $id) { ${o} } }`, "cooRemoveCartItem"), g = (n) => {
|
|
30
34
|
let { apiGatewayUrl: i } = e();
|
|
31
35
|
return r({
|
|
32
36
|
queryKey: [
|
|
@@ -47,7 +51,7 @@ var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colo
|
|
|
47
51
|
}
|
|
48
52
|
}, i)).cooMyOrders
|
|
49
53
|
});
|
|
50
|
-
},
|
|
54
|
+
}, _ = (n) => {
|
|
51
55
|
let { apiGatewayUrl: i } = e();
|
|
52
56
|
return r({
|
|
53
57
|
queryKey: [
|
|
@@ -56,9 +60,9 @@ var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colo
|
|
|
56
60
|
n
|
|
57
61
|
],
|
|
58
62
|
enabled: !!n,
|
|
59
|
-
queryFn: async () => (await t(`query CooMyOrder($id: ID!) { cooMyOrder(id: $id) { ${
|
|
63
|
+
queryFn: async () => (await t(`query CooMyOrder($id: ID!) { cooMyOrder(id: $id) { ${l} } }`, { id: n }, i)).cooMyOrder
|
|
60
64
|
});
|
|
61
|
-
},
|
|
65
|
+
}, v = () => {
|
|
62
66
|
let e = i();
|
|
63
67
|
return (t) => {
|
|
64
68
|
e.setQueryData([
|
|
@@ -67,31 +71,31 @@ var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colo
|
|
|
67
71
|
t.id
|
|
68
72
|
], t), e.invalidateQueries({ queryKey: [a, "orders"] }), e.invalidateQueries({ queryKey: [a, "cart"] });
|
|
69
73
|
};
|
|
70
|
-
},
|
|
71
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
74
|
+
}, y = () => {
|
|
75
|
+
let { apiGatewayUrl: r } = e(), i = v();
|
|
72
76
|
return n({
|
|
73
|
-
mutationFn: async (e) => (await t(`mutation CooCheckout($input: CooCheckoutInput!) { cooCheckout(input: $input) { ${
|
|
77
|
+
mutationFn: async (e) => (await t(`mutation CooCheckout($input: CooCheckoutInput!) { cooCheckout(input: $input) { ${u} } }`, { input: e }, r)).cooCheckout,
|
|
74
78
|
onSuccess: (e) => i(e.order)
|
|
75
79
|
});
|
|
76
|
-
},
|
|
77
|
-
let { apiGatewayUrl: r } = e(), i =
|
|
80
|
+
}, b = () => {
|
|
81
|
+
let { apiGatewayUrl: r } = e(), i = v();
|
|
78
82
|
return n({
|
|
79
|
-
mutationFn: async (e) => (await t(`mutation CooResumeOrderPayment($id: ID!) { cooResumeOrderPayment(id: $id) { ${
|
|
83
|
+
mutationFn: async (e) => (await t(`mutation CooResumeOrderPayment($id: ID!) { cooResumeOrderPayment(id: $id) { ${u} } }`, { id: e }, r)).cooResumeOrderPayment,
|
|
80
84
|
onSuccess: (e) => i(e.order)
|
|
81
85
|
});
|
|
82
|
-
},
|
|
86
|
+
}, x = () => {
|
|
83
87
|
let { apiGatewayUrl: r } = e();
|
|
84
88
|
return n({
|
|
85
89
|
mutationFn: async (e) => (await t(`mutation CooSyncOrderPayment($id: ID!) { cooSyncOrderPayment(id: $id) { ${s} } }`, { id: e }, r)).cooSyncOrderPayment,
|
|
86
|
-
onSuccess:
|
|
90
|
+
onSuccess: v()
|
|
87
91
|
});
|
|
88
|
-
},
|
|
92
|
+
}, S = () => {
|
|
89
93
|
let { apiGatewayUrl: r } = e();
|
|
90
94
|
return n({
|
|
91
95
|
mutationFn: async (e) => (await t(`mutation CooCancelOrder($id: ID!) { cooCancelOrder(id: $id) { ${s} } }`, { id: e }, r)).cooCancelOrder,
|
|
92
|
-
onSuccess:
|
|
96
|
+
onSuccess: v()
|
|
93
97
|
});
|
|
94
|
-
},
|
|
98
|
+
}, C = () => {
|
|
95
99
|
let { apiGatewayUrl: n } = e();
|
|
96
100
|
return r({
|
|
97
101
|
queryKey: [a, "creator-earnings"],
|
|
@@ -100,13 +104,13 @@ var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colo
|
|
|
100
104
|
offset: 0
|
|
101
105
|
} }, n)).cooMyCreatorEarnings
|
|
102
106
|
});
|
|
103
|
-
},
|
|
107
|
+
}, w = () => {
|
|
104
108
|
let { apiGatewayUrl: n } = e();
|
|
105
109
|
return r({
|
|
106
110
|
queryKey: [a, "creator-earnings-summary"],
|
|
107
111
|
queryFn: async () => (await t("query CooMyCreatorEarningsSummary {\n cooMyCreatorEarningsSummary {\n commissionRate holdDays currency totalLifetimeAmount availableAmount pendingAmount\n reservedAmount paidAmount pendingPayoutCount unsyncedCount billingAvailable\n }\n }", {}, n)).cooMyCreatorEarningsSummary
|
|
108
112
|
});
|
|
109
|
-
},
|
|
113
|
+
}, T = () => {
|
|
110
114
|
let { apiGatewayUrl: r } = e(), o = i();
|
|
111
115
|
return n({
|
|
112
116
|
mutationFn: async (e) => (await t("mutation CooRequestCreatorPayout($input: CooRequestCreatorPayoutInput!) {\n cooRequestCreatorPayout(input: $input) { id status requestedAmount currency createdAt }\n }", { input: e }, r)).cooRequestCreatorPayout,
|
|
@@ -116,6 +120,6 @@ var a = "coolandlovely", o = "\n items {\n id styleItemId quantity size colo
|
|
|
116
120
|
});
|
|
117
121
|
};
|
|
118
122
|
//#endregion
|
|
119
|
-
export {
|
|
123
|
+
export { c as FULFILMENT_FIELDS, p as useAddToCart, S as useCancelOrder, y as useCheckout, d as useMyCart, C as useMyCreatorEarnings, w as useMyCreatorEarningsSummary, _ as useMyOrder, g as useMyOrders, h as useRemoveCartItem, T as useRequestCreatorPayout, b as useResumeOrderPayment, x as useSyncOrderPayment, m as useUpdateCartItem };
|
|
120
124
|
|
|
121
125
|
//# sourceMappingURL=useCommerceApi.js.map
|