@jmruthers/pace-core 0.5.54 → 0.5.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +0 -4
  2. package/dist/{DataTable-7FMFXA7A.js → DataTable-DJQTKX33.js} +11 -11
  3. package/dist/{PublicLoadingSpinner-Bq_-BeK-.d.ts → PublicLoadingSpinner-SL8WaQN7.d.ts} +2 -21
  4. package/dist/{api-H5A3H4IR.js → api-LUNF5O6M.js} +3 -3
  5. package/dist/{appConfig-BVGyuvI7.d.ts → appConfig-DjpeG6P-.d.ts} +9 -1
  6. package/dist/{appNameResolver-7GHF5ED2.js → appNameResolver-UURKN7NF.js} +2 -2
  7. package/dist/{audit-BUW3LMJB.js → audit-6TOCAMKO.js} +2 -2
  8. package/dist/{chunk-NRK4AIHQ.js → chunk-2DFCT6D3.js} +3 -3
  9. package/dist/{chunk-GIO7BFE7.js → chunk-3JKVVLD3.js} +66 -169
  10. package/dist/{chunk-GIO7BFE7.js.map → chunk-3JKVVLD3.js.map} +1 -1
  11. package/dist/{chunk-MZBUOP4P.js → chunk-5BSLGBYI.js} +4 -3
  12. package/dist/chunk-5BSLGBYI.js.map +1 -0
  13. package/dist/{chunk-I5Z3QH5X.js → chunk-66C4BSAY.js} +2 -2
  14. package/dist/{chunk-I5Z3QH5X.js.map → chunk-66C4BSAY.js.map} +1 -1
  15. package/dist/{chunk-EL2O4IUX.js → chunk-ASXSJGPW.js} +20 -24
  16. package/dist/{chunk-EL2O4IUX.js.map → chunk-ASXSJGPW.js.map} +1 -1
  17. package/dist/{chunk-7BNPOCLL.js → chunk-B2WTCLCV.js} +6 -2
  18. package/dist/chunk-B2WTCLCV.js.map +1 -0
  19. package/dist/{chunk-WJARTBCT.js → chunk-D7ARGIA3.js} +16 -7
  20. package/dist/chunk-D7ARGIA3.js.map +1 -0
  21. package/dist/{chunk-MYP2EGHX.js → chunk-GIDCWCHF.js} +21 -14
  22. package/dist/chunk-GIDCWCHF.js.map +1 -0
  23. package/dist/{chunk-MSFACPQQ.js → chunk-HYNGIE5T.js} +11 -11
  24. package/dist/{chunk-MSFACPQQ.js.map → chunk-HYNGIE5T.js.map} +1 -1
  25. package/dist/{chunk-TRIZ7IB7.js → chunk-I5GID3EX.js} +148 -288
  26. package/dist/chunk-I5GID3EX.js.map +1 -0
  27. package/dist/{chunk-GWSBHC4J.js → chunk-KLPVOPRI.js} +261 -38
  28. package/dist/chunk-KLPVOPRI.js.map +1 -0
  29. package/dist/{chunk-BC3S53OZ.js → chunk-N6XMGSGD.js} +30 -14
  30. package/dist/chunk-N6XMGSGD.js.map +1 -0
  31. package/dist/{chunk-6MTY77WU.js → chunk-QB4GXDUM.js} +3 -3
  32. package/dist/{chunk-YDJW5XTN.js → chunk-STT7INZR.js} +25 -1
  33. package/dist/chunk-STT7INZR.js.map +1 -0
  34. package/dist/{chunk-NYUJ4FJR.js → chunk-UETTVYKU.js} +7 -7
  35. package/dist/chunk-UETTVYKU.js.map +1 -0
  36. package/dist/{chunk-22KLBHPS.js → chunk-W66AZIOH.js} +2 -2
  37. package/dist/chunk-W66AZIOH.js.map +1 -0
  38. package/dist/{chunk-NZ655MWE.js → chunk-YEHO6FDW.js} +5 -4
  39. package/dist/chunk-YEHO6FDW.js.map +1 -0
  40. package/dist/{chunk-SS3E6QLB.js → chunk-YNUBMSMV.js} +2 -2
  41. package/dist/chunk-YNUBMSMV.js.map +1 -0
  42. package/dist/{chunk-74C6SNEC.js → chunk-ZPK5656W.js} +3 -3
  43. package/dist/{chunk-74C6SNEC.js.map → chunk-ZPK5656W.js.map} +1 -1
  44. package/dist/components.d.ts +22 -899
  45. package/dist/components.js +436 -3118
  46. package/dist/components.js.map +1 -1
  47. package/dist/file-reference-9xUOnwyt.d.ts +70 -0
  48. package/dist/hooks.d.ts +2 -2
  49. package/dist/hooks.js +10 -10
  50. package/dist/hooks.js.map +1 -1
  51. package/dist/index.d.ts +49 -9
  52. package/dist/index.js +190 -25
  53. package/dist/index.js.map +1 -1
  54. package/dist/{organisation-CO3Sh3_D.d.ts → organisation-t-vvQC3g.d.ts} +1 -8
  55. package/dist/providers.d.ts +2 -2
  56. package/dist/providers.js +5 -5
  57. package/dist/rbac/index.d.ts +65 -46
  58. package/dist/rbac/index.js +10 -12
  59. package/dist/styles/core.css +0 -125
  60. package/dist/types.d.ts +2 -1
  61. package/dist/types.js +3 -1
  62. package/dist/types.js.map +1 -1
  63. package/dist/{usePublicRouteParams-B2OcAsur.d.ts → usePublicRouteParams-CdoFxnJK.d.ts} +1 -1
  64. package/dist/utils.d.ts +3 -4
  65. package/dist/utils.js +44 -13
  66. package/dist/utils.js.map +1 -1
  67. package/docs/FILE_REFERENCE_SYSTEM.md +440 -0
  68. package/docs/INDEX.md +7 -5
  69. package/docs/README.md +0 -1
  70. package/docs/api/README.md +0 -4
  71. package/docs/api/classes/ErrorBoundary.md +1 -1
  72. package/docs/api/classes/InvalidScopeError.md +1 -1
  73. package/docs/api/classes/MissingUserContextError.md +1 -1
  74. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  75. package/docs/api/classes/PermissionDeniedError.md +2 -2
  76. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  77. package/docs/api/classes/RBACAuditManager.md +12 -12
  78. package/docs/api/classes/RBACCache.md +1 -1
  79. package/docs/api/classes/RBACEngine.md +6 -6
  80. package/docs/api/classes/RBACError.md +1 -1
  81. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  82. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  83. package/docs/api/classes/StorageUtils.md +281 -0
  84. package/docs/api/interfaces/AggregateConfig.md +1 -1
  85. package/docs/api/interfaces/ButtonProps.md +1 -1
  86. package/docs/api/interfaces/CardProps.md +1 -1
  87. package/docs/api/interfaces/ColorPalette.md +1 -1
  88. package/docs/api/interfaces/ColorShade.md +1 -1
  89. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  90. package/docs/api/interfaces/DataTableAction.md +1 -1
  91. package/docs/api/interfaces/DataTableColumn.md +1 -1
  92. package/docs/api/interfaces/DataTableProps.md +1 -1
  93. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  94. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  95. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  96. package/docs/api/interfaces/EventContextType.md +1 -1
  97. package/docs/api/interfaces/EventLogoProps.md +1 -1
  98. package/docs/api/interfaces/EventProviderProps.md +1 -1
  99. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  100. package/docs/api/interfaces/FileUploadProps.md +1 -1
  101. package/docs/api/interfaces/FooterProps.md +1 -1
  102. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  103. package/docs/api/interfaces/InputProps.md +1 -1
  104. package/docs/api/interfaces/LabelProps.md +1 -1
  105. package/docs/api/interfaces/LoginFormProps.md +1 -1
  106. package/docs/api/interfaces/NavigationAccessRecord.md +2 -2
  107. package/docs/api/interfaces/NavigationContextType.md +1 -1
  108. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  109. package/docs/api/interfaces/NavigationItem.md +1 -1
  110. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  111. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  112. package/docs/api/interfaces/Organisation.md +1 -1
  113. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  114. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  115. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  116. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  117. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  118. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  119. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  120. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  121. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  122. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  123. package/docs/api/interfaces/PaletteData.md +1 -1
  124. package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
  125. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  126. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  127. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  128. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  129. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  130. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  131. package/docs/api/interfaces/RBACConfig.md +1 -1
  132. package/docs/api/interfaces/RBACContextType.md +1 -1
  133. package/docs/api/interfaces/RBACLogger.md +1 -1
  134. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  135. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  136. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  137. package/docs/api/interfaces/RouteAccessRecord.md +2 -2
  138. package/docs/api/interfaces/RouteConfig.md +2 -2
  139. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  140. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  141. package/docs/api/interfaces/StorageConfig.md +1 -1
  142. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  143. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  144. package/docs/api/interfaces/StorageListOptions.md +1 -1
  145. package/docs/api/interfaces/StorageListResult.md +1 -1
  146. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  147. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  148. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  149. package/docs/api/interfaces/StyleImport.md +1 -1
  150. package/docs/api/interfaces/ToastActionElement.md +1 -1
  151. package/docs/api/interfaces/ToastProps.md +1 -1
  152. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  153. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  154. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  155. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  156. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  157. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  158. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  159. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  160. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  161. package/docs/api/interfaces/UserEventAccess.md +1 -1
  162. package/docs/api/interfaces/UserMenuProps.md +1 -1
  163. package/docs/api/interfaces/UserProfile.md +1 -1
  164. package/docs/api/modules.md +204 -200
  165. package/docs/api-reference/components.md +141 -163
  166. package/docs/api-reference/hooks.md +347 -0
  167. package/docs/core-concepts/rbac-system.md +69 -16
  168. package/docs/getting-started/examples/basic-auth-app.md +0 -1
  169. package/docs/implementation-guides/datatable-rbac-usage.md +12 -11
  170. package/docs/implementation-guides/file-upload-storage.md +733 -0
  171. package/docs/implementation-guides/inactivity-tracking.md +779 -0
  172. package/docs/implementation-guides/organisation-security.md +748 -0
  173. package/docs/implementation-guides/public-pages-advanced.md +1022 -0
  174. package/docs/migration/MIGRATION_GUIDE.md +684 -0
  175. package/docs/migration/README.md +13 -2
  176. package/docs/migration/rbac-migration.md +73 -0
  177. package/docs/rbac/examples/rbac-rls-integration-example.md +11 -13
  178. package/docs/style-guide.md +269 -1
  179. package/package.json +1 -1
  180. package/src/__tests__/TESTING_GUIDELINES.md +331 -18
  181. package/src/__tests__/helpers/supabaseMock.ts +99 -0
  182. package/src/__tests__/rbac/PagePermissionGuard.test.tsx +10 -7
  183. package/src/__tests__/shared.ts +6 -0
  184. package/src/components/DataTable/components/ActionButtons.tsx +2 -2
  185. package/src/components/DataTable/components/DataTableCore.tsx +2 -2
  186. package/src/components/DataTable/components/UnifiedTableBody.tsx +1 -1
  187. package/src/components/DataTable/utils/debugTools.ts +2 -2
  188. package/src/components/Dialog/Dialog.test.tsx +12 -2
  189. package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +6 -6
  190. package/src/components/ErrorBoundary/ErrorBoundary.tsx +2 -2
  191. package/src/components/FileDisplay.tsx +233 -0
  192. package/src/components/FileUpload.tsx +176 -0
  193. package/src/components/Footer/Footer.test.tsx +7 -7
  194. package/src/components/NavigationMenu/NavigationMenu.test.tsx +13 -6
  195. package/src/components/OrganisationSelector/OrganisationSelector.test.tsx +30 -3
  196. package/src/components/OrganisationSelector/OrganisationSelector.tsx +1 -1
  197. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +558 -0
  198. package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
  199. package/src/components/PublicLayout/PublicPageDebugger.tsx +2 -2
  200. package/src/components/PublicLayout/PublicPageDiagnostic.tsx +2 -2
  201. package/src/components/PublicLayout/PublicPageProvider.tsx +2 -2
  202. package/src/components/Select/Select.test.tsx +50 -15
  203. package/src/components/SuperAdminGuard.tsx +2 -2
  204. package/src/components/__tests__/SuperAdminGuard.test.tsx +559 -0
  205. package/src/components/index.ts +0 -183
  206. package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +2 -2
  207. package/src/hooks/__tests__/usePermissionCache.unit.test.ts +1 -1
  208. package/src/hooks/__tests__/useRBAC.unit.test.ts +191 -138
  209. package/src/hooks/public/usePublicEvent.ts +2 -2
  210. package/src/hooks/useAppConfig.ts +3 -3
  211. package/src/hooks/useComponentPerformance.ts +1 -1
  212. package/src/hooks/useDataTablePerformance.ts +1 -1
  213. package/src/hooks/useFileReference.ts +232 -0
  214. package/src/hooks/useOrganisationPermissions.test.ts +254 -344
  215. package/src/hooks/useOrganisationPermissions.ts +15 -7
  216. package/src/hooks/useOrganisationSecurity.test.ts +390 -402
  217. package/src/hooks/usePerformanceMonitor.ts +1 -1
  218. package/src/hooks/usePermissionCache.test.ts +264 -395
  219. package/src/hooks/usePermissionCache.ts +34 -4
  220. package/src/hooks/useSecureDataAccess.test.ts +486 -0
  221. package/src/hooks/useSecureDataAccess.ts +4 -1
  222. package/src/providers/InactivityProvider.tsx +2 -2
  223. package/src/providers/OrganisationProvider.test.simple.tsx +168 -0
  224. package/src/providers/OrganisationProvider.test.tsx +168 -0
  225. package/src/providers/OrganisationProvider.tsx +25 -31
  226. package/src/providers/UnifiedAuthProvider.test.simple.tsx +205 -0
  227. package/src/providers/UnifiedAuthProvider.test.tsx +128 -0
  228. package/src/providers/__tests__/InactivityProvider.test.tsx +3 -4
  229. package/src/providers/__tests__/OrganisationProvider.test.tsx +19 -14
  230. package/src/rbac/__tests__/integration.authflow.test.tsx +123 -0
  231. package/src/rbac/__tests__/integration.navigation.test.tsx +72 -0
  232. package/src/rbac/__tests__/integration.securedata.test.tsx +92 -0
  233. package/src/rbac/__tests__/integration.smoke.test.tsx +73 -0
  234. package/src/rbac/__tests__/rbac-core.test.tsx +26 -22
  235. package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +411 -0
  236. package/src/rbac/__tests__/rbac-engine-simplified.test.ts +285 -0
  237. package/src/rbac/__tests__/rbac-functions.test.ts +655 -0
  238. package/src/rbac/__tests__/rbac-integration.test.ts +532 -0
  239. package/src/rbac/__tests__/scenarios.user-role.test.tsx +196 -0
  240. package/src/rbac/api.test.ts +6 -6
  241. package/src/rbac/api.ts +2 -2
  242. package/src/rbac/audit.test.ts +485 -0
  243. package/src/rbac/audit.ts +7 -1
  244. package/src/rbac/cache-invalidation.ts +318 -0
  245. package/src/rbac/cache.test.ts +286 -0
  246. package/src/rbac/components/EnhancedNavigationMenu.test.tsx +559 -0
  247. package/src/rbac/components/EnhancedNavigationMenu.tsx +29 -23
  248. package/src/rbac/components/NavigationProvider.test.tsx +449 -0
  249. package/src/rbac/components/PagePermissionGuard.tsx +4 -4
  250. package/src/rbac/components/PagePermissionProvider.test.tsx +479 -0
  251. package/src/rbac/components/SecureDataProvider.test.tsx +511 -0
  252. package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +159 -430
  253. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +4 -5
  254. package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +112 -118
  255. package/src/rbac/config.test.ts +410 -0
  256. package/src/rbac/engine.test.simple.ts +237 -0
  257. package/src/rbac/engine.test.ts +233 -0
  258. package/src/rbac/engine.ts +37 -41
  259. package/src/rbac/examples/CompleteRBACExample.tsx +3 -3
  260. package/src/rbac/examples/EventBasedApp.tsx +4 -4
  261. package/src/rbac/hooks/useRBAC.simple.test.ts +16 -0
  262. package/src/rbac/hooks/useRBAC.test.ts +207 -455
  263. package/src/rbac/hooks/useRBAC.ts +30 -22
  264. package/src/rbac/permissions.test.ts +128 -0
  265. package/src/rbac/permissions.ts +56 -141
  266. package/src/rbac/providers/RBACProvider.tsx +1 -1
  267. package/src/rbac/secureClient.test.ts +444 -0
  268. package/src/rbac/security.test.ts +390 -0
  269. package/src/rbac/security.ts +1 -1
  270. package/src/rbac/types.test.ts +382 -0
  271. package/src/rbac/types.ts +2 -2
  272. package/src/styles/core.css +0 -125
  273. package/src/types/file-reference.ts +77 -0
  274. package/src/types/rbac-functions.ts +290 -0
  275. package/src/types/supabase.ts +10 -28
  276. package/src/types/unified.ts +4 -1
  277. package/src/utils/__tests__/bundleAnalysis.unit.test.ts +81 -55
  278. package/src/utils/__tests__/lazyLoad.unit.test.tsx +21 -12
  279. package/src/utils/__tests__/organisationContext.unit.test.ts +13 -7
  280. package/src/utils/__tests__/performanceBudgets.unit.test.ts +3 -3
  281. package/src/utils/__tests__/sessionTracking.unit.test.ts +32 -12
  282. package/src/utils/appConfig.ts +1 -1
  283. package/src/utils/appIdResolver.test.ts +503 -0
  284. package/src/utils/appIdResolver.ts +1 -1
  285. package/src/utils/appNameResolver.test.ts +494 -0
  286. package/src/utils/appNameResolver.ts +3 -2
  287. package/src/utils/bundleAnalysis.ts +3 -3
  288. package/src/utils/debugLogger.ts +1 -1
  289. package/src/utils/file-reference.ts +263 -0
  290. package/src/utils/formatDate.test.ts +2 -2
  291. package/src/utils/organisationContext.test.ts +340 -0
  292. package/src/utils/organisationContext.ts +19 -6
  293. package/src/utils/performanceBudgets.ts +2 -2
  294. package/src/utils/permissionUtils.test.ts +393 -0
  295. package/src/utils/permissionUtils.ts +5 -2
  296. package/src/utils/secureDataAccess.test.ts +715 -0
  297. package/src/utils/secureDataAccess.ts +21 -5
  298. package/src/utils/sessionTracking.ts +34 -4
  299. package/src/utils/storage/__tests__/helpers.unit.test.ts +328 -0
  300. package/src/utils/storage/__tests__/index.unit.test.ts +16 -0
  301. package/src/utils/storage/helpers.ts +20 -25
  302. package/src/utils/storage/index.ts +29 -1
  303. package/src/vite-env.d.ts +17 -0
  304. package/dist/chunk-22KLBHPS.js.map +0 -1
  305. package/dist/chunk-7BNPOCLL.js.map +0 -1
  306. package/dist/chunk-BC3S53OZ.js.map +0 -1
  307. package/dist/chunk-GWSBHC4J.js.map +0 -1
  308. package/dist/chunk-MYP2EGHX.js.map +0 -1
  309. package/dist/chunk-MZBUOP4P.js.map +0 -1
  310. package/dist/chunk-NYUJ4FJR.js.map +0 -1
  311. package/dist/chunk-NZ655MWE.js.map +0 -1
  312. package/dist/chunk-SS3E6QLB.js.map +0 -1
  313. package/dist/chunk-TRIZ7IB7.js.map +0 -1
  314. package/dist/chunk-WJARTBCT.js.map +0 -1
  315. package/dist/chunk-YDJW5XTN.js.map +0 -1
  316. package/docs/print-components/README.md +0 -258
  317. package/docs/print-components/api-reference.md +0 -636
  318. package/docs/print-components/examples/README.md +0 -204
  319. package/docs/print-components/examples/basic-report.tsx +0 -92
  320. package/docs/print-components/examples/card-catalog.tsx +0 -149
  321. package/docs/print-components/examples/cover-page-report.tsx +0 -163
  322. package/docs/print-components/quick-start.md +0 -363
  323. package/src/components/PrintButton/PrintButton.tsx +0 -321
  324. package/src/components/PrintButton/PrintButtonGroup.tsx +0 -84
  325. package/src/components/PrintButton/PrintToolbar.tsx +0 -94
  326. package/src/components/PrintButton/__tests__/PrintButton.test.tsx +0 -271
  327. package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +0 -438
  328. package/src/components/PrintButton/index.ts +0 -33
  329. package/src/components/PrintButton/types.ts +0 -173
  330. package/src/components/PrintCard/PrintCard.tsx +0 -154
  331. package/src/components/PrintCard/PrintCardContent.tsx +0 -57
  332. package/src/components/PrintCard/PrintCardFooter.tsx +0 -60
  333. package/src/components/PrintCard/PrintCardGrid.tsx +0 -91
  334. package/src/components/PrintCard/PrintCardHeader.tsx +0 -78
  335. package/src/components/PrintCard/PrintCardImage.tsx +0 -81
  336. package/src/components/PrintCard/examples/PrintCardShowcase.tsx +0 -239
  337. package/src/components/PrintCard/index.ts +0 -34
  338. package/src/components/PrintCard/types.ts +0 -171
  339. package/src/components/PrintDataTable/PrintDataTable.tsx +0 -215
  340. package/src/components/PrintDataTable/PrintTableGroup.tsx +0 -90
  341. package/src/components/PrintDataTable/PrintTableRow.tsx +0 -76
  342. package/src/components/PrintDataTable/index.ts +0 -25
  343. package/src/components/PrintDataTable/types.ts +0 -67
  344. package/src/components/PrintFooter/PrintFooter.tsx +0 -183
  345. package/src/components/PrintFooter/PrintFooterContent.tsx +0 -71
  346. package/src/components/PrintFooter/PrintFooterInfo.tsx +0 -86
  347. package/src/components/PrintFooter/PrintPageNumber.tsx +0 -90
  348. package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +0 -390
  349. package/src/components/PrintFooter/index.ts +0 -30
  350. package/src/components/PrintFooter/types.ts +0 -149
  351. package/src/components/PrintGrid/PrintGrid.tsx +0 -180
  352. package/src/components/PrintGrid/PrintGridBreakpoint.tsx +0 -109
  353. package/src/components/PrintGrid/PrintGridContainer.tsx +0 -128
  354. package/src/components/PrintGrid/PrintGridItem.tsx +0 -220
  355. package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +0 -359
  356. package/src/components/PrintGrid/index.ts +0 -31
  357. package/src/components/PrintGrid/types.ts +0 -159
  358. package/src/components/PrintHeader/PrintCoverHeader.tsx +0 -230
  359. package/src/components/PrintHeader/PrintHeader.tsx +0 -150
  360. package/src/components/PrintHeader/index.ts +0 -17
  361. package/src/components/PrintHeader/types.ts +0 -42
  362. package/src/components/PrintLayout/PrintLayout.tsx +0 -122
  363. package/src/components/PrintLayout/PrintLayoutContext.tsx +0 -66
  364. package/src/components/PrintLayout/PrintPageBreak.tsx +0 -52
  365. package/src/components/PrintLayout/examples/PrintShowcase.tsx +0 -230
  366. package/src/components/PrintLayout/index.ts +0 -19
  367. package/src/components/PrintLayout/types.ts +0 -37
  368. package/src/components/PrintPageBreak/PrintPageBreak.tsx +0 -120
  369. package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +0 -90
  370. package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +0 -112
  371. package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +0 -279
  372. package/src/components/PrintPageBreak/index.ts +0 -23
  373. package/src/components/PrintPageBreak/types.ts +0 -94
  374. package/src/components/PrintSection/PrintColumn.tsx +0 -104
  375. package/src/components/PrintSection/PrintDivider.tsx +0 -101
  376. package/src/components/PrintSection/PrintSection.tsx +0 -129
  377. package/src/components/PrintSection/PrintSectionContent.tsx +0 -75
  378. package/src/components/PrintSection/PrintSectionHeader.tsx +0 -97
  379. package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +0 -258
  380. package/src/components/PrintSection/index.ts +0 -33
  381. package/src/components/PrintSection/types.ts +0 -155
  382. package/src/components/PrintText/PrintText.tsx +0 -116
  383. package/src/components/PrintText/index.ts +0 -16
  384. package/src/components/PrintText/types.ts +0 -24
  385. package/src/rbac/__tests__/integration.test.tsx +0 -218
  386. package/src/utils/print/PrintDataProcessor.ts +0 -390
  387. package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +0 -397
  388. package/src/utils/print/index.ts +0 -29
  389. package/src/utils/print/types.ts +0 -196
  390. package/src/utils/print/usePrintOptimization.ts +0 -272
  391. /package/dist/{DataTable-7FMFXA7A.js.map → DataTable-DJQTKX33.js.map} +0 -0
  392. /package/dist/{api-H5A3H4IR.js.map → api-LUNF5O6M.js.map} +0 -0
  393. /package/dist/{appNameResolver-7GHF5ED2.js.map → appNameResolver-UURKN7NF.js.map} +0 -0
  394. /package/dist/{audit-BUW3LMJB.js.map → audit-6TOCAMKO.js.map} +0 -0
  395. /package/dist/{chunk-NRK4AIHQ.js.map → chunk-2DFCT6D3.js.map} +0 -0
  396. /package/dist/{chunk-6MTY77WU.js.map → chunk-QB4GXDUM.js.map} +0 -0
@@ -23,11 +23,39 @@ vi.mock('../../providers/EventProvider', () => ({
23
23
  // Mock Supabase client
24
24
  const mockSupabase = createMockSupabaseClient();
25
25
 
26
- // Ensure rpc is properly mocked
27
- vi.spyOn(mockSupabase, 'rpc').mockResolvedValue({
28
- data: { permissions: {}, roles: [], access_level: 'viewer' },
29
- error: null
30
- });
26
+ // Helper to setup RPC mocks for useRBAC hook
27
+ // useRBAC makes TWO RPC calls: rbac_app_resolve and rbac_permissions_get
28
+ const setupRBACMock = (permissions: any[] = []) => {
29
+ mockSupabase.rpc.mockImplementation((functionName: string, params?: any) => {
30
+ if (functionName === 'rbac_app_resolve') {
31
+ return Promise.resolve({
32
+ data: [{
33
+ app_id: 'test-app-id',
34
+ app_name: 'test-app',
35
+ has_access: true,
36
+ is_active: true
37
+ }],
38
+ error: null
39
+ });
40
+ }
41
+
42
+ if (functionName === 'rbac_permissions_get') {
43
+ return Promise.resolve({
44
+ data: permissions,
45
+ error: null
46
+ });
47
+ }
48
+
49
+ if (functionName === 'rbac_page_access_check') {
50
+ return Promise.resolve({ data: true, error: null });
51
+ }
52
+
53
+ return Promise.resolve({ data: null, error: null });
54
+ });
55
+ };
56
+
57
+ // Setup default RPC mock
58
+ setupRBACMock();
31
59
 
32
60
  describe('useRBAC', () => {
33
61
  beforeEach(() => {
@@ -111,10 +139,7 @@ describe('useRBAC', () => {
111
139
  }
112
140
  ];
113
141
 
114
- mockSupabase.rpc.mockResolvedValue({
115
- data: mockPermissions,
116
- error: null
117
- });
142
+ setupRBACMock(mockPermissions);
118
143
 
119
144
  const { result } = renderHook(() => useRBAC());
120
145
 
@@ -135,10 +160,7 @@ describe('useRBAC', () => {
135
160
  }
136
161
  ];
137
162
 
138
- mockSupabase.rpc.mockResolvedValue({
139
- data: mockPermissions,
140
- error: null
141
- });
163
+ setupRBACMock(mockPermissions);
142
164
 
143
165
  const { result } = renderHook(() => useRBAC());
144
166
 
@@ -159,11 +181,9 @@ describe('useRBAC', () => {
159
181
  }
160
182
  ];
161
183
 
162
- mockSupabase.rpc.mockResolvedValue({
163
- data: mockPermissions,
164
- error: null
165
- });
166
-
184
+
185
+ setupRBACMock(mockPermissions);
186
+
167
187
  const { result } = renderHook(() => useRBAC());
168
188
 
169
189
  await waitFor(() => {
@@ -195,11 +215,9 @@ describe('useRBAC', () => {
195
215
  }
196
216
  ];
197
217
 
198
- mockSupabase.rpc.mockResolvedValue({
199
- data: mockPermissions,
200
- error: null
201
- });
202
-
218
+
219
+ setupRBACMock(mockPermissions);
220
+
203
221
  const { result } = renderHook(() => useRBAC());
204
222
 
205
223
  await waitFor(() => {
@@ -236,11 +254,9 @@ describe('useRBAC', () => {
236
254
  }
237
255
  ];
238
256
 
239
- mockSupabase.rpc.mockResolvedValue({
240
- data: mockPermissions,
241
- error: null
242
- });
243
-
257
+
258
+ setupRBACMock(mockPermissions);
259
+
244
260
  const { result } = renderHook(() => useRBAC());
245
261
 
246
262
  await waitFor(() => {
@@ -261,15 +277,22 @@ describe('useRBAC', () => {
261
277
  }
262
278
  ];
263
279
 
264
- mockSupabase.rpc
265
- .mockResolvedValueOnce({
266
- data: mockPermissions,
267
- error: null
268
- })
269
- .mockResolvedValueOnce({
270
- data: true,
271
- error: null
272
- });
280
+ // Fully mock RPC responses for this test
281
+ mockSupabase.rpc.mockImplementation((functionName: string, params?: any) => {
282
+ if (functionName === 'rbac_app_resolve') {
283
+ return Promise.resolve({
284
+ data: [{ app_id: 'test-app-id', app_name: 'test-app', has_access: true, is_active: true }],
285
+ error: null
286
+ });
287
+ }
288
+ if (functionName === 'rbac_permissions_get') {
289
+ return Promise.resolve({ data: mockPermissions, error: null });
290
+ }
291
+ if (functionName === 'rbac_page_access_check') {
292
+ return Promise.resolve({ data: true, error: null });
293
+ }
294
+ return Promise.resolve({ data: null, error: null });
295
+ });
273
296
 
274
297
  const { result } = renderHook(() => useRBAC());
275
298
 
@@ -279,7 +302,7 @@ describe('useRBAC', () => {
279
302
 
280
303
  const hasPermission = await result.current.hasPermission('read', 'dashboard');
281
304
  expect(hasPermission).toBe(true);
282
- expect(mockSupabase.rpc).toHaveBeenCalledWith('check_page_permission', {
305
+ expect(mockSupabase.rpc).toHaveBeenCalledWith('rbac_page_access_check', {
283
306
  p_user_id: 'test-user-id',
284
307
  p_app_id: 'test-app-id',
285
308
  p_page_id: 'dashboard',
@@ -299,15 +322,22 @@ describe('useRBAC', () => {
299
322
  }
300
323
  ];
301
324
 
302
- mockSupabase.rpc
303
- .mockResolvedValueOnce({
304
- data: mockPermissions,
305
- error: null
306
- })
307
- .mockResolvedValueOnce({
308
- data: false,
309
- error: null
310
- });
325
+ // Fully mock RPC responses for this test
326
+ mockSupabase.rpc.mockImplementation((functionName: string, params?: any) => {
327
+ if (functionName === 'rbac_app_resolve') {
328
+ return Promise.resolve({
329
+ data: [{ app_id: 'test-app-id', app_name: 'test-app', has_access: true, is_active: true }],
330
+ error: null
331
+ });
332
+ }
333
+ if (functionName === 'rbac_permissions_get') {
334
+ return Promise.resolve({ data: mockPermissions, error: null });
335
+ }
336
+ if (functionName === 'rbac_page_access_check') {
337
+ return Promise.resolve({ data: false, error: null });
338
+ }
339
+ return Promise.resolve({ data: null, error: null });
340
+ });
311
341
 
312
342
  const { result } = renderHook(() => useRBAC());
313
343
 
@@ -331,12 +361,22 @@ describe('useRBAC', () => {
331
361
  }
332
362
  ];
333
363
 
334
- mockSupabase.rpc
335
- .mockResolvedValueOnce({
336
- data: mockPermissions,
337
- error: null
338
- })
339
- .mockRejectedValueOnce(new Error('Database error'));
364
+ // Fully mock RPC responses (reject on access check)
365
+ mockSupabase.rpc.mockImplementation((functionName: string, params?: any) => {
366
+ if (functionName === 'rbac_app_resolve') {
367
+ return Promise.resolve({
368
+ data: [{ app_id: 'test-app-id', app_name: 'test-app', has_access: true, is_active: true }],
369
+ error: null
370
+ });
371
+ }
372
+ if (functionName === 'rbac_permissions_get') {
373
+ return Promise.resolve({ data: mockPermissions, error: null });
374
+ }
375
+ if (functionName === 'rbac_page_access_check') {
376
+ return Promise.reject(new Error('Database error'));
377
+ }
378
+ return Promise.resolve({ data: null, error: null });
379
+ });
340
380
 
341
381
  const { result } = renderHook(() => useRBAC());
342
382
 
@@ -360,15 +400,22 @@ describe('useRBAC', () => {
360
400
  }
361
401
  ];
362
402
 
363
- mockSupabase.rpc
364
- .mockResolvedValueOnce({
365
- data: mockPermissions,
366
- error: null
367
- })
368
- .mockResolvedValueOnce({
369
- data: true,
370
- error: null
371
- });
403
+ // Fully mock RPC responses
404
+ mockSupabase.rpc.mockImplementation((functionName: string, params?: any) => {
405
+ if (functionName === 'rbac_app_resolve') {
406
+ return Promise.resolve({
407
+ data: [{ app_id: 'test-app-id', app_name: 'test-app', has_access: true, is_active: true }],
408
+ error: null
409
+ });
410
+ }
411
+ if (functionName === 'rbac_permissions_get') {
412
+ return Promise.resolve({ data: mockPermissions, error: null });
413
+ }
414
+ if (functionName === 'rbac_page_access_check') {
415
+ return Promise.resolve({ data: true, error: null });
416
+ }
417
+ return Promise.resolve({ data: null, error: null });
418
+ });
372
419
 
373
420
  const { result } = renderHook(() => useRBAC('default-page'));
374
421
 
@@ -378,7 +425,7 @@ describe('useRBAC', () => {
378
425
 
379
426
  await result.current.hasPermission('read');
380
427
 
381
- expect(mockSupabase.rpc).toHaveBeenCalledWith('check_page_permission', {
428
+ expect(mockSupabase.rpc).toHaveBeenCalledWith('rbac_page_access_check', {
382
429
  p_user_id: 'test-user-id',
383
430
  p_app_id: 'test-app-id',
384
431
  p_page_id: 'default-page',
@@ -400,11 +447,9 @@ describe('useRBAC', () => {
400
447
  }
401
448
  ];
402
449
 
403
- mockSupabase.rpc.mockResolvedValue({
404
- data: mockPermissions,
405
- error: null
406
- });
407
-
450
+
451
+ setupRBACMock(mockPermissions);
452
+
408
453
  const { result } = renderHook(() => useRBAC());
409
454
 
410
455
  await waitFor(() => {
@@ -426,11 +471,9 @@ describe('useRBAC', () => {
426
471
  }
427
472
  ];
428
473
 
429
- mockSupabase.rpc.mockResolvedValue({
430
- data: mockPermissions,
431
- error: null
432
- });
433
-
474
+
475
+ setupRBACMock(mockPermissions);
476
+
434
477
  const { result } = renderHook(() => useRBAC());
435
478
 
436
479
  await waitFor(() => {
@@ -452,11 +495,9 @@ describe('useRBAC', () => {
452
495
  }
453
496
  ];
454
497
 
455
- mockSupabase.rpc.mockResolvedValue({
456
- data: mockPermissions,
457
- error: null
458
- });
459
-
498
+
499
+ setupRBACMock(mockPermissions);
500
+
460
501
  const { result } = renderHook(() => useRBAC());
461
502
 
462
503
  expect(result.current.hasGlobalPermission('super_admin')).toBe(false);
@@ -476,11 +517,9 @@ describe('useRBAC', () => {
476
517
  }
477
518
  ];
478
519
 
479
- mockSupabase.rpc.mockResolvedValue({
480
- data: mockPermissions,
481
- error: null
482
- });
483
-
520
+
521
+ setupRBACMock(mockPermissions);
522
+
484
523
  const { result } = renderHook(() => useRBAC());
485
524
 
486
525
  await waitFor(() => {
@@ -498,11 +537,9 @@ describe('useRBAC', () => {
498
537
  }
499
538
  ];
500
539
 
501
- mockSupabase.rpc.mockResolvedValue({
502
- data: mockPermissions,
503
- error: null
504
- });
505
-
540
+
541
+ setupRBACMock(mockPermissions);
542
+
506
543
  const { result } = renderHook(() => useRBAC());
507
544
 
508
545
  await waitFor(() => {
@@ -520,11 +557,9 @@ describe('useRBAC', () => {
520
557
  }
521
558
  ];
522
559
 
523
- mockSupabase.rpc.mockResolvedValue({
524
- data: mockPermissions,
525
- error: null
526
- });
527
-
560
+
561
+ setupRBACMock(mockPermissions);
562
+
528
563
  const { result } = renderHook(() => useRBAC());
529
564
 
530
565
  await waitFor(() => {
@@ -542,11 +577,9 @@ describe('useRBAC', () => {
542
577
  }
543
578
  ];
544
579
 
545
- mockSupabase.rpc.mockResolvedValue({
546
- data: mockPermissions,
547
- error: null
548
- });
549
-
580
+
581
+ setupRBACMock(mockPermissions);
582
+
550
583
  const { result } = renderHook(() => useRBAC());
551
584
 
552
585
  await waitFor(() => {
@@ -564,11 +597,9 @@ describe('useRBAC', () => {
564
597
  }
565
598
  ];
566
599
 
567
- mockSupabase.rpc.mockResolvedValue({
568
- data: mockPermissions,
569
- error: null
570
- });
571
-
600
+
601
+ setupRBACMock(mockPermissions);
602
+
572
603
  const { result } = renderHook(() => useRBAC());
573
604
 
574
605
  await waitFor(() => {
@@ -586,11 +617,9 @@ describe('useRBAC', () => {
586
617
  }
587
618
  ];
588
619
 
589
- mockSupabase.rpc.mockResolvedValue({
590
- data: mockPermissions,
591
- error: null
592
- });
593
-
620
+
621
+ setupRBACMock(mockPermissions);
622
+
594
623
  const { result } = renderHook(() => useRBAC());
595
624
 
596
625
  await waitFor(() => {
@@ -639,9 +668,26 @@ describe('useRBAC', () => {
639
668
  it('handles RPC errors gracefully', async () => {
640
669
  const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
641
670
 
642
- mockSupabase.rpc.mockResolvedValue({
643
- data: null,
644
- error: { message: 'Database connection failed' }
671
+ // Mock the app resolve to succeed, but permissions to fail
672
+ mockSupabase.rpc.mockImplementation((functionName: string) => {
673
+ if (functionName === 'rbac_app_resolve') {
674
+ return Promise.resolve({
675
+ data: [{
676
+ app_id: 'test-app-id',
677
+ app_name: 'test-app',
678
+ has_access: true,
679
+ is_active: true
680
+ }],
681
+ error: null
682
+ });
683
+ }
684
+ if (functionName === 'rbac_permissions_get') {
685
+ return Promise.resolve({
686
+ data: null,
687
+ error: { message: 'Database connection failed' }
688
+ });
689
+ }
690
+ return Promise.resolve({ data: null, error: null });
645
691
  });
646
692
 
647
693
  const { result } = renderHook(() => useRBAC());
@@ -657,9 +703,26 @@ describe('useRBAC', () => {
657
703
  it('handles network errors gracefully', async () => {
658
704
  const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
659
705
 
660
- mockSupabase.rpc.mockResolvedValue({
661
- data: null,
662
- error: { message: 'Network timeout' }
706
+ // Mock the app resolve to succeed, but permissions to fail
707
+ mockSupabase.rpc.mockImplementation((functionName: string) => {
708
+ if (functionName === 'rbac_app_resolve') {
709
+ return Promise.resolve({
710
+ data: [{
711
+ app_id: 'test-app-id',
712
+ app_name: 'test-app',
713
+ has_access: true,
714
+ is_active: true
715
+ }],
716
+ error: null
717
+ });
718
+ }
719
+ if (functionName === 'rbac_permissions_get') {
720
+ return Promise.resolve({
721
+ data: null,
722
+ error: { message: 'Network timeout' }
723
+ });
724
+ }
725
+ return Promise.resolve({ data: null, error: null });
663
726
  });
664
727
 
665
728
  const { result } = renderHook(() => useRBAC());
@@ -699,10 +762,7 @@ describe('useRBAC', () => {
699
762
  }
700
763
  ];
701
764
 
702
- mockSupabase.rpc.mockResolvedValue({
703
- data: mockPermissions,
704
- error: null
705
- });
765
+ setupRBACMock(mockPermissions);
706
766
 
707
767
  const { result, rerender } = renderHook(() => useRBAC());
708
768
 
@@ -721,7 +781,7 @@ describe('useRBAC', () => {
721
781
  rerender();
722
782
 
723
783
  await waitFor(() => {
724
- expect(mockSupabase.rpc).toHaveBeenCalledTimes(2);
784
+ expect(mockSupabase.rpc).toHaveBeenCalledTimes(4);
725
785
  });
726
786
  });
727
787
 
@@ -735,10 +795,7 @@ describe('useRBAC', () => {
735
795
  }
736
796
  ];
737
797
 
738
- mockSupabase.rpc.mockResolvedValue({
739
- data: mockPermissions,
740
- error: null
741
- });
798
+ setupRBACMock(mockPermissions);
742
799
 
743
800
  const { result, rerender } = renderHook(() => useRBAC());
744
801
 
@@ -754,7 +811,7 @@ describe('useRBAC', () => {
754
811
  rerender();
755
812
 
756
813
  await waitFor(() => {
757
- expect(mockSupabase.rpc).toHaveBeenCalledTimes(2);
814
+ expect(mockSupabase.rpc).toHaveBeenCalledTimes(4);
758
815
  });
759
816
  });
760
817
 
@@ -768,10 +825,7 @@ describe('useRBAC', () => {
768
825
  }
769
826
  ];
770
827
 
771
- mockSupabase.rpc.mockResolvedValue({
772
- data: mockPermissions,
773
- error: null
774
- });
828
+ setupRBACMock(mockPermissions);
775
829
 
776
830
  const { result, rerender } = renderHook(() => useRBAC());
777
831
 
@@ -787,7 +841,7 @@ describe('useRBAC', () => {
787
841
  rerender();
788
842
 
789
843
  await waitFor(() => {
790
- expect(mockSupabase.rpc).toHaveBeenCalledTimes(2);
844
+ expect(mockSupabase.rpc).toHaveBeenCalledTimes(4);
791
845
  });
792
846
  });
793
847
 
@@ -808,11 +862,9 @@ describe('useRBAC', () => {
808
862
  }
809
863
  ];
810
864
 
811
- mockSupabase.rpc.mockResolvedValue({
812
- data: mockPermissions,
813
- error: null
814
- });
815
-
865
+
866
+ setupRBACMock(mockPermissions);
867
+
816
868
  const { result } = renderHook(() => useRBAC());
817
869
 
818
870
  expect(result.current.eventAppRole).toBeNull();
@@ -841,10 +893,11 @@ describe('useRBAC', () => {
841
893
  }
842
894
  ];
843
895
 
844
- mockSupabase.rpc.mockResolvedValue({
845
- data: mockPermissions,
846
- error: null
847
- });
896
+
897
+
898
+ setupRBACMock(mockPermissions);
899
+
900
+
848
901
 
849
902
  const { result } = renderHook(() => useRBAC());
850
903
 
@@ -117,8 +117,8 @@ export function usePublicEvent(
117
117
  } catch {
118
118
  // Fallback to direct environment variable access if not in PublicPageProvider
119
119
  environment = {
120
- supabaseUrl: (import.meta as any).env?.VITE_SUPABASE_URL || process.env.VITE_SUPABASE_URL || process.env.NEXT_PUBLIC_SUPABASE_URL || null,
121
- supabaseKey: (import.meta as any).env?.VITE_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY || process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || null
120
+ supabaseUrl: (import.meta as any).env?.VITE_SUPABASE_URL || (import.meta as any).env?.NEXT_PUBLIC_SUPABASE_URL || null,
121
+ supabaseKey: (import.meta as any).env?.VITE_SUPABASE_ANON_KEY || (import.meta as any).env?.NEXT_PUBLIC_SUPABASE_ANON_KEY || null
122
122
  };
123
123
  }
124
124
 
@@ -58,9 +58,9 @@ export function useAppConfig(): UseAppConfigReturn {
58
58
  'PACE';
59
59
  }
60
60
  // Check Node.js environment (server-side)
61
- if (typeof process !== 'undefined' && process.env) {
62
- return process.env.VITE_APP_NAME ||
63
- process.env.NEXT_PUBLIC_APP_NAME ||
61
+ if (typeof import.meta !== 'undefined' && import.meta.env) {
62
+ return import.meta.env.VITE_APP_NAME ||
63
+ import.meta.env.NEXT_PUBLIC_APP_NAME ||
64
64
  'PACE';
65
65
  }
66
66
  return 'PACE';
@@ -9,7 +9,7 @@ interface PerformanceConfig {
9
9
 
10
10
  export function useComponentPerformance({
11
11
  componentName,
12
- enableLogging = process.env.NODE_ENV === 'development',
12
+ enableLogging = import.meta.env.MODE === 'development',
13
13
  threshold = 16 // 60fps = 16ms per frame
14
14
  }: PerformanceConfig) {
15
15
  const renderCount = useRef(0);
@@ -273,7 +273,7 @@ export function useDataTablePerformance<TData extends DataRecord>({
273
273
  updateMemoryUsage();
274
274
 
275
275
  // Only set up interval in non-test environments to prevent memory leaks during testing
276
- const interval = typeof process !== 'undefined' && process.env.NODE_ENV !== 'test'
276
+ const interval = import.meta.env.MODE !== 'test'
277
277
  ? setInterval(updateMemoryUsage, 5000)
278
278
  : null;
279
279