@jmruthers/pace-core 0.5.67 → 0.5.69
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 +26 -0
- package/dist/{DataTable-MFUXNGPR.js → DataTable-MPBSXUC6.js} +5 -6
- package/dist/{PublicLoadingSpinner-DdKXTkCZ.d.ts → PublicLoadingSpinner-BOdyU3u-.d.ts} +1 -1
- package/dist/{UnifiedAuthProvider-CQNiemcB.d.ts → UnifiedAuthProvider-D02AMXgO.d.ts} +3 -3
- package/dist/{chunk-CKNY7HYS.js → chunk-2ARQW6VX.js} +3 -3
- package/dist/{chunk-T2MQY57J.js → chunk-6JILXFEA.js} +335 -5
- package/dist/chunk-6JILXFEA.js.map +1 -0
- package/dist/{chunk-D7ARGIA3.js → chunk-6RBH67W7.js} +23 -6
- package/dist/chunk-6RBH67W7.js.map +1 -0
- package/dist/{chunk-C7GUF747.js → chunk-FJTAWPAQ.js} +3 -5
- package/dist/{chunk-C7GUF747.js.map → chunk-FJTAWPAQ.js.map} +1 -1
- package/dist/{chunk-4HQ5BOVZ.js → chunk-NO5QHMDX.js} +7 -6
- package/dist/chunk-NO5QHMDX.js.map +1 -0
- package/dist/{chunk-ZPK5656W.js → chunk-O3NWNXDY.js} +4 -5
- package/dist/chunk-O3NWNXDY.js.map +1 -0
- package/dist/{chunk-BTCA3ENN.js → chunk-Q2UP3ZWQ.js} +4 -4
- package/dist/{chunk-QVEOQVD4.js → chunk-RVYGJPOD.js} +173 -20
- package/dist/chunk-RVYGJPOD.js.map +1 -0
- package/dist/{chunk-FVDOEGGG.js → chunk-UCMHBF7Y.js} +3 -5
- package/dist/{chunk-FVDOEGGG.js.map → chunk-UCMHBF7Y.js.map} +1 -1
- package/dist/{chunk-T6HVDA24.js → chunk-V3QO3LL7.js} +5 -7
- package/dist/chunk-V3QO3LL7.js.map +1 -0
- package/dist/{chunk-ZB6AEA7I.js → chunk-ZXJGZLLO.js} +17 -17
- package/dist/{chunk-ZB6AEA7I.js.map → chunk-ZXJGZLLO.js.map} +1 -1
- package/dist/components.d.ts +2 -2
- package/dist/components.js +8 -9
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +9 -6
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +5 -7
- package/dist/rbac/index.js +5 -6
- package/dist/{usePublicRouteParams-CdoFxnJK.d.ts → usePublicRouteParams-Ua1Vz-HG.d.ts} +35 -1
- package/dist/utils.d.ts +4 -1
- package/dist/utils.js +3 -3
- package/docs/DOCUMENTATION_CHECKLIST.md +281 -0
- package/docs/README.md +22 -10
- package/docs/api/README.md +26 -0
- 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/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 +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 +2 -2
- 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 +4 -4
- 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 +39 -14
- package/docs/api-reference/providers.md +16 -7
- package/docs/architecture/services.md +374 -0
- package/docs/best-practices/README.md +1 -1
- package/docs/best-practices/testing.md +1 -1
- package/docs/breaking-changes.md +182 -0
- package/docs/common-patterns.md +445 -0
- package/docs/core-concepts/authentication.md +26 -11
- package/docs/core-concepts/events.md +2 -0
- package/docs/core-concepts/organisations.md +2 -0
- package/docs/core-concepts/permissions.md +2 -0
- package/docs/{INDEX.md → documentation-index.md} +26 -38
- package/docs/faq.md +286 -0
- package/docs/{FILE_REFERENCE_SYSTEM.md → file-reference-system.md} +1 -1
- package/docs/getting-started/installation-guide.md +284 -0
- package/docs/getting-started/quick-start.md +8 -1
- package/docs/implementation-guides/app-layout.md +3 -1
- package/docs/implementation-guides/data-tables.md +2 -0
- package/docs/implementation-guides/dynamic-colors.md +47 -2
- package/docs/implementation-guides/event-theming-summary.md +220 -0
- package/docs/implementation-guides/forms.md +9 -7
- package/docs/implementation-guides/navigation.md +2 -0
- package/docs/migration/service-architecture.md +351 -0
- package/docs/migration-guides/unified-auth-provider-mandatory-timeouts.md +226 -0
- package/docs/rbac/README-rbac-rls-integration.md +2 -2
- package/docs/rbac/README.md +1 -1
- package/docs/rbac/examples/rbac-rls-integration-example.md +3 -3
- package/docs/rbac/quick-start.md +2 -0
- package/docs/rbac/rbac-rls-integration.md +2 -2
- package/docs/security/README.md +5 -1
- package/docs/style-guide.md +136 -1
- package/docs/testing/README.md +1 -1
- package/docs/troubleshooting/authentication-issues.md +334 -0
- package/docs/troubleshooting/common-issues.md +2 -0
- package/docs/troubleshooting/styling-issues.md +199 -144
- package/docs/usage.md +23 -2
- package/package.json +1 -1
- package/src/__tests__/{TESTING_GUIDELINES.md → TEST_GUIDE_CURSOR.md} +20 -0
- package/src/__tests__/TEST_GUIDE_HUMAN.md +103 -0
- package/src/__tests__/fixtures/test-data.ts +90 -0
- package/src/__tests__/helpers/__tests__/component-test-utils.test.tsx +260 -0
- package/src/__tests__/helpers/__tests__/optimized-test-setup.test.ts +224 -0
- package/src/__tests__/helpers/__tests__/supabaseMock.test.ts +273 -0
- package/src/__tests__/helpers/__tests__/test-providers.test.tsx +98 -0
- package/src/__tests__/helpers/__tests__/test-utils.test.tsx +436 -0
- package/src/__tests__/helpers/__tests__/timer-utils.test.ts +371 -0
- package/src/__tests__/helpers/component-test-utils.tsx +14 -4
- package/src/__tests__/helpers/optimized-test-setup.ts +68 -0
- package/src/__tests__/helpers/test-providers.tsx +329 -0
- package/src/__tests__/helpers/test-utils.tsx +91 -45
- package/src/__tests__/helpers/timer-utils.ts +71 -0
- package/src/__tests__/hooks/usePermissions.test.ts +1 -5
- package/src/__tests__/integration/UserProfile.test.tsx +1 -5
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +42 -12
- package/src/__tests__/setup.ts +34 -28
- package/src/components/Alert/Alert.test.tsx +1 -5
- package/src/components/Avatar/Avatar.test.tsx +1 -5
- package/src/components/Button/Button.test.tsx +4 -20
- package/src/components/Card/Card.test.tsx +1 -5
- package/src/components/Checkbox/Checkbox.test.tsx +1 -5
- package/src/components/DataTable/__tests__/DataTable.comprehensive.test.tsx +1 -5
- package/src/components/DataTable/__tests__/DataTable.test.tsx +45 -49
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +1 -5
- package/src/components/DataTable/__tests__/styles.test.ts +382 -0
- package/src/components/DataTable/context/__tests__/DataTableContext.test.tsx +409 -0
- package/src/components/DataTable/core/__tests__/ActionManager.test.ts +634 -0
- package/src/components/DataTable/core/__tests__/DataManager.test.ts +519 -0
- package/src/components/DataTable/core/__tests__/StateManager.test.ts +714 -0
- package/src/components/DataTable/hooks/__tests__/useDataTableState.test.ts +592 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +354 -0
- package/src/components/DataTable/utils/__tests__/hierarchicalUtils.test.ts +539 -0
- package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +1 -5
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +1 -8
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +34 -38
- package/src/components/Footer/Footer.test.tsx +1 -5
- package/src/components/Form/Form.test.tsx +22 -35
- package/src/components/Header/Header.test.tsx +1 -9
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +1 -5
- package/src/components/Input/Input.test.tsx +2 -10
- package/src/components/LoginForm/LoginForm.test.tsx +1 -5
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +24 -24
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +1 -6
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +6 -16
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +1 -5
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +1 -5
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +1 -7
- package/src/components/PasswordReset/PasswordChangeForm.test.tsx +1 -9
- package/src/components/PasswordReset/PasswordResetForm.test.tsx +1 -9
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +4 -5
- package/src/components/PublicLayout/PublicPageHeader.tsx +13 -9
- package/src/components/PublicLayout/__tests__/EventLogo.test.tsx +666 -0
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +457 -0
- package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +393 -0
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +351 -0
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +374 -0
- package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +388 -0
- package/src/components/Select/Select.bug-test.tsx +69 -0
- package/src/components/Select/Select.refactored.tsx +497 -0
- package/src/components/Select/Select.test.tsx +42 -49
- package/src/components/Select/Select.tsx +5 -2
- package/src/components/Select/hooks.ts +254 -0
- package/src/components/Switch/Switch.test.tsx +1 -5
- package/src/components/Table/__tests__/Table.test.tsx +775 -0
- package/src/components/Toast/Toast.test.tsx +15 -8
- package/src/components/Tooltip/Tooltip.test.tsx +1 -5
- package/src/components/UserMenu/UserMenu.test.tsx +3 -15
- package/src/components/__tests__/FileDisplay.test.tsx +575 -0
- package/src/components/__tests__/FileUpload.test.tsx +446 -0
- package/src/components/__tests__/SuperAdminGuard.test.tsx +422 -354
- package/src/hooks/__tests__/ServiceHooks.test.tsx +613 -0
- package/src/hooks/__tests__/hooks.integration.test.tsx +1 -10
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +10 -14
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +307 -0
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +1 -6
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +1 -5
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +6 -9
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +321 -0
- package/src/hooks/__tests__/usePublicEvent.unit.test.ts +583 -0
- package/src/hooks/__tests__/usePublicEventLogo.unit.test.ts +640 -0
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +435 -0
- package/src/hooks/__tests__/useRBAC.unit.test.ts +10 -10
- package/src/hooks/__tests__/useStorage.unit.test.ts +751 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/public/usePublicEvent.ts +181 -13
- package/src/hooks/public/usePublicRouteParams.ts +13 -3
- package/src/hooks/services/useAuth.ts +50 -0
- package/src/hooks/services/useAuthService.ts +30 -0
- package/src/hooks/services/useCurrentEvent.ts +36 -0
- package/src/hooks/services/useCurrentOrganisation.ts +52 -0
- package/src/hooks/services/useEventService.ts +30 -0
- package/src/hooks/services/useInactivityService.ts +30 -0
- package/src/hooks/services/useOrganisationService.ts +30 -0
- package/src/hooks/services/usePermissions.ts +70 -0
- package/src/hooks/services/useRBACService.ts +30 -0
- package/src/hooks/useCounter.test.ts +1 -5
- package/src/hooks/useEventTheme.ts +86 -0
- package/src/hooks/useOrganisationPermissions.test.ts +2 -5
- package/src/hooks/useOrganisationSecurity.test.ts +1 -5
- package/src/hooks/usePermissionCache.test.ts +1 -5
- package/src/hooks/usePermissionCheck.ts +150 -0
- package/src/hooks/useSecureDataAccess.test.ts +1 -5
- package/src/index.ts +1 -0
- package/src/providers/OrganisationProvider.test.tsx +1 -5
- package/src/providers/OrganisationProvider.tsx +56 -4
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +42 -6
- package/src/providers/UnifiedAuthProvider.test.tsx +1 -5
- package/src/providers/UnifiedAuthProvider.tsx +4 -4
- package/src/providers/__tests__/AuthProvider.test.tsx +105 -439
- package/src/providers/__tests__/AuthProvider.test.tsx.backup +771 -0
- package/src/providers/__tests__/EventProvider.test.tsx +211 -110
- package/src/providers/__tests__/EventProvider.test.tsx.backup +824 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +1 -5
- package/src/providers/__tests__/OrganisationProvider.test.tsx +97 -261
- package/src/providers/__tests__/OrganisationProvider.test.tsx.backup +820 -0
- package/src/providers/__tests__/ServiceProviders.test.tsx +477 -0
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +72 -504
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup +911 -0
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup2 +166 -0
- package/src/providers/services/AuthServiceProvider.tsx +65 -0
- package/src/providers/services/EventServiceProvider.tsx +83 -0
- package/src/providers/services/InactivityServiceProvider.tsx +83 -0
- package/src/providers/services/OrganisationServiceProvider.tsx +77 -0
- package/src/providers/services/RBACServiceProvider.tsx +79 -0
- package/src/providers/services/UnifiedAuthProvider.tsx +368 -0
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +210 -0
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +269 -0
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +892 -0
- package/src/rbac/__tests__/engine.comprehensive.test.ts +954 -0
- package/src/rbac/__tests__/integration.authflow.test.tsx +1 -5
- package/src/rbac/__tests__/integration.navigation.test.tsx +1 -4
- package/src/rbac/__tests__/rbac-core.test.tsx +2 -7
- package/src/rbac/__tests__/rbac-functions.test.ts +1 -9
- package/src/rbac/__tests__/rbac-integration.test.ts +1 -9
- package/src/rbac/api.test.ts +1 -9
- package/src/rbac/cache.test.ts +10 -8
- package/src/rbac/cli/__tests__/policy-manager.test.ts +339 -0
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +1 -5
- package/src/rbac/components/NavigationProvider.test.tsx +1 -5
- package/src/rbac/components/PagePermissionProvider.test.tsx +1 -5
- package/src/rbac/components/SecureDataProvider.test.tsx +1 -5
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +25 -29
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +27 -30
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +23 -27
- package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +18 -22
- package/src/rbac/config.test.ts +1 -5
- package/src/rbac/hooks/useCan.test.ts +262 -9
- package/src/rbac/hooks/usePermissions.test.ts +246 -6
- package/src/rbac/hooks/useRBAC.simple.test.ts +1 -5
- package/src/rbac/hooks/useRBAC.test.ts +472 -198
- package/src/rbac/providers/__tests__/RBACProvider.test.tsx +1 -9
- package/src/services/AuthService.ts +416 -0
- package/src/services/EventService.ts +366 -0
- package/src/services/InactivityService.ts +388 -0
- package/src/services/OrganisationService.ts +592 -0
- package/src/services/RBACService.ts +522 -0
- package/src/services/__tests__/AuthService.test.ts +356 -0
- package/src/services/__tests__/BaseService.test.ts +314 -0
- package/src/services/__tests__/EventService.test.ts +489 -0
- package/src/services/__tests__/InactivityService.test.ts +403 -0
- package/src/services/__tests__/OrganisationService.test.ts +660 -0
- package/src/services/__tests__/RBACService.test.ts +492 -0
- package/src/services/base/BaseService.ts +87 -0
- package/src/services/interfaces/IAuthService.ts +39 -0
- package/src/services/interfaces/IEventService.ts +30 -0
- package/src/services/interfaces/IInactivityService.ts +31 -0
- package/src/services/interfaces/IOrganisationService.ts +41 -0
- package/src/services/interfaces/IRBACService.ts +62 -0
- package/src/theming/__tests__/runtime.test.ts +540 -0
- package/src/types/__tests__/file-reference.test.ts +447 -0
- package/src/types/__tests__/organisation.test.ts +1133 -0
- package/src/types/__tests__/theme.test.ts +830 -0
- package/src/types/__tests__/type-validation.test.ts +527 -0
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +1 -5
- package/src/utils/__tests__/debugLogger.test.ts +417 -0
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +1 -6
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +1 -5
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +35 -35
- package/src/utils/__tests__/organisationContext.unit.test.ts +1 -5
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +5 -11
- package/src/utils/__tests__/secureErrors.unit.test.ts +1 -6
- package/src/utils/__tests__/secureStorage.unit.test.ts +1 -5
- package/src/utils/__tests__/securityMonitor.unit.test.ts +1 -5
- package/src/utils/__tests__/sessionTracking.unit.test.ts +1 -5
- package/src/utils/appIdResolver.test.ts +6 -10
- package/src/utils/appNameResolver.simple.test.ts +142 -0
- package/src/utils/appNameResolver.test.ts +31 -458
- package/src/utils/appNameResolver.test.ts.backup +494 -0
- package/src/utils/debugLogger.ts +26 -5
- package/src/utils/formatDate.test.ts +1 -5
- package/src/utils/organisationContext.test.ts +1 -5
- package/src/utils/performanceBudgets.ts +3 -4
- package/src/utils/secureDataAccess.test.ts +1 -5
- package/src/utils/storage/__tests__/helpers.unit.test.ts +1 -5
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +1 -5
- package/dist/chunk-4HQ5BOVZ.js.map +0 -1
- package/dist/chunk-D7ARGIA3.js.map +0 -1
- package/dist/chunk-QVEOQVD4.js.map +0 -1
- package/dist/chunk-T2MQY57J.js.map +0 -1
- package/dist/chunk-T6HVDA24.js.map +0 -1
- package/dist/chunk-VTJ5HCZB.js +0 -315
- package/dist/chunk-VTJ5HCZB.js.map +0 -1
- package/dist/chunk-ZPK5656W.js.map +0 -1
- package/docs/getting-started/installation.md +0 -269
- package/src/__tests__/REBUILD_PLAN.md +0 -223
- /package/dist/{DataTable-MFUXNGPR.js.map → DataTable-MPBSXUC6.js.map} +0 -0
- /package/dist/{chunk-CKNY7HYS.js.map → chunk-2ARQW6VX.js.map} +0 -0
- /package/dist/{chunk-BTCA3ENN.js.map → chunk-Q2UP3ZWQ.js.map} +0 -0
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
# PACE Core Documentation Index
|
|
2
2
|
|
|
3
|
-
> **📚 Complete Documentation Reference** | [Quick Start](./getting-started/quick-start.md) | [API Reference](./api-reference/components.md) | [Troubleshooting](./troubleshooting/README.md)
|
|
3
|
+
> **📚 Complete Documentation Reference** | [Quick Start](./getting-started/quick-start.md) | [API Reference](./api-reference/components.md) | [Troubleshooting](./troubleshooting/README.md) | [← Back to Docs](./README.md)
|
|
4
4
|
|
|
5
5
|
Complete index of all PACE Core documentation organized by topic and use case.
|
|
6
6
|
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Last Updated:** 2025-01-XX | **Version:** v0.5.65+
|
|
10
|
+
|
|
7
11
|
## 🚀 Getting Started
|
|
8
12
|
|
|
9
13
|
### First Time Users
|
|
10
|
-
- **[Installation](./getting-started/installation.md)** - Package installation and basic setup
|
|
14
|
+
- **[Installation](./getting-started/installation-guide.md)** - Package installation and basic setup (START HERE)
|
|
11
15
|
- **[Quick Start](./getting-started/quick-start.md)** - Build your first app in 10 minutes
|
|
12
16
|
- **[Examples](./getting-started/examples/README.md)** - Complete working examples
|
|
17
|
+
- **[FAQ](./faq.md)** - Common questions and quick answers
|
|
13
18
|
|
|
14
19
|
### Configuration
|
|
15
20
|
- **[Vite Configuration](./consuming-app-vite-config.md)** - **CRITICAL** Tailwind v4 setup
|
|
16
|
-
- **[Environment Setup](./getting-started/environment-setup.md)** - Environment variables
|
|
17
|
-
- **[Build Configuration](./getting-started/build-configuration.md)** - Build tool setup
|
|
18
21
|
|
|
19
22
|
## 🏗️ Core Features
|
|
20
23
|
|
|
@@ -28,8 +31,8 @@ Complete index of all PACE Core documentation organized by topic and use case.
|
|
|
28
31
|
- **[Data Tables](./implementation-guides/data-tables.md)** - Interactive data management
|
|
29
32
|
- **[Forms](./implementation-guides/forms.md)** - Form handling and validation
|
|
30
33
|
- **[File Upload & Storage](./implementation-guides/file-upload-storage.md)** - **NEW** Complete file management system
|
|
31
|
-
- **[
|
|
32
|
-
- **[
|
|
34
|
+
- **[Events](./core-concepts/events.md)** - Event management
|
|
35
|
+
- **[Organisations](./core-concepts/organisations.md)** - Multi-tenant support
|
|
33
36
|
- **[Public Pages](./implementation-guides/public-pages.md)** - Public pages without authentication
|
|
34
37
|
- **[Public Pages Advanced](./implementation-guides/public-pages-advanced.md)** - **NEW** Advanced public page patterns
|
|
35
38
|
|
|
@@ -42,14 +45,11 @@ Complete index of all PACE Core documentation organized by topic and use case.
|
|
|
42
45
|
|
|
43
46
|
### Design System
|
|
44
47
|
- **[Styling Overview](./styles/README.md)** - Complete design system
|
|
45
|
-
- **[Color Palettes](./styles/color-palettes.md)** - Main, secondary, accent colors
|
|
46
|
-
- **[Typography](./styles/typography.md)** - Font families and text styles
|
|
47
|
-
- **[Component Styling](./styles/component-styling.md)** - How components are styled
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- **[
|
|
49
|
+
## 🚨 Important Notices
|
|
50
|
+
|
|
51
|
+
### Breaking Changes
|
|
52
|
+
- **[Breaking Changes](./breaking-changes.md)** - All breaking changes (CRITICAL - read before upgrading)
|
|
53
53
|
|
|
54
54
|
## 🔧 API Reference
|
|
55
55
|
|
|
@@ -82,12 +82,9 @@ Complete index of all PACE Core documentation organized by topic and use case.
|
|
|
82
82
|
- **[Troubleshooting Overview](./troubleshooting/README.md)** - Complete guide
|
|
83
83
|
- **[Common Issues](./troubleshooting/common-issues.md)** - Frequent problems
|
|
84
84
|
- **[Styling Issues](./troubleshooting/styling-issues.md)** - Component styling
|
|
85
|
-
- **[Authentication Issues](./troubleshooting/authentication-issues.md)** - Auth problems
|
|
86
85
|
|
|
87
86
|
### Debugging
|
|
88
87
|
- **[Debugging Guide](./troubleshooting/debugging.md)** - Debug techniques
|
|
89
|
-
- **[Performance Issues](./troubleshooting/performance-issues.md)** - Performance problems
|
|
90
|
-
- **[Build Issues](./troubleshooting/build-issues.md)** - Build and deployment
|
|
91
88
|
|
|
92
89
|
## 🔄 Migration & Updates
|
|
93
90
|
|
|
@@ -99,68 +96,58 @@ Complete index of all PACE Core documentation organized by topic and use case.
|
|
|
99
96
|
- **[v0.4.15 Tailwind Scanning](./migration/v0.4.15-tailwind-scanning.md)** - Legacy approach
|
|
100
97
|
|
|
101
98
|
### Breaking Changes
|
|
102
|
-
- **[v0.x to v1.x](./migration/v0-to-v1.md)** - Major version upgrade
|
|
103
99
|
- **[RBAC Migration](./migration/rbac-migration.md)** - RBAC system updates
|
|
104
|
-
- **[Component Updates](./migration/component-updates.md)** - Component API changes
|
|
105
100
|
|
|
106
101
|
## 📖 Core Concepts
|
|
107
102
|
|
|
108
103
|
### Understanding PACE Core
|
|
109
104
|
- **[Architecture](./architecture/README.md)** - System architecture
|
|
110
|
-
- **[Design Principles](./core-concepts/design-principles.md)** - Core design philosophy
|
|
111
|
-
- **[Security Model](./core-concepts/security-model.md)** - Security architecture
|
|
112
|
-
- **[Performance Model](./core-concepts/performance-model.md)** - Performance considerations
|
|
113
105
|
|
|
114
106
|
### Key Concepts
|
|
107
|
+
- **[Authentication](./core-concepts/authentication.md)** - User management and sessions
|
|
115
108
|
- **[Permissions](./core-concepts/permissions.md)** - Permission system
|
|
116
109
|
- **[Events](./core-concepts/events.md)** - Event management
|
|
117
110
|
- **[Organisations](./core-concepts/organisations.md)** - Multi-tenancy
|
|
118
|
-
- **[Context Management](./core-concepts/context-management.md)** - React context usage
|
|
119
111
|
|
|
120
112
|
## 🛠️ Implementation Guides
|
|
121
113
|
|
|
122
114
|
### Application Structure
|
|
123
115
|
- **[App Layout](./implementation-guides/app-layout.md)** - Layout patterns
|
|
124
116
|
- **[Navigation](./implementation-guides/navigation.md)** - Navigation systems
|
|
125
|
-
- **[Routing](./implementation-guides/routing.md)** - URL routing
|
|
126
|
-
- **[State Management](./implementation-guides/state-management.md)** - Application state
|
|
127
117
|
|
|
128
118
|
### Data & Forms
|
|
129
119
|
- **[Data Tables](./implementation-guides/data-tables.md)** - Data management
|
|
130
120
|
- **[Forms](./implementation-guides/forms.md)** - Form implementation
|
|
131
|
-
- **[
|
|
132
|
-
- **[File Upload](./implementation-guides/file-upload.md)** - File handling
|
|
121
|
+
- **[File Upload & Storage](./implementation-guides/file-upload-storage.md)** - File handling
|
|
133
122
|
|
|
134
123
|
### Advanced Features
|
|
135
124
|
- **[Permission Enforcement](./implementation-guides/permission-enforcement.md)** - Security implementation
|
|
136
125
|
- **[Inactivity Tracking](./implementation-guides/inactivity-tracking.md)** - **NEW** User session management
|
|
137
126
|
- **[Organisation Security](./implementation-guides/organisation-security.md)** - **NEW** Advanced security patterns
|
|
138
|
-
- **[
|
|
139
|
-
- **[
|
|
127
|
+
- **[Public Pages](./implementation-guides/public-pages.md)** - Public pages without authentication
|
|
128
|
+
- **[Public Pages Advanced](./implementation-guides/public-pages-advanced.md)** - **NEW** Advanced public page patterns
|
|
140
129
|
|
|
141
130
|
## 🎨 Styling Guides
|
|
142
131
|
|
|
143
132
|
### Design System
|
|
144
|
-
- **[
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
- **[Spacing](./styles/spacing.md)** - Layout spacing
|
|
133
|
+
- **[Styling Overview](./styles/README.md)** - Complete design system
|
|
134
|
+
|
|
135
|
+
## 🎯 Common Patterns
|
|
148
136
|
|
|
149
|
-
|
|
150
|
-
- **[Theme Customization](./styles/theme-customization.md)** - Custom themes
|
|
151
|
-
- **[Component Customization](./styles/component-customization.md)** - Styling components
|
|
152
|
-
- **[CSS Architecture](./styles/css-architecture.md)** - CSS organization
|
|
153
|
-
- **[Responsive Design](./styles/responsive-design.md)** - Mobile-first approach
|
|
137
|
+
- **[Common Patterns](./common-patterns.md)** - Reusable code patterns and best practices
|
|
154
138
|
|
|
155
139
|
## 🔍 Search by Use Case
|
|
156
140
|
|
|
157
141
|
### I want to...
|
|
158
142
|
- **Build a new app** → [Quick Start](./getting-started/quick-start.md)
|
|
143
|
+
- **See code patterns** → [Common Patterns](./common-patterns.md)
|
|
159
144
|
- **Add authentication** → [Authentication Guide](./core-concepts/authentication.md)
|
|
160
145
|
- **Implement permissions** → [RBAC System](./rbac/README.md)
|
|
161
146
|
- **Create data tables** → [Data Tables Guide](./implementation-guides/data-tables.md)
|
|
162
147
|
- **Style my app** → [Styling Overview](./styles/README.md)
|
|
163
148
|
- **Fix styling issues** → [Troubleshooting - Styling](./troubleshooting/styling-issues.md)
|
|
149
|
+
- **Find quick answers** → [FAQ](./faq.md)
|
|
150
|
+
- **Check breaking changes** → [Breaking Changes](./breaking-changes.md)
|
|
164
151
|
- **Optimize performance** → [Performance Best Practices](./best-practices/performance.md)
|
|
165
152
|
- **Deploy to production** → [Deployment Guide](./best-practices/deployment.md)
|
|
166
153
|
- **Migrate from v0.x** → [Migration Guide](./migration/README.md)
|
|
@@ -173,6 +160,7 @@ Complete index of all PACE Core documentation organized by topic and use case.
|
|
|
173
160
|
- **Best practices** → [Best Practices](./best-practices/README.md)
|
|
174
161
|
- **Security guidelines** → [Security Best Practices](./best-practices/security.md)
|
|
175
162
|
- **Performance tips** → [Performance Best Practices](./best-practices/performance.md)
|
|
163
|
+
- **Deployment guide** → [Deployment Best Practices](./best-practices/deployment.md)
|
|
176
164
|
- **Testing strategies** → [Testing Best Practices](./best-practices/testing.md)
|
|
177
165
|
|
|
178
166
|
## 📚 Additional Resources
|
|
@@ -187,7 +175,7 @@ Complete index of all PACE Core documentation organized by topic and use case.
|
|
|
187
175
|
- **[GitHub Repository](https://github.com/jmruthers/pace-core)** - Source code
|
|
188
176
|
- **[Issue Tracker](https://github.com/jmruthers/pace-core/issues)** - Bug reports
|
|
189
177
|
- **[Discussions](https://github.com/jmruthers/pace-core/discussions)** - Community help
|
|
190
|
-
- **[
|
|
178
|
+
- **[Migration Guides](./migration/MIGRATION_GUIDE.md)** - Version history and migration info
|
|
191
179
|
|
|
192
180
|
---
|
|
193
181
|
|
package/docs/faq.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# PACE Core FAQ
|
|
2
|
+
|
|
3
|
+
> **📚 Frequently Asked Questions** | [← Back to Documentation](./README.md)
|
|
4
|
+
|
|
5
|
+
Common questions and quick answers about PACE Core.
|
|
6
|
+
|
|
7
|
+
## Installation & Setup
|
|
8
|
+
|
|
9
|
+
### How do I install PACE Core?
|
|
10
|
+
|
|
11
|
+
See the [Installation Guide](./getting-started/installation-guide.md) for complete step-by-step instructions.
|
|
12
|
+
|
|
13
|
+
**Quick answer:**
|
|
14
|
+
```bash
|
|
15
|
+
npm install @jmruthers/pace-core
|
|
16
|
+
npm install -D @tailwindcss/vite tailwindcss@^4.0.0
|
|
17
|
+
# Then import CSS in your app
|
|
18
|
+
import '@jmruthers/pace-core/src/styles/core.css';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Why aren't my components styled?
|
|
22
|
+
|
|
23
|
+
This is the most common issue. Ensure you have:
|
|
24
|
+
|
|
25
|
+
1. **Proper Vite configuration** - Include pace-core source files:
|
|
26
|
+
```typescript
|
|
27
|
+
content: [
|
|
28
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
29
|
+
'./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}'
|
|
30
|
+
]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. **CSS imported** in your entry point:
|
|
34
|
+
```tsx
|
|
35
|
+
import '@jmruthers/pace-core/src/styles/core.css';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
3. **Using Tailwind v4** (not v3)
|
|
39
|
+
|
|
40
|
+
See [Styling Issues](./troubleshooting/styling-issues.md) for detailed help.
|
|
41
|
+
|
|
42
|
+
### What version of Tailwind do I need?
|
|
43
|
+
|
|
44
|
+
You need **Tailwind CSS v4** with the Vite plugin. Tailwind v3 will not work.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Correct version
|
|
48
|
+
npm install -D @tailwindcss/vite tailwindcss@^4.0.0
|
|
49
|
+
|
|
50
|
+
# Remove v3 if installed
|
|
51
|
+
npm uninstall tailwindcss@^3.0.0
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
See [Installation Guide](./getting-started/installation-guide.md) for details.
|
|
55
|
+
|
|
56
|
+
### Do I need a tailwind.config.js file?
|
|
57
|
+
|
|
58
|
+
**No.** With the CSS-first approach in v0.4.17+, you don't need a config file. The configuration is handled via CSS imports and Vite plugin.
|
|
59
|
+
|
|
60
|
+
## Authentication & RBAC
|
|
61
|
+
|
|
62
|
+
### How do I set up authentication?
|
|
63
|
+
|
|
64
|
+
Wrap your app with `UnifiedAuthProvider`:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { UnifiedAuthProvider } from '@jmruthers/pace-core';
|
|
68
|
+
|
|
69
|
+
<UnifiedAuthProvider
|
|
70
|
+
supabaseClient={supabase}
|
|
71
|
+
appName="my-app"
|
|
72
|
+
idleTimeoutMs={30 * 60 * 1000}
|
|
73
|
+
warnBeforeMs={5 * 60 * 1000}
|
|
74
|
+
onIdleLogout={() => window.location.href = '/login'}
|
|
75
|
+
>
|
|
76
|
+
<App />
|
|
77
|
+
</UnifiedAuthProvider>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
See [Authentication Guide](./core-concepts/authentication.md) for details.
|
|
81
|
+
|
|
82
|
+
### How do I use RBAC permissions?
|
|
83
|
+
|
|
84
|
+
Use the `useCan` hook or `PagePermissionGuard` component:
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { useCan } from '@jmruthers/pace-core';
|
|
88
|
+
|
|
89
|
+
const { hasPermission } = useCan();
|
|
90
|
+
|
|
91
|
+
if (hasPermission('update:users', { organisationId })) {
|
|
92
|
+
// Show edit button
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
See [RBAC Guide](./rbac/README.md) for details.
|
|
97
|
+
|
|
98
|
+
### What's the permission format?
|
|
99
|
+
|
|
100
|
+
Permissions use colon-separated format: `{operation}:{resource}`
|
|
101
|
+
|
|
102
|
+
Examples:
|
|
103
|
+
- `read:users`
|
|
104
|
+
- `update:events`
|
|
105
|
+
- `delete:organisations`
|
|
106
|
+
|
|
107
|
+
See [Permissions Guide](./core-concepts/permissions.md) for details.
|
|
108
|
+
|
|
109
|
+
### Why is my permission check always returning false?
|
|
110
|
+
|
|
111
|
+
Common causes:
|
|
112
|
+
|
|
113
|
+
1. **Missing organisation context** - Always include `organisationId` in scope
|
|
114
|
+
2. **User not authenticated** - Check authentication status
|
|
115
|
+
3. **Permission format incorrect** - Use colon format, not space
|
|
116
|
+
|
|
117
|
+
See [Permission Troubleshooting](./troubleshooting/organisation-context-setup.md) for help.
|
|
118
|
+
|
|
119
|
+
## Breaking Changes
|
|
120
|
+
|
|
121
|
+
### What changed in v0.5.65?
|
|
122
|
+
|
|
123
|
+
Mandatory inactivity timeouts in `UnifiedAuthProvider`. You must now provide:
|
|
124
|
+
- `idleTimeoutMs` - When to logout
|
|
125
|
+
- `warnBeforeMs` - When to warn user
|
|
126
|
+
- `onIdleLogout` - Callback on logout
|
|
127
|
+
|
|
128
|
+
See [Breaking Changes](./breaking-changes.md) for details.
|
|
129
|
+
|
|
130
|
+
### How do I migrate from v0.4.x to v0.5.65?
|
|
131
|
+
|
|
132
|
+
Add the required inactivity timeout props:
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
// Old (broken)
|
|
136
|
+
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
137
|
+
<App />
|
|
138
|
+
</UnifiedAuthProvider>
|
|
139
|
+
|
|
140
|
+
// New (required)
|
|
141
|
+
<UnifiedAuthProvider
|
|
142
|
+
supabaseClient={supabase}
|
|
143
|
+
appName="my-app"
|
|
144
|
+
idleTimeoutMs={30 * 60 * 1000}
|
|
145
|
+
warnBeforeMs={5 * 60 * 1000}
|
|
146
|
+
onIdleLogout={() => window.location.href = '/login'}
|
|
147
|
+
>
|
|
148
|
+
<App />
|
|
149
|
+
</UnifiedAuthProvider>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
See [Migration Guide](./migration-guides/unified-auth-provider-mandatory-timeouts.md).
|
|
153
|
+
|
|
154
|
+
## Troubleshooting
|
|
155
|
+
|
|
156
|
+
### My components look unstyled
|
|
157
|
+
|
|
158
|
+
**Quick Checklist:**
|
|
159
|
+
- [ ] CSS file imported: `import '@jmruthers/pace-core/src/styles/core.css'`
|
|
160
|
+
- [ ] Vite config includes pace-core source files
|
|
161
|
+
- [ ] Using Tailwind v4
|
|
162
|
+
- [ ] Dev server restarted after config changes
|
|
163
|
+
|
|
164
|
+
See [Styling Issues](./troubleshooting/styling-issues.md) for detailed help.
|
|
165
|
+
|
|
166
|
+
### I'm getting TypeScript errors
|
|
167
|
+
|
|
168
|
+
**Common causes:**
|
|
169
|
+
|
|
170
|
+
1. **Missing props** - Check breaking changes for new required props
|
|
171
|
+
2. **Wrong imports** - Use `@jmruthers/pace-core` (with @)
|
|
172
|
+
3. **Version mismatch** - Update peer dependencies
|
|
173
|
+
|
|
174
|
+
See [Common Issues](./troubleshooting/common-issues.md) for help.
|
|
175
|
+
|
|
176
|
+
### Permission checks aren't working
|
|
177
|
+
|
|
178
|
+
**Check these:**
|
|
179
|
+
1. User is authenticated
|
|
180
|
+
2. Organisation context is set
|
|
181
|
+
3. Permission format is correct (`operation:resource`)
|
|
182
|
+
4. User has the permission in database
|
|
183
|
+
|
|
184
|
+
See [RBAC Troubleshooting](./rbac/troubleshooting.md) for help.
|
|
185
|
+
|
|
186
|
+
## Best Practices
|
|
187
|
+
|
|
188
|
+
### What are the coding standards?
|
|
189
|
+
|
|
190
|
+
Follow the [Style Guide](./style-guide.md) for:
|
|
191
|
+
- Code example standards
|
|
192
|
+
- Terminology usage
|
|
193
|
+
- Documentation structure
|
|
194
|
+
- Import patterns
|
|
195
|
+
|
|
196
|
+
### Should I use the service architecture?
|
|
197
|
+
|
|
198
|
+
The service architecture is optional. Existing code using `UnifiedAuthProvider` continues to work. New projects may benefit from the cleaner architecture.
|
|
199
|
+
|
|
200
|
+
See [Service Architecture](./architecture/services.md) for details.
|
|
201
|
+
|
|
202
|
+
## Common Patterns
|
|
203
|
+
|
|
204
|
+
### How do I fetch data with permissions?
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
import { useCan } from '@jmruthers/pace-core';
|
|
208
|
+
|
|
209
|
+
function MyComponent() {
|
|
210
|
+
const { hasPermission, isLoading } = useCan();
|
|
211
|
+
const [data, setData] = useState([]);
|
|
212
|
+
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
if (hasPermission('read:data', { organisationId })) {
|
|
215
|
+
fetchData().then(setData);
|
|
216
|
+
}
|
|
217
|
+
}, [hasPermission, organisationId]);
|
|
218
|
+
|
|
219
|
+
if (isLoading) return <div>Loading...</div>;
|
|
220
|
+
|
|
221
|
+
return <DataTable data={data} />;
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### How do I handle file uploads?
|
|
226
|
+
|
|
227
|
+
Use the FileUpload component and hooks:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { FileUpload, useFileReference } from '@jmruthers/pace-core';
|
|
231
|
+
|
|
232
|
+
function MyComponent() {
|
|
233
|
+
const { uploadFile } = useFileReference(supabase);
|
|
234
|
+
|
|
235
|
+
const handleUpload = async (file: File) => {
|
|
236
|
+
await uploadFile(file, {
|
|
237
|
+
organisationId: currentOrg.id
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
return <FileUpload onUpload={handleUpload} />;
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
See [File Upload Guide](./implementation-guides/file-upload-storage.md).
|
|
246
|
+
|
|
247
|
+
### How do I create a public page?
|
|
248
|
+
|
|
249
|
+
Use Public page components:
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import { PublicPageLayout, usePublicEvent } from '@jmruthers/pace-core';
|
|
253
|
+
|
|
254
|
+
function PublicPage({ eventSlug }) {
|
|
255
|
+
const { event, loading } = usePublicEvent(eventSlug);
|
|
256
|
+
|
|
257
|
+
if (loading) return <PublicLoadingSpinner />;
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<PublicPageLayout event={event}>
|
|
261
|
+
{/* Public content */}
|
|
262
|
+
</PublicPageLayout>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
See [Public Pages Guide](./implementation-guides/public-pages.md).
|
|
268
|
+
|
|
269
|
+
## Performance
|
|
270
|
+
|
|
271
|
+
### How do I optimize performance?
|
|
272
|
+
|
|
273
|
+
1. Use permission caching (automatic)
|
|
274
|
+
2. Implement code splitting
|
|
275
|
+
3. Use React.memo for expensive components
|
|
276
|
+
4. Optimize data table rendering
|
|
277
|
+
|
|
278
|
+
See [Performance Guide](./best-practices/performance.md).
|
|
279
|
+
|
|
280
|
+
## Still Have Questions?
|
|
281
|
+
|
|
282
|
+
- Check [Troubleshooting](./troubleshooting/README.md)
|
|
283
|
+
- See [Common Issues](./troubleshooting/common-issues.md)
|
|
284
|
+
- Review [Examples](./getting-started/examples/)
|
|
285
|
+
- [Ask for Help](https://github.com/jmruthers/pace-core/issues)
|
|
286
|
+
|