@jmruthers/pace-core 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataTable-THFPBKTP.js → DataTable-AOVNCPTX.js} +8 -8
- package/dist/{PublicPageProvider-DEMpysFR.d.ts → PublicPageProvider-QTFVrL-Z.d.ts} +65 -83
- package/dist/{UnifiedAuthProvider-KAGUYQ4J.js → UnifiedAuthProvider-4SBX4LU5.js} +4 -4
- package/dist/{api-IAGWF3ZG.js → api-O6HTBX5Y.js} +3 -3
- package/dist/{chunk-ZNIWI3UC.js → chunk-6COVEUS7.js} +141 -107
- package/dist/chunk-6COVEUS7.js.map +1 -0
- package/dist/{chunk-QRPVRXYT.js → chunk-AFVQODI2.js} +38 -1
- package/dist/{chunk-QRPVRXYT.js.map → chunk-AFVQODI2.js.map} +1 -1
- package/dist/{chunk-RWEBCB47.js → chunk-EFN2EIMK.js} +2 -2
- package/dist/{chunk-CNCQDFLN.js → chunk-G7QEZTYQ.js} +31 -31
- package/dist/{chunk-CNCQDFLN.js.map → chunk-G7QEZTYQ.js.map} +1 -1
- package/dist/{chunk-YDQHOZNA.js → chunk-HU2C6SSC.js} +29 -18
- package/dist/chunk-HU2C6SSC.js.map +1 -0
- package/dist/{chunk-DWUBLJJM.js → chunk-IHB5DR3H.js} +184 -53
- package/dist/chunk-IHB5DR3H.js.map +1 -0
- package/dist/{chunk-PQBSKX33.js → chunk-IVOFDYWT.js} +364 -208
- package/dist/chunk-IVOFDYWT.js.map +1 -0
- package/dist/{chunk-6SOIHG6Z.js → chunk-JGRYX5UX.js} +120 -20
- package/dist/chunk-JGRYX5UX.js.map +1 -0
- package/dist/{chunk-6Z7LTB3D.js → chunk-NTM7ZSB6.js} +4 -4
- package/dist/chunk-NTM7ZSB6.js.map +1 -0
- package/dist/{chunk-HFZBI76P.js → chunk-RGAWHO7N.js} +4 -4
- package/dist/chunk-RGAWHO7N.js.map +1 -0
- package/dist/{chunk-2T2IG7T7.js → chunk-UPPMRMYG.js} +3 -3
- package/dist/{chunk-2T2IG7T7.js.map → chunk-UPPMRMYG.js.map} +1 -1
- package/dist/components.d.ts +2 -3
- package/dist/components.js +24 -28
- package/dist/components.js.map +1 -1
- package/dist/{contextValidator-3JNZKUTX.js → contextValidator-5OGXSPKS.js} +2 -2
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +41 -139
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +27 -18
- package/dist/index.js +41 -50
- package/dist/index.js.map +1 -1
- package/dist/providers.js +3 -3
- package/dist/rbac/index.d.ts +16 -9
- package/dist/rbac/index.js +6 -6
- package/dist/{usePublicRouteParams-i3qtoBgg.d.ts → usePublicRouteParams-ClnV4tnv.d.ts} +8 -8
- package/dist/utils.js +1 -1
- package/docs/api/modules.md +210 -100
- package/package.json +8 -4
- package/scripts/audit/core/checks/dependencies.cjs +9 -0
- package/scripts/validate-master.js +1 -1
- package/src/components/DataTable/__tests__/keyboard.test.tsx +15 -2
- package/src/components/DataTable/components/ImportModal.tsx +4 -6
- package/src/components/DataTable/components/ViewRowModal.tsx +4 -4
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +455 -96
- package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +122 -58
- package/src/components/DataTable/core/DataTableContext.tsx +1 -1
- package/src/components/DateTimeField/DateTimeField.tsx +17 -19
- package/src/components/DateTimeField/README.md +5 -2
- package/src/components/Dialog/Dialog.test.tsx +248 -228
- package/src/components/Dialog/Dialog.tsx +455 -325
- package/src/components/Dialog/index.ts +3 -3
- package/src/components/FileDisplay/FileDisplay.test.tsx +41 -0
- package/src/components/FileDisplay/FileDisplay.tsx +5 -5
- package/src/components/Form/Form.test.tsx +3 -2
- package/src/components/Form/Form.tsx +4 -5
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +28 -28
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +40 -54
- package/src/components/LoginForm/LoginForm.tsx +2 -2
- package/src/components/NavigationMenu/NavigationMenu.tsx +2 -2
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +54 -42
- package/src/components/PaceAppLayout/README.md +10 -9
- package/src/components/PaceAppLayout/test-setup.tsx +40 -31
- package/src/components/PasswordChange/PasswordChangeForm.test.tsx +61 -0
- package/src/components/PasswordChange/PasswordChangeForm.tsx +20 -13
- package/src/components/PublicLayout/PublicLayout.test.tsx +7 -3
- package/src/components/PublicLayout/PublicPageLayout.tsx +5 -8
- package/src/components/UserMenu/UserMenu.test.tsx +38 -6
- package/src/components/UserMenu/UserMenu.tsx +36 -34
- package/src/components/index.ts +3 -4
- package/src/hooks/useEventTheme.ts +4 -4
- package/src/hooks/useEvents.ts +11 -7
- package/src/hooks/useKeyboardShortcuts.ts +1 -1
- package/src/hooks/useOrganisationPermissions.ts +4 -4
- package/src/hooks/useOrganisations.ts +13 -7
- package/src/index.ts +11 -1
- package/src/rbac/README.md +20 -20
- package/src/rbac/hooks/useRBAC.test.ts +21 -3
- package/src/rbac/hooks/useRBAC.ts +4 -3
- package/src/rbac/hooks/useResourcePermissions.test.ts +125 -30
- package/src/rbac/hooks/useResourcePermissions.ts +57 -29
- package/src/rbac/permissions.ts +17 -17
- package/src/rbac/utils/contextValidator.ts +36 -0
- package/src/services/AuthService.ts +2 -5
- package/src/services/EventService.ts +99 -2
- package/src/services/InactivityService.ts +139 -58
- package/src/styles/core.css +4 -0
- package/src/utils/formatting/formatTime.test.ts +3 -2
- package/dist/chunk-6SOIHG6Z.js.map +0 -1
- package/dist/chunk-6Z7LTB3D.js.map +0 -1
- package/dist/chunk-DWUBLJJM.js.map +0 -1
- package/dist/chunk-HFZBI76P.js.map +0 -1
- package/dist/chunk-PQBSKX33.js.map +0 -1
- package/dist/chunk-YDQHOZNA.js.map +0 -1
- package/dist/chunk-ZNIWI3UC.js.map +0 -1
- /package/dist/{DataTable-THFPBKTP.js.map → DataTable-AOVNCPTX.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-KAGUYQ4J.js.map → UnifiedAuthProvider-4SBX4LU5.js.map} +0 -0
- /package/dist/{api-IAGWF3ZG.js.map → api-O6HTBX5Y.js.map} +0 -0
- /package/dist/{chunk-RWEBCB47.js.map → chunk-EFN2EIMK.js.map} +0 -0
- /package/dist/{contextValidator-3JNZKUTX.js.map → contextValidator-5OGXSPKS.js.map} +0 -0
|
@@ -14,9 +14,7 @@ import {
|
|
|
14
14
|
DialogContent,
|
|
15
15
|
DialogFooter,
|
|
16
16
|
DialogHeader,
|
|
17
|
-
DialogOverlay,
|
|
18
17
|
DialogTitle,
|
|
19
|
-
DialogTrigger,
|
|
20
18
|
Input,
|
|
21
19
|
Select,
|
|
22
20
|
SelectContent,
|
|
@@ -26,13 +24,13 @@ import {
|
|
|
26
24
|
SelectSeparator,
|
|
27
25
|
SelectTrigger,
|
|
28
26
|
SelectValue
|
|
29
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-IVOFDYWT.js";
|
|
30
28
|
import {
|
|
31
29
|
useCan,
|
|
32
30
|
usePermissions,
|
|
33
31
|
useRBAC,
|
|
34
32
|
useResolvedScope
|
|
35
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HU2C6SSC.js";
|
|
36
34
|
import {
|
|
37
35
|
createFileReferenceService,
|
|
38
36
|
generateFileUrlsBatch,
|
|
@@ -44,26 +42,30 @@ import {
|
|
|
44
42
|
useFileDisplay,
|
|
45
43
|
usePreventTabReload,
|
|
46
44
|
usePublicFileDisplay
|
|
47
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-UPPMRMYG.js";
|
|
48
46
|
import {
|
|
49
47
|
useToast
|
|
50
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-JGRYX5UX.js";
|
|
51
49
|
import {
|
|
52
50
|
ErrorBoundary,
|
|
53
51
|
PublicPageContext,
|
|
54
52
|
useAppConfig,
|
|
55
53
|
useEvents,
|
|
56
54
|
useIsPublicPage
|
|
57
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-NTM7ZSB6.js";
|
|
58
56
|
import {
|
|
59
57
|
EventServiceContext,
|
|
60
58
|
useOrganisations,
|
|
61
59
|
useSessionRestoration,
|
|
62
60
|
useUnifiedAuth
|
|
63
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-IHB5DR3H.js";
|
|
64
62
|
import {
|
|
65
63
|
isSuperAdmin
|
|
66
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-EFN2EIMK.js";
|
|
65
|
+
import {
|
|
66
|
+
EventContextRequiredError,
|
|
67
|
+
OrganisationContextRequiredError
|
|
68
|
+
} from "./chunk-AFVQODI2.js";
|
|
67
69
|
import {
|
|
68
70
|
assertAppId
|
|
69
71
|
} from "./chunk-QXHPKYJV.js";
|
|
@@ -734,8 +736,8 @@ var FileDisplayContent = React3.memo(function FileDisplayContent2({
|
|
|
734
736
|
children: "\xD7"
|
|
735
737
|
}
|
|
736
738
|
),
|
|
737
|
-
/* @__PURE__ */ jsx4(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { size: "sm", children: [
|
|
738
|
-
/* @__PURE__ */ jsx4(DialogHeader, { children: /* @__PURE__ */ jsx4(
|
|
739
|
+
/* @__PURE__ */ jsx4(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { size: "sm", title: "Confirm Delete", children: [
|
|
740
|
+
/* @__PURE__ */ jsx4(DialogHeader, { children: /* @__PURE__ */ jsx4("h2", { children: "Confirm Delete" }) }),
|
|
739
741
|
/* @__PURE__ */ jsx4(DialogBody, { children: /* @__PURE__ */ jsx4("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
740
742
|
/* @__PURE__ */ jsxs3(DialogFooter, { children: [
|
|
741
743
|
/* @__PURE__ */ jsx4(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
@@ -782,8 +784,8 @@ var FileDisplayContent = React3.memo(function FileDisplayContent2({
|
|
|
782
784
|
children: "\xD7"
|
|
783
785
|
}
|
|
784
786
|
),
|
|
785
|
-
/* @__PURE__ */ jsx4(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { size: "sm", children: [
|
|
786
|
-
/* @__PURE__ */ jsx4(DialogHeader, { children: /* @__PURE__ */ jsx4(
|
|
787
|
+
/* @__PURE__ */ jsx4(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { size: "sm", title: "Confirm Delete", children: [
|
|
788
|
+
/* @__PURE__ */ jsx4(DialogHeader, { children: /* @__PURE__ */ jsx4("h2", { children: "Confirm Delete" }) }),
|
|
787
789
|
/* @__PURE__ */ jsx4(DialogBody, { children: /* @__PURE__ */ jsx4("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
788
790
|
/* @__PURE__ */ jsxs3(DialogFooter, { children: [
|
|
789
791
|
/* @__PURE__ */ jsx4(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
@@ -2249,8 +2251,8 @@ function FormField({
|
|
|
2249
2251
|
className
|
|
2250
2252
|
}) {
|
|
2251
2253
|
const { control } = useFormContext();
|
|
2252
|
-
return /* @__PURE__ */ jsxs6("
|
|
2253
|
-
label && /* @__PURE__ */ jsxs6(
|
|
2254
|
+
return /* @__PURE__ */ jsxs6("label", { className: cn("space-y-2", className), children: [
|
|
2255
|
+
label && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
2254
2256
|
label,
|
|
2255
2257
|
validation?.required && /* @__PURE__ */ jsx11("span", { className: "text-destructive ml-1", "aria-label": "required", children: "*" })
|
|
2256
2258
|
] }),
|
|
@@ -2380,7 +2382,7 @@ var LoginForm = React9.memo(({
|
|
|
2380
2382
|
children: isLoading ? "Signing in..." : "Sign In"
|
|
2381
2383
|
}
|
|
2382
2384
|
),
|
|
2383
|
-
showSignUp && (onSignUp ? /* @__PURE__ */ jsx12("
|
|
2385
|
+
showSignUp && (onSignUp ? /* @__PURE__ */ jsx12("p", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx12(
|
|
2384
2386
|
"button",
|
|
2385
2387
|
{
|
|
2386
2388
|
type: "button",
|
|
@@ -2622,7 +2624,7 @@ function ContextSelector({
|
|
|
2622
2624
|
// src/components/PasswordChange/PasswordChangeForm.tsx
|
|
2623
2625
|
import { useState as useState8 } from "react";
|
|
2624
2626
|
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2625
|
-
function PasswordChangeForm({ onSubmit, className }) {
|
|
2627
|
+
function PasswordChangeForm({ onSubmit, onSuccess, className }) {
|
|
2626
2628
|
const [newPassword, setNewPassword] = useState8("");
|
|
2627
2629
|
const [confirmPassword, setConfirmPassword] = useState8("");
|
|
2628
2630
|
const [error, setError] = useState8(null);
|
|
@@ -2643,6 +2645,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2643
2645
|
const result = await onSubmit({ newPassword, confirmPassword });
|
|
2644
2646
|
if (result && result.error) {
|
|
2645
2647
|
setError(result.error.message || "Failed to change password.");
|
|
2648
|
+
} else {
|
|
2649
|
+
onSuccess?.();
|
|
2646
2650
|
}
|
|
2647
2651
|
} catch (err) {
|
|
2648
2652
|
const errorObj = err instanceof Error ? err : new Error("An unexpected error occurred");
|
|
@@ -2652,9 +2656,9 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2652
2656
|
}
|
|
2653
2657
|
};
|
|
2654
2658
|
return /* @__PURE__ */ jsxs9("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
2655
|
-
error && /* @__PURE__ */ jsx14("
|
|
2656
|
-
/* @__PURE__ */ jsxs9("
|
|
2657
|
-
|
|
2659
|
+
error && /* @__PURE__ */ jsx14("p", { className: "grid place-items-center text-center size-full", role: "alert", children: error }),
|
|
2660
|
+
/* @__PURE__ */ jsxs9(Label, { htmlFor: "new-password", className: "block mb-4", children: [
|
|
2661
|
+
"New Password",
|
|
2658
2662
|
/* @__PURE__ */ jsx14(
|
|
2659
2663
|
Input,
|
|
2660
2664
|
{
|
|
@@ -2663,12 +2667,13 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2663
2667
|
value: newPassword,
|
|
2664
2668
|
onChange: (e) => setNewPassword(e.target.value),
|
|
2665
2669
|
required: true,
|
|
2666
|
-
disabled: isSubmitting
|
|
2670
|
+
disabled: isSubmitting,
|
|
2671
|
+
className: "mt-2"
|
|
2667
2672
|
}
|
|
2668
2673
|
)
|
|
2669
2674
|
] }),
|
|
2670
|
-
/* @__PURE__ */ jsxs9("
|
|
2671
|
-
|
|
2675
|
+
/* @__PURE__ */ jsxs9(Label, { htmlFor: "confirm-password", className: "block mb-4", children: [
|
|
2676
|
+
"Confirm Password",
|
|
2672
2677
|
/* @__PURE__ */ jsx14(
|
|
2673
2678
|
Input,
|
|
2674
2679
|
{
|
|
@@ -2677,7 +2682,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2677
2682
|
value: confirmPassword,
|
|
2678
2683
|
onChange: (e) => setConfirmPassword(e.target.value),
|
|
2679
2684
|
required: true,
|
|
2680
|
-
disabled: isSubmitting
|
|
2685
|
+
disabled: isSubmitting,
|
|
2686
|
+
className: "mt-2"
|
|
2681
2687
|
}
|
|
2682
2688
|
)
|
|
2683
2689
|
] }),
|
|
@@ -2696,7 +2702,7 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2696
2702
|
// src/components/UserMenu/UserMenu.tsx
|
|
2697
2703
|
import React12, { useCallback as useCallback8, useMemo as useMemo6, useState as useState9 } from "react";
|
|
2698
2704
|
import { ChevronDown, LogOut, KeyRound } from "lucide-react";
|
|
2699
|
-
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2705
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2700
2706
|
var UserMenu = React12.memo(function UserMenu2({
|
|
2701
2707
|
user,
|
|
2702
2708
|
onSignOut,
|
|
@@ -2704,7 +2710,6 @@ var UserMenu = React12.memo(function UserMenu2({
|
|
|
2704
2710
|
className,
|
|
2705
2711
|
showAvatar = true
|
|
2706
2712
|
}) {
|
|
2707
|
-
const [isPasswordDialogOpen, setPasswordDialogOpen] = useState9(false);
|
|
2708
2713
|
const userInfo = useMemo6(() => {
|
|
2709
2714
|
if (!user) return null;
|
|
2710
2715
|
return {
|
|
@@ -2720,7 +2725,14 @@ var UserMenu = React12.memo(function UserMenu2({
|
|
|
2720
2725
|
if (!user || !userInfo) {
|
|
2721
2726
|
return null;
|
|
2722
2727
|
}
|
|
2723
|
-
|
|
2728
|
+
const [isPasswordDialogOpen, setPasswordDialogOpen] = useState9(false);
|
|
2729
|
+
const handlePasswordChange = useCallback8(async (newPassword, confirmPassword) => {
|
|
2730
|
+
if (!onChangePassword) {
|
|
2731
|
+
return { error: { message: "Password change not configured" } };
|
|
2732
|
+
}
|
|
2733
|
+
return await onChangePassword(newPassword, confirmPassword);
|
|
2734
|
+
}, [onChangePassword]);
|
|
2735
|
+
return /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
2724
2736
|
/* @__PURE__ */ jsxs10(Select, { className, children: [
|
|
2725
2737
|
/* @__PURE__ */ jsx15(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
|
|
2726
2738
|
showAvatar && /* @__PURE__ */ jsx15(
|
|
@@ -2739,38 +2751,38 @@ var UserMenu = React12.memo(function UserMenu2({
|
|
|
2739
2751
|
/* @__PURE__ */ jsx15(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs10("li", { className: "pt-2", children: [
|
|
2740
2752
|
userInfo.displayName,
|
|
2741
2753
|
/* @__PURE__ */ jsx15("br", {}),
|
|
2742
|
-
/* @__PURE__ */ jsx15("
|
|
2754
|
+
/* @__PURE__ */ jsx15("small", { children: userInfo.email })
|
|
2743
2755
|
] }) }),
|
|
2744
2756
|
/* @__PURE__ */ jsx15(SelectSeparator, {}),
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2757
|
+
/* @__PURE__ */ jsxs10(
|
|
2758
|
+
SelectItem,
|
|
2759
|
+
{
|
|
2760
|
+
value: "change-password",
|
|
2761
|
+
onClick: () => setPasswordDialogOpen(true),
|
|
2762
|
+
children: [
|
|
2763
|
+
/* @__PURE__ */ jsx15(KeyRound, { className: "inline-block mr-2 size-4" }),
|
|
2764
|
+
"Change Password"
|
|
2765
|
+
]
|
|
2766
|
+
}
|
|
2767
|
+
),
|
|
2749
2768
|
/* @__PURE__ */ jsxs10(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
|
|
2750
|
-
/* @__PURE__ */ jsx15(LogOut, { className: "mr-2 size-4" }),
|
|
2751
|
-
|
|
2769
|
+
/* @__PURE__ */ jsx15(LogOut, { className: "inline-block mr-2 size-4" }),
|
|
2770
|
+
"Sign out"
|
|
2752
2771
|
] })
|
|
2753
2772
|
] })
|
|
2754
2773
|
] }),
|
|
2755
|
-
/* @__PURE__ */ jsx15(
|
|
2756
|
-
/* @__PURE__ */ jsxs10(DialogContent, { className, children: [
|
|
2774
|
+
/* @__PURE__ */ jsx15(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: /* @__PURE__ */ jsxs10(DialogContent, { children: [
|
|
2757
2775
|
/* @__PURE__ */ jsx15(DialogHeader, { children: /* @__PURE__ */ jsx15(DialogTitle, { children: "Change Password" }) }),
|
|
2758
2776
|
/* @__PURE__ */ jsx15(
|
|
2759
2777
|
PasswordChangeForm,
|
|
2760
2778
|
{
|
|
2761
2779
|
onSubmit: async ({ newPassword, confirmPassword }) => {
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
setPasswordDialogOpen(false);
|
|
2766
|
-
}
|
|
2767
|
-
return { error };
|
|
2768
|
-
}
|
|
2769
|
-
return {};
|
|
2770
|
-
}
|
|
2780
|
+
return await handlePasswordChange(newPassword, confirmPassword);
|
|
2781
|
+
},
|
|
2782
|
+
onSuccess: () => setPasswordDialogOpen(false)
|
|
2771
2783
|
}
|
|
2772
2784
|
)
|
|
2773
|
-
] })
|
|
2785
|
+
] }) })
|
|
2774
2786
|
] });
|
|
2775
2787
|
});
|
|
2776
2788
|
var UserMenuLoading = React12.memo(function UserMenuLoading2() {
|
|
@@ -2841,7 +2853,7 @@ function useNavigationFiltering({
|
|
|
2841
2853
|
}
|
|
2842
2854
|
const userId2 = authContext.user.id;
|
|
2843
2855
|
const appName = authContext.appName;
|
|
2844
|
-
import("./api-
|
|
2856
|
+
import("./api-O6HTBX5Y.js").then(({ resolveAppContext }) => {
|
|
2845
2857
|
resolveAppContext({
|
|
2846
2858
|
userId: userId2,
|
|
2847
2859
|
appName
|
|
@@ -3084,7 +3096,7 @@ function useNavigationFiltering({
|
|
|
3084
3096
|
}
|
|
3085
3097
|
|
|
3086
3098
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
3087
|
-
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3099
|
+
import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3088
3100
|
var NavigationMenu = React14.forwardRef(({
|
|
3089
3101
|
items,
|
|
3090
3102
|
mode = "dropdown",
|
|
@@ -3227,7 +3239,7 @@ var NavigationMenu = React14.forwardRef(({
|
|
|
3227
3239
|
const hasChildren = item.children && item.children.length > 0;
|
|
3228
3240
|
const isExpanded = expandedItems.has(item.id);
|
|
3229
3241
|
const itemIsActive = isActiveItem(item);
|
|
3230
|
-
return /* @__PURE__ */ jsx16("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs11(
|
|
3242
|
+
return /* @__PURE__ */ jsx16("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
3231
3243
|
/* @__PURE__ */ jsxs11(
|
|
3232
3244
|
"button",
|
|
3233
3245
|
{
|
|
@@ -3422,7 +3434,7 @@ function Header({
|
|
|
3422
3434
|
|
|
3423
3435
|
// src/components/Footer/Footer.tsx
|
|
3424
3436
|
import React15 from "react";
|
|
3425
|
-
import { Fragment as
|
|
3437
|
+
import { Fragment as Fragment10, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3426
3438
|
var FooterComponent = ({
|
|
3427
3439
|
companyName = "Solvera Solutions Pty Ltd",
|
|
3428
3440
|
year = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
@@ -3435,7 +3447,7 @@ var FooterComponent = ({
|
|
|
3435
3447
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
3436
3448
|
return /* @__PURE__ */ jsx18("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs13("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
3437
3449
|
logo && /* @__PURE__ */ jsx18("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
3438
|
-
children && /* @__PURE__ */ jsx18(
|
|
3450
|
+
children && /* @__PURE__ */ jsx18(Fragment10, { children }),
|
|
3439
3451
|
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
3440
3452
|
links && links.length > 0 && /* @__PURE__ */ jsx18("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx18("li", { children: /* @__PURE__ */ jsx18("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
|
|
3441
3453
|
] }) });
|
|
@@ -3447,7 +3459,7 @@ Footer.displayName = "Footer";
|
|
|
3447
3459
|
// src/components/PaceAppLayout/PaceAppLayout.tsx
|
|
3448
3460
|
import { useState as useState12, useEffect as useEffect7, useMemo as useMemo8 } from "react";
|
|
3449
3461
|
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
3450
|
-
import { Fragment as
|
|
3462
|
+
import { Fragment as Fragment11, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3451
3463
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
3452
3464
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
3453
3465
|
function PaceAppLayout({
|
|
@@ -3591,6 +3603,12 @@ function PaceAppLayout({
|
|
|
3591
3603
|
);
|
|
3592
3604
|
const can = isSuperAdmin2 ? true : canFromHook;
|
|
3593
3605
|
const hasPermission = enforcePermissions ? can : true;
|
|
3606
|
+
const isContextError = useMemo8(() => {
|
|
3607
|
+
if (!permissionError) {
|
|
3608
|
+
return false;
|
|
3609
|
+
}
|
|
3610
|
+
return permissionError instanceof EventContextRequiredError || permissionError instanceof OrganisationContextRequiredError || permissionError.name === "EventContextRequiredError" || permissionError.name === "OrganisationContextRequiredError";
|
|
3611
|
+
}, [permissionError]);
|
|
3594
3612
|
useEffect7(() => {
|
|
3595
3613
|
if (!enforcePermissions) {
|
|
3596
3614
|
return;
|
|
@@ -3641,7 +3659,7 @@ function PaceAppLayout({
|
|
|
3641
3659
|
return;
|
|
3642
3660
|
}
|
|
3643
3661
|
try {
|
|
3644
|
-
const { isSuperAdmin: checkSuperAdminDynamic } = await import("./api-
|
|
3662
|
+
const { isSuperAdmin: checkSuperAdminDynamic } = await import("./api-O6HTBX5Y.js");
|
|
3645
3663
|
const isSuper = await checkSuperAdminDynamic(user.id);
|
|
3646
3664
|
if (isSuper) {
|
|
3647
3665
|
if (isMounted) {
|
|
@@ -3656,7 +3674,7 @@ function PaceAppLayout({
|
|
|
3656
3674
|
}
|
|
3657
3675
|
}
|
|
3658
3676
|
try {
|
|
3659
|
-
const { getPermissionMap } = await import("./api-
|
|
3677
|
+
const { getPermissionMap } = await import("./api-O6HTBX5Y.js");
|
|
3660
3678
|
const permissionScope = {
|
|
3661
3679
|
organisationId: currentScope.organisationId,
|
|
3662
3680
|
eventId: currentScope.eventId,
|
|
@@ -3667,7 +3685,7 @@ function PaceAppLayout({
|
|
|
3667
3685
|
userId: user.id,
|
|
3668
3686
|
scope: permissionScope
|
|
3669
3687
|
});
|
|
3670
|
-
const { getPageScopeType } = await import("./api-
|
|
3688
|
+
const { getPageScopeType } = await import("./api-O6HTBX5Y.js");
|
|
3671
3689
|
const effectiveAppId = currentScope.appId || resolvedAppId;
|
|
3672
3690
|
const effectiveAppName = appName;
|
|
3673
3691
|
const hasEventContext = !!currentScope.eventId;
|
|
@@ -3776,7 +3794,7 @@ function PaceAppLayout({
|
|
|
3776
3794
|
let hasAccess = true;
|
|
3777
3795
|
if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
|
|
3778
3796
|
try {
|
|
3779
|
-
const { isPermittedCached } = await import("./api-
|
|
3797
|
+
const { isPermittedCached } = await import("./api-O6HTBX5Y.js");
|
|
3780
3798
|
const hasPagePermission = await isPermittedCached({
|
|
3781
3799
|
userId: user?.id || "",
|
|
3782
3800
|
scope,
|
|
@@ -3792,7 +3810,7 @@ function PaceAppLayout({
|
|
|
3792
3810
|
}
|
|
3793
3811
|
}
|
|
3794
3812
|
if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
|
|
3795
|
-
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-
|
|
3813
|
+
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-4SBX4LU5.js");
|
|
3796
3814
|
hasAccess = true;
|
|
3797
3815
|
}
|
|
3798
3816
|
if (!isMounted) return;
|
|
@@ -3853,51 +3871,61 @@ function PaceAppLayout({
|
|
|
3853
3871
|
}
|
|
3854
3872
|
};
|
|
3855
3873
|
if (user?.id && organisationLoading && !isSuperAdmin2 && !isCheckingSuperAdminDirect && !rbacLoading && !selectedOrganisationId) {
|
|
3856
|
-
return /* @__PURE__ */
|
|
3857
|
-
/* @__PURE__ */ jsx19(
|
|
3858
|
-
|
|
3859
|
-
|
|
3874
|
+
return /* @__PURE__ */ jsxs14("p", { className: "grid place-items-center text-center size-full", children: [
|
|
3875
|
+
/* @__PURE__ */ jsx19(
|
|
3876
|
+
LoadingSpinner,
|
|
3877
|
+
{
|
|
3878
|
+
size: "lg"
|
|
3879
|
+
}
|
|
3880
|
+
),
|
|
3881
|
+
/* @__PURE__ */ jsx19("br", {}),
|
|
3882
|
+
"Loading organisation context..."
|
|
3883
|
+
] });
|
|
3860
3884
|
}
|
|
3861
3885
|
if (enforcePermissions && isCheckingPermission) {
|
|
3862
|
-
return /* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */ jsx19(
|
|
3864
|
-
|
|
3865
|
-
|
|
3886
|
+
return /* @__PURE__ */ jsxs14("p", { className: "grid place-items-center text-center size-full", children: [
|
|
3887
|
+
/* @__PURE__ */ jsx19(
|
|
3888
|
+
LoadingSpinner,
|
|
3889
|
+
{
|
|
3890
|
+
size: "lg"
|
|
3891
|
+
}
|
|
3892
|
+
),
|
|
3893
|
+
/* @__PURE__ */ jsx19("br", {}),
|
|
3894
|
+
"Checking permissions..."
|
|
3895
|
+
] });
|
|
3866
3896
|
}
|
|
3867
|
-
if (enforcePermissions && permissionError && !isSuperAdmin2) {
|
|
3868
|
-
return /* @__PURE__ */
|
|
3869
|
-
/* @__PURE__ */ jsx19("h2", {
|
|
3870
|
-
/* @__PURE__ */ jsx19("p", {
|
|
3897
|
+
if (enforcePermissions && permissionError && !isSuperAdmin2 && !isContextError) {
|
|
3898
|
+
return /* @__PURE__ */ jsxs14("hgroup", { className: "grid place-items-center text-center size-full", children: [
|
|
3899
|
+
/* @__PURE__ */ jsx19("h2", { children: "Permission Error" }),
|
|
3900
|
+
/* @__PURE__ */ jsx19("p", { children: permissionError.message }),
|
|
3871
3901
|
/* @__PURE__ */ jsx19(Button, { onClick: () => navigate("/"), children: "Go Home" })
|
|
3872
|
-
] })
|
|
3902
|
+
] });
|
|
3873
3903
|
}
|
|
3874
|
-
if (enforcePermissions && hasPermission === false && !isCheckingSuperAdminDirect && !isSuperAdmin2) {
|
|
3904
|
+
if (enforcePermissions && hasPermission === false && !isCheckingSuperAdminDirect && !isSuperAdmin2 && !isContextError) {
|
|
3875
3905
|
if (enforcePagePermissions && pagePermissionFallback) {
|
|
3876
|
-
return /* @__PURE__ */ jsx19(
|
|
3906
|
+
return /* @__PURE__ */ jsx19(Fragment11, { children: pagePermissionFallback });
|
|
3877
3907
|
}
|
|
3878
3908
|
if (permissionFallback) {
|
|
3879
|
-
return /* @__PURE__ */ jsx19(
|
|
3880
|
-
}
|
|
3881
|
-
return /* @__PURE__ */
|
|
3882
|
-
/* @__PURE__ */ jsx19("h2", {
|
|
3883
|
-
/* @__PURE__ */ jsx19("p", {
|
|
3884
|
-
/* @__PURE__ */
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
] })
|
|
3898
|
-
] }) });
|
|
3909
|
+
return /* @__PURE__ */ jsx19(Fragment11, { children: permissionFallback });
|
|
3910
|
+
}
|
|
3911
|
+
return /* @__PURE__ */ jsxs14("hgroup", { className: "grid place-items-center text-center size-full", children: [
|
|
3912
|
+
/* @__PURE__ */ jsx19("h2", { children: "Access Denied" }),
|
|
3913
|
+
/* @__PURE__ */ jsx19("p", { children: "You don't have permission to access this page." }),
|
|
3914
|
+
/* @__PURE__ */ jsx19(Button, { onClick: () => navigate("/"), children: "Go Home" }),
|
|
3915
|
+
/* @__PURE__ */ jsx19(
|
|
3916
|
+
Button,
|
|
3917
|
+
{
|
|
3918
|
+
variant: "outline",
|
|
3919
|
+
onClick: async () => {
|
|
3920
|
+
await handleSignOut();
|
|
3921
|
+
navigate("/login");
|
|
3922
|
+
},
|
|
3923
|
+
children: "Sign out"
|
|
3924
|
+
}
|
|
3925
|
+
)
|
|
3926
|
+
] });
|
|
3899
3927
|
}
|
|
3900
|
-
return /* @__PURE__ */ jsxs14(
|
|
3928
|
+
return /* @__PURE__ */ jsxs14(Fragment11, { children: [
|
|
3901
3929
|
/* @__PURE__ */ jsx19(
|
|
3902
3930
|
Header,
|
|
3903
3931
|
{
|
|
@@ -4246,7 +4274,7 @@ function ProtectedRoute({
|
|
|
4246
4274
|
|
|
4247
4275
|
// src/components/FileUpload/FileUpload.tsx
|
|
4248
4276
|
import { useState as useState15, useCallback as useCallback10, useRef as useRef9, useEffect as useEffect10, useMemo as useMemo10 } from "react";
|
|
4249
|
-
import { Fragment as
|
|
4277
|
+
import { Fragment as Fragment12, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4250
4278
|
function FileUpload({
|
|
4251
4279
|
supabase,
|
|
4252
4280
|
table_name,
|
|
@@ -4623,7 +4651,7 @@ function FileUpload({
|
|
|
4623
4651
|
"aria-label": accept ? `Upload file${multiple ? "s" : ""} (${accept})` : `Upload file${multiple ? "s" : ""}`
|
|
4624
4652
|
}
|
|
4625
4653
|
),
|
|
4626
|
-
/* @__PURE__ */ jsx23("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs18(
|
|
4654
|
+
/* @__PURE__ */ jsx23("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs18(Fragment12, { children: [
|
|
4627
4655
|
/* @__PURE__ */ jsx23("span", { className: "font-medium", children: "Click to upload" }),
|
|
4628
4656
|
" ",
|
|
4629
4657
|
"or drag and drop"
|
|
@@ -4807,7 +4835,7 @@ var TableCaption = React20.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4807
4835
|
TableCaption.displayName = "TableCaption";
|
|
4808
4836
|
|
|
4809
4837
|
// src/components/PublicLayout/PublicPageLayout.tsx
|
|
4810
|
-
import { Fragment as
|
|
4838
|
+
import { Fragment as Fragment13, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4811
4839
|
function PublicPageHeader({
|
|
4812
4840
|
event,
|
|
4813
4841
|
eventCode,
|
|
@@ -4832,9 +4860,9 @@ function PublicPageHeader({
|
|
|
4832
4860
|
alt: appName
|
|
4833
4861
|
}
|
|
4834
4862
|
),
|
|
4835
|
-
event && /* @__PURE__ */ jsxs19(
|
|
4863
|
+
event && /* @__PURE__ */ jsxs19(Fragment13, { children: [
|
|
4836
4864
|
/* @__PURE__ */ jsx25("h1", { children: event.event_name }),
|
|
4837
|
-
showEventLogo && event && /* @__PURE__ */ jsx25(
|
|
4865
|
+
showEventLogo && event && /* @__PURE__ */ jsx25(Fragment13, { children: customEventLogo || /* @__PURE__ */ jsx25(
|
|
4838
4866
|
FileDisplay,
|
|
4839
4867
|
{
|
|
4840
4868
|
table_name: "event",
|
|
@@ -4853,11 +4881,11 @@ function PublicPageHeader({
|
|
|
4853
4881
|
) }),
|
|
4854
4882
|
event.event_venue && /* @__PURE__ */ jsx25("h4", { children: event.event_venue })
|
|
4855
4883
|
] }),
|
|
4856
|
-
title && /* @__PURE__ */ jsxs19(
|
|
4884
|
+
title && /* @__PURE__ */ jsxs19(Fragment13, { children: [
|
|
4857
4885
|
/* @__PURE__ */ jsx25("h1", { children: title }),
|
|
4858
4886
|
description && /* @__PURE__ */ jsx25("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
|
|
4859
4887
|
] }),
|
|
4860
|
-
children && /* @__PURE__ */ jsx25(
|
|
4888
|
+
children && /* @__PURE__ */ jsx25(Fragment13, { children })
|
|
4861
4889
|
] });
|
|
4862
4890
|
}
|
|
4863
4891
|
function PublicPageFooter({
|
|
@@ -4873,7 +4901,7 @@ function PublicPageFooter({
|
|
|
4873
4901
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
4874
4902
|
return /* @__PURE__ */ jsx25("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs19("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
4875
4903
|
logo && /* @__PURE__ */ jsx25("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
4876
|
-
children && /* @__PURE__ */ jsx25(
|
|
4904
|
+
children && /* @__PURE__ */ jsx25(Fragment13, { children }),
|
|
4877
4905
|
/* @__PURE__ */ jsx25("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
4878
4906
|
links && links.length > 0 && /* @__PURE__ */ jsx25("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx25("li", { children: /* @__PURE__ */ jsx25("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
|
|
4879
4907
|
] }) });
|
|
@@ -4900,10 +4928,16 @@ function PublicPageLayout({
|
|
|
4900
4928
|
if (LoadingFallback) {
|
|
4901
4929
|
return /* @__PURE__ */ jsx25(LoadingFallback, {});
|
|
4902
4930
|
}
|
|
4903
|
-
return /* @__PURE__ */
|
|
4904
|
-
/* @__PURE__ */ jsx25(
|
|
4905
|
-
|
|
4906
|
-
|
|
4931
|
+
return /* @__PURE__ */ jsxs19("p", { className: "grid place-items-center text-center size-full", children: [
|
|
4932
|
+
/* @__PURE__ */ jsx25(
|
|
4933
|
+
LoadingSpinner,
|
|
4934
|
+
{
|
|
4935
|
+
size: "lg"
|
|
4936
|
+
}
|
|
4937
|
+
),
|
|
4938
|
+
/* @__PURE__ */ jsx25("br", {}),
|
|
4939
|
+
loadingMessage || "Loading..."
|
|
4940
|
+
] });
|
|
4907
4941
|
}
|
|
4908
4942
|
if (error && showValidationErrors) {
|
|
4909
4943
|
if (ErrorFallback) {
|
|
@@ -4926,7 +4960,7 @@ function PublicPageLayout({
|
|
|
4926
4960
|
handleRefetch && /* @__PURE__ */ jsx25(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4927
4961
|
] });
|
|
4928
4962
|
}
|
|
4929
|
-
return /* @__PURE__ */ jsx25(ErrorBoundary, { componentName: "PublicPageLayout", children: /* @__PURE__ */ jsxs19(
|
|
4963
|
+
return /* @__PURE__ */ jsx25(ErrorBoundary, { componentName: "PublicPageLayout", children: /* @__PURE__ */ jsxs19(Fragment13, { children: [
|
|
4930
4964
|
customHeader || /* @__PURE__ */ jsx25(
|
|
4931
4965
|
PublicPageHeader,
|
|
4932
4966
|
{
|
|
@@ -4990,4 +5024,4 @@ export {
|
|
|
4990
5024
|
PublicPageFooter,
|
|
4991
5025
|
PublicPageLayout
|
|
4992
5026
|
};
|
|
4993
|
-
//# sourceMappingURL=chunk-
|
|
5027
|
+
//# sourceMappingURL=chunk-6COVEUS7.js.map
|