@flamingo-stack/openframe-frontend-core 0.0.698-2527.7788.1 → 0.0.698
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-DMUUWHII.cjs → chunk-26GBOUIP.cjs} +92 -9
- package/dist/chunk-26GBOUIP.cjs.map +1 -0
- package/dist/{chunk-LJRMRHX3.js → chunk-2QESJBGE.js} +8 -8
- package/dist/{chunk-6FA7CKGO.cjs → chunk-3CFHHJKK.cjs} +3 -3
- package/dist/{chunk-6FA7CKGO.cjs.map → chunk-3CFHHJKK.cjs.map} +1 -1
- package/dist/{chunk-C36HIYNP.cjs → chunk-4FS56YZS.cjs} +681 -660
- package/dist/chunk-4FS56YZS.cjs.map +1 -0
- package/dist/{chunk-6JZJU3MT.cjs → chunk-55L6XDGC.cjs} +7 -7
- package/dist/{chunk-6JZJU3MT.cjs.map → chunk-55L6XDGC.cjs.map} +1 -1
- package/dist/{chunk-R6W6Q7LP.js → chunk-5VXVHYHC.js} +5 -5
- package/dist/{chunk-TQJCGJC3.cjs → chunk-676MGKZW.cjs} +5 -5
- package/dist/{chunk-TQJCGJC3.cjs.map → chunk-676MGKZW.cjs.map} +1 -1
- package/dist/{chunk-AUGTCILI.js → chunk-7QAT2DV5.js} +3 -3
- package/dist/{chunk-L4TUCNI2.js → chunk-AC6OEPUV.js} +6 -6
- package/dist/{chunk-G6ASUIGI.js → chunk-AXAGIZTZ.js} +21 -24
- package/dist/chunk-AXAGIZTZ.js.map +1 -0
- package/dist/{chunk-KAYOPKVW.cjs → chunk-BRTCMVBG.cjs} +15 -15
- package/dist/{chunk-KAYOPKVW.cjs.map → chunk-BRTCMVBG.cjs.map} +1 -1
- package/dist/{chunk-DBC5HYVO.cjs → chunk-BZHARMWU.cjs} +80 -80
- package/dist/{chunk-DBC5HYVO.cjs.map → chunk-BZHARMWU.cjs.map} +1 -1
- package/dist/{chunk-LXKEHZUV.cjs → chunk-COX4CSXZ.cjs} +466 -469
- package/dist/chunk-COX4CSXZ.cjs.map +1 -0
- package/dist/{chunk-AVRVYWCS.js → chunk-CXQTK6W3.js} +89 -6
- package/dist/chunk-CXQTK6W3.js.map +1 -0
- package/dist/{chunk-77DK66OI.cjs → chunk-FBXR26Q4.cjs} +50 -50
- package/dist/{chunk-77DK66OI.cjs.map → chunk-FBXR26Q4.cjs.map} +1 -1
- package/dist/{chunk-MRNN5TYM.js → chunk-FI7ZPOYQ.js} +27 -6
- package/dist/chunk-FI7ZPOYQ.js.map +1 -0
- package/dist/{chunk-UODSGUIM.js → chunk-FWVIDEOA.js} +2 -2
- package/dist/{chunk-OV6AUU2F.js → chunk-HNHKXOCZ.js} +7 -7
- package/dist/{chunk-DCKHFLXE.cjs → chunk-IRWS22CP.cjs} +22 -22
- package/dist/{chunk-DCKHFLXE.cjs.map → chunk-IRWS22CP.cjs.map} +1 -1
- package/dist/{chunk-SIQDC6VE.js → chunk-J3ZS6CRA.js} +4 -4
- package/dist/{chunk-ZYU3U3EI.js → chunk-J6ZEVCVN.js} +4 -4
- package/dist/{chunk-T3ZAMHEG.js → chunk-MOEOLUVD.js} +3 -3
- package/dist/{chunk-AHAZ6WLZ.cjs → chunk-OEX2WLZX.cjs} +10 -10
- package/dist/{chunk-AHAZ6WLZ.cjs.map → chunk-OEX2WLZX.cjs.map} +1 -1
- package/dist/{chunk-WCHS6P5U.js → chunk-R2XJXMAT.js} +6 -6
- package/dist/{chunk-DVDXCOTA.js → chunk-R4JFUVQ4.js} +3 -3
- package/dist/{chunk-UVRLSOEJ.js → chunk-TN2RFU6D.js} +113 -183
- package/dist/chunk-TN2RFU6D.js.map +1 -0
- package/dist/{chunk-MKOAFRVX.cjs → chunk-UXU4DROI.cjs} +12 -12
- package/dist/{chunk-MKOAFRVX.cjs.map → chunk-UXU4DROI.cjs.map} +1 -1
- package/dist/{chunk-VF37HVC4.cjs → chunk-VCEO6AGC.cjs} +18 -18
- package/dist/{chunk-VF37HVC4.cjs.map → chunk-VCEO6AGC.cjs.map} +1 -1
- package/dist/{chunk-UIWQO4OC.cjs → chunk-VO2FJ2AL.cjs} +36 -36
- package/dist/{chunk-UIWQO4OC.cjs.map → chunk-VO2FJ2AL.cjs.map} +1 -1
- package/dist/{chunk-COA3TIOD.js → chunk-VOSO3SC5.js} +5 -5
- package/dist/{chunk-W4YXUJOF.cjs → chunk-VP6PJLMI.cjs} +48 -118
- package/dist/chunk-VP6PJLMI.cjs.map +1 -0
- package/dist/{chunk-Z7OC25FG.cjs → chunk-VQEXKCFM.cjs} +5 -5
- package/dist/{chunk-Z7OC25FG.cjs.map → chunk-VQEXKCFM.cjs.map} +1 -1
- package/dist/{chunk-IMCBJOFN.cjs → chunk-X2W4ANCM.cjs} +43 -43
- package/dist/{chunk-IMCBJOFN.cjs.map → chunk-X2W4ANCM.cjs.map} +1 -1
- package/dist/{chunk-3WRN7VAD.js → chunk-YNBOPBO7.js} +4 -4
- package/dist/{chunk-LNUZHW4O.cjs → chunk-YRSPHPGO.cjs} +25 -25
- package/dist/{chunk-LNUZHW4O.cjs.map → chunk-YRSPHPGO.cjs.map} +1 -1
- package/dist/{chunk-HOZGKVRI.js → chunk-ZNJK5HOE.js} +2 -2
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/case-studies/index.cjs +17 -17
- package/dist/components/case-studies/index.js +5 -5
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/index.js +2 -2
- package/dist/components/contact/index.cjs +6 -6
- package/dist/components/contact/index.js +5 -5
- package/dist/components/docs/index.cjs +9 -9
- package/dist/components/docs/index.js +8 -8
- package/dist/components/embeds/index.cjs +6 -6
- package/dist/components/embeds/index.js +5 -5
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/faq/index.js +5 -5
- package/dist/components/features/cards-strip.d.ts.map +1 -1
- package/dist/components/features/index.cjs +5 -5
- package/dist/components/features/index.js +4 -4
- package/dist/components/help-center-pages/index.cjs +81 -81
- package/dist/components/help-center-pages/index.js +16 -16
- package/dist/components/index.cjs +48 -47
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +17 -16
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +32 -32
- package/dist/components/meeting-scheduler/index.js +4 -4
- package/dist/components/navigation/index.cjs +8 -8
- package/dist/components/navigation/index.js +7 -7
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/tickets/index.cjs +9 -9
- package/dist/components/tickets/index.js +8 -8
- package/dist/components/ui/index.cjs +5 -5
- package/dist/components/ui/index.js +4 -4
- package/dist/components/ui/marquee-wall.d.ts.map +1 -1
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/ui/use-in-view.d.ts +8 -1
- package/dist/hooks/ui/use-in-view.d.ts.map +1 -1
- package/dist/hooks/use-scenario-player.d.ts +3 -0
- package/dist/hooks/use-scenario-player.d.ts.map +1 -1
- package/dist/index.cjs +20 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/dist/utils/index.cjs +21 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +19 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/path-pattern.d.ts +5 -0
- package/dist/utils/path-pattern.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/announcement-bar.tsx +3 -2
- package/src/components/features/cards-strip.tsx +12 -11
- package/src/components/ui/marquee-wall.tsx +16 -14
- package/src/hooks/__tests__/use-scenario-player.test.tsx +48 -0
- package/src/hooks/ui/use-in-view.ts +15 -3
- package/src/hooks/use-scenario-player.ts +22 -2
- package/src/utils/__tests__/path-pattern.test.ts +30 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/path-pattern.ts +31 -0
- package/dist/chunk-AVRVYWCS.js.map +0 -1
- package/dist/chunk-C36HIYNP.cjs.map +0 -1
- package/dist/chunk-DMUUWHII.cjs.map +0 -1
- package/dist/chunk-G6ASUIGI.js.map +0 -1
- package/dist/chunk-LXKEHZUV.cjs.map +0 -1
- package/dist/chunk-MRNN5TYM.js.map +0 -1
- package/dist/chunk-UVRLSOEJ.js.map +0 -1
- package/dist/chunk-W4YXUJOF.cjs.map +0 -1
- /package/dist/{chunk-LJRMRHX3.js.map → chunk-2QESJBGE.js.map} +0 -0
- /package/dist/{chunk-R6W6Q7LP.js.map → chunk-5VXVHYHC.js.map} +0 -0
- /package/dist/{chunk-AUGTCILI.js.map → chunk-7QAT2DV5.js.map} +0 -0
- /package/dist/{chunk-L4TUCNI2.js.map → chunk-AC6OEPUV.js.map} +0 -0
- /package/dist/{chunk-UODSGUIM.js.map → chunk-FWVIDEOA.js.map} +0 -0
- /package/dist/{chunk-OV6AUU2F.js.map → chunk-HNHKXOCZ.js.map} +0 -0
- /package/dist/{chunk-SIQDC6VE.js.map → chunk-J3ZS6CRA.js.map} +0 -0
- /package/dist/{chunk-ZYU3U3EI.js.map → chunk-J6ZEVCVN.js.map} +0 -0
- /package/dist/{chunk-T3ZAMHEG.js.map → chunk-MOEOLUVD.js.map} +0 -0
- /package/dist/{chunk-WCHS6P5U.js.map → chunk-R2XJXMAT.js.map} +0 -0
- /package/dist/{chunk-DVDXCOTA.js.map → chunk-R4JFUVQ4.js.map} +0 -0
- /package/dist/{chunk-COA3TIOD.js.map → chunk-VOSO3SC5.js.map} +0 -0
- /package/dist/{chunk-3WRN7VAD.js.map → chunk-YNBOPBO7.js.map} +0 -0
- /package/dist/{chunk-HOZGKVRI.js.map → chunk-ZNJK5HOE.js.map} +0 -0
|
@@ -17,9 +17,10 @@ import {
|
|
|
17
17
|
getHashTargetElement,
|
|
18
18
|
normalizeHashFragment,
|
|
19
19
|
scrollElementIntoView,
|
|
20
|
+
useAutoplay,
|
|
20
21
|
useDebounce,
|
|
21
22
|
useMediaQuery
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CXQTK6W3.js";
|
|
23
24
|
import {
|
|
24
25
|
useRouter,
|
|
25
26
|
useSearchParams
|
|
@@ -896,81 +897,8 @@ function useWindowSize() {
|
|
|
896
897
|
// src/hooks/ui/index.ts
|
|
897
898
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
898
899
|
|
|
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
|
-
var STEPS = Array.from({ length: 21 }, (_, i) => i / 20);
|
|
911
|
-
function useInView({
|
|
912
|
-
threshold = 0,
|
|
913
|
-
rootMargin = "0px"
|
|
914
|
-
} = {}) {
|
|
915
|
-
const [inView, setInView] = useState10(false);
|
|
916
|
-
const observerRef = useRef8(null);
|
|
917
|
-
const disconnect = useCallback8(() => {
|
|
918
|
-
observerRef.current?.disconnect();
|
|
919
|
-
observerRef.current = null;
|
|
920
|
-
}, []);
|
|
921
|
-
const ref = useCallback8(
|
|
922
|
-
(node) => {
|
|
923
|
-
disconnect();
|
|
924
|
-
if (!node || typeof IntersectionObserver === "undefined") {
|
|
925
|
-
setInView(false);
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
const observer = new IntersectionObserver(
|
|
929
|
-
(entries) => {
|
|
930
|
-
const entry = entries[entries.length - 1];
|
|
931
|
-
if (!entry) return;
|
|
932
|
-
const ofElement = entry.intersectionRatio >= threshold;
|
|
933
|
-
const viewportHeight = entry.rootBounds?.height ?? 0;
|
|
934
|
-
const ofViewport = viewportHeight > 0 && (entry.intersectionRect?.height ?? 0) >= viewportHeight * threshold;
|
|
935
|
-
setInView(entry.isIntersecting && (ofElement || ofViewport));
|
|
936
|
-
},
|
|
937
|
-
{ threshold: STEPS, rootMargin }
|
|
938
|
-
);
|
|
939
|
-
observer.observe(node);
|
|
940
|
-
observerRef.current = observer;
|
|
941
|
-
},
|
|
942
|
-
[disconnect, threshold, rootMargin]
|
|
943
|
-
);
|
|
944
|
-
useEffect10(() => disconnect, [disconnect]);
|
|
945
|
-
return { ref, inView };
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
// src/hooks/ui/use-autoplay.ts
|
|
949
|
-
import { useEffect as useEffect11, useState as useState11 } from "react";
|
|
950
|
-
function useAutoplay(onScreen) {
|
|
951
|
-
const reducedState = usePrefersReducedMotionState();
|
|
952
|
-
const [paused, setPaused] = useState11(false);
|
|
953
|
-
const [tabHidden, setTabHidden] = useState11(false);
|
|
954
|
-
useEffect11(() => {
|
|
955
|
-
const sync2 = () => setTabHidden(document.visibilityState === "hidden");
|
|
956
|
-
sync2();
|
|
957
|
-
document.addEventListener("visibilitychange", sync2);
|
|
958
|
-
window.addEventListener("pageshow", sync2);
|
|
959
|
-
return () => {
|
|
960
|
-
document.removeEventListener("visibilitychange", sync2);
|
|
961
|
-
window.removeEventListener("pageshow", sync2);
|
|
962
|
-
};
|
|
963
|
-
}, []);
|
|
964
|
-
return {
|
|
965
|
-
playing: onScreen && !paused && !tabHidden && reducedState === false,
|
|
966
|
-
paused,
|
|
967
|
-
setPaused,
|
|
968
|
-
reducedMotion: reducedState === true
|
|
969
|
-
};
|
|
970
|
-
}
|
|
971
|
-
|
|
972
900
|
// src/hooks/platform/use-platform-config.ts
|
|
973
|
-
import { useState as
|
|
901
|
+
import { useState as useState10, useEffect as useEffect10 } from "react";
|
|
974
902
|
|
|
975
903
|
// src/utils/platform-config.tsx
|
|
976
904
|
import { Globe } from "lucide-react";
|
|
@@ -1083,10 +1011,10 @@ function toPlatformConfigs(payload) {
|
|
|
1083
1011
|
return configs;
|
|
1084
1012
|
}
|
|
1085
1013
|
function usePlatformConfig() {
|
|
1086
|
-
const [platforms, setPlatforms] =
|
|
1087
|
-
const [isLoading, setIsLoading] =
|
|
1088
|
-
const [error, setError] =
|
|
1089
|
-
|
|
1014
|
+
const [platforms, setPlatforms] = useState10(platformCache || []);
|
|
1015
|
+
const [isLoading, setIsLoading] = useState10(!platformCache);
|
|
1016
|
+
const [error, setError] = useState10(null);
|
|
1017
|
+
useEffect10(() => {
|
|
1090
1018
|
const commit = (data) => {
|
|
1091
1019
|
setPlatforms((prev) => prev === data ? prev : data);
|
|
1092
1020
|
setIsLoading(false);
|
|
@@ -1154,7 +1082,7 @@ function useValidatePlatform(value) {
|
|
|
1154
1082
|
import { toast as sonnerToast2 } from "sonner";
|
|
1155
1083
|
|
|
1156
1084
|
// src/components/ui/toaster.tsx
|
|
1157
|
-
import { useState as
|
|
1085
|
+
import { useState as useState11 } from "react";
|
|
1158
1086
|
import { Toaster as SonnerToaster, toast as sonnerToast } from "sonner";
|
|
1159
1087
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1160
1088
|
var dotColorByVariant = {
|
|
@@ -1270,7 +1198,7 @@ function CommandApprovalToast({
|
|
|
1270
1198
|
defaultExpanded = false,
|
|
1271
1199
|
className
|
|
1272
1200
|
}) {
|
|
1273
|
-
const [expanded, setExpanded] =
|
|
1201
|
+
const [expanded, setExpanded] = useState11(defaultExpanded);
|
|
1274
1202
|
const handleApprove = () => {
|
|
1275
1203
|
onApprove?.();
|
|
1276
1204
|
sonnerToast.dismiss(id);
|
|
@@ -1470,15 +1398,15 @@ var useToast = () => ({
|
|
|
1470
1398
|
});
|
|
1471
1399
|
|
|
1472
1400
|
// src/hooks/use-contact-submission.ts
|
|
1473
|
-
import { useState as
|
|
1401
|
+
import { useState as useState12, useCallback as useCallback8, useEffect as useEffect11 } from "react";
|
|
1474
1402
|
function useContactSubmission(options = {}) {
|
|
1475
1403
|
const { userId, successRedirectUrl, successToastMessage, onSuccess } = options;
|
|
1476
1404
|
const { toast: toast2 } = useToast();
|
|
1477
1405
|
const router = useRouter();
|
|
1478
1406
|
const { contactUrl } = useRequiredEndpointsRuntime();
|
|
1479
|
-
const [isSubmitting, setIsSubmitting] =
|
|
1480
|
-
const [isSuccess, setIsSuccess] =
|
|
1481
|
-
const submit =
|
|
1407
|
+
const [isSubmitting, setIsSubmitting] = useState12(false);
|
|
1408
|
+
const [isSuccess, setIsSuccess] = useState12(false);
|
|
1409
|
+
const submit = useCallback8(
|
|
1482
1410
|
async (formData) => {
|
|
1483
1411
|
if (isSubmitting) return;
|
|
1484
1412
|
setIsSubmitting(true);
|
|
@@ -1516,7 +1444,7 @@ function useContactSubmission(options = {}) {
|
|
|
1516
1444
|
},
|
|
1517
1445
|
[isSubmitting, toast2, userId, successToastMessage, contactUrl]
|
|
1518
1446
|
);
|
|
1519
|
-
|
|
1447
|
+
useEffect11(() => {
|
|
1520
1448
|
if (!isSuccess || !successRedirectUrl) return void 0;
|
|
1521
1449
|
console.log("\u{1F680} Contact submission successful, redirecting to:", successRedirectUrl);
|
|
1522
1450
|
const timer = setTimeout(() => {
|
|
@@ -1529,7 +1457,7 @@ function useContactSubmission(options = {}) {
|
|
|
1529
1457
|
}, 1500);
|
|
1530
1458
|
return () => clearTimeout(timer);
|
|
1531
1459
|
}, [isSuccess, successRedirectUrl, router]);
|
|
1532
|
-
|
|
1460
|
+
useEffect11(() => {
|
|
1533
1461
|
if (isSuccess && onSuccess) {
|
|
1534
1462
|
onSuccess();
|
|
1535
1463
|
}
|
|
@@ -1538,7 +1466,7 @@ function useContactSubmission(options = {}) {
|
|
|
1538
1466
|
}
|
|
1539
1467
|
|
|
1540
1468
|
// src/hooks/use-copy-to-clipboard.ts
|
|
1541
|
-
import { useCallback as
|
|
1469
|
+
import { useCallback as useCallback9, useState as useState13 } from "react";
|
|
1542
1470
|
function useCopyToClipboard({
|
|
1543
1471
|
successTitle = "Copied",
|
|
1544
1472
|
successDescription = "Copied to clipboard",
|
|
@@ -1547,8 +1475,8 @@ function useCopyToClipboard({
|
|
|
1547
1475
|
resetDelay = 2e3
|
|
1548
1476
|
} = {}) {
|
|
1549
1477
|
const { toast: toast2 } = useToast();
|
|
1550
|
-
const [copied, setCopied] =
|
|
1551
|
-
const copy =
|
|
1478
|
+
const [copied, setCopied] = useState13(false);
|
|
1479
|
+
const copy = useCallback9(
|
|
1552
1480
|
async (text) => {
|
|
1553
1481
|
try {
|
|
1554
1482
|
await navigator.clipboard.writeText(text);
|
|
@@ -1565,7 +1493,7 @@ function useCopyToClipboard({
|
|
|
1565
1493
|
}
|
|
1566
1494
|
|
|
1567
1495
|
// src/hooks/use-batch-images.ts
|
|
1568
|
-
import { useEffect as
|
|
1496
|
+
import { useEffect as useEffect12, useMemo as useMemo3, useState as useState14, useRef as useRef8 } from "react";
|
|
1569
1497
|
var globalBatchImageConfig = {};
|
|
1570
1498
|
function configureBatchImageFetch(config) {
|
|
1571
1499
|
globalBatchImageConfig = { ...globalBatchImageConfig, ...config };
|
|
@@ -1638,17 +1566,17 @@ async function batchFetchAuthenticatedImages(imageUrls, config) {
|
|
|
1638
1566
|
return results;
|
|
1639
1567
|
}
|
|
1640
1568
|
function useBatchImages(imageUrls, config) {
|
|
1641
|
-
const [fetchedImages, setFetchedImages] =
|
|
1569
|
+
const [fetchedImages, setFetchedImages] = useState14({});
|
|
1642
1570
|
const uniqueUrls = useMemo3(
|
|
1643
1571
|
() => Array.from(new Set(imageUrls.filter((url) => Boolean(url)))),
|
|
1644
1572
|
[imageUrls]
|
|
1645
1573
|
);
|
|
1646
|
-
const requestedUrls =
|
|
1647
|
-
const fetchedImagesRef =
|
|
1648
|
-
|
|
1574
|
+
const requestedUrls = useRef8(/* @__PURE__ */ new Set());
|
|
1575
|
+
const fetchedImagesRef = useRef8(fetchedImages);
|
|
1576
|
+
useEffect12(() => {
|
|
1649
1577
|
fetchedImagesRef.current = fetchedImages;
|
|
1650
1578
|
}, [fetchedImages]);
|
|
1651
|
-
|
|
1579
|
+
useEffect12(
|
|
1652
1580
|
() => () => {
|
|
1653
1581
|
Object.values(fetchedImagesRef.current).forEach((blobUrl) => {
|
|
1654
1582
|
if (blobUrl && blobUrl.startsWith("blob:")) {
|
|
@@ -1658,7 +1586,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
1658
1586
|
},
|
|
1659
1587
|
[]
|
|
1660
1588
|
);
|
|
1661
|
-
|
|
1589
|
+
useEffect12(() => {
|
|
1662
1590
|
const urlsToFetch = uniqueUrls.filter((url) => !requestedUrls.current.has(url));
|
|
1663
1591
|
if (urlsToFetch.length === 0) {
|
|
1664
1592
|
return;
|
|
@@ -1676,7 +1604,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
1676
1604
|
}
|
|
1677
1605
|
|
|
1678
1606
|
// src/hooks/use-authenticated-image.ts
|
|
1679
|
-
import { useEffect as
|
|
1607
|
+
import { useEffect as useEffect13, useState as useState15, useRef as useRef9 } from "react";
|
|
1680
1608
|
var globalImageConfig = {};
|
|
1681
1609
|
var imageCache = /* @__PURE__ */ new Map();
|
|
1682
1610
|
var pendingRequests = /* @__PURE__ */ new Map();
|
|
@@ -1705,8 +1633,8 @@ function getImageConfig() {
|
|
|
1705
1633
|
};
|
|
1706
1634
|
}
|
|
1707
1635
|
function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
1708
|
-
const [settled, setSettled] =
|
|
1709
|
-
const currentCacheKeyRef =
|
|
1636
|
+
const [settled, setSettled] = useState15(null);
|
|
1637
|
+
const currentCacheKeyRef = useRef9(null);
|
|
1710
1638
|
const { tenantHostUrl, enableDevMode, accessTokenKey } = {
|
|
1711
1639
|
...getImageConfig(),
|
|
1712
1640
|
...config
|
|
@@ -1724,7 +1652,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1724
1652
|
}
|
|
1725
1653
|
}
|
|
1726
1654
|
const cacheKey = fullImageUrl === null ? null : refreshKey ? `${fullImageUrl}?v=${refreshKey}` : fullImageUrl;
|
|
1727
|
-
|
|
1655
|
+
useEffect13(() => {
|
|
1728
1656
|
if (cacheKey === null) {
|
|
1729
1657
|
if (currentCacheKeyRef.current) {
|
|
1730
1658
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -1801,7 +1729,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1801
1729
|
});
|
|
1802
1730
|
pendingRequests.set(cacheKey, fetchPromise2);
|
|
1803
1731
|
}, [cacheKey, fullImageUrl, refreshKey, enableDevMode, accessTokenKey]);
|
|
1804
|
-
|
|
1732
|
+
useEffect13(() => {
|
|
1805
1733
|
return () => {
|
|
1806
1734
|
if (currentCacheKeyRef.current) {
|
|
1807
1735
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -1822,7 +1750,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1822
1750
|
}
|
|
1823
1751
|
|
|
1824
1752
|
// src/hooks/state/use-query-params.ts
|
|
1825
|
-
import { useEffect as
|
|
1753
|
+
import { useEffect as useEffect14, useState as useState16, useMemo as useMemo4, useCallback as useCallback10, useRef as useRef10 } from "react";
|
|
1826
1754
|
|
|
1827
1755
|
// src/hooks/state/flatten-schema.ts
|
|
1828
1756
|
function flattenQueryVariables(queryVariables, introspector2) {
|
|
@@ -2273,26 +2201,26 @@ function validateVariables(variables, schema) {
|
|
|
2273
2201
|
function useQueryParams(query, options = {}) {
|
|
2274
2202
|
const router = useRouter();
|
|
2275
2203
|
const searchParams = useSearchParams();
|
|
2276
|
-
const [isLoading, setIsLoading] =
|
|
2277
|
-
const [isReady, setIsReady] =
|
|
2278
|
-
const [error, setError] =
|
|
2279
|
-
const [schema, setSchema] =
|
|
2204
|
+
const [isLoading, setIsLoading] = useState16(true);
|
|
2205
|
+
const [isReady, setIsReady] = useState16(false);
|
|
2206
|
+
const [error, setError] = useState16(null);
|
|
2207
|
+
const [schema, setSchema] = useState16({});
|
|
2280
2208
|
const defaultValues = useMemo4(() => options.defaultValues || {}, [options.defaultValues]);
|
|
2281
2209
|
const skipIntrospection = options.skipIntrospection || false;
|
|
2282
2210
|
const debug = options.debug || false;
|
|
2283
|
-
const initSourceRef =
|
|
2211
|
+
const initSourceRef = useRef10({
|
|
2284
2212
|
introspectionHeaders: options.introspectionHeaders,
|
|
2285
2213
|
paramMapping: options.paramMapping,
|
|
2286
2214
|
defaultValues
|
|
2287
2215
|
});
|
|
2288
|
-
|
|
2216
|
+
useEffect14(() => {
|
|
2289
2217
|
initSourceRef.current = {
|
|
2290
2218
|
introspectionHeaders: options.introspectionHeaders,
|
|
2291
2219
|
paramMapping: options.paramMapping,
|
|
2292
2220
|
defaultValues
|
|
2293
2221
|
};
|
|
2294
2222
|
});
|
|
2295
|
-
|
|
2223
|
+
useEffect14(() => {
|
|
2296
2224
|
let cancelled = false;
|
|
2297
2225
|
async function initialize() {
|
|
2298
2226
|
try {
|
|
@@ -2369,7 +2297,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2369
2297
|
});
|
|
2370
2298
|
return result;
|
|
2371
2299
|
}, [searchParams]);
|
|
2372
|
-
const updateUrl =
|
|
2300
|
+
const updateUrl = useCallback10(
|
|
2373
2301
|
(newParams) => {
|
|
2374
2302
|
const url = newParams.toString() ? `?${newParams.toString()}` : window.location.pathname;
|
|
2375
2303
|
if (debug) {
|
|
@@ -2379,7 +2307,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2379
2307
|
},
|
|
2380
2308
|
[router, debug]
|
|
2381
2309
|
);
|
|
2382
|
-
const setParam =
|
|
2310
|
+
const setParam = useCallback10(
|
|
2383
2311
|
(key, value) => {
|
|
2384
2312
|
if (!isReady) {
|
|
2385
2313
|
console.warn("[useQueryParams] Schema not ready, cannot set param");
|
|
@@ -2395,7 +2323,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2395
2323
|
},
|
|
2396
2324
|
[variables, schema, isReady, updateUrl]
|
|
2397
2325
|
);
|
|
2398
|
-
const setParams =
|
|
2326
|
+
const setParams = useCallback10(
|
|
2399
2327
|
(updates) => {
|
|
2400
2328
|
if (!isReady) {
|
|
2401
2329
|
console.warn("[useQueryParams] Schema not ready, cannot set params");
|
|
@@ -2411,7 +2339,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2411
2339
|
},
|
|
2412
2340
|
[variables, schema, isReady, updateUrl]
|
|
2413
2341
|
);
|
|
2414
|
-
const clearParamsHandler =
|
|
2342
|
+
const clearParamsHandler = useCallback10(
|
|
2415
2343
|
(keys) => {
|
|
2416
2344
|
if (!isReady) {
|
|
2417
2345
|
console.warn("[useQueryParams] Schema not ready, cannot clear params");
|
|
@@ -2427,7 +2355,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2427
2355
|
},
|
|
2428
2356
|
[variables, schema, isReady, updateUrl]
|
|
2429
2357
|
);
|
|
2430
|
-
const resetParams =
|
|
2358
|
+
const resetParams = useCallback10(() => {
|
|
2431
2359
|
if (debug) {
|
|
2432
2360
|
console.log("[useQueryParams] Resetting params");
|
|
2433
2361
|
}
|
|
@@ -2462,9 +2390,9 @@ function applyParamMapping(schema, mapping) {
|
|
|
2462
2390
|
}
|
|
2463
2391
|
|
|
2464
2392
|
// src/hooks/state/use-api-params.ts
|
|
2465
|
-
import { useCallback as
|
|
2393
|
+
import { useCallback as useCallback11, useEffect as useEffect15, useMemo as useMemo5, useRef as useRef11, useState as useState17 } from "react";
|
|
2466
2394
|
function useContentStable(value, key) {
|
|
2467
|
-
const [cached, setCached] =
|
|
2395
|
+
const [cached, setCached] = useState17({ value, key });
|
|
2468
2396
|
if (cached.key !== key) setCached({ value, key });
|
|
2469
2397
|
return cached.key === key ? cached.value : value;
|
|
2470
2398
|
}
|
|
@@ -2491,9 +2419,9 @@ function useApiParams(schema, options = {}) {
|
|
|
2491
2419
|
const searchParamsLive = useSearchParams();
|
|
2492
2420
|
const debug = options.debug || false;
|
|
2493
2421
|
const searchString = searchParamsLive.toString();
|
|
2494
|
-
const pendingRef =
|
|
2495
|
-
const [pendingTail, setPendingTail] =
|
|
2496
|
-
const syncPendingTail =
|
|
2422
|
+
const pendingRef = useRef11([]);
|
|
2423
|
+
const [pendingTail, setPendingTail] = useState17(void 0);
|
|
2424
|
+
const syncPendingTail = useCallback11(() => {
|
|
2497
2425
|
setPendingTail(pendingRef.current[pendingRef.current.length - 1]);
|
|
2498
2426
|
}, []);
|
|
2499
2427
|
const schemaKey = useMemo5(() => JSON.stringify(schema), [schema]);
|
|
@@ -2521,14 +2449,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2521
2449
|
}
|
|
2522
2450
|
return result;
|
|
2523
2451
|
}, [searchString, debug, stableSchema, options.absent]);
|
|
2524
|
-
const [paramsCache, setParamsCache] =
|
|
2452
|
+
const [paramsCache, setParamsCache] = useState17(() => ({ src: rawParams, value: rawParams }));
|
|
2525
2453
|
let stableParams = paramsCache.value;
|
|
2526
2454
|
if (paramsCache.src !== rawParams) {
|
|
2527
2455
|
stableParams = reuseArrayRefs(paramsCache.value, rawParams);
|
|
2528
2456
|
setParamsCache({ src: rawParams, value: stableParams });
|
|
2529
2457
|
}
|
|
2530
2458
|
const params = stableParams;
|
|
2531
|
-
const addParamToSearchParams =
|
|
2459
|
+
const addParamToSearchParams = useCallback11((searchParams, key, value) => {
|
|
2532
2460
|
for (const [k, v] of createSearchParams({ [key]: value })) searchParams.append(k, v);
|
|
2533
2461
|
}, []);
|
|
2534
2462
|
const urlSearchParams = useMemo5(() => {
|
|
@@ -2543,7 +2471,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2543
2471
|
}
|
|
2544
2472
|
return newParams;
|
|
2545
2473
|
}, [params, flattenedSchema, addParamToSearchParams, stableSchema]);
|
|
2546
|
-
const updateUrl =
|
|
2474
|
+
const updateUrl = useCallback11(
|
|
2547
2475
|
(newParams, keysToRemove = []) => {
|
|
2548
2476
|
const base = pendingRef.current[pendingRef.current.length - 1] ?? searchString;
|
|
2549
2477
|
const finalParams = new URLSearchParams(base);
|
|
@@ -2578,14 +2506,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2578
2506
|
},
|
|
2579
2507
|
[router, debug, searchString, stableSchema, syncPendingTail]
|
|
2580
2508
|
);
|
|
2581
|
-
|
|
2509
|
+
useEffect15(() => {
|
|
2582
2510
|
const queue = pendingRef.current;
|
|
2583
2511
|
if (queue.length === 0) return;
|
|
2584
2512
|
const hit = queue.indexOf(searchString);
|
|
2585
2513
|
pendingRef.current = hit === -1 ? [] : queue.slice(hit + 1);
|
|
2586
2514
|
syncPendingTail();
|
|
2587
2515
|
}, [searchString, syncPendingTail]);
|
|
2588
|
-
const setParam =
|
|
2516
|
+
const setParam = useCallback11(
|
|
2589
2517
|
(key, value) => {
|
|
2590
2518
|
const config = stableSchema[key];
|
|
2591
2519
|
if (!config) {
|
|
@@ -2602,7 +2530,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2602
2530
|
},
|
|
2603
2531
|
[updateUrl, addParamToSearchParams, stableSchema]
|
|
2604
2532
|
);
|
|
2605
|
-
const setParams =
|
|
2533
|
+
const setParams = useCallback11(
|
|
2606
2534
|
(updates) => {
|
|
2607
2535
|
const newParams = new URLSearchParams();
|
|
2608
2536
|
const keysToRemove = [];
|
|
@@ -2622,14 +2550,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2622
2550
|
},
|
|
2623
2551
|
[updateUrl, addParamToSearchParams, stableSchema, flattenedSchema]
|
|
2624
2552
|
);
|
|
2625
|
-
const clearParams2 =
|
|
2553
|
+
const clearParams2 = useCallback11(
|
|
2626
2554
|
(keys) => {
|
|
2627
2555
|
const newParams = new URLSearchParams();
|
|
2628
2556
|
updateUrl(newParams, keys);
|
|
2629
2557
|
},
|
|
2630
2558
|
[updateUrl]
|
|
2631
2559
|
);
|
|
2632
|
-
const resetParams =
|
|
2560
|
+
const resetParams = useCallback11(() => {
|
|
2633
2561
|
if (debug) {
|
|
2634
2562
|
console.log("[useApiParams] Resetting params");
|
|
2635
2563
|
}
|
|
@@ -2653,7 +2581,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2653
2581
|
}
|
|
2654
2582
|
|
|
2655
2583
|
// src/hooks/state/use-cursor-pagination-state.ts
|
|
2656
|
-
import { useCallback as
|
|
2584
|
+
import { useCallback as useCallback12, useEffect as useEffect16, useRef as useRef12, useState as useState18 } from "react";
|
|
2657
2585
|
var urlSchema = {
|
|
2658
2586
|
search: { type: "string", default: "" },
|
|
2659
2587
|
cursor: { type: "string", default: "" }
|
|
@@ -2661,21 +2589,21 @@ var urlSchema = {
|
|
|
2661
2589
|
function useCursorPaginationState(options) {
|
|
2662
2590
|
const { onInitialLoad, onSearchChange } = options;
|
|
2663
2591
|
const { params, setParam, setParams } = useApiParams(urlSchema);
|
|
2664
|
-
const [searchInput, setSearchInput] =
|
|
2665
|
-
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] =
|
|
2666
|
-
const [initialLoadCount, setInitialLoadCount] =
|
|
2667
|
-
const lastSearchRef =
|
|
2668
|
-
const isSyncingFromUrl =
|
|
2669
|
-
const isInitialLoadInProgress =
|
|
2670
|
-
const searchInputRef =
|
|
2671
|
-
const onInitialLoadRef =
|
|
2672
|
-
const paramsRef =
|
|
2673
|
-
|
|
2592
|
+
const [searchInput, setSearchInput] = useState18(params.search || "");
|
|
2593
|
+
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] = useState18(false);
|
|
2594
|
+
const [initialLoadCount, setInitialLoadCount] = useState18(0);
|
|
2595
|
+
const lastSearchRef = useRef12(null);
|
|
2596
|
+
const isSyncingFromUrl = useRef12(false);
|
|
2597
|
+
const isInitialLoadInProgress = useRef12(true);
|
|
2598
|
+
const searchInputRef = useRef12(searchInput);
|
|
2599
|
+
const onInitialLoadRef = useRef12(onInitialLoad);
|
|
2600
|
+
const paramsRef = useRef12(params);
|
|
2601
|
+
useEffect16(() => {
|
|
2674
2602
|
searchInputRef.current = searchInput;
|
|
2675
2603
|
onInitialLoadRef.current = onInitialLoad;
|
|
2676
2604
|
paramsRef.current = params;
|
|
2677
2605
|
});
|
|
2678
|
-
|
|
2606
|
+
useEffect16(() => {
|
|
2679
2607
|
if (isInitialLoadInProgress.current) return;
|
|
2680
2608
|
const urlSearch = params.search || "";
|
|
2681
2609
|
if (urlSearch !== searchInputRef.current) {
|
|
@@ -2686,7 +2614,7 @@ function useCursorPaginationState(options) {
|
|
|
2686
2614
|
}, 0);
|
|
2687
2615
|
}
|
|
2688
2616
|
}, [params.search, initialLoadCount]);
|
|
2689
|
-
|
|
2617
|
+
useEffect16(() => {
|
|
2690
2618
|
if (isInitialLoadInProgress.current) return;
|
|
2691
2619
|
if (isSyncingFromUrl.current) return;
|
|
2692
2620
|
if (searchInput !== params.search) {
|
|
@@ -2697,7 +2625,7 @@ function useCursorPaginationState(options) {
|
|
|
2697
2625
|
});
|
|
2698
2626
|
}
|
|
2699
2627
|
}, [searchInput, params.search, setParams, initialLoadCount]);
|
|
2700
|
-
|
|
2628
|
+
useEffect16(() => {
|
|
2701
2629
|
if (initialLoadCount === 0) {
|
|
2702
2630
|
const cursor = paramsRef.current.cursor || null;
|
|
2703
2631
|
const search = paramsRef.current.search || "";
|
|
@@ -2713,7 +2641,7 @@ function useCursorPaginationState(options) {
|
|
|
2713
2641
|
});
|
|
2714
2642
|
}
|
|
2715
2643
|
}, [initialLoadCount]);
|
|
2716
|
-
|
|
2644
|
+
useEffect16(() => {
|
|
2717
2645
|
if (isInitialLoadInProgress.current) return;
|
|
2718
2646
|
if (initialLoadCount === 0) return;
|
|
2719
2647
|
const currentSearch = params.search || "";
|
|
@@ -2725,7 +2653,7 @@ function useCursorPaginationState(options) {
|
|
|
2725
2653
|
});
|
|
2726
2654
|
}
|
|
2727
2655
|
}, [params.search, onSearchChange, initialLoadCount]);
|
|
2728
|
-
const handleNextPage =
|
|
2656
|
+
const handleNextPage = useCallback12(
|
|
2729
2657
|
async (endCursor, fetchFn) => {
|
|
2730
2658
|
setParam("cursor", endCursor);
|
|
2731
2659
|
await fetchFn();
|
|
@@ -2733,7 +2661,7 @@ function useCursorPaginationState(options) {
|
|
|
2733
2661
|
},
|
|
2734
2662
|
[setParam]
|
|
2735
2663
|
);
|
|
2736
|
-
const handleResetToFirstPage =
|
|
2664
|
+
const handleResetToFirstPage = useCallback12(
|
|
2737
2665
|
async (fetchFn) => {
|
|
2738
2666
|
setParam("cursor", "");
|
|
2739
2667
|
await fetchFn();
|
|
@@ -2755,22 +2683,22 @@ function useCursorPaginationState(options) {
|
|
|
2755
2683
|
}
|
|
2756
2684
|
|
|
2757
2685
|
// src/hooks/nats/use-nats-client.ts
|
|
2758
|
-
import { useEffect as
|
|
2686
|
+
import { useEffect as useEffect17, useMemo as useMemo6, useState as useState19 } from "react";
|
|
2759
2687
|
function useNatsClient(clientOptions, options = {}) {
|
|
2760
2688
|
const { autoConnect = true } = options;
|
|
2761
2689
|
const client = useMemo6(() => {
|
|
2762
2690
|
if (!clientOptions) return null;
|
|
2763
2691
|
return createNatsClient(clientOptions);
|
|
2764
2692
|
}, [clientOptions]);
|
|
2765
|
-
const [status, setStatus] =
|
|
2766
|
-
const [lastError, setLastError] =
|
|
2767
|
-
const [statusClient, setStatusClient] =
|
|
2693
|
+
const [status, setStatus] = useState19("disconnected");
|
|
2694
|
+
const [lastError, setLastError] = useState19(null);
|
|
2695
|
+
const [statusClient, setStatusClient] = useState19(client);
|
|
2768
2696
|
if (statusClient !== client) {
|
|
2769
2697
|
setStatusClient(client);
|
|
2770
2698
|
setStatus("disconnected");
|
|
2771
2699
|
setLastError(null);
|
|
2772
2700
|
}
|
|
2773
|
-
|
|
2701
|
+
useEffect17(() => {
|
|
2774
2702
|
if (!client) return void 0;
|
|
2775
2703
|
const off = client.onStatus((event) => {
|
|
2776
2704
|
setStatus(event.status);
|
|
@@ -2797,7 +2725,8 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
2797
2725
|
}
|
|
2798
2726
|
|
|
2799
2727
|
// src/hooks/use-scenario-player.ts
|
|
2800
|
-
import { useCallback as
|
|
2728
|
+
import { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef13, useState as useState20 } from "react";
|
|
2729
|
+
var START_MS = 300;
|
|
2801
2730
|
function useScenarioPlayer({
|
|
2802
2731
|
scenarioCount,
|
|
2803
2732
|
lastStep: lastStepOption,
|
|
@@ -2809,14 +2738,20 @@ function useScenarioPlayer({
|
|
|
2809
2738
|
}) {
|
|
2810
2739
|
const auto = useAutoplay(enabled);
|
|
2811
2740
|
const { reducedMotion, paused, setPaused } = auto;
|
|
2812
|
-
const [scenario, setScenario] =
|
|
2813
|
-
const [rawStep, setRawStep] =
|
|
2741
|
+
const [scenario, setScenario] = useState20(initialScenario);
|
|
2742
|
+
const [rawStep, setRawStep] = useState20(startAtEnd ? Number.MAX_SAFE_INTEGER : 0);
|
|
2814
2743
|
const lastStep = typeof lastStepOption === "function" ? lastStepOption(scenario) : lastStepOption;
|
|
2815
2744
|
const step = reducedMotion ? lastStep : Math.min(rawStep, lastStep);
|
|
2816
2745
|
const playing = auto.playing && scenarioCount > 0;
|
|
2817
|
-
|
|
2746
|
+
const starting = useRef13(false);
|
|
2747
|
+
const wasPlaying = useRef13(false);
|
|
2748
|
+
useEffect18(() => {
|
|
2749
|
+
if (playing && !wasPlaying.current) starting.current = true;
|
|
2750
|
+
wasPlaying.current = playing;
|
|
2818
2751
|
if (!playing) return void 0;
|
|
2819
2752
|
const atEnd = rawStep >= lastStep;
|
|
2753
|
+
const quickStart = starting.current && !atEnd;
|
|
2754
|
+
starting.current = false;
|
|
2820
2755
|
const timer = setTimeout(
|
|
2821
2756
|
() => {
|
|
2822
2757
|
if (atEnd) {
|
|
@@ -2826,18 +2761,18 @@ function useScenarioPlayer({
|
|
|
2826
2761
|
setRawStep((current) => Math.min(current, lastStep) + 1);
|
|
2827
2762
|
}
|
|
2828
2763
|
},
|
|
2829
|
-
atEnd ? holdMs : stepMs
|
|
2764
|
+
atEnd ? holdMs : quickStart ? Math.min(START_MS, stepMs) : stepMs
|
|
2830
2765
|
);
|
|
2831
2766
|
return () => clearTimeout(timer);
|
|
2832
2767
|
}, [playing, rawStep, lastStep, stepMs, holdMs, scenario, scenarioCount]);
|
|
2833
|
-
const setStep =
|
|
2768
|
+
const setStep = useCallback13(
|
|
2834
2769
|
(next) => {
|
|
2835
2770
|
setRawStep(Math.max(0, Math.min(lastStep, next)));
|
|
2836
2771
|
setPaused(false);
|
|
2837
2772
|
},
|
|
2838
2773
|
[lastStep, setPaused]
|
|
2839
2774
|
);
|
|
2840
|
-
const go =
|
|
2775
|
+
const go = useCallback13(
|
|
2841
2776
|
(next) => {
|
|
2842
2777
|
setScenario(next);
|
|
2843
2778
|
setRawStep(0);
|
|
@@ -2951,7 +2886,7 @@ function useAccessCodeIntegration() {
|
|
|
2951
2886
|
}
|
|
2952
2887
|
|
|
2953
2888
|
// src/hooks/use-claude-mirror-src.ts
|
|
2954
|
-
import { useEffect as
|
|
2889
|
+
import { useEffect as useEffect19, useState as useState21 } from "react";
|
|
2955
2890
|
|
|
2956
2891
|
// src/utils/embed-url-converters.ts
|
|
2957
2892
|
function toGoogleSheetsEmbedUrl(url) {
|
|
@@ -3041,9 +2976,9 @@ async function revalidateMirror(mirrorPath) {
|
|
|
3041
2976
|
function useClaudeMirrorSrc(url) {
|
|
3042
2977
|
const endpoints = useEndpointsRuntime();
|
|
3043
2978
|
const mirrorPath = toClaudeMirrorPath(url, endpoints?.storageViewBaseUrl);
|
|
3044
|
-
const [resolved, setResolved] =
|
|
2979
|
+
const [resolved, setResolved] = useState21(null);
|
|
3045
2980
|
const state = resolved && resolved.key === mirrorPath ? resolved.value : { src: null, status: mirrorPath ? "probing" : "absent" };
|
|
3046
|
-
|
|
2981
|
+
useEffect19(() => {
|
|
3047
2982
|
if (!mirrorPath) return void 0;
|
|
3048
2983
|
let cancelled = false;
|
|
3049
2984
|
const settle = (value) => {
|
|
@@ -3070,11 +3005,11 @@ function useClaudeMirrorSrc(url) {
|
|
|
3070
3005
|
}
|
|
3071
3006
|
|
|
3072
3007
|
// src/hooks/use-scroll-to-hash.ts
|
|
3073
|
-
import { useEffect as
|
|
3008
|
+
import { useEffect as useEffect20 } from "react";
|
|
3074
3009
|
var MAX_POLL_FRAMES = 60;
|
|
3075
3010
|
function useScrollToHash(readyDep = true, options) {
|
|
3076
3011
|
const headerOffset = options?.headerOffset ?? 0;
|
|
3077
|
-
|
|
3012
|
+
useEffect20(() => {
|
|
3078
3013
|
if (typeof window === "undefined") return void 0;
|
|
3079
3014
|
if (readyDep === null || readyDep === false) return void 0;
|
|
3080
3015
|
let rafId = null;
|
|
@@ -3114,7 +3049,7 @@ function useScrollToHash(readyDep = true, options) {
|
|
|
3114
3049
|
}
|
|
3115
3050
|
|
|
3116
3051
|
// src/hooks/use-humanity-signals.ts
|
|
3117
|
-
import { useCallback as
|
|
3052
|
+
import { useCallback as useCallback14, useRef as useRef14, useState as useState22 } from "react";
|
|
3118
3053
|
|
|
3119
3054
|
// src/utils/humanity-signals.ts
|
|
3120
3055
|
var HONEYPOT_FIELD = "form_extra_note";
|
|
@@ -3177,16 +3112,16 @@ var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [
|
|
|
3177
3112
|
// src/hooks/use-humanity-signals.ts
|
|
3178
3113
|
function useHumanitySignals() {
|
|
3179
3114
|
const ref = useRef14(null);
|
|
3180
|
-
const [mountedAt] =
|
|
3115
|
+
const [mountedAt] = useState22(() => typeof performance !== "undefined" ? performance.now() : 0);
|
|
3181
3116
|
const startedAtRef = useRef14(mountedAt);
|
|
3182
|
-
const getSignals =
|
|
3117
|
+
const getSignals = useCallback14(
|
|
3183
3118
|
() => ({
|
|
3184
3119
|
[HONEYPOT_FIELD]: ref.current?.value ?? "",
|
|
3185
3120
|
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - startedAtRef.current) : 0
|
|
3186
3121
|
}),
|
|
3187
3122
|
[]
|
|
3188
3123
|
);
|
|
3189
|
-
const resetSignals =
|
|
3124
|
+
const resetSignals = useCallback14(() => {
|
|
3190
3125
|
if (ref.current) ref.current.value = "";
|
|
3191
3126
|
if (typeof performance !== "undefined") startedAtRef.current = performance.now();
|
|
3192
3127
|
}, []);
|
|
@@ -3194,7 +3129,7 @@ function useHumanitySignals() {
|
|
|
3194
3129
|
}
|
|
3195
3130
|
|
|
3196
3131
|
// src/hooks/use-form-rescue.ts
|
|
3197
|
-
import { useCallback as
|
|
3132
|
+
import { useCallback as useCallback15, useEffect as useEffect21, useMemo as useMemo7, useRef as useRef15 } from "react";
|
|
3198
3133
|
|
|
3199
3134
|
// src/utils/form-rescue.ts
|
|
3200
3135
|
var FORM_ID_PATTERN = /^[a-z][a-z0-9_]{1,47}$/;
|
|
@@ -3419,16 +3354,16 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3419
3354
|
const fieldNamesRef = useRef15(fieldNames);
|
|
3420
3355
|
const onRestoreRef = useRef15(onRestore);
|
|
3421
3356
|
const getSignalsRef = useRef15(getSignals);
|
|
3422
|
-
|
|
3357
|
+
useEffect21(() => {
|
|
3423
3358
|
fieldNamesRef.current = fieldNames;
|
|
3424
3359
|
onRestoreRef.current = onRestore;
|
|
3425
3360
|
getSignalsRef.current = getSignals;
|
|
3426
3361
|
});
|
|
3427
|
-
const attemptId =
|
|
3362
|
+
const attemptId = useCallback15(() => {
|
|
3428
3363
|
if (!attemptIdRef.current) attemptIdRef.current = newAttemptId();
|
|
3429
3364
|
return attemptIdRef.current;
|
|
3430
3365
|
}, []);
|
|
3431
|
-
const send =
|
|
3366
|
+
const send = useCallback15(
|
|
3432
3367
|
(keepalive) => {
|
|
3433
3368
|
if (!formId || !draftsUrl || !dirtyRef.current || completedRef.current || !latestRef.current) return;
|
|
3434
3369
|
dirtyRef.current = false;
|
|
@@ -3459,7 +3394,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3459
3394
|
},
|
|
3460
3395
|
[attemptId, draftsUrl, formId]
|
|
3461
3396
|
);
|
|
3462
|
-
|
|
3397
|
+
useEffect21(() => {
|
|
3463
3398
|
if (!formId || typeof window === "undefined") return void 0;
|
|
3464
3399
|
let cancelled = false;
|
|
3465
3400
|
const token = new URLSearchParams(window.location.search).get(FORM_RESCUE_RESUME_PARAM);
|
|
@@ -3489,7 +3424,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3489
3424
|
cancelled = true;
|
|
3490
3425
|
};
|
|
3491
3426
|
}, [attemptId, draftsUrl, formId]);
|
|
3492
|
-
|
|
3427
|
+
useEffect21(() => {
|
|
3493
3428
|
if (!formId || typeof document === "undefined") return void 0;
|
|
3494
3429
|
const onHide = () => {
|
|
3495
3430
|
if (completedRef.current || !startedRef.current) return;
|
|
@@ -3516,7 +3451,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3516
3451
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
3517
3452
|
};
|
|
3518
3453
|
}, [attemptId, formId, send]);
|
|
3519
|
-
const track =
|
|
3454
|
+
const track = useCallback15(
|
|
3520
3455
|
(values, lastField) => {
|
|
3521
3456
|
if (!formId || completedRef.current) return;
|
|
3522
3457
|
const names = fieldNamesRef.current;
|
|
@@ -3549,14 +3484,14 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3549
3484
|
},
|
|
3550
3485
|
[attemptId, formId, send]
|
|
3551
3486
|
);
|
|
3552
|
-
const submitFields =
|
|
3487
|
+
const submitFields = useCallback15(() => {
|
|
3553
3488
|
if (!formId) return {};
|
|
3554
3489
|
return {
|
|
3555
3490
|
[FORM_RESCUE_ATTEMPT_FIELD]: attemptId(),
|
|
3556
3491
|
...resumeTokenRef.current ? { [FORM_RESCUE_RESUME_FIELD]: resumeTokenRef.current } : {}
|
|
3557
3492
|
};
|
|
3558
3493
|
}, [attemptId, formId]);
|
|
3559
|
-
const complete =
|
|
3494
|
+
const complete = useCallback15(() => {
|
|
3560
3495
|
if (!formId) return;
|
|
3561
3496
|
if (timerRef.current) {
|
|
3562
3497
|
clearTimeout(timerRef.current);
|
|
@@ -3574,7 +3509,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
3574
3509
|
}
|
|
3575
3510
|
|
|
3576
3511
|
// src/hooks/use-rescued-form.ts
|
|
3577
|
-
import { useEffect as
|
|
3512
|
+
import { useEffect as useEffect22 } from "react";
|
|
3578
3513
|
function flattenOneLevel(values) {
|
|
3579
3514
|
const flat = {};
|
|
3580
3515
|
for (const [key, value] of Object.entries(values)) {
|
|
@@ -3598,7 +3533,7 @@ function useRescuedForm(form, { rescue, fields, getSignals, fieldPath }) {
|
|
|
3598
3533
|
}
|
|
3599
3534
|
}
|
|
3600
3535
|
});
|
|
3601
|
-
|
|
3536
|
+
useEffect22(() => {
|
|
3602
3537
|
const subscription = watch((values, { name }) => {
|
|
3603
3538
|
handle.track(flattenOneLevel(values), name ? name.split(".").pop() ?? null : null);
|
|
3604
3539
|
});
|
|
@@ -3623,11 +3558,6 @@ export {
|
|
|
3623
3558
|
useTablePagination,
|
|
3624
3559
|
useThrottle,
|
|
3625
3560
|
useWindowSize,
|
|
3626
|
-
PREFERS_REDUCED_MOTION_QUERY,
|
|
3627
|
-
usePrefersReducedMotion,
|
|
3628
|
-
usePrefersReducedMotionState,
|
|
3629
|
-
useInView,
|
|
3630
|
-
useAutoplay,
|
|
3631
3561
|
usePreventScroll,
|
|
3632
3562
|
platformIcons,
|
|
3633
3563
|
transformPlatformConfigsToOptions,
|
|
@@ -3728,4 +3658,4 @@ export {
|
|
|
3728
3658
|
useFormRescue,
|
|
3729
3659
|
useRescuedForm
|
|
3730
3660
|
};
|
|
3731
|
-
//# sourceMappingURL=chunk-
|
|
3661
|
+
//# sourceMappingURL=chunk-TN2RFU6D.js.map
|