@jmruthers/pace-core 0.5.70 → 0.5.72

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.
Files changed (145) hide show
  1. package/dist/{DataTable-OSELOGMA.js → DataTable-RCFGXSPQ.js} +5 -5
  2. package/dist/{api-A4SUYPPV.js → api-DDMUKIUD.js} +2 -2
  3. package/dist/{chunk-5NV76BYF.js → chunk-2PDTIGS4.js} +6 -6
  4. package/dist/{chunk-GCUIIBLB.js → chunk-4CET7YQI.js} +4 -3
  5. package/dist/chunk-4CET7YQI.js.map +1 -0
  6. package/dist/{chunk-FOT3WUV6.js → chunk-67FGPOHX.js} +3 -3
  7. package/dist/{chunk-V2TE7LOF.js → chunk-BUM2ZPYC.js} +12 -12
  8. package/dist/{chunk-BHBMXMLT.js → chunk-C353TCFY.js} +2 -2
  9. package/dist/{chunk-NHR52QAQ.js → chunk-FGMFQSHX.js} +8 -7
  10. package/dist/chunk-FGMFQSHX.js.map +1 -0
  11. package/dist/{chunk-KWQH4VO3.js → chunk-GDIBOLKV.js} +2 -2
  12. package/dist/{chunk-OTJUAYBG.js → chunk-MTI7X73I.js} +5 -5
  13. package/dist/{chunk-4YMVZ76F.js → chunk-WMYLD5WP.js} +71 -66
  14. package/dist/chunk-WMYLD5WP.js.map +1 -0
  15. package/dist/{chunk-5G7JA3L5.js → chunk-XC4ZCSO4.js} +2 -2
  16. package/dist/components.js +7 -7
  17. package/dist/hooks.js +4 -4
  18. package/dist/index.js +10 -10
  19. package/dist/providers.js +2 -2
  20. package/dist/rbac/index.d.ts +4 -0
  21. package/dist/rbac/index.js +5 -5
  22. package/dist/utils.js +1 -1
  23. package/docs/api/classes/ColumnFactory.md +1 -1
  24. package/docs/api/classes/ErrorBoundary.md +1 -1
  25. package/docs/api/classes/InvalidScopeError.md +1 -1
  26. package/docs/api/classes/MissingUserContextError.md +1 -1
  27. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  28. package/docs/api/classes/PermissionDeniedError.md +1 -1
  29. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  30. package/docs/api/classes/RBACAuditManager.md +1 -1
  31. package/docs/api/classes/RBACCache.md +1 -1
  32. package/docs/api/classes/RBACEngine.md +2 -2
  33. package/docs/api/classes/RBACError.md +1 -1
  34. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  35. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  36. package/docs/api/classes/StorageUtils.md +1 -1
  37. package/docs/api/enums/FileCategory.md +1 -1
  38. package/docs/api/interfaces/AggregateConfig.md +1 -1
  39. package/docs/api/interfaces/ButtonProps.md +1 -1
  40. package/docs/api/interfaces/CardProps.md +1 -1
  41. package/docs/api/interfaces/ColorPalette.md +1 -1
  42. package/docs/api/interfaces/ColorShade.md +1 -1
  43. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  44. package/docs/api/interfaces/DataTableAction.md +1 -1
  45. package/docs/api/interfaces/DataTableColumn.md +1 -1
  46. package/docs/api/interfaces/DataTableProps.md +1 -1
  47. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  48. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  49. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  50. package/docs/api/interfaces/EventContextType.md +1 -1
  51. package/docs/api/interfaces/EventLogoProps.md +1 -1
  52. package/docs/api/interfaces/EventProviderProps.md +1 -1
  53. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  54. package/docs/api/interfaces/FileMetadata.md +1 -1
  55. package/docs/api/interfaces/FileReference.md +1 -1
  56. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  57. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  58. package/docs/api/interfaces/FileUploadProps.md +1 -1
  59. package/docs/api/interfaces/FooterProps.md +1 -1
  60. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  61. package/docs/api/interfaces/InputProps.md +1 -1
  62. package/docs/api/interfaces/LabelProps.md +1 -1
  63. package/docs/api/interfaces/LoginFormProps.md +1 -1
  64. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  65. package/docs/api/interfaces/NavigationContextType.md +1 -1
  66. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  67. package/docs/api/interfaces/NavigationItem.md +1 -1
  68. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  69. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  70. package/docs/api/interfaces/Organisation.md +1 -1
  71. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  72. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  73. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  74. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  75. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  76. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  77. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  78. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  79. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  80. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  81. package/docs/api/interfaces/PaletteData.md +1 -1
  82. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  83. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  84. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  85. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  86. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  87. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  88. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  89. package/docs/api/interfaces/RBACConfig.md +1 -1
  90. package/docs/api/interfaces/RBACContextType.md +1 -1
  91. package/docs/api/interfaces/RBACLogger.md +1 -1
  92. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  93. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  94. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  95. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  96. package/docs/api/interfaces/RouteConfig.md +1 -1
  97. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  98. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  99. package/docs/api/interfaces/StorageConfig.md +1 -1
  100. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  101. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  102. package/docs/api/interfaces/StorageListOptions.md +1 -1
  103. package/docs/api/interfaces/StorageListResult.md +1 -1
  104. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  105. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  106. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  107. package/docs/api/interfaces/StyleImport.md +1 -1
  108. package/docs/api/interfaces/SwitchProps.md +1 -1
  109. package/docs/api/interfaces/ToastActionElement.md +1 -1
  110. package/docs/api/interfaces/ToastProps.md +1 -1
  111. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  112. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  113. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  114. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  115. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  116. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  117. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  118. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  119. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  120. package/docs/api/interfaces/UserEventAccess.md +1 -1
  121. package/docs/api/interfaces/UserMenuProps.md +1 -1
  122. package/docs/api/interfaces/UserProfile.md +1 -1
  123. package/docs/api/modules.md +3 -3
  124. package/docs/implementation-guides/data-tables.md +191 -0
  125. package/package.json +1 -1
  126. package/src/components/DataTable/components/DataTableBody.tsx +38 -27
  127. package/src/components/DataTable/components/UnifiedTableBody.tsx +72 -64
  128. package/src/rbac/__tests__/engine.comprehensive.test.ts +150 -78
  129. package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +52 -50
  130. package/src/rbac/__tests__/rbac-engine-simplified.test.ts +39 -19
  131. package/src/rbac/engine.test.ts +4 -0
  132. package/src/rbac/engine.ts +16 -7
  133. package/src/rbac/providers/RBACProvider.tsx +15 -4
  134. package/dist/chunk-4YMVZ76F.js.map +0 -1
  135. package/dist/chunk-GCUIIBLB.js.map +0 -1
  136. package/dist/chunk-NHR52QAQ.js.map +0 -1
  137. /package/dist/{DataTable-OSELOGMA.js.map → DataTable-RCFGXSPQ.js.map} +0 -0
  138. /package/dist/{api-A4SUYPPV.js.map → api-DDMUKIUD.js.map} +0 -0
  139. /package/dist/{chunk-5NV76BYF.js.map → chunk-2PDTIGS4.js.map} +0 -0
  140. /package/dist/{chunk-FOT3WUV6.js.map → chunk-67FGPOHX.js.map} +0 -0
  141. /package/dist/{chunk-V2TE7LOF.js.map → chunk-BUM2ZPYC.js.map} +0 -0
  142. /package/dist/{chunk-BHBMXMLT.js.map → chunk-C353TCFY.js.map} +0 -0
  143. /package/dist/{chunk-KWQH4VO3.js.map → chunk-GDIBOLKV.js.map} +0 -0
  144. /package/dist/{chunk-OTJUAYBG.js.map → chunk-MTI7X73I.js.map} +0 -0
  145. /package/dist/{chunk-5G7JA3L5.js.map → chunk-XC4ZCSO4.js.map} +0 -0
@@ -32,9 +32,9 @@ import {
32
32
  useDataTableContext,
33
33
  usePluginRegistry,
34
34
  useStateManager
35
- } from "./chunk-4YMVZ76F.js";
36
- import "./chunk-FOT3WUV6.js";
37
- import "./chunk-NHR52QAQ.js";
35
+ } from "./chunk-WMYLD5WP.js";
36
+ import "./chunk-67FGPOHX.js";
37
+ import "./chunk-FGMFQSHX.js";
38
38
  import "./chunk-B2WTCLCV.js";
39
39
  import {
40
40
  DataChunkManager,
@@ -47,7 +47,7 @@ import {
47
47
  throttle,
48
48
  useDataTablePerformance
49
49
  } from "./chunk-YNUBMSMV.js";
50
- import "./chunk-GCUIIBLB.js";
50
+ import "./chunk-4CET7YQI.js";
51
51
  import "./chunk-ULBI5JGB.js";
52
52
  import "./chunk-5BSLGBYI.js";
53
53
  import "./chunk-6RBH67W7.js";
@@ -97,4 +97,4 @@ export {
97
97
  usePluginRegistry,
98
98
  useStateManager
99
99
  };
100
- //# sourceMappingURL=DataTable-OSELOGMA.js.map
100
+ //# sourceMappingURL=DataTable-RCFGXSPQ.js.map
@@ -16,7 +16,7 @@ import {
16
16
  isPermittedCached,
17
17
  isSuperAdmin,
18
18
  setupRBAC
19
- } from "./chunk-NHR52QAQ.js";
19
+ } from "./chunk-FGMFQSHX.js";
20
20
  import "./chunk-B2WTCLCV.js";
21
21
  import "./chunk-PLDDJCW6.js";
22
22
  export {
@@ -38,4 +38,4 @@ export {
38
38
  isSuperAdmin,
39
39
  setupRBAC
40
40
  };
41
- //# sourceMappingURL=api-A4SUYPPV.js.map
41
+ //# sourceMappingURL=api-DDMUKIUD.js.map
@@ -15,17 +15,17 @@ import {
15
15
  SelectSeparator,
16
16
  SelectTrigger,
17
17
  SelectValue
18
- } from "./chunk-4YMVZ76F.js";
18
+ } from "./chunk-WMYLD5WP.js";
19
19
  import {
20
20
  isPermitted
21
- } from "./chunk-NHR52QAQ.js";
21
+ } from "./chunk-FGMFQSHX.js";
22
22
  import {
23
23
  PublicErrorBoundary,
24
24
  useAppConfig,
25
25
  usePublicEventLogo,
26
26
  usePublicPageContext,
27
27
  useToast
28
- } from "./chunk-BHBMXMLT.js";
28
+ } from "./chunk-C353TCFY.js";
29
29
  import {
30
30
  Button,
31
31
  Dialog,
@@ -44,7 +44,7 @@ import {
44
44
  useEvents,
45
45
  useOrganisations,
46
46
  useUnifiedAuth
47
- } from "./chunk-GCUIIBLB.js";
47
+ } from "./chunk-4CET7YQI.js";
48
48
  import {
49
49
  LoadingSpinner
50
50
  } from "./chunk-CDQ3PX7L.js";
@@ -1205,7 +1205,7 @@ function PaceAppLayout({
1205
1205
  eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,
1206
1206
  appId: user.user_metadata?.appId || user.app_metadata?.appId
1207
1207
  };
1208
- const { isSuperAdmin } = await import("./api-A4SUYPPV.js");
1208
+ const { isSuperAdmin } = await import("./api-DDMUKIUD.js");
1209
1209
  const isSuper = await isSuperAdmin(user.id);
1210
1210
  if (isSuper) {
1211
1211
  return true;
@@ -3753,4 +3753,4 @@ export {
3753
3753
  PublicPageDiagnostic,
3754
3754
  PublicPageContextChecker
3755
3755
  };
3756
- //# sourceMappingURL=chunk-5NV76BYF.js.map
3756
+ //# sourceMappingURL=chunk-2PDTIGS4.js.map
@@ -357,7 +357,8 @@ function RBACProvider({
357
357
  setAccessLevel("viewer" /* VIEWER */);
358
358
  return;
359
359
  }
360
- const isSuperAdmin = user?.user_metadata?.globalRole === "super_admin";
360
+ const { data: globalRoles } = await supabaseClient.from("rbac_global_roles").select("role").eq("user_id", user.id).eq("role", "super_admin").lte("valid_from", (/* @__PURE__ */ new Date()).toISOString()).or(`valid_to.is.null,valid_to.gte.${(/* @__PURE__ */ new Date()).toISOString()}`).limit(1);
361
+ const isSuperAdmin = globalRoles && globalRoles.length > 0;
361
362
  if (isSuperAdmin) {
362
363
  setPermissions({
363
364
  "admin:create": true,
@@ -374,7 +375,7 @@ function RBACProvider({
374
375
  "events:delete": true
375
376
  });
376
377
  setRoles(["super_admin"]);
377
- setAccessLevel("admin" /* ADMIN */);
378
+ setAccessLevel("super" /* SUPER */);
378
379
  return;
379
380
  }
380
381
  const shouldLoadDirectPermissions = !eventId && !appConfig.requires_event;
@@ -8268,4 +8269,4 @@ lodash/lodash.js:
8268
8269
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8269
8270
  *)
8270
8271
  */
8271
- //# sourceMappingURL=chunk-GCUIIBLB.js.map
8272
+ //# sourceMappingURL=chunk-4CET7YQI.js.map