@flamingo-stack/openframe-frontend-core 0.0.490 → 0.0.491
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-VUXNXWOQ.cjs → chunk-2RTNC3KP.cjs} +1036 -873
- package/dist/chunk-2RTNC3KP.cjs.map +1 -0
- package/dist/{chunk-VDZO6IDR.js → chunk-2YQK6LHR.js} +5 -5
- package/dist/{chunk-BZMOEWWS.js → chunk-35CTCUJ7.js} +6 -6
- package/dist/{chunk-GUTYUMGV.cjs → chunk-6O3YTVLG.cjs} +12 -12
- package/dist/{chunk-GUTYUMGV.cjs.map → chunk-6O3YTVLG.cjs.map} +1 -1
- package/dist/{chunk-RW2LPL72.js → chunk-6WTCJI5R.js} +2 -2
- package/dist/{chunk-WLM3F3WU.js → chunk-6XNWT2KC.js} +3 -3
- package/dist/{chunk-IEZ3YBAP.cjs → chunk-7NRRONK5.cjs} +32 -32
- package/dist/{chunk-IEZ3YBAP.cjs.map → chunk-7NRRONK5.cjs.map} +1 -1
- package/dist/{chunk-OQIMH2WQ.js → chunk-CYIUPI7J.js} +1167 -1004
- package/dist/{chunk-OQIMH2WQ.js.map → chunk-CYIUPI7J.js.map} +1 -1
- package/dist/{chunk-6CJ2K7BD.js → chunk-CZTKQVIQ.js} +3 -3
- package/dist/{chunk-3IEVA5AO.cjs → chunk-EHHX22JL.cjs} +93 -93
- package/dist/{chunk-3IEVA5AO.cjs.map → chunk-EHHX22JL.cjs.map} +1 -1
- package/dist/{chunk-7I42V2OD.cjs → chunk-GL33BHGZ.cjs} +73 -73
- package/dist/{chunk-7I42V2OD.cjs.map → chunk-GL33BHGZ.cjs.map} +1 -1
- package/dist/{chunk-AIRNG27G.js → chunk-GTMW4KY7.js} +6 -6
- package/dist/{chunk-EJQUYZXF.cjs → chunk-HRMOCJKU.cjs} +12 -12
- package/dist/{chunk-EJQUYZXF.cjs.map → chunk-HRMOCJKU.cjs.map} +1 -1
- package/dist/{chunk-AW63ET2A.cjs → chunk-ITV6LSG7.cjs} +19 -19
- package/dist/{chunk-AW63ET2A.cjs.map → chunk-ITV6LSG7.cjs.map} +1 -1
- package/dist/{chunk-6CFFISUC.js → chunk-IUGJAILN.js} +3 -3
- package/dist/{chunk-FY5XAW3H.cjs → chunk-J2V4B6FF.cjs} +18 -18
- package/dist/{chunk-FY5XAW3H.cjs.map → chunk-J2V4B6FF.cjs.map} +1 -1
- package/dist/{chunk-UZZT65PQ.cjs → chunk-PVSXTCJY.cjs} +40 -40
- package/dist/{chunk-UZZT65PQ.cjs.map → chunk-PVSXTCJY.cjs.map} +1 -1
- package/dist/{chunk-VL2YMDPH.js → chunk-QF54RPHZ.js} +6 -6
- package/dist/{chunk-GZK7FWJJ.js → chunk-QKWOBV55.js} +12 -12
- package/dist/chunk-QKWOBV55.js.map +1 -0
- package/dist/{chunk-D5LQMRPU.cjs → chunk-QNFAZIFC.cjs} +5 -5
- package/dist/{chunk-D5LQMRPU.cjs.map → chunk-QNFAZIFC.cjs.map} +1 -1
- package/dist/{chunk-STYA77PH.cjs → chunk-SGL6URIJ.cjs} +12 -12
- package/dist/chunk-SGL6URIJ.cjs.map +1 -0
- package/dist/{chunk-EGXCWZYP.js → chunk-T4BUS6JV.js} +3 -3
- package/dist/{chunk-KP5KRRD6.cjs → chunk-THC3K262.cjs} +3 -3
- package/dist/{chunk-KP5KRRD6.cjs.map → chunk-THC3K262.cjs.map} +1 -1
- package/dist/{chunk-BIKOJ4FH.cjs → chunk-TTYJAZ7P.cjs} +58 -32
- package/dist/chunk-TTYJAZ7P.cjs.map +1 -0
- package/dist/{chunk-MPYDX5WX.js → chunk-U2JIGUXF.js} +4 -4
- package/dist/{chunk-2MKUHJ3O.cjs → chunk-VD4QDSP7.cjs} +40 -40
- package/dist/{chunk-2MKUHJ3O.cjs.map → chunk-VD4QDSP7.cjs.map} +1 -1
- package/dist/{chunk-PB3BTZDU.js → chunk-WEUNPE3S.js} +139 -113
- package/dist/chunk-WEUNPE3S.js.map +1 -0
- package/dist/{chunk-GMPYR3MX.cjs → chunk-YKE2KZ2Y.cjs} +33 -33
- package/dist/{chunk-GMPYR3MX.cjs.map → chunk-YKE2KZ2Y.cjs.map} +1 -1
- package/dist/{chunk-NGEFYPY7.js → chunk-ZDUJ6BDI.js} +4 -4
- package/dist/{chunk-6QK3ONDD.js → chunk-ZEC5U5T7.js} +2 -2
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/chat/index.js +3 -3
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/faq/index.js +5 -5
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/features/index.js +3 -3
- package/dist/components/features/select-button.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +161 -161
- package/dist/components/index.js +12 -12
- package/dist/components/layout/page-layout.d.ts +7 -1
- package/dist/components/layout/page-layout.d.ts.map +1 -1
- package/dist/components/layout/title-block.d.ts +23 -1
- package/dist/components/layout/title-block.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +4 -4
- package/dist/components/navigation/index.js +3 -3
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/autocomplete.d.ts.map +1 -1
- package/dist/components/ui/checkbox-block.d.ts.map +1 -1
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/field-wrapper.d.ts +10 -1
- package/dist/components/ui/field-wrapper.d.ts.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +50 -50
- package/dist/components/ui/file-manager/index.js +1 -1
- package/dist/components/ui/floating-tooltip.d.ts +8 -1
- package/dist/components/ui/floating-tooltip.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +4 -4
- package/dist/components/ui/index.js +3 -3
- package/dist/components/ui/input-trigger.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/page-actions.d.ts +7 -1
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/search-input.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/tab-navigation.d.ts +10 -1
- package/dist/components/ui/tab-navigation.d.ts.map +1 -1
- package/dist/components/ui/tag-search-input.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/truncate-text.d.ts +2 -2
- package/dist/components/ui/truncate-text.d.ts.map +1 -1
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/ui/index.d.ts +1 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/use-is-truncated.d.ts +33 -0
- package/dist/hooks/ui/use-is-truncated.d.ts.map +1 -0
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -3
- package/package.json +1 -1
- package/src/components/features/select-button.tsx +4 -1
- package/src/components/layout/page-layout.tsx +16 -0
- package/src/components/layout/title-block.tsx +106 -7
- package/src/components/ui/.field-wrapper.md +5 -4
- package/src/components/ui/.tab-navigation.md +14 -1
- package/src/components/ui/autocomplete.tsx +13 -1
- package/src/components/ui/button/button.tsx +1 -1
- package/src/components/ui/checkbox-block.tsx +27 -3
- package/src/components/ui/date-picker.tsx +15 -1
- package/src/components/ui/field-wrapper.tsx +12 -6
- package/src/components/ui/floating-tooltip.tsx +9 -1
- package/src/components/ui/input-trigger.tsx +8 -1
- package/src/components/ui/input.tsx +8 -1
- package/src/components/ui/page-actions.tsx +142 -30
- package/src/components/ui/radio-group.tsx +28 -3
- package/src/components/ui/search-input.tsx +2 -1
- package/src/components/ui/select.tsx +7 -0
- package/src/components/ui/tab-navigation.tsx +26 -4
- package/src/components/ui/tag-search-input.tsx +9 -2
- package/src/components/ui/textarea.tsx +8 -1
- package/src/components/ui/truncate-text.tsx +3 -18
- package/src/hooks/ui/index.ts +1 -0
- package/src/hooks/ui/use-is-truncated.ts +66 -0
- package/dist/chunk-BIKOJ4FH.cjs.map +0 -1
- package/dist/chunk-GZK7FWJJ.js.map +0 -1
- package/dist/chunk-PB3BTZDU.js.map +0 -1
- package/dist/chunk-STYA77PH.cjs.map +0 -1
- package/dist/chunk-VUXNXWOQ.cjs.map +0 -1
- /package/dist/{chunk-VDZO6IDR.js.map → chunk-2YQK6LHR.js.map} +0 -0
- /package/dist/{chunk-BZMOEWWS.js.map → chunk-35CTCUJ7.js.map} +0 -0
- /package/dist/{chunk-RW2LPL72.js.map → chunk-6WTCJI5R.js.map} +0 -0
- /package/dist/{chunk-WLM3F3WU.js.map → chunk-6XNWT2KC.js.map} +0 -0
- /package/dist/{chunk-6CJ2K7BD.js.map → chunk-CZTKQVIQ.js.map} +0 -0
- /package/dist/{chunk-AIRNG27G.js.map → chunk-GTMW4KY7.js.map} +0 -0
- /package/dist/{chunk-6CFFISUC.js.map → chunk-IUGJAILN.js.map} +0 -0
- /package/dist/{chunk-VL2YMDPH.js.map → chunk-QF54RPHZ.js.map} +0 -0
- /package/dist/{chunk-EGXCWZYP.js.map → chunk-T4BUS6JV.js.map} +0 -0
- /package/dist/{chunk-MPYDX5WX.js.map → chunk-U2JIGUXF.js.map} +0 -0
- /package/dist/{chunk-NGEFYPY7.js.map → chunk-ZDUJ6BDI.js.map} +0 -0
- /package/dist/{chunk-6QK3ONDD.js.map → chunk-ZEC5U5T7.js.map} +0 -0
|
@@ -518,10 +518,35 @@ function useImageEdgeColor(imageUrl, fallback = "#000000") {
|
|
|
518
518
|
return color;
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
+
// src/hooks/ui/use-is-truncated.ts
|
|
522
|
+
import { useCallback as useCallback4, useEffect as useEffect7, useState as useState7 } from "react";
|
|
523
|
+
function useIsTruncated(value, options) {
|
|
524
|
+
const multiline = options?.multiline ?? false;
|
|
525
|
+
const [element, setElement] = useState7(null);
|
|
526
|
+
const [isTruncated, setIsTruncated] = useState7(false);
|
|
527
|
+
const ref = useCallback4((node) => setElement(node), []);
|
|
528
|
+
useEffect7(() => {
|
|
529
|
+
if (!element) {
|
|
530
|
+
setIsTruncated(false);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
const check = () => {
|
|
534
|
+
setIsTruncated(
|
|
535
|
+
multiline ? element.scrollHeight > element.clientHeight + 1 : element.scrollWidth > element.clientWidth + 1
|
|
536
|
+
);
|
|
537
|
+
};
|
|
538
|
+
check();
|
|
539
|
+
const observer = new ResizeObserver(check);
|
|
540
|
+
observer.observe(element);
|
|
541
|
+
return () => observer.disconnect();
|
|
542
|
+
}, [element, value, multiline]);
|
|
543
|
+
return { ref, isTruncated };
|
|
544
|
+
}
|
|
545
|
+
|
|
521
546
|
// src/hooks/ui/use-local-storage.ts
|
|
522
|
-
import { useEffect as
|
|
547
|
+
import { useEffect as useEffect8, useRef as useRef4, useState as useState8 } from "react";
|
|
523
548
|
function useLocalStorage(key, initialValue) {
|
|
524
|
-
const [storedValue, setStoredValue] =
|
|
549
|
+
const [storedValue, setStoredValue] = useState8(() => {
|
|
525
550
|
try {
|
|
526
551
|
if (typeof window !== "undefined") {
|
|
527
552
|
const item = window.localStorage.getItem(key);
|
|
@@ -534,7 +559,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
534
559
|
});
|
|
535
560
|
const isInitialized = useRef4(true);
|
|
536
561
|
const isFromStorageEvent = useRef4(false);
|
|
537
|
-
|
|
562
|
+
useEffect8(() => {
|
|
538
563
|
if (!isInitialized.current) return;
|
|
539
564
|
const handleStorageChange = (e) => {
|
|
540
565
|
if (e.key === key && e.newValue !== null) {
|
|
@@ -573,7 +598,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
573
598
|
window.removeEventListener("localStorageUpdate", handleCustomStorageUpdate);
|
|
574
599
|
};
|
|
575
600
|
}, [key]);
|
|
576
|
-
|
|
601
|
+
useEffect8(() => {
|
|
577
602
|
if (!isInitialized.current) return;
|
|
578
603
|
if (isFromStorageEvent.current) {
|
|
579
604
|
isFromStorageEvent.current = false;
|
|
@@ -599,7 +624,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
599
624
|
}
|
|
600
625
|
|
|
601
626
|
// src/hooks/ui/use-marquee-engine.ts
|
|
602
|
-
import { useCallback as
|
|
627
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef5 } from "react";
|
|
603
628
|
var RESYNC_EPSILON = 1.5;
|
|
604
629
|
function useMarqueeEngine(options) {
|
|
605
630
|
const posRef = useRef5(0);
|
|
@@ -607,7 +632,7 @@ function useMarqueeEngine(options) {
|
|
|
607
632
|
const speedEnvRef = useRef5(0);
|
|
608
633
|
const optsRef = useRef5(options);
|
|
609
634
|
optsRef.current = options;
|
|
610
|
-
const wrap =
|
|
635
|
+
const wrap = useCallback5((pos) => {
|
|
611
636
|
const half = optsRef.current.getWrapSize();
|
|
612
637
|
if (half <= 0) return pos;
|
|
613
638
|
const min = optsRef.current.getWrapMin?.() ?? 0;
|
|
@@ -615,11 +640,11 @@ function useMarqueeEngine(options) {
|
|
|
615
640
|
while (pos < min) pos += half;
|
|
616
641
|
return pos;
|
|
617
642
|
}, []);
|
|
618
|
-
const glideBy =
|
|
643
|
+
const glideBy = useCallback5((px) => {
|
|
619
644
|
glideRemainingRef.current += px;
|
|
620
645
|
}, []);
|
|
621
646
|
const active = options.active;
|
|
622
|
-
|
|
647
|
+
useEffect9(() => {
|
|
623
648
|
if (!active) return;
|
|
624
649
|
let raf = 0;
|
|
625
650
|
let last = performance.now();
|
|
@@ -664,9 +689,9 @@ function useMarqueeEngine(options) {
|
|
|
664
689
|
}
|
|
665
690
|
|
|
666
691
|
// src/hooks/ui/use-media-query.ts
|
|
667
|
-
import { useLayoutEffect, useState as
|
|
692
|
+
import { useLayoutEffect, useState as useState9 } from "react";
|
|
668
693
|
function useMediaQuery(query) {
|
|
669
|
-
const [matches, setMatches] =
|
|
694
|
+
const [matches, setMatches] = useState9(void 0);
|
|
670
695
|
useLayoutEffect(() => {
|
|
671
696
|
const matchMedia = window.matchMedia(query);
|
|
672
697
|
const handleChange = () => {
|
|
@@ -699,7 +724,7 @@ function useLgUp() {
|
|
|
699
724
|
}
|
|
700
725
|
|
|
701
726
|
// src/hooks/ui/use-memoized-callback.ts
|
|
702
|
-
import { useCallback as
|
|
727
|
+
import { useCallback as useCallback6, useRef as useRef6 } from "react";
|
|
703
728
|
function useMemoizedCallback(callback, dependencies) {
|
|
704
729
|
const callbackRef = useRef6(callback);
|
|
705
730
|
const dependenciesRef = useRef6(dependencies);
|
|
@@ -708,15 +733,15 @@ function useMemoizedCallback(callback, dependencies) {
|
|
|
708
733
|
if (depsChanged) {
|
|
709
734
|
dependenciesRef.current = dependencies;
|
|
710
735
|
}
|
|
711
|
-
return
|
|
736
|
+
return useCallback6(((...args) => callbackRef.current(...args)), [depsChanged]);
|
|
712
737
|
}
|
|
713
738
|
|
|
714
739
|
// src/hooks/ui/use-notification-permission.ts
|
|
715
|
-
import { useCallback as
|
|
740
|
+
import { useCallback as useCallback7, useEffect as useEffect10, useState as useState10 } from "react";
|
|
716
741
|
function useNotificationPermission() {
|
|
717
|
-
const [supported, setSupported] =
|
|
718
|
-
const [permission, setPermission] =
|
|
719
|
-
|
|
742
|
+
const [supported, setSupported] = useState10(false);
|
|
743
|
+
const [permission, setPermission] = useState10("default");
|
|
744
|
+
useEffect10(() => {
|
|
720
745
|
if (typeof window === "undefined" || !("Notification" in window)) return;
|
|
721
746
|
setSupported(true);
|
|
722
747
|
const sync = () => setPermission(Notification.permission);
|
|
@@ -737,7 +762,7 @@ function useNotificationPermission() {
|
|
|
737
762
|
window.removeEventListener("focus", sync);
|
|
738
763
|
};
|
|
739
764
|
}, []);
|
|
740
|
-
const request =
|
|
765
|
+
const request = useCallback7(async () => {
|
|
741
766
|
if (typeof window === "undefined" || !("Notification" in window)) {
|
|
742
767
|
return "denied";
|
|
743
768
|
}
|
|
@@ -752,7 +777,7 @@ function useNotificationPermission() {
|
|
|
752
777
|
}
|
|
753
778
|
|
|
754
779
|
// src/hooks/ui/use-onboarding-state.ts
|
|
755
|
-
import { useState as
|
|
780
|
+
import { useState as useState11, useEffect as useEffect11, useCallback as useCallback8 } from "react";
|
|
756
781
|
|
|
757
782
|
// src/utils/onboarding-storage.ts
|
|
758
783
|
var DEFAULT_STATE = {
|
|
@@ -827,9 +852,9 @@ function dismissOnboarding(key) {
|
|
|
827
852
|
|
|
828
853
|
// src/hooks/ui/use-onboarding-state.ts
|
|
829
854
|
function useOnboardingState(storageKey = "openframe-onboarding-state") {
|
|
830
|
-
const [state, setState] =
|
|
831
|
-
const [, forceUpdate] =
|
|
832
|
-
|
|
855
|
+
const [state, setState] = useState11(() => loadOnboardingState(storageKey));
|
|
856
|
+
const [, forceUpdate] = useState11(0);
|
|
857
|
+
useEffect11(() => {
|
|
833
858
|
const handleStorageUpdate = (e) => {
|
|
834
859
|
if (e.detail.key === storageKey) {
|
|
835
860
|
const newState = loadOnboardingState(storageKey);
|
|
@@ -843,38 +868,38 @@ function useOnboardingState(storageKey = "openframe-onboarding-state") {
|
|
|
843
868
|
window.removeEventListener("localStorageUpdate", handleStorageUpdate);
|
|
844
869
|
};
|
|
845
870
|
}, [storageKey]);
|
|
846
|
-
const markComplete =
|
|
871
|
+
const markComplete = useCallback8((stepId) => {
|
|
847
872
|
console.log(`\u{1F3AF} markComplete called for: "${stepId}"`);
|
|
848
873
|
const newState = markStepComplete(storageKey, stepId);
|
|
849
874
|
setState(newState);
|
|
850
875
|
forceUpdate((prev) => prev + 1);
|
|
851
876
|
}, [storageKey]);
|
|
852
|
-
const markSkipped =
|
|
877
|
+
const markSkipped = useCallback8((stepId) => {
|
|
853
878
|
console.log(`\u23ED\uFE0F markSkipped called for: "${stepId}"`);
|
|
854
879
|
const newState = markStepSkipped(storageKey, stepId);
|
|
855
880
|
setState(newState);
|
|
856
881
|
forceUpdate((prev) => prev + 1);
|
|
857
882
|
}, [storageKey]);
|
|
858
|
-
const dismissOnboarding2 =
|
|
883
|
+
const dismissOnboarding2 = useCallback8(() => {
|
|
859
884
|
console.log(`\u{1F6AB} dismissOnboarding called`);
|
|
860
885
|
const newState = dismissOnboarding(storageKey);
|
|
861
886
|
setState(newState);
|
|
862
887
|
forceUpdate((prev) => prev + 1);
|
|
863
888
|
}, [storageKey]);
|
|
864
|
-
const markMultipleComplete2 =
|
|
889
|
+
const markMultipleComplete2 = useCallback8((stepIds) => {
|
|
865
890
|
console.log(`\u{1F3AF} markMultipleComplete called for:`, stepIds);
|
|
866
891
|
const newState = markMultipleComplete(storageKey, stepIds);
|
|
867
892
|
setState(newState);
|
|
868
893
|
forceUpdate((prev) => prev + 1);
|
|
869
894
|
console.log(`\u{1F4DD} State after batch:`, newState);
|
|
870
895
|
}, [storageKey]);
|
|
871
|
-
const isStepComplete =
|
|
896
|
+
const isStepComplete = useCallback8((stepId) => {
|
|
872
897
|
return state.completedSteps.includes(stepId);
|
|
873
898
|
}, [state.completedSteps]);
|
|
874
|
-
const isStepSkipped =
|
|
899
|
+
const isStepSkipped = useCallback8((stepId) => {
|
|
875
900
|
return state.skippedSteps.includes(stepId);
|
|
876
901
|
}, [state.skippedSteps]);
|
|
877
|
-
const allStepsComplete =
|
|
902
|
+
const allStepsComplete = useCallback8((steps) => {
|
|
878
903
|
return steps.every((step) => isStepComplete(step.id) || isStepSkipped(step.id));
|
|
879
904
|
}, [isStepComplete, isStepSkipped]);
|
|
880
905
|
return {
|
|
@@ -890,9 +915,9 @@ function useOnboardingState(storageKey = "openframe-onboarding-state") {
|
|
|
890
915
|
}
|
|
891
916
|
|
|
892
917
|
// src/hooks/ui/use-reset-on-page-hidden.ts
|
|
893
|
-
import { useEffect as
|
|
918
|
+
import { useEffect as useEffect12 } from "react";
|
|
894
919
|
function useResetOnPageHidden(reset) {
|
|
895
|
-
|
|
920
|
+
useEffect12(() => {
|
|
896
921
|
const onVisibility = () => {
|
|
897
922
|
if (document.visibilityState === "hidden") reset();
|
|
898
923
|
};
|
|
@@ -906,19 +931,19 @@ function useResetOnPageHidden(reset) {
|
|
|
906
931
|
}
|
|
907
932
|
|
|
908
933
|
// src/hooks/ui/use-search.ts
|
|
909
|
-
import { useState as
|
|
934
|
+
import { useState as useState12, useEffect as useEffect13, useCallback as useCallback9 } from "react";
|
|
910
935
|
function useSearch(config) {
|
|
911
936
|
const { searchFn, mapResult, debounceMs = 300, minQueryLength = 2 } = config;
|
|
912
|
-
const [query, setQuery] =
|
|
913
|
-
const [results, setResults] =
|
|
914
|
-
const [isLoading, setIsLoading] =
|
|
915
|
-
const [error, setError] =
|
|
937
|
+
const [query, setQuery] = useState12("");
|
|
938
|
+
const [results, setResults] = useState12([]);
|
|
939
|
+
const [isLoading, setIsLoading] = useState12(false);
|
|
940
|
+
const [error, setError] = useState12(null);
|
|
916
941
|
const debouncedQuery = useDebounce(query, debounceMs);
|
|
917
|
-
const clearResults =
|
|
942
|
+
const clearResults = useCallback9(() => {
|
|
918
943
|
setResults([]);
|
|
919
944
|
setError(null);
|
|
920
945
|
}, []);
|
|
921
|
-
|
|
946
|
+
useEffect13(() => {
|
|
922
947
|
if (!debouncedQuery || debouncedQuery.length < minQueryLength) {
|
|
923
948
|
setResults([]);
|
|
924
949
|
setIsLoading(false);
|
|
@@ -954,11 +979,11 @@ function useSearch(config) {
|
|
|
954
979
|
}
|
|
955
980
|
|
|
956
981
|
// src/hooks/ui/use-suppress-clone-focus.ts
|
|
957
|
-
import { useEffect as
|
|
982
|
+
import { useEffect as useEffect14, useRef as useRef7 } from "react";
|
|
958
983
|
var CLONE_FOCUSABLE_SELECTOR = 'a[href],button,input,select,textarea,iframe,summary,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])';
|
|
959
984
|
function useSuppressCloneFocus(active) {
|
|
960
985
|
const ref = useRef7(null);
|
|
961
|
-
|
|
986
|
+
useEffect14(() => {
|
|
962
987
|
const root = ref.current;
|
|
963
988
|
if (!root || !active) return;
|
|
964
989
|
const suppress = () => {
|
|
@@ -1017,11 +1042,11 @@ function useTablePagination(config) {
|
|
|
1017
1042
|
}
|
|
1018
1043
|
|
|
1019
1044
|
// src/hooks/ui/use-throttle.ts
|
|
1020
|
-
import { useState as
|
|
1045
|
+
import { useState as useState13, useEffect as useEffect15, useRef as useRef8 } from "react";
|
|
1021
1046
|
function useThrottle(value, limit = 200) {
|
|
1022
|
-
const [throttledValue, setThrottledValue] =
|
|
1047
|
+
const [throttledValue, setThrottledValue] = useState13(value);
|
|
1023
1048
|
const lastUpdated = useRef8(Date.now());
|
|
1024
|
-
|
|
1049
|
+
useEffect15(() => {
|
|
1025
1050
|
const now = Date.now();
|
|
1026
1051
|
const elapsed = now - lastUpdated.current;
|
|
1027
1052
|
if (elapsed >= limit) {
|
|
@@ -1041,13 +1066,13 @@ function useThrottle(value, limit = 200) {
|
|
|
1041
1066
|
}
|
|
1042
1067
|
|
|
1043
1068
|
// src/hooks/ui/use-window-size.ts
|
|
1044
|
-
import { useLayoutEffect as useLayoutEffect2, useState as
|
|
1069
|
+
import { useLayoutEffect as useLayoutEffect2, useState as useState14 } from "react";
|
|
1045
1070
|
function useWindowSize() {
|
|
1046
|
-
const [windowSize, setWindowSize] =
|
|
1071
|
+
const [windowSize, setWindowSize] = useState14({
|
|
1047
1072
|
width: 0,
|
|
1048
1073
|
height: 0
|
|
1049
1074
|
});
|
|
1050
|
-
const [isClient, setIsClient] =
|
|
1075
|
+
const [isClient, setIsClient] = useState14(false);
|
|
1051
1076
|
useLayoutEffect2(() => {
|
|
1052
1077
|
setIsClient(true);
|
|
1053
1078
|
if (!isClient) return;
|
|
@@ -1068,7 +1093,7 @@ function useWindowSize() {
|
|
|
1068
1093
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
1069
1094
|
|
|
1070
1095
|
// src/hooks/platform/use-platform-config.ts
|
|
1071
|
-
import { useState as
|
|
1096
|
+
import { useState as useState15, useEffect as useEffect16 } from "react";
|
|
1072
1097
|
|
|
1073
1098
|
// src/utils/platform-config.tsx
|
|
1074
1099
|
import { Globe } from "lucide-react";
|
|
@@ -1246,10 +1271,10 @@ function getPlatformIconComponent(platformName, className = "h-6 w-6") {
|
|
|
1246
1271
|
var platformCache = null;
|
|
1247
1272
|
var fetchPromise = null;
|
|
1248
1273
|
function usePlatformConfig() {
|
|
1249
|
-
const [platforms, setPlatforms] =
|
|
1250
|
-
const [isLoading, setIsLoading] =
|
|
1251
|
-
const [error, setError] =
|
|
1252
|
-
|
|
1274
|
+
const [platforms, setPlatforms] = useState15(platformCache || []);
|
|
1275
|
+
const [isLoading, setIsLoading] = useState15(!platformCache);
|
|
1276
|
+
const [error, setError] = useState15(null);
|
|
1277
|
+
useEffect16(() => {
|
|
1253
1278
|
if (platformCache) {
|
|
1254
1279
|
setPlatforms(platformCache);
|
|
1255
1280
|
setIsLoading(false);
|
|
@@ -1698,7 +1723,7 @@ var useToast = () => ({
|
|
|
1698
1723
|
});
|
|
1699
1724
|
|
|
1700
1725
|
// src/hooks/use-contact-submission.ts
|
|
1701
|
-
import { useState as
|
|
1726
|
+
import { useState as useState17, useCallback as useCallback10, useEffect as useEffect17 } from "react";
|
|
1702
1727
|
init_next_navigation();
|
|
1703
1728
|
|
|
1704
1729
|
// src/utils/local-storage-adapter.ts
|
|
@@ -1981,9 +2006,9 @@ function useContactSubmission(options = {}) {
|
|
|
1981
2006
|
const { toast: toast2 } = useToast();
|
|
1982
2007
|
const router = useRouter();
|
|
1983
2008
|
const { contactUrl } = useRequiredEndpointsRuntime();
|
|
1984
|
-
const [isSubmitting, setIsSubmitting] =
|
|
1985
|
-
const [isSuccess, setIsSuccess] =
|
|
1986
|
-
const submit =
|
|
2009
|
+
const [isSubmitting, setIsSubmitting] = useState17(false);
|
|
2010
|
+
const [isSuccess, setIsSuccess] = useState17(false);
|
|
2011
|
+
const submit = useCallback10(async (formData) => {
|
|
1987
2012
|
if (isSubmitting) return;
|
|
1988
2013
|
setIsSubmitting(true);
|
|
1989
2014
|
try {
|
|
@@ -2018,7 +2043,7 @@ function useContactSubmission(options = {}) {
|
|
|
2018
2043
|
setIsSubmitting(false);
|
|
2019
2044
|
}
|
|
2020
2045
|
}, [isSubmitting, toast2, userId, successToastMessage, contactUrl]);
|
|
2021
|
-
|
|
2046
|
+
useEffect17(() => {
|
|
2022
2047
|
if (isSuccess && successRedirectUrl) {
|
|
2023
2048
|
console.log("\u{1F680} Contact submission successful, redirecting to:", successRedirectUrl);
|
|
2024
2049
|
const timer = setTimeout(() => {
|
|
@@ -2032,7 +2057,7 @@ function useContactSubmission(options = {}) {
|
|
|
2032
2057
|
return () => clearTimeout(timer);
|
|
2033
2058
|
}
|
|
2034
2059
|
}, [isSuccess, successRedirectUrl, router]);
|
|
2035
|
-
|
|
2060
|
+
useEffect17(() => {
|
|
2036
2061
|
if (isSuccess && onSuccess) {
|
|
2037
2062
|
onSuccess();
|
|
2038
2063
|
}
|
|
@@ -2041,7 +2066,7 @@ function useContactSubmission(options = {}) {
|
|
|
2041
2066
|
}
|
|
2042
2067
|
|
|
2043
2068
|
// src/hooks/use-copy-to-clipboard.ts
|
|
2044
|
-
import { useCallback as
|
|
2069
|
+
import { useCallback as useCallback11, useState as useState18 } from "react";
|
|
2045
2070
|
function useCopyToClipboard({
|
|
2046
2071
|
successTitle = "Copied",
|
|
2047
2072
|
successDescription = "Copied to clipboard",
|
|
@@ -2050,8 +2075,8 @@ function useCopyToClipboard({
|
|
|
2050
2075
|
resetDelay = 2e3
|
|
2051
2076
|
} = {}) {
|
|
2052
2077
|
const { toast: toast2 } = useToast();
|
|
2053
|
-
const [copied, setCopied] =
|
|
2054
|
-
const copy =
|
|
2078
|
+
const [copied, setCopied] = useState18(false);
|
|
2079
|
+
const copy = useCallback11(
|
|
2055
2080
|
async (text) => {
|
|
2056
2081
|
try {
|
|
2057
2082
|
await navigator.clipboard.writeText(text);
|
|
@@ -2068,7 +2093,7 @@ function useCopyToClipboard({
|
|
|
2068
2093
|
}
|
|
2069
2094
|
|
|
2070
2095
|
// src/hooks/use-batch-images.ts
|
|
2071
|
-
import { useEffect as
|
|
2096
|
+
import { useEffect as useEffect18, useMemo as useMemo2, useState as useState19, useRef as useRef9 } from "react";
|
|
2072
2097
|
var globalBatchImageConfig = {};
|
|
2073
2098
|
function configureBatchImageFetch(config) {
|
|
2074
2099
|
globalBatchImageConfig = { ...globalBatchImageConfig, ...config };
|
|
@@ -2141,14 +2166,14 @@ async function batchFetchAuthenticatedImages(imageUrls, config) {
|
|
|
2141
2166
|
return results;
|
|
2142
2167
|
}
|
|
2143
2168
|
function useBatchImages(imageUrls, config) {
|
|
2144
|
-
const [fetchedImages, setFetchedImages] =
|
|
2145
|
-
const [loading, setLoading] =
|
|
2169
|
+
const [fetchedImages, setFetchedImages] = useState19({});
|
|
2170
|
+
const [loading, setLoading] = useState19(false);
|
|
2146
2171
|
const uniqueUrls = useMemo2(
|
|
2147
2172
|
() => Array.from(new Set(imageUrls.filter((url) => Boolean(url)))),
|
|
2148
2173
|
[imageUrls]
|
|
2149
2174
|
);
|
|
2150
2175
|
const requestedUrls = useRef9(/* @__PURE__ */ new Set());
|
|
2151
|
-
|
|
2176
|
+
useEffect18(() => {
|
|
2152
2177
|
if (uniqueUrls.length === 0) {
|
|
2153
2178
|
setFetchedImages({});
|
|
2154
2179
|
return;
|
|
@@ -2178,7 +2203,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
2178
2203
|
}
|
|
2179
2204
|
|
|
2180
2205
|
// src/hooks/use-authenticated-image.ts
|
|
2181
|
-
import { useEffect as
|
|
2206
|
+
import { useEffect as useEffect19, useState as useState20, useRef as useRef10 } from "react";
|
|
2182
2207
|
var globalImageConfig = {};
|
|
2183
2208
|
var imageCache = /* @__PURE__ */ new Map();
|
|
2184
2209
|
var pendingRequests = /* @__PURE__ */ new Map();
|
|
@@ -2207,11 +2232,11 @@ function getImageConfig() {
|
|
|
2207
2232
|
};
|
|
2208
2233
|
}
|
|
2209
2234
|
function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
2210
|
-
const [fetchedImageUrl, setFetchedImageUrl] =
|
|
2211
|
-
const [isLoading, setIsLoading] =
|
|
2212
|
-
const [error, setError] =
|
|
2235
|
+
const [fetchedImageUrl, setFetchedImageUrl] = useState20();
|
|
2236
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
2237
|
+
const [error, setError] = useState20(null);
|
|
2213
2238
|
const currentCacheKeyRef = useRef10(null);
|
|
2214
|
-
|
|
2239
|
+
useEffect19(() => {
|
|
2215
2240
|
if (!imageUrl) {
|
|
2216
2241
|
setFetchedImageUrl(void 0);
|
|
2217
2242
|
setIsLoading(false);
|
|
@@ -2322,7 +2347,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
2322
2347
|
});
|
|
2323
2348
|
pendingRequests.set(cacheKey, fetchPromise2);
|
|
2324
2349
|
}, [imageUrl, refreshKey, config]);
|
|
2325
|
-
|
|
2350
|
+
useEffect19(() => {
|
|
2326
2351
|
return () => {
|
|
2327
2352
|
if (currentCacheKeyRef.current) {
|
|
2328
2353
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -2336,7 +2361,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
2336
2361
|
}
|
|
2337
2362
|
|
|
2338
2363
|
// src/hooks/use-authed-image-src.ts
|
|
2339
|
-
import { useEffect as
|
|
2364
|
+
import { useEffect as useEffect20, useReducer } from "react";
|
|
2340
2365
|
var resolvedCache = /* @__PURE__ */ new Map();
|
|
2341
2366
|
var inFlight = /* @__PURE__ */ new Map();
|
|
2342
2367
|
var cacheGeneration = 0;
|
|
@@ -2368,7 +2393,7 @@ function fetchAsBlobUrl(src) {
|
|
|
2368
2393
|
function useAuthedImageSrc(src) {
|
|
2369
2394
|
const bearerSrc = src && needsBearerAssetFetch(src) ? src : null;
|
|
2370
2395
|
const [, rerender] = useReducer((c) => c + 1, 0);
|
|
2371
|
-
|
|
2396
|
+
useEffect20(() => {
|
|
2372
2397
|
if (!bearerSrc || resolvedCache.has(bearerSrc)) return;
|
|
2373
2398
|
let cancelled = false;
|
|
2374
2399
|
fetchAsBlobUrl(bearerSrc).catch(() => {
|
|
@@ -2386,7 +2411,7 @@ function useAuthedImageSrc(src) {
|
|
|
2386
2411
|
|
|
2387
2412
|
// src/hooks/state/use-query-params.ts
|
|
2388
2413
|
init_next_navigation();
|
|
2389
|
-
import { useEffect as
|
|
2414
|
+
import { useEffect as useEffect21, useState as useState21, useMemo as useMemo3, useCallback as useCallback12 } from "react";
|
|
2390
2415
|
|
|
2391
2416
|
// src/hooks/state/graphql-parser.ts
|
|
2392
2417
|
import {
|
|
@@ -2848,14 +2873,14 @@ var introspector = new GraphQLIntrospector();
|
|
|
2848
2873
|
function useQueryParams(query, options = {}) {
|
|
2849
2874
|
const router = useRouter();
|
|
2850
2875
|
const searchParams = useSearchParams();
|
|
2851
|
-
const [isLoading, setIsLoading] =
|
|
2852
|
-
const [isReady, setIsReady] =
|
|
2853
|
-
const [error, setError] =
|
|
2854
|
-
const [schema, setSchema] =
|
|
2876
|
+
const [isLoading, setIsLoading] = useState21(true);
|
|
2877
|
+
const [isReady, setIsReady] = useState21(false);
|
|
2878
|
+
const [error, setError] = useState21(null);
|
|
2879
|
+
const [schema, setSchema] = useState21({});
|
|
2855
2880
|
const defaultValues = options.defaultValues || {};
|
|
2856
2881
|
const skipIntrospection = options.skipIntrospection || false;
|
|
2857
2882
|
const debug = options.debug || false;
|
|
2858
|
-
|
|
2883
|
+
useEffect21(() => {
|
|
2859
2884
|
async function initialize() {
|
|
2860
2885
|
try {
|
|
2861
2886
|
if (debug) console.log("[useQueryParams] Initializing...");
|
|
@@ -2925,14 +2950,14 @@ function useQueryParams(query, options = {}) {
|
|
|
2925
2950
|
});
|
|
2926
2951
|
return result;
|
|
2927
2952
|
}, [searchParams]);
|
|
2928
|
-
const updateUrl =
|
|
2953
|
+
const updateUrl = useCallback12((newParams) => {
|
|
2929
2954
|
const url = newParams.toString() ? `?${newParams.toString()}` : window.location.pathname;
|
|
2930
2955
|
if (debug) {
|
|
2931
2956
|
console.log("[useQueryParams] Updating URL:", url);
|
|
2932
2957
|
}
|
|
2933
2958
|
router.replace(url, { scroll: false });
|
|
2934
2959
|
}, [router, debug]);
|
|
2935
|
-
const setParam =
|
|
2960
|
+
const setParam = useCallback12((key, value) => {
|
|
2936
2961
|
if (!isReady) {
|
|
2937
2962
|
console.warn("[useQueryParams] Schema not ready, cannot set param");
|
|
2938
2963
|
return;
|
|
@@ -2946,7 +2971,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2946
2971
|
console.error("[useQueryParams] Failed to set param:", err);
|
|
2947
2972
|
}
|
|
2948
2973
|
}, [variables, schema, isReady, updateUrl]);
|
|
2949
|
-
const setParams =
|
|
2974
|
+
const setParams = useCallback12((updates) => {
|
|
2950
2975
|
if (!isReady) {
|
|
2951
2976
|
console.warn("[useQueryParams] Schema not ready, cannot set params");
|
|
2952
2977
|
return;
|
|
@@ -2960,7 +2985,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2960
2985
|
console.error("[useQueryParams] Failed to set params:", err);
|
|
2961
2986
|
}
|
|
2962
2987
|
}, [variables, schema, isReady, updateUrl]);
|
|
2963
|
-
const clearParamsHandler =
|
|
2988
|
+
const clearParamsHandler = useCallback12((keys) => {
|
|
2964
2989
|
if (!isReady) {
|
|
2965
2990
|
console.warn("[useQueryParams] Schema not ready, cannot clear params");
|
|
2966
2991
|
return;
|
|
@@ -2974,7 +2999,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2974
2999
|
console.error("[useQueryParams] Failed to clear params:", err);
|
|
2975
3000
|
}
|
|
2976
3001
|
}, [variables, schema, isReady, updateUrl]);
|
|
2977
|
-
const resetParams =
|
|
3002
|
+
const resetParams = useCallback12(() => {
|
|
2978
3003
|
if (debug) {
|
|
2979
3004
|
console.log("[useQueryParams] Resetting params");
|
|
2980
3005
|
}
|
|
@@ -3007,7 +3032,7 @@ function applyParamMapping(schema, mapping) {
|
|
|
3007
3032
|
|
|
3008
3033
|
// src/hooks/state/use-api-params.ts
|
|
3009
3034
|
init_next_navigation();
|
|
3010
|
-
import { useCallback as
|
|
3035
|
+
import { useCallback as useCallback13, useMemo as useMemo4, useRef as useRef11 } from "react";
|
|
3011
3036
|
function useContentStable(value, key) {
|
|
3012
3037
|
const ref = useRef11(void 0);
|
|
3013
3038
|
if (ref.current && ref.current.key === key) return ref.current.value;
|
|
@@ -3066,7 +3091,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3066
3091
|
prevParamsRef.current = result;
|
|
3067
3092
|
return result;
|
|
3068
3093
|
}, [searchString, schemaKey, debug]);
|
|
3069
|
-
const addParamToSearchParams =
|
|
3094
|
+
const addParamToSearchParams = useCallback13((searchParams, key, value) => {
|
|
3070
3095
|
if (value === void 0 || value === "" || value === null) {
|
|
3071
3096
|
return;
|
|
3072
3097
|
}
|
|
@@ -3094,7 +3119,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3094
3119
|
}
|
|
3095
3120
|
return newParams;
|
|
3096
3121
|
}, [params, schemaKey, flattenedSchema, addParamToSearchParams]);
|
|
3097
|
-
const updateUrl =
|
|
3122
|
+
const updateUrl = useCallback13((newParams, keysToRemove = []) => {
|
|
3098
3123
|
const finalParams = new URLSearchParams(searchString);
|
|
3099
3124
|
keysToRemove.forEach((key) => {
|
|
3100
3125
|
if (key in stableSchema) {
|
|
@@ -3130,7 +3155,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3130
3155
|
}
|
|
3131
3156
|
return false;
|
|
3132
3157
|
};
|
|
3133
|
-
const setParam =
|
|
3158
|
+
const setParam = useCallback13((key, value) => {
|
|
3134
3159
|
const config = stableSchema[key];
|
|
3135
3160
|
if (!config) {
|
|
3136
3161
|
console.warn(`[useApiParams] Unknown parameter: ${key}`);
|
|
@@ -3144,7 +3169,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3144
3169
|
updateUrl(newParams);
|
|
3145
3170
|
}
|
|
3146
3171
|
}, [schemaKey, updateUrl, addParamToSearchParams]);
|
|
3147
|
-
const setParams =
|
|
3172
|
+
const setParams = useCallback13((updates) => {
|
|
3148
3173
|
const newParams = new URLSearchParams();
|
|
3149
3174
|
const keysToRemove = [];
|
|
3150
3175
|
for (const [key, value] of Object.entries(updates)) {
|
|
@@ -3161,11 +3186,11 @@ function useApiParams(schema, options = {}) {
|
|
|
3161
3186
|
}
|
|
3162
3187
|
updateUrl(newParams, keysToRemove);
|
|
3163
3188
|
}, [schemaKey, updateUrl, addParamToSearchParams]);
|
|
3164
|
-
const clearParams2 =
|
|
3189
|
+
const clearParams2 = useCallback13((keys) => {
|
|
3165
3190
|
const newParams = new URLSearchParams();
|
|
3166
3191
|
updateUrl(newParams, keys);
|
|
3167
3192
|
}, [updateUrl]);
|
|
3168
|
-
const resetParams =
|
|
3193
|
+
const resetParams = useCallback13(() => {
|
|
3169
3194
|
if (debug) {
|
|
3170
3195
|
console.log("[useApiParams] Resetting params");
|
|
3171
3196
|
}
|
|
@@ -3202,7 +3227,7 @@ function createSearchParams(params) {
|
|
|
3202
3227
|
}
|
|
3203
3228
|
|
|
3204
3229
|
// src/hooks/state/use-cursor-pagination-state.ts
|
|
3205
|
-
import { useCallback as
|
|
3230
|
+
import { useCallback as useCallback14, useEffect as useEffect22, useRef as useRef12, useState as useState22 } from "react";
|
|
3206
3231
|
var urlSchema = {
|
|
3207
3232
|
search: { type: "string", default: "" },
|
|
3208
3233
|
cursor: { type: "string", default: "" }
|
|
@@ -3213,13 +3238,13 @@ function useCursorPaginationState(options) {
|
|
|
3213
3238
|
onSearchChange
|
|
3214
3239
|
} = options;
|
|
3215
3240
|
const { params, setParam, setParams } = useApiParams(urlSchema);
|
|
3216
|
-
const [searchInput, setSearchInput] =
|
|
3217
|
-
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] =
|
|
3218
|
-
const [initialLoadCount, setInitialLoadCount] =
|
|
3241
|
+
const [searchInput, setSearchInput] = useState22(params.search || "");
|
|
3242
|
+
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] = useState22(false);
|
|
3243
|
+
const [initialLoadCount, setInitialLoadCount] = useState22(0);
|
|
3219
3244
|
const lastSearchRef = useRef12(null);
|
|
3220
3245
|
const isSyncingFromUrl = useRef12(false);
|
|
3221
3246
|
const isInitialLoadInProgress = useRef12(true);
|
|
3222
|
-
|
|
3247
|
+
useEffect22(() => {
|
|
3223
3248
|
if (isInitialLoadInProgress.current) return;
|
|
3224
3249
|
const urlSearch = params.search || "";
|
|
3225
3250
|
if (urlSearch !== searchInput) {
|
|
@@ -3230,7 +3255,7 @@ function useCursorPaginationState(options) {
|
|
|
3230
3255
|
}, 0);
|
|
3231
3256
|
}
|
|
3232
3257
|
}, [params.search, initialLoadCount]);
|
|
3233
|
-
|
|
3258
|
+
useEffect22(() => {
|
|
3234
3259
|
if (isInitialLoadInProgress.current) return;
|
|
3235
3260
|
if (isSyncingFromUrl.current) return;
|
|
3236
3261
|
if (searchInput !== params.search) {
|
|
@@ -3241,7 +3266,7 @@ function useCursorPaginationState(options) {
|
|
|
3241
3266
|
});
|
|
3242
3267
|
}
|
|
3243
3268
|
}, [searchInput, params.search, setParams, initialLoadCount]);
|
|
3244
|
-
|
|
3269
|
+
useEffect22(() => {
|
|
3245
3270
|
if (initialLoadCount === 0) {
|
|
3246
3271
|
const cursor = params.cursor || null;
|
|
3247
3272
|
const search = params.search || "";
|
|
@@ -3255,7 +3280,7 @@ function useCursorPaginationState(options) {
|
|
|
3255
3280
|
});
|
|
3256
3281
|
}
|
|
3257
3282
|
}, []);
|
|
3258
|
-
|
|
3283
|
+
useEffect22(() => {
|
|
3259
3284
|
if (isInitialLoadInProgress.current) return;
|
|
3260
3285
|
if (initialLoadCount === 0) return;
|
|
3261
3286
|
const currentSearch = params.search || "";
|
|
@@ -3265,7 +3290,7 @@ function useCursorPaginationState(options) {
|
|
|
3265
3290
|
onSearchChange(currentSearch);
|
|
3266
3291
|
}
|
|
3267
3292
|
}, [params.search, onSearchChange, initialLoadCount]);
|
|
3268
|
-
const handleNextPage =
|
|
3293
|
+
const handleNextPage = useCallback14(
|
|
3269
3294
|
async (endCursor, fetchFn) => {
|
|
3270
3295
|
setParam("cursor", endCursor);
|
|
3271
3296
|
await fetchFn();
|
|
@@ -3273,7 +3298,7 @@ function useCursorPaginationState(options) {
|
|
|
3273
3298
|
},
|
|
3274
3299
|
[setParam]
|
|
3275
3300
|
);
|
|
3276
|
-
const handleResetToFirstPage =
|
|
3301
|
+
const handleResetToFirstPage = useCallback14(
|
|
3277
3302
|
async (fetchFn) => {
|
|
3278
3303
|
setParam("cursor", "");
|
|
3279
3304
|
await fetchFn();
|
|
@@ -3295,16 +3320,16 @@ function useCursorPaginationState(options) {
|
|
|
3295
3320
|
}
|
|
3296
3321
|
|
|
3297
3322
|
// src/hooks/nats/use-nats-client.ts
|
|
3298
|
-
import { useEffect as
|
|
3323
|
+
import { useEffect as useEffect23, useMemo as useMemo5, useState as useState23 } from "react";
|
|
3299
3324
|
function useNatsClient(clientOptions, options = {}) {
|
|
3300
3325
|
const { autoConnect = true } = options;
|
|
3301
3326
|
const client = useMemo5(() => {
|
|
3302
3327
|
if (!clientOptions) return null;
|
|
3303
3328
|
return createNatsClient(clientOptions);
|
|
3304
3329
|
}, [clientOptions]);
|
|
3305
|
-
const [status, setStatus] =
|
|
3306
|
-
const [lastError, setLastError] =
|
|
3307
|
-
|
|
3330
|
+
const [status, setStatus] = useState23("disconnected");
|
|
3331
|
+
const [lastError, setLastError] = useState23(null);
|
|
3332
|
+
useEffect23(() => {
|
|
3308
3333
|
if (!client) {
|
|
3309
3334
|
setStatus("disconnected");
|
|
3310
3335
|
setLastError(null);
|
|
@@ -3335,7 +3360,7 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
3335
3360
|
}
|
|
3336
3361
|
|
|
3337
3362
|
// src/hooks/use-near-viewport.ts
|
|
3338
|
-
import { useEffect as
|
|
3363
|
+
import { useEffect as useEffect24, useRef as useRef13, useState as useState24, useCallback as useCallback15 } from "react";
|
|
3339
3364
|
var observers = /* @__PURE__ */ new Map();
|
|
3340
3365
|
var subscribers = /* @__PURE__ */ new WeakMap();
|
|
3341
3366
|
var THRESHOLD_EPSILON = 0.01;
|
|
@@ -3366,10 +3391,10 @@ function getObserverFor(rootMargin, threshold) {
|
|
|
3366
3391
|
}
|
|
3367
3392
|
var NEAR_VIEWPORT_ROOT_MARGIN = "500px";
|
|
3368
3393
|
function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN, threshold = 0) {
|
|
3369
|
-
const [isNear, setIsNear] =
|
|
3394
|
+
const [isNear, setIsNear] = useState24(false);
|
|
3370
3395
|
const elRef = useRef13(null);
|
|
3371
3396
|
const key = observerKey(rootMargin, threshold);
|
|
3372
|
-
const ref =
|
|
3397
|
+
const ref = useCallback15(
|
|
3373
3398
|
(node) => {
|
|
3374
3399
|
const prev = elRef.current;
|
|
3375
3400
|
if (prev) {
|
|
@@ -3387,7 +3412,7 @@ function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN, threshold = 0)
|
|
|
3387
3412
|
},
|
|
3388
3413
|
[key, rootMargin, threshold]
|
|
3389
3414
|
);
|
|
3390
|
-
|
|
3415
|
+
useEffect24(() => {
|
|
3391
3416
|
return () => {
|
|
3392
3417
|
const el = elRef.current;
|
|
3393
3418
|
if (!el) return;
|
|
@@ -3545,7 +3570,7 @@ function useOgPlaceholderUrl({
|
|
|
3545
3570
|
}
|
|
3546
3571
|
|
|
3547
3572
|
// src/hooks/use-scroll-to-hash.ts
|
|
3548
|
-
import { useEffect as
|
|
3573
|
+
import { useEffect as useEffect25 } from "react";
|
|
3549
3574
|
|
|
3550
3575
|
// src/utils/scroll-into-view.ts
|
|
3551
3576
|
var activeRaf = 0;
|
|
@@ -3683,7 +3708,7 @@ function navigateSamePageHash(target, options = {}) {
|
|
|
3683
3708
|
var MAX_POLL_FRAMES = 60;
|
|
3684
3709
|
function useScrollToHash(readyDep = true, options) {
|
|
3685
3710
|
const headerOffset = options?.headerOffset ?? 0;
|
|
3686
|
-
|
|
3711
|
+
useEffect25(() => {
|
|
3687
3712
|
if (typeof window === "undefined") return;
|
|
3688
3713
|
if (readyDep === null || readyDep === false) return;
|
|
3689
3714
|
let rafId = null;
|
|
@@ -3723,7 +3748,7 @@ function useScrollToHash(readyDep = true, options) {
|
|
|
3723
3748
|
}
|
|
3724
3749
|
|
|
3725
3750
|
// src/hooks/use-humanity-signals.ts
|
|
3726
|
-
import { useCallback as
|
|
3751
|
+
import { useCallback as useCallback16, useRef as useRef14 } from "react";
|
|
3727
3752
|
|
|
3728
3753
|
// src/utils/humanity-signals.ts
|
|
3729
3754
|
var HONEYPOT_FIELD = "contact_url_confirm";
|
|
@@ -3749,14 +3774,14 @@ var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [
|
|
|
3749
3774
|
function useHumanitySignals() {
|
|
3750
3775
|
const ref = useRef14(null);
|
|
3751
3776
|
const mountedAt = useRef14(typeof performance !== "undefined" ? performance.now() : 0);
|
|
3752
|
-
const getSignals =
|
|
3777
|
+
const getSignals = useCallback16(
|
|
3753
3778
|
() => ({
|
|
3754
3779
|
[HONEYPOT_FIELD]: ref.current?.value ?? "",
|
|
3755
3780
|
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - mountedAt.current) : 0
|
|
3756
3781
|
}),
|
|
3757
3782
|
[]
|
|
3758
3783
|
);
|
|
3759
|
-
const resetSignals =
|
|
3784
|
+
const resetSignals = useCallback16(() => {
|
|
3760
3785
|
if (ref.current) ref.current.value = "";
|
|
3761
3786
|
if (typeof performance !== "undefined") mountedAt.current = performance.now();
|
|
3762
3787
|
}, []);
|
|
@@ -3771,6 +3796,7 @@ export {
|
|
|
3771
3796
|
useHeaderHeight,
|
|
3772
3797
|
useHorizontalScrollbar,
|
|
3773
3798
|
useImageEdgeColor,
|
|
3799
|
+
useIsTruncated,
|
|
3774
3800
|
useLocalStorage,
|
|
3775
3801
|
useMarqueeEngine,
|
|
3776
3802
|
useMediaQuery,
|
|
@@ -3885,4 +3911,4 @@ export {
|
|
|
3885
3911
|
splitCsvEnv,
|
|
3886
3912
|
useHumanitySignals
|
|
3887
3913
|
};
|
|
3888
|
-
//# sourceMappingURL=chunk-
|
|
3914
|
+
//# sourceMappingURL=chunk-WEUNPE3S.js.map
|