@jmruthers/pace-core 0.6.3 → 0.6.4

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 (40) hide show
  1. package/dist/{DataTable-THFPBKTP.js → DataTable-E7YQZD7D.js} +7 -7
  2. package/dist/{UnifiedAuthProvider-KAGUYQ4J.js → UnifiedAuthProvider-QPXO24B4.js} +4 -4
  3. package/dist/{api-IAGWF3ZG.js → api-6LVZTHDS.js} +3 -3
  4. package/dist/{chunk-QRPVRXYT.js → chunk-36LVWXB2.js} +2 -1
  5. package/dist/{chunk-RWEBCB47.js → chunk-3LPHPB62.js} +2 -2
  6. package/dist/{chunk-HFZBI76P.js → chunk-5EC5MEWX.js} +4 -4
  7. package/dist/{chunk-PQBSKX33.js → chunk-7JPAB3T5.js} +4 -4
  8. package/dist/{chunk-CNCQDFLN.js → chunk-ATKZM7RX.js} +14 -14
  9. package/dist/{chunk-DWUBLJJM.js → chunk-AVMLPIM7.js} +88 -8
  10. package/dist/chunk-AVMLPIM7.js.map +1 -0
  11. package/dist/{chunk-ZNIWI3UC.js → chunk-I6DAQMWX.js} +25 -15
  12. package/dist/{chunk-ZNIWI3UC.js.map → chunk-I6DAQMWX.js.map} +1 -1
  13. package/dist/{chunk-YDQHOZNA.js → chunk-NN6WWZ5U.js} +8 -8
  14. package/dist/{chunk-6Z7LTB3D.js → chunk-OEWDTMG7.js} +4 -4
  15. package/dist/{chunk-2T2IG7T7.js → chunk-YKRAFF5K.js} +3 -3
  16. package/dist/components.js +8 -8
  17. package/dist/{contextValidator-3JNZKUTX.js → contextValidator-OOPCLPZW.js} +2 -2
  18. package/dist/hooks.js +6 -6
  19. package/dist/index.js +10 -10
  20. package/dist/providers.js +3 -3
  21. package/dist/rbac/index.js +6 -6
  22. package/dist/utils.js +1 -1
  23. package/docs/api/modules.md +2 -2
  24. package/package.json +8 -3
  25. package/scripts/audit/core/checks/dependencies.cjs +9 -0
  26. package/src/components/PaceAppLayout/PaceAppLayout.tsx +22 -3
  27. package/src/services/EventService.ts +99 -2
  28. package/dist/chunk-DWUBLJJM.js.map +0 -1
  29. /package/dist/{DataTable-THFPBKTP.js.map → DataTable-E7YQZD7D.js.map} +0 -0
  30. /package/dist/{UnifiedAuthProvider-KAGUYQ4J.js.map → UnifiedAuthProvider-QPXO24B4.js.map} +0 -0
  31. /package/dist/{api-IAGWF3ZG.js.map → api-6LVZTHDS.js.map} +0 -0
  32. /package/dist/{chunk-QRPVRXYT.js.map → chunk-36LVWXB2.js.map} +0 -0
  33. /package/dist/{chunk-RWEBCB47.js.map → chunk-3LPHPB62.js.map} +0 -0
  34. /package/dist/{chunk-HFZBI76P.js.map → chunk-5EC5MEWX.js.map} +0 -0
  35. /package/dist/{chunk-PQBSKX33.js.map → chunk-7JPAB3T5.js.map} +0 -0
  36. /package/dist/{chunk-CNCQDFLN.js.map → chunk-ATKZM7RX.js.map} +0 -0
  37. /package/dist/{chunk-YDQHOZNA.js.map → chunk-NN6WWZ5U.js.map} +0 -0
  38. /package/dist/{chunk-6Z7LTB3D.js.map → chunk-OEWDTMG7.js.map} +0 -0
  39. /package/dist/{chunk-2T2IG7T7.js.map → chunk-YKRAFF5K.js.map} +0 -0
  40. /package/dist/{contextValidator-3JNZKUTX.js.map → contextValidator-OOPCLPZW.js.map} +0 -0
@@ -26,13 +26,13 @@ import {
26
26
  SelectSeparator,
27
27
  SelectTrigger,
28
28
  SelectValue
29
- } from "./chunk-PQBSKX33.js";
29
+ } from "./chunk-7JPAB3T5.js";
30
30
  import {
31
31
  useCan,
32
32
  usePermissions,
33
33
  useRBAC,
34
34
  useResolvedScope
35
- } from "./chunk-YDQHOZNA.js";
35
+ } from "./chunk-NN6WWZ5U.js";
36
36
  import {
37
37
  createFileReferenceService,
38
38
  generateFileUrlsBatch,
@@ -44,7 +44,7 @@ import {
44
44
  useFileDisplay,
45
45
  usePreventTabReload,
46
46
  usePublicFileDisplay
47
- } from "./chunk-2T2IG7T7.js";
47
+ } from "./chunk-YKRAFF5K.js";
48
48
  import {
49
49
  useToast
50
50
  } from "./chunk-6SOIHG6Z.js";
@@ -54,16 +54,20 @@ import {
54
54
  useAppConfig,
55
55
  useEvents,
56
56
  useIsPublicPage
57
- } from "./chunk-6Z7LTB3D.js";
57
+ } from "./chunk-OEWDTMG7.js";
58
58
  import {
59
59
  EventServiceContext,
60
60
  useOrganisations,
61
61
  useSessionRestoration,
62
62
  useUnifiedAuth
63
- } from "./chunk-DWUBLJJM.js";
63
+ } from "./chunk-AVMLPIM7.js";
64
64
  import {
65
65
  isSuperAdmin
66
- } from "./chunk-RWEBCB47.js";
66
+ } from "./chunk-3LPHPB62.js";
67
+ import {
68
+ EventContextRequiredError,
69
+ OrganisationContextRequiredError
70
+ } from "./chunk-36LVWXB2.js";
67
71
  import {
68
72
  assertAppId
69
73
  } from "./chunk-QXHPKYJV.js";
@@ -2841,7 +2845,7 @@ function useNavigationFiltering({
2841
2845
  }
2842
2846
  const userId2 = authContext.user.id;
2843
2847
  const appName = authContext.appName;
2844
- import("./api-IAGWF3ZG.js").then(({ resolveAppContext }) => {
2848
+ import("./api-6LVZTHDS.js").then(({ resolveAppContext }) => {
2845
2849
  resolveAppContext({
2846
2850
  userId: userId2,
2847
2851
  appName
@@ -3591,6 +3595,12 @@ function PaceAppLayout({
3591
3595
  );
3592
3596
  const can = isSuperAdmin2 ? true : canFromHook;
3593
3597
  const hasPermission = enforcePermissions ? can : true;
3598
+ const isContextError = useMemo8(() => {
3599
+ if (!permissionError) {
3600
+ return false;
3601
+ }
3602
+ return permissionError instanceof EventContextRequiredError || permissionError instanceof OrganisationContextRequiredError || permissionError.name === "EventContextRequiredError" || permissionError.name === "OrganisationContextRequiredError";
3603
+ }, [permissionError]);
3594
3604
  useEffect7(() => {
3595
3605
  if (!enforcePermissions) {
3596
3606
  return;
@@ -3641,7 +3651,7 @@ function PaceAppLayout({
3641
3651
  return;
3642
3652
  }
3643
3653
  try {
3644
- const { isSuperAdmin: checkSuperAdminDynamic } = await import("./api-IAGWF3ZG.js");
3654
+ const { isSuperAdmin: checkSuperAdminDynamic } = await import("./api-6LVZTHDS.js");
3645
3655
  const isSuper = await checkSuperAdminDynamic(user.id);
3646
3656
  if (isSuper) {
3647
3657
  if (isMounted) {
@@ -3656,7 +3666,7 @@ function PaceAppLayout({
3656
3666
  }
3657
3667
  }
3658
3668
  try {
3659
- const { getPermissionMap } = await import("./api-IAGWF3ZG.js");
3669
+ const { getPermissionMap } = await import("./api-6LVZTHDS.js");
3660
3670
  const permissionScope = {
3661
3671
  organisationId: currentScope.organisationId,
3662
3672
  eventId: currentScope.eventId,
@@ -3667,7 +3677,7 @@ function PaceAppLayout({
3667
3677
  userId: user.id,
3668
3678
  scope: permissionScope
3669
3679
  });
3670
- const { getPageScopeType } = await import("./api-IAGWF3ZG.js");
3680
+ const { getPageScopeType } = await import("./api-6LVZTHDS.js");
3671
3681
  const effectiveAppId = currentScope.appId || resolvedAppId;
3672
3682
  const effectiveAppName = appName;
3673
3683
  const hasEventContext = !!currentScope.eventId;
@@ -3776,7 +3786,7 @@ function PaceAppLayout({
3776
3786
  let hasAccess = true;
3777
3787
  if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
3778
3788
  try {
3779
- const { isPermittedCached } = await import("./api-IAGWF3ZG.js");
3789
+ const { isPermittedCached } = await import("./api-6LVZTHDS.js");
3780
3790
  const hasPagePermission = await isPermittedCached({
3781
3791
  userId: user?.id || "",
3782
3792
  scope,
@@ -3792,7 +3802,7 @@ function PaceAppLayout({
3792
3802
  }
3793
3803
  }
3794
3804
  if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
3795
- const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-KAGUYQ4J.js");
3805
+ const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-QPXO24B4.js");
3796
3806
  hasAccess = true;
3797
3807
  }
3798
3808
  if (!isMounted) return;
@@ -3864,14 +3874,14 @@ function PaceAppLayout({
3864
3874
  /* @__PURE__ */ jsx19("p", { className: "text-sec-600", children: "Checking permissions..." })
3865
3875
  ] }) });
3866
3876
  }
3867
- if (enforcePermissions && permissionError && !isSuperAdmin2) {
3877
+ if (enforcePermissions && permissionError && !isSuperAdmin2 && !isContextError) {
3868
3878
  return /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs14("div", { className: "text-center", children: [
3869
3879
  /* @__PURE__ */ jsx19("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
3870
3880
  /* @__PURE__ */ jsx19("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
3871
3881
  /* @__PURE__ */ jsx19(Button, { onClick: () => navigate("/"), children: "Go Home" })
3872
3882
  ] }) });
3873
3883
  }
3874
- if (enforcePermissions && hasPermission === false && !isCheckingSuperAdminDirect && !isSuperAdmin2) {
3884
+ if (enforcePermissions && hasPermission === false && !isCheckingSuperAdminDirect && !isSuperAdmin2 && !isContextError) {
3875
3885
  if (enforcePagePermissions && pagePermissionFallback) {
3876
3886
  return /* @__PURE__ */ jsx19(Fragment9, { children: pagePermissionFallback });
3877
3887
  }
@@ -4990,4 +5000,4 @@ export {
4990
5000
  PublicPageFooter,
4991
5001
  PublicPageLayout
4992
5002
  };
4993
- //# sourceMappingURL=chunk-ZNIWI3UC.js.map
5003
+ //# sourceMappingURL=chunk-I6DAQMWX.js.map