@burdenoff/microfe-coolandlovely 2026.1109.4 → 2026.1109.6
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 +8 -0
- package/dist/coolandlovely/CoolAndLovelyRoot.js.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +1 -1
- package/dist/coolandlovely/CoolAndLovelyRoutes.js +32 -16
- package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
- package/dist/coolandlovely/api/resaleTransport.d.ts +13 -0
- package/dist/coolandlovely/api/resaleTransport.d.ts.map +1 -0
- package/dist/coolandlovely/api/resaleTransport.js +38 -0
- package/dist/coolandlovely/api/resaleTransport.js.map +1 -0
- package/dist/coolandlovely/hooks/useResale.d.ts +12 -0
- package/dist/coolandlovely/hooks/useResale.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useResale.js +132 -0
- package/dist/coolandlovely/hooks/useResale.js.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleBrowsePage.d.ts +2 -0
- package/dist/coolandlovely/pages/resale/ResaleBrowsePage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js +164 -0
- package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleListingPage.d.ts +2 -0
- package/dist/coolandlovely/pages/resale/ResaleListingPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleListingPage.js +161 -0
- package/dist/coolandlovely/pages/resale/ResaleListingPage.js.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleReportsPage.d.ts +2 -0
- package/dist/coolandlovely/pages/resale/ResaleReportsPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleReportsPage.js +80 -0
- package/dist/coolandlovely/pages/resale/ResaleReportsPage.js.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleSellerPage.d.ts +2 -0
- package/dist/coolandlovely/pages/resale/ResaleSellerPage.d.ts.map +1 -0
- package/dist/coolandlovely/pages/resale/ResaleSellerPage.js +235 -0
- package/dist/coolandlovely/pages/resale/ResaleSellerPage.js.map +1 -0
- package/dist/coolandlovely/utils/resalePresentation.d.ts +5 -0
- package/dist/coolandlovely/utils/resalePresentation.d.ts.map +1 -0
- package/dist/coolandlovely/utils/resalePresentation.js +33 -0
- package/dist/coolandlovely/utils/resalePresentation.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +974 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +252 -18
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +66230 -9890
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +5 -4
|
@@ -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;AA2BhC,OAAO,KAAK,EAAE,sBAAsB,EAAW,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,
|
|
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;AA2BhC,OAAO,KAAK,EAAE,sBAAsB,EAAW,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAgPxD,CAAC"}
|
|
@@ -123,6 +123,14 @@ var D = (D) => {
|
|
|
123
123
|
order: 36,
|
|
124
124
|
group: "my-style"
|
|
125
125
|
},
|
|
126
|
+
{
|
|
127
|
+
id: "coolandlovely-resale",
|
|
128
|
+
label: M("coolandlovely.nav.resale", "Pre-loved marketplace"),
|
|
129
|
+
path: P(A, "resale"),
|
|
130
|
+
icon: /* @__PURE__ */ C(_, { size: 20 }),
|
|
131
|
+
order: 37,
|
|
132
|
+
group: "my-style"
|
|
133
|
+
},
|
|
126
134
|
{
|
|
127
135
|
id: "coolandlovely-discover",
|
|
128
136
|
label: M("coolandlovely.nav.discover", "Discover"),
|
|
@@ -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 { 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 { CoolAndLovelyQueryScope } from './context/QueryScope';\nimport { coolAndLovelyScopeKey } from './context/queryScopeKey';\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\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-marketplace',\n label: t('coolandlovely.nav.marketplace', 'Creator marketplace'),\n path: joinPath(basePath, 'creator-marketplace'),\n icon: <Handshake size={20} />,\n order: 36,\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 {\n id: 'coolandlovely-journal',\n label: t('coolandlovely.nav.journal', 'Journal'),\n path: joinPath(basePath, 'journal'),\n icon: <TrendingUp size={20} />,\n order: 42,\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 <CoolAndLovelyQueryScope key={coolAndLovelyScopeKey(props)}>\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 </CoolAndLovelyQueryScope>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAuCA,IAAa,KAAiD,MAAU;CACtE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,GAAG,MA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CAClB;GACE,IAAI;GACJ,OAAO,EAAE,8BAA8B,eAAe;GACtD,MAAM;GACN,OAAO;GACP,SAAS;EACX,CACF;EAGA,OADgB,EAAoB,CAC7B;CACT,GAAG,CAAC,GAAqB,CAAC,CAAC,GAGzB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EACE,aAAa,EAAM,eAAe;EAClC,SAAQ;EACR,gBAAgB;YAEhB,kBAAC,GAAD;GAAuB,GAAI;aAA3B,CACE,kBAAC,GAAD,CAAsB,CAAA,GACtB,kBAAC,GAAD,CAAiB,CAAA,CACI;;CACJ,CAAA,EACE,GAXK,EAAsB,CAAK,CAWhC;AAE7B"}
|
|
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 { 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 { CoolAndLovelyQueryScope } from './context/QueryScope';\nimport { coolAndLovelyScopeKey } from './context/queryScopeKey';\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\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-marketplace',\n label: t('coolandlovely.nav.marketplace', 'Creator marketplace'),\n path: joinPath(basePath, 'creator-marketplace'),\n icon: <Handshake size={20} />,\n order: 36,\n group: 'my-style',\n },\n {\n id: 'coolandlovely-resale',\n label: t('coolandlovely.nav.resale', 'Pre-loved marketplace'),\n path: joinPath(basePath, 'resale'),\n icon: <ShoppingBag size={20} />,\n order: 37,\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 {\n id: 'coolandlovely-journal',\n label: t('coolandlovely.nav.journal', 'Journal'),\n path: joinPath(basePath, 'journal'),\n icon: <TrendingUp size={20} />,\n order: 42,\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 <CoolAndLovelyQueryScope key={coolAndLovelyScopeKey(props)}>\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 </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KACE,IAAI;KACJ,OAAO,EAAE,wCAAwC,gBAAgB;KACjE,MAAM,EAAS,GAAU,sBAAsB;KAC/C,MAAM,kBAAC,GAAD,EAAO,MAAM,GAAK,CAAA;KACxB,OAAO;KACP,OAAO;IACT;GACF,IACA,CAAC;EACP;EAGA,OADgB,EAAiB,CAC1B;CACT,GAAG;EAAC;EAAkB;EAAU;EAAG;CAAS,CAAC,GAG7C,QAAgB;EACd,IAAI,CAAC,GAAqB;EAE1B,IAAM,IAAc,CAClB;GACE,IAAI;GACJ,OAAO,EAAE,8BAA8B,eAAe;GACtD,MAAM;GACN,OAAO;GACP,SAAS;EACX,CACF;EAGA,OADgB,EAAoB,CAC7B;CACT,GAAG,CAAC,GAAqB,CAAC,CAAC,GAGzB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EACE,aAAa,EAAM,eAAe;EAClC,SAAQ;EACR,gBAAgB;YAEhB,kBAAC,GAAD;GAAuB,GAAI;aAA3B,CACE,kBAAC,GAAD,CAAsB,CAAA,GACtB,kBAAC,GAAD,CAAiB,CAAA,CACI;;CACJ,CAAA,EACE,GAXK,EAAsB,CAAK,CAWhC;AAE7B"}
|
|
@@ -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;AAsKhD,eAAO,MAAM,mBAAmB,EAAE,EAoGjC,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/brands/ImportCatalogPage.js").then((e) => ({ default: e.ImportCatalogPage }))), m = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), h = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), g = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), _ = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), v = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), y = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), b = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), x = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), S = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), C = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), w = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), T = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), E = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), D = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), O = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), k = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), A = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), j = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), M = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), N = r(() => import("./pages/editorial/EditorialPage.js").then((e) => ({ default: e.EditorialPage }))), P = r(() => import("./pages/marketplace/CreatorMarketplacePage.js").then((e) => ({ default: e.CreatorMarketplacePage }))), F = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))),
|
|
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/brands/ImportCatalogPage.js").then((e) => ({ default: e.ImportCatalogPage }))), m = r(() => import("./pages/collections/CollectionsListPage.js").then((e) => ({ default: e.CollectionsListPage }))), h = r(() => import("./pages/collections/CollectionDetailPage.js").then((e) => ({ default: e.CollectionDetailPage }))), g = r(() => import("./pages/collections/CollectionFormPage.js").then((e) => ({ default: e.CollectionFormPage }))), _ = r(() => import("./pages/items/StyleItemsListPage.js").then((e) => ({ default: e.StyleItemsListPage }))), v = r(() => import("./pages/items/StyleItemDetailPage.js").then((e) => ({ default: e.StyleItemDetailPage }))), y = r(() => import("./pages/items/StyleItemFormPage.js").then((e) => ({ default: e.StyleItemFormPage }))), b = r(() => import("./pages/looks/LooksListPage.js").then((e) => ({ default: e.LooksListPage }))), x = r(() => import("./pages/looks/LookDetailPage.js").then((e) => ({ default: e.LookDetailPage }))), S = r(() => import("./pages/looks/LookFormPage.js").then((e) => ({ default: e.LookFormPage }))), C = r(() => import("./pages/collaborations/CollaborationsListPage.js").then((e) => ({ default: e.CollaborationsListPage }))), w = r(() => import("./pages/collaborations/CollaborationDetailPage.js").then((e) => ({ default: e.CollaborationDetailPage }))), T = r(() => import("./pages/collaborations/CollaborationFormPage.js").then((e) => ({ default: e.CollaborationFormPage }))), E = r(() => import("./pages/wardrobe/WardrobeListPage.js").then((e) => ({ default: e.WardrobeListPage }))), D = r(() => import("./pages/wardrobe/WardrobeFormPage.js").then((e) => ({ default: e.WardrobeFormPage }))), O = r(() => import("./pages/lookbooks/LookbooksListPage.js").then((e) => ({ default: e.LookbooksListPage }))), k = r(() => import("./pages/lookbooks/LookbookDetailPage.js").then((e) => ({ default: e.LookbookDetailPage }))), A = r(() => import("./pages/profile/StyleProfilePage.js").then((e) => ({ default: e.StyleProfilePage }))), j = r(() => import("./pages/discover/DiscoverPage.js").then((e) => ({ default: e.DiscoverPage }))), M = r(() => import("./pages/trends/TrendsPage.js").then((e) => ({ default: e.TrendsPage }))), N = r(() => import("./pages/editorial/EditorialPage.js").then((e) => ({ default: e.EditorialPage }))), P = r(() => import("./pages/marketplace/CreatorMarketplacePage.js").then((e) => ({ default: e.CreatorMarketplacePage }))), F = r(() => import("./pages/resale/ResaleBrowsePage.js").then((e) => ({ default: e.ResaleBrowsePage }))), I = r(() => import("./pages/resale/ResaleListingPage.js").then((e) => ({ default: e.ResaleListingPage }))), L = r(() => import("./pages/resale/ResaleSellerPage.js").then((e) => ({ default: e.ResaleSellerPage }))), R = r(() => import("./pages/resale/ResaleReportsPage.js").then((e) => ({ default: e.ResaleReportsPage }))), z = r(() => import("./pages/commerce/CartPage.js").then((e) => ({ default: e.CartPage }))), B = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrdersPage }))), V = r(() => import("./pages/commerce/BrandOrdersPage.js").then((e) => ({ default: e.BrandOrderDetailPage }))), H = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrdersPage }))), U = r(() => import("./pages/commerce/OrdersPage.js").then((e) => ({ default: e.OrderDetailPage }))), W = r(() => import("./pages/commerce/CreatorEarningsPage.js").then((e) => ({ default: e.CreatorEarningsPage }))), G = r(() => import("./pages/admin/AdminBrandsPage.js").then((e) => ({ default: e.AdminBrandsPage }))), K = r(() => import("./pages/admin/AdminCollaborationsPage.js").then((e) => ({ default: e.AdminCollaborationsPage }))), q = r(() => import("./pages/admin/AdminFeaturedItemsPage.js").then((e) => ({ default: e.AdminFeaturedItemsPage }))), J = () => /* @__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
|
+
}), Y = () => {
|
|
11
|
+
let { basePath: r, isStandalone: Y, workspaceId: X, currentUser: Z } = e(), Q = s(), $ = r === "/" ? "" : (r ?? "").replace(/\/$/, "");
|
|
12
|
+
return $ && !Y && !(Q.pathname === $ || Q.pathname.startsWith($ + "/")) ? 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(J, {}),
|
|
16
16
|
children: /* @__PURE__ */ l(o, { children: [
|
|
17
17
|
/* @__PURE__ */ c(a, {
|
|
18
18
|
index: !0,
|
|
@@ -132,36 +132,52 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ c(a, {
|
|
134
134
|
path: "journal",
|
|
135
|
-
element: /* @__PURE__ */ c(N, {}, `${
|
|
135
|
+
element: /* @__PURE__ */ c(N, {}, `${X ?? ""}:${Z?.id ?? ""}`)
|
|
136
136
|
}),
|
|
137
137
|
/* @__PURE__ */ c(a, {
|
|
138
138
|
path: "cart",
|
|
139
|
-
element: /* @__PURE__ */ c(
|
|
139
|
+
element: /* @__PURE__ */ c(z, {})
|
|
140
140
|
}),
|
|
141
141
|
/* @__PURE__ */ c(a, {
|
|
142
142
|
path: "orders",
|
|
143
|
-
element: /* @__PURE__ */ c(
|
|
143
|
+
element: /* @__PURE__ */ c(H, {})
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ c(a, {
|
|
146
146
|
path: "orders/:orderId",
|
|
147
|
-
element: /* @__PURE__ */ c(
|
|
147
|
+
element: /* @__PURE__ */ c(U, {})
|
|
148
148
|
}),
|
|
149
149
|
/* @__PURE__ */ c(a, {
|
|
150
150
|
path: "earnings",
|
|
151
|
-
element: /* @__PURE__ */ c(
|
|
151
|
+
element: /* @__PURE__ */ c(W, {})
|
|
152
152
|
}),
|
|
153
153
|
/* @__PURE__ */ c(a, {
|
|
154
154
|
path: "creator-marketplace",
|
|
155
155
|
element: /* @__PURE__ */ c(P, {})
|
|
156
156
|
}),
|
|
157
157
|
/* @__PURE__ */ c(a, {
|
|
158
|
-
path: "
|
|
158
|
+
path: "resale",
|
|
159
|
+
element: /* @__PURE__ */ c(F, {})
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ c(a, {
|
|
162
|
+
path: "resale/listings/:listingId",
|
|
159
163
|
element: /* @__PURE__ */ c(I, {})
|
|
160
164
|
}),
|
|
161
165
|
/* @__PURE__ */ c(a, {
|
|
162
|
-
path: "
|
|
166
|
+
path: "resale/seller",
|
|
163
167
|
element: /* @__PURE__ */ c(L, {})
|
|
164
168
|
}),
|
|
169
|
+
/* @__PURE__ */ c(a, {
|
|
170
|
+
path: "resale/reports",
|
|
171
|
+
element: /* @__PURE__ */ c(R, {})
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ c(a, {
|
|
174
|
+
path: "brand-orders",
|
|
175
|
+
element: /* @__PURE__ */ c(B, {})
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ c(a, {
|
|
178
|
+
path: "brand-orders/:brandId/:orderId",
|
|
179
|
+
element: /* @__PURE__ */ c(V, {})
|
|
180
|
+
}),
|
|
165
181
|
/* @__PURE__ */ c(a, {
|
|
166
182
|
path: "admin",
|
|
167
183
|
element: /* @__PURE__ */ c(i, {
|
|
@@ -171,15 +187,15 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
171
187
|
}),
|
|
172
188
|
/* @__PURE__ */ c(a, {
|
|
173
189
|
path: "admin/brands",
|
|
174
|
-
element: /* @__PURE__ */ c(
|
|
190
|
+
element: /* @__PURE__ */ c(G, {})
|
|
175
191
|
}),
|
|
176
192
|
/* @__PURE__ */ c(a, {
|
|
177
193
|
path: "admin/collaborations",
|
|
178
|
-
element: /* @__PURE__ */ c(
|
|
194
|
+
element: /* @__PURE__ */ c(K, {})
|
|
179
195
|
}),
|
|
180
196
|
/* @__PURE__ */ c(a, {
|
|
181
197
|
path: "admin/featured-items",
|
|
182
|
-
element: /* @__PURE__ */ c(
|
|
198
|
+
element: /* @__PURE__ */ c(q, {})
|
|
183
199
|
}),
|
|
184
200
|
/* @__PURE__ */ c(a, {
|
|
185
201
|
path: "*",
|
|
@@ -193,6 +209,6 @@ var u = r(() => import("./pages/brands/BrandsListPage.js").then((e) => ({ defaul
|
|
|
193
209
|
});
|
|
194
210
|
};
|
|
195
211
|
//#endregion
|
|
196
|
-
export {
|
|
212
|
+
export { Y as CoolAndLovelyRoutes };
|
|
197
213
|
|
|
198
214
|
//# 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);\nconst ImportCatalogPage = lazy(() =>\n import('./pages/brands/ImportCatalogPage').then((m) => ({ default: m.ImportCatalogPage }))\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);\nconst EditorialPage = lazy(() =>\n import('./pages/editorial/EditorialPage').then((module) => ({ default: module.EditorialPage }))\n);\n\nconst CreatorMarketplacePage = lazy(() =>\n import('./pages/marketplace/CreatorMarketplacePage').then((m) => ({\n default: m.CreatorMarketplacePage,\n }))\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, workspaceId, currentUser } = 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/import\" element={<ImportCatalogPage />} />\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 <Route\n path=\"journal\"\n element={<EditorialPage key={`${workspaceId ?? ''}:${currentUser?.id ?? ''}`} />}\n />\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 <Route path=\"creator-marketplace\" element={<CreatorMarketplacePage />} />\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,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CACrF,GACM,IAAkB,QACtB,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACvF,GACM,IAAgB,QACpB,OAAO,kCAA+B,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CACnF,GACM,IAAoB,QACxB,OAAO,sCAAmC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC3F,GAGM,IAAsB,QAC1B,OAAO,6CAA0C,CAAC,MAAM,OAAO,EAC7D,SAAS,EAAE,oBACb,EAAE,CACJ,GACM,IAAuB,QAC3B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAAS,EAAE,qBACb,EAAE,CACJ,GACM,IAAqB,QACzB,OAAO,4CAAyC,CAAC,MAAM,OAAO,EAAE,SAAS,E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GAAD,CAAkB,CAAA;IAAI,CAAA;IAC1D,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,CAA0B,CAAA;IAAI,CAAA;IAC1E,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,CAAyB,CAAA;IAAI,CAAA;IAGzE,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA;CACP,CAAA;AAET"}
|
|
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);\nconst ImportCatalogPage = lazy(() =>\n import('./pages/brands/ImportCatalogPage').then((m) => ({ default: m.ImportCatalogPage }))\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);\nconst EditorialPage = lazy(() =>\n import('./pages/editorial/EditorialPage').then((module) => ({ default: module.EditorialPage }))\n);\n\nconst CreatorMarketplacePage = lazy(() =>\n import('./pages/marketplace/CreatorMarketplacePage').then((m) => ({\n default: m.CreatorMarketplacePage,\n }))\n);\nconst ResaleBrowsePage = lazy(() =>\n import('./pages/resale/ResaleBrowsePage').then((m) => ({ default: m.ResaleBrowsePage }))\n);\nconst ResaleListingPage = lazy(() =>\n import('./pages/resale/ResaleListingPage').then((m) => ({ default: m.ResaleListingPage }))\n);\nconst ResaleSellerPage = lazy(() =>\n import('./pages/resale/ResaleSellerPage').then((m) => ({ default: m.ResaleSellerPage }))\n);\nconst ResaleReportsPage = lazy(() =>\n import('./pages/resale/ResaleReportsPage').then((m) => ({ default: m.ResaleReportsPage }))\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, workspaceId, currentUser } = 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/import\" element={<ImportCatalogPage />} />\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 <Route\n path=\"journal\"\n element={<EditorialPage key={`${workspaceId ?? ''}:${currentUser?.id ?? ''}`} />}\n />\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 <Route path=\"creator-marketplace\" element={<CreatorMarketplacePage />} />\n <Route path=\"resale\" element={<ResaleBrowsePage />} />\n <Route path=\"resale/listings/:listingId\" element={<ResaleListingPage />} />\n <Route path=\"resale/seller\" element={<ResaleSellerPage />} />\n <Route path=\"resale/reports\" element={<ResaleReportsPage />} />\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,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CACrF,GACM,IAAkB,QACtB,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACvF,GACM,IAAgB,QACpB,OAAO,kCAA+B,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CACnF,GACM,IAAoB,QACxB,OAAO,sCAAmC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC3F,GAGM,IAAsB,QAC1B,OAAO,6CAA0C,CAAC,MAAM,OAAO,EAC7D,SAAS,EAAE,oBACb,EAAE,CACJ,GACM,IAAuB,QAC3B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAAS,EAAE,qBACb,EAAE,CACJ,GACM,IAAqB,QACzB,OAAO,4CAAyC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAClG,GAGM,IAAqB,QACzB,OAAO,sCAAmC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC5F,GACM,IAAsB,QAC1B,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAAS,EAAE,oBAA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,CAAA;IAC1E,kBAAC,GAAD;KAAO,MAAK;KAAgB,SAAS,kBAAC,GAAD,CAAmB,CAAA;IAAI,CAAA;IAC5D,kBAAC,GAAD;KAAO,MAAK;KAAiB,SAAS,kBAAC,GAAD,CAAoB,CAAA;IAAI,CAAA;IAG9D,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,CAAkB,CAAA;IAAI,CAAA;IAC1D,kBAAC,GAAD;KAAO,MAAK;KAAiC,SAAS,kBAAC,GAAD,CAAuB,CAAA;IAAI,CAAA;IAGjF,kBAAC,GAAD;KAAO,MAAK;KAAQ,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAe,SAAA;KAAS,CAAA;IAAI,CAAA;IACtE,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,CAAkB,CAAA;IAAI,CAAA;IAC1D,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,CAA0B,CAAA;IAAI,CAAA;IAC1E,kBAAC,GAAD;KAAO,MAAK;KAAuB,SAAS,kBAAC,GAAD,CAAyB,CAAA;IAAI,CAAA;IAGzE,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA;CACP,CAAA;AAET"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
/** Captured by the mounted resale page; never persisted or used as a cache key. */
|
|
3
|
+
export interface ResaleRequestScope {
|
|
4
|
+
apiGatewayUrl: string;
|
|
5
|
+
authToken: string;
|
|
6
|
+
actorId: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
organizationId?: string;
|
|
10
|
+
projectId?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function resaleRequest<T>(scope: ResaleRequestScope, document: DocumentNode, variables: Record<string, unknown>, signal: AbortSignal): Promise<T>;
|
|
13
|
+
//# sourceMappingURL=resaleTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resaleTransport.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/api/resaleTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AASnD,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,aAAa,CAAC,CAAC,EACnC,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,CAAC,CAAC,CA6CZ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getStoredOrganizationId as e, getStoredProjectId as t, graphqlFetchPinned as n, prepareWorkspaceRequest as r, resolveGatewayUrl as i } from "@burdenoff/fe-libs/shared/graphql";
|
|
2
|
+
import { print as a } from "graphql";
|
|
3
|
+
//#region src/coolandlovely/api/resaleTransport.ts
|
|
4
|
+
async function o(o, s, c, l) {
|
|
5
|
+
let u = { ...o }, d = () => {
|
|
6
|
+
if ((u.organizationId ?? null) !== (e() ?? null) || (u.projectId ?? null) !== (t() ?? null)) throw Error("The active context changed. Reopen the resale page before continuing.");
|
|
7
|
+
};
|
|
8
|
+
d();
|
|
9
|
+
let f = i("workspace", u.apiGatewayUrl), p = a(s), m = await r({
|
|
10
|
+
url: f,
|
|
11
|
+
authToken: u.authToken,
|
|
12
|
+
actorId: u.actorId,
|
|
13
|
+
workspaceId: u.workspaceId,
|
|
14
|
+
tenantId: u.tenantId,
|
|
15
|
+
currentQuery: p,
|
|
16
|
+
signal: l
|
|
17
|
+
});
|
|
18
|
+
d(), m.assertCurrent();
|
|
19
|
+
let h = await n({
|
|
20
|
+
gateway: "workspace",
|
|
21
|
+
baseUrl: u.apiGatewayUrl,
|
|
22
|
+
query: p,
|
|
23
|
+
variables: c,
|
|
24
|
+
authToken: u.authToken,
|
|
25
|
+
workspaceToken: m.workspaceToken,
|
|
26
|
+
workspaceId: u.workspaceId,
|
|
27
|
+
organizationId: u.organizationId ?? !1,
|
|
28
|
+
tenantId: u.tenantId ?? !1,
|
|
29
|
+
projectId: u.projectId ?? !1,
|
|
30
|
+
signal: l
|
|
31
|
+
});
|
|
32
|
+
if (d(), m.assertCurrent(), h.errors?.length || h.data == null) throw Error("The resale operation was not confirmed. Refresh its authoritative status before retrying.");
|
|
33
|
+
return h.data;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { o as resaleRequest };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=resaleTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resaleTransport.js","names":[],"sources":["../../../src/coolandlovely/api/resaleTransport.ts"],"sourcesContent":["import { print, type DocumentNode } from 'graphql';\nimport {\n getStoredOrganizationId,\n getStoredProjectId,\n graphqlFetchPinned,\n prepareWorkspaceRequest,\n resolveGatewayUrl,\n} from '@burdenoff/fe-libs/shared/graphql';\n\n/** Captured by the mounted resale page; never persisted or used as a cache key. */\nexport interface ResaleRequestScope {\n apiGatewayUrl: string;\n authToken: string;\n actorId: string;\n workspaceId: string;\n tenantId?: string;\n organizationId?: string;\n projectId?: string;\n}\n\nexport async function resaleRequest<T>(\n scope: ResaleRequestScope,\n document: DocumentNode,\n variables: Record<string, unknown>,\n signal: AbortSignal\n): Promise<T> {\n const captured = { ...scope };\n const assertCapturedContext = () => {\n if (\n (captured.organizationId ?? null) !== (getStoredOrganizationId() ?? null) ||\n (captured.projectId ?? null) !== (getStoredProjectId() ?? null)\n ) {\n throw new Error('The active context changed. Reopen the resale page before continuing.');\n }\n };\n assertCapturedContext();\n const url = resolveGatewayUrl('workspace', captured.apiGatewayUrl);\n const query = print(document);\n const prepared = await prepareWorkspaceRequest({\n url,\n authToken: captured.authToken,\n actorId: captured.actorId,\n workspaceId: captured.workspaceId,\n tenantId: captured.tenantId,\n currentQuery: query,\n signal,\n });\n assertCapturedContext();\n prepared.assertCurrent();\n const response = await graphqlFetchPinned<T>({\n gateway: 'workspace',\n baseUrl: captured.apiGatewayUrl,\n query,\n variables,\n authToken: captured.authToken,\n workspaceToken: prepared.workspaceToken,\n workspaceId: captured.workspaceId,\n organizationId: captured.organizationId ?? false,\n tenantId: captured.tenantId ?? false,\n projectId: captured.projectId ?? false,\n signal,\n });\n assertCapturedContext();\n prepared.assertCurrent();\n if (response.errors?.length || response.data == null) {\n throw new Error(\n 'The resale operation was not confirmed. Refresh its authoritative status before retrying.'\n );\n }\n return response.data;\n}\n"],"mappings":";;;AAoBA,eAAsB,EACpB,GACA,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAAE,GAAG,EAAM,GACtB,UAA8B;EAClC,KACG,EAAS,kBAAkB,WAAW,EAAwB,KAAK,UACnE,EAAS,aAAa,WAAW,EAAmB,KAAK,OAE1D,MAAU,MAAM,uEAAuE;CAE3F;CACA,EAAsB;CACtB,IAAM,IAAM,EAAkB,aAAa,EAAS,aAAa,GAC3D,IAAQ,EAAM,CAAQ,GACtB,IAAW,MAAM,EAAwB;EAC7C;EACA,WAAW,EAAS;EACpB,SAAS,EAAS;EAClB,aAAa,EAAS;EACtB,UAAU,EAAS;EACnB,cAAc;EACd;CACF,CAAC;CAED,AADA,EAAsB,GACtB,EAAS,cAAc;CACvB,IAAM,IAAW,MAAM,EAAsB;EAC3C,SAAS;EACT,SAAS,EAAS;EAClB;EACA;EACA,WAAW,EAAS;EACpB,gBAAgB,EAAS;EACzB,aAAa,EAAS;EACtB,gBAAgB,EAAS,kBAAkB;EAC3C,UAAU,EAAS,YAAY;EAC/B,WAAW,EAAS,aAAa;EACjC;CACF,CAAC;CAGD,IAFA,EAAsB,GACtB,EAAS,cAAc,GACnB,EAAS,QAAQ,UAAU,EAAS,QAAQ,MAC9C,MAAU,MACR,2FACF;CAEF,OAAO,EAAS;AAClB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
import { CooResaleBrowseQuery, CooResaleBrowseQueryVariables, CooResalePublicDetailQuery, CooResaleSellerQuery, CooResaleOwnReportsQuery } from '../../generated/wspace-operations';
|
|
3
|
+
export type { CooResaleShopFieldsFragment as ResaleShop, CooResaleOwnListingFieldsFragment as ResaleOwnListing, CooResalePublicFieldsFragment as ResalePublicListing, } from '../../generated/wspace-operations';
|
|
4
|
+
export declare const RESALE_QUERY_KEY: readonly ["coolandlovely", "resale"];
|
|
5
|
+
export declare const RESALE_PAGE_SIZE = 20;
|
|
6
|
+
export declare function useResaleBrowse(input: CooResaleBrowseQueryVariables['input']): import('@tanstack/react-query').UseQueryResult<CooResaleBrowseQuery, Error>;
|
|
7
|
+
export declare function useResalePublicListing(id: string | undefined): import('@tanstack/react-query').UseQueryResult<CooResalePublicDetailQuery, Error>;
|
|
8
|
+
export declare function useResaleSeller(page: number): import('@tanstack/react-query').UseQueryResult<CooResaleSellerQuery, Error>;
|
|
9
|
+
export declare function useResaleReports(page: number): import('@tanstack/react-query').UseQueryResult<CooResaleOwnReportsQuery, Error>;
|
|
10
|
+
export declare function useResaleMutation<TData, TVariables extends Record<string, unknown>>(document: DocumentNode): import('@tanstack/react-query').UseMutationResult<TData, Error, TVariables, unknown>;
|
|
11
|
+
export declare function refreshResaleRead(refetch: () => Promise<unknown>): void;
|
|
12
|
+
//# sourceMappingURL=useResale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResale.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useResale.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACV,2BAA2B,IAAI,UAAU,EACzC,iCAAiC,IAAI,gBAAgB,EACrD,6BAA6B,IAAI,mBAAmB,GACrD,MAAM,mCAAmC,CAAC;AAE3C,eAAO,MAAM,gBAAgB,sCAAuC,CAAC;AACrE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAoDnC,wBAAgB,eAAe,CAAC,KAAK,EAAE,6BAA6B,CAAC,OAAO,CAAC,+EAU5E;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,qFAY5D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,+EAc3C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,mFAc5C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjF,QAAQ,EAAE,YAAY,wFAcvB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAGvE"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useCoolAndLovely as e } from "../context/CoolAndLovelyContext.js";
|
|
2
|
+
import "../context/index.js";
|
|
3
|
+
import { CooResaleBrowseDocument as t, CooResaleOwnReportsDocument as n, CooResalePublicDetailDocument as r, CooResaleSellerDocument as i } from "../../generated/wspace-operations.js";
|
|
4
|
+
import { resaleRequest as a } from "../api/resaleTransport.js";
|
|
5
|
+
import { useEffect as o, useMemo as s } from "react";
|
|
6
|
+
import { useMutation as c, useQuery as l, useQueryClient as u } from "@tanstack/react-query";
|
|
7
|
+
import { clearGraphqlFetchResponseCache as d } from "@burdenoff/fe-libs/shared/graphql/fetch";
|
|
8
|
+
//#region src/coolandlovely/hooks/useResale.ts
|
|
9
|
+
var f = ["coolandlovely", "resale"];
|
|
10
|
+
function p() {
|
|
11
|
+
let { apiGatewayUrl: t, authToken: n, currentUser: r, workspaceId: i, tenantId: c, organizationId: l, projectId: u } = e(), d = r?.id, p = s(() => ({ controller: new AbortController() }), [
|
|
12
|
+
t,
|
|
13
|
+
n,
|
|
14
|
+
d,
|
|
15
|
+
i,
|
|
16
|
+
c,
|
|
17
|
+
l,
|
|
18
|
+
u
|
|
19
|
+
]);
|
|
20
|
+
o(() => {
|
|
21
|
+
p.controller.signal.aborted && (p.controller = new AbortController());
|
|
22
|
+
let e = p.controller;
|
|
23
|
+
return () => e.abort();
|
|
24
|
+
}, [p]);
|
|
25
|
+
let m = [
|
|
26
|
+
...f,
|
|
27
|
+
t,
|
|
28
|
+
d,
|
|
29
|
+
i,
|
|
30
|
+
c,
|
|
31
|
+
l,
|
|
32
|
+
u
|
|
33
|
+
];
|
|
34
|
+
return {
|
|
35
|
+
request: (e, r, o = p.controller.signal) => {
|
|
36
|
+
if (!t || !n || !d || !i) throw Error("Choose an account and workspace before continuing.");
|
|
37
|
+
return a({
|
|
38
|
+
apiGatewayUrl: t,
|
|
39
|
+
authToken: n,
|
|
40
|
+
actorId: d,
|
|
41
|
+
workspaceId: i,
|
|
42
|
+
tenantId: c,
|
|
43
|
+
organizationId: l,
|
|
44
|
+
projectId: u
|
|
45
|
+
}, e, r, o);
|
|
46
|
+
},
|
|
47
|
+
ready: !!(t && n && d && i),
|
|
48
|
+
key: m
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function m(e) {
|
|
52
|
+
let { request: n, ready: r, key: i } = p();
|
|
53
|
+
return l({
|
|
54
|
+
queryKey: [
|
|
55
|
+
...i,
|
|
56
|
+
"browse",
|
|
57
|
+
e
|
|
58
|
+
],
|
|
59
|
+
enabled: r,
|
|
60
|
+
retry: !1,
|
|
61
|
+
staleTime: 0,
|
|
62
|
+
queryFn: ({ signal: r }) => n(t, { input: e }, r)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function h(e) {
|
|
66
|
+
let { request: t, ready: n, key: i } = p();
|
|
67
|
+
return l({
|
|
68
|
+
queryKey: [
|
|
69
|
+
...i,
|
|
70
|
+
"public-detail",
|
|
71
|
+
e
|
|
72
|
+
],
|
|
73
|
+
enabled: n && !!e,
|
|
74
|
+
retry: !1,
|
|
75
|
+
staleTime: 0,
|
|
76
|
+
queryFn: ({ signal: n }) => {
|
|
77
|
+
if (!e) throw Error("Choose a resale listing.");
|
|
78
|
+
return t(r, { id: e }, n);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function g(e) {
|
|
83
|
+
let { request: t, ready: n, key: r } = p();
|
|
84
|
+
return l({
|
|
85
|
+
queryKey: [
|
|
86
|
+
...r,
|
|
87
|
+
"seller",
|
|
88
|
+
e
|
|
89
|
+
],
|
|
90
|
+
enabled: n,
|
|
91
|
+
retry: !1,
|
|
92
|
+
staleTime: 0,
|
|
93
|
+
queryFn: ({ signal: n }) => t(i, { pagination: {
|
|
94
|
+
limit: 20,
|
|
95
|
+
offset: e * 20
|
|
96
|
+
} }, n)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function _(e) {
|
|
100
|
+
let { request: t, ready: r, key: i } = p();
|
|
101
|
+
return l({
|
|
102
|
+
queryKey: [
|
|
103
|
+
...i,
|
|
104
|
+
"reports",
|
|
105
|
+
e
|
|
106
|
+
],
|
|
107
|
+
enabled: r,
|
|
108
|
+
retry: !1,
|
|
109
|
+
staleTime: 0,
|
|
110
|
+
queryFn: ({ signal: r }) => t(n, { pagination: {
|
|
111
|
+
limit: 20,
|
|
112
|
+
offset: e * 20
|
|
113
|
+
} }, r)
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function v(e) {
|
|
117
|
+
let { request: t } = p(), n = u();
|
|
118
|
+
return c({
|
|
119
|
+
retry: !1,
|
|
120
|
+
mutationFn: (n) => t(e, n),
|
|
121
|
+
onSettled: async () => {
|
|
122
|
+
d(), await n.invalidateQueries({ queryKey: f });
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function y(e) {
|
|
127
|
+
d(), e();
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { f as RESALE_QUERY_KEY, y as refreshResaleRead, m as useResaleBrowse, v as useResaleMutation, h as useResalePublicListing, _ as useResaleReports, g as useResaleSeller };
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=useResale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResale.js","names":[],"sources":["../../../src/coolandlovely/hooks/useResale.ts"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport type { DocumentNode } from 'graphql';\nimport { clearGraphqlFetchResponseCache } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport { useCoolAndLovely } from '../context';\nimport { resaleRequest } from '../api/resaleTransport';\nimport {\n CooResaleBrowseDocument,\n CooResalePublicDetailDocument,\n CooResaleSellerDocument,\n CooResaleOwnReportsDocument,\n type CooResaleBrowseQuery,\n type CooResaleBrowseQueryVariables,\n type CooResalePublicDetailQuery,\n type CooResaleSellerQuery,\n type CooResaleOwnReportsQuery,\n} from '../../generated/wspace-operations';\n\nexport type {\n CooResaleShopFieldsFragment as ResaleShop,\n CooResaleOwnListingFieldsFragment as ResaleOwnListing,\n CooResalePublicFieldsFragment as ResalePublicListing,\n} from '../../generated/wspace-operations';\n\nexport const RESALE_QUERY_KEY = ['coolandlovely', 'resale'] as const;\nexport const RESALE_PAGE_SIZE = 20;\n\nfunction useResaleClient() {\n const {\n apiGatewayUrl,\n authToken,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n projectId,\n } = useCoolAndLovely();\n const actorId = currentUser?.id;\n const lifetime = useMemo(\n () => ({ controller: new AbortController() }),\n [apiGatewayUrl, authToken, actorId, workspaceId, tenantId, organizationId, projectId]\n );\n useEffect(() => {\n // StrictMode and hidden-tree effect replay reuse the captured scope capsule.\n // Renew only that capsule after cleanup; old scopes stay independently aborted.\n if (lifetime.controller.signal.aborted) lifetime.controller = new AbortController();\n const controller = lifetime.controller;\n return () => controller.abort();\n }, [lifetime]);\n // Only nonsecret context identifiers belong in query keys. Bearers never do.\n const key = [\n ...RESALE_QUERY_KEY,\n apiGatewayUrl,\n actorId,\n workspaceId,\n tenantId,\n organizationId,\n projectId,\n ] as const;\n const ready = Boolean(apiGatewayUrl && authToken && actorId && workspaceId);\n const request = <T>(\n document: DocumentNode,\n variables: Record<string, unknown>,\n signal = lifetime.controller.signal\n ): Promise<T> => {\n if (!apiGatewayUrl || !authToken || !actorId || !workspaceId)\n throw new Error('Choose an account and workspace before continuing.');\n return resaleRequest<T>(\n { apiGatewayUrl, authToken, actorId, workspaceId, tenantId, organizationId, projectId },\n document,\n variables,\n signal\n );\n };\n return { request, ready, key };\n}\n\nexport function useResaleBrowse(input: CooResaleBrowseQueryVariables['input']) {\n const { request, ready, key } = useResaleClient();\n return useQuery({\n queryKey: [...key, 'browse', input],\n enabled: ready,\n retry: false,\n staleTime: 0,\n queryFn: ({ signal }) =>\n request<CooResaleBrowseQuery>(CooResaleBrowseDocument, { input }, signal),\n });\n}\n\nexport function useResalePublicListing(id: string | undefined) {\n const { request, ready, key } = useResaleClient();\n return useQuery({\n queryKey: [...key, 'public-detail', id],\n enabled: ready && Boolean(id),\n retry: false,\n staleTime: 0,\n queryFn: ({ signal }) => {\n if (!id) throw new Error('Choose a resale listing.');\n return request<CooResalePublicDetailQuery>(CooResalePublicDetailDocument, { id }, signal);\n },\n });\n}\n\nexport function useResaleSeller(page: number) {\n const { request, ready, key } = useResaleClient();\n return useQuery({\n queryKey: [...key, 'seller', page],\n enabled: ready,\n retry: false,\n staleTime: 0,\n queryFn: ({ signal }) =>\n request<CooResaleSellerQuery>(\n CooResaleSellerDocument,\n { pagination: { limit: RESALE_PAGE_SIZE, offset: page * RESALE_PAGE_SIZE } },\n signal\n ),\n });\n}\n\nexport function useResaleReports(page: number) {\n const { request, ready, key } = useResaleClient();\n return useQuery({\n queryKey: [...key, 'reports', page],\n enabled: ready,\n retry: false,\n staleTime: 0,\n queryFn: ({ signal }) =>\n request<CooResaleOwnReportsQuery>(\n CooResaleOwnReportsDocument,\n { pagination: { limit: RESALE_PAGE_SIZE, offset: page * RESALE_PAGE_SIZE } },\n signal\n ),\n });\n}\n\nexport function useResaleMutation<TData, TVariables extends Record<string, unknown>>(\n document: DocumentNode\n) {\n const { request } = useResaleClient();\n const queries = useQueryClient();\n return useMutation<TData, Error, TVariables>({\n retry: false,\n mutationFn: (variables) => request<TData>(document, variables),\n // A committed write can lose its response or fail the post-context check.\n // Refresh reads on every settlement, without replaying the mutation.\n onSettled: async () => {\n clearGraphqlFetchResponseCache();\n await queries.invalidateQueries({ queryKey: RESALE_QUERY_KEY });\n },\n });\n}\n\nexport function refreshResaleRead(refetch: () => Promise<unknown>): void {\n clearGraphqlFetchResponseCache();\n void refetch();\n}\n"],"mappings":";;;;;;;;AAwBA,IAAa,IAAmB,CAAC,iBAAiB,QAAQ;AAG1D,SAAS,IAAkB;CACzB,IAAM,EACJ,kBACA,cACA,gBACA,gBACA,aACA,mBACA,iBACE,EAAiB,GACf,IAAU,GAAa,IACvB,IAAW,SACR,EAAE,YAAY,IAAI,gBAAgB,EAAE,IAC3C;EAAC;EAAe;EAAW;EAAS;EAAa;EAAU;EAAgB;CAAS,CACtF;CACA,QAAgB;EAGd,AAAI,EAAS,WAAW,OAAO,YAAS,EAAS,aAAa,IAAI,gBAAgB;EAClF,IAAM,IAAa,EAAS;EAC5B,aAAa,EAAW,MAAM;CAChC,GAAG,CAAC,CAAQ,CAAC;CA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AC7C,IAAM,EAAE,YAAS,UAAO,WAAQ,EAAgB;CAChD,OAAO,EAAS;EACd,UAAU;GAAC,GAAG;GAAK;GAAW;EAAI;EAClC,SAAS;EACT,OAAO;EACP,WAAW;EACX,UAAU,EAAE,gBACV,EACE,GACA,EAAE,YAAY;GAAE,OAAA;GAAyB,QAAQ,IAAA;EAAwB,EAAE,GAC3E,CACF;CACJ,CAAC;AACH;AAEA,SAAgB,EACd,GACA;CACA,IAAM,EAAE,eAAY,EAAgB,GAC9B,IAAU,EAAe;CAC/B,OAAO,EAAsC;EAC3C,OAAO;EACP,aAAa,MAAc,EAAe,GAAU,CAAS;EAG7D,WAAW,YAAY;GAErB,AADA,EAA+B,GAC/B,MAAM,EAAQ,kBAAkB,EAAE,UAAU,EAAiB,CAAC;EAChE;CACF,CAAC;AACH;AAEA,SAAgB,EAAkB,GAAuC;CAEvE,AADA,EAA+B,GAC/B,EAAa;AACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResaleBrowsePage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/resale/ResaleBrowsePage.tsx"],"names":[],"mappings":"AAiBA,wBAAgB,gBAAgB,gCAiJ/B"}
|