@jmruthers/pace-core 0.5.71 → 0.5.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataTable-V3RFYBBB.js → DataTable-INW5YIFV.js} +7 -5
- package/dist/UnifiedAuthProvider-6SYT5WFN.js +14 -0
- package/dist/UnifiedAuthProvider-6SYT5WFN.js.map +1 -0
- package/dist/{chunk-67FGPOHX.js → chunk-2PRPDH66.js} +6 -4
- package/dist/{chunk-67FGPOHX.js.map → chunk-2PRPDH66.js.map} +1 -1
- package/dist/chunk-3SP4P7NS.js +82 -0
- package/dist/chunk-3SP4P7NS.js.map +1 -0
- package/dist/{chunk-BUM2ZPYC.js → chunk-43C63KLH.js} +4 -4
- package/dist/{chunk-VLFIYM6B.js → chunk-5A4RL4BC.js} +72 -67
- package/dist/chunk-5A4RL4BC.js.map +1 -0
- package/dist/{chunk-2NWIXRSB.js → chunk-BYG6OSTC.js} +97 -48
- package/dist/chunk-BYG6OSTC.js.map +1 -0
- package/dist/{chunk-6RBH67W7.js → chunk-CDDYJCYU.js} +2 -77
- package/dist/chunk-CDDYJCYU.js.map +1 -0
- package/dist/{chunk-XC4ZCSO4.js → chunk-F24P24TZ.js} +6 -4
- package/dist/{chunk-XC4ZCSO4.js.map → chunk-F24P24TZ.js.map} +1 -1
- package/dist/{chunk-4CET7YQI.js → chunk-GBC5PC3N.js} +9 -945
- package/dist/chunk-GBC5PC3N.js.map +1 -0
- package/dist/{chunk-GDIBOLKV.js → chunk-LANO5IFV.js} +6 -4
- package/dist/{chunk-GDIBOLKV.js.map → chunk-LANO5IFV.js.map} +1 -1
- package/dist/{chunk-C353TCFY.js → chunk-M4UMXYNK.js} +2 -2
- package/dist/chunk-RJNE764D.js +953 -0
- package/dist/chunk-RJNE764D.js.map +1 -0
- package/dist/{chunk-MTI7X73I.js → chunk-UC2BWIK7.js} +7 -5
- package/dist/{chunk-MTI7X73I.js.map → chunk-UC2BWIK7.js.map} +1 -1
- package/dist/components.js +9 -7
- package/dist/components.js.map +1 -1
- package/dist/hooks.js +7 -5
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/providers.js +10 -7
- package/dist/rbac/index.js +7 -5
- package/dist/utils.js +8 -6
- package/dist/utils.js.map +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +2 -2
- package/docs/implementation-guides/data-tables.md +191 -0
- package/package.json +1 -1
- package/src/components/DataTable/components/DataTableBody.tsx +38 -27
- package/src/components/DataTable/components/UnifiedTableBody.tsx +72 -64
- package/src/components/NavigationMenu/NavigationMenu.tsx +32 -2
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +81 -46
- package/dist/chunk-2NWIXRSB.js.map +0 -1
- package/dist/chunk-4CET7YQI.js.map +0 -1
- package/dist/chunk-6RBH67W7.js.map +0 -1
- package/dist/chunk-VLFIYM6B.js.map +0 -1
- /package/dist/{DataTable-V3RFYBBB.js.map → DataTable-INW5YIFV.js.map} +0 -0
- /package/dist/{chunk-BUM2ZPYC.js.map → chunk-43C63KLH.js.map} +0 -0
- /package/dist/{chunk-C353TCFY.js.map → chunk-M4UMXYNK.js.map} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SelectSeparator,
|
|
16
16
|
SelectTrigger,
|
|
17
17
|
SelectValue
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5A4RL4BC.js";
|
|
19
19
|
import {
|
|
20
20
|
isPermitted
|
|
21
21
|
} from "./chunk-FGMFQSHX.js";
|
|
@@ -25,7 +25,15 @@ import {
|
|
|
25
25
|
usePublicEventLogo,
|
|
26
26
|
usePublicPageContext,
|
|
27
27
|
useToast
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-M4UMXYNK.js";
|
|
29
|
+
import {
|
|
30
|
+
EventProvider_exports,
|
|
31
|
+
OrganisationProvider_exports,
|
|
32
|
+
init_EventProvider,
|
|
33
|
+
init_OrganisationProvider,
|
|
34
|
+
useEvents,
|
|
35
|
+
useOrganisations
|
|
36
|
+
} from "./chunk-RJNE764D.js";
|
|
29
37
|
import {
|
|
30
38
|
Button,
|
|
31
39
|
Dialog,
|
|
@@ -34,17 +42,11 @@ import {
|
|
|
34
42
|
DialogOverlay,
|
|
35
43
|
DialogTitle,
|
|
36
44
|
DialogTrigger,
|
|
37
|
-
EventProvider_exports,
|
|
38
|
-
OrganisationProvider_exports,
|
|
39
45
|
UnifiedAuthProvider_exports,
|
|
40
46
|
init_Button,
|
|
41
|
-
init_EventProvider,
|
|
42
|
-
init_OrganisationProvider,
|
|
43
47
|
init_UnifiedAuthProvider,
|
|
44
|
-
useEvents,
|
|
45
|
-
useOrganisations,
|
|
46
48
|
useUnifiedAuth
|
|
47
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-GBC5PC3N.js";
|
|
48
50
|
import {
|
|
49
51
|
LoadingSpinner
|
|
50
52
|
} from "./chunk-CDQ3PX7L.js";
|
|
@@ -54,7 +56,7 @@ import {
|
|
|
54
56
|
import {
|
|
55
57
|
cn,
|
|
56
58
|
init_cn
|
|
57
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-CDDYJCYU.js";
|
|
58
60
|
import {
|
|
59
61
|
__require,
|
|
60
62
|
__toCommonJS
|
|
@@ -930,7 +932,30 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
930
932
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
931
933
|
});
|
|
932
934
|
}
|
|
933
|
-
|
|
935
|
+
if (!authContext) {
|
|
936
|
+
if (onNavigate) {
|
|
937
|
+
onNavigate(item);
|
|
938
|
+
} else if (item.href) {
|
|
939
|
+
window.location.href = item.href;
|
|
940
|
+
}
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
const isItemVisible = filteredItems.some((filtered) => filtered.id === item.id);
|
|
944
|
+
let hasPermission = true;
|
|
945
|
+
if (item.permissions && item.permissions.length > 0) {
|
|
946
|
+
hasPermission = item.permissions.some((permission) => {
|
|
947
|
+
if (typeof permission !== "string") return true;
|
|
948
|
+
return authContext.hasPermission(permission);
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
if (!hasPermission) {
|
|
952
|
+
if (item.roles && item.roles.length > 0) {
|
|
953
|
+
hasPermission = item.roles.some((role) => {
|
|
954
|
+
if (typeof role !== "string") return true;
|
|
955
|
+
return authContext.hasRole(role);
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}
|
|
934
959
|
if (!hasPermission) {
|
|
935
960
|
if (onNavigationAccessDenied) {
|
|
936
961
|
onNavigationAccessDenied(item.id, "Insufficient permissions");
|
|
@@ -1330,53 +1355,77 @@ function PaceAppLayout({
|
|
|
1330
1355
|
}, [baseMenuItems, filterNavigationByPermissions, enforcePermissions, pageIdMapping, routePermissions, defaultPermission]);
|
|
1331
1356
|
useEffect3(() => {
|
|
1332
1357
|
if (!roleBasedRouting || routeConfig.length === 0) return;
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1358
|
+
let isMounted = true;
|
|
1359
|
+
const checkRouteAccess = async () => {
|
|
1360
|
+
const currentPath = location.pathname;
|
|
1361
|
+
const currentRoute = routeConfig.find((route) => route.path === currentPath);
|
|
1362
|
+
if (!currentRoute) {
|
|
1363
|
+
if (strictMode) {
|
|
1364
|
+
console.error(`[PaceAppLayout] STRICT MODE VIOLATION: Route not found in configuration`, {
|
|
1365
|
+
route: currentPath,
|
|
1366
|
+
userId: user?.id,
|
|
1367
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1368
|
+
});
|
|
1369
|
+
if (onRouteStrictModeViolation) {
|
|
1370
|
+
onRouteStrictModeViolation(currentPath, "Route not found in configuration");
|
|
1371
|
+
}
|
|
1344
1372
|
}
|
|
1373
|
+
return;
|
|
1345
1374
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1375
|
+
let hasAccess = true;
|
|
1376
|
+
if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
|
|
1377
|
+
try {
|
|
1378
|
+
const hasPagePermission = await checkPermission(currentRoute.permissions[0], currentRoute.pageId);
|
|
1379
|
+
if (!isMounted) return;
|
|
1380
|
+
hasAccess = hasPagePermission;
|
|
1381
|
+
} catch (error) {
|
|
1382
|
+
console.error("[PaceAppLayout] Failed to check page permission:", error);
|
|
1383
|
+
if (!isMounted) return;
|
|
1384
|
+
hasAccess = false;
|
|
1385
|
+
}
|
|
1352
1386
|
}
|
|
1353
|
-
if (
|
|
1354
|
-
|
|
1387
|
+
if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
|
|
1388
|
+
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-6SYT5WFN.js");
|
|
1389
|
+
hasAccess = true;
|
|
1390
|
+
}
|
|
1391
|
+
if (!isMounted) return;
|
|
1392
|
+
if (!hasAccess) {
|
|
1393
|
+
if (onRouteAccessDenied) {
|
|
1394
|
+
onRouteAccessDenied(currentPath, "Insufficient permissions");
|
|
1395
|
+
}
|
|
1396
|
+
if (strictMode) {
|
|
1397
|
+
console.error(`[PaceAppLayout] STRICT MODE VIOLATION: User attempted to access protected route without permission`, {
|
|
1398
|
+
route: currentPath,
|
|
1399
|
+
userId: user?.id,
|
|
1400
|
+
permissions: currentRoute.permissions,
|
|
1401
|
+
roles: currentRoute.roles,
|
|
1402
|
+
accessLevel: currentRoute.accessLevel,
|
|
1403
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1404
|
+
});
|
|
1405
|
+
if (onRouteStrictModeViolation) {
|
|
1406
|
+
onRouteStrictModeViolation(currentPath, "Insufficient permissions");
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
navigate(fallbackRoute, { replace: true });
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
if (auditLog) {
|
|
1413
|
+
console.log(`[PaceAppLayout] Route access attempt:`, {
|
|
1355
1414
|
route: currentPath,
|
|
1356
1415
|
userId: user?.id,
|
|
1416
|
+
allowed: hasAccess,
|
|
1357
1417
|
permissions: currentRoute.permissions,
|
|
1358
1418
|
roles: currentRoute.roles,
|
|
1359
1419
|
accessLevel: currentRoute.accessLevel,
|
|
1360
1420
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1361
1421
|
});
|
|
1362
|
-
if (onRouteStrictModeViolation) {
|
|
1363
|
-
onRouteStrictModeViolation(currentPath, "Insufficient permissions");
|
|
1364
|
-
}
|
|
1365
1422
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
allowed: hasAccess,
|
|
1373
|
-
permissions: currentRoute.permissions,
|
|
1374
|
-
roles: currentRoute.roles,
|
|
1375
|
-
accessLevel: currentRoute.accessLevel,
|
|
1376
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1377
|
-
});
|
|
1378
|
-
}
|
|
1379
|
-
}, [roleBasedRouting, routeConfig, location.pathname, strictMode, user?.id, fallbackRoute]);
|
|
1423
|
+
};
|
|
1424
|
+
checkRouteAccess();
|
|
1425
|
+
return () => {
|
|
1426
|
+
isMounted = false;
|
|
1427
|
+
};
|
|
1428
|
+
}, [roleBasedRouting, routeConfig, location.pathname, strictMode, user?.id, fallbackRoute, checkPermission, navigate, auditLog, onRouteAccessDenied, onRouteStrictModeViolation]);
|
|
1380
1429
|
const handleSignOut = async () => {
|
|
1381
1430
|
await signOut();
|
|
1382
1431
|
};
|
|
@@ -3753,4 +3802,4 @@ export {
|
|
|
3753
3802
|
PublicPageDiagnostic,
|
|
3754
3803
|
PublicPageContextChecker
|
|
3755
3804
|
};
|
|
3756
|
-
//# sourceMappingURL=chunk-
|
|
3805
|
+
//# sourceMappingURL=chunk-BYG6OSTC.js.map
|