@fluid-app/rep-sdk 0.1.0
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 +413 -0
- package/dist/ContactsScreen-BYXF74BO.js +4 -0
- package/dist/ContactsScreen-BYXF74BO.js.map +1 -0
- package/dist/ContactsScreen-XZOQJVFE.cjs +17 -0
- package/dist/ContactsScreen-XZOQJVFE.cjs.map +1 -0
- package/dist/CustomersScreen-53SXRDDK.cjs +17 -0
- package/dist/CustomersScreen-53SXRDDK.cjs.map +1 -0
- package/dist/CustomersScreen-VS6LGULO.js +4 -0
- package/dist/CustomersScreen-VS6LGULO.js.map +1 -0
- package/dist/MessagingScreen-O42JEJMW.js +4 -0
- package/dist/MessagingScreen-O42JEJMW.js.map +1 -0
- package/dist/MessagingScreen-UCVLYWZB.cjs +17 -0
- package/dist/MessagingScreen-UCVLYWZB.cjs.map +1 -0
- package/dist/OrdersScreen-QQJFTTSS.js +4 -0
- package/dist/OrdersScreen-QQJFTTSS.js.map +1 -0
- package/dist/OrdersScreen-WNT2WDLI.cjs +17 -0
- package/dist/OrdersScreen-WNT2WDLI.cjs.map +1 -0
- package/dist/ProductsScreen-CTIAKS3Z.cjs +17 -0
- package/dist/ProductsScreen-CTIAKS3Z.cjs.map +1 -0
- package/dist/ProductsScreen-TRIT2FE3.js +4 -0
- package/dist/ProductsScreen-TRIT2FE3.js.map +1 -0
- package/dist/chunk-2AWTZV3T.js +16 -0
- package/dist/chunk-2AWTZV3T.js.map +1 -0
- package/dist/chunk-CXRJSGO6.js +16 -0
- package/dist/chunk-CXRJSGO6.js.map +1 -0
- package/dist/chunk-DEQ3PBVX.cjs +29 -0
- package/dist/chunk-DEQ3PBVX.cjs.map +1 -0
- package/dist/chunk-JZRNKSKT.cjs +19 -0
- package/dist/chunk-JZRNKSKT.cjs.map +1 -0
- package/dist/chunk-LO2HDG6C.js +26 -0
- package/dist/chunk-LO2HDG6C.js.map +1 -0
- package/dist/chunk-MBUCXIUN.cjs +19 -0
- package/dist/chunk-MBUCXIUN.cjs.map +1 -0
- package/dist/chunk-MEOOAMH2.cjs +19 -0
- package/dist/chunk-MEOOAMH2.cjs.map +1 -0
- package/dist/chunk-PJWPO4BJ.js +16 -0
- package/dist/chunk-PJWPO4BJ.js.map +1 -0
- package/dist/chunk-PZIHCYDD.js +16 -0
- package/dist/chunk-PZIHCYDD.js.map +1 -0
- package/dist/chunk-QUVJ3R4T.cjs +19 -0
- package/dist/chunk-QUVJ3R4T.cjs.map +1 -0
- package/dist/chunk-WH7WZXT6.js +16 -0
- package/dist/chunk-WH7WZXT6.js.map +1 -0
- package/dist/chunk-YII3IXF4.cjs +19 -0
- package/dist/chunk-YII3IXF4.cjs.map +1 -0
- package/dist/index.cjs +2446 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2164 -0
- package/dist/index.d.ts +2164 -0
- package/dist/index.js +2079 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# @fluid-app/rep-sdk
|
|
2
|
+
|
|
3
|
+
SDK for building custom Fluid rep portals. Provides React hooks, providers, and an API client for integrating with the Fluid Commerce platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @fluid-app/rep-sdk
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @fluid-app/rep-sdk
|
|
11
|
+
# or
|
|
12
|
+
bun add @fluid-app/rep-sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Peer Dependencies
|
|
16
|
+
|
|
17
|
+
This package requires the following peer dependencies:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"react": ">=18.0.0",
|
|
22
|
+
"@tanstack/react-query": ">=5.0.0"
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
Wrap your application with `FluidProvider`:
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { FluidProvider } from "@fluid-app/rep-sdk";
|
|
32
|
+
|
|
33
|
+
function App() {
|
|
34
|
+
return (
|
|
35
|
+
<FluidProvider
|
|
36
|
+
config={{
|
|
37
|
+
baseUrl: "https://api.fluid.app/api",
|
|
38
|
+
getAuthToken: () => localStorage.getItem("fluid_token"),
|
|
39
|
+
onAuthError: () => {
|
|
40
|
+
// Handle 401 errors (e.g., redirect to login)
|
|
41
|
+
window.location.href = "/login";
|
|
42
|
+
},
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<YourApp />
|
|
46
|
+
</FluidProvider>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Hooks
|
|
52
|
+
|
|
53
|
+
### useFluidApi
|
|
54
|
+
|
|
55
|
+
Access the API client for making requests:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { useFluidApi } from "@fluid-app/rep-sdk";
|
|
59
|
+
import { useQuery } from "@tanstack/react-query";
|
|
60
|
+
|
|
61
|
+
function ProductList() {
|
|
62
|
+
const api = useFluidApi();
|
|
63
|
+
|
|
64
|
+
const { data: products, isLoading } = useQuery({
|
|
65
|
+
queryKey: ["products"],
|
|
66
|
+
queryFn: () => api.products.list({ active: true }),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
if (isLoading) return <Spinner />;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<ul>
|
|
73
|
+
{products?.map((product) => <li key={product.id}>{product.name}</li>)}
|
|
74
|
+
</ul>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### useCurrentRep
|
|
80
|
+
|
|
81
|
+
Fetch the currently authenticated rep's profile:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { useCurrentRep } from "@fluid-app/rep-sdk";
|
|
85
|
+
|
|
86
|
+
function RepHeader() {
|
|
87
|
+
const { data: rep, isLoading } = useCurrentRep();
|
|
88
|
+
|
|
89
|
+
if (isLoading) return <Skeleton />;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div>
|
|
93
|
+
<Avatar src={rep?.avatar_url} />
|
|
94
|
+
<span>
|
|
95
|
+
{rep?.first_name} {rep?.last_name}
|
|
96
|
+
</span>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### useFluidProfile
|
|
103
|
+
|
|
104
|
+
Fetch the rep portal profile (themes, navigation, screens):
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import { useFluidProfile } from "@fluid-app/rep-sdk";
|
|
108
|
+
|
|
109
|
+
function Navigation() {
|
|
110
|
+
const { data: profile, isLoading } = useFluidProfile();
|
|
111
|
+
|
|
112
|
+
if (isLoading) return <Spinner />;
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<nav>
|
|
116
|
+
{profile?.navigation.navigation_items.map((item) => (
|
|
117
|
+
<NavItem key={item.id} item={item} />
|
|
118
|
+
))}
|
|
119
|
+
</nav>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### useFluidPermissions
|
|
125
|
+
|
|
126
|
+
Check user permissions with a convenient `can()` helper:
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { useFluidPermissions } from "@fluid-app/rep-sdk";
|
|
130
|
+
|
|
131
|
+
function TeamSettings() {
|
|
132
|
+
const { can, isSuperAdmin } = useFluidPermissions();
|
|
133
|
+
|
|
134
|
+
// Check if user can manage team
|
|
135
|
+
if (!can("team", "manage")) {
|
|
136
|
+
return <AccessDenied />;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<div>
|
|
141
|
+
<h1>Team Settings</h1>
|
|
142
|
+
{/* Only show delete button if user has delete permission */}
|
|
143
|
+
{can("team", "delete") && <DeleteTeamButton />}
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Available permission actions: `"view"`, `"create"`, `"update"`, `"delete"`, `"settings"`, `"add"`, `"manage"`, `"send"`
|
|
150
|
+
|
|
151
|
+
### useFluidTheme
|
|
152
|
+
|
|
153
|
+
Control theme settings:
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { useFluidTheme } from "@fluid-app/rep-sdk";
|
|
157
|
+
import type { Theme } from "@fluid-app/rep-sdk";
|
|
158
|
+
|
|
159
|
+
function ThemeSwitcher({ themes }: { themes: Theme[] }) {
|
|
160
|
+
const { currentTheme, setTheme, setThemeMode, mode } = useFluidTheme();
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<div>
|
|
164
|
+
<select
|
|
165
|
+
value={currentTheme?.name}
|
|
166
|
+
onChange={(e) => {
|
|
167
|
+
const theme = themes.find((t) => t.name === e.target.value);
|
|
168
|
+
if (theme) setTheme(theme);
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
{themes.map((theme) => (
|
|
172
|
+
<option key={theme.name} value={theme.name}>
|
|
173
|
+
{theme.name}
|
|
174
|
+
</option>
|
|
175
|
+
))}
|
|
176
|
+
</select>
|
|
177
|
+
|
|
178
|
+
<button onClick={() => setThemeMode(mode === "dark" ? "light" : "dark")}>
|
|
179
|
+
Toggle {mode === "dark" ? "Light" : "Dark"} Mode
|
|
180
|
+
</button>
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## API Client
|
|
187
|
+
|
|
188
|
+
The SDK provides a typed API client with methods for common operations:
|
|
189
|
+
|
|
190
|
+
### Products
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
const api = useFluidApi();
|
|
194
|
+
|
|
195
|
+
// List products with optional filters
|
|
196
|
+
const products = await api.products.list({
|
|
197
|
+
active: true,
|
|
198
|
+
page: 1,
|
|
199
|
+
per_page: 20,
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Get a single product
|
|
203
|
+
const product = await api.products.get("product-id");
|
|
204
|
+
|
|
205
|
+
// Search products
|
|
206
|
+
const results = await api.products.search("query");
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Orders
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
const api = useFluidApi();
|
|
213
|
+
|
|
214
|
+
// List orders
|
|
215
|
+
const orders = await api.orders.list({
|
|
216
|
+
status: "pending",
|
|
217
|
+
date_from: "2024-01-01",
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// Get a single order
|
|
221
|
+
const order = await api.orders.get("order-id");
|
|
222
|
+
|
|
223
|
+
// Create an order
|
|
224
|
+
const newOrder = await api.orders.create({
|
|
225
|
+
customer_id: "customer-id",
|
|
226
|
+
line_items: [{ product_id: "product-id", quantity: 2 }],
|
|
227
|
+
});
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Reps
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
const api = useFluidApi();
|
|
234
|
+
|
|
235
|
+
// Get current rep profile
|
|
236
|
+
const rep = await api.reps.current();
|
|
237
|
+
|
|
238
|
+
// Update profile
|
|
239
|
+
const updated = await api.reps.updateProfile({
|
|
240
|
+
first_name: "John",
|
|
241
|
+
last_name: "Doe",
|
|
242
|
+
});
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Analytics
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
const api = useFluidApi();
|
|
249
|
+
|
|
250
|
+
// Get dashboard data
|
|
251
|
+
const dashboard = await api.analytics.dashboard();
|
|
252
|
+
|
|
253
|
+
// Get sales data
|
|
254
|
+
const sales = await api.analytics.sales({
|
|
255
|
+
date_from: "2024-01-01",
|
|
256
|
+
date_to: "2024-12-31",
|
|
257
|
+
group_by: "month",
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Custom Requests
|
|
262
|
+
|
|
263
|
+
For endpoints not covered by the typed methods:
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
const api = useFluidApi();
|
|
267
|
+
|
|
268
|
+
// Generic GET request
|
|
269
|
+
const data = await api.get<MyType>("/custom/endpoint", { param: "value" });
|
|
270
|
+
|
|
271
|
+
// Generic POST request
|
|
272
|
+
const result = await api.post<MyType>("/custom/endpoint", { body: "data" });
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Providers
|
|
276
|
+
|
|
277
|
+
### FluidProvider
|
|
278
|
+
|
|
279
|
+
The main provider that sets up the SDK. It wraps:
|
|
280
|
+
|
|
281
|
+
- `QueryClientProvider` (TanStack Query)
|
|
282
|
+
- `FluidThemeProvider` (theme management)
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
import { FluidProvider } from "@fluid-app/rep-sdk";
|
|
286
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
287
|
+
|
|
288
|
+
// Optional: provide your own QueryClient
|
|
289
|
+
const queryClient = new QueryClient({
|
|
290
|
+
defaultOptions: {
|
|
291
|
+
queries: { staleTime: 5 * 60 * 1000 },
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
function App() {
|
|
296
|
+
return (
|
|
297
|
+
<FluidProvider
|
|
298
|
+
config={{
|
|
299
|
+
baseUrl: "https://api.fluid.app/api",
|
|
300
|
+
getAuthToken: () => getToken(),
|
|
301
|
+
}}
|
|
302
|
+
queryClient={queryClient}
|
|
303
|
+
initialTheme={defaultTheme}
|
|
304
|
+
>
|
|
305
|
+
<YourApp />
|
|
306
|
+
</FluidProvider>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### FluidThemeProvider
|
|
312
|
+
|
|
313
|
+
Can be used standalone if you need theme management without the full SDK:
|
|
314
|
+
|
|
315
|
+
```tsx
|
|
316
|
+
import { FluidThemeProvider, useFluidTheme } from "@fluid-app/rep-sdk";
|
|
317
|
+
|
|
318
|
+
function App() {
|
|
319
|
+
return (
|
|
320
|
+
<FluidThemeProvider initialTheme={myTheme}>
|
|
321
|
+
<ThemedContent />
|
|
322
|
+
</FluidThemeProvider>
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Theme CSS variables are applied to the document root (or a custom container) with the `--fluid-` prefix.
|
|
328
|
+
|
|
329
|
+
## Types
|
|
330
|
+
|
|
331
|
+
All types are exported for use in your application:
|
|
332
|
+
|
|
333
|
+
```tsx
|
|
334
|
+
import type {
|
|
335
|
+
// Core types
|
|
336
|
+
Profile,
|
|
337
|
+
Theme,
|
|
338
|
+
ThemeConfig,
|
|
339
|
+
Navigation,
|
|
340
|
+
NavigationItem,
|
|
341
|
+
ScreenDefinition,
|
|
342
|
+
|
|
343
|
+
// Permissions
|
|
344
|
+
UserPermissions,
|
|
345
|
+
Permissions,
|
|
346
|
+
PermissionAction,
|
|
347
|
+
ResourcePermissions,
|
|
348
|
+
|
|
349
|
+
// Rep
|
|
350
|
+
Rep,
|
|
351
|
+
UpdateRepData,
|
|
352
|
+
|
|
353
|
+
// API types
|
|
354
|
+
Product,
|
|
355
|
+
ProductListParams,
|
|
356
|
+
Order,
|
|
357
|
+
OrderListParams,
|
|
358
|
+
CreateOrderData,
|
|
359
|
+
DashboardData,
|
|
360
|
+
SalesData,
|
|
361
|
+
SalesParams,
|
|
362
|
+
|
|
363
|
+
// Client types
|
|
364
|
+
FluidSDKConfig,
|
|
365
|
+
FluidClient,
|
|
366
|
+
RequestOptions,
|
|
367
|
+
} from "@fluid-app/rep-sdk";
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Query Keys
|
|
371
|
+
|
|
372
|
+
Query keys are exported for cache invalidation and prefetching:
|
|
373
|
+
|
|
374
|
+
```tsx
|
|
375
|
+
import {
|
|
376
|
+
PROFILE_QUERY_KEY,
|
|
377
|
+
PERMISSIONS_QUERY_KEY,
|
|
378
|
+
CURRENT_REP_QUERY_KEY,
|
|
379
|
+
} from "@fluid-app/rep-sdk";
|
|
380
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
381
|
+
|
|
382
|
+
function RefreshButton() {
|
|
383
|
+
const queryClient = useQueryClient();
|
|
384
|
+
|
|
385
|
+
const handleRefresh = () => {
|
|
386
|
+
queryClient.invalidateQueries({ queryKey: PROFILE_QUERY_KEY });
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
return <button onClick={handleRefresh}>Refresh Profile</button>;
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Error Handling
|
|
394
|
+
|
|
395
|
+
The SDK provides an `ApiError` class for structured error handling:
|
|
396
|
+
|
|
397
|
+
```tsx
|
|
398
|
+
import { ApiError, isApiError } from "@fluid-app/rep-sdk";
|
|
399
|
+
|
|
400
|
+
try {
|
|
401
|
+
await api.orders.create(orderData);
|
|
402
|
+
} catch (error) {
|
|
403
|
+
if (isApiError(error)) {
|
|
404
|
+
console.log("Status:", error.status);
|
|
405
|
+
console.log("Message:", error.message);
|
|
406
|
+
console.log("Data:", error.data); // Server error details
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## License
|
|
412
|
+
|
|
413
|
+
Private - Fluid Commerce
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ContactsScreen-BYXF74BO.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkMEOOAMH2_cjs = require('./chunk-MEOOAMH2.cjs');
|
|
4
|
+
require('./chunk-DEQ3PBVX.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "ContactsScreen", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkMEOOAMH2_cjs.ContactsScreen; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "contactsScreenPropertySchema", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkMEOOAMH2_cjs.contactsScreenPropertySchema; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=ContactsScreen-XZOQJVFE.cjs.map
|
|
17
|
+
//# sourceMappingURL=ContactsScreen-XZOQJVFE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ContactsScreen-XZOQJVFE.cjs"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkMBUCXIUN_cjs = require('./chunk-MBUCXIUN.cjs');
|
|
4
|
+
require('./chunk-DEQ3PBVX.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "CustomersScreen", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkMBUCXIUN_cjs.CustomersScreen; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "customersScreenPropertySchema", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkMBUCXIUN_cjs.customersScreenPropertySchema; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=CustomersScreen-53SXRDDK.cjs.map
|
|
17
|
+
//# sourceMappingURL=CustomersScreen-53SXRDDK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"CustomersScreen-53SXRDDK.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"CustomersScreen-VS6LGULO.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"MessagingScreen-O42JEJMW.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkJZRNKSKT_cjs = require('./chunk-JZRNKSKT.cjs');
|
|
4
|
+
require('./chunk-DEQ3PBVX.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "MessagingScreen", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkJZRNKSKT_cjs.MessagingScreen; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "messagingScreenPropertySchema", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkJZRNKSKT_cjs.messagingScreenPropertySchema; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=MessagingScreen-UCVLYWZB.cjs.map
|
|
17
|
+
//# sourceMappingURL=MessagingScreen-UCVLYWZB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"MessagingScreen-UCVLYWZB.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"OrdersScreen-QQJFTTSS.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkYII3IXF4_cjs = require('./chunk-YII3IXF4.cjs');
|
|
4
|
+
require('./chunk-DEQ3PBVX.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "OrdersScreen", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkYII3IXF4_cjs.OrdersScreen; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ordersScreenPropertySchema", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkYII3IXF4_cjs.ordersScreenPropertySchema; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=OrdersScreen-WNT2WDLI.cjs.map
|
|
17
|
+
//# sourceMappingURL=OrdersScreen-WNT2WDLI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"OrdersScreen-WNT2WDLI.cjs"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQUVJ3R4T_cjs = require('./chunk-QUVJ3R4T.cjs');
|
|
4
|
+
require('./chunk-DEQ3PBVX.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "ProductsScreen", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkQUVJ3R4T_cjs.ProductsScreen; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "productsScreenPropertySchema", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkQUVJ3R4T_cjs.productsScreenPropertySchema; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=ProductsScreen-CTIAKS3Z.cjs.map
|
|
17
|
+
//# sourceMappingURL=ProductsScreen-CTIAKS3Z.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ProductsScreen-CTIAKS3Z.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ProductsScreen-TRIT2FE3.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CoreScreenPlaceholder } from './chunk-LO2HDG6C.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function ProductsScreen(_props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(CoreScreenPlaceholder, { name: "Products" });
|
|
6
|
+
}
|
|
7
|
+
var productsScreenPropertySchema = {
|
|
8
|
+
widgetType: "ProductsScreen",
|
|
9
|
+
displayName: "Products Screen",
|
|
10
|
+
tabsConfig: [{ id: "styling", label: "Styling" }],
|
|
11
|
+
fields: []
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { ProductsScreen, productsScreenPropertySchema };
|
|
15
|
+
//# sourceMappingURL=chunk-2AWTZV3T.js.map
|
|
16
|
+
//# sourceMappingURL=chunk-2AWTZV3T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/screens/ProductsScreen.tsx"],"names":[],"mappings":";;;AAmBO,SAAS,eAAe,MAAA,EAA6B;AAC1D,EAAA,uBAAO,GAAA,CAAC,qBAAA,EAAA,EAAsB,IAAA,EAAK,UAAA,EAAW,CAAA;AAChD;AAEO,IAAM,4BAAA,GAAqD;AAAA,EAChE,UAAA,EAAY,gBAAA;AAAA,EACZ,WAAA,EAAa,iBAAA;AAAA,EACb,YAAY,CAAC,EAAE,IAAI,SAAA,EAAW,KAAA,EAAO,WAAW,CAAA;AAAA,EAChD,QAAQ;AACV","file":"chunk-2AWTZV3T.js","sourcesContent":["import type { ComponentProps } from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { CoreScreenPlaceholder } from \"./CoreScreenPlaceholder\";\n\ntype ProductsScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function ProductsScreen(_props: ProductsScreenProps) {\n return <CoreScreenPlaceholder name=\"Products\" />;\n}\n\nexport const productsScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"ProductsScreen\",\n displayName: \"Products Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CoreScreenPlaceholder } from './chunk-LO2HDG6C.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function CustomersScreen(_props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(CoreScreenPlaceholder, { name: "Customers" });
|
|
6
|
+
}
|
|
7
|
+
var customersScreenPropertySchema = {
|
|
8
|
+
widgetType: "CustomersScreen",
|
|
9
|
+
displayName: "Customers Screen",
|
|
10
|
+
tabsConfig: [{ id: "styling", label: "Styling" }],
|
|
11
|
+
fields: []
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { CustomersScreen, customersScreenPropertySchema };
|
|
15
|
+
//# sourceMappingURL=chunk-CXRJSGO6.js.map
|
|
16
|
+
//# sourceMappingURL=chunk-CXRJSGO6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/screens/CustomersScreen.tsx"],"names":[],"mappings":";;;AAmBO,SAAS,gBAAgB,MAAA,EAA8B;AAC5D,EAAA,uBAAO,GAAA,CAAC,qBAAA,EAAA,EAAsB,IAAA,EAAK,WAAA,EAAY,CAAA;AACjD;AAEO,IAAM,6BAAA,GAAsD;AAAA,EACjE,UAAA,EAAY,iBAAA;AAAA,EACZ,WAAA,EAAa,kBAAA;AAAA,EACb,YAAY,CAAC,EAAE,IAAI,SAAA,EAAW,KAAA,EAAO,WAAW,CAAA;AAAA,EAChD,QAAQ;AACV","file":"chunk-CXRJSGO6.js","sourcesContent":["import type { ComponentProps } from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { CoreScreenPlaceholder } from \"./CoreScreenPlaceholder\";\n\ntype CustomersScreenProps = ComponentProps<\"div\"> & {\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CustomersScreen(_props: CustomersScreenProps) {\n return <CoreScreenPlaceholder name=\"Customers\" />;\n}\n\nexport const customersScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"CustomersScreen\",\n displayName: \"Customers Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
function CoreScreenPlaceholder({ name }) {
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-[400px] items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-sm rounded-lg border border-dashed border-gray-300 p-8 text-center dark:border-gray-700", children: [
|
|
20
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100", children: name }),
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-gray-500 dark:text-gray-400", children: "This screen is provided by Fluid Commerce" }),
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-gray-400 dark:text-gray-500", children: "Connect to the Fluid platform to enable this feature" })
|
|
23
|
+
] }) });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.CoreScreenPlaceholder = CoreScreenPlaceholder;
|
|
27
|
+
exports.__reExport = __reExport;
|
|
28
|
+
//# sourceMappingURL=chunk-DEQ3PBVX.cjs.map
|
|
29
|
+
//# sourceMappingURL=chunk-DEQ3PBVX.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/screens/CoreScreenPlaceholder.tsx"],"names":["jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;AAIO,SAAS,qBAAA,CAAsB,EAAE,IAAA,EAAK,EAA8B;AACzE,EAAA,sCACG,KAAA,EAAA,EAAI,SAAA,EAAU,kDACb,QAAA,kBAAAA,eAAA,CAAC,KAAA,EAAA,EAAI,WAAU,+FAAA,EACb,QAAA,EAAA;AAAA,oBAAAC,cAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,wDAAA,EACX,QAAA,EAAA,IAAA,EACH,CAAA;AAAA,oBACAA,cAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,uCAAA,EAAwC,QAAA,EAAA,2CAAA,EAErD,CAAA;AAAA,oBACAA,cAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,+CAAA,EAAgD,QAAA,EAAA,sDAAA,EAE7D;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"chunk-DEQ3PBVX.cjs","sourcesContent":["/**\n * Internal placeholder component for core screens provided by Fluid Commerce.\n * This is NOT exported from the SDK — it's shared between core screen files.\n */\nexport function CoreScreenPlaceholder({ name }: { readonly name: string }) {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"max-w-sm rounded-lg border border-dashed border-gray-300 p-8 text-center dark:border-gray-700\">\n <h2 className=\"text-xl font-semibold text-gray-900 dark:text-gray-100\">\n {name}\n </h2>\n <p className=\"mt-2 text-gray-500 dark:text-gray-400\">\n This screen is provided by Fluid Commerce\n </p>\n <p className=\"mt-1 text-sm text-gray-400 dark:text-gray-500\">\n Connect to the Fluid platform to enable this feature\n </p>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkDEQ3PBVX_cjs = require('./chunk-DEQ3PBVX.cjs');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
function MessagingScreen(_props) {
|
|
7
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkDEQ3PBVX_cjs.CoreScreenPlaceholder, { name: "Messaging" });
|
|
8
|
+
}
|
|
9
|
+
var messagingScreenPropertySchema = {
|
|
10
|
+
widgetType: "MessagingScreen",
|
|
11
|
+
displayName: "Messaging Screen",
|
|
12
|
+
tabsConfig: [{ id: "styling", label: "Styling" }],
|
|
13
|
+
fields: []
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.MessagingScreen = MessagingScreen;
|
|
17
|
+
exports.messagingScreenPropertySchema = messagingScreenPropertySchema;
|
|
18
|
+
//# sourceMappingURL=chunk-JZRNKSKT.cjs.map
|
|
19
|
+
//# sourceMappingURL=chunk-JZRNKSKT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/screens/MessagingScreen.tsx"],"names":["jsx","CoreScreenPlaceholder"],"mappings":";;;;;AAwBO,SAAS,gBAAgB,MAAA,EAA8B;AAC5D,EAAA,uBAAOA,cAAA,CAACC,uCAAA,EAAA,EAAsB,IAAA,EAAK,WAAA,EAAY,CAAA;AACjD;AAEO,IAAM,6BAAA,GAAsD;AAAA,EACjE,UAAA,EAAY,iBAAA;AAAA,EACZ,WAAA,EAAa,kBAAA;AAAA,EACb,YAAY,CAAC,EAAE,IAAI,SAAA,EAAW,KAAA,EAAO,WAAW,CAAA;AAAA,EAChD,QAAQ;AACV","file":"chunk-JZRNKSKT.cjs","sourcesContent":["import type { ComponentProps } from \"react\";\nimport type {\n BackgroundValue,\n BorderRadiusOptions,\n ColorOptions,\n PaddingOptions,\n} from \"../types\";\nimport type { WidgetPropertySchema } from \"../registries/property-schema-types\";\nimport { CoreScreenPlaceholder } from \"./CoreScreenPlaceholder\";\n\ntype MessagingScreenProps = ComponentProps<\"div\"> & {\n // Styling\n background?: BackgroundValue;\n textColor?: ColorOptions;\n accentColor?: ColorOptions;\n padding?: PaddingOptions;\n borderRadius?: BorderRadiusOptions;\n\n // Callbacks\n onConversationSelect?: (conversationId: string) => void;\n onSendMessage?: (conversationId: string, message: string) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function MessagingScreen(_props: MessagingScreenProps) {\n return <CoreScreenPlaceholder name=\"Messaging\" />;\n}\n\nexport const messagingScreenPropertySchema: WidgetPropertySchema = {\n widgetType: \"MessagingScreen\",\n displayName: \"Messaging Screen\",\n tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n fields: [],\n} as const satisfies WidgetPropertySchema;\n"]}
|