@flamingo-stack/openframe-frontend-core 0.0.697 → 0.0.698-2527.7764.1
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/{chunk-F6U2H42L.cjs → chunk-2JRKNGJ4.cjs} +6 -1
- package/dist/chunk-2JRKNGJ4.cjs.map +1 -0
- package/dist/{chunk-WVDBRL2S.js → chunk-3I4UVWLL.js} +7 -7
- package/dist/{chunk-LNOXNCEC.js → chunk-3QOEL4WL.js} +4 -4
- package/dist/{chunk-FZFEIXGB.cjs → chunk-3Y6OCKKW.cjs} +98 -98
- package/dist/{chunk-FZFEIXGB.cjs.map → chunk-3Y6OCKKW.cjs.map} +1 -1
- package/dist/{chunk-N4G3C4B4.cjs → chunk-4QRN6FRY.cjs} +12 -12
- package/dist/{chunk-N4G3C4B4.cjs.map → chunk-4QRN6FRY.cjs.map} +1 -1
- package/dist/{chunk-NE4H4JJG.cjs → chunk-5EL4RXTH.cjs} +42 -42
- package/dist/{chunk-NE4H4JJG.cjs.map → chunk-5EL4RXTH.cjs.map} +1 -1
- package/dist/{chunk-6CDP6TGH.cjs → chunk-5TAHPP4S.cjs} +126 -27
- package/dist/chunk-5TAHPP4S.cjs.map +1 -0
- package/dist/{chunk-M3JA577H.js → chunk-6SN6IVLN.js} +3 -3
- package/dist/{chunk-J4VGVLQI.js → chunk-7SKHOYTF.js} +3 -3
- package/dist/{chunk-7MM6EDNA.cjs → chunk-7WUCZIT4.cjs} +55 -32
- package/dist/{chunk-7MM6EDNA.cjs.map → chunk-7WUCZIT4.cjs.map} +1 -1
- package/dist/{chunk-75CG72QX.cjs → chunk-A3S7VHTM.cjs} +33 -33
- package/dist/{chunk-75CG72QX.cjs.map → chunk-A3S7VHTM.cjs.map} +1 -1
- package/dist/{chunk-VSQVJHOS.js → chunk-AKVO7FP4.js} +2 -2
- package/dist/{chunk-T33ICOHD.cjs → chunk-AQLW7KV3.cjs} +29 -29
- package/dist/{chunk-T33ICOHD.cjs.map → chunk-AQLW7KV3.cjs.map} +1 -1
- package/dist/{chunk-J4MCVIXU.js → chunk-BNJBJTEK.js} +209 -110
- package/dist/chunk-BNJBJTEK.js.map +1 -0
- package/dist/{chunk-YCVDJX7Z.js → chunk-DBF7PGQR.js} +4 -4
- package/dist/{chunk-LZXZ3C6M.js → chunk-E47BI33A.js} +32 -9
- package/dist/chunk-E47BI33A.js.map +1 -0
- package/dist/{chunk-RQ3HFUKV.cjs → chunk-FEXS67IG.cjs} +8 -8
- package/dist/{chunk-RQ3HFUKV.cjs.map → chunk-FEXS67IG.cjs.map} +1 -1
- package/dist/{chunk-LEGNIETR.cjs → chunk-GPF5IV4F.cjs} +5 -5
- package/dist/{chunk-LEGNIETR.cjs.map → chunk-GPF5IV4F.cjs.map} +1 -1
- package/dist/{chunk-VE7HLTVQ.js → chunk-H45GRYL4.js} +2 -2
- package/dist/{chunk-QYFXRVH3.js → chunk-H7FCFGSD.js} +9 -9
- package/dist/{chunk-JU6SBF3C.cjs → chunk-HT7SU5UN.cjs} +7 -7
- package/dist/{chunk-JU6SBF3C.cjs.map → chunk-HT7SU5UN.cjs.map} +1 -1
- package/dist/{chunk-3V7O7J4S.cjs → chunk-IZ3B3YRO.cjs} +28 -28
- package/dist/{chunk-3V7O7J4S.cjs.map → chunk-IZ3B3YRO.cjs.map} +1 -1
- package/dist/{chunk-KLDCI3KF.cjs → chunk-JM7KIML2.cjs} +3 -3
- package/dist/{chunk-KLDCI3KF.cjs.map → chunk-JM7KIML2.cjs.map} +1 -1
- package/dist/{chunk-Y2MDXJB4.js → chunk-JZCCRN3K.js} +2 -2
- package/dist/{chunk-4HVWGYHI.js → chunk-LPLXCDNV.js} +6 -1
- package/dist/chunk-LPLXCDNV.js.map +1 -0
- package/dist/{chunk-LF4S37VU.js → chunk-NKKA4KY7.js} +5 -5
- package/dist/{chunk-RIDRAKQ5.cjs → chunk-OF6FE2KT.cjs} +15 -15
- package/dist/{chunk-RIDRAKQ5.cjs.map → chunk-OF6FE2KT.cjs.map} +1 -1
- package/dist/{chunk-QD4BVKAU.js → chunk-OKA4VKE6.js} +6 -6
- package/dist/{chunk-Z7A7FUWY.js → chunk-OM6WC5XG.js} +3 -3
- package/dist/{chunk-77XUG4Z4.js → chunk-OPXQ5E3G.js} +10 -10
- package/dist/{chunk-GRBZC5N3.js → chunk-PELIFROQ.js} +2 -2
- package/dist/{chunk-JBMFCHNT.js → chunk-PMXCBAC4.js} +2883 -2343
- package/dist/chunk-PMXCBAC4.js.map +1 -0
- package/dist/{chunk-PYNHPMDB.js → chunk-Q7PGQDD4.js} +5 -5
- package/dist/{chunk-EWQZ4BXD.cjs → chunk-QYTVHA6G.cjs} +7 -7
- package/dist/{chunk-EWQZ4BXD.cjs.map → chunk-QYTVHA6G.cjs.map} +1 -1
- package/dist/{chunk-H6SSHFMD.js → chunk-QZFJJRXE.js} +6 -6
- package/dist/{chunk-XRW5VZKH.cjs → chunk-SBBLGNXR.cjs} +14 -14
- package/dist/{chunk-XRW5VZKH.cjs.map → chunk-SBBLGNXR.cjs.map} +1 -1
- package/dist/{chunk-VCR3TW2H.cjs → chunk-TVMY3U3W.cjs} +8 -8
- package/dist/{chunk-VCR3TW2H.cjs.map → chunk-TVMY3U3W.cjs.map} +1 -1
- package/dist/{chunk-3S56I5MX.js → chunk-U7J7G5J7.js} +3 -3
- package/dist/{chunk-SG53SIJX.js → chunk-ULYQ4WFF.js} +6 -6
- package/dist/{chunk-CVMWOUAX.cjs → chunk-UTQLLMBP.cjs} +48 -48
- package/dist/{chunk-CVMWOUAX.cjs.map → chunk-UTQLLMBP.cjs.map} +1 -1
- package/dist/{chunk-5DBWXJBG.cjs → chunk-VVTWH4YS.cjs} +1529 -989
- package/dist/chunk-VVTWH4YS.cjs.map +1 -0
- package/dist/{chunk-5P2J7E5E.cjs → chunk-WC76QXUX.cjs} +3 -3
- package/dist/{chunk-5P2J7E5E.cjs.map → chunk-WC76QXUX.cjs.map} +1 -1
- package/dist/{chunk-2FK7BZIM.cjs → chunk-XFIHZS35.cjs} +18 -18
- package/dist/{chunk-2FK7BZIM.cjs.map → chunk-XFIHZS35.cjs.map} +1 -1
- package/dist/{chunk-OB3ZJ7GQ.js → chunk-XGB5EEFZ.js} +3 -3
- package/dist/{chunk-MFU3ALKM.cjs → chunk-YNAWEA3G.cjs} +232 -232
- package/dist/{chunk-MFU3ALKM.cjs.map → chunk-YNAWEA3G.cjs.map} +1 -1
- package/dist/{chunk-WADR7VIA.cjs → chunk-YWMEVCCZ.cjs} +70 -70
- package/dist/{chunk-WADR7VIA.cjs.map → chunk-YWMEVCCZ.cjs.map} +1 -1
- package/dist/components/announcement-bar.d.ts +1 -1
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/calendar.cjs +4 -4
- package/dist/components/calendar.js +1 -1
- package/dist/components/case-studies/index.cjs +21 -21
- package/dist/components/case-studies/index.js +7 -7
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/chat/index.js +3 -3
- package/dist/components/contact/index.cjs +8 -8
- package/dist/components/contact/index.js +7 -7
- package/dist/components/docs/index.cjs +11 -11
- package/dist/components/docs/index.js +10 -10
- package/dist/components/embeds/index.cjs +8 -8
- package/dist/components/embeds/index.js +7 -7
- package/dist/components/faq/index.cjs +8 -8
- package/dist/components/faq/index.js +7 -7
- package/dist/components/features/conversation-card.d.ts +32 -0
- package/dist/components/features/conversation-card.d.ts.map +1 -0
- package/dist/components/features/index.cjs +9 -7
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.d.ts +1 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +8 -6
- package/dist/components/help-center-pages/index.cjs +101 -101
- package/dist/components/help-center-pages/index.js +20 -20
- package/dist/components/index.cjs +133 -109
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +45 -21
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +59 -59
- package/dist/components/meeting-scheduler/index.js +8 -8
- package/dist/components/navigation/index.cjs +10 -10
- package/dist/components/navigation/index.js +9 -9
- package/dist/components/onboarding-guides/index.cjs +10 -10
- package/dist/components/onboarding-guides/index.js +9 -9
- package/dist/components/platform/ToolBadge.d.ts +17 -9
- package/dist/components/platform/ToolBadge.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/related-content/index.js +4 -4
- package/dist/components/tickets/index.cjs +12 -12
- package/dist/components/tickets/index.js +11 -11
- package/dist/components/ui/app-window-frame.d.ts +20 -0
- package/dist/components/ui/app-window-frame.d.ts.map +1 -0
- package/dist/components/ui/button/button-styles.d.ts +1 -0
- package/dist/components/ui/button/button-styles.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/feature-card.d.ts +5 -0
- package/dist/components/ui/feature-card.d.ts.map +1 -1
- package/dist/components/ui/feature-list.d.ts +7 -1
- package/dist/components/ui/feature-list.d.ts.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +11 -11
- package/dist/components/ui/file-manager/index.js +1 -1
- package/dist/components/ui/incident-feed.d.ts +49 -0
- package/dist/components/ui/incident-feed.d.ts.map +1 -0
- package/dist/components/ui/index.cjs +27 -7
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +5 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +26 -6
- package/dist/components/ui/page-actions.d.ts +1 -1
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/phone-frame.d.ts +60 -0
- package/dist/components/ui/phone-frame.d.ts.map +1 -0
- package/dist/components/ui/snap-carousel.d.ts +27 -0
- package/dist/components/ui/snap-carousel.d.ts.map +1 -0
- package/dist/components/ui/sticky-action-bar.d.ts +29 -0
- package/dist/components/ui/sticky-action-bar.d.ts.map +1 -0
- package/dist/components/ui/tab-navigation.d.ts +14 -1
- package/dist/components/ui/tab-navigation.d.ts.map +1 -1
- package/dist/hooks/index.cjs +12 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +11 -1
- package/dist/hooks/ui/index.d.ts +2 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/use-in-view.d.ts +20 -0
- package/dist/hooks/ui/use-in-view.d.ts.map +1 -0
- package/dist/hooks/ui/use-prefers-reduced-motion.d.ts +13 -0
- package/dist/hooks/ui/use-prefers-reduced-motion.d.ts.map +1 -0
- package/dist/hooks/use-scenario-player.d.ts +45 -0
- package/dist/hooks/use-scenario-player.d.ts.map +1 -0
- package/dist/index.cjs +44 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -10
- package/dist/index.js.map +1 -1
- package/dist/types/announcement.cjs.map +1 -1
- package/dist/types/announcement.d.ts +21 -0
- package/dist/types/announcement.d.ts.map +1 -1
- package/dist/types/announcement.js.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/announcement-bar.tsx +7 -1
- package/src/components/features/conversation-card.tsx +93 -0
- package/src/components/features/index.ts +3 -0
- package/src/components/platform/ToolBadge.tsx +47 -13
- package/src/components/ui/__tests__/snap-carousel.test.tsx +116 -0
- package/src/components/ui/app-window-frame.tsx +41 -0
- package/src/components/ui/button/button-styles.ts +5 -0
- package/src/components/ui/button/button.tsx +1 -0
- package/src/components/ui/feature-card.tsx +16 -1
- package/src/components/ui/feature-list.tsx +23 -3
- package/src/components/ui/incident-feed.tsx +143 -0
- package/src/components/ui/index.ts +8 -0
- package/src/components/ui/page-actions.tsx +1 -1
- package/src/components/ui/phone-frame.tsx +166 -0
- package/src/components/ui/snap-carousel.tsx +186 -0
- package/src/components/ui/sticky-action-bar.tsx +81 -0
- package/src/components/ui/tab-navigation.tsx +63 -13
- package/src/hooks/__tests__/use-scenario-player.test.tsx +144 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/ui/index.ts +2 -0
- package/src/hooks/ui/use-in-view.ts +63 -0
- package/src/hooks/ui/use-prefers-reduced-motion.ts +22 -0
- package/src/hooks/use-scenario-player.ts +102 -0
- package/src/stories/DemoStage.stories.tsx +242 -0
- package/src/types/announcement.ts +21 -0
- package/dist/chunk-4HVWGYHI.js.map +0 -1
- package/dist/chunk-5DBWXJBG.cjs.map +0 -1
- package/dist/chunk-6CDP6TGH.cjs.map +0 -1
- package/dist/chunk-F6U2H42L.cjs.map +0 -1
- package/dist/chunk-J4MCVIXU.js.map +0 -1
- package/dist/chunk-JBMFCHNT.js.map +0 -1
- package/dist/chunk-LZXZ3C6M.js.map +0 -1
- /package/dist/{chunk-WVDBRL2S.js.map → chunk-3I4UVWLL.js.map} +0 -0
- /package/dist/{chunk-LNOXNCEC.js.map → chunk-3QOEL4WL.js.map} +0 -0
- /package/dist/{chunk-M3JA577H.js.map → chunk-6SN6IVLN.js.map} +0 -0
- /package/dist/{chunk-J4VGVLQI.js.map → chunk-7SKHOYTF.js.map} +0 -0
- /package/dist/{chunk-VSQVJHOS.js.map → chunk-AKVO7FP4.js.map} +0 -0
- /package/dist/{chunk-YCVDJX7Z.js.map → chunk-DBF7PGQR.js.map} +0 -0
- /package/dist/{chunk-VE7HLTVQ.js.map → chunk-H45GRYL4.js.map} +0 -0
- /package/dist/{chunk-QYFXRVH3.js.map → chunk-H7FCFGSD.js.map} +0 -0
- /package/dist/{chunk-Y2MDXJB4.js.map → chunk-JZCCRN3K.js.map} +0 -0
- /package/dist/{chunk-LF4S37VU.js.map → chunk-NKKA4KY7.js.map} +0 -0
- /package/dist/{chunk-QD4BVKAU.js.map → chunk-OKA4VKE6.js.map} +0 -0
- /package/dist/{chunk-Z7A7FUWY.js.map → chunk-OM6WC5XG.js.map} +0 -0
- /package/dist/{chunk-77XUG4Z4.js.map → chunk-OPXQ5E3G.js.map} +0 -0
- /package/dist/{chunk-GRBZC5N3.js.map → chunk-PELIFROQ.js.map} +0 -0
- /package/dist/{chunk-PYNHPMDB.js.map → chunk-Q7PGQDD4.js.map} +0 -0
- /package/dist/{chunk-H6SSHFMD.js.map → chunk-QZFJJRXE.js.map} +0 -0
- /package/dist/{chunk-3S56I5MX.js.map → chunk-U7J7G5J7.js.map} +0 -0
- /package/dist/{chunk-SG53SIJX.js.map → chunk-ULYQ4WFF.js.map} +0 -0
- /package/dist/{chunk-OB3ZJ7GQ.js.map → chunk-XGB5EEFZ.js.map} +0 -0
|
@@ -896,8 +896,55 @@ function useWindowSize() {
|
|
|
896
896
|
// src/hooks/ui/index.ts
|
|
897
897
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
898
898
|
|
|
899
|
+
// src/hooks/ui/use-prefers-reduced-motion.ts
|
|
900
|
+
var PREFERS_REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
901
|
+
function usePrefersReducedMotion() {
|
|
902
|
+
return useMediaQuery(PREFERS_REDUCED_MOTION_QUERY) === true;
|
|
903
|
+
}
|
|
904
|
+
function usePrefersReducedMotionState() {
|
|
905
|
+
return useMediaQuery(PREFERS_REDUCED_MOTION_QUERY);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/hooks/ui/use-in-view.ts
|
|
909
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useRef as useRef8, useState as useState10 } from "react";
|
|
910
|
+
function useInView({
|
|
911
|
+
threshold = 0,
|
|
912
|
+
rootMargin = "0px"
|
|
913
|
+
} = {}) {
|
|
914
|
+
const [inView, setInView] = useState10(false);
|
|
915
|
+
const observerRef = useRef8(null);
|
|
916
|
+
const nodeRef = useRef8(null);
|
|
917
|
+
const disconnect = useCallback8(() => {
|
|
918
|
+
observerRef.current?.disconnect();
|
|
919
|
+
observerRef.current = null;
|
|
920
|
+
}, []);
|
|
921
|
+
const ref = useCallback8(
|
|
922
|
+
(node) => {
|
|
923
|
+
disconnect();
|
|
924
|
+
nodeRef.current = node;
|
|
925
|
+
if (!node || typeof IntersectionObserver === "undefined") {
|
|
926
|
+
setInView(false);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
const observer = new IntersectionObserver(
|
|
930
|
+
(entries) => {
|
|
931
|
+
const entry = entries[entries.length - 1];
|
|
932
|
+
if (!entry) return;
|
|
933
|
+
setInView(entry.isIntersecting && entry.intersectionRatio >= threshold);
|
|
934
|
+
},
|
|
935
|
+
{ threshold, rootMargin }
|
|
936
|
+
);
|
|
937
|
+
observer.observe(node);
|
|
938
|
+
observerRef.current = observer;
|
|
939
|
+
},
|
|
940
|
+
[disconnect, threshold, rootMargin]
|
|
941
|
+
);
|
|
942
|
+
useEffect10(() => disconnect, [disconnect]);
|
|
943
|
+
return { ref, inView };
|
|
944
|
+
}
|
|
945
|
+
|
|
899
946
|
// src/hooks/platform/use-platform-config.ts
|
|
900
|
-
import { useState as
|
|
947
|
+
import { useState as useState11, useEffect as useEffect11 } from "react";
|
|
901
948
|
|
|
902
949
|
// src/utils/platform-config.tsx
|
|
903
950
|
import { Globe } from "lucide-react";
|
|
@@ -1010,10 +1057,10 @@ function toPlatformConfigs(payload) {
|
|
|
1010
1057
|
return configs;
|
|
1011
1058
|
}
|
|
1012
1059
|
function usePlatformConfig() {
|
|
1013
|
-
const [platforms, setPlatforms] =
|
|
1014
|
-
const [isLoading, setIsLoading] =
|
|
1015
|
-
const [error, setError] =
|
|
1016
|
-
|
|
1060
|
+
const [platforms, setPlatforms] = useState11(platformCache || []);
|
|
1061
|
+
const [isLoading, setIsLoading] = useState11(!platformCache);
|
|
1062
|
+
const [error, setError] = useState11(null);
|
|
1063
|
+
useEffect11(() => {
|
|
1017
1064
|
const commit = (data) => {
|
|
1018
1065
|
setPlatforms((prev) => prev === data ? prev : data);
|
|
1019
1066
|
setIsLoading(false);
|
|
@@ -1081,7 +1128,7 @@ function useValidatePlatform(value) {
|
|
|
1081
1128
|
import { toast as sonnerToast2 } from "sonner";
|
|
1082
1129
|
|
|
1083
1130
|
// src/components/ui/toaster.tsx
|
|
1084
|
-
import { useState as
|
|
1131
|
+
import { useState as useState12 } from "react";
|
|
1085
1132
|
import { Toaster as SonnerToaster, toast as sonnerToast } from "sonner";
|
|
1086
1133
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1087
1134
|
var dotColorByVariant = {
|
|
@@ -1197,7 +1244,7 @@ function CommandApprovalToast({
|
|
|
1197
1244
|
defaultExpanded = false,
|
|
1198
1245
|
className
|
|
1199
1246
|
}) {
|
|
1200
|
-
const [expanded, setExpanded] =
|
|
1247
|
+
const [expanded, setExpanded] = useState12(defaultExpanded);
|
|
1201
1248
|
const handleApprove = () => {
|
|
1202
1249
|
onApprove?.();
|
|
1203
1250
|
sonnerToast.dismiss(id);
|
|
@@ -1397,15 +1444,15 @@ var useToast = () => ({
|
|
|
1397
1444
|
});
|
|
1398
1445
|
|
|
1399
1446
|
// src/hooks/use-contact-submission.ts
|
|
1400
|
-
import { useState as
|
|
1447
|
+
import { useState as useState13, useCallback as useCallback9, useEffect as useEffect12 } from "react";
|
|
1401
1448
|
function useContactSubmission(options = {}) {
|
|
1402
1449
|
const { userId, successRedirectUrl, successToastMessage, onSuccess } = options;
|
|
1403
1450
|
const { toast: toast2 } = useToast();
|
|
1404
1451
|
const router = useRouter();
|
|
1405
1452
|
const { contactUrl } = useRequiredEndpointsRuntime();
|
|
1406
|
-
const [isSubmitting, setIsSubmitting] =
|
|
1407
|
-
const [isSuccess, setIsSuccess] =
|
|
1408
|
-
const submit =
|
|
1453
|
+
const [isSubmitting, setIsSubmitting] = useState13(false);
|
|
1454
|
+
const [isSuccess, setIsSuccess] = useState13(false);
|
|
1455
|
+
const submit = useCallback9(
|
|
1409
1456
|
async (formData) => {
|
|
1410
1457
|
if (isSubmitting) return;
|
|
1411
1458
|
setIsSubmitting(true);
|
|
@@ -1443,7 +1490,7 @@ function useContactSubmission(options = {}) {
|
|
|
1443
1490
|
},
|
|
1444
1491
|
[isSubmitting, toast2, userId, successToastMessage, contactUrl]
|
|
1445
1492
|
);
|
|
1446
|
-
|
|
1493
|
+
useEffect12(() => {
|
|
1447
1494
|
if (!isSuccess || !successRedirectUrl) return void 0;
|
|
1448
1495
|
console.log("\u{1F680} Contact submission successful, redirecting to:", successRedirectUrl);
|
|
1449
1496
|
const timer = setTimeout(() => {
|
|
@@ -1456,7 +1503,7 @@ function useContactSubmission(options = {}) {
|
|
|
1456
1503
|
}, 1500);
|
|
1457
1504
|
return () => clearTimeout(timer);
|
|
1458
1505
|
}, [isSuccess, successRedirectUrl, router]);
|
|
1459
|
-
|
|
1506
|
+
useEffect12(() => {
|
|
1460
1507
|
if (isSuccess && onSuccess) {
|
|
1461
1508
|
onSuccess();
|
|
1462
1509
|
}
|
|
@@ -1465,7 +1512,7 @@ function useContactSubmission(options = {}) {
|
|
|
1465
1512
|
}
|
|
1466
1513
|
|
|
1467
1514
|
// src/hooks/use-copy-to-clipboard.ts
|
|
1468
|
-
import { useCallback as
|
|
1515
|
+
import { useCallback as useCallback10, useState as useState14 } from "react";
|
|
1469
1516
|
function useCopyToClipboard({
|
|
1470
1517
|
successTitle = "Copied",
|
|
1471
1518
|
successDescription = "Copied to clipboard",
|
|
@@ -1474,8 +1521,8 @@ function useCopyToClipboard({
|
|
|
1474
1521
|
resetDelay = 2e3
|
|
1475
1522
|
} = {}) {
|
|
1476
1523
|
const { toast: toast2 } = useToast();
|
|
1477
|
-
const [copied, setCopied] =
|
|
1478
|
-
const copy =
|
|
1524
|
+
const [copied, setCopied] = useState14(false);
|
|
1525
|
+
const copy = useCallback10(
|
|
1479
1526
|
async (text) => {
|
|
1480
1527
|
try {
|
|
1481
1528
|
await navigator.clipboard.writeText(text);
|
|
@@ -1492,7 +1539,7 @@ function useCopyToClipboard({
|
|
|
1492
1539
|
}
|
|
1493
1540
|
|
|
1494
1541
|
// src/hooks/use-batch-images.ts
|
|
1495
|
-
import { useEffect as
|
|
1542
|
+
import { useEffect as useEffect13, useMemo as useMemo3, useState as useState15, useRef as useRef9 } from "react";
|
|
1496
1543
|
var globalBatchImageConfig = {};
|
|
1497
1544
|
function configureBatchImageFetch(config) {
|
|
1498
1545
|
globalBatchImageConfig = { ...globalBatchImageConfig, ...config };
|
|
@@ -1565,17 +1612,17 @@ async function batchFetchAuthenticatedImages(imageUrls, config) {
|
|
|
1565
1612
|
return results;
|
|
1566
1613
|
}
|
|
1567
1614
|
function useBatchImages(imageUrls, config) {
|
|
1568
|
-
const [fetchedImages, setFetchedImages] =
|
|
1615
|
+
const [fetchedImages, setFetchedImages] = useState15({});
|
|
1569
1616
|
const uniqueUrls = useMemo3(
|
|
1570
1617
|
() => Array.from(new Set(imageUrls.filter((url) => Boolean(url)))),
|
|
1571
1618
|
[imageUrls]
|
|
1572
1619
|
);
|
|
1573
|
-
const requestedUrls =
|
|
1574
|
-
const fetchedImagesRef =
|
|
1575
|
-
|
|
1620
|
+
const requestedUrls = useRef9(/* @__PURE__ */ new Set());
|
|
1621
|
+
const fetchedImagesRef = useRef9(fetchedImages);
|
|
1622
|
+
useEffect13(() => {
|
|
1576
1623
|
fetchedImagesRef.current = fetchedImages;
|
|
1577
1624
|
}, [fetchedImages]);
|
|
1578
|
-
|
|
1625
|
+
useEffect13(
|
|
1579
1626
|
() => () => {
|
|
1580
1627
|
Object.values(fetchedImagesRef.current).forEach((blobUrl) => {
|
|
1581
1628
|
if (blobUrl && blobUrl.startsWith("blob:")) {
|
|
@@ -1585,7 +1632,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
1585
1632
|
},
|
|
1586
1633
|
[]
|
|
1587
1634
|
);
|
|
1588
|
-
|
|
1635
|
+
useEffect13(() => {
|
|
1589
1636
|
const urlsToFetch = uniqueUrls.filter((url) => !requestedUrls.current.has(url));
|
|
1590
1637
|
if (urlsToFetch.length === 0) {
|
|
1591
1638
|
return;
|
|
@@ -1603,7 +1650,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
1603
1650
|
}
|
|
1604
1651
|
|
|
1605
1652
|
// src/hooks/use-authenticated-image.ts
|
|
1606
|
-
import { useEffect as
|
|
1653
|
+
import { useEffect as useEffect14, useState as useState16, useRef as useRef10 } from "react";
|
|
1607
1654
|
var globalImageConfig = {};
|
|
1608
1655
|
var imageCache = /* @__PURE__ */ new Map();
|
|
1609
1656
|
var pendingRequests = /* @__PURE__ */ new Map();
|
|
@@ -1632,8 +1679,8 @@ function getImageConfig() {
|
|
|
1632
1679
|
};
|
|
1633
1680
|
}
|
|
1634
1681
|
function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
1635
|
-
const [settled, setSettled] =
|
|
1636
|
-
const currentCacheKeyRef =
|
|
1682
|
+
const [settled, setSettled] = useState16(null);
|
|
1683
|
+
const currentCacheKeyRef = useRef10(null);
|
|
1637
1684
|
const { tenantHostUrl, enableDevMode, accessTokenKey } = {
|
|
1638
1685
|
...getImageConfig(),
|
|
1639
1686
|
...config
|
|
@@ -1651,7 +1698,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1651
1698
|
}
|
|
1652
1699
|
}
|
|
1653
1700
|
const cacheKey = fullImageUrl === null ? null : refreshKey ? `${fullImageUrl}?v=${refreshKey}` : fullImageUrl;
|
|
1654
|
-
|
|
1701
|
+
useEffect14(() => {
|
|
1655
1702
|
if (cacheKey === null) {
|
|
1656
1703
|
if (currentCacheKeyRef.current) {
|
|
1657
1704
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -1728,7 +1775,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1728
1775
|
});
|
|
1729
1776
|
pendingRequests.set(cacheKey, fetchPromise2);
|
|
1730
1777
|
}, [cacheKey, fullImageUrl, refreshKey, enableDevMode, accessTokenKey]);
|
|
1731
|
-
|
|
1778
|
+
useEffect14(() => {
|
|
1732
1779
|
return () => {
|
|
1733
1780
|
if (currentCacheKeyRef.current) {
|
|
1734
1781
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -1749,7 +1796,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1749
1796
|
}
|
|
1750
1797
|
|
|
1751
1798
|
// src/hooks/state/use-query-params.ts
|
|
1752
|
-
import { useEffect as
|
|
1799
|
+
import { useEffect as useEffect15, useState as useState17, useMemo as useMemo4, useCallback as useCallback11, useRef as useRef11 } from "react";
|
|
1753
1800
|
|
|
1754
1801
|
// src/hooks/state/flatten-schema.ts
|
|
1755
1802
|
function flattenQueryVariables(queryVariables, introspector2) {
|
|
@@ -2200,26 +2247,26 @@ function validateVariables(variables, schema) {
|
|
|
2200
2247
|
function useQueryParams(query, options = {}) {
|
|
2201
2248
|
const router = useRouter();
|
|
2202
2249
|
const searchParams = useSearchParams();
|
|
2203
|
-
const [isLoading, setIsLoading] =
|
|
2204
|
-
const [isReady, setIsReady] =
|
|
2205
|
-
const [error, setError] =
|
|
2206
|
-
const [schema, setSchema] =
|
|
2250
|
+
const [isLoading, setIsLoading] = useState17(true);
|
|
2251
|
+
const [isReady, setIsReady] = useState17(false);
|
|
2252
|
+
const [error, setError] = useState17(null);
|
|
2253
|
+
const [schema, setSchema] = useState17({});
|
|
2207
2254
|
const defaultValues = useMemo4(() => options.defaultValues || {}, [options.defaultValues]);
|
|
2208
2255
|
const skipIntrospection = options.skipIntrospection || false;
|
|
2209
2256
|
const debug = options.debug || false;
|
|
2210
|
-
const initSourceRef =
|
|
2257
|
+
const initSourceRef = useRef11({
|
|
2211
2258
|
introspectionHeaders: options.introspectionHeaders,
|
|
2212
2259
|
paramMapping: options.paramMapping,
|
|
2213
2260
|
defaultValues
|
|
2214
2261
|
});
|
|
2215
|
-
|
|
2262
|
+
useEffect15(() => {
|
|
2216
2263
|
initSourceRef.current = {
|
|
2217
2264
|
introspectionHeaders: options.introspectionHeaders,
|
|
2218
2265
|
paramMapping: options.paramMapping,
|
|
2219
2266
|
defaultValues
|
|
2220
2267
|
};
|
|
2221
2268
|
});
|
|
2222
|
-
|
|
2269
|
+
useEffect15(() => {
|
|
2223
2270
|
let cancelled = false;
|
|
2224
2271
|
async function initialize() {
|
|
2225
2272
|
try {
|
|
@@ -2296,7 +2343,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2296
2343
|
});
|
|
2297
2344
|
return result;
|
|
2298
2345
|
}, [searchParams]);
|
|
2299
|
-
const updateUrl =
|
|
2346
|
+
const updateUrl = useCallback11(
|
|
2300
2347
|
(newParams) => {
|
|
2301
2348
|
const url = newParams.toString() ? `?${newParams.toString()}` : window.location.pathname;
|
|
2302
2349
|
if (debug) {
|
|
@@ -2306,7 +2353,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2306
2353
|
},
|
|
2307
2354
|
[router, debug]
|
|
2308
2355
|
);
|
|
2309
|
-
const setParam =
|
|
2356
|
+
const setParam = useCallback11(
|
|
2310
2357
|
(key, value) => {
|
|
2311
2358
|
if (!isReady) {
|
|
2312
2359
|
console.warn("[useQueryParams] Schema not ready, cannot set param");
|
|
@@ -2322,7 +2369,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2322
2369
|
},
|
|
2323
2370
|
[variables, schema, isReady, updateUrl]
|
|
2324
2371
|
);
|
|
2325
|
-
const setParams =
|
|
2372
|
+
const setParams = useCallback11(
|
|
2326
2373
|
(updates) => {
|
|
2327
2374
|
if (!isReady) {
|
|
2328
2375
|
console.warn("[useQueryParams] Schema not ready, cannot set params");
|
|
@@ -2338,7 +2385,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2338
2385
|
},
|
|
2339
2386
|
[variables, schema, isReady, updateUrl]
|
|
2340
2387
|
);
|
|
2341
|
-
const clearParamsHandler =
|
|
2388
|
+
const clearParamsHandler = useCallback11(
|
|
2342
2389
|
(keys) => {
|
|
2343
2390
|
if (!isReady) {
|
|
2344
2391
|
console.warn("[useQueryParams] Schema not ready, cannot clear params");
|
|
@@ -2354,7 +2401,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2354
2401
|
},
|
|
2355
2402
|
[variables, schema, isReady, updateUrl]
|
|
2356
2403
|
);
|
|
2357
|
-
const resetParams =
|
|
2404
|
+
const resetParams = useCallback11(() => {
|
|
2358
2405
|
if (debug) {
|
|
2359
2406
|
console.log("[useQueryParams] Resetting params");
|
|
2360
2407
|
}
|
|
@@ -2389,9 +2436,9 @@ function applyParamMapping(schema, mapping) {
|
|
|
2389
2436
|
}
|
|
2390
2437
|
|
|
2391
2438
|
// src/hooks/state/use-api-params.ts
|
|
2392
|
-
import { useCallback as
|
|
2439
|
+
import { useCallback as useCallback12, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef12, useState as useState18 } from "react";
|
|
2393
2440
|
function useContentStable(value, key) {
|
|
2394
|
-
const [cached, setCached] =
|
|
2441
|
+
const [cached, setCached] = useState18({ value, key });
|
|
2395
2442
|
if (cached.key !== key) setCached({ value, key });
|
|
2396
2443
|
return cached.key === key ? cached.value : value;
|
|
2397
2444
|
}
|
|
@@ -2418,9 +2465,9 @@ function useApiParams(schema, options = {}) {
|
|
|
2418
2465
|
const searchParamsLive = useSearchParams();
|
|
2419
2466
|
const debug = options.debug || false;
|
|
2420
2467
|
const searchString = searchParamsLive.toString();
|
|
2421
|
-
const pendingRef =
|
|
2422
|
-
const [pendingTail, setPendingTail] =
|
|
2423
|
-
const syncPendingTail =
|
|
2468
|
+
const pendingRef = useRef12([]);
|
|
2469
|
+
const [pendingTail, setPendingTail] = useState18(void 0);
|
|
2470
|
+
const syncPendingTail = useCallback12(() => {
|
|
2424
2471
|
setPendingTail(pendingRef.current[pendingRef.current.length - 1]);
|
|
2425
2472
|
}, []);
|
|
2426
2473
|
const schemaKey = useMemo5(() => JSON.stringify(schema), [schema]);
|
|
@@ -2448,14 +2495,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2448
2495
|
}
|
|
2449
2496
|
return result;
|
|
2450
2497
|
}, [searchString, debug, stableSchema, options.absent]);
|
|
2451
|
-
const [paramsCache, setParamsCache] =
|
|
2498
|
+
const [paramsCache, setParamsCache] = useState18(() => ({ src: rawParams, value: rawParams }));
|
|
2452
2499
|
let stableParams = paramsCache.value;
|
|
2453
2500
|
if (paramsCache.src !== rawParams) {
|
|
2454
2501
|
stableParams = reuseArrayRefs(paramsCache.value, rawParams);
|
|
2455
2502
|
setParamsCache({ src: rawParams, value: stableParams });
|
|
2456
2503
|
}
|
|
2457
2504
|
const params = stableParams;
|
|
2458
|
-
const addParamToSearchParams =
|
|
2505
|
+
const addParamToSearchParams = useCallback12((searchParams, key, value) => {
|
|
2459
2506
|
for (const [k, v] of createSearchParams({ [key]: value })) searchParams.append(k, v);
|
|
2460
2507
|
}, []);
|
|
2461
2508
|
const urlSearchParams = useMemo5(() => {
|
|
@@ -2470,7 +2517,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2470
2517
|
}
|
|
2471
2518
|
return newParams;
|
|
2472
2519
|
}, [params, flattenedSchema, addParamToSearchParams, stableSchema]);
|
|
2473
|
-
const updateUrl =
|
|
2520
|
+
const updateUrl = useCallback12(
|
|
2474
2521
|
(newParams, keysToRemove = []) => {
|
|
2475
2522
|
const base = pendingRef.current[pendingRef.current.length - 1] ?? searchString;
|
|
2476
2523
|
const finalParams = new URLSearchParams(base);
|
|
@@ -2505,14 +2552,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2505
2552
|
},
|
|
2506
2553
|
[router, debug, searchString, stableSchema, syncPendingTail]
|
|
2507
2554
|
);
|
|
2508
|
-
|
|
2555
|
+
useEffect16(() => {
|
|
2509
2556
|
const queue = pendingRef.current;
|
|
2510
2557
|
if (queue.length === 0) return;
|
|
2511
2558
|
const hit = queue.indexOf(searchString);
|
|
2512
2559
|
pendingRef.current = hit === -1 ? [] : queue.slice(hit + 1);
|
|
2513
2560
|
syncPendingTail();
|
|
2514
2561
|
}, [searchString, syncPendingTail]);
|
|
2515
|
-
const setParam =
|
|
2562
|
+
const setParam = useCallback12(
|
|
2516
2563
|
(key, value) => {
|
|
2517
2564
|
const config = stableSchema[key];
|
|
2518
2565
|
if (!config) {
|
|
@@ -2529,7 +2576,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2529
2576
|
},
|
|
2530
2577
|
[updateUrl, addParamToSearchParams, stableSchema]
|
|
2531
2578
|
);
|
|
2532
|
-
const setParams =
|
|
2579
|
+
const setParams = useCallback12(
|
|
2533
2580
|
(updates) => {
|
|
2534
2581
|
const newParams = new URLSearchParams();
|
|
2535
2582
|
const keysToRemove = [];
|
|
@@ -2549,14 +2596,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2549
2596
|
},
|
|
2550
2597
|
[updateUrl, addParamToSearchParams, stableSchema, flattenedSchema]
|
|
2551
2598
|
);
|
|
2552
|
-
const clearParams2 =
|
|
2599
|
+
const clearParams2 = useCallback12(
|
|
2553
2600
|
(keys) => {
|
|
2554
2601
|
const newParams = new URLSearchParams();
|
|
2555
2602
|
updateUrl(newParams, keys);
|
|
2556
2603
|
},
|
|
2557
2604
|
[updateUrl]
|
|
2558
2605
|
);
|
|
2559
|
-
const resetParams =
|
|
2606
|
+
const resetParams = useCallback12(() => {
|
|
2560
2607
|
if (debug) {
|
|
2561
2608
|
console.log("[useApiParams] Resetting params");
|
|
2562
2609
|
}
|
|
@@ -2580,7 +2627,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2580
2627
|
}
|
|
2581
2628
|
|
|
2582
2629
|
// src/hooks/state/use-cursor-pagination-state.ts
|
|
2583
|
-
import { useCallback as
|
|
2630
|
+
import { useCallback as useCallback13, useEffect as useEffect17, useRef as useRef13, useState as useState19 } from "react";
|
|
2584
2631
|
var urlSchema = {
|
|
2585
2632
|
search: { type: "string", default: "" },
|
|
2586
2633
|
cursor: { type: "string", default: "" }
|
|
@@ -2588,21 +2635,21 @@ var urlSchema = {
|
|
|
2588
2635
|
function useCursorPaginationState(options) {
|
|
2589
2636
|
const { onInitialLoad, onSearchChange } = options;
|
|
2590
2637
|
const { params, setParam, setParams } = useApiParams(urlSchema);
|
|
2591
|
-
const [searchInput, setSearchInput] =
|
|
2592
|
-
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] =
|
|
2593
|
-
const [initialLoadCount, setInitialLoadCount] =
|
|
2594
|
-
const lastSearchRef =
|
|
2595
|
-
const isSyncingFromUrl =
|
|
2596
|
-
const isInitialLoadInProgress =
|
|
2597
|
-
const searchInputRef =
|
|
2598
|
-
const onInitialLoadRef =
|
|
2599
|
-
const paramsRef =
|
|
2600
|
-
|
|
2638
|
+
const [searchInput, setSearchInput] = useState19(params.search || "");
|
|
2639
|
+
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] = useState19(false);
|
|
2640
|
+
const [initialLoadCount, setInitialLoadCount] = useState19(0);
|
|
2641
|
+
const lastSearchRef = useRef13(null);
|
|
2642
|
+
const isSyncingFromUrl = useRef13(false);
|
|
2643
|
+
const isInitialLoadInProgress = useRef13(true);
|
|
2644
|
+
const searchInputRef = useRef13(searchInput);
|
|
2645
|
+
const onInitialLoadRef = useRef13(onInitialLoad);
|
|
2646
|
+
const paramsRef = useRef13(params);
|
|
2647
|
+
useEffect17(() => {
|
|
2601
2648
|
searchInputRef.current = searchInput;
|
|
2602
2649
|
onInitialLoadRef.current = onInitialLoad;
|
|
2603
2650
|
paramsRef.current = params;
|
|
2604
2651
|
});
|
|
2605
|
-
|
|
2652
|
+
useEffect17(() => {
|
|
2606
2653
|
if (isInitialLoadInProgress.current) return;
|
|
2607
2654
|
const urlSearch = params.search || "";
|
|
2608
2655
|
if (urlSearch !== searchInputRef.current) {
|
|
@@ -2613,7 +2660,7 @@ function useCursorPaginationState(options) {
|
|
|
2613
2660
|
}, 0);
|
|
2614
2661
|
}
|
|
2615
2662
|
}, [params.search, initialLoadCount]);
|
|
2616
|
-
|
|
2663
|
+
useEffect17(() => {
|
|
2617
2664
|
if (isInitialLoadInProgress.current) return;
|
|
2618
2665
|
if (isSyncingFromUrl.current) return;
|
|
2619
2666
|
if (searchInput !== params.search) {
|
|
@@ -2624,7 +2671,7 @@ function useCursorPaginationState(options) {
|
|
|
2624
2671
|
});
|
|
2625
2672
|
}
|
|
2626
2673
|
}, [searchInput, params.search, setParams, initialLoadCount]);
|
|
2627
|
-
|
|
2674
|
+
useEffect17(() => {
|
|
2628
2675
|
if (initialLoadCount === 0) {
|
|
2629
2676
|
const cursor = paramsRef.current.cursor || null;
|
|
2630
2677
|
const search = paramsRef.current.search || "";
|
|
@@ -2640,7 +2687,7 @@ function useCursorPaginationState(options) {
|
|
|
2640
2687
|
});
|
|
2641
2688
|
}
|
|
2642
2689
|
}, [initialLoadCount]);
|
|
2643
|
-
|
|
2690
|
+
useEffect17(() => {
|
|
2644
2691
|
if (isInitialLoadInProgress.current) return;
|
|
2645
2692
|
if (initialLoadCount === 0) return;
|
|
2646
2693
|
const currentSearch = params.search || "";
|
|
@@ -2652,7 +2699,7 @@ function useCursorPaginationState(options) {
|
|
|
2652
2699
|
});
|
|
2653
2700
|
}
|
|
2654
2701
|
}, [params.search, onSearchChange, initialLoadCount]);
|
|
2655
|
-
const handleNextPage =
|
|
2702
|
+
const handleNextPage = useCallback13(
|
|
2656
2703
|
async (endCursor, fetchFn) => {
|
|
2657
2704
|
setParam("cursor", endCursor);
|
|
2658
2705
|
await fetchFn();
|
|
@@ -2660,7 +2707,7 @@ function useCursorPaginationState(options) {
|
|
|
2660
2707
|
},
|
|
2661
2708
|
[setParam]
|
|
2662
2709
|
);
|
|
2663
|
-
const handleResetToFirstPage =
|
|
2710
|
+
const handleResetToFirstPage = useCallback13(
|
|
2664
2711
|
async (fetchFn) => {
|
|
2665
2712
|
setParam("cursor", "");
|
|
2666
2713
|
await fetchFn();
|
|
@@ -2682,22 +2729,22 @@ function useCursorPaginationState(options) {
|
|
|
2682
2729
|
}
|
|
2683
2730
|
|
|
2684
2731
|
// src/hooks/nats/use-nats-client.ts
|
|
2685
|
-
import { useEffect as
|
|
2732
|
+
import { useEffect as useEffect18, useMemo as useMemo6, useState as useState20 } from "react";
|
|
2686
2733
|
function useNatsClient(clientOptions, options = {}) {
|
|
2687
2734
|
const { autoConnect = true } = options;
|
|
2688
2735
|
const client = useMemo6(() => {
|
|
2689
2736
|
if (!clientOptions) return null;
|
|
2690
2737
|
return createNatsClient(clientOptions);
|
|
2691
2738
|
}, [clientOptions]);
|
|
2692
|
-
const [status, setStatus] =
|
|
2693
|
-
const [lastError, setLastError] =
|
|
2694
|
-
const [statusClient, setStatusClient] =
|
|
2739
|
+
const [status, setStatus] = useState20("disconnected");
|
|
2740
|
+
const [lastError, setLastError] = useState20(null);
|
|
2741
|
+
const [statusClient, setStatusClient] = useState20(client);
|
|
2695
2742
|
if (statusClient !== client) {
|
|
2696
2743
|
setStatusClient(client);
|
|
2697
2744
|
setStatus("disconnected");
|
|
2698
2745
|
setLastError(null);
|
|
2699
2746
|
}
|
|
2700
|
-
|
|
2747
|
+
useEffect18(() => {
|
|
2701
2748
|
if (!client) return void 0;
|
|
2702
2749
|
const off = client.onStatus((event) => {
|
|
2703
2750
|
setStatus(event.status);
|
|
@@ -2723,6 +2770,53 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
2723
2770
|
};
|
|
2724
2771
|
}
|
|
2725
2772
|
|
|
2773
|
+
// src/hooks/use-scenario-player.ts
|
|
2774
|
+
import { useCallback as useCallback14, useEffect as useEffect19, useState as useState21 } from "react";
|
|
2775
|
+
function useScenarioPlayer({
|
|
2776
|
+
scenarioCount,
|
|
2777
|
+
lastStep: lastStepOption,
|
|
2778
|
+
stepMs,
|
|
2779
|
+
holdMs,
|
|
2780
|
+
enabled = true,
|
|
2781
|
+
initialScenario = 0
|
|
2782
|
+
}) {
|
|
2783
|
+
const reducedState = usePrefersReducedMotionState();
|
|
2784
|
+
const reducedMotion = reducedState === true;
|
|
2785
|
+
const [scenario, setScenario] = useState21(initialScenario);
|
|
2786
|
+
const [rawStep, setRawStep] = useState21(0);
|
|
2787
|
+
const [paused, setPaused] = useState21(false);
|
|
2788
|
+
const lastStep = typeof lastStepOption === "function" ? lastStepOption(scenario) : lastStepOption;
|
|
2789
|
+
const step = reducedMotion ? lastStep : Math.min(rawStep, lastStep);
|
|
2790
|
+
const playing = enabled && !paused && reducedState === false && scenarioCount > 0;
|
|
2791
|
+
useEffect19(() => {
|
|
2792
|
+
if (!playing) return void 0;
|
|
2793
|
+
const atEnd = rawStep >= lastStep;
|
|
2794
|
+
const timer = setTimeout(
|
|
2795
|
+
() => {
|
|
2796
|
+
if (atEnd) {
|
|
2797
|
+
setScenario((current) => (current + 1) % scenarioCount);
|
|
2798
|
+
setRawStep(0);
|
|
2799
|
+
} else {
|
|
2800
|
+
setRawStep((current) => current + 1);
|
|
2801
|
+
}
|
|
2802
|
+
},
|
|
2803
|
+
atEnd ? holdMs : stepMs
|
|
2804
|
+
);
|
|
2805
|
+
return () => clearTimeout(timer);
|
|
2806
|
+
}, [playing, rawStep, lastStep, stepMs, holdMs, scenario, scenarioCount]);
|
|
2807
|
+
const setStep = useCallback14(
|
|
2808
|
+
(next) => {
|
|
2809
|
+
setRawStep(Math.max(0, Math.min(lastStep, next)));
|
|
2810
|
+
},
|
|
2811
|
+
[lastStep]
|
|
2812
|
+
);
|
|
2813
|
+
const go = useCallback14((next) => {
|
|
2814
|
+
setScenario(next);
|
|
2815
|
+
setRawStep(0);
|
|
2816
|
+
}, []);
|
|
2817
|
+
return { scenario, step, paused, setPaused, setStep, go, reducedMotion };
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2726
2820
|
// src/hooks/use-access-code-integration.ts
|
|
2727
2821
|
import React from "react";
|
|
2728
2822
|
|
|
@@ -2826,7 +2920,7 @@ function useAccessCodeIntegration() {
|
|
|
2826
2920
|
}
|
|
2827
2921
|
|
|
2828
2922
|
// src/hooks/use-claude-mirror-src.ts
|
|
2829
|
-
import { useEffect as
|
|
2923
|
+
import { useEffect as useEffect20, useState as useState22 } from "react";
|
|
2830
2924
|
|
|
2831
2925
|
// src/utils/embed-url-converters.ts
|
|
2832
2926
|
function toGoogleSheetsEmbedUrl(url) {
|
|
@@ -2916,9 +3010,9 @@ async function revalidateMirror(mirrorPath) {
|
|
|
2916
3010
|
function useClaudeMirrorSrc(url) {
|
|
2917
3011
|
const endpoints = useEndpointsRuntime();
|
|
2918
3012
|
const mirrorPath = toClaudeMirrorPath(url, endpoints?.storageViewBaseUrl);
|
|
2919
|
-
const [resolved, setResolved] =
|
|
3013
|
+
const [resolved, setResolved] = useState22(null);
|
|
2920
3014
|
const state = resolved && resolved.key === mirrorPath ? resolved.value : { src: null, status: mirrorPath ? "probing" : "absent" };
|
|
2921
|
-
|
|
3015
|
+
useEffect20(() => {
|
|
2922
3016
|
if (!mirrorPath) return void 0;
|
|
2923
3017
|
let cancelled = false;
|
|
2924
3018
|
const settle = (value) => {
|
|
@@ -2945,11 +3039,11 @@ function useClaudeMirrorSrc(url) {
|
|
|
2945
3039
|
}
|
|
2946
3040
|
|
|
2947
3041
|
// src/hooks/use-scroll-to-hash.ts
|
|
2948
|
-
import { useEffect as
|
|
3042
|
+
import { useEffect as useEffect21 } from "react";
|
|
2949
3043
|
var MAX_POLL_FRAMES = 60;
|
|
2950
3044
|
function useScrollToHash(readyDep = true, options) {
|
|
2951
3045
|
const headerOffset = options?.headerOffset ?? 0;
|
|
2952
|
-
|
|
3046
|
+
useEffect21(() => {
|
|
2953
3047
|
if (typeof window === "undefined") return void 0;
|
|
2954
3048
|
if (readyDep === null || readyDep === false) return void 0;
|
|
2955
3049
|
let rafId = null;
|
|
@@ -2989,7 +3083,7 @@ function useScrollToHash(readyDep = true, options) {
|
|
|
2989
3083
|
}
|
|
2990
3084
|
|
|
2991
3085
|
// src/hooks/use-humanity-signals.ts
|
|
2992
|
-
import { useCallback as
|
|
3086
|
+
import { useCallback as useCallback15, useRef as useRef14, useState as useState23 } from "react";
|
|
2993
3087
|
|
|
2994
3088
|
// src/utils/humanity-signals.ts
|
|
2995
3089
|
var HONEYPOT_FIELD = "form_extra_note";
|
|
@@ -3051,17 +3145,17 @@ var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [
|
|
|
3051
3145
|
|
|
3052
3146
|
// src/hooks/use-humanity-signals.ts
|
|
3053
3147
|
function useHumanitySignals() {
|
|
3054
|
-
const ref =
|
|
3055
|
-
const [mountedAt] =
|
|
3056
|
-
const startedAtRef =
|
|
3057
|
-
const getSignals =
|
|
3148
|
+
const ref = useRef14(null);
|
|
3149
|
+
const [mountedAt] = useState23(() => typeof performance !== "undefined" ? performance.now() : 0);
|
|
3150
|
+
const startedAtRef = useRef14(mountedAt);
|
|
3151
|
+
const getSignals = useCallback15(
|
|
3058
3152
|
() => ({
|
|
3059
3153
|
[HONEYPOT_FIELD]: ref.current?.value ?? "",
|
|
3060
3154
|
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - startedAtRef.current) : 0
|
|
3061
3155
|
}),
|
|
3062
3156
|
[]
|
|
3063
3157
|
);
|
|
3064
|
-
const resetSignals =
|
|
3158
|
+
const resetSignals = useCallback15(() => {
|
|
3065
3159
|
if (ref.current) ref.current.value = "";
|
|
3066
3160
|
if (typeof performance !== "undefined") startedAtRef.current = performance.now();
|
|
3067
3161
|
}, []);
|
|
@@ -3069,7 +3163,7 @@ function useHumanitySignals() {
|
|
|
3069
3163
|
}
|
|
3070
3164
|
|
|
3071
3165
|
// src/hooks/use-form-rescue.ts
|
|
3072
|
-
import { useCallback as
|
|
3166
|
+
import { useCallback as useCallback16, useEffect as useEffect22, useMemo as useMemo7, useRef as useRef15 } from "react";
|
|
3073
3167
|
|
|
3074
3168
|
// src/utils/form-rescue.ts
|
|
3075
3169
|
var FORM_ID_PATTERN = /^[a-z][a-z0-9_]{1,47}$/;
|
|
@@ -3283,27 +3377,27 @@ function readUtm() {
|
|
|
3283
3377
|
function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
3284
3378
|
const draftsUrl = useEndpointsRuntime()?.formDraftsUrl;
|
|
3285
3379
|
const formId = form?.id ?? null;
|
|
3286
|
-
const attemptIdRef =
|
|
3287
|
-
const resumeTokenRef =
|
|
3288
|
-
const latestRef =
|
|
3289
|
-
const dirtyRef =
|
|
3290
|
-
const startedRef =
|
|
3291
|
-
const leadCapturedRef =
|
|
3292
|
-
const completedRef =
|
|
3293
|
-
const timerRef =
|
|
3294
|
-
const fieldNamesRef =
|
|
3295
|
-
const onRestoreRef =
|
|
3296
|
-
const getSignalsRef =
|
|
3297
|
-
|
|
3380
|
+
const attemptIdRef = useRef15(null);
|
|
3381
|
+
const resumeTokenRef = useRef15(null);
|
|
3382
|
+
const latestRef = useRef15(null);
|
|
3383
|
+
const dirtyRef = useRef15(false);
|
|
3384
|
+
const startedRef = useRef15(false);
|
|
3385
|
+
const leadCapturedRef = useRef15(false);
|
|
3386
|
+
const completedRef = useRef15(false);
|
|
3387
|
+
const timerRef = useRef15(null);
|
|
3388
|
+
const fieldNamesRef = useRef15(fieldNames);
|
|
3389
|
+
const onRestoreRef = useRef15(onRestore);
|
|
3390
|
+
const getSignalsRef = useRef15(getSignals);
|
|
3391
|
+
useEffect22(() => {
|
|
3298
3392
|
fieldNamesRef.current = fieldNames;
|
|
3299
3393
|
onRestoreRef.current = onRestore;
|
|
3300
3394
|
getSignalsRef.current = getSignals;
|
|
3301
3395
|
});
|
|
3302
|
-
const attemptId =
|
|
3396
|
+
const attemptId = useCallback16(() => {
|
|
3303
3397
|
if (!attemptIdRef.current) attemptIdRef.current = newAttemptId();
|
|
3304
3398
|
return attemptIdRef.current;
|
|
3305
3399
|
}, []);
|
|
3306
|
-
const send =
|
|
3400
|
+
const send = useCallback16(
|
|
3307
3401
|
(keepalive) => {
|
|
3308
3402
|
if (!formId || !draftsUrl || !dirtyRef.current || completedRef.current || !latestRef.current) return;
|
|
3309
3403
|
dirtyRef.current = false;
|
|
@@ -3334,7 +3428,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3334
3428
|
},
|
|
3335
3429
|
[attemptId, draftsUrl, formId]
|
|
3336
3430
|
);
|
|
3337
|
-
|
|
3431
|
+
useEffect22(() => {
|
|
3338
3432
|
if (!formId || typeof window === "undefined") return void 0;
|
|
3339
3433
|
let cancelled = false;
|
|
3340
3434
|
const token = new URLSearchParams(window.location.search).get(FORM_RESCUE_RESUME_PARAM);
|
|
@@ -3364,7 +3458,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3364
3458
|
cancelled = true;
|
|
3365
3459
|
};
|
|
3366
3460
|
}, [attemptId, draftsUrl, formId]);
|
|
3367
|
-
|
|
3461
|
+
useEffect22(() => {
|
|
3368
3462
|
if (!formId || typeof document === "undefined") return void 0;
|
|
3369
3463
|
const onHide = () => {
|
|
3370
3464
|
if (completedRef.current || !startedRef.current) return;
|
|
@@ -3391,7 +3485,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3391
3485
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
3392
3486
|
};
|
|
3393
3487
|
}, [attemptId, formId, send]);
|
|
3394
|
-
const track =
|
|
3488
|
+
const track = useCallback16(
|
|
3395
3489
|
(values, lastField) => {
|
|
3396
3490
|
if (!formId || completedRef.current) return;
|
|
3397
3491
|
const names = fieldNamesRef.current;
|
|
@@ -3424,14 +3518,14 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3424
3518
|
},
|
|
3425
3519
|
[attemptId, formId, send]
|
|
3426
3520
|
);
|
|
3427
|
-
const submitFields =
|
|
3521
|
+
const submitFields = useCallback16(() => {
|
|
3428
3522
|
if (!formId) return {};
|
|
3429
3523
|
return {
|
|
3430
3524
|
[FORM_RESCUE_ATTEMPT_FIELD]: attemptId(),
|
|
3431
3525
|
...resumeTokenRef.current ? { [FORM_RESCUE_RESUME_FIELD]: resumeTokenRef.current } : {}
|
|
3432
3526
|
};
|
|
3433
3527
|
}, [attemptId, formId]);
|
|
3434
|
-
const complete =
|
|
3528
|
+
const complete = useCallback16(() => {
|
|
3435
3529
|
if (!formId) return;
|
|
3436
3530
|
if (timerRef.current) {
|
|
3437
3531
|
clearTimeout(timerRef.current);
|
|
@@ -3449,7 +3543,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3449
3543
|
}
|
|
3450
3544
|
|
|
3451
3545
|
// src/hooks/use-rescued-form.ts
|
|
3452
|
-
import { useEffect as
|
|
3546
|
+
import { useEffect as useEffect23 } from "react";
|
|
3453
3547
|
function flattenOneLevel(values) {
|
|
3454
3548
|
const flat = {};
|
|
3455
3549
|
for (const [key, value] of Object.entries(values)) {
|
|
@@ -3473,7 +3567,7 @@ function useRescuedForm(form, { rescue, fields, getSignals, fieldPath }) {
|
|
|
3473
3567
|
}
|
|
3474
3568
|
}
|
|
3475
3569
|
});
|
|
3476
|
-
|
|
3570
|
+
useEffect23(() => {
|
|
3477
3571
|
const subscription = watch((values, { name }) => {
|
|
3478
3572
|
handle.track(flattenOneLevel(values), name ? name.split(".").pop() ?? null : null);
|
|
3479
3573
|
});
|
|
@@ -3498,6 +3592,10 @@ export {
|
|
|
3498
3592
|
useTablePagination,
|
|
3499
3593
|
useThrottle,
|
|
3500
3594
|
useWindowSize,
|
|
3595
|
+
PREFERS_REDUCED_MOTION_QUERY,
|
|
3596
|
+
usePrefersReducedMotion,
|
|
3597
|
+
usePrefersReducedMotionState,
|
|
3598
|
+
useInView,
|
|
3501
3599
|
usePreventScroll,
|
|
3502
3600
|
platformIcons,
|
|
3503
3601
|
transformPlatformConfigsToOptions,
|
|
@@ -3545,6 +3643,7 @@ export {
|
|
|
3545
3643
|
useApiParams,
|
|
3546
3644
|
useCursorPaginationState,
|
|
3547
3645
|
useNatsClient,
|
|
3646
|
+
useScenarioPlayer,
|
|
3548
3647
|
validateAccessCode,
|
|
3549
3648
|
consumeAccessCode,
|
|
3550
3649
|
validateAndConsumeAccessCode,
|
|
@@ -3597,4 +3696,4 @@ export {
|
|
|
3597
3696
|
useFormRescue,
|
|
3598
3697
|
useRescuedForm
|
|
3599
3698
|
};
|
|
3600
|
-
//# sourceMappingURL=chunk-
|
|
3699
|
+
//# sourceMappingURL=chunk-BNJBJTEK.js.map
|