@jmruthers/pace-core 0.6.4 → 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-E7YQZD7D.js → DataTable-AOVNCPTX.js} +8 -8
- package/dist/{PublicPageProvider-DEMpysFR.d.ts → PublicPageProvider-QTFVrL-Z.d.ts} +65 -83
- package/dist/{UnifiedAuthProvider-QPXO24B4.js → UnifiedAuthProvider-4SBX4LU5.js} +4 -4
- package/dist/{api-6LVZTHDS.js → api-O6HTBX5Y.js} +3 -3
- package/dist/{chunk-I6DAQMWX.js → chunk-6COVEUS7.js} +130 -106
- package/dist/chunk-6COVEUS7.js.map +1 -0
- package/dist/{chunk-36LVWXB2.js → chunk-AFVQODI2.js} +37 -1
- package/dist/{chunk-36LVWXB2.js.map → chunk-AFVQODI2.js.map} +1 -1
- package/dist/{chunk-3LPHPB62.js → chunk-EFN2EIMK.js} +2 -2
- package/dist/{chunk-ATKZM7RX.js → chunk-G7QEZTYQ.js} +31 -31
- package/dist/{chunk-ATKZM7RX.js.map → chunk-G7QEZTYQ.js.map} +1 -1
- package/dist/{chunk-NN6WWZ5U.js → chunk-HU2C6SSC.js} +29 -18
- package/dist/chunk-HU2C6SSC.js.map +1 -0
- package/dist/{chunk-AVMLPIM7.js → chunk-IHB5DR3H.js} +102 -51
- package/dist/chunk-IHB5DR3H.js.map +1 -0
- package/dist/{chunk-7JPAB3T5.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-OEWDTMG7.js → chunk-NTM7ZSB6.js} +4 -4
- package/dist/chunk-NTM7ZSB6.js.map +1 -0
- package/dist/{chunk-5EC5MEWX.js → chunk-RGAWHO7N.js} +4 -4
- package/dist/chunk-RGAWHO7N.js.map +1 -0
- package/dist/{chunk-YKRAFF5K.js → chunk-UPPMRMYG.js} +3 -3
- package/dist/{chunk-YKRAFF5K.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-OOPCLPZW.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 +1 -2
- 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 +32 -39
- 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/InactivityService.ts +139 -58
- package/src/styles/core.css +4 -0
- package/src/utils/formatting/formatTime.test.ts +3 -2
- package/dist/chunk-5EC5MEWX.js.map +0 -1
- package/dist/chunk-6SOIHG6Z.js.map +0 -1
- package/dist/chunk-7JPAB3T5.js.map +0 -1
- package/dist/chunk-AVMLPIM7.js.map +0 -1
- package/dist/chunk-I6DAQMWX.js.map +0 -1
- package/dist/chunk-NN6WWZ5U.js.map +0 -1
- package/dist/chunk-OEWDTMG7.js.map +0 -1
- /package/dist/{DataTable-E7YQZD7D.js.map → DataTable-AOVNCPTX.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-QPXO24B4.js.map → UnifiedAuthProvider-4SBX4LU5.js.map} +0 -0
- /package/dist/{api-6LVZTHDS.js.map → api-O6HTBX5Y.js.map} +0 -0
- /package/dist/{chunk-3LPHPB62.js.map → chunk-EFN2EIMK.js.map} +0 -0
- /package/dist/{contextValidator-OOPCLPZW.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,30 +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";
|
|
67
65
|
import {
|
|
68
66
|
EventContextRequiredError,
|
|
69
67
|
OrganisationContextRequiredError
|
|
70
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-AFVQODI2.js";
|
|
71
69
|
import {
|
|
72
70
|
assertAppId
|
|
73
71
|
} from "./chunk-QXHPKYJV.js";
|
|
@@ -738,8 +736,8 @@ var FileDisplayContent = React3.memo(function FileDisplayContent2({
|
|
|
738
736
|
children: "\xD7"
|
|
739
737
|
}
|
|
740
738
|
),
|
|
741
|
-
/* @__PURE__ */ jsx4(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { size: "sm", children: [
|
|
742
|
-
/* @__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" }) }),
|
|
743
741
|
/* @__PURE__ */ jsx4(DialogBody, { children: /* @__PURE__ */ jsx4("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
744
742
|
/* @__PURE__ */ jsxs3(DialogFooter, { children: [
|
|
745
743
|
/* @__PURE__ */ jsx4(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
@@ -786,8 +784,8 @@ var FileDisplayContent = React3.memo(function FileDisplayContent2({
|
|
|
786
784
|
children: "\xD7"
|
|
787
785
|
}
|
|
788
786
|
),
|
|
789
|
-
/* @__PURE__ */ jsx4(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { size: "sm", children: [
|
|
790
|
-
/* @__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" }) }),
|
|
791
789
|
/* @__PURE__ */ jsx4(DialogBody, { children: /* @__PURE__ */ jsx4("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
792
790
|
/* @__PURE__ */ jsxs3(DialogFooter, { children: [
|
|
793
791
|
/* @__PURE__ */ jsx4(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
@@ -2253,8 +2251,8 @@ function FormField({
|
|
|
2253
2251
|
className
|
|
2254
2252
|
}) {
|
|
2255
2253
|
const { control } = useFormContext();
|
|
2256
|
-
return /* @__PURE__ */ jsxs6("
|
|
2257
|
-
label && /* @__PURE__ */ jsxs6(
|
|
2254
|
+
return /* @__PURE__ */ jsxs6("label", { className: cn("space-y-2", className), children: [
|
|
2255
|
+
label && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
2258
2256
|
label,
|
|
2259
2257
|
validation?.required && /* @__PURE__ */ jsx11("span", { className: "text-destructive ml-1", "aria-label": "required", children: "*" })
|
|
2260
2258
|
] }),
|
|
@@ -2384,7 +2382,7 @@ var LoginForm = React9.memo(({
|
|
|
2384
2382
|
children: isLoading ? "Signing in..." : "Sign In"
|
|
2385
2383
|
}
|
|
2386
2384
|
),
|
|
2387
|
-
showSignUp && (onSignUp ? /* @__PURE__ */ jsx12("
|
|
2385
|
+
showSignUp && (onSignUp ? /* @__PURE__ */ jsx12("p", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx12(
|
|
2388
2386
|
"button",
|
|
2389
2387
|
{
|
|
2390
2388
|
type: "button",
|
|
@@ -2626,7 +2624,7 @@ function ContextSelector({
|
|
|
2626
2624
|
// src/components/PasswordChange/PasswordChangeForm.tsx
|
|
2627
2625
|
import { useState as useState8 } from "react";
|
|
2628
2626
|
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2629
|
-
function PasswordChangeForm({ onSubmit, className }) {
|
|
2627
|
+
function PasswordChangeForm({ onSubmit, onSuccess, className }) {
|
|
2630
2628
|
const [newPassword, setNewPassword] = useState8("");
|
|
2631
2629
|
const [confirmPassword, setConfirmPassword] = useState8("");
|
|
2632
2630
|
const [error, setError] = useState8(null);
|
|
@@ -2647,6 +2645,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2647
2645
|
const result = await onSubmit({ newPassword, confirmPassword });
|
|
2648
2646
|
if (result && result.error) {
|
|
2649
2647
|
setError(result.error.message || "Failed to change password.");
|
|
2648
|
+
} else {
|
|
2649
|
+
onSuccess?.();
|
|
2650
2650
|
}
|
|
2651
2651
|
} catch (err) {
|
|
2652
2652
|
const errorObj = err instanceof Error ? err : new Error("An unexpected error occurred");
|
|
@@ -2656,9 +2656,9 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2656
2656
|
}
|
|
2657
2657
|
};
|
|
2658
2658
|
return /* @__PURE__ */ jsxs9("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
2659
|
-
error && /* @__PURE__ */ jsx14("
|
|
2660
|
-
/* @__PURE__ */ jsxs9("
|
|
2661
|
-
|
|
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",
|
|
2662
2662
|
/* @__PURE__ */ jsx14(
|
|
2663
2663
|
Input,
|
|
2664
2664
|
{
|
|
@@ -2667,12 +2667,13 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2667
2667
|
value: newPassword,
|
|
2668
2668
|
onChange: (e) => setNewPassword(e.target.value),
|
|
2669
2669
|
required: true,
|
|
2670
|
-
disabled: isSubmitting
|
|
2670
|
+
disabled: isSubmitting,
|
|
2671
|
+
className: "mt-2"
|
|
2671
2672
|
}
|
|
2672
2673
|
)
|
|
2673
2674
|
] }),
|
|
2674
|
-
/* @__PURE__ */ jsxs9("
|
|
2675
|
-
|
|
2675
|
+
/* @__PURE__ */ jsxs9(Label, { htmlFor: "confirm-password", className: "block mb-4", children: [
|
|
2676
|
+
"Confirm Password",
|
|
2676
2677
|
/* @__PURE__ */ jsx14(
|
|
2677
2678
|
Input,
|
|
2678
2679
|
{
|
|
@@ -2681,7 +2682,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2681
2682
|
value: confirmPassword,
|
|
2682
2683
|
onChange: (e) => setConfirmPassword(e.target.value),
|
|
2683
2684
|
required: true,
|
|
2684
|
-
disabled: isSubmitting
|
|
2685
|
+
disabled: isSubmitting,
|
|
2686
|
+
className: "mt-2"
|
|
2685
2687
|
}
|
|
2686
2688
|
)
|
|
2687
2689
|
] }),
|
|
@@ -2700,7 +2702,7 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
2700
2702
|
// src/components/UserMenu/UserMenu.tsx
|
|
2701
2703
|
import React12, { useCallback as useCallback8, useMemo as useMemo6, useState as useState9 } from "react";
|
|
2702
2704
|
import { ChevronDown, LogOut, KeyRound } from "lucide-react";
|
|
2703
|
-
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";
|
|
2704
2706
|
var UserMenu = React12.memo(function UserMenu2({
|
|
2705
2707
|
user,
|
|
2706
2708
|
onSignOut,
|
|
@@ -2708,7 +2710,6 @@ var UserMenu = React12.memo(function UserMenu2({
|
|
|
2708
2710
|
className,
|
|
2709
2711
|
showAvatar = true
|
|
2710
2712
|
}) {
|
|
2711
|
-
const [isPasswordDialogOpen, setPasswordDialogOpen] = useState9(false);
|
|
2712
2713
|
const userInfo = useMemo6(() => {
|
|
2713
2714
|
if (!user) return null;
|
|
2714
2715
|
return {
|
|
@@ -2724,7 +2725,14 @@ var UserMenu = React12.memo(function UserMenu2({
|
|
|
2724
2725
|
if (!user || !userInfo) {
|
|
2725
2726
|
return null;
|
|
2726
2727
|
}
|
|
2727
|
-
|
|
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: [
|
|
2728
2736
|
/* @__PURE__ */ jsxs10(Select, { className, children: [
|
|
2729
2737
|
/* @__PURE__ */ jsx15(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
|
|
2730
2738
|
showAvatar && /* @__PURE__ */ jsx15(
|
|
@@ -2743,38 +2751,38 @@ var UserMenu = React12.memo(function UserMenu2({
|
|
|
2743
2751
|
/* @__PURE__ */ jsx15(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs10("li", { className: "pt-2", children: [
|
|
2744
2752
|
userInfo.displayName,
|
|
2745
2753
|
/* @__PURE__ */ jsx15("br", {}),
|
|
2746
|
-
/* @__PURE__ */ jsx15("
|
|
2754
|
+
/* @__PURE__ */ jsx15("small", { children: userInfo.email })
|
|
2747
2755
|
] }) }),
|
|
2748
2756
|
/* @__PURE__ */ jsx15(SelectSeparator, {}),
|
|
2749
|
-
/* @__PURE__ */
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
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
|
+
),
|
|
2753
2768
|
/* @__PURE__ */ jsxs10(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
|
|
2754
|
-
/* @__PURE__ */ jsx15(LogOut, { className: "mr-2 size-4" }),
|
|
2755
|
-
|
|
2769
|
+
/* @__PURE__ */ jsx15(LogOut, { className: "inline-block mr-2 size-4" }),
|
|
2770
|
+
"Sign out"
|
|
2756
2771
|
] })
|
|
2757
2772
|
] })
|
|
2758
2773
|
] }),
|
|
2759
|
-
/* @__PURE__ */ jsx15(
|
|
2760
|
-
/* @__PURE__ */ jsxs10(DialogContent, { className, children: [
|
|
2774
|
+
/* @__PURE__ */ jsx15(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: /* @__PURE__ */ jsxs10(DialogContent, { children: [
|
|
2761
2775
|
/* @__PURE__ */ jsx15(DialogHeader, { children: /* @__PURE__ */ jsx15(DialogTitle, { children: "Change Password" }) }),
|
|
2762
2776
|
/* @__PURE__ */ jsx15(
|
|
2763
2777
|
PasswordChangeForm,
|
|
2764
2778
|
{
|
|
2765
2779
|
onSubmit: async ({ newPassword, confirmPassword }) => {
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
setPasswordDialogOpen(false);
|
|
2770
|
-
}
|
|
2771
|
-
return { error };
|
|
2772
|
-
}
|
|
2773
|
-
return {};
|
|
2774
|
-
}
|
|
2780
|
+
return await handlePasswordChange(newPassword, confirmPassword);
|
|
2781
|
+
},
|
|
2782
|
+
onSuccess: () => setPasswordDialogOpen(false)
|
|
2775
2783
|
}
|
|
2776
2784
|
)
|
|
2777
|
-
] })
|
|
2785
|
+
] }) })
|
|
2778
2786
|
] });
|
|
2779
2787
|
});
|
|
2780
2788
|
var UserMenuLoading = React12.memo(function UserMenuLoading2() {
|
|
@@ -2845,7 +2853,7 @@ function useNavigationFiltering({
|
|
|
2845
2853
|
}
|
|
2846
2854
|
const userId2 = authContext.user.id;
|
|
2847
2855
|
const appName = authContext.appName;
|
|
2848
|
-
import("./api-
|
|
2856
|
+
import("./api-O6HTBX5Y.js").then(({ resolveAppContext }) => {
|
|
2849
2857
|
resolveAppContext({
|
|
2850
2858
|
userId: userId2,
|
|
2851
2859
|
appName
|
|
@@ -3088,7 +3096,7 @@ function useNavigationFiltering({
|
|
|
3088
3096
|
}
|
|
3089
3097
|
|
|
3090
3098
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
3091
|
-
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";
|
|
3092
3100
|
var NavigationMenu = React14.forwardRef(({
|
|
3093
3101
|
items,
|
|
3094
3102
|
mode = "dropdown",
|
|
@@ -3231,7 +3239,7 @@ var NavigationMenu = React14.forwardRef(({
|
|
|
3231
3239
|
const hasChildren = item.children && item.children.length > 0;
|
|
3232
3240
|
const isExpanded = expandedItems.has(item.id);
|
|
3233
3241
|
const itemIsActive = isActiveItem(item);
|
|
3234
|
-
return /* @__PURE__ */ jsx16("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs11(
|
|
3242
|
+
return /* @__PURE__ */ jsx16("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
3235
3243
|
/* @__PURE__ */ jsxs11(
|
|
3236
3244
|
"button",
|
|
3237
3245
|
{
|
|
@@ -3426,7 +3434,7 @@ function Header({
|
|
|
3426
3434
|
|
|
3427
3435
|
// src/components/Footer/Footer.tsx
|
|
3428
3436
|
import React15 from "react";
|
|
3429
|
-
import { Fragment as
|
|
3437
|
+
import { Fragment as Fragment10, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3430
3438
|
var FooterComponent = ({
|
|
3431
3439
|
companyName = "Solvera Solutions Pty Ltd",
|
|
3432
3440
|
year = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
@@ -3439,7 +3447,7 @@ var FooterComponent = ({
|
|
|
3439
3447
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
3440
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: [
|
|
3441
3449
|
logo && /* @__PURE__ */ jsx18("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
3442
|
-
children && /* @__PURE__ */ jsx18(
|
|
3450
|
+
children && /* @__PURE__ */ jsx18(Fragment10, { children }),
|
|
3443
3451
|
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
3444
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)) })
|
|
3445
3453
|
] }) });
|
|
@@ -3451,7 +3459,7 @@ Footer.displayName = "Footer";
|
|
|
3451
3459
|
// src/components/PaceAppLayout/PaceAppLayout.tsx
|
|
3452
3460
|
import { useState as useState12, useEffect as useEffect7, useMemo as useMemo8 } from "react";
|
|
3453
3461
|
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
3454
|
-
import { Fragment as
|
|
3462
|
+
import { Fragment as Fragment11, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3455
3463
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
3456
3464
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
3457
3465
|
function PaceAppLayout({
|
|
@@ -3651,7 +3659,7 @@ function PaceAppLayout({
|
|
|
3651
3659
|
return;
|
|
3652
3660
|
}
|
|
3653
3661
|
try {
|
|
3654
|
-
const { isSuperAdmin: checkSuperAdminDynamic } = await import("./api-
|
|
3662
|
+
const { isSuperAdmin: checkSuperAdminDynamic } = await import("./api-O6HTBX5Y.js");
|
|
3655
3663
|
const isSuper = await checkSuperAdminDynamic(user.id);
|
|
3656
3664
|
if (isSuper) {
|
|
3657
3665
|
if (isMounted) {
|
|
@@ -3666,7 +3674,7 @@ function PaceAppLayout({
|
|
|
3666
3674
|
}
|
|
3667
3675
|
}
|
|
3668
3676
|
try {
|
|
3669
|
-
const { getPermissionMap } = await import("./api-
|
|
3677
|
+
const { getPermissionMap } = await import("./api-O6HTBX5Y.js");
|
|
3670
3678
|
const permissionScope = {
|
|
3671
3679
|
organisationId: currentScope.organisationId,
|
|
3672
3680
|
eventId: currentScope.eventId,
|
|
@@ -3677,7 +3685,7 @@ function PaceAppLayout({
|
|
|
3677
3685
|
userId: user.id,
|
|
3678
3686
|
scope: permissionScope
|
|
3679
3687
|
});
|
|
3680
|
-
const { getPageScopeType } = await import("./api-
|
|
3688
|
+
const { getPageScopeType } = await import("./api-O6HTBX5Y.js");
|
|
3681
3689
|
const effectiveAppId = currentScope.appId || resolvedAppId;
|
|
3682
3690
|
const effectiveAppName = appName;
|
|
3683
3691
|
const hasEventContext = !!currentScope.eventId;
|
|
@@ -3786,7 +3794,7 @@ function PaceAppLayout({
|
|
|
3786
3794
|
let hasAccess = true;
|
|
3787
3795
|
if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
|
|
3788
3796
|
try {
|
|
3789
|
-
const { isPermittedCached } = await import("./api-
|
|
3797
|
+
const { isPermittedCached } = await import("./api-O6HTBX5Y.js");
|
|
3790
3798
|
const hasPagePermission = await isPermittedCached({
|
|
3791
3799
|
userId: user?.id || "",
|
|
3792
3800
|
scope,
|
|
@@ -3802,7 +3810,7 @@ function PaceAppLayout({
|
|
|
3802
3810
|
}
|
|
3803
3811
|
}
|
|
3804
3812
|
if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
|
|
3805
|
-
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-
|
|
3813
|
+
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-4SBX4LU5.js");
|
|
3806
3814
|
hasAccess = true;
|
|
3807
3815
|
}
|
|
3808
3816
|
if (!isMounted) return;
|
|
@@ -3863,51 +3871,61 @@ function PaceAppLayout({
|
|
|
3863
3871
|
}
|
|
3864
3872
|
};
|
|
3865
3873
|
if (user?.id && organisationLoading && !isSuperAdmin2 && !isCheckingSuperAdminDirect && !rbacLoading && !selectedOrganisationId) {
|
|
3866
|
-
return /* @__PURE__ */
|
|
3867
|
-
/* @__PURE__ */ jsx19(
|
|
3868
|
-
|
|
3869
|
-
|
|
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
|
+
] });
|
|
3870
3884
|
}
|
|
3871
3885
|
if (enforcePermissions && isCheckingPermission) {
|
|
3872
|
-
return /* @__PURE__ */
|
|
3873
|
-
/* @__PURE__ */ jsx19(
|
|
3874
|
-
|
|
3875
|
-
|
|
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
|
+
] });
|
|
3876
3896
|
}
|
|
3877
3897
|
if (enforcePermissions && permissionError && !isSuperAdmin2 && !isContextError) {
|
|
3878
|
-
return /* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */ jsx19("h2", {
|
|
3880
|
-
/* @__PURE__ */ jsx19("p", {
|
|
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 }),
|
|
3881
3901
|
/* @__PURE__ */ jsx19(Button, { onClick: () => navigate("/"), children: "Go Home" })
|
|
3882
|
-
] })
|
|
3902
|
+
] });
|
|
3883
3903
|
}
|
|
3884
3904
|
if (enforcePermissions && hasPermission === false && !isCheckingSuperAdminDirect && !isSuperAdmin2 && !isContextError) {
|
|
3885
3905
|
if (enforcePagePermissions && pagePermissionFallback) {
|
|
3886
|
-
return /* @__PURE__ */ jsx19(
|
|
3906
|
+
return /* @__PURE__ */ jsx19(Fragment11, { children: pagePermissionFallback });
|
|
3887
3907
|
}
|
|
3888
3908
|
if (permissionFallback) {
|
|
3889
|
-
return /* @__PURE__ */ jsx19(
|
|
3890
|
-
}
|
|
3891
|
-
return /* @__PURE__ */
|
|
3892
|
-
/* @__PURE__ */ jsx19("h2", {
|
|
3893
|
-
/* @__PURE__ */ jsx19("p", {
|
|
3894
|
-
/* @__PURE__ */
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
] })
|
|
3908
|
-
] }) });
|
|
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
|
+
] });
|
|
3909
3927
|
}
|
|
3910
|
-
return /* @__PURE__ */ jsxs14(
|
|
3928
|
+
return /* @__PURE__ */ jsxs14(Fragment11, { children: [
|
|
3911
3929
|
/* @__PURE__ */ jsx19(
|
|
3912
3930
|
Header,
|
|
3913
3931
|
{
|
|
@@ -4256,7 +4274,7 @@ function ProtectedRoute({
|
|
|
4256
4274
|
|
|
4257
4275
|
// src/components/FileUpload/FileUpload.tsx
|
|
4258
4276
|
import { useState as useState15, useCallback as useCallback10, useRef as useRef9, useEffect as useEffect10, useMemo as useMemo10 } from "react";
|
|
4259
|
-
import { Fragment as
|
|
4277
|
+
import { Fragment as Fragment12, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4260
4278
|
function FileUpload({
|
|
4261
4279
|
supabase,
|
|
4262
4280
|
table_name,
|
|
@@ -4633,7 +4651,7 @@ function FileUpload({
|
|
|
4633
4651
|
"aria-label": accept ? `Upload file${multiple ? "s" : ""} (${accept})` : `Upload file${multiple ? "s" : ""}`
|
|
4634
4652
|
}
|
|
4635
4653
|
),
|
|
4636
|
-
/* @__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: [
|
|
4637
4655
|
/* @__PURE__ */ jsx23("span", { className: "font-medium", children: "Click to upload" }),
|
|
4638
4656
|
" ",
|
|
4639
4657
|
"or drag and drop"
|
|
@@ -4817,7 +4835,7 @@ var TableCaption = React20.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4817
4835
|
TableCaption.displayName = "TableCaption";
|
|
4818
4836
|
|
|
4819
4837
|
// src/components/PublicLayout/PublicPageLayout.tsx
|
|
4820
|
-
import { Fragment as
|
|
4838
|
+
import { Fragment as Fragment13, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4821
4839
|
function PublicPageHeader({
|
|
4822
4840
|
event,
|
|
4823
4841
|
eventCode,
|
|
@@ -4842,9 +4860,9 @@ function PublicPageHeader({
|
|
|
4842
4860
|
alt: appName
|
|
4843
4861
|
}
|
|
4844
4862
|
),
|
|
4845
|
-
event && /* @__PURE__ */ jsxs19(
|
|
4863
|
+
event && /* @__PURE__ */ jsxs19(Fragment13, { children: [
|
|
4846
4864
|
/* @__PURE__ */ jsx25("h1", { children: event.event_name }),
|
|
4847
|
-
showEventLogo && event && /* @__PURE__ */ jsx25(
|
|
4865
|
+
showEventLogo && event && /* @__PURE__ */ jsx25(Fragment13, { children: customEventLogo || /* @__PURE__ */ jsx25(
|
|
4848
4866
|
FileDisplay,
|
|
4849
4867
|
{
|
|
4850
4868
|
table_name: "event",
|
|
@@ -4863,11 +4881,11 @@ function PublicPageHeader({
|
|
|
4863
4881
|
) }),
|
|
4864
4882
|
event.event_venue && /* @__PURE__ */ jsx25("h4", { children: event.event_venue })
|
|
4865
4883
|
] }),
|
|
4866
|
-
title && /* @__PURE__ */ jsxs19(
|
|
4884
|
+
title && /* @__PURE__ */ jsxs19(Fragment13, { children: [
|
|
4867
4885
|
/* @__PURE__ */ jsx25("h1", { children: title }),
|
|
4868
4886
|
description && /* @__PURE__ */ jsx25("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
|
|
4869
4887
|
] }),
|
|
4870
|
-
children && /* @__PURE__ */ jsx25(
|
|
4888
|
+
children && /* @__PURE__ */ jsx25(Fragment13, { children })
|
|
4871
4889
|
] });
|
|
4872
4890
|
}
|
|
4873
4891
|
function PublicPageFooter({
|
|
@@ -4883,7 +4901,7 @@ function PublicPageFooter({
|
|
|
4883
4901
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
4884
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: [
|
|
4885
4903
|
logo && /* @__PURE__ */ jsx25("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
4886
|
-
children && /* @__PURE__ */ jsx25(
|
|
4904
|
+
children && /* @__PURE__ */ jsx25(Fragment13, { children }),
|
|
4887
4905
|
/* @__PURE__ */ jsx25("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
4888
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)) })
|
|
4889
4907
|
] }) });
|
|
@@ -4910,10 +4928,16 @@ function PublicPageLayout({
|
|
|
4910
4928
|
if (LoadingFallback) {
|
|
4911
4929
|
return /* @__PURE__ */ jsx25(LoadingFallback, {});
|
|
4912
4930
|
}
|
|
4913
|
-
return /* @__PURE__ */
|
|
4914
|
-
/* @__PURE__ */ jsx25(
|
|
4915
|
-
|
|
4916
|
-
|
|
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
|
+
] });
|
|
4917
4941
|
}
|
|
4918
4942
|
if (error && showValidationErrors) {
|
|
4919
4943
|
if (ErrorFallback) {
|
|
@@ -4936,7 +4960,7 @@ function PublicPageLayout({
|
|
|
4936
4960
|
handleRefetch && /* @__PURE__ */ jsx25(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4937
4961
|
] });
|
|
4938
4962
|
}
|
|
4939
|
-
return /* @__PURE__ */ jsx25(ErrorBoundary, { componentName: "PublicPageLayout", children: /* @__PURE__ */ jsxs19(
|
|
4963
|
+
return /* @__PURE__ */ jsx25(ErrorBoundary, { componentName: "PublicPageLayout", children: /* @__PURE__ */ jsxs19(Fragment13, { children: [
|
|
4940
4964
|
customHeader || /* @__PURE__ */ jsx25(
|
|
4941
4965
|
PublicPageHeader,
|
|
4942
4966
|
{
|
|
@@ -5000,4 +5024,4 @@ export {
|
|
|
5000
5024
|
PublicPageFooter,
|
|
5001
5025
|
PublicPageLayout
|
|
5002
5026
|
};
|
|
5003
|
-
//# sourceMappingURL=chunk-
|
|
5027
|
+
//# sourceMappingURL=chunk-6COVEUS7.js.map
|