@burdenoff/microfe-store 2026.510.113
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/README.md +217 -0
- package/dist/StoreAdminRoot.d.ts +22 -0
- package/dist/StoreAdminRoot.js +23 -0
- package/dist/StoreAdminRoot.js.map +1 -0
- package/dist/StoreAdminRoutes.d.ts +9 -0
- package/dist/StoreAdminRoutes.js +69 -0
- package/dist/StoreAdminRoutes.js.map +1 -0
- package/dist/StoreRoot.d.ts +31 -0
- package/dist/StoreRoot.js +139 -0
- package/dist/StoreRoot.js.map +1 -0
- package/dist/StoreRoutes.d.ts +12 -0
- package/dist/StoreRoutes.js +285 -0
- package/dist/StoreRoutes.js.map +1 -0
- package/dist/components/InstallAppModal.d.ts +26 -0
- package/dist/components/InstallAppModal.js +287 -0
- package/dist/components/InstallAppModal.js.map +1 -0
- package/dist/components/RouteGuards.d.ts +17 -0
- package/dist/components/RouteGuards.js +26 -0
- package/dist/components/RouteGuards.js.map +1 -0
- package/dist/components/cart/CartDrawer.d.ts +35 -0
- package/dist/components/cart/CartDrawer.js +162 -0
- package/dist/components/cart/CartDrawer.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +3 -0
- package/dist/components/marketplace/ProductCard.d.ts +18 -0
- package/dist/components/marketplace/ProductCard.js +2 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/generated/global-operations.d.ts +2012 -0
- package/dist/generated/global-operations.js +1444 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.d.ts +20856 -0
- package/dist/generated/global-types.js +14 -0
- package/dist/generated/global-types.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +1 -0
- package/dist/generated/wspace-types.d.ts +53362 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/useBackendCart.d.ts +73 -0
- package/dist/hooks/useBackendCart.js +171 -0
- package/dist/hooks/useBackendCart.js.map +1 -0
- package/dist/hooks/useCart.d.ts +62 -0
- package/dist/hooks/useCart.js +90 -0
- package/dist/hooks/useCart.js.map +1 -0
- package/dist/hooks/useInstallations.d.ts +43 -0
- package/dist/hooks/useInstallations.js +140 -0
- package/dist/hooks/useInstallations.js.map +1 -0
- package/dist/hooks/useOrders.d.ts +40 -0
- package/dist/hooks/useOrders.js +73 -0
- package/dist/hooks/useOrders.js.map +1 -0
- package/dist/hooks/useProductSearch.d.ts +22 -0
- package/dist/hooks/useProductSearch.js +59 -0
- package/dist/hooks/useProductSearch.js.map +1 -0
- package/dist/hooks/useStoreGraphQL.d.ts +475 -0
- package/dist/hooks/useStoreGraphQL.js +751 -0
- package/dist/hooks/useStoreGraphQL.js.map +1 -0
- package/dist/hooks/useStoreGraphQLWithContext.d.ts +48 -0
- package/dist/hooks/useStoreGraphQLWithContext.js +39 -0
- package/dist/hooks/useStoreGraphQLWithContext.js.map +1 -0
- package/dist/hooks/useStorePermissions.d.ts +63 -0
- package/dist/hooks/useStorePermissions.js +88 -0
- package/dist/hooks/useStorePermissions.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +13 -0
- package/dist/pages/AdminDashboardPage.d.ts +3 -0
- package/dist/pages/AdminDashboardPage.js +491 -0
- package/dist/pages/AdminDashboardPage.js.map +1 -0
- package/dist/pages/AdminReviewModerationPage.d.ts +3 -0
- package/dist/pages/AdminReviewModerationPage.js +247 -0
- package/dist/pages/AdminReviewModerationPage.js.map +1 -0
- package/dist/pages/AdminStoresPage.d.ts +3 -0
- package/dist/pages/AdminStoresPage.js +442 -0
- package/dist/pages/AdminStoresPage.js.map +1 -0
- package/dist/pages/AdminSubmissionsQueuePage.d.ts +3 -0
- package/dist/pages/AdminSubmissionsQueuePage.js +387 -0
- package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -0
- package/dist/pages/AppDetailPage.d.ts +3 -0
- package/dist/pages/AppDetailPage.js +166 -0
- package/dist/pages/AppDetailPage.js.map +1 -0
- package/dist/pages/AppSettingsPage.d.ts +3 -0
- package/dist/pages/AppSettingsPage.js +100 -0
- package/dist/pages/AppSettingsPage.js.map +1 -0
- package/dist/pages/CartPage.d.ts +8 -0
- package/dist/pages/CartPage.js +259 -0
- package/dist/pages/CartPage.js.map +1 -0
- package/dist/pages/InstalledAppsPage.d.ts +8 -0
- package/dist/pages/InstalledAppsPage.js +290 -0
- package/dist/pages/InstalledAppsPage.js.map +1 -0
- package/dist/pages/MarketplaceHomePage.d.ts +3 -0
- package/dist/pages/MarketplaceHomePage.js +1118 -0
- package/dist/pages/MarketplaceHomePage.js.map +1 -0
- package/dist/pages/MyLicensesPage.d.ts +3 -0
- package/dist/pages/MyLicensesPage.js +146 -0
- package/dist/pages/MyLicensesPage.js.map +1 -0
- package/dist/pages/OrderConfirmationPage.d.ts +3 -0
- package/dist/pages/OrderConfirmationPage.js +178 -0
- package/dist/pages/OrderConfirmationPage.js.map +1 -0
- package/dist/pages/OrdersPage.d.ts +8 -0
- package/dist/pages/OrdersPage.js +358 -0
- package/dist/pages/OrdersPage.js.map +1 -0
- package/dist/pages/ProductCategoryPage.d.ts +3 -0
- package/dist/pages/ProductCategoryPage.js +83 -0
- package/dist/pages/ProductCategoryPage.js.map +1 -0
- package/dist/pages/ProductDetailPage.d.ts +8 -0
- package/dist/pages/ProductDetailPage.js +1205 -0
- package/dist/pages/ProductDetailPage.js.map +1 -0
- package/dist/pages/ProductReviewsPage.d.ts +3 -0
- package/dist/pages/ProductReviewsPage.js +86 -0
- package/dist/pages/ProductReviewsPage.js.map +1 -0
- package/dist/pages/PublisherDashboardPage.d.ts +3 -0
- package/dist/pages/PublisherDashboardPage.js +154 -0
- package/dist/pages/PublisherDashboardPage.js.map +1 -0
- package/dist/pages/PublisherRevenuePage.d.ts +3 -0
- package/dist/pages/PublisherRevenuePage.js +138 -0
- package/dist/pages/PublisherRevenuePage.js.map +1 -0
- package/dist/pages/PublisherSubmissionsPage.d.ts +3 -0
- package/dist/pages/PublisherSubmissionsPage.js +174 -0
- package/dist/pages/PublisherSubmissionsPage.js.map +1 -0
- package/dist/pages/PublisherSubmitPage.d.ts +3 -0
- package/dist/pages/PublisherSubmitPage.js +224 -0
- package/dist/pages/PublisherSubmitPage.js.map +1 -0
- package/dist/pages/SearchResultsPage.d.ts +3 -0
- package/dist/pages/SearchResultsPage.js +125 -0
- package/dist/pages/SearchResultsPage.js.map +1 -0
- package/dist/pages/StoresPage.d.ts +3 -0
- package/dist/pages/StoresPage.js +154 -0
- package/dist/pages/StoresPage.js.map +1 -0
- package/dist/providers/StoreProvider.d.ts +38 -0
- package/dist/providers/StoreProvider.js +51 -0
- package/dist/providers/StoreProvider.js.map +1 -0
- package/dist/store/storeStore.d.ts +69 -0
- package/dist/store/storeStore.js +68 -0
- package/dist/store/storeStore.js.map +1 -0
- package/dist/translations/en.d.ts +518 -0
- package/dist/translations/en.js +514 -0
- package/dist/translations/en.js.map +1 -0
- package/dist/types/index.d.ts +575 -0
- package/dist/utils/index.d.ts +67 -0
- package/dist/utils/index.js +114 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +105 -0
package/README.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# @burdenoff/microfe-store
|
|
2
|
+
|
|
3
|
+
Standalone micro-frontend for the Store tenant module, providing app marketplace functionality including product discovery, shopping cart, checkout, installation management, licensing, and publisher portal.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Store micro-frontend is a fully isolated, production-ready module for:
|
|
8
|
+
|
|
9
|
+
- **End Users**: Browse, purchase, and install digital/physical products
|
|
10
|
+
- **Publishers**: Submit products, manage listings, track revenue
|
|
11
|
+
- **Workspace Admins**: Install apps, manage entitlements, configure permissions
|
|
12
|
+
- **Platform Admins**: Review submissions, moderate content, manage categories
|
|
13
|
+
|
|
14
|
+
## Project Structure
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
microfe-store/
|
|
18
|
+
├── package.json # Package configuration with subpath exports
|
|
19
|
+
├── vite.config.ts # Vite build configuration
|
|
20
|
+
├── tsconfig.json # TypeScript configuration
|
|
21
|
+
├── tsconfig.build.json # Build-specific TS config
|
|
22
|
+
├── tsconfig.node.json # Node config for Vite
|
|
23
|
+
├── .graphqlrc.yml # GraphQL codegen configuration
|
|
24
|
+
├── eslint.config.mjs # ESLint configuration
|
|
25
|
+
├── prettier.config.mjs # Prettier configuration
|
|
26
|
+
├── .gitignore # Git ignore rules
|
|
27
|
+
├── index.html # Dev server entry
|
|
28
|
+
└── src/
|
|
29
|
+
├── index.ts # Main exports
|
|
30
|
+
├── StoreRoot.tsx # Root component (entry point)
|
|
31
|
+
├── StoreRoutes.tsx # Internal routing
|
|
32
|
+
├── components/ # Reusable UI components
|
|
33
|
+
│ ├── index.ts
|
|
34
|
+
│ ├── cart/
|
|
35
|
+
│ │ └── CartDrawer.tsx
|
|
36
|
+
│ └── marketplace/
|
|
37
|
+
│ └── ProductCard.tsx
|
|
38
|
+
├── hooks/ # Custom React hooks
|
|
39
|
+
│ ├── index.ts
|
|
40
|
+
│ ├── useCart.ts
|
|
41
|
+
│ ├── useProductSearch.ts
|
|
42
|
+
│ ├── useStorePermissions.ts
|
|
43
|
+
│ └── useStoreGraphQL.ts # 22+ GraphQL hooks
|
|
44
|
+
├── graphql/ # GraphQL client & operations
|
|
45
|
+
│ ├── index.ts
|
|
46
|
+
│ ├── store-client.ts # Apollo Client singleton
|
|
47
|
+
│ ├── operations.ts # Queries, mutations, fragments
|
|
48
|
+
│ └── operations/ # .graphql files by domain
|
|
49
|
+
├── pages/ # Page components
|
|
50
|
+
│ ├── MarketplaceHomePage.tsx
|
|
51
|
+
│ ├── ProductDetailPage.tsx
|
|
52
|
+
│ ├── CartPage.tsx
|
|
53
|
+
│ └── InstalledAppsPage.tsx
|
|
54
|
+
├── providers/ # React context providers
|
|
55
|
+
│ └── StoreProvider.tsx
|
|
56
|
+
├── store/ # Zustand state management
|
|
57
|
+
│ └── storeStore.ts
|
|
58
|
+
├── types/ # TypeScript type definitions
|
|
59
|
+
│ └── index.ts
|
|
60
|
+
├── utils/ # Utility functions
|
|
61
|
+
│ └── index.ts
|
|
62
|
+
└── dev/ # Development entry point
|
|
63
|
+
└── main.tsx
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install @burdenoff/microfe-store
|
|
70
|
+
# or
|
|
71
|
+
bun add @burdenoff/microfe-store
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
### Basic Integration
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { StoreRoot, type StoreRootProps } from '@burdenoff/microfe-store';
|
|
80
|
+
|
|
81
|
+
function App() {
|
|
82
|
+
const props: StoreRootProps = {
|
|
83
|
+
basePath: '/store',
|
|
84
|
+
apiGatewayUrl: 'https://api.example.com/tenant/graphql',
|
|
85
|
+
authToken: 'your-jwt-token',
|
|
86
|
+
user: {
|
|
87
|
+
id: 'user-1',
|
|
88
|
+
email: 'user@example.com',
|
|
89
|
+
roles: ['user', 'publisher'],
|
|
90
|
+
},
|
|
91
|
+
features: {
|
|
92
|
+
enablePhysicalProducts: true,
|
|
93
|
+
enablePublisherPortal: true,
|
|
94
|
+
enableReviews: true,
|
|
95
|
+
enableSubscriptions: true,
|
|
96
|
+
},
|
|
97
|
+
registerNavItems: (items) => {
|
|
98
|
+
// Register navigation items with your shell
|
|
99
|
+
return () => {}; // Cleanup function
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return <StoreRoot {...props} />;
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Subpath Exports
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
// Main entry
|
|
111
|
+
import { StoreRoot, useStore, useCart } from '@burdenoff/microfe-store';
|
|
112
|
+
|
|
113
|
+
// Components only
|
|
114
|
+
import { ProductCard, CartDrawer } from '@burdenoff/microfe-store/components';
|
|
115
|
+
|
|
116
|
+
// Hooks only
|
|
117
|
+
import { useProductSearch, useStorePermissions } from '@burdenoff/microfe-store/hooks';
|
|
118
|
+
|
|
119
|
+
// GraphQL client
|
|
120
|
+
import { getStoreClient, resetStoreClient } from '@burdenoff/microfe-store/graphql';
|
|
121
|
+
|
|
122
|
+
// Types only
|
|
123
|
+
import type { Product, CartItem, Order } from '@burdenoff/microfe-store/types';
|
|
124
|
+
|
|
125
|
+
// Utilities
|
|
126
|
+
import { formatPrice, calculateCartTotals } from '@burdenoff/microfe-store/utils';
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Features
|
|
130
|
+
|
|
131
|
+
### Implemented
|
|
132
|
+
|
|
133
|
+
- Product catalog with search and filtering
|
|
134
|
+
- Shopping cart with quantity management
|
|
135
|
+
- Marketplace homepage with featured products
|
|
136
|
+
- Installed apps management page
|
|
137
|
+
- Cart page with order summary
|
|
138
|
+
- Permission-based navigation
|
|
139
|
+
- Feature flag support
|
|
140
|
+
|
|
141
|
+
### Routes
|
|
142
|
+
|
|
143
|
+
| Route | Description |
|
|
144
|
+
| -------------------------- | ------------------------------ |
|
|
145
|
+
| `/marketplace` | Product catalog & search |
|
|
146
|
+
| `/marketplace/product/:id` | Product details |
|
|
147
|
+
| `/cart` | Shopping cart |
|
|
148
|
+
| `/orders` | Order history |
|
|
149
|
+
| `/installed` | Installed apps |
|
|
150
|
+
| `/licenses` | License management |
|
|
151
|
+
| `/publisher/*` | Publisher portal (conditional) |
|
|
152
|
+
| `/admin/reviews` | Review moderation (admin only) |
|
|
153
|
+
|
|
154
|
+
## Architecture
|
|
155
|
+
|
|
156
|
+
### State Management
|
|
157
|
+
|
|
158
|
+
- **Zustand** with persistence middleware
|
|
159
|
+
- Cart state persisted to localStorage
|
|
160
|
+
- View preferences (grid/list, sort) persisted
|
|
161
|
+
|
|
162
|
+
### GraphQL Integration
|
|
163
|
+
|
|
164
|
+
- Apollo Client singleton with auth token injection
|
|
165
|
+
- 22+ hooks for store operations
|
|
166
|
+
- Pagination support with cache merge
|
|
167
|
+
|
|
168
|
+
### Permission Scopes
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
// Example scopes
|
|
172
|
+
'tenantmodule-store:catalog:product:read';
|
|
173
|
+
'tenantmodule-store:commerce:order:create';
|
|
174
|
+
'tenantmodule-store:fulfillment:installation:create';
|
|
175
|
+
'tenantmodule-store:publisher:submission:create';
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Install dependencies
|
|
182
|
+
bun install
|
|
183
|
+
|
|
184
|
+
# Start dev server
|
|
185
|
+
bun run dev
|
|
186
|
+
|
|
187
|
+
# Build for production
|
|
188
|
+
bun run build
|
|
189
|
+
|
|
190
|
+
# Type check
|
|
191
|
+
bun run type:check
|
|
192
|
+
|
|
193
|
+
# Run all checks
|
|
194
|
+
bun run sanity
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Configuration
|
|
198
|
+
|
|
199
|
+
### Environment Variables
|
|
200
|
+
|
|
201
|
+
| Variable | Description | Default |
|
|
202
|
+
| ---------------------- | ---------------------- | -------------------------------------- |
|
|
203
|
+
| `VITE_API_GATEWAY_URL` | GraphQL API endpoint | `http://localhost:4000/tenant/graphql` |
|
|
204
|
+
| `VITE_AUTH_TOKEN` | Development auth token | - |
|
|
205
|
+
|
|
206
|
+
## Peer Dependencies
|
|
207
|
+
|
|
208
|
+
- `react` ^19.0.0
|
|
209
|
+
- `react-dom` ^19.0.0
|
|
210
|
+
- `react-router-dom` ^7.0.0
|
|
211
|
+
- `@apollo/client` ^3.12.0
|
|
212
|
+
- `zustand` ^5.0.0
|
|
213
|
+
- `@burdenoff/fe-libs` workspace:\*
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
MIT
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { StoreAdminRootProps } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Admin root component for the Store microfrontend.
|
|
6
|
+
*
|
|
7
|
+
* This is the admin entry point that the admin app shell imports and renders.
|
|
8
|
+
* It sets up the necessary providers and renders only admin-specific routing.
|
|
9
|
+
* User-facing routes (marketplace, cart, orders, etc.) are NOT included here —
|
|
10
|
+
* those are in StoreRoot, which product app shells import instead.
|
|
11
|
+
*
|
|
12
|
+
* Nav items are registered statically by the admin shell's NavRegistration
|
|
13
|
+
* component, so this root only needs to provide context and routes.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { StoreAdminRoot } from '@burdenoff/microfe-store';
|
|
18
|
+
*
|
|
19
|
+
* <StoreAdminRoot basePath="/store" {...globalBaseProps} />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const StoreAdminRoot: FC<StoreAdminRootProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoreProvider as e } from "./providers/StoreProvider.js";
|
|
2
|
+
import { StoreAdminRoutes as t } from "./StoreAdminRoutes.js";
|
|
3
|
+
import { ErrorBoundary as n } from "@burdenoff/fe-libs/shared/components";
|
|
4
|
+
import { useI18n as r } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/StoreAdminRoot.tsx
|
|
7
|
+
var a = (a) => {
|
|
8
|
+
let { t: o } = r();
|
|
9
|
+
return /* @__PURE__ */ i(n, {
|
|
10
|
+
fallback: /* @__PURE__ */ i("div", {
|
|
11
|
+
className: "p-6 text-center text-text-secondary",
|
|
12
|
+
children: o("common.moduleLoadError", { defaultValue: "Something went wrong loading this module. Please refresh the page." })
|
|
13
|
+
}),
|
|
14
|
+
children: /* @__PURE__ */ i(e, {
|
|
15
|
+
...a,
|
|
16
|
+
children: /* @__PURE__ */ i(t, {})
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { a as StoreAdminRoot };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=StoreAdminRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreAdminRoot.js","names":[],"sources":["../src/StoreAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { StoreProvider } from './providers/StoreProvider';\nimport type { StoreAdminRootProps } from './types';\nimport { StoreAdminRoutes } from './StoreAdminRoutes';\n\n/**\n * Admin root component for the Store microfrontend.\n *\n * This is the admin entry point that the admin app shell imports and renders.\n * It sets up the necessary providers and renders only admin-specific routing.\n * User-facing routes (marketplace, cart, orders, etc.) are NOT included here —\n * those are in StoreRoot, which product app shells import instead.\n *\n * Nav items are registered statically by the admin shell's NavRegistration\n * component, so this root only needs to provide context and routes.\n *\n * @example\n * ```tsx\n * import { StoreAdminRoot } from '@burdenoff/microfe-store';\n *\n * <StoreAdminRoot basePath=\"/store\" {...globalBaseProps} />\n * ```\n */\nexport const StoreAdminRoot: FC<StoreAdminRootProps> = (props) => {\n const { t } = useI18n();\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {t('common.moduleLoadError', {\n defaultValue: 'Something went wrong loading this module. Please refresh the page.',\n })}\n </div>\n }\n >\n <StoreProvider {...props}>\n <StoreAdminRoutes />\n </StoreProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;AAyBA,IAAa,KAA2C,MAAU;CAChE,IAAM,EAAE,SAAM,GAAS;AAEvB,QACE,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAE,0BAA0B,EAC3B,cAAc,sEACf,CAAC;GACE,CAAA;YAGR,kBAAC,GAAD;GAAe,GAAI;aACjB,kBAAC,GAAD,EAAoB,CAAA;GACN,CAAA;EACF,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { STORE_PERMISSIONS as e, useStorePermissions as t } from "./hooks/useStorePermissions.js";
|
|
2
|
+
import { PageLoadingFallback as n, PermissionGuard as r } from "./components/RouteGuards.js";
|
|
3
|
+
import { Suspense as i, lazy as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { Navigate as c, Route as l, Routes as u } from "react-router-dom";
|
|
6
|
+
//#region src/StoreAdminRoutes.tsx
|
|
7
|
+
var d = a(() => import("./pages/AdminDashboardPage.js").then((e) => ({ default: e.AdminDashboardPage }))), f = a(() => import("./pages/AdminSubmissionsQueuePage.js").then((e) => ({ default: e.AdminSubmissionsQueuePage }))), p = a(() => import("./pages/AdminStoresPage.js").then((e) => ({ default: e.AdminStoresPage }))), m = a(() => import("./pages/AdminReviewModerationPage.js").then((e) => ({ default: e.AdminReviewModerationPage }))), h = () => {
|
|
8
|
+
let { hasPermission: a } = t(), h = a(e.REVIEW_ADMIN) || a(e.PRODUCT_ADMIN);
|
|
9
|
+
return /* @__PURE__ */ s(u, { children: [
|
|
10
|
+
/* @__PURE__ */ o(l, {
|
|
11
|
+
index: !0,
|
|
12
|
+
element: /* @__PURE__ */ o(c, {
|
|
13
|
+
to: "dashboard",
|
|
14
|
+
replace: !0
|
|
15
|
+
})
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ o(l, {
|
|
18
|
+
path: "dashboard",
|
|
19
|
+
element: /* @__PURE__ */ o(r, {
|
|
20
|
+
allowed: h,
|
|
21
|
+
children: /* @__PURE__ */ o(i, {
|
|
22
|
+
fallback: /* @__PURE__ */ o(n, {}),
|
|
23
|
+
children: /* @__PURE__ */ o(d, {})
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ o(l, {
|
|
28
|
+
path: "submissions",
|
|
29
|
+
element: /* @__PURE__ */ o(r, {
|
|
30
|
+
allowed: h,
|
|
31
|
+
children: /* @__PURE__ */ o(i, {
|
|
32
|
+
fallback: /* @__PURE__ */ o(n, {}),
|
|
33
|
+
children: /* @__PURE__ */ o(f, {})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ o(l, {
|
|
38
|
+
path: "stores",
|
|
39
|
+
element: /* @__PURE__ */ o(r, {
|
|
40
|
+
allowed: h,
|
|
41
|
+
children: /* @__PURE__ */ o(i, {
|
|
42
|
+
fallback: /* @__PURE__ */ o(n, {}),
|
|
43
|
+
children: /* @__PURE__ */ o(p, {})
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ o(l, {
|
|
48
|
+
path: "reviews",
|
|
49
|
+
element: /* @__PURE__ */ o(r, {
|
|
50
|
+
allowed: a(e.REVIEW_ADMIN),
|
|
51
|
+
children: /* @__PURE__ */ o(i, {
|
|
52
|
+
fallback: /* @__PURE__ */ o(n, {}),
|
|
53
|
+
children: /* @__PURE__ */ o(m, {})
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ o(l, {
|
|
58
|
+
path: "*",
|
|
59
|
+
element: /* @__PURE__ */ o(c, {
|
|
60
|
+
to: "dashboard",
|
|
61
|
+
replace: !0
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
] });
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { h as StoreAdminRoutes };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=StoreAdminRoutes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreAdminRoutes.js","names":[],"sources":["../src/StoreAdminRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, type FC } from 'react';\nimport { Routes, Route, Navigate } from 'react-router-dom';\nimport { useStorePermissions, STORE_PERMISSIONS } from './hooks/useStorePermissions';\nimport { PageLoadingFallback, PermissionGuard } from './components/RouteGuards';\n\nconst AdminDashboardPage = lazy(() =>\n import('./pages/AdminDashboardPage').then((m) => ({\n default: m.AdminDashboardPage,\n }))\n);\n\nconst AdminSubmissionsQueuePage = lazy(() =>\n import('./pages/AdminSubmissionsQueuePage').then((m) => ({\n default: m.AdminSubmissionsQueuePage,\n }))\n);\n\nconst AdminStoresPage = lazy(() =>\n import('./pages/AdminStoresPage').then((m) => ({\n default: m.AdminStoresPage,\n }))\n);\n\nconst AdminReviewModerationPage = lazy(() =>\n import('./pages/AdminReviewModerationPage').then((m) => ({\n default: m.AdminReviewModerationPage,\n }))\n);\n\n/**\n * StoreAdminRoutes component\n *\n * Admin-only routing for the Store microfrontend.\n * Mounted by the admin app shell via StoreAdminRoot.\n */\nexport const StoreAdminRoutes: FC = () => {\n const { hasPermission } = useStorePermissions();\n const isAdmin =\n hasPermission(STORE_PERMISSIONS.REVIEW_ADMIN) || hasPermission(STORE_PERMISSIONS.PRODUCT_ADMIN);\n\n return (\n <Routes>\n {/* Default redirect to dashboard */}\n <Route index element={<Navigate to=\"dashboard\" replace />} />\n\n <Route\n path=\"dashboard\"\n element={\n <PermissionGuard allowed={isAdmin}>\n <Suspense fallback={<PageLoadingFallback />}>\n <AdminDashboardPage />\n </Suspense>\n </PermissionGuard>\n }\n />\n\n <Route\n path=\"submissions\"\n element={\n <PermissionGuard allowed={isAdmin}>\n <Suspense fallback={<PageLoadingFallback />}>\n <AdminSubmissionsQueuePage />\n </Suspense>\n </PermissionGuard>\n }\n />\n\n <Route\n path=\"stores\"\n element={\n <PermissionGuard allowed={isAdmin}>\n <Suspense fallback={<PageLoadingFallback />}>\n <AdminStoresPage />\n </Suspense>\n </PermissionGuard>\n }\n />\n\n <Route\n path=\"reviews\"\n element={\n <PermissionGuard allowed={hasPermission(STORE_PERMISSIONS.REVIEW_ADMIN)}>\n <Suspense fallback={<PageLoadingFallback />}>\n <AdminReviewModerationPage />\n </Suspense>\n </PermissionGuard>\n }\n />\n\n {/* Catch-all redirect */}\n <Route path=\"*\" element={<Navigate to=\"dashboard\" replace />} />\n </Routes>\n );\n};\n"],"mappings":";;;;;;AAKA,IAAM,IAAqB,QACzB,OAAO,iCAA8B,MAAM,OAAO,EAChD,SAAS,EAAE,oBACZ,EAAE,CACJ,EAEK,IAA4B,QAChC,OAAO,wCAAqC,MAAM,OAAO,EACvD,SAAS,EAAE,2BACZ,EAAE,CACJ,EAEK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAC7C,SAAS,EAAE,iBACZ,EAAE,CACJ,EAEK,IAA4B,QAChC,OAAO,wCAAqC,MAAM,OAAO,EACvD,SAAS,EAAE,2BACZ,EAAE,CACJ,EAQY,UAA6B;CACxC,IAAM,EAAE,qBAAkB,GAAqB,EACzC,IACJ,EAAc,EAAkB,aAAa,IAAI,EAAc,EAAkB,cAAc;AAEjG,QACE,kBAAC,GAAD,EAAA,UAAA;EAEE,kBAAC,GAAD;GAAO,OAAA;GAAM,SAAS,kBAAC,GAAD;IAAU,IAAG;IAAY,SAAA;IAAU,CAAA;GAAI,CAAA;EAE7D,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAiB,SAAS;cACxB,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;eACzC,kBAAC,GAAD,EAAsB,CAAA;KACb,CAAA;IACK,CAAA;GAEpB,CAAA;EAEF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAiB,SAAS;cACxB,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;eACzC,kBAAC,GAAD,EAA6B,CAAA;KACpB,CAAA;IACK,CAAA;GAEpB,CAAA;EAEF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAiB,SAAS;cACxB,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;eACzC,kBAAC,GAAD,EAAmB,CAAA;KACV,CAAA;IACK,CAAA;GAEpB,CAAA;EAEF,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IAAiB,SAAS,EAAc,EAAkB,aAAa;cACrE,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,EAAuB,CAAA;eACzC,kBAAC,GAAD,EAA6B,CAAA;KACpB,CAAA;IACK,CAAA;GAEpB,CAAA;EAGF,kBAAC,GAAD;GAAO,MAAK;GAAI,SAAS,kBAAC,GAAD;IAAU,IAAG;IAAY,SAAA;IAAU,CAAA;GAAI,CAAA;EACzD,EAAA,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { StoreRootProps } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Root component for the Store microfrontend.
|
|
6
|
+
*
|
|
7
|
+
* This is the main entry point that host applications import and render.
|
|
8
|
+
* It sets up the necessary providers and renders the internal routing.
|
|
9
|
+
* Automatically registers navigation items with the shell if registration functions are provided.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { StoreRoot, type StoreRootProps } from '@burdenoff/micro-fe/store';
|
|
14
|
+
*
|
|
15
|
+
* function App() {
|
|
16
|
+
* const props: StoreRootProps = {
|
|
17
|
+
* basePath: '/store',
|
|
18
|
+
* navigate: (path) => router.push(path),
|
|
19
|
+
* currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },
|
|
20
|
+
* workspaceId: 'ws-123',
|
|
21
|
+
* organizationId: 'org-123',
|
|
22
|
+
* apiGatewayUrl: 'https://api.example.com/tenant/graphql',
|
|
23
|
+
* authToken: 'token',
|
|
24
|
+
* registerNavItems: (items) => { return () => {}; },
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* return <StoreRoot {...props} />;
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const StoreRoot: FC<StoreRootProps>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { StoreProvider as e } from "./providers/StoreProvider.js";
|
|
2
|
+
import { STORE_PERMISSIONS as t, useStorePermissions as n } from "./hooks/useStorePermissions.js";
|
|
3
|
+
import { useCart as r } from "./hooks/useCart.js";
|
|
4
|
+
import { StoreRoutes as i } from "./StoreRoutes.js";
|
|
5
|
+
import { useEffect as a, useMemo as o } from "react";
|
|
6
|
+
import { ErrorBoundary as s } from "@burdenoff/fe-libs/shared/components";
|
|
7
|
+
import { FeatureFlagProvider as c } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
8
|
+
import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { Briefcase as u, DollarSign as d, FileCheck as f, Key as p, LayoutDashboard as m, Package as h, Receipt as g, ShoppingBag as _, ShoppingCart as v, Upload as y } from "lucide-react";
|
|
10
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
11
|
+
//#region src/StoreRoot.tsx
|
|
12
|
+
var x = (t) => {
|
|
13
|
+
let { t: n } = l();
|
|
14
|
+
return /* @__PURE__ */ b(c, {
|
|
15
|
+
workspaceId: t.workspaceId ?? null,
|
|
16
|
+
gateway: "global",
|
|
17
|
+
defaultEnabled: !0,
|
|
18
|
+
children: /* @__PURE__ */ b(s, {
|
|
19
|
+
fallback: /* @__PURE__ */ b("div", {
|
|
20
|
+
className: "p-6 text-center text-text-secondary",
|
|
21
|
+
children: n("common.moduleLoadError", { defaultValue: "Something went wrong loading this module. Please refresh the page." })
|
|
22
|
+
}),
|
|
23
|
+
children: /* @__PURE__ */ b(e, {
|
|
24
|
+
...t,
|
|
25
|
+
children: /* @__PURE__ */ b(S, { ...t })
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}, S = ({ registerNavItems: e, registerFooterItems: s, basePath: c = "/" }) => {
|
|
30
|
+
let { itemCount: x } = r(), { permissions: S, hasPermission: C } = n(), { t: w } = l(), T = S.canPublish, E = C(t.EARNINGS_READ);
|
|
31
|
+
a(() => {
|
|
32
|
+
if (!e) return;
|
|
33
|
+
let t = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`), n = [
|
|
34
|
+
{
|
|
35
|
+
id: "store-marketplace",
|
|
36
|
+
label: w("nav.marketplace", { defaultValue: "Marketplace" }),
|
|
37
|
+
path: t(c, "marketplace"),
|
|
38
|
+
icon: /* @__PURE__ */ b(_, { size: 20 }),
|
|
39
|
+
order: 10,
|
|
40
|
+
group: "store"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "store-cart",
|
|
44
|
+
label: w("nav.cart", { defaultValue: "Cart" }),
|
|
45
|
+
path: t(c, "cart"),
|
|
46
|
+
icon: /* @__PURE__ */ b(v, { size: 20 }),
|
|
47
|
+
badge: x > 0 ? x : void 0,
|
|
48
|
+
order: 20,
|
|
49
|
+
group: "store"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "store-orders",
|
|
53
|
+
label: w("nav.orders", { defaultValue: "My Orders" }),
|
|
54
|
+
path: t(c, "orders"),
|
|
55
|
+
icon: /* @__PURE__ */ b(g, { size: 20 }),
|
|
56
|
+
order: 30,
|
|
57
|
+
group: "store"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "store-installed",
|
|
61
|
+
label: w("nav.installed", { defaultValue: "Installed Apps" }),
|
|
62
|
+
path: t(c, "installed"),
|
|
63
|
+
icon: /* @__PURE__ */ b(h, { size: 20 }),
|
|
64
|
+
order: 40,
|
|
65
|
+
group: "store"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "store-licenses",
|
|
69
|
+
label: w("nav.licenses", { defaultValue: "Licenses" }),
|
|
70
|
+
path: t(c, "licenses"),
|
|
71
|
+
icon: /* @__PURE__ */ b(p, { size: 20 }),
|
|
72
|
+
order: 50,
|
|
73
|
+
group: "store"
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
if (T) {
|
|
77
|
+
let e = [
|
|
78
|
+
{
|
|
79
|
+
id: "store-publisher-dashboard",
|
|
80
|
+
label: w("nav.publisherDashboard", { defaultValue: "Dashboard" }),
|
|
81
|
+
path: t(c, "publisher"),
|
|
82
|
+
icon: /* @__PURE__ */ b(m, { size: 20 }),
|
|
83
|
+
order: 10
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "store-publisher-submit",
|
|
87
|
+
label: w("nav.submitProduct", { defaultValue: "Submit Product" }),
|
|
88
|
+
path: t(c, "publisher/submit"),
|
|
89
|
+
icon: /* @__PURE__ */ b(y, { size: 20 }),
|
|
90
|
+
order: 20
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "store-publisher-submissions",
|
|
94
|
+
label: w("nav.submissions", { defaultValue: "Submissions" }),
|
|
95
|
+
path: t(c, "publisher/submissions"),
|
|
96
|
+
icon: /* @__PURE__ */ b(f, { size: 20 }),
|
|
97
|
+
order: 30
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
E && e.push({
|
|
101
|
+
id: "store-publisher-revenue",
|
|
102
|
+
label: w("nav.revenue", { defaultValue: "Revenue" }),
|
|
103
|
+
path: t(c, "publisher/revenue"),
|
|
104
|
+
icon: /* @__PURE__ */ b(d, { size: 20 }),
|
|
105
|
+
order: 40
|
|
106
|
+
}), n.push({
|
|
107
|
+
id: "store-publisher",
|
|
108
|
+
label: w("nav.publisher", { defaultValue: "Publisher Portal" }),
|
|
109
|
+
path: t(c, "publisher"),
|
|
110
|
+
icon: /* @__PURE__ */ b(u, { size: 20 }),
|
|
111
|
+
order: 60,
|
|
112
|
+
group: "store",
|
|
113
|
+
children: e
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return e(n);
|
|
117
|
+
}, [
|
|
118
|
+
e,
|
|
119
|
+
c,
|
|
120
|
+
x,
|
|
121
|
+
T,
|
|
122
|
+
E,
|
|
123
|
+
w
|
|
124
|
+
]);
|
|
125
|
+
let D = o(() => [{
|
|
126
|
+
id: "store-status",
|
|
127
|
+
label: w("store.footer.ready", { defaultValue: "Store Ready" }),
|
|
128
|
+
type: "status",
|
|
129
|
+
order: 10,
|
|
130
|
+
section: "left"
|
|
131
|
+
}], [w]);
|
|
132
|
+
return a(() => {
|
|
133
|
+
if (s) return s(D);
|
|
134
|
+
}, [s, D]), /* @__PURE__ */ b(i, {});
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
export { x as StoreRoot };
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=StoreRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreRoot.js","names":[],"sources":["../src/StoreRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n ShoppingBag,\n ShoppingCart,\n Receipt,\n Package,\n Key,\n Briefcase,\n LayoutDashboard,\n Upload,\n FileCheck,\n DollarSign,\n} from 'lucide-react';\nimport { StoreProvider } from './providers/StoreProvider';\nimport type { NavItem, StoreRootProps } from './types';\nimport { StoreRoutes } from './StoreRoutes';\nimport { useCart } from './hooks/useCart';\nimport { useStorePermissions, STORE_PERMISSIONS } from './hooks/useStorePermissions';\n\n/**\n * Root component for the Store microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { StoreRoot, type StoreRootProps } from '@burdenoff/micro-fe/store';\n *\n * function App() {\n * const props: StoreRootProps = {\n * basePath: '/store',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },\n * workspaceId: 'ws-123',\n * organizationId: 'org-123',\n * apiGatewayUrl: 'https://api.example.com/tenant/graphql',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <StoreRoot {...props} />;\n * }\n * ```\n */\nexport const StoreRoot: FC<StoreRootProps> = (props) => {\n const { t } = useI18n();\n\n return (\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={true}\n >\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {t('common.moduleLoadError', {\n defaultValue: 'Something went wrong loading this module. Please refresh the page.',\n })}\n </div>\n }\n >\n <StoreProvider {...props}>\n <StoreNavigationRegistration {...props} />\n </StoreProvider>\n </ErrorBoundary>\n </FeatureFlagProvider>\n );\n};\n\n/**\n * Internal component that handles navigation registration\n */\nconst StoreNavigationRegistration: FC<StoreRootProps> = ({\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n}) => {\n const { itemCount } = useCart(); // Get item count from backend cart\n const { permissions, hasPermission } = useStorePermissions();\n const { t } = useI18n();\n\n // Extract primitive flags so the registration effect only re-runs when\n // values actually change — not on every re-render of the permissions\n // object or memoized `hasPermission` identity. Without this, the parent\n // shell's nav store subscription causes a render loop: register → state\n // change → parent re-render → new permissions object → effect re-run →\n // unregister → register → ... (\"Maximum update depth exceeded\").\n const canPublish = permissions.canPublish;\n const canReadEarnings = hasPermission(STORE_PERMISSIONS.EARNINGS_READ);\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\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 const navItems: NavItem[] = [\n {\n id: 'store-marketplace',\n label: t('nav.marketplace', { defaultValue: 'Marketplace' }),\n path: joinPath(basePath, 'marketplace'),\n icon: <ShoppingBag size={20} />,\n order: 10,\n group: 'store',\n },\n {\n id: 'store-cart',\n label: t('nav.cart', { defaultValue: 'Cart' }),\n path: joinPath(basePath, 'cart'),\n icon: <ShoppingCart size={20} />,\n badge: itemCount > 0 ? itemCount : undefined,\n order: 20,\n group: 'store',\n },\n {\n id: 'store-orders',\n label: t('nav.orders', { defaultValue: 'My Orders' }),\n path: joinPath(basePath, 'orders'),\n icon: <Receipt size={20} />,\n order: 30,\n group: 'store',\n },\n {\n id: 'store-installed',\n label: t('nav.installed', { defaultValue: 'Installed Apps' }),\n path: joinPath(basePath, 'installed'),\n icon: <Package size={20} />,\n order: 40,\n group: 'store',\n },\n {\n id: 'store-licenses',\n label: t('nav.licenses', { defaultValue: 'Licenses' }),\n path: joinPath(basePath, 'licenses'),\n icon: <Key size={20} />,\n order: 50,\n group: 'store',\n },\n ];\n\n if (canPublish) {\n const publisherChildren: NavItem[] = [\n {\n id: 'store-publisher-dashboard',\n label: t('nav.publisherDashboard', { defaultValue: 'Dashboard' }),\n path: joinPath(basePath, 'publisher'),\n icon: <LayoutDashboard size={20} />,\n order: 10,\n },\n {\n id: 'store-publisher-submit',\n label: t('nav.submitProduct', { defaultValue: 'Submit Product' }),\n path: joinPath(basePath, 'publisher/submit'),\n icon: <Upload size={20} />,\n order: 20,\n },\n {\n id: 'store-publisher-submissions',\n label: t('nav.submissions', { defaultValue: 'Submissions' }),\n path: joinPath(basePath, 'publisher/submissions'),\n icon: <FileCheck size={20} />,\n order: 30,\n },\n ];\n\n if (canReadEarnings) {\n publisherChildren.push({\n id: 'store-publisher-revenue',\n label: t('nav.revenue', { defaultValue: 'Revenue' }),\n path: joinPath(basePath, 'publisher/revenue'),\n icon: <DollarSign size={20} />,\n order: 40,\n });\n }\n\n navItems.push({\n id: 'store-publisher',\n label: t('nav.publisher', { defaultValue: 'Publisher Portal' }),\n path: joinPath(basePath, 'publisher'),\n icon: <Briefcase size={20} />,\n order: 60,\n group: 'store',\n children: publisherChildren,\n });\n }\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, itemCount, canPublish, canReadEarnings, t]);\n\n // Register footer items — memoized to avoid re-registering on every render.\n const footerItems = useMemo(\n () => [\n {\n id: 'store-status',\n label: t('store.footer.ready', { defaultValue: 'Store Ready' }),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ],\n [t]\n );\n\n useEffect(() => {\n if (!registerFooterItems) return;\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, footerItems]);\n\n return <StoreRoutes />;\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* StoreRoutes component
|
|
5
|
+
*
|
|
6
|
+
* Internal routing for the Store microfrontend. Every route is gated by both
|
|
7
|
+
* a live feature flag (via FeatureGate) and an RBAC permission check so that
|
|
8
|
+
* features can be toggled per-org without a deployment.
|
|
9
|
+
*
|
|
10
|
+
* Flag namespace: store.*
|
|
11
|
+
*/
|
|
12
|
+
export declare const StoreRoutes: FC;
|