@jmruthers/pace-core 0.5.193 → 0.6.2

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 (577) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +7 -1
  3. package/cursor-rules/00-pace-core-compliance.mdc +299 -0
  4. package/cursor-rules/01-standards-compliance.mdc +244 -0
  5. package/cursor-rules/02-project-structure.mdc +200 -0
  6. package/cursor-rules/03-solid-principles.mdc +222 -0
  7. package/cursor-rules/04-testing-standards.mdc +268 -0
  8. package/cursor-rules/05-bug-reports-and-features.mdc +246 -0
  9. package/cursor-rules/06-code-quality.mdc +309 -0
  10. package/cursor-rules/07-tech-stack-compliance.mdc +214 -0
  11. package/cursor-rules/08-markup-quality.mdc +452 -0
  12. package/cursor-rules/CHANGELOG.md +119 -0
  13. package/cursor-rules/README.md +192 -0
  14. package/dist/{AuthService-DjnJHDtC.d.ts → AuthService-BPvc3Ka0.d.ts} +54 -0
  15. package/dist/{DataTable-Be6dH_dR.d.ts → DataTable-BMRU8a1j.d.ts} +34 -2
  16. package/dist/{DataTable-5FU7IESH.js → DataTable-TPTKCX4D.js} +10 -9
  17. package/dist/{PublicPageProvider-C0Sm_e5k.d.ts → PublicPageProvider-DC6kCaqf.d.ts} +385 -261
  18. package/dist/{UnifiedAuthProvider-RGJTDE2C.js → UnifiedAuthProvider-CH6Z342H.js} +3 -3
  19. package/dist/{UnifiedAuthProvider-185Ih4dj.d.ts → UnifiedAuthProvider-CVcTjx-d.d.ts} +29 -0
  20. package/dist/{api-N774RPUA.js → api-MVVQZLJI.js} +2 -2
  21. package/dist/{chunk-KNC55RTG.js → chunk-24UVZUZG.js} +90 -54
  22. package/dist/chunk-24UVZUZG.js.map +1 -0
  23. package/dist/{chunk-HWIIPPNI.js → chunk-2UOI2FG5.js} +20 -20
  24. package/dist/chunk-2UOI2FG5.js.map +1 -0
  25. package/dist/{chunk-E3SPN4VZ 5.js → chunk-3XC4CPTD.js} +4345 -3986
  26. package/dist/chunk-3XC4CPTD.js.map +1 -0
  27. package/dist/{chunk-7EQTDTTJ.js → chunk-6J4GEEJR.js} +172 -45
  28. package/dist/chunk-6J4GEEJR.js.map +1 -0
  29. package/dist/{chunk-6C4YBBJM 5.js → chunk-6SOIHG6Z.js} +1 -1
  30. package/dist/chunk-6SOIHG6Z.js.map +1 -0
  31. package/dist/{chunk-7FLMSG37.js → chunk-EHMR7VYL.js} +25 -25
  32. package/dist/chunk-EHMR7VYL.js.map +1 -0
  33. package/dist/{chunk-I7PSE6JW.js → chunk-F2IMUDXZ.js} +2 -75
  34. package/dist/chunk-F2IMUDXZ.js.map +1 -0
  35. package/dist/{chunk-QWWZ5CAQ.js → chunk-FFQEQTNW.js} +7 -9
  36. package/dist/chunk-FFQEQTNW.js.map +1 -0
  37. package/dist/chunk-FMUCXFII.js +76 -0
  38. package/dist/chunk-FMUCXFII.js.map +1 -0
  39. package/dist/{chunk-HW3OVDUF.js → chunk-J36DSWQK.js} +1 -1
  40. package/dist/{chunk-HW3OVDUF.js.map → chunk-J36DSWQK.js.map} +1 -1
  41. package/dist/{chunk-SQGMNID3.js → chunk-L4OXEN46.js} +4 -5
  42. package/dist/chunk-L4OXEN46.js.map +1 -0
  43. package/dist/{chunk-R77UEZ4E 3.js → chunk-M43Y4SSO.js} +1 -1
  44. package/dist/chunk-M43Y4SSO.js.map +1 -0
  45. package/dist/{chunk-IIELH4DL.js → chunk-MMZ7JXPU.js} +60 -223
  46. package/dist/chunk-MMZ7JXPU.js.map +1 -0
  47. package/dist/{chunk-NOAYCWCX 5.js → chunk-NECFR5MM.js} +394 -312
  48. package/dist/chunk-NECFR5MM.js.map +1 -0
  49. package/dist/{chunk-BC4IJKSL.js → chunk-SFZUDBL5.js} +40 -4
  50. package/dist/chunk-SFZUDBL5.js.map +1 -0
  51. package/dist/{chunk-XNXXZ43G.js → chunk-XWQCNGTQ.js} +748 -364
  52. package/dist/chunk-XWQCNGTQ.js.map +1 -0
  53. package/dist/components.d.ts +6 -6
  54. package/dist/components.js +15 -12
  55. package/dist/components.js.map +1 -1
  56. package/dist/{functions-D_kgHktt.d.ts → functions-DHebl8-F.d.ts} +1 -1
  57. package/dist/hooks.d.ts +59 -126
  58. package/dist/hooks.js +19 -28
  59. package/dist/hooks.js.map +1 -1
  60. package/dist/index.d.ts +63 -16
  61. package/dist/index.js +23 -24
  62. package/dist/index.js.map +1 -1
  63. package/dist/providers.d.ts +21 -3
  64. package/dist/providers.js +2 -2
  65. package/dist/rbac/index.d.ts +146 -115
  66. package/dist/rbac/index.js +8 -11
  67. package/dist/theming/runtime.d.ts +1 -13
  68. package/dist/theming/runtime.js +1 -1
  69. package/dist/{timezone-_pgH8qrY.d.ts → timezone-CHhWg6b4.d.ts} +3 -10
  70. package/dist/{types-UU913iLA.d.ts → types-BeoeWV5I.d.ts} +8 -0
  71. package/dist/{types-CEpcvwwF.d.ts → types-CkbwOr4Y.d.ts} +6 -0
  72. package/dist/types.d.ts +2 -2
  73. package/dist/{usePublicRouteParams-TZe0gy-4.d.ts → usePublicRouteParams-1oMokgLF.d.ts} +34 -4
  74. package/dist/{useToast-C8gR5ir4.d.ts → useToast-AyaT-x7p.d.ts} +2 -2
  75. package/dist/utils.d.ts +4 -5
  76. package/dist/utils.js +15 -15
  77. package/dist/utils.js.map +1 -1
  78. package/docs/api/README.md +7 -1
  79. package/docs/api/classes/ColumnFactory.md +8 -8
  80. package/docs/api/classes/InvalidScopeError.md +4 -4
  81. package/docs/api/classes/Logger.md +1 -1
  82. package/docs/api/classes/MissingUserContextError.md +4 -4
  83. package/docs/api/classes/OrganisationContextRequiredError.md +4 -4
  84. package/docs/api/classes/PermissionDeniedError.md +4 -4
  85. package/docs/api/classes/RBACAuditManager.md +1 -1
  86. package/docs/api/classes/RBACCache.md +1 -1
  87. package/docs/api/classes/RBACEngine.md +1 -1
  88. package/docs/api/classes/RBACError.md +4 -4
  89. package/docs/api/classes/RBACNotInitializedError.md +4 -4
  90. package/docs/api/classes/SecureSupabaseClient.md +18 -15
  91. package/docs/api/classes/StorageUtils.md +1 -1
  92. package/docs/api/enums/FileCategory.md +1 -1
  93. package/docs/api/enums/LogLevel.md +1 -1
  94. package/docs/api/enums/RBACErrorCode.md +1 -1
  95. package/docs/api/enums/RPCFunction.md +1 -1
  96. package/docs/api/interfaces/AddressFieldProps.md +1 -1
  97. package/docs/api/interfaces/AddressFieldRef.md +1 -1
  98. package/docs/api/interfaces/AggregateConfig.md +4 -4
  99. package/docs/api/interfaces/AutocompleteOptions.md +1 -1
  100. package/docs/api/interfaces/AvatarProps.md +1 -1
  101. package/docs/api/interfaces/BadgeProps.md +9 -2
  102. package/docs/api/interfaces/ButtonProps.md +7 -4
  103. package/docs/api/interfaces/CalendarProps.md +8 -5
  104. package/docs/api/interfaces/CardProps.md +8 -5
  105. package/docs/api/interfaces/ColorPalette.md +1 -1
  106. package/docs/api/interfaces/ColorShade.md +1 -1
  107. package/docs/api/interfaces/ComplianceResult.md +1 -1
  108. package/docs/api/interfaces/DataAccessRecord.md +9 -9
  109. package/docs/api/interfaces/DataRecord.md +1 -1
  110. package/docs/api/interfaces/DataTableAction.md +24 -21
  111. package/docs/api/interfaces/DataTableColumn.md +31 -31
  112. package/docs/api/interfaces/DataTableProps.md +1 -1
  113. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  114. package/docs/api/interfaces/DatabaseComplianceResult.md +1 -1
  115. package/docs/api/interfaces/DatabaseIssue.md +1 -1
  116. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  117. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  118. package/docs/api/interfaces/ErrorBoundaryProps.md +147 -0
  119. package/docs/api/interfaces/ErrorBoundaryProviderProps.md +36 -0
  120. package/docs/api/interfaces/ErrorBoundaryState.md +75 -0
  121. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  122. package/docs/api/interfaces/ExportColumn.md +1 -1
  123. package/docs/api/interfaces/ExportOptions.md +8 -8
  124. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  125. package/docs/api/interfaces/FileMetadata.md +1 -1
  126. package/docs/api/interfaces/FileReference.md +1 -1
  127. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  128. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  129. package/docs/api/interfaces/FileUploadProps.md +26 -23
  130. package/docs/api/interfaces/FooterProps.md +10 -8
  131. package/docs/api/interfaces/FormFieldProps.md +10 -10
  132. package/docs/api/interfaces/FormProps.md +1 -1
  133. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  134. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  135. package/docs/api/interfaces/InputProps.md +7 -4
  136. package/docs/api/interfaces/LabelProps.md +1 -1
  137. package/docs/api/interfaces/LoggerConfig.md +1 -1
  138. package/docs/api/interfaces/LoginFormProps.md +14 -11
  139. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  140. package/docs/api/interfaces/NavigationContextType.md +1 -1
  141. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  142. package/docs/api/interfaces/NavigationItem.md +11 -11
  143. package/docs/api/interfaces/NavigationMenuProps.md +15 -15
  144. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  145. package/docs/api/interfaces/Organisation.md +1 -1
  146. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  147. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  148. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  149. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  150. package/docs/api/interfaces/PaceAppLayoutProps.md +30 -27
  151. package/docs/api/interfaces/PaceLoginPageProps.md +6 -4
  152. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  153. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  154. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  155. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  156. package/docs/api/interfaces/PaletteData.md +1 -1
  157. package/docs/api/interfaces/ParsedAddress.md +1 -1
  158. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  159. package/docs/api/interfaces/ProgressProps.md +1 -1
  160. package/docs/api/interfaces/ProtectedRouteProps.md +7 -26
  161. package/docs/api/interfaces/PublicPageFooterProps.md +9 -9
  162. package/docs/api/interfaces/PublicPageHeaderProps.md +10 -10
  163. package/docs/api/interfaces/PublicPageLayoutProps.md +7 -20
  164. package/docs/api/interfaces/QuickFix.md +1 -1
  165. package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
  166. package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
  167. package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
  168. package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
  169. package/docs/api/interfaces/RBACConfig.md +1 -1
  170. package/docs/api/interfaces/RBACContext.md +1 -1
  171. package/docs/api/interfaces/RBACLogger.md +1 -1
  172. package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
  173. package/docs/api/interfaces/RBACPerformanceMetrics.md +1 -1
  174. package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
  175. package/docs/api/interfaces/RBACPermissionCheckResult.md +1 -1
  176. package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
  177. package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
  178. package/docs/api/interfaces/RBACResult.md +1 -1
  179. package/docs/api/interfaces/RBACRoleGrantParams.md +1 -1
  180. package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
  181. package/docs/api/interfaces/RBACRoleRevokeParams.md +1 -1
  182. package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
  183. package/docs/api/interfaces/RBACRoleValidateParams.md +1 -1
  184. package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
  185. package/docs/api/interfaces/RBACRolesListParams.md +1 -1
  186. package/docs/api/interfaces/RBACRolesListResult.md +1 -1
  187. package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
  188. package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
  189. package/docs/api/interfaces/ResourcePermissions.md +1 -1
  190. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  191. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  192. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  193. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  194. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  195. package/docs/api/interfaces/RouteConfig.md +1 -1
  196. package/docs/api/interfaces/RuntimeComplianceResult.md +1 -1
  197. package/docs/api/interfaces/SecureDataContextType.md +9 -9
  198. package/docs/api/interfaces/SecureDataProviderProps.md +8 -8
  199. package/docs/api/interfaces/SessionRestorationLoaderProps.md +3 -3
  200. package/docs/api/interfaces/SetupIssue.md +1 -1
  201. package/docs/api/interfaces/StorageConfig.md +1 -1
  202. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  203. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  204. package/docs/api/interfaces/StorageListOptions.md +1 -1
  205. package/docs/api/interfaces/StorageListResult.md +1 -1
  206. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  207. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  208. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  209. package/docs/api/interfaces/StyleImport.md +1 -1
  210. package/docs/api/interfaces/SwitchProps.md +1 -1
  211. package/docs/api/interfaces/TabsContentProps.md +1 -1
  212. package/docs/api/interfaces/TabsListProps.md +1 -1
  213. package/docs/api/interfaces/TabsProps.md +1 -1
  214. package/docs/api/interfaces/TabsTriggerProps.md +3 -3
  215. package/docs/api/interfaces/TextareaProps.md +1 -1
  216. package/docs/api/interfaces/ToastActionElement.md +4 -1
  217. package/docs/api/interfaces/ToastProps.md +1 -1
  218. package/docs/api/interfaces/UnifiedAuthContextType.md +58 -55
  219. package/docs/api/interfaces/UnifiedAuthProviderProps.md +15 -13
  220. package/docs/api/interfaces/UseFormDialogOptions.md +1 -1
  221. package/docs/api/interfaces/UseFormDialogReturn.md +1 -1
  222. package/docs/api/interfaces/UseInactivityTrackerOptions.md +11 -9
  223. package/docs/api/interfaces/UseInactivityTrackerReturn.md +8 -8
  224. package/docs/api/interfaces/UsePublicEventLogoOptions.md +6 -6
  225. package/docs/api/interfaces/UsePublicEventLogoReturn.md +9 -6
  226. package/docs/api/interfaces/UsePublicEventOptions.md +3 -3
  227. package/docs/api/interfaces/UsePublicEventReturn.md +8 -5
  228. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +4 -4
  229. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +12 -9
  230. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +10 -7
  231. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  232. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  233. package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
  234. package/docs/api/interfaces/UserEventAccess.md +14 -11
  235. package/docs/api/interfaces/UserMenuProps.md +8 -6
  236. package/docs/api/interfaces/UserProfile.md +1 -1
  237. package/docs/api/modules.md +575 -634
  238. package/docs/architecture/database-schema-requirements.md +161 -0
  239. package/docs/core-concepts/rbac-system.md +3 -3
  240. package/docs/documentation-index.md +2 -4
  241. package/docs/getting-started/cursor-rules.md +263 -0
  242. package/docs/getting-started/installation-guide.md +6 -1
  243. package/docs/getting-started/quick-start.md +6 -1
  244. package/docs/migration/DOCUMENTATION_STRUCTURE.md +441 -0
  245. package/docs/migration/MIGRATION_GUIDE.md +6 -28
  246. package/docs/migration/README.md +52 -6
  247. package/docs/migration/V0.5.190_TO_V0.6.1_MIGRATION.md +1153 -0
  248. package/docs/migration/V0.6.0_REACT_19_MIGRATION.md +227 -0
  249. package/docs/migration/database-changes-december-2025.md +3 -3
  250. package/docs/rbac/event-based-apps.md +1 -1
  251. package/docs/rbac/getting-started.md +1 -1
  252. package/docs/rbac/quick-start.md +1 -1
  253. package/docs/standards/README.md +40 -0
  254. package/docs/troubleshooting/migration.md +4 -4
  255. package/examples/PublicPages/PublicEventPage.tsx +1 -1
  256. package/package.json +12 -6
  257. package/scripts/audit/core/checks/accessibility.cjs +197 -0
  258. package/scripts/audit/core/checks/api-usage.cjs +191 -0
  259. package/scripts/audit/core/checks/bundle.cjs +142 -0
  260. package/scripts/{check-pace-core-compliance.cjs → audit/core/checks/compliance.cjs} +737 -691
  261. package/scripts/audit/core/checks/config.cjs +54 -0
  262. package/scripts/audit/core/checks/coverage.cjs +84 -0
  263. package/scripts/audit/core/checks/dependencies.cjs +454 -0
  264. package/scripts/audit/core/checks/documentation.cjs +203 -0
  265. package/scripts/audit/core/checks/environment.cjs +128 -0
  266. package/scripts/audit/core/checks/error-handling.cjs +299 -0
  267. package/scripts/audit/core/checks/forms.cjs +172 -0
  268. package/scripts/audit/core/checks/heuristics.cjs +68 -0
  269. package/scripts/audit/core/checks/hooks.cjs +334 -0
  270. package/scripts/audit/core/checks/imports.cjs +244 -0
  271. package/scripts/audit/core/checks/performance.cjs +325 -0
  272. package/scripts/audit/core/checks/routes.cjs +117 -0
  273. package/scripts/audit/core/checks/state.cjs +130 -0
  274. package/scripts/audit/core/checks/structure.cjs +65 -0
  275. package/scripts/audit/core/checks/style.cjs +584 -0
  276. package/scripts/audit/core/checks/testing.cjs +122 -0
  277. package/scripts/audit/core/checks/typescript.cjs +61 -0
  278. package/scripts/audit/core/scanner.cjs +199 -0
  279. package/scripts/audit/core/utils.cjs +137 -0
  280. package/scripts/audit/index.cjs +223 -0
  281. package/scripts/audit/reporters/console.cjs +151 -0
  282. package/scripts/audit/reporters/json.cjs +54 -0
  283. package/scripts/audit/reporters/markdown.cjs +124 -0
  284. package/scripts/audit-consuming-app.cjs +86 -0
  285. package/scripts/build-docs/build-decision.js +240 -0
  286. package/scripts/build-docs/cache-utils.js +105 -0
  287. package/scripts/build-docs/content-normalization.js +150 -0
  288. package/scripts/build-docs/file-utils.js +105 -0
  289. package/scripts/build-docs/git-utils.js +86 -0
  290. package/scripts/build-docs/hash-utils.js +116 -0
  291. package/scripts/build-docs/typedoc-runner.js +220 -0
  292. package/scripts/build-docs-incremental.js +77 -913
  293. package/scripts/install-cursor-rules.cjs +236 -0
  294. package/scripts/utils/command-runner.js +16 -11
  295. package/scripts/validate-formats.js +61 -56
  296. package/scripts/validate-master.js +74 -69
  297. package/scripts/validate-pre-publish.js +70 -65
  298. package/src/__tests__/helpers/test-providers.tsx +1 -1
  299. package/src/__tests__/helpers/test-utils.tsx +1 -1
  300. package/src/__tests__/hooks/usePermissions.test.ts +2 -2
  301. package/src/components/Alert/Alert.test.tsx +12 -18
  302. package/src/components/Alert/Alert.tsx +5 -7
  303. package/src/components/Avatar/Avatar.test.tsx +4 -4
  304. package/src/components/Badge/Badge.tsx +16 -4
  305. package/src/components/Button/Button.tsx +27 -4
  306. package/src/components/Calendar/Calendar.tsx +9 -3
  307. package/src/components/Card/Card.tsx +4 -0
  308. package/src/components/Checkbox/Checkbox.test.tsx +12 -12
  309. package/src/components/Checkbox/Checkbox.tsx +2 -2
  310. package/src/components/DataTable/DataTable.test.tsx +57 -93
  311. package/src/components/DataTable/DataTable.tsx +40 -6
  312. package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +5 -6
  313. package/src/components/DataTable/__tests__/pagination.modes.test.tsx +29 -7
  314. package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx +12 -12
  315. package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +2 -3
  316. package/src/components/DataTable/components/AccessDeniedPage.tsx +17 -26
  317. package/src/components/DataTable/components/ActionButtons.tsx +10 -7
  318. package/src/components/DataTable/components/BulkOperationsDropdown.tsx +2 -2
  319. package/src/components/DataTable/components/ColumnFilter.tsx +10 -0
  320. package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +12 -0
  321. package/src/components/DataTable/components/DataTableBody.tsx +8 -0
  322. package/src/components/DataTable/components/DataTableCore.tsx +200 -561
  323. package/src/components/DataTable/components/DataTableErrorBoundary.tsx +11 -0
  324. package/src/components/DataTable/components/DataTableLayout.tsx +559 -0
  325. package/src/components/DataTable/components/DataTableModals.tsx +9 -1
  326. package/src/components/DataTable/components/DataTableToolbar.tsx +8 -0
  327. package/src/components/DataTable/components/DraggableColumnHeader.tsx +12 -0
  328. package/src/components/DataTable/components/EditFields.tsx +307 -0
  329. package/src/components/DataTable/components/EditableRow.tsx +9 -1
  330. package/src/components/DataTable/components/EmptyState.tsx +10 -0
  331. package/src/components/DataTable/components/FilterRow.tsx +12 -0
  332. package/src/components/DataTable/components/GroupHeader.tsx +12 -0
  333. package/src/components/DataTable/components/GroupingDropdown.tsx +12 -0
  334. package/src/components/DataTable/components/ImportModal.tsx +7 -0
  335. package/src/components/DataTable/components/LoadingState.tsx +6 -0
  336. package/src/components/DataTable/components/PaginationControls.tsx +16 -1
  337. package/src/components/DataTable/components/RowComponent.tsx +391 -0
  338. package/src/components/DataTable/components/UnifiedTableBody.tsx +62 -852
  339. package/src/components/DataTable/components/VirtualizedDataTable.tsx +16 -4
  340. package/src/components/DataTable/components/__tests__/AccessDeniedPage.test.tsx +4 -2
  341. package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +23 -23
  342. package/src/components/DataTable/components/__tests__/EditableRow.test.tsx +11 -11
  343. package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +36 -36
  344. package/src/components/DataTable/components/__tests__/GroupHeader.test.tsx +27 -27
  345. package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +39 -39
  346. package/src/components/DataTable/components/__tests__/UnifiedTableBody.test.tsx +33 -33
  347. package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +29 -29
  348. package/src/components/DataTable/components/cellValueUtils.ts +40 -0
  349. package/src/components/DataTable/components/hooks/useImportModalFocus.ts +53 -0
  350. package/src/components/DataTable/components/hooks/usePermissionTracking.ts +126 -0
  351. package/src/components/DataTable/context/DataTableContext.tsx +50 -0
  352. package/src/components/DataTable/core/ColumnFactory.ts +31 -0
  353. package/src/components/DataTable/core/DataTableContext.tsx +32 -1
  354. package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +10 -0
  355. package/src/components/DataTable/hooks/useColumnReordering.ts +14 -2
  356. package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +10 -0
  357. package/src/components/DataTable/hooks/useDataTableDataPipeline.ts +16 -0
  358. package/src/components/DataTable/hooks/useDataTablePermissions.ts +124 -32
  359. package/src/components/DataTable/hooks/useDataTableState.ts +35 -1
  360. package/src/components/DataTable/hooks/useEffectiveColumnOrder.ts +12 -0
  361. package/src/components/DataTable/hooks/useKeyboardNavigation.ts +2 -2
  362. package/src/components/DataTable/hooks/useServerSideDataEffect.ts +11 -0
  363. package/src/components/DataTable/hooks/useTableColumns.ts +8 -0
  364. package/src/components/DataTable/hooks/useTableHandlers.ts +14 -0
  365. package/src/components/DataTable/styles.ts +6 -6
  366. package/src/components/DataTable/types.ts +6 -10
  367. package/src/components/DataTable/utils/a11yUtils.ts +7 -0
  368. package/src/components/DataTable/utils/debugTools.ts +18 -113
  369. package/src/components/DataTable/utils/errorHandling.ts +12 -0
  370. package/src/components/DataTable/utils/exportUtils.ts +9 -0
  371. package/src/components/DataTable/utils/flexibleImport.ts +12 -48
  372. package/src/components/DataTable/utils/paginationUtils.ts +8 -0
  373. package/src/components/DataTable/utils/performanceUtils.ts +5 -1
  374. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +8 -14
  375. package/src/components/Dialog/Dialog.tsx +8 -7
  376. package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +180 -1
  377. package/src/components/ErrorBoundary/ErrorBoundary.tsx +46 -6
  378. package/src/components/ErrorBoundary/ErrorBoundaryContext.tsx +129 -0
  379. package/src/components/ErrorBoundary/index.ts +27 -2
  380. package/src/components/EventSelector/EventSelector.tsx +4 -1
  381. package/src/components/FileDisplay/FileDisplay.test.tsx +2 -2
  382. package/src/components/FileDisplay/FileDisplay.tsx +32 -18
  383. package/src/components/FileUpload/FileUpload.tsx +22 -2
  384. package/src/components/Footer/Footer.test.tsx +16 -16
  385. package/src/components/Footer/Footer.tsx +15 -12
  386. package/src/components/Form/Form.test.tsx +36 -15
  387. package/src/components/Form/Form.tsx +31 -26
  388. package/src/components/Header/Header.tsx +22 -11
  389. package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +40 -40
  390. package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +1 -1
  391. package/src/components/Input/Input.test.tsx +2 -2
  392. package/src/components/Input/Input.tsx +36 -34
  393. package/src/components/Label/Label.tsx +1 -1
  394. package/src/components/LoadingSpinner/LoadingSpinner.test.tsx +4 -4
  395. package/src/components/LoadingSpinner/LoadingSpinner.tsx +1 -1
  396. package/src/components/LoginForm/LoginForm.test.tsx +42 -42
  397. package/src/components/LoginForm/LoginForm.tsx +12 -8
  398. package/src/components/NavigationMenu/NavigationMenu.tsx +15 -514
  399. package/src/components/NavigationMenu/types.ts +56 -0
  400. package/src/components/NavigationMenu/useNavigationFiltering.ts +390 -0
  401. package/src/components/OrganisationSelector/OrganisationSelector.tsx +3 -0
  402. package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +1 -1
  403. package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +54 -52
  404. package/src/components/PaceAppLayout/PaceAppLayout.tsx +33 -12
  405. package/src/components/PaceAppLayout/README.md +1 -1
  406. package/src/components/PaceAppLayout/test-setup.tsx +1 -2
  407. package/src/components/PaceLoginPage/PaceLoginPage.tsx +4 -1
  408. package/src/components/PasswordChange/PasswordChangeForm.test.tsx +33 -33
  409. package/src/components/PasswordChange/PasswordChangeForm.tsx +10 -1
  410. package/src/components/Progress/Progress.tsx +1 -1
  411. package/src/components/ProtectedRoute/ProtectedRoute.tsx +3 -9
  412. package/src/components/PublicLayout/PublicPageLayout.tsx +3 -6
  413. package/src/components/PublicLayout/PublicPageProvider.tsx +4 -0
  414. package/src/components/Select/Select.tsx +95 -438
  415. package/src/components/Select/context.ts +23 -0
  416. package/src/components/Select/hooks/useSelectEvents.ts +87 -0
  417. package/src/components/Select/hooks/useSelectSearch.ts +91 -0
  418. package/src/components/Select/hooks/useSelectState.ts +104 -0
  419. package/src/components/Select/index.ts +9 -1
  420. package/src/components/Select/types.ts +123 -0
  421. package/src/components/Select/utils/text.ts +26 -0
  422. package/src/components/SessionRestorationLoader/SessionRestorationLoader.tsx +5 -6
  423. package/src/components/Switch/Switch.tsx +4 -4
  424. package/src/components/Table/Table.tsx +1 -1
  425. package/src/components/Tabs/Tabs.tsx +1 -1
  426. package/src/components/Textarea/Textarea.tsx +27 -29
  427. package/src/components/Toast/Toast.tsx +5 -1
  428. package/src/components/Tooltip/Tooltip.tsx +3 -3
  429. package/src/components/UserMenu/UserMenu.test.tsx +24 -11
  430. package/src/components/UserMenu/UserMenu.tsx +22 -19
  431. package/src/components/index.ts +2 -2
  432. package/src/hooks/__tests__/hooks.integration.test.tsx +80 -55
  433. package/src/hooks/__tests__/index.unit.test.ts +2 -5
  434. package/src/hooks/__tests__/useStorage.unit.test.ts +36 -36
  435. package/src/hooks/index.ts +1 -2
  436. package/src/hooks/public/usePublicEvent.ts +5 -1
  437. package/src/hooks/public/usePublicEventLogo.ts +5 -1
  438. package/src/hooks/public/usePublicFileDisplay.ts +4 -0
  439. package/src/hooks/public/usePublicRouteParams.ts +5 -1
  440. package/src/hooks/services/useAuth.ts +32 -0
  441. package/src/hooks/services/useCurrentEvent.ts +6 -0
  442. package/src/hooks/services/useCurrentOrganisation.ts +6 -0
  443. package/src/hooks/useDataTableState.ts +8 -18
  444. package/src/hooks/useDebounce.ts +9 -0
  445. package/src/hooks/useEventTheme.ts +6 -0
  446. package/src/hooks/useFileDisplay.ts +4 -0
  447. package/src/hooks/useFileReference.ts +25 -7
  448. package/src/hooks/useFileUrl.ts +11 -1
  449. package/src/hooks/useFocusManagement.ts +16 -2
  450. package/src/hooks/useFocusTrap.ts +7 -4
  451. package/src/hooks/useFormDialog.ts +8 -7
  452. package/src/hooks/useInactivityTracker.ts +4 -1
  453. package/src/hooks/useKeyboardShortcuts.ts +4 -0
  454. package/src/hooks/useOrganisationPermissions.ts +4 -0
  455. package/src/hooks/useOrganisationSecurity.ts +4 -0
  456. package/src/hooks/usePerformanceMonitor.ts +4 -0
  457. package/src/hooks/usePermissionCache.ts +8 -1
  458. package/src/hooks/useQueryCache.ts +12 -1
  459. package/src/hooks/useSessionRestoration.ts +4 -0
  460. package/src/hooks/useStorage.ts +4 -0
  461. package/src/hooks/useToast.ts +3 -3
  462. package/src/index.ts +2 -1
  463. package/src/providers/__tests__/OrganisationProvider.test.tsx +115 -49
  464. package/src/providers/__tests__/ProviderLifecycle.test.tsx +21 -6
  465. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +10 -10
  466. package/src/providers/services/AuthServiceProvider.tsx +18 -0
  467. package/src/providers/services/EventServiceProvider.tsx +18 -0
  468. package/src/providers/services/InactivityServiceProvider.tsx +18 -0
  469. package/src/providers/services/OrganisationServiceProvider.tsx +18 -0
  470. package/src/providers/services/UnifiedAuthProvider.tsx +58 -22
  471. package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +33 -7
  472. package/src/rbac/README.md +1 -1
  473. package/src/rbac/__tests__/adapters.comprehensive.test.tsx +26 -26
  474. package/src/rbac/__tests__/scenarios.user-role.test.tsx +4 -5
  475. package/src/rbac/adapters.tsx +14 -5
  476. package/src/rbac/api.ts +100 -67
  477. package/src/rbac/components/EnhancedNavigationMenu.tsx +1 -1
  478. package/src/rbac/components/NavigationGuard.tsx +1 -1
  479. package/src/rbac/components/NavigationProvider.tsx +5 -2
  480. package/src/rbac/components/PagePermissionGuard.tsx +158 -18
  481. package/src/rbac/components/PagePermissionProvider.tsx +1 -1
  482. package/src/rbac/components/PermissionEnforcer.tsx +1 -1
  483. package/src/rbac/components/RoleBasedRouter.tsx +6 -2
  484. package/src/rbac/components/SecureDataProvider.test.tsx +84 -49
  485. package/src/rbac/components/SecureDataProvider.tsx +21 -6
  486. package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +24 -14
  487. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +7 -0
  488. package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +14 -6
  489. package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +15 -4
  490. package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +148 -24
  491. package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +81 -15
  492. package/src/rbac/engine.ts +38 -14
  493. package/src/rbac/hooks/permissions/index.ts +7 -0
  494. package/src/rbac/hooks/permissions/useAccessLevel.ts +105 -0
  495. package/src/rbac/hooks/permissions/useCachedPermissions.ts +79 -0
  496. package/src/rbac/hooks/permissions/useCan.ts +347 -0
  497. package/src/rbac/hooks/permissions/useHasAllPermissions.ts +90 -0
  498. package/src/rbac/hooks/permissions/useHasAnyPermission.ts +90 -0
  499. package/src/rbac/hooks/permissions/useMultiplePermissions.ts +93 -0
  500. package/src/rbac/hooks/permissions/usePermissions.ts +253 -0
  501. package/src/rbac/hooks/useCan.test.ts +71 -64
  502. package/src/rbac/hooks/usePermissions.ts +14 -995
  503. package/src/rbac/hooks/useResourcePermissions.test.ts +54 -18
  504. package/src/rbac/hooks/useResourcePermissions.ts +14 -4
  505. package/src/rbac/hooks/useSecureSupabase.ts +33 -13
  506. package/src/rbac/permissions.ts +0 -30
  507. package/src/rbac/secureClient.ts +212 -61
  508. package/src/rbac/types.ts +8 -0
  509. package/src/theming/__tests__/parseEventColours.test.ts +6 -9
  510. package/src/theming/parseEventColours.ts +5 -19
  511. package/src/types/vitest-globals.d.ts +51 -26
  512. package/src/utils/__mocks__/supabaseMock.ts +1 -3
  513. package/src/utils/__tests__/formatting.unit.test.ts +4 -4
  514. package/src/utils/__tests__/index.unit.test.ts +2 -2
  515. package/src/utils/audit/audit.ts +0 -3
  516. package/src/utils/core/cn.ts +1 -1
  517. package/src/utils/file-reference/index.ts +53 -1
  518. package/src/utils/formatting/formatting.ts +8 -18
  519. package/src/utils/index.ts +0 -1
  520. package/src/utils/security/secureDataAccess.test.ts +31 -20
  521. package/src/utils/security/secureDataAccess.ts +4 -3
  522. package/dist/chunk-6C4YBBJM.js +0 -628
  523. package/dist/chunk-6C4YBBJM.js.map +0 -1
  524. package/dist/chunk-7D4SUZUM.js 2.map +0 -1
  525. package/dist/chunk-7EQTDTTJ.js 2.map +0 -1
  526. package/dist/chunk-7EQTDTTJ.js.map +0 -1
  527. package/dist/chunk-7FLMSG37.js 2.map +0 -1
  528. package/dist/chunk-7FLMSG37.js.map +0 -1
  529. package/dist/chunk-BC4IJKSL.js.map +0 -1
  530. package/dist/chunk-E3SPN4VZ.js +0 -12917
  531. package/dist/chunk-E3SPN4VZ.js.map +0 -1
  532. package/dist/chunk-E66EQZE6 5.js +0 -37
  533. package/dist/chunk-E66EQZE6.js 2.map +0 -1
  534. package/dist/chunk-HWIIPPNI.js.map +0 -1
  535. package/dist/chunk-I7PSE6JW 5.js +0 -191
  536. package/dist/chunk-I7PSE6JW.js 2.map +0 -1
  537. package/dist/chunk-I7PSE6JW.js.map +0 -1
  538. package/dist/chunk-IIELH4DL.js.map +0 -1
  539. package/dist/chunk-KNC55RTG.js 5.map +0 -1
  540. package/dist/chunk-KNC55RTG.js.map +0 -1
  541. package/dist/chunk-KQCRWDSA.js 5.map +0 -1
  542. package/dist/chunk-LFNCN2SP.js +0 -412
  543. package/dist/chunk-LFNCN2SP.js 2.map +0 -1
  544. package/dist/chunk-LFNCN2SP.js.map +0 -1
  545. package/dist/chunk-LMC26NLJ 2.js +0 -84
  546. package/dist/chunk-NOAYCWCX.js +0 -4993
  547. package/dist/chunk-NOAYCWCX.js.map +0 -1
  548. package/dist/chunk-QWWZ5CAQ.js 3.map +0 -1
  549. package/dist/chunk-QWWZ5CAQ.js.map +0 -1
  550. package/dist/chunk-QXHPKYJV 3.js +0 -113
  551. package/dist/chunk-R77UEZ4E.js +0 -68
  552. package/dist/chunk-R77UEZ4E.js.map +0 -1
  553. package/dist/chunk-SQGMNID3.js.map +0 -1
  554. package/dist/chunk-VBXEHIUJ.js 6.map +0 -1
  555. package/dist/chunk-XNXXZ43G.js.map +0 -1
  556. package/dist/chunk-ZSAAAMVR 6.js +0 -25
  557. package/dist/components.js 5.map +0 -1
  558. package/dist/styles/index 2.js +0 -12
  559. package/dist/styles/index.js 5.map +0 -1
  560. package/dist/theming/runtime 5.js +0 -19
  561. package/dist/theming/runtime.js 5.map +0 -1
  562. package/docs/api/classes/ErrorBoundary.md +0 -144
  563. package/docs/migration/quick-migration-guide.md +0 -356
  564. package/docs/migration/service-architecture.md +0 -281
  565. package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +0 -680
  566. package/src/hooks/useSecureDataAccess.test.ts +0 -559
  567. package/src/hooks/useSecureDataAccess.ts +0 -666
  568. /package/dist/{DataTable-5FU7IESH.js.map → DataTable-TPTKCX4D.js.map} +0 -0
  569. /package/dist/{UnifiedAuthProvider-RGJTDE2C.js.map → UnifiedAuthProvider-CH6Z342H.js.map} +0 -0
  570. /package/dist/{api-N774RPUA.js.map → api-MVVQZLJI.js.map} +0 -0
  571. /package/docs/migration/{organisation-context-timing-fix.md → V0.3.44_organisation-context-timing-fix.md} +0 -0
  572. /package/docs/migration/{rbac-migration.md → V0.4.0_rbac-migration.md} +0 -0
  573. /package/docs/migration/{person-scoped-profiles-migration-guide.md → V0.5.190_person-scoped-profiles-migration-guide.md} +0 -0
  574. /package/examples/{rbac → RBAC}/CompleteRBACExample.tsx +0 -0
  575. /package/examples/{rbac → RBAC}/EventBasedApp.tsx +0 -0
  576. /package/examples/{rbac → RBAC}/PermissionExample.tsx +0 -0
  577. /package/examples/{rbac → RBAC}/index.ts +0 -0
@@ -0,0 +1,1153 @@
1
+ # Migration Guide: v0.5.190 → v0.6.1
2
+
3
+ **Version:** 0.6.1
4
+ **Previous Version:** 0.5.190
5
+ **Migration Date:** January 2025
6
+ **Breaking Changes:** Yes
7
+
8
+ ## Overview
9
+
10
+ This comprehensive migration guide covers all changes between pace-core v0.5.190 and v0.6.1. This upgrade includes major breaking changes including React 19 upgrade, database schema changes, and new features.
11
+
12
+ **⚠️ CRITICAL**: This migration requires:
13
+ 1. React 19 upgrade (breaking)
14
+ 2. Database migrations (breaking)
15
+ 3. Code updates for table name changes (breaking)
16
+ 4. TypeScript type regeneration
17
+
18
+ **Estimated Migration Time:** 2-4 hours depending on codebase size
19
+
20
+ ---
21
+
22
+ ## Table of Contents
23
+
24
+ 1. [Quick Start Checklist](#quick-start-checklist)
25
+ 2. [Breaking Changes](#breaking-changes)
26
+ - [React 19 Upgrade](#1-react-19-upgrade-breaking)
27
+ - [Database Schema Changes](#2-database-schema-changes-breaking)
28
+ - [Table Naming Standardization](#21-table-naming-standardization)
29
+ - [Person-Scoped Profiles Migration](#22-person-scoped-profiles-migration)
30
+ 3. [New Features](#new-features)
31
+ - [useFormDialog Hook](#useformdialog-hook)
32
+ - [DateTimeField Component](#datetimefield-component)
33
+ - [DatePickerWithTimezone Component](#datepickerwithtimezone-component)
34
+ - [Timezone Utilities](#timezone-utilities)
35
+ - [Location Utilities](#location-utilities)
36
+ 4. [Step-by-Step Migration](#step-by-step-migration)
37
+ 5. [Code Examples](#code-examples)
38
+ 6. [Testing Checklist](#testing-checklist)
39
+ 7. [Troubleshooting](#troubleshooting)
40
+
41
+ ---
42
+
43
+ ## Quick Start Checklist
44
+
45
+ Use this checklist to track your migration progress:
46
+
47
+ ### Pre-Migration
48
+ - [ ] Backup your project and database
49
+ - [ ] Review this entire migration guide
50
+ - [ ] Identify all database queries in your codebase
51
+ - [ ] Identify all React component patterns that may need updates
52
+ - [ ] Test current version in development environment
53
+
54
+ ### Phase 1: Dependencies
55
+ - [ ] Upgrade React to 19.2.3+
56
+ - [ ] Upgrade React DOM to 19.2.3+
57
+ - [ ] Upgrade @types/react to 19.2.7+
58
+ - [ ] Upgrade @types/react-dom to 19.2.3+
59
+ - [ ] Upgrade @vitejs/plugin-react to 5.1.2+
60
+ - [ ] Install babel-plugin-react-compiler (optional but recommended)
61
+ - [ ] Update pace-core to 0.6.1
62
+
63
+ ### Phase 2: Database Migrations
64
+ - [ ] Apply person-scoped profiles migration (`20251205211120_migrate_profiles_to_person_scoped.sql`)
65
+ - [ ] Apply table naming standardization migration (`20251206111258_standardize_table_naming_app_entity.sql`)
66
+ - [ ] Verify all migrations applied successfully
67
+ - [ ] Regenerate TypeScript database types
68
+
69
+ ### Phase 3: Code Updates
70
+ - [ ] Update all table name references (`organisations` → `core_organisations`, etc.)
71
+ - [ ] Remove `organisation_id` filters from profile table queries
72
+ - [ ] Update `pace_contact` queries to use `person_id` instead of `member_id`
73
+ - [ ] Update React component code for React 19 compatibility
74
+ - [ ] Configure React Compiler in vite.config.ts
75
+ - [ ] Fix TypeScript errors
76
+
77
+ ### Phase 4: Testing
78
+ - [ ] Run type checking (`npm run type-check`)
79
+ - [ ] Run build (`npm run build`)
80
+ - [ ] Test all database queries
81
+ - [ ] Test authentication flows
82
+ - [ ] Test profile management
83
+ - [ ] Test file uploads
84
+ - [ ] Test navigation and permissions
85
+ - [ ] Test cross-organisation scenarios
86
+ - [ ] Run full test suite
87
+
88
+ ### Phase 5: Deployment
89
+ - [ ] Deploy to staging environment
90
+ - [ ] Perform full regression testing
91
+ - [ ] Deploy to production
92
+ - [ ] Monitor for errors
93
+
94
+ ---
95
+
96
+ ## Breaking Changes
97
+
98
+ ### 1. React 19 Upgrade (BREAKING)
99
+
100
+ **Impact:** High - All consuming apps must upgrade to React 19
101
+
102
+ #### What Changed
103
+
104
+ - **React**: `^18.3.1` → `^19.2.3`
105
+ - **React DOM**: `^18.3.1` → `^19.2.3`
106
+ - **@types/react**: `^18.3.17` → `^19.2.7`
107
+ - **@types/react-dom**: `^18.3.5` → `^19.2.3`
108
+ - **@vitejs/plugin-react**: `^4.5.1` → `^5.1.2`
109
+ - **React Compiler**: Added `babel-plugin-react-compiler@^1.0.0` (optional but recommended)
110
+
111
+ #### Quick Summary
112
+
113
+ - All consuming apps must upgrade to React 19.2.3+
114
+ - React Compiler should be configured for optimal performance
115
+ - TypeScript types are stricter, especially for `child.props` access
116
+ - Error handling behavior has changed
117
+
118
+ **📖 For complete React 19 migration instructions, see:** [React 19 Migration Guide](./V0.6.0_REACT_19_MIGRATION.md)
119
+
120
+ The dedicated React 19 migration guide includes:
121
+ - Step-by-step dependency updates
122
+ - Vite configuration changes
123
+ - TypeScript type updates
124
+ - React Compiler setup
125
+ - Troubleshooting common issues
126
+ - Testing checklist
127
+
128
+ ---
129
+
130
+ ### 2. Database Schema Changes (BREAKING)
131
+
132
+ **Impact:** High - All database queries must be updated
133
+
134
+ There are two major database schema changes that affect consuming applications:
135
+
136
+ #### 2.1. Table Naming Standardization
137
+
138
+ **Migration:** `20251206111258_standardize_table_naming_app_entity.sql`
139
+ **Date:** 2025-12-06
140
+
141
+ All tables have been renamed to follow the `app_entity` naming convention:
142
+ - **Core infrastructure tables** → `core_*` prefix
143
+ - **Application-specific tables** → `{app}_*` prefix (e.g., `cake_*`, `trac_*`, `medi_*`)
144
+ - **Shared PACE tables** → `core_*` prefix
145
+
146
+ ##### Core Table Renames
147
+
148
+ | Old Name | New Name |
149
+ |----------|----------|
150
+ | `organisations` | `core_organisations` |
151
+ | `event` | `core_events` |
152
+ | `file_references` | `core_file_references` |
153
+ | `pace_person` | `core_person` |
154
+ | `pace_member` | `core_member` |
155
+ | `pace_contact` | `core_contact` |
156
+ | `pace_address` | `core_address` |
157
+ | `pace_phone` | `core_phone` |
158
+ | `pace_consent` | `core_consent` |
159
+ | `pace_identification` | `core_identification` |
160
+ | `pace_qualification` | `core_qualification` |
161
+ | All other `pace_*` tables | `core_*` |
162
+
163
+ ##### View Changes
164
+
165
+ | Old Name | New Name | Notes |
166
+ |----------|----------|-------|
167
+ | `organisation_memberships` | **DROPPED** | Merged into `core_organisation_memberships` |
168
+ | `user_organisation_memberships` | **DROPPED** | Merged into `core_organisation_memberships` |
169
+ | - | `core_organisation_memberships` | **NEW** - Unified membership view |
170
+
171
+ ##### Code Updates Required
172
+
173
+ **Before:**
174
+ ```typescript
175
+ // ❌ This will fail - table name changed
176
+ const { data } = await supabase
177
+ .from('organisations')
178
+ .select('*');
179
+ ```
180
+
181
+ **After:**
182
+ ```typescript
183
+ // ✅ Use new table name
184
+ const { data } = await supabase
185
+ .from('core_organisations')
186
+ .select('*');
187
+ ```
188
+
189
+ **Before:**
190
+ ```typescript
191
+ // ❌ This will fail - view dropped
192
+ const { data } = await supabase
193
+ .from('organisation_memberships')
194
+ .select('*')
195
+ .eq('organisation_id', orgId);
196
+ ```
197
+
198
+ **After:**
199
+ ```typescript
200
+ // ✅ Use new unified view
201
+ const { data } = await supabase
202
+ .from('core_organisation_memberships')
203
+ .select('*')
204
+ .eq('organisation_id', orgId);
205
+ ```
206
+
207
+ **Before:**
208
+ ```typescript
209
+ // ❌ This will fail - table names changed
210
+ const { data } = await supabase
211
+ .from('pace_person')
212
+ .select('*, pace_member(*), organisations(*)')
213
+ .eq('id', personId);
214
+ ```
215
+
216
+ **After:**
217
+ ```typescript
218
+ // ✅ Use new table names
219
+ const { data } = await supabase
220
+ .from('core_person')
221
+ .select('*, core_member(*), core_organisations(*)')
222
+ .eq('id', personId);
223
+ ```
224
+
225
+ **Before:**
226
+ ```typescript
227
+ // ❌ This will fail - table name changed
228
+ const { data } = await supabase
229
+ .from('file_references')
230
+ .select('*')
231
+ .eq('table_name', 'pace_person')
232
+ .eq('record_id', personId);
233
+ ```
234
+
235
+ **After:**
236
+ ```typescript
237
+ // ✅ Use new table names
238
+ const { data } = await supabase
239
+ .from('core_file_references')
240
+ .select('*')
241
+ .eq('table_name', 'core_person') // Also update table_name values
242
+ .eq('record_id', personId);
243
+ ```
244
+
245
+ **Important**: The `table_name` column in `core_file_references` has been updated to use new table names. If you're querying by `table_name`, ensure you use the new names:
246
+ - `'pace_person'` → `'core_person'`
247
+ - `'event'` → `'core_events'`
248
+ - `'pace_member'` → `'core_member'`
249
+ - `'pace_contact'` → `'core_contact'`
250
+ - etc.
251
+
252
+ ##### Search and Replace Strategy
253
+
254
+ Use your IDE's search and replace to update table names:
255
+
256
+ 1. **Search for old table names:**
257
+ - `'organisations'` → `'core_organisations'`
258
+ - `'event'` → `'core_events'`
259
+ - `'pace_person'` → `'core_person'`
260
+ - `'pace_member'` → `'core_member'`
261
+ - `'pace_contact'` → `'core_contact'`
262
+ - etc.
263
+
264
+ 2. **Update view references:**
265
+ - `'organisation_memberships'` → `'core_organisation_memberships'`
266
+ - `'user_organisation_memberships'` → `'core_organisation_memberships'`
267
+
268
+ 3. **Update file reference table_name values:**
269
+ - `'pace_person'` → `'core_person'`
270
+ - `'event'` → `'core_events'`
271
+ - etc.
272
+
273
+ #### 2.2. Person-Scoped Profiles Migration
274
+
275
+ **Migration:** `20251205211120_migrate_profiles_to_person_scoped.sql` + related migrations
276
+ **Date:** 2025-12-05
277
+
278
+ Profiles have been migrated from **organisation-scoped** to **person-scoped**:
279
+ - **One membership profile** (`core_member`) per person (regardless of organisation)
280
+ - **One medical profile** (`medi_profile`) per person
281
+ - **Multiple contact profiles** (`core_contact`) per person
282
+
283
+ ##### Key Changes
284
+
285
+ 1. **Removed `organisation_id`** from:
286
+ - `core_member` (was `pace_member`)
287
+ - `medi_profile`
288
+ - `core_contact` (was `pace_contact`)
289
+ - Related tables: `medi_condition`, `medi_diet`, `medi_action_plan`, `core_consent`, `core_identification`, `core_qualification`
290
+
291
+ 2. **Removed `member_id`** from `core_contact` (now uses `person_id` directly)
292
+
293
+ 3. **Added unique constraint** on `core_member.person_id` (one membership per person)
294
+
295
+ ##### Code Updates Required
296
+
297
+ **Before:**
298
+ ```typescript
299
+ // ❌ This will fail - organisation_id column no longer exists
300
+ const { data } = await supabase
301
+ .from('pace_member')
302
+ .select('*')
303
+ .eq('person_id', personId)
304
+ .eq('organisation_id', orgId);
305
+ ```
306
+
307
+ **After:**
308
+ ```typescript
309
+ // ✅ No organisation_id needed - one profile per person
310
+ const { data } = await supabase
311
+ .from('core_member')
312
+ .select('*')
313
+ .eq('person_id', personId);
314
+ ```
315
+
316
+ **Before:**
317
+ ```typescript
318
+ // ❌ This will fail - member_id column no longer exists
319
+ const { data } = await supabase
320
+ .from('pace_contact')
321
+ .select('*')
322
+ .eq('member_id', memberId);
323
+ ```
324
+
325
+ **After:**
326
+ ```typescript
327
+ // ✅ Use person_id instead
328
+ const { data } = await supabase
329
+ .from('core_contact')
330
+ .select('*')
331
+ .eq('person_id', personId);
332
+ ```
333
+
334
+ **Before:**
335
+ ```typescript
336
+ // ❌ This will fail - organisation_id required
337
+ await supabase
338
+ .from('pace_member')
339
+ .insert({
340
+ person_id: personId,
341
+ organisation_id: orgId, // ❌ Column doesn't exist
342
+ membership_number: '12345'
343
+ });
344
+ ```
345
+
346
+ **After:**
347
+ ```typescript
348
+ // ✅ No organisation_id needed
349
+ await supabase
350
+ .from('core_member')
351
+ .insert({
352
+ person_id: personId,
353
+ membership_number: '12345'
354
+ });
355
+ ```
356
+
357
+ ##### Getting Organisation Members
358
+
359
+ **Before:**
360
+ ```typescript
361
+ // ❌ This pattern no longer works
362
+ const { data } = await supabase
363
+ .from('pace_member')
364
+ .select('*')
365
+ .eq('organisation_id', orgId);
366
+ ```
367
+
368
+ **After:**
369
+ ```typescript
370
+ // ✅ Get members via organisation roles
371
+ const { data: orgMembers } = await supabase
372
+ .from('rbac_organisation_roles')
373
+ .select(`
374
+ organisation_id,
375
+ user_id,
376
+ core_person!inner(
377
+ id,
378
+ core_member(*)
379
+ )
380
+ `)
381
+ .eq('organisation_id', orgId)
382
+ .eq('status', 'active');
383
+ ```
384
+
385
+ **For detailed person-scoped profiles migration instructions, see:** [Person-Scoped Profiles Migration Guide](./V0.5.190_person-scoped-profiles-migration-guide.md)
386
+
387
+ **For detailed database changes, see:** [Database Changes December 2025](./database-changes-december-2025.md)
388
+
389
+ ---
390
+
391
+ ## New Features
392
+
393
+ ### useFormDialog Hook
394
+
395
+ **New in:** Unreleased (0.6.1)
396
+
397
+ Generic React hook for managing form dialog state (open/close, form data, reset behavior). Supports both controlled and uncontrolled usage patterns with type-safe form data management.
398
+
399
+ **Usage:**
400
+
401
+ ```tsx
402
+ import { useFormDialog } from '@jmruthers/pace-core';
403
+
404
+ function MyComponent() {
405
+ const formDialog = useFormDialog<FormData>({
406
+ defaultValues: { name: '', email: '' }
407
+ });
408
+
409
+ return (
410
+ <>
411
+ <Button onClick={() => formDialog.open()}>Open Form</Button>
412
+ <Dialog open={formDialog.isOpen} onOpenChange={formDialog.setOpen}>
413
+ <DialogContent>
414
+ <Form form={form} onSubmit={formDialog.handleSubmit}>
415
+ {/* Form fields */}
416
+ </Form>
417
+ </DialogContent>
418
+ </Dialog>
419
+ </>
420
+ );
421
+ }
422
+ ```
423
+
424
+ ### DateTimeField Component
425
+
426
+ **New in:** Unreleased (0.6.1)
427
+
428
+ Form input component for datetime values with automatic UTC ↔ timezone conversion.
429
+
430
+ **Features:**
431
+ - Supports both ISO string and Date object values
432
+ - Automatic timezone conversion
433
+ - Prevents unwanted conversions during user editing
434
+ - Shows timezone information when not UTC
435
+ - Accessible form field with proper labels
436
+
437
+ **Usage:**
438
+
439
+ ```tsx
440
+ import { DateTimeField, Form, useZodForm } from '@jmruthers/pace-core';
441
+
442
+ function MyForm() {
443
+ const form = useZodForm({
444
+ schema: z.object({
445
+ eventDate: z.string().datetime()
446
+ })
447
+ });
448
+
449
+ return (
450
+ <Form form={form}>
451
+ <FormField
452
+ control={form.control}
453
+ name="eventDate"
454
+ render={({ field }) => (
455
+ <DateTimeField
456
+ label="Event Date & Time"
457
+ value={field.value}
458
+ onChange={field.onChange}
459
+ timezone="America/New_York"
460
+ />
461
+ )}
462
+ />
463
+ </Form>
464
+ );
465
+ }
466
+ ```
467
+
468
+ ### DatePickerWithTimezone Component
469
+
470
+ **New in:** Unreleased (0.6.1)
471
+
472
+ Date picker component with timezone information display.
473
+
474
+ **Features:**
475
+ - Calendar date selection with timezone context
476
+ - Shows "Local" when timezone matches user timezone
477
+ - Optional "Done" button
478
+ - Accessible date selection
479
+
480
+ **Usage:**
481
+
482
+ ```tsx
483
+ import { DatePickerWithTimezone } from '@jmruthers/pace-core';
484
+
485
+ function MyComponent() {
486
+ const [date, setDate] = useState<Date | undefined>();
487
+
488
+ return (
489
+ <DatePickerWithTimezone
490
+ date={date}
491
+ onDateChange={setDate}
492
+ timezone="America/New_York"
493
+ showDoneButton
494
+ />
495
+ );
496
+ }
497
+ ```
498
+
499
+ ### Timezone Utilities
500
+
501
+ **New in:** Unreleased (0.6.1)
502
+
503
+ Comprehensive timezone conversion and formatting utilities.
504
+
505
+ **Available Utilities:**
506
+
507
+ ```tsx
508
+ import {
509
+ formatInTimeZone,
510
+ getTimezoneAbbreviation,
511
+ formatTimeInTimeZone,
512
+ getUserTimeZone,
513
+ toZonedTime,
514
+ fromZonedTime,
515
+ roundToNearestMinutes,
516
+ getTimeZoneDifference,
517
+ formatDateTimeForDisplay,
518
+ formatDateOnlyForDisplay,
519
+ formatDateTimeForTable,
520
+ formatDateTimeForMap
521
+ } from '@jmruthers/pace-core/utils/timezone';
522
+ ```
523
+
524
+ **Usage Examples:**
525
+
526
+ ```tsx
527
+ import { formatInTimeZone, getUserTimeZone, toZonedTime } from '@jmruthers/pace-core/utils/timezone';
528
+
529
+ // Format date in specific timezone
530
+ const formatted = formatInTimeZone(
531
+ new Date(),
532
+ 'America/New_York',
533
+ 'MMM dd, yyyy HH:mm'
534
+ );
535
+
536
+ // Get user's timezone
537
+ const userTz = getUserTimeZone(); // e.g., "America/New_York"
538
+
539
+ // Convert UTC to timezone
540
+ const localTime = toZonedTime(new Date(), 'America/New_York');
541
+
542
+ // Format for display
543
+ const display = formatDateTimeForDisplay(
544
+ new Date().toISOString(),
545
+ 'America/New_York'
546
+ );
547
+ ```
548
+
549
+ ### Location Utilities
550
+
551
+ **New in:** Unreleased (0.6.1)
552
+
553
+ Geographic coordinate handling utilities.
554
+
555
+ **Available Utilities:**
556
+
557
+ ```tsx
558
+ import {
559
+ formatCoordinates,
560
+ hasValidCoordinates,
561
+ areCoordinatesEqual,
562
+ getGoogleMapsUrl
563
+ } from '@jmruthers/pace-core/utils/location';
564
+ ```
565
+
566
+ **Usage Examples:**
567
+
568
+ ```tsx
569
+ import { formatCoordinates, getGoogleMapsUrl } from '@jmruthers/pace-core/utils/location';
570
+
571
+ // Format coordinates
572
+ const formatted = formatCoordinates({ lat: 40.7128, lng: -74.0060 });
573
+ // Returns: "40.712800, -74.006000"
574
+
575
+ // Generate Google Maps URL
576
+ const mapsUrl = getGoogleMapsUrl({ lat: 40.7128, lng: -74.0060 });
577
+ // Returns: "https://www.google.com/maps/search/?api=1&query=40.712800,-74.006000"
578
+ ```
579
+
580
+ ---
581
+
582
+ ## Step-by-Step Migration
583
+
584
+ ### Step 1: Backup Everything
585
+
586
+ ```bash
587
+ # Backup your project
588
+ git commit -am "Pre-migration backup"
589
+
590
+ # Backup your database (if using Supabase CLI)
591
+ supabase db dump > backup.sql
592
+ ```
593
+
594
+ ### Step 2: Update Dependencies
595
+
596
+ **📖 For React 19 dependency updates, see [React 19 Migration Guide](./V0.6.0_REACT_19_MIGRATION.md#step-1-update-react-dependencies).**
597
+
598
+ ```bash
599
+ # Update React and related dependencies (see React 19 guide for details)
600
+ npm install react@^19.2.3 react-dom@^19.2.3
601
+ npm install -D @types/react@^19.2.7 @types/react-dom@^19.2.3
602
+ npm install -D @vitejs/plugin-react@^5.1.2
603
+ npm install -D babel-plugin-react-compiler@latest
604
+
605
+ # Update pace-core
606
+ npm install @jmruthers/pace-core@0.6.1
607
+ ```
608
+
609
+ ### Step 3: Apply Database Migrations
610
+
611
+ Apply the following migrations in order:
612
+
613
+ 1. **Person-Scoped Profiles Migration:**
614
+ ```bash
615
+ # Apply migration
616
+ supabase migration up 20251205211120_migrate_profiles_to_person_scoped
617
+ ```
618
+
619
+ 2. **Table Naming Standardization:**
620
+ ```bash
621
+ # Apply migration
622
+ supabase migration up 20251206111258_standardize_table_naming_app_entity
623
+ ```
624
+
625
+ **Note:** If you're using Supabase hosted, apply these migrations through the Supabase dashboard or CLI.
626
+
627
+ ### Step 4: Regenerate TypeScript Types
628
+
629
+ ```bash
630
+ # Regenerate database types
631
+ npx supabase gen types typescript --project-id <your-project-id> > src/types/database.generated.ts
632
+ ```
633
+
634
+ ### Step 5: Update Vite Configuration for React 19
635
+
636
+ **📖 See [React 19 Migration Guide](./V0.6.0_REACT_19_MIGRATION.md#step-4-configure-react-compiler-in-vite) for detailed Vite configuration instructions.**
637
+
638
+ Quick summary: Update your `vite.config.ts` to include React Compiler configuration. The React 19 migration guide includes complete setup instructions.
639
+
640
+ ### Step 6: Update Code
641
+
642
+ #### 6.1. Update Table Names
643
+
644
+ Search and replace all table name references:
645
+
646
+ ```bash
647
+ # Use your IDE's search and replace or:
648
+ # Find: 'organisations'
649
+ # Replace: 'core_organisations'
650
+
651
+ # Find: 'event'
652
+ # Replace: 'core_events'
653
+
654
+ # Find: 'pace_person'
655
+ # Replace: 'core_person'
656
+
657
+ # Find: 'pace_member'
658
+ # Replace: 'core_member'
659
+
660
+ # Find: 'pace_contact'
661
+ # Replace: 'core_contact'
662
+
663
+ # Find: 'organisation_memberships'
664
+ # Replace: 'core_organisation_memberships'
665
+
666
+ # Find: 'user_organisation_memberships'
667
+ # Replace: 'core_organisation_memberships'
668
+ ```
669
+
670
+ #### 6.2. Remove Organisation ID Filters
671
+
672
+ Search for and remove `organisation_id` filters from profile table queries:
673
+
674
+ ```typescript
675
+ // Find patterns like:
676
+ .eq('organisation_id', orgId)
677
+
678
+ // In queries to:
679
+ // - core_member
680
+ // - medi_profile
681
+ // - core_contact
682
+ // - core_consent
683
+ // - core_identification
684
+ // - core_qualification
685
+ ```
686
+
687
+ #### 6.3. Update Contact Queries
688
+
689
+ Update `pace_contact` queries to use `person_id` instead of `member_id`:
690
+
691
+ ```typescript
692
+ // Find:
693
+ .eq('member_id', memberId)
694
+
695
+ // Replace with:
696
+ .eq('person_id', personId)
697
+ ```
698
+
699
+ #### 6.4. Update React Component Code for React 19
700
+
701
+ **📖 See [React 19 Migration Guide](./V0.6.0_REACT_19_MIGRATION.md#step-5-update-typescript-types) for detailed React 19 TypeScript updates.**
702
+
703
+ If you have components that access `child.props`, you'll need to add type assertions. The React 19 migration guide includes complete examples and patterns.
704
+
705
+ ### Step 7: Fix TypeScript Errors
706
+
707
+ ```bash
708
+ # Run type checking
709
+ npm run type-check
710
+
711
+ # Fix all TypeScript errors
712
+ # Common fixes:
713
+ # - Update table name types
714
+ # - Add type assertions for child.props
715
+ # - Update import paths if needed
716
+ ```
717
+
718
+ ### Step 8: Test Your Application
719
+
720
+ ```bash
721
+ # Run build
722
+ npm run build
723
+
724
+ # Run tests
725
+ npm run test
726
+
727
+ # Start dev server
728
+ npm run dev
729
+ ```
730
+
731
+ ---
732
+
733
+ ## Code Examples
734
+
735
+ ### Example 1: Organisation Query
736
+
737
+ **Before:**
738
+ ```typescript
739
+ const { data: organisations } = await supabase
740
+ .from('organisations')
741
+ .select('*')
742
+ .eq('is_active', true);
743
+ ```
744
+
745
+ **After:**
746
+ ```typescript
747
+ const { data: organisations } = await supabase
748
+ .from('core_organisations')
749
+ .select('*')
750
+ .eq('is_active', true);
751
+ ```
752
+
753
+ ### Example 2: Event Query with Joins
754
+
755
+ **Before:**
756
+ ```typescript
757
+ const { data: events } = await supabase
758
+ .from('event')
759
+ .select(`
760
+ *,
761
+ organisations(*)
762
+ `)
763
+ .eq('organisation_id', orgId);
764
+ ```
765
+
766
+ **After:**
767
+ ```typescript
768
+ const { data: events } = await supabase
769
+ .from('core_events')
770
+ .select(`
771
+ *,
772
+ core_organisations(*)
773
+ `)
774
+ .eq('organisation_id', orgId);
775
+ ```
776
+
777
+ ### Example 3: Person with Member Profile
778
+
779
+ **Before:**
780
+ ```typescript
781
+ const { data: person } = await supabase
782
+ .from('pace_person')
783
+ .select(`
784
+ *,
785
+ pace_member(*)
786
+ `)
787
+ .eq('id', personId)
788
+ .eq('organisation_id', orgId) // ❌ organisation_id no longer exists
789
+ .single();
790
+ ```
791
+
792
+ **After:**
793
+ ```typescript
794
+ const { data: person } = await supabase
795
+ .from('core_person')
796
+ .select(`
797
+ *,
798
+ core_member(*)
799
+ `)
800
+ .eq('id', personId)
801
+ .single(); // ✅ No organisation_id needed
802
+ ```
803
+
804
+ ### Example 4: Organisation Memberships
805
+
806
+ **Before:**
807
+ ```typescript
808
+ const { data: memberships } = await supabase
809
+ .from('organisation_memberships')
810
+ .select('*')
811
+ .eq('organisation_id', orgId)
812
+ .eq('user_id', userId);
813
+ ```
814
+
815
+ **After:**
816
+ ```typescript
817
+ const { data: memberships } = await supabase
818
+ .from('core_organisation_memberships')
819
+ .select('*')
820
+ .eq('organisation_id', orgId)
821
+ .eq('user_id', userId);
822
+ ```
823
+
824
+ ### Example 5: File References
825
+
826
+ **Before:**
827
+ ```typescript
828
+ const { data: files } = await supabase
829
+ .from('file_references')
830
+ .select('*')
831
+ .eq('table_name', 'pace_person')
832
+ .eq('record_id', personId);
833
+ ```
834
+
835
+ **After:**
836
+ ```typescript
837
+ const { data: files } = await supabase
838
+ .from('core_file_references')
839
+ .select('*')
840
+ .eq('table_name', 'core_person') // Updated table_name value
841
+ .eq('record_id', personId);
842
+ ```
843
+
844
+ ### Example 6: Getting Member Profile
845
+
846
+ **Before:**
847
+ ```typescript
848
+ async function getMemberProfile(personId: string, orgId: string) {
849
+ const { data } = await supabase
850
+ .from('pace_member')
851
+ .select('*')
852
+ .eq('person_id', personId)
853
+ .eq('organisation_id', orgId) // ❌
854
+ .single();
855
+ return data;
856
+ }
857
+ ```
858
+
859
+ **After:**
860
+ ```typescript
861
+ async function getMemberProfile(personId: string) {
862
+ // ✅ No organisation_id needed - one profile per person
863
+ const { data } = await supabase
864
+ .from('core_member')
865
+ .select('*')
866
+ .eq('person_id', personId)
867
+ .single();
868
+ return data;
869
+ }
870
+ ```
871
+
872
+ ### Example 7: Getting Contacts
873
+
874
+ **Before:**
875
+ ```typescript
876
+ async function getContacts(memberId: string) {
877
+ const { data } = await supabase
878
+ .from('pace_contact')
879
+ .select('*')
880
+ .eq('member_id', memberId) // ❌
881
+ .eq('organisation_id', orgId); // ❌
882
+ return data;
883
+ }
884
+ ```
885
+
886
+ **After:**
887
+ ```typescript
888
+ async function getContacts(personId: string) {
889
+ // ✅ Use person_id directly
890
+ const { data } = await supabase
891
+ .from('core_contact')
892
+ .select('*')
893
+ .eq('person_id', personId);
894
+ return data;
895
+ }
896
+ ```
897
+
898
+ ### Example 8: React Component with child.props
899
+
900
+ **Before:**
901
+ ```tsx
902
+ React.Children.map(children, (child) => {
903
+ if (React.isValidElement(child)) {
904
+ const variant = child.props.variant; // ❌ Type error in React 19
905
+ }
906
+ });
907
+ ```
908
+
909
+ **After:**
910
+ ```tsx
911
+ React.Children.map(children, (child) => {
912
+ if (React.isValidElement(child)) {
913
+ const props = child.props as { variant?: string; [key: string]: unknown };
914
+ const variant = props.variant; // ✅ Type-safe
915
+ }
916
+ });
917
+ ```
918
+
919
+ ---
920
+
921
+ ## Testing Checklist
922
+
923
+ ### Database Queries
924
+ - [ ] Test organisation queries with new table names
925
+ - [ ] Test event queries with new table names
926
+ - [ ] Test person/profile queries (person-scoped)
927
+ - [ ] Test file reference queries
928
+ - [ ] Test organisation membership queries
929
+ - [ ] Test cross-organisation scenarios
930
+
931
+ ### React Components
932
+ - [ ] All components render correctly
933
+ - [ ] No TypeScript errors
934
+ - [ ] Error boundaries work correctly
935
+ - [ ] React Compiler is working (check DevTools)
936
+
937
+ ### Authentication
938
+ - [ ] Login works
939
+ - [ ] Logout works
940
+ - [ ] Session restoration works
941
+ - [ ] Organisation switching works
942
+
943
+ ### Permissions
944
+ - [ ] RBAC permission checks work
945
+ - [ ] Navigation filtering works
946
+ - [ ] Page permission guards work
947
+
948
+ ### Forms
949
+ - [ ] Form validation works
950
+ - [ ] Form submission works
951
+ - [ ] New DateTimeField component works (if using)
952
+
953
+ ### Data Tables
954
+ - [ ] Data tables render correctly
955
+ - [ ] Sorting works
956
+ - [ ] Filtering works
957
+ - [ ] Pagination works
958
+
959
+ ### File Uploads
960
+ - [ ] File uploads work
961
+ - [ ] File references use new table names
962
+ - [ ] File display works
963
+
964
+ ### Performance
965
+ - [ ] No performance regressions
966
+ - [ ] React Compiler optimizations working
967
+ - [ ] No memory leaks
968
+
969
+ ---
970
+
971
+ ## Troubleshooting
972
+
973
+ ### Issue 1: "relation does not exist"
974
+
975
+ **Error:**
976
+ ```
977
+ relation "organisations" does not exist
978
+ ```
979
+
980
+ **Solution:**
981
+ Update table name to `core_organisations`:
982
+ ```typescript
983
+ // ❌ Old
984
+ .from('organisations')
985
+
986
+ // ✅ New
987
+ .from('core_organisations')
988
+ ```
989
+
990
+ ### Issue 2: "column does not exist"
991
+
992
+ **Error:**
993
+ ```
994
+ column "organisation_id" does not exist in table "core_member"
995
+ ```
996
+
997
+ **Solution:**
998
+ Remove `organisation_id` filters from profile table queries:
999
+ ```typescript
1000
+ // ❌ Old
1001
+ .from('core_member')
1002
+ .eq('organisation_id', orgId) // ❌ Column doesn't exist
1003
+
1004
+ // ✅ New
1005
+ .from('core_member')
1006
+ .eq('person_id', personId) // ✅ Person-scoped
1007
+ ```
1008
+
1009
+ ### Issue 3: View not found
1010
+
1011
+ **Error:**
1012
+ ```
1013
+ relation "organisation_memberships" does not exist
1014
+ ```
1015
+
1016
+ **Solution:**
1017
+ Use the new unified view:
1018
+ ```typescript
1019
+ // ❌ Old
1020
+ .from('organisation_memberships')
1021
+
1022
+ // ✅ New
1023
+ .from('core_organisation_memberships')
1024
+ ```
1025
+
1026
+ ### Issue 4: File reference table_name mismatch
1027
+
1028
+ **Error:**
1029
+ ```
1030
+ No file references found (table_name mismatch)
1031
+ ```
1032
+
1033
+ **Solution:**
1034
+ Update `table_name` values to use new table names:
1035
+ ```typescript
1036
+ // ❌ Old
1037
+ .eq('table_name', 'pace_person')
1038
+
1039
+ // ✅ New
1040
+ .eq('table_name', 'core_person')
1041
+ ```
1042
+
1043
+ ### Issue 5: TypeScript errors with child.props
1044
+
1045
+ **Error:**
1046
+ ```
1047
+ Property 'variant' does not exist on type 'unknown'
1048
+ ```
1049
+
1050
+ **Solution:**
1051
+ Add type assertion:
1052
+ ```typescript
1053
+ const props = child.props as { variant?: string; [key: string]: unknown };
1054
+ const variant = props.variant;
1055
+ ```
1056
+
1057
+ ### Issue 6: React Compiler not working
1058
+
1059
+ **Symptoms:**
1060
+ - No "Memo ✨" badges in React DevTools
1061
+ - Performance not improved
1062
+
1063
+ **Solution:**
1064
+ 1. Verify `babel-plugin-react-compiler` is installed
1065
+ 2. Check `vite.config.ts` has the compiler configured
1066
+ 3. Restart your dev server
1067
+ 4. Check React DevTools for "Memo ✨" badges
1068
+
1069
+ ### Issue 7: Test failures after React 19 upgrade
1070
+
1071
+ **Solution:**
1072
+ 1. Update `@testing-library/react` to latest version
1073
+ 2. Check for StrictMode-related test issues
1074
+ 3. Verify error boundaries still work correctly
1075
+ 4. Update test mocks if needed
1076
+
1077
+ ---
1078
+
1079
+ ## Additional Resources
1080
+
1081
+ ### Documentation
1082
+ - [React 19 Migration Guide](./V0.6.0_REACT_19_MIGRATION.md)
1083
+ - [Database Changes December 2025](./database-changes-december-2025.md)
1084
+ - [Person-Scoped Profiles Migration Guide](./V0.5.190_person-scoped-profiles-migration-guide.md)
1085
+ - [RBAC Migration Guide](./V0.4.0_rbac-migration.md)
1086
+
1087
+ ### External Resources
1088
+ - [React 19 Upgrade Guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide)
1089
+ - [React Compiler Documentation](https://react.dev/learn/react-compiler)
1090
+
1091
+ ### Support
1092
+
1093
+ If you encounter issues migrating:
1094
+
1095
+ 1. **Check Migration Status**: Verify all migrations are applied
1096
+ 2. **Verify Types**: Regenerate TypeScript types from current schema
1097
+ 3. **Review RLS**: Ensure RLS policies are correctly applied
1098
+ 4. **Check Logs**: Review Supabase logs for errors
1099
+ 5. **Search Codebase**: Use search to find all references to old table names
1100
+
1101
+ ---
1102
+
1103
+ ## Summary
1104
+
1105
+ **Key Takeaways:**
1106
+
1107
+ 1. **React 19 Upgrade:**
1108
+ - Must upgrade to React 19.2.3+
1109
+ - Configure React Compiler for optimal performance
1110
+ - Update TypeScript types for `child.props`
1111
+
1112
+ 2. **Table Naming:**
1113
+ - All core tables → `core_*` prefix
1114
+ - All PACE tables → `core_*` prefix
1115
+ - Application tables → `{app}_*` prefix
1116
+ - Update all queries to use new table names
1117
+
1118
+ 3. **Views:**
1119
+ - `organisation_memberships` and `user_organisation_memberships` → `core_organisation_memberships`
1120
+
1121
+ 4. **Profiles:**
1122
+ - Person-scoped (not organisation-scoped)
1123
+ - Remove `organisation_id` from profile queries
1124
+ - Use `person_id` instead of `member_id` for contacts
1125
+
1126
+ 5. **File References:**
1127
+ - Update `table_name` values to use new table names
1128
+
1129
+ 6. **Types:**
1130
+ - Regenerate TypeScript types after migrations
1131
+
1132
+ 7. **New Features:**
1133
+ - `useFormDialog` hook available
1134
+ - `DateTimeField` and `DatePickerWithTimezone` components available
1135
+ - Timezone and location utilities available
1136
+
1137
+ **Migration Order:**
1138
+ 1. Update dependencies (React 19, pace-core 0.6.1)
1139
+ 2. Apply person-scoped profiles migrations
1140
+ 3. Apply table naming standardization migrations
1141
+ 4. Regenerate TypeScript types
1142
+ 5. Update code to use new table names
1143
+ 6. Remove `organisation_id` filters from profile queries
1144
+ 7. Update React component code for React 19
1145
+ 8. Configure React Compiler
1146
+ 9. Test thoroughly
1147
+
1148
+ ---
1149
+
1150
+ **Last Updated:** January 2025
1151
+ **Version:** 0.6.1
1152
+ **Previous Version:** 0.5.190
1153
+