@jmruthers/pace-core 0.5.54 → 0.5.56
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 +0 -4
- package/dist/{DataTable-7FMFXA7A.js → DataTable-DJQTKX33.js} +11 -11
- package/dist/{PublicLoadingSpinner-Bq_-BeK-.d.ts → PublicLoadingSpinner-SL8WaQN7.d.ts} +2 -21
- package/dist/{api-H5A3H4IR.js → api-LUNF5O6M.js} +3 -3
- package/dist/{appConfig-BVGyuvI7.d.ts → appConfig-DjpeG6P-.d.ts} +9 -1
- package/dist/{appNameResolver-7GHF5ED2.js → appNameResolver-UURKN7NF.js} +2 -2
- package/dist/{audit-BUW3LMJB.js → audit-6TOCAMKO.js} +2 -2
- package/dist/{chunk-NRK4AIHQ.js → chunk-2DFCT6D3.js} +3 -3
- package/dist/{chunk-GIO7BFE7.js → chunk-3JKVVLD3.js} +66 -169
- package/dist/{chunk-GIO7BFE7.js.map → chunk-3JKVVLD3.js.map} +1 -1
- package/dist/{chunk-MZBUOP4P.js → chunk-5BSLGBYI.js} +4 -3
- package/dist/chunk-5BSLGBYI.js.map +1 -0
- package/dist/{chunk-I5Z3QH5X.js → chunk-66C4BSAY.js} +2 -2
- package/dist/{chunk-I5Z3QH5X.js.map → chunk-66C4BSAY.js.map} +1 -1
- package/dist/{chunk-EL2O4IUX.js → chunk-ASXSJGPW.js} +20 -24
- package/dist/{chunk-EL2O4IUX.js.map → chunk-ASXSJGPW.js.map} +1 -1
- package/dist/{chunk-7BNPOCLL.js → chunk-B2WTCLCV.js} +6 -2
- package/dist/chunk-B2WTCLCV.js.map +1 -0
- package/dist/{chunk-WJARTBCT.js → chunk-D7ARGIA3.js} +16 -7
- package/dist/chunk-D7ARGIA3.js.map +1 -0
- package/dist/{chunk-MYP2EGHX.js → chunk-GIDCWCHF.js} +21 -14
- package/dist/chunk-GIDCWCHF.js.map +1 -0
- package/dist/{chunk-MSFACPQQ.js → chunk-HYNGIE5T.js} +11 -11
- package/dist/{chunk-MSFACPQQ.js.map → chunk-HYNGIE5T.js.map} +1 -1
- package/dist/{chunk-TRIZ7IB7.js → chunk-I5GID3EX.js} +148 -288
- package/dist/chunk-I5GID3EX.js.map +1 -0
- package/dist/{chunk-GWSBHC4J.js → chunk-KLPVOPRI.js} +261 -38
- package/dist/chunk-KLPVOPRI.js.map +1 -0
- package/dist/{chunk-BC3S53OZ.js → chunk-N6XMGSGD.js} +30 -14
- package/dist/chunk-N6XMGSGD.js.map +1 -0
- package/dist/{chunk-6MTY77WU.js → chunk-QB4GXDUM.js} +3 -3
- package/dist/{chunk-YDJW5XTN.js → chunk-STT7INZR.js} +25 -1
- package/dist/chunk-STT7INZR.js.map +1 -0
- package/dist/{chunk-NYUJ4FJR.js → chunk-UETTVYKU.js} +7 -7
- package/dist/chunk-UETTVYKU.js.map +1 -0
- package/dist/{chunk-22KLBHPS.js → chunk-W66AZIOH.js} +2 -2
- package/dist/chunk-W66AZIOH.js.map +1 -0
- package/dist/{chunk-NZ655MWE.js → chunk-YEHO6FDW.js} +5 -4
- package/dist/chunk-YEHO6FDW.js.map +1 -0
- package/dist/{chunk-SS3E6QLB.js → chunk-YNUBMSMV.js} +2 -2
- package/dist/chunk-YNUBMSMV.js.map +1 -0
- package/dist/{chunk-74C6SNEC.js → chunk-ZPK5656W.js} +3 -3
- package/dist/{chunk-74C6SNEC.js.map → chunk-ZPK5656W.js.map} +1 -1
- package/dist/components.d.ts +22 -899
- package/dist/components.js +436 -3118
- package/dist/components.js.map +1 -1
- package/dist/file-reference-9xUOnwyt.d.ts +70 -0
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +10 -10
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +49 -9
- package/dist/index.js +190 -25
- package/dist/index.js.map +1 -1
- package/dist/{organisation-CO3Sh3_D.d.ts → organisation-t-vvQC3g.d.ts} +1 -8
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +5 -5
- package/dist/rbac/index.d.ts +65 -46
- package/dist/rbac/index.js +10 -12
- package/dist/styles/core.css +0 -125
- package/dist/types.d.ts +2 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/{usePublicRouteParams-B2OcAsur.d.ts → usePublicRouteParams-CdoFxnJK.d.ts} +1 -1
- package/dist/utils.d.ts +3 -4
- package/dist/utils.js +44 -13
- package/dist/utils.js.map +1 -1
- package/docs/FILE_REFERENCE_SYSTEM.md +440 -0
- package/docs/INDEX.md +7 -5
- package/docs/README.md +0 -1
- package/docs/api/README.md +0 -4
- 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 +2 -2
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +12 -12
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +6 -6
- 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 +281 -0
- 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/FileSizeLimits.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 +2 -2
- 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 +4 -4
- 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 +2 -2
- package/docs/api/interfaces/RouteConfig.md +2 -2
- 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/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 +204 -200
- package/docs/api-reference/components.md +141 -163
- package/docs/api-reference/hooks.md +347 -0
- package/docs/core-concepts/rbac-system.md +69 -16
- package/docs/getting-started/examples/basic-auth-app.md +0 -1
- package/docs/implementation-guides/datatable-rbac-usage.md +12 -11
- package/docs/implementation-guides/file-upload-storage.md +733 -0
- package/docs/implementation-guides/inactivity-tracking.md +779 -0
- package/docs/implementation-guides/organisation-security.md +748 -0
- package/docs/implementation-guides/public-pages-advanced.md +1022 -0
- package/docs/migration/MIGRATION_GUIDE.md +684 -0
- package/docs/migration/README.md +13 -2
- package/docs/migration/rbac-migration.md +73 -0
- package/docs/rbac/examples/rbac-rls-integration-example.md +11 -13
- package/docs/style-guide.md +269 -1
- package/package.json +1 -1
- package/src/__tests__/TESTING_GUIDELINES.md +331 -18
- package/src/__tests__/helpers/supabaseMock.ts +99 -0
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +10 -7
- package/src/__tests__/shared.ts +6 -0
- package/src/components/DataTable/components/ActionButtons.tsx +2 -2
- package/src/components/DataTable/components/DataTableCore.tsx +2 -2
- package/src/components/DataTable/components/UnifiedTableBody.tsx +1 -1
- package/src/components/DataTable/utils/debugTools.ts +2 -2
- package/src/components/Dialog/Dialog.test.tsx +12 -2
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +6 -6
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +2 -2
- package/src/components/FileDisplay.tsx +233 -0
- package/src/components/FileUpload.tsx +176 -0
- package/src/components/Footer/Footer.test.tsx +7 -7
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +13 -6
- package/src/components/OrganisationSelector/OrganisationSelector.test.tsx +30 -3
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +1 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +558 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicPageDebugger.tsx +2 -2
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +2 -2
- package/src/components/PublicLayout/PublicPageProvider.tsx +2 -2
- package/src/components/Select/Select.test.tsx +50 -15
- package/src/components/SuperAdminGuard.tsx +2 -2
- package/src/components/__tests__/SuperAdminGuard.test.tsx +559 -0
- package/src/components/index.ts +0 -183
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +2 -2
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +1 -1
- package/src/hooks/__tests__/useRBAC.unit.test.ts +191 -138
- package/src/hooks/public/usePublicEvent.ts +2 -2
- package/src/hooks/useAppConfig.ts +3 -3
- package/src/hooks/useComponentPerformance.ts +1 -1
- package/src/hooks/useDataTablePerformance.ts +1 -1
- package/src/hooks/useFileReference.ts +232 -0
- package/src/hooks/useOrganisationPermissions.test.ts +254 -344
- package/src/hooks/useOrganisationPermissions.ts +15 -7
- package/src/hooks/useOrganisationSecurity.test.ts +390 -402
- package/src/hooks/usePerformanceMonitor.ts +1 -1
- package/src/hooks/usePermissionCache.test.ts +264 -395
- package/src/hooks/usePermissionCache.ts +34 -4
- package/src/hooks/useSecureDataAccess.test.ts +486 -0
- package/src/hooks/useSecureDataAccess.ts +4 -1
- package/src/providers/InactivityProvider.tsx +2 -2
- package/src/providers/OrganisationProvider.test.simple.tsx +168 -0
- package/src/providers/OrganisationProvider.test.tsx +168 -0
- package/src/providers/OrganisationProvider.tsx +25 -31
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +205 -0
- package/src/providers/UnifiedAuthProvider.test.tsx +128 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +3 -4
- package/src/providers/__tests__/OrganisationProvider.test.tsx +19 -14
- package/src/rbac/__tests__/integration.authflow.test.tsx +123 -0
- package/src/rbac/__tests__/integration.navigation.test.tsx +72 -0
- package/src/rbac/__tests__/integration.securedata.test.tsx +92 -0
- package/src/rbac/__tests__/integration.smoke.test.tsx +73 -0
- package/src/rbac/__tests__/rbac-core.test.tsx +26 -22
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +411 -0
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +285 -0
- package/src/rbac/__tests__/rbac-functions.test.ts +655 -0
- package/src/rbac/__tests__/rbac-integration.test.ts +532 -0
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +196 -0
- package/src/rbac/api.test.ts +6 -6
- package/src/rbac/api.ts +2 -2
- package/src/rbac/audit.test.ts +485 -0
- package/src/rbac/audit.ts +7 -1
- package/src/rbac/cache-invalidation.ts +318 -0
- package/src/rbac/cache.test.ts +286 -0
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +559 -0
- package/src/rbac/components/EnhancedNavigationMenu.tsx +29 -23
- package/src/rbac/components/NavigationProvider.test.tsx +449 -0
- package/src/rbac/components/PagePermissionGuard.tsx +4 -4
- package/src/rbac/components/PagePermissionProvider.test.tsx +479 -0
- package/src/rbac/components/SecureDataProvider.test.tsx +511 -0
- package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +159 -430
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +4 -5
- package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +112 -118
- package/src/rbac/config.test.ts +410 -0
- package/src/rbac/engine.test.simple.ts +237 -0
- package/src/rbac/engine.test.ts +233 -0
- package/src/rbac/engine.ts +37 -41
- package/src/rbac/examples/CompleteRBACExample.tsx +3 -3
- package/src/rbac/examples/EventBasedApp.tsx +4 -4
- package/src/rbac/hooks/useRBAC.simple.test.ts +16 -0
- package/src/rbac/hooks/useRBAC.test.ts +207 -455
- package/src/rbac/hooks/useRBAC.ts +30 -22
- package/src/rbac/permissions.test.ts +128 -0
- package/src/rbac/permissions.ts +56 -141
- package/src/rbac/providers/RBACProvider.tsx +1 -1
- package/src/rbac/secureClient.test.ts +444 -0
- package/src/rbac/security.test.ts +390 -0
- package/src/rbac/security.ts +1 -1
- package/src/rbac/types.test.ts +382 -0
- package/src/rbac/types.ts +2 -2
- package/src/styles/core.css +0 -125
- package/src/types/file-reference.ts +77 -0
- package/src/types/rbac-functions.ts +290 -0
- package/src/types/supabase.ts +10 -28
- package/src/types/unified.ts +4 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +81 -55
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +21 -12
- package/src/utils/__tests__/organisationContext.unit.test.ts +13 -7
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +3 -3
- package/src/utils/__tests__/sessionTracking.unit.test.ts +32 -12
- package/src/utils/appConfig.ts +1 -1
- package/src/utils/appIdResolver.test.ts +503 -0
- package/src/utils/appIdResolver.ts +1 -1
- package/src/utils/appNameResolver.test.ts +494 -0
- package/src/utils/appNameResolver.ts +3 -2
- package/src/utils/bundleAnalysis.ts +3 -3
- package/src/utils/debugLogger.ts +1 -1
- package/src/utils/file-reference.ts +263 -0
- package/src/utils/formatDate.test.ts +2 -2
- package/src/utils/organisationContext.test.ts +340 -0
- package/src/utils/organisationContext.ts +19 -6
- package/src/utils/performanceBudgets.ts +2 -2
- package/src/utils/permissionUtils.test.ts +393 -0
- package/src/utils/permissionUtils.ts +5 -2
- package/src/utils/secureDataAccess.test.ts +715 -0
- package/src/utils/secureDataAccess.ts +21 -5
- package/src/utils/sessionTracking.ts +34 -4
- package/src/utils/storage/__tests__/helpers.unit.test.ts +328 -0
- package/src/utils/storage/__tests__/index.unit.test.ts +16 -0
- package/src/utils/storage/helpers.ts +20 -25
- package/src/utils/storage/index.ts +29 -1
- package/src/vite-env.d.ts +17 -0
- package/dist/chunk-22KLBHPS.js.map +0 -1
- package/dist/chunk-7BNPOCLL.js.map +0 -1
- package/dist/chunk-BC3S53OZ.js.map +0 -1
- package/dist/chunk-GWSBHC4J.js.map +0 -1
- package/dist/chunk-MYP2EGHX.js.map +0 -1
- package/dist/chunk-MZBUOP4P.js.map +0 -1
- package/dist/chunk-NYUJ4FJR.js.map +0 -1
- package/dist/chunk-NZ655MWE.js.map +0 -1
- package/dist/chunk-SS3E6QLB.js.map +0 -1
- package/dist/chunk-TRIZ7IB7.js.map +0 -1
- package/dist/chunk-WJARTBCT.js.map +0 -1
- package/dist/chunk-YDJW5XTN.js.map +0 -1
- package/docs/print-components/README.md +0 -258
- package/docs/print-components/api-reference.md +0 -636
- package/docs/print-components/examples/README.md +0 -204
- package/docs/print-components/examples/basic-report.tsx +0 -92
- package/docs/print-components/examples/card-catalog.tsx +0 -149
- package/docs/print-components/examples/cover-page-report.tsx +0 -163
- package/docs/print-components/quick-start.md +0 -363
- package/src/components/PrintButton/PrintButton.tsx +0 -321
- package/src/components/PrintButton/PrintButtonGroup.tsx +0 -84
- package/src/components/PrintButton/PrintToolbar.tsx +0 -94
- package/src/components/PrintButton/__tests__/PrintButton.test.tsx +0 -271
- package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +0 -438
- package/src/components/PrintButton/index.ts +0 -33
- package/src/components/PrintButton/types.ts +0 -173
- package/src/components/PrintCard/PrintCard.tsx +0 -154
- package/src/components/PrintCard/PrintCardContent.tsx +0 -57
- package/src/components/PrintCard/PrintCardFooter.tsx +0 -60
- package/src/components/PrintCard/PrintCardGrid.tsx +0 -91
- package/src/components/PrintCard/PrintCardHeader.tsx +0 -78
- package/src/components/PrintCard/PrintCardImage.tsx +0 -81
- package/src/components/PrintCard/examples/PrintCardShowcase.tsx +0 -239
- package/src/components/PrintCard/index.ts +0 -34
- package/src/components/PrintCard/types.ts +0 -171
- package/src/components/PrintDataTable/PrintDataTable.tsx +0 -215
- package/src/components/PrintDataTable/PrintTableGroup.tsx +0 -90
- package/src/components/PrintDataTable/PrintTableRow.tsx +0 -76
- package/src/components/PrintDataTable/index.ts +0 -25
- package/src/components/PrintDataTable/types.ts +0 -67
- package/src/components/PrintFooter/PrintFooter.tsx +0 -183
- package/src/components/PrintFooter/PrintFooterContent.tsx +0 -71
- package/src/components/PrintFooter/PrintFooterInfo.tsx +0 -86
- package/src/components/PrintFooter/PrintPageNumber.tsx +0 -90
- package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +0 -390
- package/src/components/PrintFooter/index.ts +0 -30
- package/src/components/PrintFooter/types.ts +0 -149
- package/src/components/PrintGrid/PrintGrid.tsx +0 -180
- package/src/components/PrintGrid/PrintGridBreakpoint.tsx +0 -109
- package/src/components/PrintGrid/PrintGridContainer.tsx +0 -128
- package/src/components/PrintGrid/PrintGridItem.tsx +0 -220
- package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +0 -359
- package/src/components/PrintGrid/index.ts +0 -31
- package/src/components/PrintGrid/types.ts +0 -159
- package/src/components/PrintHeader/PrintCoverHeader.tsx +0 -230
- package/src/components/PrintHeader/PrintHeader.tsx +0 -150
- package/src/components/PrintHeader/index.ts +0 -17
- package/src/components/PrintHeader/types.ts +0 -42
- package/src/components/PrintLayout/PrintLayout.tsx +0 -122
- package/src/components/PrintLayout/PrintLayoutContext.tsx +0 -66
- package/src/components/PrintLayout/PrintPageBreak.tsx +0 -52
- package/src/components/PrintLayout/examples/PrintShowcase.tsx +0 -230
- package/src/components/PrintLayout/index.ts +0 -19
- package/src/components/PrintLayout/types.ts +0 -37
- package/src/components/PrintPageBreak/PrintPageBreak.tsx +0 -120
- package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +0 -90
- package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +0 -112
- package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +0 -279
- package/src/components/PrintPageBreak/index.ts +0 -23
- package/src/components/PrintPageBreak/types.ts +0 -94
- package/src/components/PrintSection/PrintColumn.tsx +0 -104
- package/src/components/PrintSection/PrintDivider.tsx +0 -101
- package/src/components/PrintSection/PrintSection.tsx +0 -129
- package/src/components/PrintSection/PrintSectionContent.tsx +0 -75
- package/src/components/PrintSection/PrintSectionHeader.tsx +0 -97
- package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +0 -258
- package/src/components/PrintSection/index.ts +0 -33
- package/src/components/PrintSection/types.ts +0 -155
- package/src/components/PrintText/PrintText.tsx +0 -116
- package/src/components/PrintText/index.ts +0 -16
- package/src/components/PrintText/types.ts +0 -24
- package/src/rbac/__tests__/integration.test.tsx +0 -218
- package/src/utils/print/PrintDataProcessor.ts +0 -390
- package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +0 -397
- package/src/utils/print/index.ts +0 -29
- package/src/utils/print/types.ts +0 -196
- package/src/utils/print/usePrintOptimization.ts +0 -272
- /package/dist/{DataTable-7FMFXA7A.js.map → DataTable-DJQTKX33.js.map} +0 -0
- /package/dist/{api-H5A3H4IR.js.map → api-LUNF5O6M.js.map} +0 -0
- /package/dist/{appNameResolver-7GHF5ED2.js.map → appNameResolver-UURKN7NF.js.map} +0 -0
- /package/dist/{audit-BUW3LMJB.js.map → audit-6TOCAMKO.js.map} +0 -0
- /package/dist/{chunk-NRK4AIHQ.js.map → chunk-2DFCT6D3.js.map} +0 -0
- /package/dist/{chunk-6MTY77WU.js.map → chunk-QB4GXDUM.js.map} +0 -0
package/README.md
CHANGED
|
@@ -282,7 +282,6 @@ import {
|
|
|
282
282
|
- **Data Display**: DataTable (with hierarchical actions & expand/collapse all), Table
|
|
283
283
|
- **Forms**: Form, LoginForm
|
|
284
284
|
- **Layout**: PaceAppLayout, Header, Footer, NavigationMenu
|
|
285
|
-
- **Print Components**: PrintLayout, PrintDataTable, PrintCard, PrintHeader, PrintText, PrintButton, PrintGrid, PrintSection, PrintFooter, PrintPageBreak
|
|
286
285
|
- **Providers**: UnifiedAuthProvider, OrganisationProvider, EventProvider
|
|
287
286
|
- **Hooks**: useUnifiedAuth, useOrganisations, useEvents
|
|
288
287
|
|
|
@@ -290,9 +289,6 @@ import {
|
|
|
290
289
|
|
|
291
290
|
- **[DataTable Component](docs/implementation-guides/data-tables.md)** - Enterprise-grade data table with hierarchical rows, expand/collapse all, actions, sorting, filtering, and performance optimization
|
|
292
291
|
- **[Hierarchical DataTable Guide](docs/implementation-guides/hierarchical-datatable.md)** - Complete guide for implementing parent/child rows with expand/collapse all and smart sorting
|
|
293
|
-
- **[Print Components](docs/print-components/README.md)** - **NEW** Print-optimized layout system for reports, documents, and printable content
|
|
294
|
-
- **[Print Quick Start](docs/print-components/quick-start.md)** - 5-minute setup guide
|
|
295
|
-
- **[Print API Reference](docs/print-components/api-reference.md)** - Complete component documentation
|
|
296
292
|
- **[Dialog Component](src/components/Dialog/README.md)** - Comprehensive dialog system with smart height management, scrolling, HTML content rendering, and accessibility features
|
|
297
293
|
- **[Storage System](src/utils/storage/README.md)** - File storage utilities with organization-scoped access control
|
|
298
294
|
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
useDataTableContext,
|
|
33
33
|
usePluginRegistry,
|
|
34
34
|
useStateManager
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-HYNGIE5T.js";
|
|
36
|
+
import "./chunk-N6XMGSGD.js";
|
|
37
|
+
import "./chunk-KLPVOPRI.js";
|
|
38
|
+
import "./chunk-B2WTCLCV.js";
|
|
39
|
+
import "./chunk-2DFCT6D3.js";
|
|
40
40
|
import {
|
|
41
41
|
DataChunkManager,
|
|
42
42
|
SearchIndex,
|
|
@@ -47,11 +47,11 @@ import {
|
|
|
47
47
|
getOptimalPageSizeOptions,
|
|
48
48
|
throttle,
|
|
49
49
|
useDataTablePerformance
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-YNUBMSMV.js";
|
|
51
|
+
import "./chunk-ASXSJGPW.js";
|
|
52
|
+
import "./chunk-STT7INZR.js";
|
|
53
|
+
import "./chunk-5BSLGBYI.js";
|
|
54
|
+
import "./chunk-D7ARGIA3.js";
|
|
55
55
|
import "./chunk-PLDDJCW6.js";
|
|
56
56
|
export {
|
|
57
57
|
ActionButtons,
|
|
@@ -97,4 +97,4 @@ export {
|
|
|
97
97
|
usePluginRegistry,
|
|
98
98
|
useStateManager
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=DataTable-
|
|
100
|
+
//# sourceMappingURL=DataTable-DJQTKX33.js.map
|
|
@@ -12,7 +12,7 @@ import { FieldValues, DefaultValues, SubmitHandler, SubmitErrorHandler, UseFormR
|
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { User, SupabaseClient, createClient } from '@supabase/supabase-js';
|
|
14
14
|
import { r as Event } from './unified-CMPjE_fv.js';
|
|
15
|
-
import {
|
|
15
|
+
import { b as Organisation } from './organisation-t-vvQC3g.js';
|
|
16
16
|
|
|
17
17
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
18
|
/** Visual variant of the button */
|
|
@@ -2771,25 +2771,6 @@ interface PasswordResetFormProps {
|
|
|
2771
2771
|
}
|
|
2772
2772
|
declare function PasswordResetForm({ onSuccess, onError, className }: PasswordResetFormProps): react_jsx_runtime.JSX.Element;
|
|
2773
2773
|
|
|
2774
|
-
interface FileUploadProps {
|
|
2775
|
-
supabase: SupabaseClient;
|
|
2776
|
-
appName: string;
|
|
2777
|
-
orgId: string;
|
|
2778
|
-
onUploadComplete?: (result: {
|
|
2779
|
-
success: boolean;
|
|
2780
|
-
path?: string;
|
|
2781
|
-
error?: string;
|
|
2782
|
-
}) => void;
|
|
2783
|
-
onUploadStart?: () => void;
|
|
2784
|
-
accept?: string;
|
|
2785
|
-
maxSize?: number;
|
|
2786
|
-
multiple?: boolean;
|
|
2787
|
-
disabled?: boolean;
|
|
2788
|
-
className?: string;
|
|
2789
|
-
children?: React__default.ReactNode;
|
|
2790
|
-
}
|
|
2791
|
-
declare function FileUpload({ supabase, appName, orgId, onUploadComplete, onUploadStart, accept, maxSize, multiple, disabled, className, children }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
2792
|
-
|
|
2793
2774
|
/**
|
|
2794
2775
|
* Storage utility types for pace-core
|
|
2795
2776
|
*/
|
|
@@ -3427,4 +3408,4 @@ declare function PublicLoadingSkeleton({ lines, className }: {
|
|
|
3427
3408
|
className?: string;
|
|
3428
3409
|
}): react_jsx_runtime.JSX.Element;
|
|
3429
3410
|
|
|
3430
|
-
export {
|
|
3411
|
+
export { SelectValue as $, Alert as A, Button as B, Card as C, Dialog as D, DialogTrigger as E, DialogClose as F, DialogContent as G, DialogHeader as H, Input as I, DialogBody as J, DialogFooter as K, Label as L, DialogTitle as M, DialogDescription as N, type DialogProps as O, Progress as P, type DialogTriggerProps as Q, type DialogContentProps as R, type DialogOverlayProps as S, Table as T, type DialogHeaderProps as U, type DialogFooterProps as V, type DialogTitleProps as W, type DialogDescriptionProps as X, type DialogSize as Y, Select as Z, SelectGroup as _, type ButtonProps as a, type PublicPageLayoutProps as a$, SelectTrigger as a0, SelectContent as a1, SelectLabel as a2, SelectItem as a3, SelectSeparator as a4, Toast as a5, Toaster as a6, ToastAction as a7, ToastProvider as a8, ToastViewport as a9, type ErrorBoundaryState as aA, LoadingSpinner as aB, EventSelector as aC, PasswordResetForm as aD, useStorage as aE, useFileUpload as aF, type UseStorageOptions as aG, type UseStorageReturn as aH, PublicPageLayout as aI, usePublicPageContext$1 as aJ, PublicPageHeader as aK, PublicPageProvider as aL, usePublicPageContext as aM, useIsPublicPage as aN, PublicPageFooter as aO, PublicPageDebugger as aP, PublicPageDiagnostic as aQ, PublicPageContextChecker as aR, EventLogo as aS, EventLogoCompact as aT, EventLogoLarge as aU, PublicErrorBoundary as aV, useErrorBoundary as aW, DefaultPublicErrorFallback as aX, PublicLoadingSpinner as aY, PublicLoadingSpinnerFullPage as aZ, PublicLoadingSkeleton as a_, ToastTitle as aa, ToastDescription as ab, ToastClose as ac, useToast as ad, type ToastActionElement as ae, type ToastProps as af, Tooltip as ag, TooltipTrigger as ah, TooltipContent as ai, TooltipProvider as aj, TooltipRoot as ak, Form as al, type FormProps as am, LoginForm as an, type LoginFormProps as ao, Header as ap, Footer as aq, type FooterProps as ar, NavigationMenu as as, type NavigationMenuProps as at, type NavigationItem as au, OrganisationSelector as av, type OrganisationSelectorProps as aw, UserMenu as ax, ErrorBoundary as ay, type ErrorBoundaryProps as az, CardHeader as b, type PublicPageHeaderProps as b0, type PublicPageFooterProps as b1, type EventLogoProps as b2, type PublicErrorBoundaryProps as b3, type PublicErrorBoundaryState as b4, type PublicLoadingSpinnerProps as b5, type PaceAppLayoutProps as b6, PaceAppLayout as b7, type PaceLoginPageProps as b8, PaceLoginPage as b9, type FileSizeLimits as ba, type StorageConfig as bb, type StorageUploadOptions as bc, type StorageFileMetadata as bd, type StorageUploadResult as be, type StorageUrlOptions as bf, type StorageListOptions as bg, type StorageListResult as bh, type UserMenuProps as bi, type StorageFileInfo as bj, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type LabelProps as k, AlertTitle as l, AlertDescription as m, Avatar as n, AvatarImage as o, AvatarFallback as p, Checkbox as q, TableHeader as r, TableBody as s, TableCaption as t, TableCell as u, TableFooter as v, TableHead as w, TableRow as x, DialogPortal as y, DialogOverlay as z };
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
isPermittedCached,
|
|
17
17
|
isSuperAdmin,
|
|
18
18
|
setupRBAC
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-KLPVOPRI.js";
|
|
20
|
+
import "./chunk-B2WTCLCV.js";
|
|
21
21
|
import "./chunk-PLDDJCW6.js";
|
|
22
22
|
export {
|
|
23
23
|
clearCache,
|
|
@@ -38,4 +38,4 @@ export {
|
|
|
38
38
|
isSuperAdmin,
|
|
39
39
|
setupRBAC
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=api-
|
|
41
|
+
//# sourceMappingURL=api-LUNF5O6M.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
-
import { S as SecureQueryOptions } from './organisation-CO3Sh3_D.js';
|
|
3
2
|
import { ClassValue } from 'clsx';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -23,6 +22,15 @@ interface DatabaseData {
|
|
|
23
22
|
interface DatabaseFilters {
|
|
24
23
|
[key: string]: unknown;
|
|
25
24
|
}
|
|
25
|
+
interface SecureQueryOptions {
|
|
26
|
+
table: string;
|
|
27
|
+
select: string;
|
|
28
|
+
organisationId: string;
|
|
29
|
+
filters?: DatabaseFilters;
|
|
30
|
+
orderBy?: string;
|
|
31
|
+
limit?: number;
|
|
32
|
+
offset?: number;
|
|
33
|
+
}
|
|
26
34
|
interface SecureDataAccess {
|
|
27
35
|
secureQuery: <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions) => Promise<T[]>;
|
|
28
36
|
secureSingleQuery: <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions) => Promise<T | null>;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getCurrentAppNameWithFallback,
|
|
8
8
|
init_appNameResolver,
|
|
9
9
|
setRBACAppName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5BSLGBYI.js";
|
|
11
11
|
import "./chunk-PLDDJCW6.js";
|
|
12
12
|
init_appNameResolver();
|
|
13
13
|
export {
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
getCurrentAppNameWithFallback,
|
|
20
20
|
setRBACAppName
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=appNameResolver-
|
|
22
|
+
//# sourceMappingURL=appNameResolver-UURKN7NF.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
emitAuditEvent,
|
|
5
5
|
getGlobalAuditManager,
|
|
6
6
|
setGlobalAuditManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B2WTCLCV.js";
|
|
8
8
|
import "./chunk-PLDDJCW6.js";
|
|
9
9
|
export {
|
|
10
10
|
RBACAuditManager,
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
getGlobalAuditManager,
|
|
14
14
|
setGlobalAuditManager
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=audit-
|
|
16
|
+
//# sourceMappingURL=audit-6TOCAMKO.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
init_UnifiedAuthProvider,
|
|
4
4
|
useOrganisations,
|
|
5
5
|
useUnifiedAuth
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ASXSJGPW.js";
|
|
7
7
|
import {
|
|
8
8
|
DebugLogger,
|
|
9
9
|
init_debugLogger,
|
|
10
10
|
init_organisationContext,
|
|
11
11
|
setOrganisationContext
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-D7ARGIA3.js";
|
|
13
13
|
import {
|
|
14
14
|
__esm,
|
|
15
15
|
__export
|
|
@@ -296,4 +296,4 @@ export {
|
|
|
296
296
|
EventProvider_exports,
|
|
297
297
|
init_EventProvider
|
|
298
298
|
};
|
|
299
|
-
//# sourceMappingURL=chunk-
|
|
299
|
+
//# sourceMappingURL=chunk-2DFCT6D3.js.map
|
|
@@ -4,25 +4,25 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
useAccessLevel,
|
|
6
6
|
useCan
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N6XMGSGD.js";
|
|
8
8
|
import {
|
|
9
9
|
OrganisationContextRequiredError,
|
|
10
10
|
RBACCache,
|
|
11
11
|
getRBACLogger,
|
|
12
12
|
rbacCache
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KLPVOPRI.js";
|
|
14
14
|
import {
|
|
15
15
|
useSecureDataAccess
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YEHO6FDW.js";
|
|
17
17
|
import {
|
|
18
18
|
init_RBACProvider,
|
|
19
19
|
init_UnifiedAuthProvider,
|
|
20
20
|
useUnifiedAuth
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ASXSJGPW.js";
|
|
22
22
|
import {
|
|
23
23
|
getCurrentAppName,
|
|
24
24
|
init_appNameResolver
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-5BSLGBYI.js";
|
|
26
26
|
|
|
27
27
|
// src/rbac/secureClient.ts
|
|
28
28
|
import { createClient } from "@supabase/supabase-js";
|
|
@@ -330,7 +330,7 @@ var PagePermissionGuardComponent = ({
|
|
|
330
330
|
}
|
|
331
331
|
if (selectedOrganisationId && selectedEventId) {
|
|
332
332
|
if (!appId) {
|
|
333
|
-
if (
|
|
333
|
+
if (import.meta.env.MODE === "test") {
|
|
334
334
|
console.warn("[PagePermissionGuard] App ID not resolved in test environment, proceeding without it");
|
|
335
335
|
} else {
|
|
336
336
|
console.error("[PagePermissionGuard] CRITICAL: App ID not resolved. Check console for details.");
|
|
@@ -339,7 +339,7 @@ var PagePermissionGuardComponent = ({
|
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
if (appId) {
|
|
342
|
+
if (import.meta.env.MODE === "production" && appId) {
|
|
343
343
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
344
344
|
if (!uuidRegex.test(appId)) {
|
|
345
345
|
console.error("[PagePermissionGuard] CRITICAL: App ID is not a valid UUID:", appId);
|
|
@@ -359,7 +359,7 @@ var PagePermissionGuardComponent = ({
|
|
|
359
359
|
}
|
|
360
360
|
if (selectedOrganisationId) {
|
|
361
361
|
if (!appId) {
|
|
362
|
-
if (
|
|
362
|
+
if (import.meta.env.MODE === "test") {
|
|
363
363
|
console.warn("[PagePermissionGuard] App ID not resolved in test environment, proceeding without it");
|
|
364
364
|
} else {
|
|
365
365
|
console.error("[PagePermissionGuard] CRITICAL: App ID not resolved. Check console for details.");
|
|
@@ -368,7 +368,7 @@ var PagePermissionGuardComponent = ({
|
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
if (appId) {
|
|
371
|
+
if (import.meta.env.MODE === "production" && appId) {
|
|
372
372
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
373
373
|
if (!uuidRegex.test(appId)) {
|
|
374
374
|
console.error("[PagePermissionGuard] CRITICAL: App ID is not a valid UUID:", appId);
|
|
@@ -1223,23 +1223,6 @@ function EnhancedNavigationMenu({
|
|
|
1223
1223
|
if (!isEnabled) return items;
|
|
1224
1224
|
return getFilteredNavigationItems(items);
|
|
1225
1225
|
}, [isEnabled, items, getFilteredNavigationItems]);
|
|
1226
|
-
const handleItemClick = useCallback8((item) => {
|
|
1227
|
-
if (onItemClick) {
|
|
1228
|
-
onItemClick(item);
|
|
1229
|
-
}
|
|
1230
|
-
if (auditLog) {
|
|
1231
|
-
console.log(`[EnhancedNavigationMenu] Navigation item clicked:`, {
|
|
1232
|
-
item: item.id,
|
|
1233
|
-
path: item.path,
|
|
1234
|
-
permissions: item.permissions,
|
|
1235
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1236
|
-
});
|
|
1237
|
-
}
|
|
1238
|
-
setNavigationHistory((prev) => {
|
|
1239
|
-
const newHistory = [item, ...prev.filter((i) => i.id !== item.id)];
|
|
1240
|
-
return newHistory.slice(0, 10);
|
|
1241
|
-
});
|
|
1242
|
-
}, [onItemClick, auditLog]);
|
|
1243
1226
|
const handleNavigationAccess = useCallback8((item, allowed) => {
|
|
1244
1227
|
if (onNavigationAccess) {
|
|
1245
1228
|
onNavigationAccess(item, allowed);
|
|
@@ -1266,6 +1249,25 @@ function EnhancedNavigationMenu({
|
|
|
1266
1249
|
});
|
|
1267
1250
|
}
|
|
1268
1251
|
}, [onStrictModeViolation, strictMode]);
|
|
1252
|
+
const handleItemClick = useCallback8((item) => {
|
|
1253
|
+
const isAuthorized = hasNavigationPermission(item);
|
|
1254
|
+
handleNavigationAccess(item, isAuthorized);
|
|
1255
|
+
if (onItemClick) {
|
|
1256
|
+
onItemClick(item);
|
|
1257
|
+
}
|
|
1258
|
+
if (auditLog) {
|
|
1259
|
+
console.log(`[EnhancedNavigationMenu] Navigation item clicked:`, {
|
|
1260
|
+
item: item.id,
|
|
1261
|
+
path: item.path,
|
|
1262
|
+
permissions: item.permissions,
|
|
1263
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
setNavigationHistory((prev) => {
|
|
1267
|
+
const newHistory = [item, ...prev.filter((i) => i.id !== item.id)];
|
|
1268
|
+
return newHistory.slice(0, 10);
|
|
1269
|
+
});
|
|
1270
|
+
}, [onItemClick, auditLog, hasNavigationPermission, handleNavigationAccess]);
|
|
1269
1271
|
const defaultRenderItem = useCallback8((item, isAuthorized) => {
|
|
1270
1272
|
const isActive = activePath === item.path;
|
|
1271
1273
|
const isDisabled = !isAuthorized;
|
|
@@ -1503,7 +1505,7 @@ function withPermissionGuard(config, handler) {
|
|
|
1503
1505
|
if (!userId || !organisationId) {
|
|
1504
1506
|
throw new Error("User context required for permission check");
|
|
1505
1507
|
}
|
|
1506
|
-
const { isPermitted: isPermitted2 } = await import("./api-
|
|
1508
|
+
const { isPermitted: isPermitted2 } = await import("./api-LUNF5O6M.js");
|
|
1507
1509
|
const hasPermission2 = await isPermitted2({
|
|
1508
1510
|
userId,
|
|
1509
1511
|
scope: { organisationId, eventId, appId },
|
|
@@ -1526,7 +1528,7 @@ function withAccessLevelGuard(minLevel, handler) {
|
|
|
1526
1528
|
if (!userId || !organisationId) {
|
|
1527
1529
|
throw new Error("User context required for access level check");
|
|
1528
1530
|
}
|
|
1529
|
-
const { getAccessLevel: getAccessLevel2 } = await import("./api-
|
|
1531
|
+
const { getAccessLevel: getAccessLevel2 } = await import("./api-LUNF5O6M.js");
|
|
1530
1532
|
const accessLevel = await getAccessLevel2({
|
|
1531
1533
|
userId,
|
|
1532
1534
|
scope: { organisationId, eventId, appId }
|
|
@@ -1551,11 +1553,11 @@ function withRoleGuard(config, handler) {
|
|
|
1551
1553
|
throw new Error("User context required for role check");
|
|
1552
1554
|
}
|
|
1553
1555
|
if (config.globalRoles && config.globalRoles.length > 0) {
|
|
1554
|
-
const { isSuperAdmin } = await import("./api-
|
|
1556
|
+
const { isSuperAdmin } = await import("./api-LUNF5O6M.js");
|
|
1555
1557
|
const isSuper = await isSuperAdmin(userId);
|
|
1556
1558
|
if (isSuper) {
|
|
1557
1559
|
if (organisationId) {
|
|
1558
|
-
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-
|
|
1560
|
+
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-6TOCAMKO.js");
|
|
1559
1561
|
await emitAuditEvent2({
|
|
1560
1562
|
type: "permission_check",
|
|
1561
1563
|
userId,
|
|
@@ -1577,21 +1579,21 @@ function withRoleGuard(config, handler) {
|
|
|
1577
1579
|
}
|
|
1578
1580
|
}
|
|
1579
1581
|
if (config.organisationRoles && config.organisationRoles.length > 0) {
|
|
1580
|
-
const { isOrganisationAdmin } = await import("./api-
|
|
1582
|
+
const { isOrganisationAdmin } = await import("./api-LUNF5O6M.js");
|
|
1581
1583
|
const isOrgAdmin = await isOrganisationAdmin(userId, organisationId);
|
|
1582
1584
|
if (!isOrgAdmin && config.requireAll !== false) {
|
|
1583
1585
|
throw new Error(`Organisation admin role required`);
|
|
1584
1586
|
}
|
|
1585
1587
|
}
|
|
1586
1588
|
if (config.eventAppRoles && config.eventAppRoles.length > 0 && eventId && appId) {
|
|
1587
|
-
const { isEventAdmin } = await import("./api-
|
|
1589
|
+
const { isEventAdmin } = await import("./api-LUNF5O6M.js");
|
|
1588
1590
|
const isEventAdminUser = await isEventAdmin(userId, { organisationId, eventId, appId });
|
|
1589
1591
|
if (!isEventAdminUser && config.requireAll !== false) {
|
|
1590
1592
|
throw new Error(`Event admin role required`);
|
|
1591
1593
|
}
|
|
1592
1594
|
}
|
|
1593
1595
|
if (organisationId) {
|
|
1594
|
-
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-
|
|
1596
|
+
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-6TOCAMKO.js");
|
|
1595
1597
|
await emitAuditEvent2({
|
|
1596
1598
|
type: "permission_check",
|
|
1597
1599
|
userId,
|
|
@@ -1624,7 +1626,7 @@ function createRBACMiddleware(config) {
|
|
|
1624
1626
|
);
|
|
1625
1627
|
if (protectedRoute) {
|
|
1626
1628
|
try {
|
|
1627
|
-
const { isPermitted: isPermitted2 } = await import("./api-
|
|
1629
|
+
const { isPermitted: isPermitted2 } = await import("./api-LUNF5O6M.js");
|
|
1628
1630
|
const hasPermission2 = await isPermitted2({
|
|
1629
1631
|
userId,
|
|
1630
1632
|
scope: { organisationId },
|
|
@@ -1651,7 +1653,7 @@ function createRBACExpressMiddleware(config) {
|
|
|
1651
1653
|
return res.status(401).json({ error: "User context required" });
|
|
1652
1654
|
}
|
|
1653
1655
|
try {
|
|
1654
|
-
const { isPermitted: isPermitted2 } = await import("./api-
|
|
1656
|
+
const { isPermitted: isPermitted2 } = await import("./api-LUNF5O6M.js");
|
|
1655
1657
|
const hasPermission2 = await isPermitted2({
|
|
1656
1658
|
userId,
|
|
1657
1659
|
scope: { organisationId, eventId, appId },
|
|
@@ -1684,7 +1686,6 @@ function hasAnyPermissionCached(userId, scope, permissions, pageId) {
|
|
|
1684
1686
|
|
|
1685
1687
|
// src/rbac/permissions.ts
|
|
1686
1688
|
var GLOBAL_PERMISSIONS = {
|
|
1687
|
-
MANAGE_ALL: "manage:*",
|
|
1688
1689
|
READ_ALL: "read:*",
|
|
1689
1690
|
CREATE_ALL: "create:*",
|
|
1690
1691
|
UPDATE_ALL: "update:*",
|
|
@@ -1692,29 +1693,25 @@ var GLOBAL_PERMISSIONS = {
|
|
|
1692
1693
|
};
|
|
1693
1694
|
var ORGANISATION_PERMISSIONS = {
|
|
1694
1695
|
// Organisation management
|
|
1695
|
-
MANAGE_ORGANISATION: "manage:organisation",
|
|
1696
1696
|
READ_ORGANISATION: "read:organisation",
|
|
1697
1697
|
UPDATE_ORGANISATION: "update:organisation",
|
|
1698
|
+
DELETE_ORGANISATION: "delete:organisation",
|
|
1698
1699
|
// User management
|
|
1699
|
-
MANAGE_USERS: "manage:users",
|
|
1700
1700
|
READ_USERS: "read:users",
|
|
1701
1701
|
CREATE_USERS: "create:users",
|
|
1702
1702
|
UPDATE_USERS: "update:users",
|
|
1703
1703
|
DELETE_USERS: "delete:users",
|
|
1704
1704
|
// Role management
|
|
1705
|
-
MANAGE_ROLES: "manage:roles",
|
|
1706
1705
|
READ_ROLES: "read:roles",
|
|
1707
1706
|
CREATE_ROLES: "create:roles",
|
|
1708
1707
|
UPDATE_ROLES: "update:roles",
|
|
1709
1708
|
DELETE_ROLES: "delete:roles",
|
|
1710
1709
|
// Event management
|
|
1711
|
-
MANAGE_EVENTS: "manage:events",
|
|
1712
1710
|
READ_EVENTS: "read:events",
|
|
1713
1711
|
CREATE_EVENTS: "create:events",
|
|
1714
1712
|
UPDATE_EVENTS: "update:events",
|
|
1715
1713
|
DELETE_EVENTS: "delete:events",
|
|
1716
1714
|
// App management
|
|
1717
|
-
MANAGE_APPS: "manage:apps",
|
|
1718
1715
|
READ_APPS: "read:apps",
|
|
1719
1716
|
CREATE_APPS: "create:apps",
|
|
1720
1717
|
UPDATE_APPS: "update:apps",
|
|
@@ -1722,171 +1719,72 @@ var ORGANISATION_PERMISSIONS = {
|
|
|
1722
1719
|
};
|
|
1723
1720
|
var EVENT_APP_PERMISSIONS = {
|
|
1724
1721
|
// Event management
|
|
1725
|
-
MANAGE_EVENT: "manage:event",
|
|
1726
1722
|
READ_EVENT: "read:event",
|
|
1723
|
+
CREATE_EVENT: "create:event",
|
|
1727
1724
|
UPDATE_EVENT: "update:event",
|
|
1725
|
+
DELETE_EVENT: "delete:event",
|
|
1728
1726
|
// App management
|
|
1729
|
-
MANAGE_APP: "manage:app",
|
|
1730
1727
|
READ_APP: "read:app",
|
|
1728
|
+
CREATE_APP: "create:app",
|
|
1731
1729
|
UPDATE_APP: "update:app",
|
|
1730
|
+
DELETE_APP: "delete:app",
|
|
1732
1731
|
// Team management
|
|
1733
|
-
MANAGE_TEAM: "manage:team",
|
|
1734
1732
|
READ_TEAM: "read:team",
|
|
1735
1733
|
CREATE_TEAM: "create:team",
|
|
1736
1734
|
UPDATE_TEAM: "update:team",
|
|
1737
1735
|
DELETE_TEAM: "delete:team",
|
|
1738
1736
|
// Team members
|
|
1739
|
-
MANAGE_TEAM_MEMBERS: "manage:team.members",
|
|
1740
1737
|
READ_TEAM_MEMBERS: "read:team.members",
|
|
1741
1738
|
CREATE_TEAM_MEMBERS: "create:team.members",
|
|
1742
1739
|
UPDATE_TEAM_MEMBERS: "update:team.members",
|
|
1743
1740
|
DELETE_TEAM_MEMBERS: "delete:team.members",
|
|
1744
1741
|
// Event content
|
|
1745
|
-
MANAGE_EVENT_CONTENT: "manage:event.content",
|
|
1746
1742
|
READ_EVENT_CONTENT: "read:event.content",
|
|
1747
1743
|
CREATE_EVENT_CONTENT: "create:event.content",
|
|
1748
1744
|
UPDATE_EVENT_CONTENT: "update:event.content",
|
|
1749
1745
|
DELETE_EVENT_CONTENT: "delete:event.content",
|
|
1750
1746
|
// Event settings
|
|
1751
|
-
MANAGE_EVENT_SETTINGS: "manage:event.settings",
|
|
1752
1747
|
READ_EVENT_SETTINGS: "read:event.settings",
|
|
1753
|
-
|
|
1748
|
+
CREATE_EVENT_SETTINGS: "create:event.settings",
|
|
1749
|
+
UPDATE_EVENT_SETTINGS: "update:event.settings",
|
|
1750
|
+
DELETE_EVENT_SETTINGS: "delete:event.settings"
|
|
1754
1751
|
};
|
|
1755
1752
|
var PAGE_PERMISSIONS = {
|
|
1756
1753
|
// General page access
|
|
1757
1754
|
READ_PAGE: "read:page",
|
|
1758
|
-
|
|
1755
|
+
CREATE_PAGE: "create:page",
|
|
1756
|
+
UPDATE_PAGE: "update:page",
|
|
1757
|
+
DELETE_PAGE: "delete:page",
|
|
1759
1758
|
// Admin pages
|
|
1760
1759
|
READ_ADMIN: "read:admin",
|
|
1761
|
-
|
|
1760
|
+
CREATE_ADMIN: "create:admin",
|
|
1761
|
+
UPDATE_ADMIN: "update:admin",
|
|
1762
|
+
DELETE_ADMIN: "delete:admin",
|
|
1762
1763
|
// Dashboard pages
|
|
1763
1764
|
READ_DASHBOARD: "read:dashboard",
|
|
1764
|
-
|
|
1765
|
+
CREATE_DASHBOARD: "create:dashboard",
|
|
1766
|
+
UPDATE_DASHBOARD: "update:dashboard",
|
|
1767
|
+
DELETE_DASHBOARD: "delete:dashboard",
|
|
1765
1768
|
// Settings pages
|
|
1766
1769
|
READ_SETTINGS: "read:settings",
|
|
1767
|
-
|
|
1770
|
+
CREATE_SETTINGS: "create:settings",
|
|
1771
|
+
UPDATE_SETTINGS: "update:settings",
|
|
1772
|
+
DELETE_SETTINGS: "delete:settings",
|
|
1768
1773
|
// Reports pages
|
|
1769
1774
|
READ_REPORTS: "read:reports",
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
// Global admin permissions
|
|
1774
|
-
GLOBAL_ADMIN: [
|
|
1775
|
-
GLOBAL_PERMISSIONS.MANAGE_ALL,
|
|
1776
|
-
GLOBAL_PERMISSIONS.READ_ALL,
|
|
1777
|
-
GLOBAL_PERMISSIONS.CREATE_ALL,
|
|
1778
|
-
GLOBAL_PERMISSIONS.UPDATE_ALL,
|
|
1779
|
-
GLOBAL_PERMISSIONS.DELETE_ALL
|
|
1780
|
-
],
|
|
1781
|
-
// Organisation admin permissions
|
|
1782
|
-
ORG_ADMIN: [
|
|
1783
|
-
ORGANISATION_PERMISSIONS.MANAGE_ORGANISATION,
|
|
1784
|
-
ORGANISATION_PERMISSIONS.READ_ORGANISATION,
|
|
1785
|
-
ORGANISATION_PERMISSIONS.UPDATE_ORGANISATION,
|
|
1786
|
-
ORGANISATION_PERMISSIONS.MANAGE_USERS,
|
|
1787
|
-
ORGANISATION_PERMISSIONS.READ_USERS,
|
|
1788
|
-
ORGANISATION_PERMISSIONS.CREATE_USERS,
|
|
1789
|
-
ORGANISATION_PERMISSIONS.UPDATE_USERS,
|
|
1790
|
-
ORGANISATION_PERMISSIONS.DELETE_USERS,
|
|
1791
|
-
ORGANISATION_PERMISSIONS.MANAGE_ROLES,
|
|
1792
|
-
ORGANISATION_PERMISSIONS.READ_ROLES,
|
|
1793
|
-
ORGANISATION_PERMISSIONS.CREATE_ROLES,
|
|
1794
|
-
ORGANISATION_PERMISSIONS.UPDATE_ROLES,
|
|
1795
|
-
ORGANISATION_PERMISSIONS.DELETE_ROLES,
|
|
1796
|
-
ORGANISATION_PERMISSIONS.MANAGE_EVENTS,
|
|
1797
|
-
ORGANISATION_PERMISSIONS.READ_EVENTS,
|
|
1798
|
-
ORGANISATION_PERMISSIONS.CREATE_EVENTS,
|
|
1799
|
-
ORGANISATION_PERMISSIONS.UPDATE_EVENTS,
|
|
1800
|
-
ORGANISATION_PERMISSIONS.DELETE_EVENTS,
|
|
1801
|
-
ORGANISATION_PERMISSIONS.MANAGE_APPS,
|
|
1802
|
-
ORGANISATION_PERMISSIONS.READ_APPS,
|
|
1803
|
-
ORGANISATION_PERMISSIONS.CREATE_APPS,
|
|
1804
|
-
ORGANISATION_PERMISSIONS.UPDATE_APPS,
|
|
1805
|
-
ORGANISATION_PERMISSIONS.DELETE_APPS
|
|
1806
|
-
],
|
|
1807
|
-
// Event admin permissions
|
|
1808
|
-
EVENT_ADMIN: [
|
|
1809
|
-
EVENT_APP_PERMISSIONS.MANAGE_EVENT,
|
|
1810
|
-
EVENT_APP_PERMISSIONS.READ_EVENT,
|
|
1811
|
-
EVENT_APP_PERMISSIONS.UPDATE_EVENT,
|
|
1812
|
-
EVENT_APP_PERMISSIONS.MANAGE_APP,
|
|
1813
|
-
EVENT_APP_PERMISSIONS.READ_APP,
|
|
1814
|
-
EVENT_APP_PERMISSIONS.UPDATE_APP,
|
|
1815
|
-
EVENT_APP_PERMISSIONS.MANAGE_TEAM,
|
|
1816
|
-
EVENT_APP_PERMISSIONS.READ_TEAM,
|
|
1817
|
-
EVENT_APP_PERMISSIONS.CREATE_TEAM,
|
|
1818
|
-
EVENT_APP_PERMISSIONS.UPDATE_TEAM,
|
|
1819
|
-
EVENT_APP_PERMISSIONS.DELETE_TEAM,
|
|
1820
|
-
EVENT_APP_PERMISSIONS.MANAGE_TEAM_MEMBERS,
|
|
1821
|
-
EVENT_APP_PERMISSIONS.READ_TEAM_MEMBERS,
|
|
1822
|
-
EVENT_APP_PERMISSIONS.CREATE_TEAM_MEMBERS,
|
|
1823
|
-
EVENT_APP_PERMISSIONS.UPDATE_TEAM_MEMBERS,
|
|
1824
|
-
EVENT_APP_PERMISSIONS.DELETE_TEAM_MEMBERS,
|
|
1825
|
-
EVENT_APP_PERMISSIONS.MANAGE_EVENT_CONTENT,
|
|
1826
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_CONTENT,
|
|
1827
|
-
EVENT_APP_PERMISSIONS.CREATE_EVENT_CONTENT,
|
|
1828
|
-
EVENT_APP_PERMISSIONS.UPDATE_EVENT_CONTENT,
|
|
1829
|
-
EVENT_APP_PERMISSIONS.DELETE_EVENT_CONTENT,
|
|
1830
|
-
EVENT_APP_PERMISSIONS.MANAGE_EVENT_SETTINGS,
|
|
1831
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_SETTINGS,
|
|
1832
|
-
EVENT_APP_PERMISSIONS.UPDATE_EVENT_SETTINGS
|
|
1833
|
-
],
|
|
1834
|
-
// Planner permissions
|
|
1835
|
-
PLANNER: [
|
|
1836
|
-
EVENT_APP_PERMISSIONS.READ_EVENT,
|
|
1837
|
-
EVENT_APP_PERMISSIONS.UPDATE_EVENT,
|
|
1838
|
-
EVENT_APP_PERMISSIONS.READ_APP,
|
|
1839
|
-
EVENT_APP_PERMISSIONS.UPDATE_APP,
|
|
1840
|
-
EVENT_APP_PERMISSIONS.READ_TEAM,
|
|
1841
|
-
EVENT_APP_PERMISSIONS.CREATE_TEAM,
|
|
1842
|
-
EVENT_APP_PERMISSIONS.UPDATE_TEAM,
|
|
1843
|
-
EVENT_APP_PERMISSIONS.READ_TEAM_MEMBERS,
|
|
1844
|
-
EVENT_APP_PERMISSIONS.CREATE_TEAM_MEMBERS,
|
|
1845
|
-
EVENT_APP_PERMISSIONS.UPDATE_TEAM_MEMBERS,
|
|
1846
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_CONTENT,
|
|
1847
|
-
EVENT_APP_PERMISSIONS.CREATE_EVENT_CONTENT,
|
|
1848
|
-
EVENT_APP_PERMISSIONS.UPDATE_EVENT_CONTENT,
|
|
1849
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_SETTINGS,
|
|
1850
|
-
EVENT_APP_PERMISSIONS.UPDATE_EVENT_SETTINGS
|
|
1851
|
-
],
|
|
1852
|
-
// Participant permissions
|
|
1853
|
-
PARTICIPANT: [
|
|
1854
|
-
EVENT_APP_PERMISSIONS.READ_EVENT,
|
|
1855
|
-
EVENT_APP_PERMISSIONS.READ_APP,
|
|
1856
|
-
EVENT_APP_PERMISSIONS.READ_TEAM,
|
|
1857
|
-
EVENT_APP_PERMISSIONS.READ_TEAM_MEMBERS,
|
|
1858
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_CONTENT,
|
|
1859
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_SETTINGS
|
|
1860
|
-
],
|
|
1861
|
-
// Viewer permissions
|
|
1862
|
-
VIEWER: [
|
|
1863
|
-
EVENT_APP_PERMISSIONS.READ_EVENT,
|
|
1864
|
-
EVENT_APP_PERMISSIONS.READ_APP,
|
|
1865
|
-
EVENT_APP_PERMISSIONS.READ_TEAM,
|
|
1866
|
-
EVENT_APP_PERMISSIONS.READ_EVENT_CONTENT
|
|
1867
|
-
]
|
|
1775
|
+
CREATE_REPORTS: "create:reports",
|
|
1776
|
+
UPDATE_REPORTS: "update:reports",
|
|
1777
|
+
DELETE_REPORTS: "delete:reports"
|
|
1868
1778
|
};
|
|
1869
1779
|
function isValidPermission(permission) {
|
|
1870
|
-
const pattern = /^(read|create|update|delete
|
|
1780
|
+
const pattern = /^(read|create|update|delete):[a-z0-9]+(\.[a-z0-9]+)*$|^(read|create|update|delete):\*$/;
|
|
1871
1781
|
return pattern.test(permission);
|
|
1872
1782
|
}
|
|
1873
1783
|
function getPermissionsForRole(role) {
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
return [...PERMISSION_GROUPS.ORG_ADMIN];
|
|
1879
|
-
case "event_admin":
|
|
1880
|
-
return [...PERMISSION_GROUPS.EVENT_ADMIN];
|
|
1881
|
-
case "planner":
|
|
1882
|
-
return [...PERMISSION_GROUPS.PLANNER];
|
|
1883
|
-
case "participant":
|
|
1884
|
-
return [...PERMISSION_GROUPS.PARTICIPANT];
|
|
1885
|
-
case "viewer":
|
|
1886
|
-
return [...PERMISSION_GROUPS.VIEWER];
|
|
1887
|
-
default:
|
|
1888
|
-
return [];
|
|
1889
|
-
}
|
|
1784
|
+
console.warn(
|
|
1785
|
+
`[RBAC] getPermissionsForRole() is deprecated. Permissions must be queried from rbac_page_permissions table. Called with role: ${role}`
|
|
1786
|
+
);
|
|
1787
|
+
return [];
|
|
1890
1788
|
}
|
|
1891
1789
|
var ALL_PERMISSIONS = {
|
|
1892
1790
|
...GLOBAL_PERMISSIONS,
|
|
@@ -1924,9 +1822,8 @@ export {
|
|
|
1924
1822
|
ORGANISATION_PERMISSIONS,
|
|
1925
1823
|
EVENT_APP_PERMISSIONS,
|
|
1926
1824
|
PAGE_PERMISSIONS,
|
|
1927
|
-
PERMISSION_GROUPS,
|
|
1928
1825
|
isValidPermission,
|
|
1929
1826
|
getPermissionsForRole,
|
|
1930
1827
|
ALL_PERMISSIONS
|
|
1931
1828
|
};
|
|
1932
|
-
//# sourceMappingURL=chunk-
|
|
1829
|
+
//# sourceMappingURL=chunk-3JKVVLD3.js.map
|