@burdenoff/microfe-coolandlovely 2026.1024.1 → 2026.1024.3
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/CoolAndLovelyRoot.d.ts.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoot.js +92 -68
- package/dist/coolandlovely/CoolAndLovelyRoot.js.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoutes.js +25 -9
- package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
- package/dist/coolandlovely/components/AddToCartPanel.d.ts +10 -0
- package/dist/coolandlovely/components/AddToCartPanel.d.ts.map +1 -0
- package/dist/coolandlovely/components/AddToCartPanel.js +97 -0
- package/dist/coolandlovely/components/AddToCartPanel.js.map +1 -0
- package/dist/coolandlovely/components/PayForOrder.d.ts +11 -0
- package/dist/coolandlovely/components/PayForOrder.d.ts.map +1 -0
- package/dist/coolandlovely/components/PayForOrder.js +118 -0
- package/dist/coolandlovely/components/PayForOrder.js.map +1 -0
- package/dist/coolandlovely/components/StatusBadge.d.ts.map +1 -1
- package/dist/coolandlovely/components/StatusBadge.js +4 -0
- package/dist/coolandlovely/components/StatusBadge.js.map +1 -1
- package/dist/coolandlovely/hooks/useCommerceApi.d.ts +27 -0
- package/dist/coolandlovely/hooks/useCommerceApi.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useCommerceApi.js +121 -0
- package/dist/coolandlovely/hooks/useCommerceApi.js.map +1 -0
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts +1 -0
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js +1 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js.map +1 -1
- package/dist/coolandlovely/pages/commerce/CartPage.d.ts +10 -0
- package/dist/coolandlovely/pages/commerce/CartPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/CartPage.js +283 -0
- package/dist/coolandlovely/pages/commerce/CartPage.js.map +1 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts +11 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js +185 -0
- package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js.map +1 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts +11 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.js +280 -0
- package/dist/coolandlovely/pages/commerce/OrdersPage.js.map +1 -0
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.js +114 -106
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.js.map +1 -1
- package/dist/coolandlovely/pages/looks/LookDetailPage.js +1 -1
- package/dist/coolandlovely/pages/looks/LookDetailPage.js.map +1 -1
- package/dist/coolandlovely/types/commerce.d.ts +137 -0
- package/dist/coolandlovely/types/commerce.d.ts.map +1 -0
- package/dist/coolandlovely/types/index.d.ts +1 -0
- package/dist/coolandlovely/types/index.d.ts.map +1 -1
- package/dist/coolandlovely/utils/paymentProviders.d.ts +74 -0
- package/dist/coolandlovely/utils/paymentProviders.d.ts.map +1 -0
- package/dist/coolandlovely/utils/paymentProviders.js +42 -0
- package/dist/coolandlovely/utils/paymentProviders.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoolAndLovelyRoot.d.ts","sourceRoot":"","sources":["../../src/coolandlovely/CoolAndLovelyRoot.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CoolAndLovelyRoot.d.ts","sourceRoot":"","sources":["../../src/coolandlovely/CoolAndLovelyRoot.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA0BhC,OAAO,KAAK,EAAE,sBAAsB,EAAW,MAAM,SAAS,CAAC;AAY/D,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAuNxD,CAAC"}
|
|
@@ -5,171 +5,195 @@ import "./components/index.js";
|
|
|
5
5
|
import { useCallback as r, useEffect as i } from "react";
|
|
6
6
|
import { QueryClient as a, QueryClientProvider as o } from "@tanstack/react-query";
|
|
7
7
|
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
-
import { BookHeart as c, Compass as l, Handshake as u, Heart as d, Home as f,
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { FeatureFlagProvider as
|
|
11
|
-
import { useFeatureFlag as
|
|
8
|
+
import { BookHeart as c, Compass as l, Handshake as u, Heart as d, Home as f, Package as p, Shapes as m, Shield as h, Shirt as g, ShoppingBag as _, Sparkles as v, Store as y, TrendingUp as b, UserCircle as x, Wallet as S } from "lucide-react";
|
|
9
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
10
|
+
import { FeatureFlagProvider as T } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
11
|
+
import { useFeatureFlag as E } from "@burdenoff/fe-libs/shared/feature-flags/useFeatureFlag";
|
|
12
12
|
//#region src/coolandlovely/CoolAndLovelyRoot.tsx
|
|
13
|
-
var
|
|
13
|
+
var D = new a({ defaultOptions: { queries: {
|
|
14
14
|
staleTime: 300 * 1e3,
|
|
15
15
|
retry: 1
|
|
16
|
-
} } }),
|
|
17
|
-
let { registerNavItems:
|
|
18
|
-
let n =
|
|
16
|
+
} } }), O = (a) => {
|
|
17
|
+
let { registerNavItems: O, registerFooterItems: k, basePath: A = "/" } = a, { t: j } = s(), M = r((e, t) => {
|
|
18
|
+
let n = j(e);
|
|
19
19
|
return n === e ? t : n;
|
|
20
|
-
}, [
|
|
20
|
+
}, [j]), N = E("coolandlovely.admin.curation", !1), P = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
21
21
|
return i(() => {
|
|
22
|
-
if (
|
|
22
|
+
if (O) return O([
|
|
23
23
|
{
|
|
24
24
|
id: "coolandlovely-overview",
|
|
25
|
-
label:
|
|
26
|
-
path:
|
|
27
|
-
icon: /* @__PURE__ */
|
|
25
|
+
label: M("coolandlovely.nav.overview", "Overview"),
|
|
26
|
+
path: P(A, ""),
|
|
27
|
+
icon: /* @__PURE__ */ C(f, { size: 20 }),
|
|
28
28
|
order: 1,
|
|
29
29
|
group: "main"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
id: "coolandlovely-brands",
|
|
33
|
-
label:
|
|
34
|
-
path:
|
|
35
|
-
icon: /* @__PURE__ */
|
|
33
|
+
label: M("coolandlovely.nav.brands", "Brands"),
|
|
34
|
+
path: P(A, "brands"),
|
|
35
|
+
icon: /* @__PURE__ */ C(y, { size: 20 }),
|
|
36
36
|
order: 10,
|
|
37
37
|
group: "catalog"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
id: "coolandlovely-collections",
|
|
41
|
-
label:
|
|
42
|
-
path:
|
|
43
|
-
icon: /* @__PURE__ */
|
|
41
|
+
label: M("coolandlovely.nav.collections", "Collections"),
|
|
42
|
+
path: P(A, "collections"),
|
|
43
|
+
icon: /* @__PURE__ */ C(m, { size: 20 }),
|
|
44
44
|
order: 11,
|
|
45
45
|
group: "catalog"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
id: "coolandlovely-items",
|
|
49
|
-
label:
|
|
50
|
-
path:
|
|
51
|
-
icon: /* @__PURE__ */
|
|
49
|
+
label: M("coolandlovely.nav.items", "Style Items"),
|
|
50
|
+
path: P(A, "items"),
|
|
51
|
+
icon: /* @__PURE__ */ C(g, { size: 20 }),
|
|
52
52
|
order: 12,
|
|
53
53
|
group: "catalog"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
id: "coolandlovely-looks",
|
|
57
|
-
label:
|
|
58
|
-
path:
|
|
59
|
-
icon: /* @__PURE__ */
|
|
57
|
+
label: M("coolandlovely.nav.looks", "Looks"),
|
|
58
|
+
path: P(A, "looks"),
|
|
59
|
+
icon: /* @__PURE__ */ C(v, { size: 20 }),
|
|
60
60
|
order: 20,
|
|
61
61
|
group: "social"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
id: "coolandlovely-collaborations",
|
|
65
|
-
label:
|
|
66
|
-
path:
|
|
67
|
-
icon: /* @__PURE__ */
|
|
65
|
+
label: M("coolandlovely.nav.collaborations", "Collaborations"),
|
|
66
|
+
path: P(A, "collaborations"),
|
|
67
|
+
icon: /* @__PURE__ */ C(u, { size: 20 }),
|
|
68
68
|
order: 21,
|
|
69
69
|
group: "social"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
id: "coolandlovely-wardrobe",
|
|
73
|
-
label:
|
|
74
|
-
path:
|
|
75
|
-
icon: /* @__PURE__ */
|
|
73
|
+
label: M("coolandlovely.nav.wardrobe", "My Wardrobe"),
|
|
74
|
+
path: P(A, "wardrobe"),
|
|
75
|
+
icon: /* @__PURE__ */ C(d, { size: 20 }),
|
|
76
76
|
order: 30,
|
|
77
77
|
group: "my-style"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
id: "coolandlovely-lookbooks",
|
|
81
|
-
label:
|
|
82
|
-
path:
|
|
83
|
-
icon: /* @__PURE__ */
|
|
81
|
+
label: M("coolandlovely.nav.lookbooks", "Lookbooks"),
|
|
82
|
+
path: P(A, "lookbooks"),
|
|
83
|
+
icon: /* @__PURE__ */ C(c, { size: 20 }),
|
|
84
84
|
order: 31,
|
|
85
85
|
group: "my-style"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: "coolandlovely-profile",
|
|
89
|
-
label:
|
|
90
|
-
path:
|
|
91
|
-
icon: /* @__PURE__ */
|
|
89
|
+
label: M("coolandlovely.nav.profile", "Style Profile"),
|
|
90
|
+
path: P(A, "profile"),
|
|
91
|
+
icon: /* @__PURE__ */ C(x, { size: 20 }),
|
|
92
92
|
order: 32,
|
|
93
93
|
group: "my-style"
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
id: "coolandlovely-cart",
|
|
97
|
+
label: M("coolandlovely.nav.cart", "Cart"),
|
|
98
|
+
path: P(A, "cart"),
|
|
99
|
+
icon: /* @__PURE__ */ C(_, { size: 20 }),
|
|
100
|
+
order: 33,
|
|
101
|
+
group: "my-style"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "coolandlovely-orders",
|
|
105
|
+
label: M("coolandlovely.nav.orders", "My Orders"),
|
|
106
|
+
path: P(A, "orders"),
|
|
107
|
+
icon: /* @__PURE__ */ C(p, { size: 20 }),
|
|
108
|
+
order: 34,
|
|
109
|
+
group: "my-style"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "coolandlovely-earnings",
|
|
113
|
+
label: M("coolandlovely.nav.earnings", "Creator Earnings"),
|
|
114
|
+
path: P(A, "earnings"),
|
|
115
|
+
icon: /* @__PURE__ */ C(S, { size: 20 }),
|
|
116
|
+
order: 35,
|
|
117
|
+
group: "my-style"
|
|
118
|
+
},
|
|
95
119
|
{
|
|
96
120
|
id: "coolandlovely-discover",
|
|
97
|
-
label:
|
|
98
|
-
path:
|
|
99
|
-
icon: /* @__PURE__ */
|
|
121
|
+
label: M("coolandlovely.nav.discover", "Discover"),
|
|
122
|
+
path: P(A, "discover"),
|
|
123
|
+
icon: /* @__PURE__ */ C(l, { size: 20 }),
|
|
100
124
|
order: 40,
|
|
101
125
|
group: "signals"
|
|
102
126
|
},
|
|
103
127
|
{
|
|
104
128
|
id: "coolandlovely-trends",
|
|
105
|
-
label:
|
|
106
|
-
path:
|
|
107
|
-
icon: /* @__PURE__ */ b
|
|
129
|
+
label: M("coolandlovely.nav.trends", "Trends"),
|
|
130
|
+
path: P(A, "trends"),
|
|
131
|
+
icon: /* @__PURE__ */ C(b, { size: 20 }),
|
|
108
132
|
order: 41,
|
|
109
133
|
group: "signals"
|
|
110
134
|
},
|
|
111
|
-
...
|
|
135
|
+
...N ? [
|
|
112
136
|
{
|
|
113
137
|
id: "coolandlovely-admin",
|
|
114
|
-
label:
|
|
115
|
-
path:
|
|
116
|
-
icon: /* @__PURE__ */
|
|
138
|
+
label: M("coolandlovely.nav.admin", "Admin"),
|
|
139
|
+
path: P(A, "admin/brands"),
|
|
140
|
+
icon: /* @__PURE__ */ C(h, { size: 20 }),
|
|
117
141
|
order: 50,
|
|
118
142
|
group: "admin"
|
|
119
143
|
},
|
|
120
144
|
{
|
|
121
145
|
id: "coolandlovely-admin-brands",
|
|
122
|
-
label:
|
|
123
|
-
path:
|
|
124
|
-
icon: /* @__PURE__ */
|
|
146
|
+
label: M("coolandlovely.nav.adminBrands", "Brands"),
|
|
147
|
+
path: P(A, "admin/brands"),
|
|
148
|
+
icon: /* @__PURE__ */ C(y, { size: 20 }),
|
|
125
149
|
order: 51,
|
|
126
150
|
group: "admin"
|
|
127
151
|
},
|
|
128
152
|
{
|
|
129
153
|
id: "coolandlovely-admin-collaborations",
|
|
130
|
-
label:
|
|
131
|
-
path:
|
|
132
|
-
icon: /* @__PURE__ */
|
|
154
|
+
label: M("coolandlovely.nav.adminCollaborations", "Collaborations"),
|
|
155
|
+
path: P(A, "admin/collaborations"),
|
|
156
|
+
icon: /* @__PURE__ */ C(u, { size: 20 }),
|
|
133
157
|
order: 52,
|
|
134
158
|
group: "admin"
|
|
135
159
|
},
|
|
136
160
|
{
|
|
137
161
|
id: "coolandlovely-admin-featured-items",
|
|
138
|
-
label:
|
|
139
|
-
path:
|
|
140
|
-
icon: /* @__PURE__ */
|
|
162
|
+
label: M("coolandlovely.nav.adminFeaturedItems", "Featured Items"),
|
|
163
|
+
path: P(A, "admin/featured-items"),
|
|
164
|
+
icon: /* @__PURE__ */ C(g, { size: 20 }),
|
|
141
165
|
order: 53,
|
|
142
166
|
group: "admin"
|
|
143
167
|
}
|
|
144
168
|
] : []
|
|
145
169
|
]);
|
|
146
170
|
}, [
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
171
|
+
O,
|
|
172
|
+
A,
|
|
173
|
+
M,
|
|
174
|
+
N
|
|
151
175
|
]), i(() => {
|
|
152
|
-
if (
|
|
176
|
+
if (k) return k([{
|
|
153
177
|
id: "coolandlovely-status",
|
|
154
|
-
label:
|
|
178
|
+
label: M("coolandlovely.footer.ready", "CoolAndLovely"),
|
|
155
179
|
type: "status",
|
|
156
180
|
order: 10,
|
|
157
181
|
section: "left"
|
|
158
182
|
}]);
|
|
159
|
-
}, [
|
|
160
|
-
client:
|
|
161
|
-
children: /* @__PURE__ */
|
|
183
|
+
}, [k, M]), /* @__PURE__ */ C(o, {
|
|
184
|
+
client: D,
|
|
185
|
+
children: /* @__PURE__ */ C(T, {
|
|
162
186
|
workspaceId: a.workspaceId ?? null,
|
|
163
187
|
gateway: "global",
|
|
164
188
|
defaultEnabled: !0,
|
|
165
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ w(e, {
|
|
166
190
|
...a,
|
|
167
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ C(t, {}), /* @__PURE__ */ C(n, {})]
|
|
168
192
|
})
|
|
169
193
|
})
|
|
170
194
|
});
|
|
171
195
|
};
|
|
172
196
|
//#endregion
|
|
173
|
-
export {
|
|
197
|
+
export { O as CoolAndLovelyRoot };
|
|
174
198
|
|
|
175
199
|
//# sourceMappingURL=CoolAndLovelyRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoolAndLovelyRoot.js","names":[],"sources":["../../src/coolandlovely/CoolAndLovelyRoot.tsx"],"sourcesContent":["/**\n * CoolAndLovely Root Component\n * @module coolandlovely\n *\n * Single Root export consumed by host application shells. The export name and\n * prop contract (basePath / navigate / currentUser / apiGatewayUrl /\n * registerNavItems / registerFooterItems / workspace context) are stable — the\n * host imports `CoolAndLovelyRoot` the same way regardless of the internal UI.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Home,\n Store,\n Shapes,\n Shirt,\n Sparkles,\n Handshake,\n Heart,\n BookHeart,\n UserCircle,\n Compass,\n TrendingUp,\n Shield,\n} from 'lucide-react';\nimport { CoolAndLovelyProvider } from './context/CoolAndLovelyContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags/useFeatureFlag';\nimport { CoolAndLovelyRoutes } from './CoolAndLovelyRoutes';\nimport { FeedbackWidget } from './components';\nimport type { CoolAndLovelyRootProps, NavItem } from './types';\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const CoolAndLovelyRoot: FC<CoolAndLovelyRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n const showAdmin = useFeatureFlag('coolandlovely.admin.curation', false);\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell on mount.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'coolandlovely-overview',\n label: t('coolandlovely.nav.overview', 'Overview'),\n path: joinPath(basePath, ''),\n icon: <Home size={20} />,\n order: 1,\n group: 'main',\n },\n // Catalog\n {\n id: 'coolandlovely-brands',\n label: t('coolandlovely.nav.brands', 'Brands'),\n path: joinPath(basePath, 'brands'),\n icon: <Store size={20} />,\n order: 10,\n group: 'catalog',\n },\n {\n id: 'coolandlovely-collections',\n label: t('coolandlovely.nav.collections', 'Collections'),\n path: joinPath(basePath, 'collections'),\n icon: <Shapes size={20} />,\n order: 11,\n group: 'catalog',\n },\n {\n id: 'coolandlovely-items',\n label: t('coolandlovely.nav.items', 'Style Items'),\n path: joinPath(basePath, 'items'),\n icon: <Shirt size={20} />,\n order: 12,\n group: 'catalog',\n },\n // Social\n {\n id: 'coolandlovely-looks',\n label: t('coolandlovely.nav.looks', 'Looks'),\n path: joinPath(basePath, 'looks'),\n icon: <Sparkles size={20} />,\n order: 20,\n group: 'social',\n },\n {\n id: 'coolandlovely-collaborations',\n label: t('coolandlovely.nav.collaborations', 'Collaborations'),\n path: joinPath(basePath, 'collaborations'),\n icon: <Handshake size={20} />,\n order: 21,\n group: 'social',\n },\n // My style\n {\n id: 'coolandlovely-wardrobe',\n label: t('coolandlovely.nav.wardrobe', 'My Wardrobe'),\n path: joinPath(basePath, 'wardrobe'),\n icon: <Heart size={20} />,\n order: 30,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-lookbooks',\n label: t('coolandlovely.nav.lookbooks', 'Lookbooks'),\n path: joinPath(basePath, 'lookbooks'),\n icon: <BookHeart size={20} />,\n order: 31,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-profile',\n label: t('coolandlovely.nav.profile', 'Style Profile'),\n path: joinPath(basePath, 'profile'),\n icon: <UserCircle size={20} />,\n order: 32,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-discover',\n label: t('coolandlovely.nav.discover', 'Discover'),\n path: joinPath(basePath, 'discover'),\n icon: <Compass size={20} />,\n order: 40,\n group: 'signals',\n },\n {\n id: 'coolandlovely-trends',\n label: t('coolandlovely.nav.trends', 'Trends'),\n path: joinPath(basePath, 'trends'),\n icon: <TrendingUp size={20} />,\n order: 41,\n group: 'signals',\n },\n // Admin curation (feature-flagged)\n ...(showAdmin\n ? [\n {\n id: 'coolandlovely-admin',\n label: t('coolandlovely.nav.admin', 'Admin'),\n path: joinPath(basePath, 'admin/brands'),\n icon: <Shield size={20} />,\n order: 50,\n group: 'admin',\n },\n {\n id: 'coolandlovely-admin-brands',\n label: t('coolandlovely.nav.adminBrands', 'Brands'),\n path: joinPath(basePath, 'admin/brands'),\n icon: <Store size={20} />,\n order: 51,\n group: 'admin',\n },\n {\n id: 'coolandlovely-admin-collaborations',\n label: t('coolandlovely.nav.adminCollaborations', 'Collaborations'),\n path: joinPath(basePath, 'admin/collaborations'),\n icon: <Handshake size={20} />,\n order: 52,\n group: 'admin',\n },\n {\n id: 'coolandlovely-admin-featured-items',\n label: t('coolandlovely.nav.adminFeaturedItems', 'Featured Items'),\n path: joinPath(basePath, 'admin/featured-items'),\n icon: <Shirt size={20} />,\n order: 53,\n group: 'admin',\n },\n ]\n : []),\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, t, showAdmin]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'coolandlovely-status',\n label: t('coolandlovely.footer.ready', 'CoolAndLovely'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <CoolAndLovelyProvider {...props}>\n <CoolAndLovelyRoutes />\n <FeedbackWidget />\n </CoolAndLovelyProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoCA,IAAM,IAAc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AS;KACnD,MAAM,EAAS,GAAU,eAAe;KACxC,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;KACzB,OAAO;KACP,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAE,yCAAyC,iBAAiB;KACnE,MAAM,EAAS,GAAU,uBAAuB;KAChD,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAC7B,OAAO;KACP,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAE,wCAAwC,iBAAiB;KAClE,MAAM,EAAS,GAAU,uBAAuB;KAChD,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;KACzB,OAAO;KACP,OAAO;KACR;IACF,GACD,EAAE;GACP,CAEyC;IAEzC;EAAC;EAAkB;EAAU;EAAG;EAAU,CAAC,EAG9C,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAE,8BAA8B,gBAAgB;GACvD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GACE,aAAa,EAAM,eAAe;GAClC,SAAQ;GACR,gBAAgB;aAEhB,kBAAC,GAAD;IAAuB,GAAI;cAA3B,CACE,kBAAC,GAAD,EAAuB,CAAA,EACvB,kBAAC,GAAD,EAAkB,CAAA,CACI;;GACJ,CAAA;EACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"CoolAndLovelyRoot.js","names":[],"sources":["../../src/coolandlovely/CoolAndLovelyRoot.tsx"],"sourcesContent":["/**\n * CoolAndLovely Root Component\n * @module coolandlovely\n *\n * Single Root export consumed by host application shells. The export name and\n * prop contract (basePath / navigate / currentUser / apiGatewayUrl /\n * registerNavItems / registerFooterItems / workspace context) are stable — the\n * host imports `CoolAndLovelyRoot` the same way regardless of the internal UI.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Home,\n Store,\n Shapes,\n Shirt,\n Sparkles,\n Handshake,\n Heart,\n BookHeart,\n UserCircle,\n Compass,\n TrendingUp,\n Shield,\n ShoppingBag,\n Package,\n Wallet,\n} from 'lucide-react';\nimport { CoolAndLovelyProvider } from './context/CoolAndLovelyContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags/useFeatureFlag';\nimport { CoolAndLovelyRoutes } from './CoolAndLovelyRoutes';\nimport { FeedbackWidget } from './components';\nimport type { CoolAndLovelyRootProps, NavItem } from './types';\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const CoolAndLovelyRoot: FC<CoolAndLovelyRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n const showAdmin = useFeatureFlag('coolandlovely.admin.curation', false);\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell on mount.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'coolandlovely-overview',\n label: t('coolandlovely.nav.overview', 'Overview'),\n path: joinPath(basePath, ''),\n icon: <Home size={20} />,\n order: 1,\n group: 'main',\n },\n // Catalog\n {\n id: 'coolandlovely-brands',\n label: t('coolandlovely.nav.brands', 'Brands'),\n path: joinPath(basePath, 'brands'),\n icon: <Store size={20} />,\n order: 10,\n group: 'catalog',\n },\n {\n id: 'coolandlovely-collections',\n label: t('coolandlovely.nav.collections', 'Collections'),\n path: joinPath(basePath, 'collections'),\n icon: <Shapes size={20} />,\n order: 11,\n group: 'catalog',\n },\n {\n id: 'coolandlovely-items',\n label: t('coolandlovely.nav.items', 'Style Items'),\n path: joinPath(basePath, 'items'),\n icon: <Shirt size={20} />,\n order: 12,\n group: 'catalog',\n },\n // Social\n {\n id: 'coolandlovely-looks',\n label: t('coolandlovely.nav.looks', 'Looks'),\n path: joinPath(basePath, 'looks'),\n icon: <Sparkles size={20} />,\n order: 20,\n group: 'social',\n },\n {\n id: 'coolandlovely-collaborations',\n label: t('coolandlovely.nav.collaborations', 'Collaborations'),\n path: joinPath(basePath, 'collaborations'),\n icon: <Handshake size={20} />,\n order: 21,\n group: 'social',\n },\n // My style\n {\n id: 'coolandlovely-wardrobe',\n label: t('coolandlovely.nav.wardrobe', 'My Wardrobe'),\n path: joinPath(basePath, 'wardrobe'),\n icon: <Heart size={20} />,\n order: 30,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-lookbooks',\n label: t('coolandlovely.nav.lookbooks', 'Lookbooks'),\n path: joinPath(basePath, 'lookbooks'),\n icon: <BookHeart size={20} />,\n order: 31,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-profile',\n label: t('coolandlovely.nav.profile', 'Style Profile'),\n path: joinPath(basePath, 'profile'),\n icon: <UserCircle size={20} />,\n order: 32,\n group: 'my-style',\n },\n // Shopping (BOFF-3370)\n {\n id: 'coolandlovely-cart',\n label: t('coolandlovely.nav.cart', 'Cart'),\n path: joinPath(basePath, 'cart'),\n icon: <ShoppingBag size={20} />,\n order: 33,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-orders',\n label: t('coolandlovely.nav.orders', 'My Orders'),\n path: joinPath(basePath, 'orders'),\n icon: <Package size={20} />,\n order: 34,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-earnings',\n label: t('coolandlovely.nav.earnings', 'Creator Earnings'),\n path: joinPath(basePath, 'earnings'),\n icon: <Wallet size={20} />,\n order: 35,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-discover',\n label: t('coolandlovely.nav.discover', 'Discover'),\n path: joinPath(basePath, 'discover'),\n icon: <Compass size={20} />,\n order: 40,\n group: 'signals',\n },\n {\n id: 'coolandlovely-trends',\n label: t('coolandlovely.nav.trends', 'Trends'),\n path: joinPath(basePath, 'trends'),\n icon: <TrendingUp size={20} />,\n order: 41,\n group: 'signals',\n },\n // Admin curation (feature-flagged)\n ...(showAdmin\n ? [\n {\n id: 'coolandlovely-admin',\n label: t('coolandlovely.nav.admin', 'Admin'),\n path: joinPath(basePath, 'admin/brands'),\n icon: <Shield size={20} />,\n order: 50,\n group: 'admin',\n },\n {\n id: 'coolandlovely-admin-brands',\n label: t('coolandlovely.nav.adminBrands', 'Brands'),\n path: joinPath(basePath, 'admin/brands'),\n icon: <Store size={20} />,\n order: 51,\n group: 'admin',\n },\n {\n id: 'coolandlovely-admin-collaborations',\n label: t('coolandlovely.nav.adminCollaborations', 'Collaborations'),\n path: joinPath(basePath, 'admin/collaborations'),\n icon: <Handshake size={20} />,\n order: 52,\n group: 'admin',\n },\n {\n id: 'coolandlovely-admin-featured-items',\n label: t('coolandlovely.nav.adminFeaturedItems', 'Featured Items'),\n path: joinPath(basePath, 'admin/featured-items'),\n icon: <Shirt size={20} />,\n order: 53,\n group: 'admin',\n },\n ]\n : []),\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, t, showAdmin]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'coolandlovely-status',\n label: t('coolandlovely.footer.ready', 'CoolAndLovely'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <CoolAndLovelyProvider {...props}>\n <CoolAndLovelyRoutes />\n <FeedbackWidget />\n </CoolAndLovelyProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAuCA,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,MAAS;CACpB,OAAO;CACR,EACF,EACF,CAAC,EAEW,KAAiD,MAAU;CACtE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,GAAG,MAAc,GAAS,EAC5B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAEpC,CAAC,EAAU,CACZ,EACK,IAAY,EAAe,gCAAgC,GAAM,EAGjE,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AA0LtD,QArLA,QAAgB;AACT,QA+JL,QADgB,EA5JY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAE,8BAA8B,WAAW;IAClD,MAAM,EAAS,GAAU,GAAG;IAC5B,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GAED;IACE,IAAI;IACJ,OAAO,EAAE,4BAA4B,SAAS;IAC9C,MAAM,EAAS,GAAU,SAAS;IAClC,MAAM,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;IACzB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,iCAAiC,cAAc;IACxD,MAAM,EAAS,GAAU,cAAc;IACvC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;IAC1B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAE,2BAA2B,cAAc;IACl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I;GACJ,OAAO,EAAE,8BAA8B,gBAAgB;GACvD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GACE,aAAa,EAAM,eAAe;GAClC,SAAQ;GACR,gBAAgB;aAEhB,kBAAC,GAAD;IAAuB,GAAI;cAA3B,CACE,kBAAC,GAAD,EAAuB,CAAA,EACvB,kBAAC,GAAD,EAAkB,CAAA,CACI;;GACJ,CAAA;EACF,CAAA"}
|
|
@@ -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;AAwIhD,eAAO,MAAM,mBAAmB,EAAE,EAsFjC,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/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))),
|
|
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 }))), P = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrderDetailPage }))), F = r(() => import("./pages/commerce/CreatorEarningsPage.js").then((e) => ({ default: e.CreatorEarningsPage }))), I = r(() => import("./pages/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))), L = r(() => import("./pages/admin/AdminCollaborationsPage.js").then((e) => ({ default: e.AdminCollaborationsPage }))), R = r(() => import("./pages/admin/AdminFeaturedItemsPage.js").then((e) => ({ default: e.AdminFeaturedItemsPage }))), z = () => /* @__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
|
+
}), B = () => {
|
|
11
|
+
let { basePath: r, isStandalone: B } = e(), V = s(), H = r === "/" ? "" : (r ?? "").replace(/\/$/, "");
|
|
12
|
+
return H && !B && !(V.pathname === H || V.pathname.startsWith(H + "/")) ? 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(z, {}),
|
|
16
16
|
children: /* @__PURE__ */ l(o, { children: [
|
|
17
17
|
/* @__PURE__ */ c(a, {
|
|
18
18
|
index: !0,
|
|
@@ -126,6 +126,22 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
126
126
|
path: "trends",
|
|
127
127
|
element: /* @__PURE__ */ c(j, {})
|
|
128
128
|
}),
|
|
129
|
+
/* @__PURE__ */ c(a, {
|
|
130
|
+
path: "cart",
|
|
131
|
+
element: /* @__PURE__ */ c(M, {})
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ c(a, {
|
|
134
|
+
path: "orders",
|
|
135
|
+
element: /* @__PURE__ */ c(N, {})
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ c(a, {
|
|
138
|
+
path: "orders/:orderId",
|
|
139
|
+
element: /* @__PURE__ */ c(P, {})
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ c(a, {
|
|
142
|
+
path: "earnings",
|
|
143
|
+
element: /* @__PURE__ */ c(F, {})
|
|
144
|
+
}),
|
|
129
145
|
/* @__PURE__ */ c(a, {
|
|
130
146
|
path: "admin",
|
|
131
147
|
element: /* @__PURE__ */ c(i, {
|
|
@@ -135,15 +151,15 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
135
151
|
}),
|
|
136
152
|
/* @__PURE__ */ c(a, {
|
|
137
153
|
path: "admin/brands",
|
|
138
|
-
element: /* @__PURE__ */ c(
|
|
154
|
+
element: /* @__PURE__ */ c(I, {})
|
|
139
155
|
}),
|
|
140
156
|
/* @__PURE__ */ c(a, {
|
|
141
157
|
path: "admin/collaborations",
|
|
142
|
-
element: /* @__PURE__ */ c(
|
|
158
|
+
element: /* @__PURE__ */ c(L, {})
|
|
143
159
|
}),
|
|
144
160
|
/* @__PURE__ */ c(a, {
|
|
145
161
|
path: "admin/featured-items",
|
|
146
|
-
element: /* @__PURE__ */ c(
|
|
162
|
+
element: /* @__PURE__ */ c(R, {})
|
|
147
163
|
}),
|
|
148
164
|
/* @__PURE__ */ c(a, {
|
|
149
165
|
path: "*",
|
|
@@ -157,6 +173,6 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
157
173
|
});
|
|
158
174
|
};
|
|
159
175
|
//#endregion
|
|
160
|
-
export {
|
|
176
|
+
export { B as CoolAndLovelyRoutes };
|
|
161
177
|
|
|
162
178
|
//# 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// 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 {/* 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,8CA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,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 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,qBAAqB,EAAE,CAC9F,EACK,IAAoB,QACxB,OAAO,sCAAmC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC1F,EAGK,IAAgB,QACpB,OAAO,kCAA+B,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAClF,EACK,IAAiB,QACrB,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACpF,EACK,IAAe,QACnB,OAAO,iCAA8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,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,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CooStyleItem } from '../types';
|
|
3
|
+
|
|
4
|
+
interface AddToCartPanelProps {
|
|
5
|
+
item: Pick<CooStyleItem, 'id' | 'status' | 'price' | 'sizes' | 'colours'>;
|
|
6
|
+
lookId?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const AddToCartPanel: FC<AddToCartPanelProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=AddToCartPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddToCartPanel.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/AddToCartPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAM1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,UAAU,mBAAmB;IAC3B,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC1E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAYD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAiIlD,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useCoolAndLovely as e } from "../context/CoolAndLovelyContext.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
4
|
+
import "../hooks/index.js";
|
|
5
|
+
import { useAddToCart as r } from "../hooks/useCommerceApi.js";
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { Check as a, Loader2 as o, ShoppingBag as s, Sparkles as c } from "lucide-react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
//#region src/coolandlovely/components/AddToCartPanel.tsx
|
|
10
|
+
var d = 10, f = (e) => t("inline-flex min-w-9 items-center justify-center rounded-full border px-3 py-1 text-sm font-medium transition-colors", e ? "border-action-primary-bg bg-action-primary-bg text-action-primary-text" : "border-border-seam text-text-primary hover:bg-bg-sunken"), p = ({ item: t, lookId: p }) => {
|
|
11
|
+
let m = n(), { navigateTo: h } = e(), g = r(), [_, v] = i(t.sizes.length === 1 ? t.sizes[0] ?? null : null), [y, b] = i(t.colours.length === 1 ? t.colours[0] ?? null : null), [x, S] = i(1), C = t.status === "ACTIVE" && t.price > 0, w = t.sizes.length > 0 && !_, T = t.colours.length > 0 && !y;
|
|
12
|
+
return C ? /* @__PURE__ */ u("div", {
|
|
13
|
+
className: "space-y-4",
|
|
14
|
+
"data-testid": "add-to-cart-panel",
|
|
15
|
+
children: [
|
|
16
|
+
p && /* @__PURE__ */ u("p", {
|
|
17
|
+
className: "inline-flex items-center gap-1.5 text-xs font-medium text-accent-primary",
|
|
18
|
+
children: [/* @__PURE__ */ l(c, { className: "h-3.5 w-3.5" }), m("coolandlovely.cart.shoppingLook", "Shopping from a look — your purchase supports its creator")]
|
|
19
|
+
}),
|
|
20
|
+
t.sizes.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
21
|
+
className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
22
|
+
children: m("coolandlovely.cart.chooseSize", "Choose a size")
|
|
23
|
+
}), /* @__PURE__ */ l("div", {
|
|
24
|
+
className: "flex flex-wrap gap-2",
|
|
25
|
+
children: t.sizes.map((e) => /* @__PURE__ */ l("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
"aria-pressed": _ === e,
|
|
28
|
+
onClick: () => v(e),
|
|
29
|
+
className: f(_ === e),
|
|
30
|
+
children: e
|
|
31
|
+
}, e))
|
|
32
|
+
})] }),
|
|
33
|
+
t.colours.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
34
|
+
className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
35
|
+
children: m("coolandlovely.cart.chooseColour", "Choose a colour")
|
|
36
|
+
}), /* @__PURE__ */ l("div", {
|
|
37
|
+
className: "flex flex-wrap gap-2",
|
|
38
|
+
children: t.colours.map((e) => /* @__PURE__ */ l("button", {
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-pressed": y === e,
|
|
41
|
+
onClick: () => b(e),
|
|
42
|
+
className: f(y === e),
|
|
43
|
+
children: e
|
|
44
|
+
}, e))
|
|
45
|
+
})] }),
|
|
46
|
+
/* @__PURE__ */ u("div", {
|
|
47
|
+
className: "flex items-center gap-3",
|
|
48
|
+
children: [/* @__PURE__ */ l("label", {
|
|
49
|
+
htmlFor: "coo-add-quantity",
|
|
50
|
+
className: "text-sm text-text-secondary",
|
|
51
|
+
children: m("coolandlovely.cart.quantity", "Quantity")
|
|
52
|
+
}), /* @__PURE__ */ l("select", {
|
|
53
|
+
id: "coo-add-quantity",
|
|
54
|
+
value: x,
|
|
55
|
+
onChange: (e) => S(Number(e.target.value)),
|
|
56
|
+
className: "rounded-lg border border-border-seam bg-bg-surface px-2 py-1.5 text-sm text-text-primary",
|
|
57
|
+
children: Array.from({ length: d }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("option", {
|
|
58
|
+
value: e,
|
|
59
|
+
children: e
|
|
60
|
+
}, e))
|
|
61
|
+
})]
|
|
62
|
+
}),
|
|
63
|
+
g.error && /* @__PURE__ */ l("p", {
|
|
64
|
+
className: "text-sm text-status-error-text",
|
|
65
|
+
children: g.error.message
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ u("div", {
|
|
68
|
+
className: "flex flex-wrap gap-2",
|
|
69
|
+
children: [/* @__PURE__ */ u("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
disabled: w || T || g.isPending,
|
|
72
|
+
onClick: () => g.mutate({ input: {
|
|
73
|
+
styleItemId: t.id,
|
|
74
|
+
quantity: x,
|
|
75
|
+
size: _,
|
|
76
|
+
colour: y,
|
|
77
|
+
lookId: p ?? null
|
|
78
|
+
} }),
|
|
79
|
+
className: "inline-flex flex-1 items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
80
|
+
children: [g.isPending ? /* @__PURE__ */ l(o, { className: "h-4 w-4 animate-spin" }) : g.isSuccess ? /* @__PURE__ */ l(a, { className: "h-4 w-4" }) : /* @__PURE__ */ l(s, { className: "h-4 w-4" }), g.isSuccess ? m("coolandlovely.cart.added", "Added to cart") : m("coolandlovely.cart.add", "Add to cart")]
|
|
81
|
+
}), g.isSuccess && /* @__PURE__ */ l("button", {
|
|
82
|
+
type: "button",
|
|
83
|
+
onClick: () => h("/cart"),
|
|
84
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
85
|
+
children: m("coolandlovely.cart.viewCart", "View cart")
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
}) : /* @__PURE__ */ l("p", {
|
|
90
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken p-3 text-sm text-text-secondary",
|
|
91
|
+
children: m("coolandlovely.cart.notForSale", "This piece is not available to buy right now.")
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
//#endregion
|
|
95
|
+
export { p as AddToCartPanel };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=AddToCartPanel.js.map
|