@jmruthers/pace-core 0.5.87 → 0.5.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/dist/{AuthService-Df3IozMG.d.ts → AuthService-DcTI5Ov4.d.ts} +9 -0
  2. package/dist/{DataTable-FA6EUX5M.js → DataTable-PWBMKMOG.js} +7 -7
  3. package/dist/{PublicLoadingSpinner-DecuJBX0.d.ts → PublicLoadingSpinner-BQXD1fbO.d.ts} +160 -130
  4. package/dist/{UnifiedAuthProvider-K2IZAY5F.js → UnifiedAuthProvider-5D3HEQND.js} +4 -4
  5. package/dist/{UnifiedAuthProvider-B391Aqum.d.ts → UnifiedAuthProvider-BVKmQd9u.d.ts} +4 -0
  6. package/dist/auth-DReDSLq9.d.ts +16 -0
  7. package/dist/{chunk-CBSD3BZ3.js → chunk-3RZBKQ5Y.js} +2 -6
  8. package/dist/{chunk-CBSD3BZ3.js.map → chunk-3RZBKQ5Y.js.map} +1 -1
  9. package/dist/{chunk-NTW3KGS4.js → chunk-6UHXQH7P.js} +5 -5
  10. package/dist/{chunk-YVUZWLQG.js → chunk-AQGF5OG7.js} +3 -3
  11. package/dist/{chunk-CVMVPYAL.js → chunk-BDZUMRBD.js} +3 -5
  12. package/dist/chunk-BDZUMRBD.js.map +1 -0
  13. package/dist/{chunk-KAY3K5TP.js → chunk-BNXBJOGL.js} +4 -4
  14. package/dist/{chunk-I7O3RSMN.js → chunk-CJIZS3UE.js} +1298 -769
  15. package/dist/chunk-CJIZS3UE.js.map +1 -0
  16. package/dist/{chunk-S3JKDMD5.js → chunk-CXKMRKRF.js} +4 -4
  17. package/dist/{chunk-5BN3YGNK.js → chunk-DP5X5ORK.js} +217 -27
  18. package/dist/chunk-DP5X5ORK.js.map +1 -0
  19. package/dist/{chunk-ZFLOV3OM.js → chunk-H3P2RGKZ.js} +352 -16
  20. package/dist/chunk-H3P2RGKZ.js.map +1 -0
  21. package/dist/{chunk-RIXPZJUB.js → chunk-KTPG5VCH.js} +2 -2
  22. package/dist/{chunk-WUXCWRL6.js → chunk-XJ2HZOBU.js} +6 -1
  23. package/dist/chunk-XJ2HZOBU.js.map +1 -0
  24. package/dist/{chunk-2FQEQUJT.js → chunk-XXVM53P4.js} +4 -4
  25. package/dist/{chunk-I2VVV5PQ.js → chunk-YY4YYM3E.js} +2 -2
  26. package/dist/components.d.ts +6 -55
  27. package/dist/components.js +24 -205
  28. package/dist/components.js.map +1 -1
  29. package/dist/{file-reference-9xUOnwyt.d.ts → file-reference-C9isKNPn.d.ts} +67 -2
  30. package/dist/hooks.js +9 -8
  31. package/dist/hooks.js.map +1 -1
  32. package/dist/index.d.ts +152 -26
  33. package/dist/index.js +64 -194
  34. package/dist/index.js.map +1 -1
  35. package/dist/providers.d.ts +5 -3
  36. package/dist/providers.js +3 -3
  37. package/dist/rbac/index.js +8 -8
  38. package/dist/types.d.ts +2 -1
  39. package/dist/types.js +3 -3
  40. package/dist/utils.js +2 -2
  41. package/docs/DOCUMENTATION_AUDIT.md +6 -6
  42. package/docs/DOCUMENTATION_STANDARD.md +137 -0
  43. package/docs/README.md +1 -1
  44. package/docs/api/classes/ColumnFactory.md +1 -1
  45. package/docs/api/classes/ErrorBoundary.md +1 -1
  46. package/docs/api/classes/InvalidScopeError.md +1 -1
  47. package/docs/api/classes/MissingUserContextError.md +1 -1
  48. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  49. package/docs/api/classes/PermissionDeniedError.md +1 -1
  50. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  51. package/docs/api/classes/RBACAuditManager.md +1 -1
  52. package/docs/api/classes/RBACCache.md +1 -1
  53. package/docs/api/classes/RBACEngine.md +1 -1
  54. package/docs/api/classes/RBACError.md +1 -1
  55. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  56. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  57. package/docs/api/classes/StorageUtils.md +83 -40
  58. package/docs/api/enums/FileCategory.md +56 -1
  59. package/docs/api/interfaces/AggregateConfig.md +1 -1
  60. package/docs/api/interfaces/ButtonProps.md +1 -1
  61. package/docs/api/interfaces/CardProps.md +1 -1
  62. package/docs/api/interfaces/ColorPalette.md +1 -1
  63. package/docs/api/interfaces/ColorShade.md +1 -1
  64. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  65. package/docs/api/interfaces/DataRecord.md +1 -1
  66. package/docs/api/interfaces/DataTableAction.md +1 -1
  67. package/docs/api/interfaces/DataTableColumn.md +1 -1
  68. package/docs/api/interfaces/DataTableProps.md +1 -1
  69. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  70. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  71. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  72. package/docs/api/interfaces/EventLogoProps.md +11 -11
  73. package/docs/api/interfaces/FileDisplayProps.md +10 -10
  74. package/docs/api/interfaces/FileMetadata.md +1 -1
  75. package/docs/api/interfaces/FileReference.md +1 -1
  76. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  77. package/docs/api/interfaces/FileUploadOptions.md +8 -8
  78. package/docs/api/interfaces/FileUploadProps.md +137 -42
  79. package/docs/api/interfaces/FooterProps.md +1 -1
  80. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  81. package/docs/api/interfaces/InputProps.md +1 -1
  82. package/docs/api/interfaces/LabelProps.md +1 -1
  83. package/docs/api/interfaces/LoginFormProps.md +1 -1
  84. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  85. package/docs/api/interfaces/NavigationContextType.md +1 -1
  86. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  87. package/docs/api/interfaces/NavigationItem.md +1 -1
  88. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  89. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  90. package/docs/api/interfaces/Organisation.md +1 -1
  91. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  92. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  93. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  94. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  95. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  96. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  97. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  98. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  99. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  100. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  101. package/docs/api/interfaces/PaletteData.md +1 -1
  102. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  103. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  104. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  105. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  106. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  107. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  108. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  109. package/docs/api/interfaces/RBACConfig.md +1 -1
  110. package/docs/api/interfaces/RBACLogger.md +1 -1
  111. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  112. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  113. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  114. package/docs/api/interfaces/RouteConfig.md +1 -1
  115. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  116. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  117. package/docs/api/interfaces/StorageConfig.md +1 -1
  118. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  119. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  120. package/docs/api/interfaces/StorageListOptions.md +1 -1
  121. package/docs/api/interfaces/StorageListResult.md +1 -1
  122. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  123. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  124. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  125. package/docs/api/interfaces/StyleImport.md +1 -1
  126. package/docs/api/interfaces/SwitchProps.md +1 -1
  127. package/docs/api/interfaces/ToastActionElement.md +1 -1
  128. package/docs/api/interfaces/ToastProps.md +1 -1
  129. package/docs/api/interfaces/UnifiedAuthContextType.md +83 -50
  130. package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
  131. package/docs/api/interfaces/UseEventLogoOptions.md +74 -0
  132. package/docs/api/interfaces/UseEventLogoReturn.md +81 -0
  133. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  134. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  135. package/docs/api/interfaces/UsePublicEventLogoOptions.md +6 -6
  136. package/docs/api/interfaces/UsePublicEventLogoReturn.md +6 -6
  137. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  138. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  139. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  140. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  141. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  142. package/docs/api/interfaces/UserEventAccess.md +11 -11
  143. package/docs/api/interfaces/UserMenuProps.md +1 -1
  144. package/docs/api/interfaces/UserProfile.md +1 -1
  145. package/docs/api/modules.md +290 -95
  146. package/docs/api-reference/components.md +1 -18
  147. package/docs/api-reference/hooks.md +1 -4
  148. package/docs/best-practices/testing.md +2 -0
  149. package/docs/documentation-index.md +1 -1
  150. package/docs/getting-started/faq.md +1 -1
  151. package/docs/implementation-guides/file-reference-system.md +592 -58
  152. package/docs/implementation-guides/file-upload-storage.md +137 -73
  153. package/docs/rbac/super-admin-guide.md +18 -70
  154. package/docs/testing/README.md +2 -0
  155. package/package.json +1 -1
  156. package/src/__tests__/TEST_STANDARD.md +674 -0
  157. package/src/__tests__/helpers/test-utils.tsx +3 -2
  158. package/src/components/DataTable/__tests__/{DataTable.comprehensive.test.tsx.skip → DataTable.comprehensive.test.tsx} +17 -18
  159. package/src/components/DataTable/__tests__/{DataTable.test.tsx.skip → DataTable.test.tsx} +14 -22
  160. package/src/components/DataTable/__tests__/{ssr.strict-mode.test.tsx.skip → ssr.strict-mode.test.tsx} +42 -47
  161. package/src/components/DataTable/components/__tests__/COVERAGE_NOTE.md +1 -1
  162. package/src/components/DataTable/examples/__tests__/PerformanceExample.test.tsx +13 -4
  163. package/src/components/DataTable/utils/__tests__/COVERAGE_NOTE.md +1 -1
  164. package/src/components/DataTable/utils/__tests__/performanceUtils.test.ts +10 -6
  165. package/src/components/FileDisplay/FileDisplay.test.tsx +257 -0
  166. package/src/components/{FileDisplay.tsx → FileDisplay/FileDisplay.tsx} +111 -10
  167. package/src/components/FileDisplay/index.tsx +4 -0
  168. package/src/components/FileUpload/FileUpload.test.tsx +171 -621
  169. package/src/components/FileUpload/FileUpload.tsx +512 -168
  170. package/src/components/FileUpload/index.tsx +4 -0
  171. package/src/components/Progress/Progress.test.tsx +38 -0
  172. package/src/components/PublicLayout/EventLogo.tsx +6 -4
  173. package/src/components/Select/Select.test.tsx +1 -1
  174. package/src/components/SessionRestorationLoader.tsx +48 -0
  175. package/src/components/Toast/Toast.tsx +13 -8
  176. package/src/components/index.ts +16 -16
  177. package/src/hooks/__tests__/ServiceHooks.test.tsx +615 -0
  178. package/src/hooks/public/usePublicEventLogo.ts +16 -20
  179. package/src/hooks/useEventLogo.ts +316 -0
  180. package/src/hooks/useEvents.ts +0 -5
  181. package/src/hooks/useFileReference.test.ts +659 -0
  182. package/src/hooks/useFileReference.ts +207 -3
  183. package/src/hooks/useSessionRestoration.ts +64 -0
  184. package/src/index.ts +17 -5
  185. package/src/providers/{UnifiedAuthProvider.test.simple.tsx → UnifiedAuthProvider.smoke.test.tsx} +81 -60
  186. package/src/providers/services/AuthServiceProvider.tsx +27 -3
  187. package/src/providers/services/UnifiedAuthProvider.tsx +34 -5
  188. package/src/rbac/{engine.test.simple.ts → RBACEngine.smoke.test.ts} +17 -12
  189. package/src/services/AuthService.ts +142 -20
  190. package/src/services/EventService.ts +0 -4
  191. package/src/types/auth.ts +15 -0
  192. package/src/types/file-reference.ts +73 -1
  193. package/src/types/index.ts +1 -0
  194. package/src/utils/__tests__/organisationContext.unit.test.ts +2 -4
  195. package/src/utils/appNameResolver.simple.test.ts +99 -29
  196. package/src/utils/file-reference.test.ts +535 -0
  197. package/src/utils/file-reference.ts +200 -30
  198. package/src/utils/organisationContext.test.ts +5 -19
  199. package/src/utils/organisationContext.ts +3 -5
  200. package/src/utils/storage/README.md +269 -262
  201. package/src/utils/storage/config.ts +9 -0
  202. package/src/utils/storage/helpers.test.ts +631 -0
  203. package/src/utils/storage/helpers.ts +112 -14
  204. package/src/utils/storage/index.ts +3 -0
  205. package/src/validation/__tests__/sanitization.unit.test.ts +1 -1
  206. package/src/validation/__tests__/schemaUtils.unit.test.ts +1 -1
  207. package/src/validation/__tests__/user.unit.test.ts +1 -1
  208. package/dist/chunk-5BN3YGNK.js.map +0 -1
  209. package/dist/chunk-CVMVPYAL.js.map +0 -1
  210. package/dist/chunk-I7O3RSMN.js.map +0 -1
  211. package/dist/chunk-WUXCWRL6.js.map +0 -1
  212. package/dist/chunk-ZFLOV3OM.js.map +0 -1
  213. package/docs/CONTENT_AUDIT_REPORT.md +0 -253
  214. package/docs/STYLE_GUIDE.md +0 -37
  215. package/examples/RBAC/__tests__/PermissionExample.test.tsx +0 -150
  216. package/examples/public-pages/__tests__/PublicPageUsageExample.test.tsx +0 -159
  217. package/src/__tests__/TEST_GUIDE_CURSOR.md +0 -1605
  218. package/src/__tests__/TEST_GUIDE_HUMAN.md +0 -103
  219. package/src/components/FileUpload/FileUpload.example.tsx +0 -218
  220. package/src/components/FileUpload/index.ts +0 -6
  221. package/src/components/FileUpload.tsx +0 -176
  222. package/src/components/Progress/index.ts +0 -3
  223. package/src/components/PublicLayout/__tests__/EventLogo.test.tsx +0 -666
  224. package/src/components/SuperAdminGuard.tsx +0 -116
  225. package/src/components/__tests__/FileDisplay.test.tsx +0 -575
  226. package/src/components/__tests__/FileUpload.test.tsx +0 -446
  227. package/src/components/__tests__/SuperAdminGuard.test.tsx +0 -627
  228. package/src/components/examples/PermissionExample.tsx +0 -173
  229. package/src/hooks/__tests__/usePublicEvent.unit.test.ts +0 -583
  230. package/src/hooks/__tests__/usePublicEventLogo.unit.test.ts +0 -640
  231. package/src/types/__tests__/file-reference.test.ts +0 -447
  232. package/src/utils/__tests__/file-reference.test.ts +0 -383
  233. /package/dist/{DataTable-FA6EUX5M.js.map → DataTable-PWBMKMOG.js.map} +0 -0
  234. /package/dist/{UnifiedAuthProvider-K2IZAY5F.js.map → UnifiedAuthProvider-5D3HEQND.js.map} +0 -0
  235. /package/dist/{chunk-NTW3KGS4.js.map → chunk-6UHXQH7P.js.map} +0 -0
  236. /package/dist/{chunk-YVUZWLQG.js.map → chunk-AQGF5OG7.js.map} +0 -0
  237. /package/dist/{chunk-KAY3K5TP.js.map → chunk-BNXBJOGL.js.map} +0 -0
  238. /package/dist/{chunk-S3JKDMD5.js.map → chunk-CXKMRKRF.js.map} +0 -0
  239. /package/dist/{chunk-RIXPZJUB.js.map → chunk-KTPG5VCH.js.map} +0 -0
  240. /package/dist/{chunk-2FQEQUJT.js.map → chunk-XXVM53P4.js.map} +0 -0
  241. /package/dist/{chunk-I2VVV5PQ.js.map → chunk-YY4YYM3E.js.map} +0 -0
  242. /package/src/providers/{OrganisationProvider.test.simple.tsx → OrganisationProvider.context.test.tsx} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types/file-reference.ts"],"sourcesContent":["// File Reference System Types\n// These types define the structure for the centralized file reference system\n\nexport interface FileReference {\n id: string;\n table_name: string;\n record_id: string;\n file_path: string;\n file_metadata: FileMetadata;\n organisation_id: string;\n app_id: string;\n is_public: boolean;\n created_at: string;\n updated_at: string;\n}\n\nexport interface FileMetadata {\n fileName: string;\n fileType: string;\n fileSize?: number;\n width?: number;\n height?: number;\n category: FileCategory;\n hash?: string;\n uploadedBy?: string;\n uploadedAt?: string;\n tags?: string[];\n customMetadata?: Record<string, any>;\n}\n\nexport enum FileCategory {\n PROFILE_PHOTOS = 'profile_photos',\n ID_DOCUMENTS = 'id_documents',\n QUALIFICATIONS = 'qualifications',\n MEDICAL_DOCUMENTS = 'medical_documents',\n DISH_IMAGES = 'dish_images',\n EVENT_LOGOS = 'event_logos',\n GENERAL_DOCUMENTS = 'general_documents',\n IMAGES = 'images',\n AUDIO = 'audio',\n VIDEO = 'video',\n ARCHIVES = 'archives'\n}\n\nexport interface FileUploadOptions {\n table_name: string;\n record_id: string;\n organisation_id: string;\n app_id: string;\n category: FileCategory;\n is_public?: boolean;\n custom_metadata?: Record<string, any>;\n}\n\nexport interface FileReferenceService {\n createFileReference(options: FileUploadOptions, file: File): Promise<FileReference>;\n getFileReference(table_name: string, record_id: string, organisation_id: string): Promise<FileReference | null>;\n getFileUrl(table_name: string, record_id: string, organisation_id: string): Promise<string | null>;\n getSignedUrl(table_name: string, record_id: string, organisation_id: string, expires_in?: number): Promise<string | null>;\n updateFileReference(id: string, updates: Partial<FileReference>): Promise<FileReference>;\n deleteFileReference(table_name: string, record_id: string, organisation_id: string, delete_file?: boolean): Promise<boolean>;\n listFileReferences(table_name: string, record_id: string, organisation_id: string): Promise<FileReference[]>;\n getFileCount(table_name: string, record_id: string, organisation_id: string): Promise<number>;\n}\n\nexport interface StorageUploadOptions {\n orgId: string;\n category: FileCategory;\n isPublic?: boolean;\n customPath?: string;\n}\n\nexport interface FileUploadResult {\n file_reference: FileReference;\n file_url: string;\n signed_url?: string;\n}\n"],"mappings":";AA8BO,IAAK,eAAL,kBAAKA,kBAAL;AACL,EAAAA,cAAA,oBAAiB;AACjB,EAAAA,cAAA,kBAAe;AACf,EAAAA,cAAA,oBAAiB;AACjB,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,cAAW;AAXD,SAAAA;AAAA,GAAA;","names":["FileCategory"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/providers/OrganisationProvider.tsx","../src/components/PublicLayout/PublicErrorBoundary.tsx","../src/components/PublicLayout/PublicPageProvider.tsx","../src/hooks/useAppConfig.ts","../src/hooks/public/usePublicEventLogo.ts"],"sourcesContent":["/**\n * @file Re-export for OrganisationProvider\n * @package @jmruthers/pace-core\n * @module Providers\n * @since 0.1.0\n * \n * Re-exports the service-based OrganisationProvider for backward compatibility.\n */\n\nexport { OrganisationServiceProvider as OrganisationProvider } from './services/OrganisationServiceProvider';\nexport type { OrganisationServiceProviderProps as OrganisationProviderProps } from './services/OrganisationServiceProvider';\n\n// Re-export context and hook\nexport { OrganisationServiceContext, useOrganisationService } from './services/OrganisationServiceProvider';\nexport type { OrganisationServiceContextType } from './services/OrganisationServiceProvider';\n\n// Re-export convenience hook for backward compatibility\nexport { useOrganisations } from '../hooks/useOrganisations';\n\n","/**\n * @file Public Error Boundary Component\n * @package @jmruthers/pace-core\n * @module Components/PublicLayout\n * @since 1.0.0\n *\n * An error boundary component specifically designed for public pages.\n * Provides graceful error handling and recovery for public content.\n *\n * Features:\n * - Graceful error handling\n * - User-friendly error messages\n * - Recovery mechanisms\n * - Accessibility compliant\n * - TypeScript support\n *\n * @example\n * ```tsx\n * import { PublicErrorBoundary } from '@jmruthers/pace-core';\n *\n * function PublicEventPage() {\n * return (\n * <PublicErrorBoundary>\n * <PublicPageContent />\n * </PublicErrorBoundary>\n * );\n * }\n * ```\n *\n * @accessibility\n * - WCAG 2.1 AA compliant\n * - Screen reader friendly error messages\n * - Keyboard accessible recovery actions\n * - High contrast support\n *\n * @dependencies\n * - React 18+ - Component framework\n * - Error boundary patterns\n * - Tailwind CSS - Styling\n */\n\nimport React, { Component, ErrorInfo, ReactNode } from 'react';\n\nexport interface PublicErrorBoundaryProps {\n /** Child components to wrap */\n children: ReactNode;\n /** Custom error fallback component */\n fallback?: React.ComponentType<PublicErrorBoundaryState>;\n /** Custom CSS classes for error display */\n className?: string;\n /** Whether to show error details in development */\n showErrorDetails?: boolean;\n /** Custom error message */\n customErrorMessage?: string;\n /** Custom recovery action */\n onRecover?: () => void;\n}\n\nexport interface PublicErrorBoundaryState {\n /** Whether an error has occurred */\n hasError: boolean;\n /** The error that occurred */\n error: Error | null;\n /** Error information */\n errorInfo: ErrorInfo | null;\n /** Function to reset the error state */\n resetError: () => void;\n}\n\n/**\n * Error boundary component for public pages\n * \n * This component catches JavaScript errors anywhere in the child component tree,\n * logs those errors, and displays a fallback UI instead of the component tree that crashed.\n * \n * @param props - Error boundary configuration\n * @returns React element with error boundary wrapper\n */\nexport class PublicErrorBoundary extends Component<PublicErrorBoundaryProps, PublicErrorBoundaryState> {\n constructor(props: PublicErrorBoundaryProps) {\n super(props);\n this.state = {\n hasError: false,\n error: null,\n errorInfo: null,\n resetError: this.resetError.bind(this)\n };\n }\n\n static getDerivedStateFromError(error: Error): Partial<PublicErrorBoundaryState> {\n // Update state so the next render will show the fallback UI\n return {\n hasError: true,\n error\n };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // Log the error to console in development\n if (import.meta.env.MODE === 'development') {\n console.error('PublicErrorBoundary caught an error:', error, errorInfo);\n }\n\n // Update state with error info\n this.setState({\n error,\n errorInfo\n });\n\n // You can also log the error to an error reporting service here\n // Example: logErrorToService(error, errorInfo);\n }\n\n resetError = () => {\n this.setState({\n hasError: false,\n error: null,\n errorInfo: null\n });\n };\n\n render() {\n if (this.state.hasError) {\n // Custom fallback component\n if (this.props.fallback) {\n return <this.props.fallback {...this.state} />;\n }\n\n // Default error UI\n return (\n <div className={`min-h-screen bg-white flex items-center justify-center ${this.props.className || ''}`}>\n <div className=\"max-w-md mx-auto text-center px-4\">\n <div className=\"mb-6\">\n <div className=\"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100 mb-4\">\n <svg\n className=\"h-6 w-6 text-red-600\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z\"\n />\n </svg>\n </div>\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2\">\n Something went wrong\n </h1>\n <p className=\"text-gray-600 mb-6\">\n {this.props.customErrorMessage || \n 'We encountered an error while loading this page. Please try again.'}\n </p>\n </div>\n\n {/* Error details in development */}\n {this.props.showErrorDetails && this.state.error && (\n <div className=\"mb-6 p-4 bg-red-50 border border-red-200 rounded-md text-left\">\n <h3 className=\"text-sm font-medium text-red-800 mb-2\">\n Error Details (Development Only)\n </h3>\n <pre className=\"text-xs text-red-700 whitespace-pre-wrap\">\n {this.state.error.toString()}\n {this.state.errorInfo?.componentStack}\n </pre>\n </div>\n )}\n\n {/* Recovery actions */}\n <div className=\"space-y-3\">\n <button\n onClick={this.resetError}\n className=\"w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2\"\n >\n Try Again\n </button>\n \n <button\n onClick={() => window.location.reload()}\n className=\"w-full px-4 py-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2\"\n >\n Reload Page\n </button>\n\n {this.props.onRecover && (\n <button\n onClick={this.props.onRecover}\n className=\"w-full px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2\"\n >\n Alternative Action\n </button>\n )}\n </div>\n\n {/* Help text */}\n <div className=\"mt-6 text-sm text-gray-500\">\n <p>\n If this problem persists, please contact support or try accessing the page later.\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n\n/**\n * Hook for accessing error boundary state\n * Useful for components that need to know if they're inside an error boundary\n */\nexport function useErrorBoundary() {\n const [error, setError] = React.useState<Error | null>(null);\n\n const resetError = React.useCallback(() => {\n setError(null);\n }, []);\n\n const captureError = React.useCallback((error: Error) => {\n setError(error);\n }, []);\n\n // Throw error synchronously during render so error boundary can catch it\n if (error) {\n throw error;\n }\n\n return { captureError, resetError };\n}\n\n/**\n * Default error fallback component\n */\nexport function DefaultPublicErrorFallback({ \n error, \n resetError \n}: PublicErrorBoundaryState) {\n return (\n <div className=\"min-h-screen bg-white flex items-center justify-center\">\n <div className=\"max-w-md mx-auto text-center px-4\">\n <div className=\"mb-6\">\n <div className=\"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100 mb-4\">\n <svg\n className=\"h-6 w-6 text-red-600\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z\"\n />\n </svg>\n </div>\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2\">\n Page Error\n </h1>\n <p className=\"text-gray-600 mb-6\">\n We encountered an error while loading this page.\n </p>\n </div>\n\n <button\n onClick={resetError}\n className=\"w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2\"\n >\n Try Again\n </button>\n </div>\n </div>\n );\n}\n","/**\n * @file Public Page Provider\n * @package @jmruthers/pace-core\n * @module Components/PublicLayout\n * @since 1.0.0\n *\n * A completely isolated provider for public pages that doesn't trigger\n * any authentication context. This ensures public pages work independently\n * of the main application's authentication system.\n *\n * Features:\n * - No authentication required\n * - No organisation context\n * - No event context\n * - Completely isolated from main app context\n * - Environment variable access for public data\n * - Error boundary integration\n *\n * @example\n * ```tsx\n * import { PublicPageProvider } from '@jmruthers/pace-core';\n * \n * function PublicApp() {\n * return (\n * <PublicPageProvider>\n * <Routes>\n * <Route path=\"/events/:eventCode/recipe-grid-report\" element={<PublicRecipePage />} />\n * </Routes>\n * </PublicPageProvider>\n * );\n * }\n * ```\n */\n\nimport React, { createContext, useContext, ReactNode, useMemo } from 'react';\nimport { createClient } from '@supabase/supabase-js';\nimport type { Database } from '../../types/database';\nimport { PublicErrorBoundary } from './PublicErrorBoundary';\n\ninterface PublicPageContextType {\n isPublicPage: true;\n supabase: ReturnType<typeof createClient<Database>> | null;\n environment: {\n supabaseUrl: string | null;\n supabaseKey: string | null;\n };\n}\n\nexport const PublicPageContext = createContext<PublicPageContextType | undefined>(undefined);\n\nexport interface PublicPageProviderProps {\n children: ReactNode;\n}\n\n/**\n * Provider for public pages that completely isolates them from authentication context\n * \n * This provider:\n * - Does not initialize any authentication providers\n * - Provides environment variables for public data access\n * - Includes error boundary for graceful error handling\n * - Is completely separate from the main app context\n */\nexport function PublicPageProvider({ children }: PublicPageProviderProps) {\n // Get environment variables for public data access\n // Handle both Vite (import.meta.env) and Node.js (process.env) environments\n const getEnvVar = (key: string): string | undefined => {\n // Check Vite environment first (browser)\n if (typeof import.meta !== 'undefined' && (import.meta as any).env) {\n return (import.meta as any).env[key];\n }\n // Check Node.js environment (server-side)\n if (typeof import.meta !== 'undefined' && import.meta.env) {\n return import.meta.env[key];\n }\n return undefined;\n };\n\n const supabaseUrl = getEnvVar('VITE_SUPABASE_URL') || \n getEnvVar('NEXT_PUBLIC_SUPABASE_URL') || \n null;\n \n const supabaseKey = getEnvVar('VITE_SUPABASE_ANON_KEY') || \n getEnvVar('NEXT_PUBLIC_SUPABASE_ANON_KEY') || \n null;\n\n // Create Supabase client if environment variables are available\n const supabase = useMemo(() => {\n if (!supabaseUrl || !supabaseKey) {\n console.warn('[PublicPageProvider] Missing Supabase environment variables. Please ensure VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY are set in your environment.');\n return null;\n }\n return createClient<Database>(supabaseUrl, supabaseKey);\n }, [supabaseUrl, supabaseKey]);\n\n const contextValue: PublicPageContextType = {\n isPublicPage: true,\n supabase,\n environment: {\n supabaseUrl,\n supabaseKey\n }\n };\n\n return (\n <PublicPageContext.Provider value={contextValue}>\n <PublicErrorBoundary>\n {children}\n </PublicErrorBoundary>\n </PublicPageContext.Provider>\n );\n}\n\n/**\n * Hook to access public page context\n * \n * @returns Public page context with environment variables\n */\nexport function usePublicPageContext(): PublicPageContextType {\n const context = useContext(PublicPageContext);\n \n if (!context) {\n throw new Error('usePublicPageContext must be used within a PublicPageProvider');\n }\n \n return context;\n}\n\n/**\n * Hook to check if we're in a public page context\n * \n * @returns True if we're in a public page context\n */\nexport function useIsPublicPage(): boolean {\n const context = useContext(PublicPageContext);\n return context !== undefined;\n}\n","/**\n * @file useAppConfig Hook\n * @package @jmruthers/pace-core\n * @module Hooks/useAppConfig\n * @since 0.4.0\n *\n * Hook for accessing app configuration like direct access support and event requirements.\n * This is a convenience hook that extracts app config from the UnifiedAuthProvider.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { supportsDirectAccess, requiresEvent, isLoading } = useAppConfig();\n * \n * if (isLoading) return <div>Loading...</div>;\n * \n * return (\n * <div>\n * {supportsDirectAccess && (\n * <div>This app supports direct access!</div>\n * )}\n * {requiresEvent && (\n * <EventSelector />\n * )}\n * </div>\n * );\n * }\n * ```\n */\n\nimport { useMemo } from 'react';\nimport { useUnifiedAuth } from '../providers/UnifiedAuthProvider';\nimport { useIsPublicPage } from '../components/PublicLayout/PublicPageProvider';\n\nexport interface UseAppConfigReturn {\n supportsDirectAccess: boolean;\n requiresEvent: boolean;\n isLoading: boolean;\n appName: string;\n}\n\n/**\n * Hook to access app configuration\n * Works in both authenticated and public contexts\n * @returns App configuration and loading state\n */\nexport function useAppConfig(): UseAppConfigReturn {\n // Check if we're in a public page context first\n const isPublicPage = useIsPublicPage();\n \n if (isPublicPage) {\n // For public pages, try to get app name from environment variables\n const getAppName = (): string => {\n // Check Vite environment first (browser)\n if (typeof import.meta !== 'undefined' && (import.meta as any).env) {\n return (import.meta as any).env.VITE_APP_NAME || \n (import.meta as any).env.NEXT_PUBLIC_APP_NAME || \n 'PACE';\n }\n // Check Node.js environment (server-side)\n if (typeof import.meta !== 'undefined' && import.meta.env) {\n return import.meta.env.VITE_APP_NAME || \n import.meta.env.NEXT_PUBLIC_APP_NAME || \n 'PACE';\n }\n return 'PACE';\n };\n \n return useMemo(() => ({\n supportsDirectAccess: false, // Public pages don't support direct access\n requiresEvent: true, // Public pages always require an event\n isLoading: false,\n appName: getAppName()\n }), []);\n }\n \n // For authenticated pages, use UnifiedAuthProvider\n try {\n const { appConfig, appName } = useUnifiedAuth();\n return useMemo(() => ({\n supportsDirectAccess: !(appConfig?.requires_event ?? true),\n requiresEvent: appConfig?.requires_event ?? true,\n isLoading: appConfig === null,\n appName\n }), [appConfig?.requires_event, appName]);\n } catch (error) {\n // Fallback if UnifiedAuthProvider is not available\n return useMemo(() => ({\n supportsDirectAccess: false,\n requiresEvent: true,\n isLoading: false,\n appName: 'PACE'\n }), []);\n }\n} ","/**\n * @file Public Event Logo Hook\n * @package @jmruthers/pace-core\n * @module Hooks/Public\n * @since 1.0.0\n *\n * A React hook for accessing public event logo URLs without authentication.\n * Provides logo URLs with fallback handling for public pages.\n *\n * Features:\n * - No authentication required\n * - Automatic fallback to event initials\n * - Caching for performance\n * - Error handling and loading states\n * - TypeScript support\n * - Image validation\n *\n * @example\n * ```tsx\n * import { usePublicEventLogo } from '@jmruthers/pace-core';\n *\n * function EventHeader() {\n * const { logoUrl, fallbackText, isLoading, error } = usePublicEventLogo(\n * eventId, \n * eventName, \n * organisationId\n * );\n *\n * if (isLoading) return <div>Loading logo...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div>\n * {logoUrl ? (\n * <img src={logoUrl} alt={`${eventName} logo`} />\n * ) : (\n * <div className=\"logo-fallback\">{fallbackText}</div>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @accessibility\n * - No direct accessibility concerns (hook)\n * - Enables accessible logo display with proper alt text\n * - Supports screen reader friendly fallbacks\n *\n * @security\n * - Only returns public-safe logo URLs\n * - Validates image existence before returning URL\n * - No sensitive information exposed\n * - Rate limiting applied at storage level\n *\n * @performance\n * - Built-in caching with TTL\n * - Image validation and optimization\n * - Minimal re-renders with stable references\n * - Lazy loading support\n *\n * @dependencies\n * - React 18+ - Hooks and effects\n * - @supabase/supabase-js - Storage integration\n * - Event types - Type definitions\n */\n\nimport { useState, useEffect, useCallback, useMemo } from 'react';\nimport type { SupabaseClient } from '@supabase/supabase-js';\nimport type { Database } from '../../types/database';\n\n// Simple in-memory cache for public data\nconst publicDataCache = new Map<string, { data: any; timestamp: number; ttl: number }>();\n\nexport interface UsePublicEventLogoReturn {\n /** The logo URL if available, null if not found or error */\n logoUrl: string | null;\n /** Fallback text (event initials) if no logo is available */\n fallbackText: string;\n /** Whether the logo is currently loading */\n isLoading: boolean;\n /** Any error that occurred during loading */\n error: Error | null;\n /** Function to manually refetch the logo */\n refetch: () => Promise<void>;\n}\n\nexport interface UsePublicEventLogoOptions {\n /** Cache TTL in milliseconds (default: 30 minutes) */\n cacheTtl?: number;\n /** Whether to enable caching (default: true) */\n enableCache?: boolean;\n /** Whether to validate image existence (default: true) */\n validateImage?: boolean;\n /** Custom fallback text generator */\n generateFallbackText?: (eventName: string) => string;\n /** Supabase client instance (required) */\n supabase: SupabaseClient<Database>;\n}\n\n/**\n * Generate fallback text from event name (first letter of each word)\n */\nfunction defaultGenerateFallbackText(eventName: string): string {\n if (!eventName) return 'EV';\n \n return eventName\n .split(' ')\n .map(word => word.charAt(0).toUpperCase())\n .join('')\n .substring(0, 3); // Max 3 characters\n}\n\n/**\n * Hook for accessing public event logo URLs\n * \n * This hook provides access to event logo URLs without requiring\n * authentication. It includes fallback handling and image validation.\n * \n * @param eventId - The event ID to fetch logo for\n * @param eventName - The event name for fallback text generation\n * @param organisationId - The organisation ID for storage path\n * @param options - Configuration options for caching and behavior\n * @returns Object containing logo URL, fallback text, loading state, error, and refetch function\n */\nexport function usePublicEventLogo(\n eventId: string | undefined,\n eventName: string | undefined,\n organisationId: string | undefined,\n options: UsePublicEventLogoOptions\n): UsePublicEventLogoReturn {\n const {\n cacheTtl = 30 * 60 * 1000, // 30 minutes\n enableCache = true,\n validateImage = true,\n generateFallbackText = defaultGenerateFallbackText,\n supabase\n } = options;\n\n const [logoUrl, setLogoUrl] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Generate fallback text\n const fallbackText = useMemo(() => {\n return eventName ? generateFallbackText(eventName) : 'EV';\n }, [eventName, generateFallbackText]);\n\n const fetchLogo = useCallback(async (): Promise<void> => {\n if (!eventId || !organisationId || !supabase) {\n setLogoUrl(null);\n setIsLoading(false);\n return;\n }\n\n // Validate UUID format for organisationId to prevent database errors\n const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n if (!uuidRegex.test(organisationId)) {\n console.warn('[usePublicEventLogo] Invalid organisationId format (not a valid UUID):', organisationId);\n // Don't return early - let the database handle the validation\n // This allows for more graceful error handling\n }\n\n // Check cache first\n const cacheKey = `public_logo_${eventId}_${organisationId}`;\n if (enableCache) {\n const cached = publicDataCache.get(cacheKey);\n if (cached && Date.now() - cached.timestamp < cached.ttl) {\n setLogoUrl(cached.data);\n setIsLoading(false);\n setError(null);\n return;\n }\n }\n\n try {\n setIsLoading(true);\n setError(null);\n\n // Call the public logo RPC function\n const { data, error: rpcError } = await (supabase as any).rpc('get_public_event_logo', {\n event_id_param: eventId,\n organisation_id_param: organisationId\n });\n\n if (rpcError) {\n throw new Error(rpcError.message || 'Failed to fetch logo');\n }\n\n if (!data || data.length === 0 || !data[0] || !data[0].logo_url) {\n setLogoUrl(null);\n return;\n }\n\n // Get the file path from the RPC function (it returns file_path as logo_url)\n const logoPath = data[0].logo_url;\n\n // Construct the full public URL using Supabase client's storage API\n const { data: urlData } = supabase.storage\n .from('public-files')\n .getPublicUrl(logoPath);\n\n if (!urlData?.publicUrl) {\n console.warn('[usePublicEventLogo] Failed to construct public URL for path:', logoPath);\n setLogoUrl(null);\n return;\n }\n\n const logoUrl = urlData.publicUrl;\n\n // Validate image existence if requested\n if (validateImage) {\n try {\n const response = await fetch(logoUrl, { method: 'HEAD' });\n if (!response.ok) {\n console.warn('[usePublicEventLogo] Logo URL not accessible:', logoUrl);\n setLogoUrl(null);\n return;\n }\n } catch (fetchError) {\n console.warn('[usePublicEventLogo] Error validating logo URL:', fetchError);\n setLogoUrl(null);\n return;\n }\n }\n\n setLogoUrl(logoUrl);\n\n // Cache the result\n if (enableCache) {\n publicDataCache.set(cacheKey, {\n data: logoUrl,\n timestamp: Date.now(),\n ttl: cacheTtl\n });\n }\n\n } catch (err) {\n console.error('[usePublicEventLogo] Error fetching logo:', err);\n const error = err instanceof Error ? err : new Error('Unknown error occurred');\n setError(error);\n setLogoUrl(null);\n } finally {\n setIsLoading(false);\n }\n }, [eventId, organisationId, supabase, cacheTtl, enableCache, validateImage]);\n\n // Fetch logo when parameters change\n useEffect(() => {\n if (eventId && organisationId) {\n fetchLogo();\n } else {\n setLogoUrl(null);\n setIsLoading(false);\n setError(null);\n }\n }, [fetchLogo, eventId, organisationId]);\n\n const refetch = useCallback(async (): Promise<void> => {\n if (!eventId || !organisationId) return;\n \n // Clear cache for this logo\n if (enableCache) {\n const cacheKey = `public_logo_${eventId}_${organisationId}`;\n publicDataCache.delete(cacheKey);\n }\n await fetchLogo();\n }, [fetchLogo, eventId, organisationId, enableCache]);\n\n return {\n logoUrl,\n fallbackText,\n isLoading,\n error,\n refetch\n };\n}\n\n/**\n * Clear all cached public logo data\n * Useful for testing or when you need to force refresh all data\n */\nexport function clearPublicLogoCache(): void {\n for (const [key] of publicDataCache) {\n if (key.startsWith('public_logo_')) {\n publicDataCache.delete(key);\n }\n }\n}\n\n/**\n * Get cache statistics for debugging\n */\nexport function getPublicLogoCacheStats(): { size: number; keys: string[] } {\n const keys = Array.from(publicDataCache.keys()).filter(key => key.startsWith('public_logo_'));\n return {\n size: keys.length,\n keys\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAIA;AAIA;AAAA;AAAA;;;ACwBA,OAAO,SAAS,iBAAuC;AAoFxC,cAOH,YAPG;AA/CR,IAAM,sBAAN,cAAkC,UAA8D;AAAA,EACrG,YAAY,OAAiC;AAC3C,UAAM,KAAK;AAiCb,sBAAa,MAAM;AACjB,WAAK,SAAS;AAAA,QACZ,UAAU;AAAA,QACV,OAAO;AAAA,QACP,WAAW;AAAA,MACb,CAAC;AAAA,IACH;AAtCE,SAAK,QAAQ;AAAA,MACX,UAAU;AAAA,MACV,OAAO;AAAA,MACP,WAAW;AAAA,MACX,YAAY,KAAK,WAAW,KAAK,IAAI;AAAA,IACvC;AAAA,EACF;AAAA,EAEA,OAAO,yBAAyB,OAAiD;AAE/E,WAAO;AAAA,MACL,UAAU;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAAA,EAEA,kBAAkB,OAAc,WAAsB;AAEpD,QAAI,YAAY,IAAI,SAAS,eAAe;AAC1C,cAAQ,MAAM,wCAAwC,OAAO,SAAS;AAAA,IACxE;AAGA,SAAK,SAAS;AAAA,MACZ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EAIH;AAAA,EAUA,SAAS;AACP,QAAI,KAAK,MAAM,UAAU;AAEvB,UAAI,KAAK,MAAM,UAAU;AACvB,eAAO,oBAAC,KAAK,MAAM,UAAX,EAAqB,GAAG,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;AAMO,SAAS,uBAA6B;AAC3C,aAAW,CAAC,GAAG,KAAK,iBAAiB;AACnC,QAAI,IAAI,WAAW,cAAc,GAAG;AAClC,sBAAgB,OAAO,GAAG;AAAA,IAC5B;AAAA,EACF;AACF;AAKO,SAAS,0BAA4D;AAC1E,QAAM,OAAO,MAAM,KAAK,gBAAgB,KAAK,CAAC,EAAE,OAAO,SAAO,IAAI,WAAW,cAAc,CAAC;AAC5F,SAAO;AAAA,IACL,MAAM,KAAK;AAAA,IACX;AAAA,EACF;AACF;","names":["error","jsx","useMemo","useMemo","useMemo","logoUrl","error"]}
@@ -1,253 +0,0 @@
1
- ---
2
- lastUpdated: 2025-10-29T22:43:00+11:00
3
- version: 0.5.76
4
- reviewedBy: content-audit
5
- ---
6
-
7
- # 📋 PACE Core Content Audit Report
8
-
9
- > **🔍 Comprehensive Content Analysis** | [← Back to Documentation](./README.md) | [Style Guide Compliance](./DOCUMENTATION_AUDIT.md)
10
-
11
- This report provides a comprehensive analysis of PACE Core documentation content accuracy, completeness, and freshness.
12
-
13
- ---
14
-
15
- ## 🎯 Executive Summary
16
-
17
- | Metric | Status | Count | Percentage |
18
- |--------|--------|--------|------------|
19
- | **Exported Features Documented** | ✅ Excellent | 65/67 | 97% |
20
- | **Documentation Accuracy** | ✅ Accurate | 95/95 | 100% |
21
- | **Duplicate Content** | ✅ Fully Consolidated | Single authoritative guide | Complete |
22
- | **Last Updated Tracking** | ✅ Complete | 95/95 | 100% |
23
- | **Overall Content Health** | ✅ **Excellent** | | |
24
-
25
- ---
26
-
27
- ## 📊 Detailed Analysis
28
-
29
- ### 1. Missing Documentation (2 Missing Features) ⬆️ Improved from 22
30
-
31
- #### 🚨 **Critical Missing Components**
32
- | Component | Export Status | Documentation Status | Priority |
33
- |-----------|---------------|----------------------|----------|
34
- | ~~`Avatar`~~ | ✅ Exported | ✅ **Documented** | High |
35
- | ~~`Switch`~~ | ✅ Exported | ✅ **Documented** | High |
36
- | ~~`Progress`~~ | ✅ Exported | ✅ **Documented** | High |
37
- | ~~`Table` (Basic)~~ | ✅ Exported | ✅ **Documented** | High |
38
- | ~~`TableHeader`~~ | ✅ Exported | ✅ **Documented** | High |
39
- | ~~`TableBody`~~ | ✅ Exported | ✅ **Documented** | High |
40
- | ~~`TableCell`~~ | ✅ Exported | ✅ **Documented** | High |
41
- | ~~`TableFooter`~~ | ✅ Exported | ✅ **Documented** | High |
42
- | ~~`TableHead`~~ | ✅ Exported | ✅ **Documented** | High |
43
- | ~~`TableRow`~~ | ✅ Exported | ✅ **Documented** | High |
44
-
45
- #### 🔧 **Missing Utilities**
46
- | Utility | Export Status | Documentation Status | Priority |
47
- |---------|---------------|----------------------|----------|
48
- | ~~`cn`~~ | ✅ Exported | ✅ **Documented** | High |
49
- | ~~`setAppConfig`~~ | ✅ Exported | ✅ **Documented** | Medium |
50
- | ~~`getAppConfig`~~ | ✅ Exported | ✅ **Documented** | Medium |
51
- | ~~`getCurrentAppName`~~ | ✅ Exported | ✅ **Documented** | Medium |
52
- | ~~`getCurrentAppId`~~ | ✅ Exported | ✅ **Documented** | Medium |
53
- | ~~`formatCurrency`~~ | ✅ Exported | ✅ **Documented** | Medium |
54
- | ~~`formatNumber`~~ | ✅ Exported | ✅ **Documented** | Medium |
55
- | ~~`formatPercent`~~ | ✅ Exported | ✅ **Documented** | Medium |
56
- | ~~`formatCompactNumber`~~ | ✅ Exported | ✅ **Documented** | Medium |
57
- | ~~`formatFileSize`~~ | ✅ Exported | ✅ **Documented** | Medium |
58
-
59
- #### 🔗 **Missing Hooks**
60
- | Hook | Export Status | Documentation Status | Priority |
61
- |------|---------------|----------------------|----------|
62
- | ~~`useFocusManagement`~~ | ✅ Exported | ✅ **Documented** | Medium |
63
- | ~~`useFocusTrap`~~ | ✅ Exported | ✅ **Documented** | Medium |
64
- | ~~`useKeyboardShortcuts`~~ | ✅ Exported | ✅ **Documented** | Medium |
65
- | ~~`useIsMobile`~~ | ✅ Exported | ✅ **Documented** | Medium |
66
- | ~~`useDebounce`~~ | ✅ Exported | ✅ **Documented** | Medium |
67
- | ~~`useDataTableState`~~ | ✅ Exported | ✅ **Documented** | Medium |
68
- | ~~`useZodForm`~~ | ✅ Exported | ✅ **Documented** | Medium |
69
- | ~~`useComponentPerformance`~~ | ✅ Exported | ✅ **Documented** | Low |
70
- | ~~`usePerformanceMonitor`~~ | ✅ Exported | ✅ **Documented** | Low |
71
- | ~~`useDataTablePerformance`~~ | ✅ Exported | ✅ **Documented** | Low |
72
-
73
- #### 🏗️ **Missing Providers**
74
- | Provider | Export Status | Documentation Status | Priority |
75
- |----------|---------------|----------------------|----------|
76
- | ~~`EventProvider`~~ | ✅ Exported | ✅ **Documented** | High |
77
- | ~~`OrganisationProvider`~~ | ✅ Exported | ✅ **Documented** | High |
78
- | ~~`InactivityProvider`~~ | ✅ Exported | ✅ **Documented** | High |
79
-
80
- ---
81
-
82
- ### 2. Duplicate Content Analysis
83
-
84
- #### 🔄 **Identified Duplicates**
85
-
86
- | Content Area | Files | Duplication Level | Action Required |
87
- |--------------|-------|------------------|-----------------|
88
- | **DataTable Usage** | 8 files | ✅ Consolidated | Cross-referenced |
89
- | **Authentication Setup** | 6 files | ✅ Fully Consolidated | Single authoritative guide |
90
- | **RBAC Implementation** | 5 files | Medium | Consolidate RBAC patterns |
91
- | **Migration Instructions** | 4 files | ✅ Fully Consolidated | Single authoritative guide |
92
- | **Quick Start Examples** | 3 files | ✅ Fully Consolidated | Single authoritative guide |
93
- | **Performance Tips** | 3 files | ✅ Fully Consolidated | Single authoritative guide |
94
- | **Troubleshooting** | 3 files | ✅ Fully Consolidated | Single authoritative guide |
95
- | **Styling Guide** | 2 files | Low | Cross-reference instead |
96
-
97
- #### 📝 **Specific Duplicate Content**
98
-
99
- 1. **DataTable Implementation** (8 files) - ✅ **Fully Consolidated**
100
- - `implementation-guides/data-tables.md` - **Single authoritative guide** with all content merged
101
- - ~~`implementation-guides/datatable-rbac-usage.md`~~ - **Deleted** (merged into main guide)
102
- - ~~`implementation-guides/hierarchical-datatable.md`~~ - **Deleted** (merged into main guide)
103
- - ~~`implementation-guides/datatable-filtering.md`~~ - **Deleted** (merged into main guide)
104
- - ~~`implementation-guides/large-datasets.md`~~ - **Deleted** (merged into main guide)
105
- - ~~`implementation-guides/performance.md`~~ - **Deleted** (merged into main guide)
106
- - `api-reference/components.md` (DataTable section) - API reference
107
- - `getting-started/examples/full-featured-app.md` - Examples
108
- - `best-practices/common-patterns.md` - Best practices
109
-
110
- 2. **Authentication Setup** (6 files) - ✅ **Fully Consolidated**
111
- - `implementation-guides/authentication.md` - **Single authoritative guide** with all content merged
112
- - ~~`getting-started/quick-start.md`~~ - **Deleted** (merged into main guide)
113
- - ~~`getting-started/examples/basic-auth-app.md`~~ - **Deleted** (merged into main guide)
114
- - ~~`troubleshooting/authentication-issues.md`~~ - **Deleted** (merged into main guide)
115
- - `api-reference/hooks.md` (useUnifiedAuth section) - API reference
116
- - `best-practices/common-patterns.md` - Best practices
117
- - `implementation-guides/navigation.md` - Navigation integration
118
-
119
- 3. **Migration Instructions** (4 files) - ✅ **Fully Consolidated**
120
- - `migration/MIGRATION_GUIDE.md` - **Single authoritative guide** with all content merged
121
- - ~~`migration/breaking-changes.md`~~ - **Deleted** (merged into main guide)
122
- - ~~`migration/quick-migration-guide.md`~~ - **Deleted** (merged into main guide)
123
- - ~~`troubleshooting/migration.md`~~ - **Deleted** (merged into main guide)
124
-
125
- ---
126
-
127
- ### 3. Documentation Accuracy Assessment
128
-
129
- #### ✅ **Accurate Documentation** (95/95 files)
130
-
131
- All documented features accurately represent the current implementation:
132
-
133
- - **Component APIs**: All documented props, methods, and usage patterns match actual implementation
134
- - **Hook Interfaces**: All documented return types and parameters are accurate
135
- - **Utility Functions**: All documented function signatures and behaviors are correct
136
- - **Type Definitions**: All documented TypeScript interfaces match actual types
137
- - **Code Examples**: All examples are syntactically correct and runnable
138
-
139
- #### 🔍 **Implementation Verification**
140
-
141
- | Category | Verified | Accuracy |
142
- |----------|----------|----------|
143
- | **Components** | 45/45 | 100% |
144
- | **Hooks** | 25/25 | 100% |
145
- | **Utilities** | 15/15 | 100% |
146
- | **Types** | 10/10 | 100% |
147
-
148
- ---
149
-
150
- ### 4. Last Updated Tracking Analysis
151
-
152
- #### ❌ **Missing Timestamps** (95/95 files)
153
-
154
- **Current State**: No documentation files have last updated timestamps.
155
-
156
- **Required Action**: Add last updated timestamps to all documentation files.
157
-
158
- #### 📅 **Proposed Timestamp Format**
159
-
160
- ```markdown
161
- ---
162
- lastUpdated: 2025-10-29T22:43:00+11:00
163
- version: 0.5.76
164
- reviewedBy: [username]
165
- ---
166
- ```
167
-
168
- ---
169
-
170
- ## 🎯 Recommendations
171
-
172
- ### 🚨 **Immediate Actions (High Priority)**
173
-
174
- 1. **Document Missing Components**
175
- - Add documentation for `Avatar`, `Switch`, `Progress` components
176
- - Add documentation for basic `Table` components
177
- - Add documentation for missing utilities (`cn`, formatting functions)
178
-
179
- 2. **Consolidate Duplicate Content**
180
- - Merge DataTable implementation guides into single comprehensive guide
181
- - Consolidate migration documentation
182
- - Create master authentication setup guide
183
-
184
- 3. **Add Last Updated Timestamps**
185
- - Implement timestamp tracking system
186
- - Add timestamps to all 95 documentation files
187
- - Establish review schedule
188
-
189
- ### 🔧 **Medium Priority Actions**
190
-
191
- 1. **Document Missing Hooks**
192
- - Add documentation for performance hooks
193
- - Add documentation for form hooks
194
- - Add documentation for utility hooks
195
-
196
- 2. **Document Missing Providers**
197
- - Add documentation for `EventProvider`
198
- - Add documentation for `OrganisationProvider`
199
- - Add documentation for `InactivityProvider`
200
-
201
- ### 📈 **Long-term Improvements**
202
-
203
- 1. **Automated Documentation Generation**
204
- - Implement automated API documentation generation
205
- - Set up CI/CD checks for documentation completeness
206
- - Create documentation coverage reports
207
-
208
- 2. **Content Management System**
209
- - Implement documentation versioning
210
- - Create automated stale content detection
211
- - Establish documentation review workflow
212
-
213
- ---
214
-
215
- ## 📋 Action Plan
216
-
217
- ### Phase 1: Critical Missing Documentation (Week 1)
218
- - [ ] Document missing UI components (`Avatar`, `Switch`, `Progress`, `Table`)
219
- - [ ] Document missing utilities (`cn`, formatting functions)
220
- - [ ] Add last updated timestamps to all files
221
-
222
- ### Phase 2: Consolidation (Week 2)
223
- - [ ] Consolidate DataTable documentation
224
- - [ ] Merge migration guides
225
- - [ ] Create master authentication guide
226
-
227
- ### Phase 3: Complete Coverage (Week 3)
228
- - [ ] Document missing hooks
229
- - [ ] Document missing providers
230
- - [ ] Implement automated documentation checks
231
-
232
- ### Phase 4: Long-term Improvements (Week 4)
233
- - [ ] Set up automated documentation generation
234
- - [ ] Implement documentation versioning
235
- - [ ] Create documentation review workflow
236
-
237
- ---
238
-
239
- ## 📊 Success Metrics
240
-
241
- | Metric | Current | Target | Timeline |
242
- |--------|---------|--------|----------|
243
- | **Documentation Coverage** | 97% | 100% | ⏱️ Almost complete |
244
- | **Duplicate Content** | ✅ Fully Consolidated | Single authoritative guide | ✅ Complete |
245
- | **Last Updated Tracking** | 100% | 100% | ✅ Complete |
246
- | **Content Accuracy** | 100% | 100% | Maintained |
247
- | **Review Cycle** | None | Quarterly | Ongoing |
248
-
249
- ---
250
-
251
- **Report Generated**: October 29, 2025 (9:43am AEDT)
252
- **Next Review**: January 29, 2026
253
- **Status**: ✅ **Excellent - 97% Coverage Achieved**
@@ -1,37 +0,0 @@
1
- # Documentation style checklist
2
-
3
- Use this checklist every time you add or revise a doc in `packages/core/docs/`.
4
-
5
- ## Voice & tone
6
-
7
- - [ ] Write in clear, direct sentences (active voice, present tense where possible).
8
- - [ ] Assume the reader is a React developer comfortable with TypeScript.
9
- - [ ] Explain *why* a step matters before diving into *how* to do it.
10
-
11
- ## Structure
12
-
13
- - [ ] Use `#` for the page title once per file, then start sections at `##`.
14
- - [ ] Open with context (goal, prerequisites, or summary) before commands or code.
15
- - [ ] End with next steps, validation checks, or related links.
16
- - [ ] Place new pages in the directory that matches their topic (e.g. RBAC docs in `docs/rbac/`).
17
-
18
- ## Formatting
19
-
20
- - [ ] Prefer fenced code blocks with a language tag (`ts`, `tsx`, `bash`).
21
- - [ ] Include imports in code samples so they can be copied directly.
22
- - [ ] Keep bullet lists parallel and under seven items; switch to tables if structure matters.
23
- - [ ] Link to neighbouring docs using relative paths (e.g. `../rbac/quick-start.md`).
24
-
25
- ## Accuracy & maintenance
26
-
27
- - [ ] Check the referenced APIs against the current implementation in `packages/core/src/`.
28
- - [ ] Verify commands run against the repo (lint, build, scripts) before publishing.
29
- - [ ] Update [documentation-index.md](./documentation-index.md) if you add, remove, or rename a page.
30
- - [ ] Note follow-up work or TODOs in the "Known gaps" area of [README.md](./README.md) so they remain visible.
31
-
32
- ## Review before merging
33
-
34
- - [ ] Run a spell check or read the page aloud to catch awkward phrasing.
35
- - [ ] Confirm headings appear in order (no skipping from `##` to `####`).
36
- - [ ] Validate that all links resolve locally.
37
- - [ ] Capture screenshots when you change visual components and attach them to the PR if applicable.
@@ -1,150 +0,0 @@
1
- /**
2
- * @file PermissionExample Unit Tests
3
- * @package @jmruthers/pace-core
4
- * @module Examples/RBAC/Tests
5
- * @since 0.4.0
6
- */
7
-
8
- import React from 'react';
9
- import { screen } from '@testing-library/react';
10
- import { describe, it, expect, vi } from 'vitest';
11
- import '@testing-library/jest-dom';
12
- import { renderWithProviders } from '../../../src/__tests__/helpers/test-utils';
13
- import { PermissionExample } from '../PermissionExample';
14
-
15
- // Mock the hooks since this is a demonstration component
16
- vi.mock('../../src/providers', () => ({
17
- useUnifiedAuth: () => ({
18
- user: { email: 'test@example.com' },
19
- isAuthenticated: true,
20
- hasPermission: (permission: string) => permission === 'app:read',
21
- hasAccessLevel: (level: string) => level === 'editor',
22
- accessLevel: 'editor',
23
- selectedEventId: 'event-123',
24
- setSelectedEventId: vi.fn()
25
- })
26
- }));
27
-
28
- vi.mock('../../src/hooks', () => ({
29
- useAppConfig: () => ({
30
- supportsDirectAccess: true,
31
- requiresEvent: false,
32
- isLoading: false,
33
- appName: 'Test App'
34
- })
35
- }));
36
-
37
- vi.mock('../../src/types', () => ({
38
- AccessLevel: {
39
- EDITOR: 'editor',
40
- PLANNER: 'planner',
41
- ADMIN: 'admin'
42
- }
43
- }));
44
-
45
- describe('PermissionExample Component', () => {
46
- describe('Rendering', () => {
47
- it('renders without crashing', () => {
48
- renderWithProviders(<PermissionExample />);
49
- expect(screen.getByText('Permission System Example')).toBeInTheDocument();
50
- });
51
-
52
- it('renders app configuration information', () => {
53
- renderWithProviders(<PermissionExample />);
54
- expect(screen.getByText(/App Configuration: Test App/)).toBeInTheDocument();
55
- expect(screen.getByText(/Supports Direct Access: ✅/)).toBeInTheDocument();
56
- });
57
-
58
- it('displays current user information', () => {
59
- renderWithProviders(<PermissionExample />);
60
- expect(screen.getByText(/User: test@example.com/)).toBeInTheDocument();
61
- });
62
-
63
- it('renders permission examples section', () => {
64
- renderWithProviders(<PermissionExample />);
65
- expect(screen.getByText('Permission Examples')).toBeInTheDocument();
66
- expect(screen.getByText('Basic Permissions')).toBeInTheDocument();
67
- expect(screen.getByText('Access Level Checks')).toBeInTheDocument();
68
- });
69
- });
70
-
71
- describe('Permission Display', () => {
72
- it('shows permission statuses', () => {
73
- renderWithProviders(<PermissionExample />);
74
-
75
- // Should show read permission is granted
76
- expect(screen.getByText(/Can Read: ✅/)).toBeInTheDocument();
77
- // Should show other permissions are denied (mocked to only return true for read)
78
- expect(screen.getByText(/Can Write: ❌/)).toBeInTheDocument();
79
- });
80
-
81
- it('displays access level information', () => {
82
- renderWithProviders(<PermissionExample />);
83
-
84
- expect(screen.getByText(/Is Editor\+: ✅/)).toBeInTheDocument();
85
- expect(screen.getByText(/Is Planner\+: ❌/)).toBeInTheDocument();
86
- expect(screen.getByText(/Is Admin: ❌/)).toBeInTheDocument();
87
- });
88
- });
89
-
90
- describe('Conditional Rendering', () => {
91
- it('shows conditional UI elements based on permissions', () => {
92
- renderWithProviders(<PermissionExample />);
93
-
94
- // Should show read permission content
95
- expect(screen.getByText(/You can see this because you have read permission/)).toBeInTheDocument();
96
-
97
- // Should show message about missing delete permission
98
- expect(screen.getByText(/Delete functionality not available for your access level/)).toBeInTheDocument();
99
- });
100
-
101
- it('does not show write permission content when not granted', () => {
102
- renderWithProviders(<PermissionExample />);
103
-
104
- // Should not show edit button (write permission not granted in mock)
105
- expect(screen.queryByText(/Edit \(Available with write permission\)/)).not.toBeInTheDocument();
106
- });
107
-
108
- it('does not show admin content when access level is insufficient', () => {
109
- renderWithProviders(<PermissionExample />);
110
-
111
- // Should not show admin-only content (mock returns editor level, not admin)
112
- expect(screen.queryByText(/Admin-only content visible/)).not.toBeInTheDocument();
113
- });
114
- });
115
-
116
- describe('Component Structure', () => {
117
- it('has proper heading structure', () => {
118
- renderWithProviders(<PermissionExample />);
119
-
120
- expect(screen.getByRole('heading', { level: 2, name: 'Permission System Example' })).toBeInTheDocument();
121
- expect(screen.getByRole('heading', { level: 3, name: 'Permission Examples' })).toBeInTheDocument();
122
- });
123
-
124
- it('organizes content into logical sections', () => {
125
- renderWithProviders(<PermissionExample />);
126
-
127
- expect(screen.getByText('App Configuration')).toBeInTheDocument();
128
- expect(screen.getByText('Permission Examples')).toBeInTheDocument();
129
- expect(screen.getByText('Current Status')).toBeInTheDocument();
130
- });
131
- });
132
-
133
- describe('Data Display', () => {
134
- it('displays current status information', () => {
135
- renderWithProviders(<PermissionExample />);
136
-
137
- expect(screen.getByText(/App: Test App/)).toBeInTheDocument();
138
- expect(screen.getByText(/Event: event-123/)).toBeInTheDocument();
139
- expect(screen.getByText(/Permission Model: Direct Access/)).toBeInTheDocument();
140
- });
141
-
142
- it('shows correct access model based on configuration', () => {
143
- renderWithProviders(<PermissionExample />);
144
-
145
- // Since supportsDirectAccess is true and requiresEvent is false
146
- expect(screen.getByText(/Permission Model: Direct Access/)).toBeInTheDocument();
147
- });
148
- });
149
- });
150
-