funuicss 3.7.15 → 3.8.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/css/fun.css +560 -203
- package/demo/theme.tsx +1311 -0
- package/index.d.ts +3 -0
- package/index.js +7 -1
- package/package.json +1 -1
- package/ui/button/Button.d.ts +2 -1
- package/ui/button/Button.js +3 -3
- package/ui/components/ImageScaler.d.ts +6 -0
- package/ui/components/ImageScaler.js +17 -0
- package/ui/div/Div.d.ts +3 -1
- package/ui/div/Div.js +2 -2
- package/ui/empty/Empty.d.ts +17 -0
- package/ui/empty/Empty.js +66 -0
- package/ui/feature/Feature.d.ts +130 -0
- package/ui/feature/Feature.js +380 -0
- package/ui/flex/Flex.d.ts +2 -1
- package/ui/flex/Flex.js +3 -3
- package/ui/footer/Footer.d.ts +1 -0
- package/ui/footer/Footer.js +6 -1
- package/ui/icons/Dynamic.d.ts +12 -0
- package/ui/icons/Dynamic.js +163 -0
- package/ui/modal/Modal.d.ts +1 -1
- package/ui/products/CartModal.d.ts +20 -0
- package/ui/products/CartModal.js +85 -0
- package/ui/products/ProductCard.d.ts +13 -0
- package/ui/products/ProductCard.js +56 -0
- package/ui/products/ProductDetail.d.ts +14 -0
- package/ui/products/ProductDetail.js +249 -0
- package/ui/products/ProductDetailModal.d.ts +17 -0
- package/ui/products/ProductDetailModal.js +99 -0
- package/ui/products/Products.d.ts +60 -0
- package/ui/products/Products.js +312 -0
- package/ui/products/Store.d.ts +99 -0
- package/ui/products/Store.js +515 -0
- package/ui/sidebar/SideBar.d.ts +3 -1
- package/ui/sidebar/SideBar.js +50 -11
- package/ui/specials/Circle.d.ts +2 -1
- package/ui/specials/Circle.js +2 -2
- package/ui/table/Table.d.ts +15 -1
- package/ui/table/Table.js +143 -15
- package/ui/theme/theme.d.ts +91 -0
- package/ui/theme/theme.js +468 -25
- package/ui/vista/Vista.js +8 -12
- package/utils/Buckets.d.ts +0 -0
- package/utils/Buckets.js +1 -0
package/ui/specials/Circle.js
CHANGED
|
@@ -59,7 +59,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
exports.default = Circle;
|
|
60
60
|
var React = __importStar(require("react"));
|
|
61
61
|
function Circle(_a) {
|
|
62
|
-
var _b = _a.size, size = _b === void 0 ? 2 : _b, funcss = _a.funcss, bg = _a.bg, color = _a.color, children = _a.children, hoverable = _a.hoverable, raised = _a.raised, key = _a.key, onClick = _a.onClick, _c = _a.className, className = _c === void 0 ? '' : _c, bordered = _a.bordered, style = _a.style, rest = __rest(_a, ["size", "funcss", "bg", "color", "children", "hoverable", "raised", "key", "onClick", "className", "bordered", "style"]);
|
|
62
|
+
var _b = _a.size, size = _b === void 0 ? 2 : _b, funcss = _a.funcss, bg = _a.bg, color = _a.color, children = _a.children, hoverable = _a.hoverable, raised = _a.raised, key = _a.key, onClick = _a.onClick, _c = _a.className, className = _c === void 0 ? '' : _c, bordered = _a.bordered, body = _a.body, style = _a.style, rest = __rest(_a, ["size", "funcss", "bg", "color", "children", "hoverable", "raised", "key", "onClick", "className", "bordered", "body", "style"]);
|
|
63
63
|
return (React.createElement("div", __assign({ className: " ".concat(className, " animated fade-in ").concat(bordered ? "border" : "", " pointer avatar ").concat(funcss || '', " ").concat("text-" + (color === null || color === void 0 ? void 0 : color.trim()) || '', " ").concat(raised ? "raised" : '', " ").concat(bg || 'lighter', " ").concat(hoverable ? 'hoverable' : ''), style: __assign({ width: "".concat(size + "rem" || '2.3rem'), height: "".concat(size + "rem" || '2.3rem') }, style), key: key, onClick: onClick }, rest),
|
|
64
|
-
React.createElement(React.Fragment, null, children)));
|
|
64
|
+
React.createElement(React.Fragment, null, body || children)));
|
|
65
65
|
}
|
package/ui/table/Table.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
type ColumnConfig = {
|
|
3
|
+
field: string;
|
|
4
|
+
title: string;
|
|
5
|
+
width?: string | number;
|
|
6
|
+
minWidth?: string | number;
|
|
7
|
+
maxWidth?: string | number;
|
|
8
|
+
className?: string;
|
|
9
|
+
cellClassName?: string;
|
|
10
|
+
textWrap?: boolean;
|
|
11
|
+
headerClassName?: string;
|
|
12
|
+
};
|
|
2
13
|
type TableProps = {
|
|
3
14
|
children?: React.ReactNode;
|
|
4
15
|
funcss?: string;
|
|
@@ -17,6 +28,7 @@ type TableProps = {
|
|
|
17
28
|
"data": any[];
|
|
18
29
|
"titles": string[];
|
|
19
30
|
"funcss": string[];
|
|
31
|
+
"columns"?: ColumnConfig[];
|
|
20
32
|
};
|
|
21
33
|
filterOnchange?: (filter?: any, value?: any, totals?: number) => {};
|
|
22
34
|
clearSearch?: boolean;
|
|
@@ -38,8 +50,10 @@ type TableProps = {
|
|
|
38
50
|
filterableFields?: string[];
|
|
39
51
|
prioritizeSearchFields?: string[];
|
|
40
52
|
onRowClick?: (data: any) => void;
|
|
53
|
+
columns?: ColumnConfig[];
|
|
41
54
|
};
|
|
42
55
|
export default function Table({ children, funcss, bordered, noStripped, hoverable, title, showTotal, light, dark, head, body, data, isLoading, right, hideExport, height, pageSize, // Default page size,
|
|
43
56
|
customColumns, filterableFields, // New prop
|
|
44
|
-
emptyResponse, filterOnchange, clearSearch, prioritizeSearchFields, onRowClick, trCss,
|
|
57
|
+
emptyResponse, filterOnchange, clearSearch, prioritizeSearchFields, onRowClick, trCss, columns, // New columns prop
|
|
58
|
+
...rest }: TableProps): React.JSX.Element;
|
|
45
59
|
export {};
|
package/ui/table/Table.js
CHANGED
|
@@ -89,7 +89,8 @@ function Table(_a) {
|
|
|
89
89
|
var _b, _c;
|
|
90
90
|
var children = _a.children, funcss = _a.funcss, bordered = _a.bordered, noStripped = _a.noStripped, hoverable = _a.hoverable, _d = _a.title, title = _d === void 0 ? "" : _d, showTotal = _a.showTotal, light = _a.light, dark = _a.dark, head = _a.head, body = _a.body, data = _a.data, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, right = _a.right, hideExport = _a.hideExport, height = _a.height, _f = _a.pageSize, pageSize = _f === void 0 ? data ? 10 : 0 : _f, // Default page size,
|
|
91
91
|
customColumns = _a.customColumns, filterableFields = _a.filterableFields, // New prop
|
|
92
|
-
emptyResponse = _a.emptyResponse, filterOnchange = _a.filterOnchange, clearSearch = _a.clearSearch, _g = _a.prioritizeSearchFields, prioritizeSearchFields = _g === void 0 ? [] : _g, onRowClick = _a.onRowClick, trCss = _a.trCss,
|
|
92
|
+
emptyResponse = _a.emptyResponse, filterOnchange = _a.filterOnchange, clearSearch = _a.clearSearch, _g = _a.prioritizeSearchFields, prioritizeSearchFields = _g === void 0 ? [] : _g, onRowClick = _a.onRowClick, trCss = _a.trCss, columns = _a.columns, // New columns prop
|
|
93
|
+
rest = __rest(_a, ["children", "funcss", "bordered", "noStripped", "hoverable", "title", "showTotal", "light", "dark", "head", "body", "data", "isLoading", "right", "hideExport", "height", "pageSize", "customColumns", "filterableFields", "emptyResponse", "filterOnchange", "clearSearch", "prioritizeSearchFields", "onRowClick", "trCss", "columns"]);
|
|
93
94
|
// Check if data is null or undefined before accessing its properties
|
|
94
95
|
// Replace this in your component
|
|
95
96
|
var _h = (0, react_1.useState)(''), search = _h[0], setSearch = _h[1];
|
|
@@ -180,6 +181,70 @@ function Table(_a) {
|
|
|
180
181
|
filterOnchange(selectedField, selectedValue, filteredData.length);
|
|
181
182
|
}
|
|
182
183
|
}, [selectedField, selectedValue]);
|
|
184
|
+
// Helper function to get column configuration for a specific index
|
|
185
|
+
var getColumnConfig = function (index) {
|
|
186
|
+
if (columns && columns[index]) {
|
|
187
|
+
return columns[index];
|
|
188
|
+
}
|
|
189
|
+
if ((data === null || data === void 0 ? void 0 : data.columns) && data.columns[index]) {
|
|
190
|
+
return data.columns[index];
|
|
191
|
+
}
|
|
192
|
+
return undefined;
|
|
193
|
+
};
|
|
194
|
+
// Helper function to generate grid template columns
|
|
195
|
+
var generateGridTemplateColumns = function () {
|
|
196
|
+
var _a;
|
|
197
|
+
// First, try to use the explicit columns prop
|
|
198
|
+
if (columns && columns.length > 0) {
|
|
199
|
+
return columns.map(function (col) {
|
|
200
|
+
return typeof col.width === 'number' ? "".concat(col.width, "px") :
|
|
201
|
+
col.width || '1fr';
|
|
202
|
+
}).join(' ');
|
|
203
|
+
}
|
|
204
|
+
// Then, try to use columns from data
|
|
205
|
+
if ((data === null || data === void 0 ? void 0 : data.columns) && data.columns.length > 0) {
|
|
206
|
+
return data.columns.map(function (col) {
|
|
207
|
+
return typeof col.width === 'number' ? "".concat(col.width, "px") :
|
|
208
|
+
col.width || '1fr';
|
|
209
|
+
}).join(' ');
|
|
210
|
+
}
|
|
211
|
+
// For custom columns, we need to add their widths too
|
|
212
|
+
if (customColumns && customColumns.length > 0) {
|
|
213
|
+
var totalColumns = (((_a = data === null || data === void 0 ? void 0 : data.fields) === null || _a === void 0 ? void 0 : _a.length) || 0) + customColumns.length;
|
|
214
|
+
return Array(totalColumns).fill('1fr').join(' ');
|
|
215
|
+
}
|
|
216
|
+
// Default fallback
|
|
217
|
+
if (data === null || data === void 0 ? void 0 : data.fields) {
|
|
218
|
+
return data.fields.map(function () { return '1fr'; }).join(' ');
|
|
219
|
+
}
|
|
220
|
+
return '1fr';
|
|
221
|
+
};
|
|
222
|
+
// Helper function to get column width for a specific index
|
|
223
|
+
var getColumnWidth = function (index) {
|
|
224
|
+
var col = getColumnConfig(index);
|
|
225
|
+
if (col === null || col === void 0 ? void 0 : col.width) {
|
|
226
|
+
return typeof col.width === 'number' ? "".concat(col.width, "px") : col.width;
|
|
227
|
+
}
|
|
228
|
+
return 'auto';
|
|
229
|
+
};
|
|
230
|
+
// Helper function to get column min-width for a specific index
|
|
231
|
+
var getColumnMinWidth = function (index) {
|
|
232
|
+
var col = getColumnConfig(index);
|
|
233
|
+
if (col === null || col === void 0 ? void 0 : col.minWidth) {
|
|
234
|
+
return typeof col.minWidth === 'number' ? "".concat(col.minWidth, "px") : col.minWidth;
|
|
235
|
+
}
|
|
236
|
+
return '80px';
|
|
237
|
+
};
|
|
238
|
+
// Helper function to get column max-width for a specific index
|
|
239
|
+
var getColumnMaxWidth = function (index) {
|
|
240
|
+
var col = getColumnConfig(index);
|
|
241
|
+
if (col === null || col === void 0 ? void 0 : col.maxWidth) {
|
|
242
|
+
return typeof col.maxWidth === 'number' ? "".concat(col.maxWidth, "px") : col.maxWidth;
|
|
243
|
+
}
|
|
244
|
+
return 'none';
|
|
245
|
+
};
|
|
246
|
+
// Generate grid template columns string
|
|
247
|
+
var gridTemplateColumns = generateGridTemplateColumns();
|
|
183
248
|
return (React.createElement("div", { className: "".concat(funcss ? funcss : '', " roundEdge") },
|
|
184
249
|
data &&
|
|
185
250
|
React.createElement("div", { className: "pr-4 pl-4 pt-2 pb-2 lighter tableHeader mb-2", style: { overflow: "show" } },
|
|
@@ -257,36 +322,99 @@ function Table(_a) {
|
|
|
257
322
|
React.createElement("div", __assign({ className: "table-grid ".concat(bordered ? 'bordered' : '', " ").concat(noStripped ? '' : 'stripped', " ").concat(hoverable ? 'hoverableTr' : '', " ").concat(light ? 'light' : '', " ").concat(dark ? 'dark' : ''), style: {
|
|
258
323
|
height: height ? height + "px" : "",
|
|
259
324
|
position: 'relative',
|
|
260
|
-
zIndex: 1
|
|
325
|
+
zIndex: 1,
|
|
326
|
+
// Set grid template columns on the main container for consistency
|
|
327
|
+
gridTemplateColumns: gridTemplateColumns
|
|
261
328
|
} }, rest),
|
|
262
|
-
data && (data === null || data === void 0 ? void 0 : data.titles) && (React.createElement("div", { className: "table-head"
|
|
329
|
+
data && (data === null || data === void 0 ? void 0 : data.titles) && (React.createElement("div", { className: "table-head", style: {
|
|
330
|
+
// Match the grid template columns
|
|
331
|
+
gridTemplateColumns: gridTemplateColumns
|
|
332
|
+
} }, data.titles.map(function (mdoc, index) {
|
|
333
|
+
var colConfig = getColumnConfig(index);
|
|
334
|
+
return (React.createElement("div", { key: mdoc, className: "table-header text-secondary ".concat((colConfig === null || colConfig === void 0 ? void 0 : colConfig.headerClassName) || '', " ").concat(index === 0 ? "first_table_data" : "", " ").concat(index === data.titles.length - 1 ? "last_table_data" : ""), "data-label": mdoc, style: {
|
|
335
|
+
// Apply column-specific styles
|
|
336
|
+
minWidth: getColumnMinWidth(index),
|
|
337
|
+
maxWidth: getColumnMaxWidth(index),
|
|
338
|
+
width: getColumnWidth(index),
|
|
339
|
+
overflow: 'hidden',
|
|
340
|
+
whiteSpace: 'nowrap',
|
|
341
|
+
textOverflow: 'ellipsis'
|
|
342
|
+
} }, mdoc));
|
|
343
|
+
}))),
|
|
263
344
|
head && React.createElement("div", { className: "table-head" }, head),
|
|
264
|
-
React.createElement("div", { className: "table-body"
|
|
345
|
+
React.createElement("div", { className: "table-body", style: {
|
|
346
|
+
// Match the grid template columns
|
|
347
|
+
gridTemplateColumns: gridTemplateColumns
|
|
348
|
+
} },
|
|
265
349
|
body && body,
|
|
266
350
|
data &&
|
|
267
351
|
(function () {
|
|
268
352
|
var results = (0, Query_1.getAdvancedFilteredData)(filteredData, searchQuery, data, getNestedValue, prioritizeSearchFields);
|
|
269
353
|
var shouldSlice = !searchQuery || results.length > 10;
|
|
270
|
-
return (shouldSlice ? results.slice(startIndex, endIndex) : results).map(function (mdoc, index) { return (React.createElement("div", { className: "table-row animated slide-up ".concat(trCss), key: index, onClick: onRowClick ? function () { return onRowClick(mdoc); } : undefined
|
|
354
|
+
return (shouldSlice ? results.slice(startIndex, endIndex) : results).map(function (mdoc, index) { return (React.createElement("div", { className: "table-row animated slide-up ".concat(trCss), key: index, onClick: onRowClick ? function () { return onRowClick(mdoc); } : undefined, style: {
|
|
355
|
+
// Match the grid template columns
|
|
356
|
+
gridTemplateColumns: gridTemplateColumns
|
|
357
|
+
} },
|
|
271
358
|
data.fields.map(function (fdoc, findex) {
|
|
272
359
|
var _a, _b;
|
|
273
|
-
|
|
360
|
+
var colConfig = getColumnConfig(findex);
|
|
361
|
+
var cellContent = getNestedValue(mdoc, fdoc);
|
|
362
|
+
return (React.createElement("div", { key: fdoc, className: "table-cell ".concat(data.funcss ? ((_a = data === null || data === void 0 ? void 0 : data.funcss) === null || _a === void 0 ? void 0 : _a[findex]) || "" : "", " ").concat((colConfig === null || colConfig === void 0 ? void 0 : colConfig.cellClassName) || '', " ").concat((colConfig === null || colConfig === void 0 ? void 0 : colConfig.textWrap) ? 'wrap' : 'truncate'), "data-label": ((_b = data.titles) === null || _b === void 0 ? void 0 : _b[findex]) || fdoc, style: {
|
|
363
|
+
overflow: "visible",
|
|
364
|
+
// Apply column-specific styles to match header
|
|
365
|
+
minWidth: getColumnMinWidth(findex),
|
|
366
|
+
maxWidth: getColumnMaxWidth(findex),
|
|
367
|
+
width: getColumnWidth(findex),
|
|
368
|
+
// Text handling based on column config
|
|
369
|
+
whiteSpace: (colConfig === null || colConfig === void 0 ? void 0 : colConfig.textWrap) ? 'normal' : 'nowrap',
|
|
370
|
+
overflowWrap: (colConfig === null || colConfig === void 0 ? void 0 : colConfig.textWrap) ? 'break-word' : 'normal',
|
|
371
|
+
textOverflow: (colConfig === null || colConfig === void 0 ? void 0 : colConfig.textWrap) ? 'clip' : 'ellipsis'
|
|
372
|
+
} }, cellContent));
|
|
274
373
|
}),
|
|
275
374
|
customColumns
|
|
276
|
-
? customColumns.map(function (column, columnIndex) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
React.createElement("div", { style: {
|
|
375
|
+
? customColumns.map(function (column, columnIndex) {
|
|
376
|
+
var _a;
|
|
377
|
+
// Calculate index for custom column (after regular data fields)
|
|
378
|
+
var colIndex = (((_a = data === null || data === void 0 ? void 0 : data.fields) === null || _a === void 0 ? void 0 : _a.length) || 0) + columnIndex;
|
|
379
|
+
return (React.createElement("div", { key: columnIndex, className: "table-cell", "data-label": column.title || "Action", style: {
|
|
281
380
|
position: "relative",
|
|
282
381
|
overflow: "visible",
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
382
|
+
// Apply column-specific styles
|
|
383
|
+
minWidth: getColumnMinWidth(colIndex),
|
|
384
|
+
maxWidth: getColumnMaxWidth(colIndex),
|
|
385
|
+
width: getColumnWidth(colIndex)
|
|
386
|
+
} },
|
|
387
|
+
React.createElement("div", { style: {
|
|
388
|
+
position: "relative",
|
|
389
|
+
overflow: "visible",
|
|
390
|
+
zIndex: 50,
|
|
391
|
+
} }, column.render && column.render(mdoc)),
|
|
392
|
+
column.onClick && (React.createElement(Button_1.default, { onClick: function () { return column.onClick && column.onClick(mdoc); } }, column.title))));
|
|
393
|
+
})
|
|
286
394
|
: "")); });
|
|
287
395
|
})(),
|
|
288
396
|
isLoading &&
|
|
289
|
-
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function (_, index) { return (React.createElement("div", { key: index, className: "table-row skeleton"
|
|
397
|
+
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function (_, index) { return (React.createElement("div", { key: index, className: "table-row skeleton", style: {
|
|
398
|
+
// Match the grid template columns
|
|
399
|
+
gridTemplateColumns: gridTemplateColumns
|
|
400
|
+
} }, data === null || data === void 0 ? void 0 :
|
|
401
|
+
data.fields.map(function (_, cellIndex) {
|
|
402
|
+
return (React.createElement("div", { key: cellIndex, className: "table-cell", style: {
|
|
403
|
+
// Apply column-specific styles to match headers
|
|
404
|
+
minWidth: getColumnMinWidth(cellIndex),
|
|
405
|
+
maxWidth: getColumnMaxWidth(cellIndex),
|
|
406
|
+
width: getColumnWidth(cellIndex)
|
|
407
|
+
} }));
|
|
408
|
+
}),
|
|
409
|
+
customColumns && customColumns.map(function (_, customIndex) {
|
|
410
|
+
var _a;
|
|
411
|
+
var colIndex = (((_a = data === null || data === void 0 ? void 0 : data.fields) === null || _a === void 0 ? void 0 : _a.length) || 0) + customIndex;
|
|
412
|
+
return (React.createElement("div", { key: "skeleton-custom-".concat(customIndex), className: "table-cell", style: {
|
|
413
|
+
minWidth: getColumnMinWidth(colIndex),
|
|
414
|
+
maxWidth: getColumnMaxWidth(colIndex),
|
|
415
|
+
width: getColumnWidth(colIndex)
|
|
416
|
+
} }));
|
|
417
|
+
}))); }),
|
|
290
418
|
children ? children : ""),
|
|
291
419
|
filteredData.length === 0 && !isLoading && !children && (React.createElement("div", { className: "table-empty" },
|
|
292
420
|
React.createElement("div", { className: "empty-icon" }, (emptyResponse === null || emptyResponse === void 0 ? void 0 : emptyResponse.icon) || React.createElement(pi_1.PiEmpty, { size: 30, className: "text-error" })),
|
package/ui/theme/theme.d.ts
CHANGED
|
@@ -8,6 +8,64 @@ interface Variable {
|
|
|
8
8
|
name: string;
|
|
9
9
|
value: any;
|
|
10
10
|
}
|
|
11
|
+
export interface BucketField {
|
|
12
|
+
name: string;
|
|
13
|
+
label: string;
|
|
14
|
+
type: string;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
options?: string[];
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface Bucket {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
category?: string;
|
|
26
|
+
fields: BucketField[];
|
|
27
|
+
createdBy: string;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
updatedAt: number;
|
|
30
|
+
updatedBy: string;
|
|
31
|
+
recordCount: number;
|
|
32
|
+
jsonFilesCount: number;
|
|
33
|
+
totalRecordsInJson: number;
|
|
34
|
+
lastJsonExport?: number;
|
|
35
|
+
userId?: string;
|
|
36
|
+
createdAtString?: string;
|
|
37
|
+
updatedAtString?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface BucketRecord {
|
|
40
|
+
id: string;
|
|
41
|
+
values: Record<string, any>;
|
|
42
|
+
createdBy: string;
|
|
43
|
+
createdAt: number;
|
|
44
|
+
updatedAt: number;
|
|
45
|
+
updatedBy: string;
|
|
46
|
+
}
|
|
47
|
+
export interface JsonFileMetadata {
|
|
48
|
+
page: number;
|
|
49
|
+
totalPages: number;
|
|
50
|
+
recordsInPage: number;
|
|
51
|
+
totalRecords: number;
|
|
52
|
+
exportedAt: string;
|
|
53
|
+
recordsPerFile: number;
|
|
54
|
+
projectId: string;
|
|
55
|
+
bucketId: string;
|
|
56
|
+
bucketName: string;
|
|
57
|
+
}
|
|
58
|
+
export interface JsonFileData {
|
|
59
|
+
metadata: JsonFileMetadata;
|
|
60
|
+
records: BucketRecord[];
|
|
61
|
+
}
|
|
62
|
+
export interface JsonFileInfo {
|
|
63
|
+
name: string;
|
|
64
|
+
fullPath: string;
|
|
65
|
+
url: string;
|
|
66
|
+
size: number;
|
|
67
|
+
page: number;
|
|
68
|
+
}
|
|
11
69
|
interface ProjectData {
|
|
12
70
|
theme_config?: {
|
|
13
71
|
colors?: Record<string, string>;
|
|
@@ -18,6 +76,7 @@ interface ProjectData {
|
|
|
18
76
|
default_variation?: ThemeVariant;
|
|
19
77
|
variables?: Variable[];
|
|
20
78
|
assets?: Asset[];
|
|
79
|
+
buckets?: any[];
|
|
21
80
|
name?: string;
|
|
22
81
|
project_id?: string;
|
|
23
82
|
version?: number;
|
|
@@ -34,6 +93,7 @@ interface ThemeProviderProps {
|
|
|
34
93
|
funcss?: string;
|
|
35
94
|
minHeight?: string;
|
|
36
95
|
children: ReactNode;
|
|
96
|
+
project?: ProjectData | null;
|
|
37
97
|
}
|
|
38
98
|
interface ThemeContextType {
|
|
39
99
|
variant: ThemeVariant;
|
|
@@ -43,6 +103,7 @@ interface ThemeContextType {
|
|
|
43
103
|
isLoading: boolean;
|
|
44
104
|
isInitialLoad: boolean;
|
|
45
105
|
error: string | null;
|
|
106
|
+
projectId?: string;
|
|
46
107
|
}
|
|
47
108
|
export declare const useTheme: () => ThemeContextType;
|
|
48
109
|
export declare const useVariant: () => {
|
|
@@ -95,3 +156,33 @@ export declare const useImageAssets: () => Asset[];
|
|
|
95
156
|
export declare const useVideoAssets: () => Asset[];
|
|
96
157
|
export declare const useAudioAssets: () => Asset[];
|
|
97
158
|
export declare const useDocumentAssets: () => Asset[];
|
|
159
|
+
export declare const useBuckets: () => Bucket[];
|
|
160
|
+
export declare const useBucket: (bucketIdOrName: string) => Bucket | undefined;
|
|
161
|
+
export declare const useBucketsByCategory: (category: string) => Bucket[];
|
|
162
|
+
export declare const useBucketJsonFiles: (bucketIdOrName: string) => {
|
|
163
|
+
files: JsonFileInfo[];
|
|
164
|
+
loading: boolean;
|
|
165
|
+
error: string | null;
|
|
166
|
+
refresh: () => Promise<void>;
|
|
167
|
+
};
|
|
168
|
+
export declare const usePaginatedRecords: (bucketIdOrName: string, page: number, pageSize?: number) => {
|
|
169
|
+
records: BucketRecord[];
|
|
170
|
+
metadata: JsonFileMetadata | null;
|
|
171
|
+
loading: boolean;
|
|
172
|
+
error: string | null;
|
|
173
|
+
refresh: () => Promise<void>;
|
|
174
|
+
};
|
|
175
|
+
export declare const useAllJsonRecords: (bucketIdOrName: string) => {
|
|
176
|
+
records: BucketRecord[];
|
|
177
|
+
loading: boolean;
|
|
178
|
+
error: string | null;
|
|
179
|
+
refresh: () => Promise<void>;
|
|
180
|
+
};
|
|
181
|
+
export declare const useBucketCache: () => {
|
|
182
|
+
clearCache: (bucketIdOrName?: string) => void;
|
|
183
|
+
refresh: () => void;
|
|
184
|
+
};
|
|
185
|
+
export declare const getPaginatedRecords: (bucketIdOrName: string, page: number, pageSize?: number) => Promise<{
|
|
186
|
+
records: BucketRecord[];
|
|
187
|
+
metadata: JsonFileMetadata | null;
|
|
188
|
+
}>;
|