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