@flamingo-stack/openframe-frontend-core 0.0.455 → 0.0.456

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.
Files changed (122) hide show
  1. package/dist/{chunk-DGPKGESY.js → chunk-2I3GN7WW.js} +4 -4
  2. package/dist/{chunk-NNDNJCJ3.cjs → chunk-6K6LAD6H.cjs} +18 -18
  3. package/dist/{chunk-NNDNJCJ3.cjs.map → chunk-6K6LAD6H.cjs.map} +1 -1
  4. package/dist/{chunk-RT7DIGTN.cjs → chunk-6TI3DCOG.cjs} +3 -3
  5. package/dist/{chunk-RT7DIGTN.cjs.map → chunk-6TI3DCOG.cjs.map} +1 -1
  6. package/dist/{chunk-YSKSBLCG.cjs → chunk-A7FTNFBX.cjs} +73 -73
  7. package/dist/{chunk-YSKSBLCG.cjs.map → chunk-A7FTNFBX.cjs.map} +1 -1
  8. package/dist/{chunk-XAQLBUCP.js → chunk-DAEKUR3J.js} +2 -2
  9. package/dist/{chunk-QSIZW6EX.js → chunk-DU6R7XNU.js} +2 -2
  10. package/dist/{chunk-D5PBUVGB.cjs → chunk-DYBATZJP.cjs} +5 -5
  11. package/dist/{chunk-D5PBUVGB.cjs.map → chunk-DYBATZJP.cjs.map} +1 -1
  12. package/dist/{chunk-IDCPYG7N.cjs → chunk-F2CCUPKC.cjs} +29 -29
  13. package/dist/{chunk-IDCPYG7N.cjs.map → chunk-F2CCUPKC.cjs.map} +1 -1
  14. package/dist/{chunk-EGTGRG7N.js → chunk-F3IBBAKV.js} +2 -2
  15. package/dist/{chunk-M5RT26WQ.cjs → chunk-GC63K4VD.cjs} +73 -73
  16. package/dist/{chunk-M5RT26WQ.cjs.map → chunk-GC63K4VD.cjs.map} +1 -1
  17. package/dist/{chunk-RZL7I6YN.cjs → chunk-GQZGCMRF.cjs} +7 -7
  18. package/dist/{chunk-RZL7I6YN.cjs.map → chunk-GQZGCMRF.cjs.map} +1 -1
  19. package/dist/{chunk-X62ICFPJ.js → chunk-ILUX3DXS.js} +2 -2
  20. package/dist/{chunk-XT6S6DYS.cjs → chunk-INH6SIP5.cjs} +12 -12
  21. package/dist/{chunk-XT6S6DYS.cjs.map → chunk-INH6SIP5.cjs.map} +1 -1
  22. package/dist/{chunk-KTGGM5WA.cjs → chunk-IOHQJOLR.cjs} +36 -12
  23. package/dist/chunk-IOHQJOLR.cjs.map +1 -0
  24. package/dist/{chunk-6W4ZEVIC.js → chunk-JHIT44TA.js} +3 -3
  25. package/dist/{chunk-BE77G7GW.cjs → chunk-KH5VTGCS.cjs} +40 -40
  26. package/dist/{chunk-BE77G7GW.cjs.map → chunk-KH5VTGCS.cjs.map} +1 -1
  27. package/dist/{chunk-YXCYQKAX.js → chunk-LAFCXJVT.js} +5 -5
  28. package/dist/{chunk-5YPKZM6Y.js → chunk-LMBPJAQ2.js} +6 -6
  29. package/dist/{chunk-BD3JBEUC.js → chunk-MK2YWJAA.js} +64 -40
  30. package/dist/chunk-MK2YWJAA.js.map +1 -0
  31. package/dist/{chunk-UJZ6O2ON.cjs → chunk-TXS2AMFV.cjs} +32 -32
  32. package/dist/{chunk-UJZ6O2ON.cjs.map → chunk-TXS2AMFV.cjs.map} +1 -1
  33. package/dist/{chunk-LB3OZE4B.js → chunk-U27TXTAK.js} +6 -6
  34. package/dist/{chunk-N4CHA7T7.js → chunk-UEKCD6WV.js} +131 -16
  35. package/dist/chunk-UEKCD6WV.js.map +1 -0
  36. package/dist/{chunk-FCVF4YAB.cjs → chunk-UHVVNVUE.cjs} +40 -40
  37. package/dist/{chunk-FCVF4YAB.cjs.map → chunk-UHVVNVUE.cjs.map} +1 -1
  38. package/dist/{chunk-2KUIA2AR.js → chunk-UXKSOJR7.js} +3 -3
  39. package/dist/{chunk-GNYV6HYO.cjs → chunk-VZNJ3RYI.cjs} +15 -15
  40. package/dist/{chunk-GNYV6HYO.cjs.map → chunk-VZNJ3RYI.cjs.map} +1 -1
  41. package/dist/{chunk-JUUPMMKI.js → chunk-YLTY4Z4B.js} +3 -3
  42. package/dist/{chunk-62AXZKYN.cjs → chunk-YMGOTPY7.cjs} +981 -866
  43. package/dist/chunk-YMGOTPY7.cjs.map +1 -0
  44. package/dist/{chunk-VNE5R4LQ.js → chunk-ZQHGSR3H.js} +5 -5
  45. package/dist/components/case-studies/index.cjs +9 -9
  46. package/dist/components/case-studies/index.js +3 -3
  47. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  48. package/dist/components/chat/guide-welcome.d.ts.map +1 -1
  49. package/dist/components/chat/index.cjs +3 -3
  50. package/dist/components/chat/index.js +2 -2
  51. package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
  52. package/dist/components/chat/quick-action-wall.d.ts +5 -1
  53. package/dist/components/chat/quick-action-wall.d.ts.map +1 -1
  54. package/dist/components/chat/types/component.types.d.ts +17 -0
  55. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  56. package/dist/components/contact/index.cjs +4 -4
  57. package/dist/components/contact/index.js +3 -3
  58. package/dist/components/docs/index.cjs +6 -6
  59. package/dist/components/docs/index.js +5 -5
  60. package/dist/components/embeds/index.cjs +4 -4
  61. package/dist/components/embeds/index.js +3 -3
  62. package/dist/components/faq/index.cjs +5 -5
  63. package/dist/components/faq/index.js +4 -4
  64. package/dist/components/features/cards-strip.d.ts.map +1 -1
  65. package/dist/components/features/index.cjs +3 -3
  66. package/dist/components/features/index.js +2 -2
  67. package/dist/components/help-center-pages/index.cjs +22 -22
  68. package/dist/components/help-center-pages/index.js +13 -13
  69. package/dist/components/index.cjs +135 -135
  70. package/dist/components/index.js +11 -11
  71. package/dist/components/navigation/index.cjs +3 -3
  72. package/dist/components/navigation/index.js +2 -2
  73. package/dist/components/onboarding-guides/index.cjs +7 -7
  74. package/dist/components/onboarding-guides/index.js +6 -6
  75. package/dist/components/related-content/index.cjs +5 -5
  76. package/dist/components/related-content/index.js +4 -4
  77. package/dist/components/tickets/index.cjs +6 -6
  78. package/dist/components/tickets/index.js +5 -5
  79. package/dist/components/ui/index.cjs +3 -3
  80. package/dist/components/ui/index.js +2 -2
  81. package/dist/components/ui/marquee-wall.d.ts +8 -1
  82. package/dist/components/ui/marquee-wall.d.ts.map +1 -1
  83. package/dist/hooks/index.cjs +4 -2
  84. package/dist/hooks/index.cjs.map +1 -1
  85. package/dist/hooks/index.js +3 -1
  86. package/dist/hooks/ui/index.d.ts +1 -0
  87. package/dist/hooks/ui/index.d.ts.map +1 -1
  88. package/dist/hooks/ui/use-reset-on-page-hidden.d.ts +19 -0
  89. package/dist/hooks/ui/use-reset-on-page-hidden.d.ts.map +1 -0
  90. package/dist/hooks/use-near-viewport.d.ts +3 -1
  91. package/dist/hooks/use-near-viewport.d.ts.map +1 -1
  92. package/dist/index.cjs +5 -3
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.js +4 -2
  95. package/package.json +1 -1
  96. package/src/components/chat/chat-message-list.tsx +48 -5
  97. package/src/components/chat/embeddable-chat.tsx +31 -3
  98. package/src/components/chat/guide-welcome.tsx +1 -0
  99. package/src/components/chat/mingo-welcome.tsx +1 -0
  100. package/src/components/chat/quick-action-wall.tsx +7 -0
  101. package/src/components/chat/types/component.types.ts +17 -0
  102. package/src/components/features/cards-strip.tsx +16 -0
  103. package/src/components/ui/marquee-wall.tsx +160 -10
  104. package/src/hooks/ui/index.ts +1 -0
  105. package/src/hooks/ui/use-reset-on-page-hidden.ts +32 -0
  106. package/src/hooks/use-near-viewport.ts +36 -12
  107. package/dist/chunk-62AXZKYN.cjs.map +0 -1
  108. package/dist/chunk-BD3JBEUC.js.map +0 -1
  109. package/dist/chunk-KTGGM5WA.cjs.map +0 -1
  110. package/dist/chunk-N4CHA7T7.js.map +0 -1
  111. /package/dist/{chunk-DGPKGESY.js.map → chunk-2I3GN7WW.js.map} +0 -0
  112. /package/dist/{chunk-XAQLBUCP.js.map → chunk-DAEKUR3J.js.map} +0 -0
  113. /package/dist/{chunk-QSIZW6EX.js.map → chunk-DU6R7XNU.js.map} +0 -0
  114. /package/dist/{chunk-EGTGRG7N.js.map → chunk-F3IBBAKV.js.map} +0 -0
  115. /package/dist/{chunk-X62ICFPJ.js.map → chunk-ILUX3DXS.js.map} +0 -0
  116. /package/dist/{chunk-6W4ZEVIC.js.map → chunk-JHIT44TA.js.map} +0 -0
  117. /package/dist/{chunk-YXCYQKAX.js.map → chunk-LAFCXJVT.js.map} +0 -0
  118. /package/dist/{chunk-5YPKZM6Y.js.map → chunk-LMBPJAQ2.js.map} +0 -0
  119. /package/dist/{chunk-LB3OZE4B.js.map → chunk-U27TXTAK.js.map} +0 -0
  120. /package/dist/{chunk-2KUIA2AR.js.map → chunk-UXKSOJR7.js.map} +0 -0
  121. /package/dist/{chunk-JUUPMMKI.js.map → chunk-YLTY4Z4B.js.map} +0 -0
  122. /package/dist/{chunk-VNE5R4LQ.js.map → chunk-ZQHGSR3H.js.map} +0 -0
@@ -889,8 +889,24 @@ function useOnboardingState(storageKey = "openframe-onboarding-state") {
889
889
  };
890
890
  }
891
891
 
892
+ // src/hooks/ui/use-reset-on-page-hidden.ts
893
+ import { useEffect as useEffect11 } from "react";
894
+ function useResetOnPageHidden(reset) {
895
+ useEffect11(() => {
896
+ const onVisibility = () => {
897
+ if (document.visibilityState === "hidden") reset();
898
+ };
899
+ window.addEventListener("blur", reset);
900
+ document.addEventListener("visibilitychange", onVisibility);
901
+ return () => {
902
+ window.removeEventListener("blur", reset);
903
+ document.removeEventListener("visibilitychange", onVisibility);
904
+ };
905
+ }, [reset]);
906
+ }
907
+
892
908
  // src/hooks/ui/use-search.ts
893
- import { useState as useState11, useEffect as useEffect11, useCallback as useCallback8 } from "react";
909
+ import { useState as useState11, useEffect as useEffect12, useCallback as useCallback8 } from "react";
894
910
  function useSearch(config) {
895
911
  const { searchFn, mapResult, debounceMs = 300, minQueryLength = 2 } = config;
896
912
  const [query, setQuery] = useState11("");
@@ -902,7 +918,7 @@ function useSearch(config) {
902
918
  setResults([]);
903
919
  setError(null);
904
920
  }, []);
905
- useEffect11(() => {
921
+ useEffect12(() => {
906
922
  if (!debouncedQuery || debouncedQuery.length < minQueryLength) {
907
923
  setResults([]);
908
924
  setIsLoading(false);
@@ -938,11 +954,11 @@ function useSearch(config) {
938
954
  }
939
955
 
940
956
  // src/hooks/ui/use-suppress-clone-focus.ts
941
- import { useEffect as useEffect12, useRef as useRef7 } from "react";
957
+ import { useEffect as useEffect13, useRef as useRef7 } from "react";
942
958
  var CLONE_FOCUSABLE_SELECTOR = 'a[href],button,input,select,textarea,iframe,summary,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])';
943
959
  function useSuppressCloneFocus(active) {
944
960
  const ref = useRef7(null);
945
- useEffect12(() => {
961
+ useEffect13(() => {
946
962
  const root = ref.current;
947
963
  if (!root || !active) return;
948
964
  const suppress = () => {
@@ -1001,11 +1017,11 @@ function useTablePagination(config) {
1001
1017
  }
1002
1018
 
1003
1019
  // src/hooks/ui/use-throttle.ts
1004
- import { useState as useState12, useEffect as useEffect13, useRef as useRef8 } from "react";
1020
+ import { useState as useState12, useEffect as useEffect14, useRef as useRef8 } from "react";
1005
1021
  function useThrottle(value, limit = 200) {
1006
1022
  const [throttledValue, setThrottledValue] = useState12(value);
1007
1023
  const lastUpdated = useRef8(Date.now());
1008
- useEffect13(() => {
1024
+ useEffect14(() => {
1009
1025
  const now = Date.now();
1010
1026
  const elapsed = now - lastUpdated.current;
1011
1027
  if (elapsed >= limit) {
@@ -1052,7 +1068,7 @@ function useWindowSize() {
1052
1068
  import { usePreventScroll } from "@react-aria/overlays";
1053
1069
 
1054
1070
  // src/hooks/platform/use-platform-config.ts
1055
- import { useState as useState14, useEffect as useEffect14 } from "react";
1071
+ import { useState as useState14, useEffect as useEffect15 } from "react";
1056
1072
 
1057
1073
  // src/utils/platform-config.tsx
1058
1074
  import { Globe } from "lucide-react";
@@ -1233,7 +1249,7 @@ function usePlatformConfig() {
1233
1249
  const [platforms, setPlatforms] = useState14(platformCache || []);
1234
1250
  const [isLoading, setIsLoading] = useState14(!platformCache);
1235
1251
  const [error, setError] = useState14(null);
1236
- useEffect14(() => {
1252
+ useEffect15(() => {
1237
1253
  if (platformCache) {
1238
1254
  setPlatforms(platformCache);
1239
1255
  setIsLoading(false);
@@ -1682,7 +1698,7 @@ var useToast = () => ({
1682
1698
  });
1683
1699
 
1684
1700
  // src/hooks/use-contact-submission.ts
1685
- import { useState as useState16, useCallback as useCallback9, useEffect as useEffect15 } from "react";
1701
+ import { useState as useState16, useCallback as useCallback9, useEffect as useEffect16 } from "react";
1686
1702
  init_next_navigation();
1687
1703
 
1688
1704
  // src/utils/local-storage-adapter.ts
@@ -1987,7 +2003,7 @@ function useContactSubmission(options = {}) {
1987
2003
  setIsSubmitting(false);
1988
2004
  }
1989
2005
  }, [isSubmitting, toast2, userId, successToastMessage, contactUrl]);
1990
- useEffect15(() => {
2006
+ useEffect16(() => {
1991
2007
  if (isSuccess && successRedirectUrl) {
1992
2008
  console.log("\u{1F680} Contact submission successful, redirecting to:", successRedirectUrl);
1993
2009
  const timer = setTimeout(() => {
@@ -2001,7 +2017,7 @@ function useContactSubmission(options = {}) {
2001
2017
  return () => clearTimeout(timer);
2002
2018
  }
2003
2019
  }, [isSuccess, successRedirectUrl, router]);
2004
- useEffect15(() => {
2020
+ useEffect16(() => {
2005
2021
  if (isSuccess && onSuccess) {
2006
2022
  onSuccess();
2007
2023
  }
@@ -2037,7 +2053,7 @@ function useCopyToClipboard({
2037
2053
  }
2038
2054
 
2039
2055
  // src/hooks/use-batch-images.ts
2040
- import { useEffect as useEffect16, useMemo as useMemo2, useState as useState18, useRef as useRef9 } from "react";
2056
+ import { useEffect as useEffect17, useMemo as useMemo2, useState as useState18, useRef as useRef9 } from "react";
2041
2057
  var globalBatchImageConfig = {};
2042
2058
  function configureBatchImageFetch(config) {
2043
2059
  globalBatchImageConfig = { ...globalBatchImageConfig, ...config };
@@ -2117,7 +2133,7 @@ function useBatchImages(imageUrls, config) {
2117
2133
  [imageUrls]
2118
2134
  );
2119
2135
  const requestedUrls = useRef9(/* @__PURE__ */ new Set());
2120
- useEffect16(() => {
2136
+ useEffect17(() => {
2121
2137
  if (uniqueUrls.length === 0) {
2122
2138
  setFetchedImages({});
2123
2139
  return;
@@ -2147,7 +2163,7 @@ function useBatchImages(imageUrls, config) {
2147
2163
  }
2148
2164
 
2149
2165
  // src/hooks/use-authenticated-image.ts
2150
- import { useEffect as useEffect17, useState as useState19, useRef as useRef10 } from "react";
2166
+ import { useEffect as useEffect18, useState as useState19, useRef as useRef10 } from "react";
2151
2167
  var globalImageConfig = {};
2152
2168
  var imageCache = /* @__PURE__ */ new Map();
2153
2169
  var pendingRequests = /* @__PURE__ */ new Map();
@@ -2180,7 +2196,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
2180
2196
  const [isLoading, setIsLoading] = useState19(false);
2181
2197
  const [error, setError] = useState19(null);
2182
2198
  const currentCacheKeyRef = useRef10(null);
2183
- useEffect17(() => {
2199
+ useEffect18(() => {
2184
2200
  if (!imageUrl) {
2185
2201
  setFetchedImageUrl(void 0);
2186
2202
  setIsLoading(false);
@@ -2291,7 +2307,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
2291
2307
  });
2292
2308
  pendingRequests.set(cacheKey, fetchPromise2);
2293
2309
  }, [imageUrl, refreshKey, config]);
2294
- useEffect17(() => {
2310
+ useEffect18(() => {
2295
2311
  return () => {
2296
2312
  if (currentCacheKeyRef.current) {
2297
2313
  const entry = imageCache.get(currentCacheKeyRef.current);
@@ -2306,7 +2322,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
2306
2322
 
2307
2323
  // src/hooks/state/use-query-params.ts
2308
2324
  init_next_navigation();
2309
- import { useEffect as useEffect18, useState as useState20, useMemo as useMemo3, useCallback as useCallback11 } from "react";
2325
+ import { useEffect as useEffect19, useState as useState20, useMemo as useMemo3, useCallback as useCallback11 } from "react";
2310
2326
 
2311
2327
  // src/hooks/state/graphql-parser.ts
2312
2328
  import {
@@ -2775,7 +2791,7 @@ function useQueryParams(query, options = {}) {
2775
2791
  const defaultValues = options.defaultValues || {};
2776
2792
  const skipIntrospection = options.skipIntrospection || false;
2777
2793
  const debug = options.debug || false;
2778
- useEffect18(() => {
2794
+ useEffect19(() => {
2779
2795
  async function initialize() {
2780
2796
  try {
2781
2797
  if (debug) console.log("[useQueryParams] Initializing...");
@@ -3122,7 +3138,7 @@ function createSearchParams(params) {
3122
3138
  }
3123
3139
 
3124
3140
  // src/hooks/state/use-cursor-pagination-state.ts
3125
- import { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef12, useState as useState21 } from "react";
3141
+ import { useCallback as useCallback13, useEffect as useEffect20, useRef as useRef12, useState as useState21 } from "react";
3126
3142
  var urlSchema = {
3127
3143
  search: { type: "string", default: "" },
3128
3144
  cursor: { type: "string", default: "" }
@@ -3139,7 +3155,7 @@ function useCursorPaginationState(options) {
3139
3155
  const lastSearchRef = useRef12(null);
3140
3156
  const isSyncingFromUrl = useRef12(false);
3141
3157
  const isInitialLoadInProgress = useRef12(true);
3142
- useEffect19(() => {
3158
+ useEffect20(() => {
3143
3159
  if (isInitialLoadInProgress.current) return;
3144
3160
  const urlSearch = params.search || "";
3145
3161
  if (urlSearch !== searchInput) {
@@ -3150,7 +3166,7 @@ function useCursorPaginationState(options) {
3150
3166
  }, 0);
3151
3167
  }
3152
3168
  }, [params.search, initialLoadCount]);
3153
- useEffect19(() => {
3169
+ useEffect20(() => {
3154
3170
  if (isInitialLoadInProgress.current) return;
3155
3171
  if (isSyncingFromUrl.current) return;
3156
3172
  if (searchInput !== params.search) {
@@ -3161,7 +3177,7 @@ function useCursorPaginationState(options) {
3161
3177
  });
3162
3178
  }
3163
3179
  }, [searchInput, params.search, setParams, initialLoadCount]);
3164
- useEffect19(() => {
3180
+ useEffect20(() => {
3165
3181
  if (initialLoadCount === 0) {
3166
3182
  const cursor = params.cursor || null;
3167
3183
  const search = params.search || "";
@@ -3175,7 +3191,7 @@ function useCursorPaginationState(options) {
3175
3191
  });
3176
3192
  }
3177
3193
  }, []);
3178
- useEffect19(() => {
3194
+ useEffect20(() => {
3179
3195
  if (isInitialLoadInProgress.current) return;
3180
3196
  if (initialLoadCount === 0) return;
3181
3197
  const currentSearch = params.search || "";
@@ -3215,7 +3231,7 @@ function useCursorPaginationState(options) {
3215
3231
  }
3216
3232
 
3217
3233
  // src/hooks/nats/use-nats-client.ts
3218
- import { useEffect as useEffect20, useMemo as useMemo5, useState as useState22 } from "react";
3234
+ import { useEffect as useEffect21, useMemo as useMemo5, useState as useState22 } from "react";
3219
3235
  function useNatsClient(clientOptions, options = {}) {
3220
3236
  const { autoConnect = true } = options;
3221
3237
  const client = useMemo5(() => {
@@ -3224,7 +3240,7 @@ function useNatsClient(clientOptions, options = {}) {
3224
3240
  }, [clientOptions]);
3225
3241
  const [status, setStatus] = useState22("disconnected");
3226
3242
  const [lastError, setLastError] = useState22(null);
3227
- useEffect20(() => {
3243
+ useEffect21(() => {
3228
3244
  if (!client) {
3229
3245
  setStatus("disconnected");
3230
3246
  setLastError(null);
@@ -3255,16 +3271,22 @@ function useNatsClient(clientOptions, options = {}) {
3255
3271
  }
3256
3272
 
3257
3273
  // src/hooks/use-near-viewport.ts
3258
- import { useEffect as useEffect21, useRef as useRef13, useState as useState23, useCallback as useCallback14 } from "react";
3274
+ import { useEffect as useEffect22, useRef as useRef13, useState as useState23, useCallback as useCallback14 } from "react";
3259
3275
  var observers = /* @__PURE__ */ new Map();
3260
3276
  var subscribers = /* @__PURE__ */ new WeakMap();
3261
- function getObserverFor(rootMargin) {
3262
- const existing = observers.get(rootMargin);
3277
+ var THRESHOLD_EPSILON = 0.01;
3278
+ function observerKey(rootMargin, threshold) {
3279
+ return `${rootMargin}|${threshold}`;
3280
+ }
3281
+ function getObserverFor(rootMargin, threshold) {
3282
+ const key = observerKey(rootMargin, threshold);
3283
+ const existing = observers.get(key);
3263
3284
  if (existing) return existing;
3264
3285
  const io = new IntersectionObserver(
3265
3286
  (entries) => {
3266
3287
  entries.forEach((entry) => {
3267
3288
  if (!entry.isIntersecting) return;
3289
+ if (entry.intersectionRatio < threshold - THRESHOLD_EPSILON) return;
3268
3290
  const cb = subscribers.get(entry.target);
3269
3291
  if (cb) {
3270
3292
  cb();
@@ -3273,15 +3295,16 @@ function getObserverFor(rootMargin) {
3273
3295
  }
3274
3296
  });
3275
3297
  },
3276
- { rootMargin }
3298
+ { rootMargin, threshold }
3277
3299
  );
3278
- observers.set(rootMargin, io);
3300
+ observers.set(key, io);
3279
3301
  return io;
3280
3302
  }
3281
3303
  var NEAR_VIEWPORT_ROOT_MARGIN = "500px";
3282
- function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN) {
3304
+ function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN, threshold = 0) {
3283
3305
  const [isNear, setIsNear] = useState23(false);
3284
3306
  const elRef = useRef13(null);
3307
+ const key = observerKey(rootMargin, threshold);
3285
3308
  const ref = useCallback14(
3286
3309
  (node) => {
3287
3310
  const prev = elRef.current;
@@ -3289,27 +3312,27 @@ function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN) {
3289
3312
  const stillOurs = subscribers.get(prev);
3290
3313
  if (stillOurs) {
3291
3314
  subscribers.delete(prev);
3292
- observers.get(rootMargin)?.unobserve(prev);
3315
+ observers.get(key)?.unobserve(prev);
3293
3316
  }
3294
3317
  }
3295
3318
  elRef.current = node;
3296
3319
  if (!node) return;
3297
3320
  const cb = () => setIsNear(true);
3298
3321
  subscribers.set(node, cb);
3299
- getObserverFor(rootMargin).observe(node);
3322
+ getObserverFor(rootMargin, threshold).observe(node);
3300
3323
  },
3301
- [rootMargin]
3324
+ [key, rootMargin, threshold]
3302
3325
  );
3303
- useEffect21(() => {
3326
+ useEffect22(() => {
3304
3327
  return () => {
3305
3328
  const el = elRef.current;
3306
3329
  if (!el) return;
3307
3330
  if (subscribers.get(el)) {
3308
3331
  subscribers.delete(el);
3309
- observers.get(rootMargin)?.unobserve(el);
3332
+ observers.get(key)?.unobserve(el);
3310
3333
  }
3311
3334
  };
3312
- }, [rootMargin]);
3335
+ }, [key]);
3313
3336
  return { ref, isNear };
3314
3337
  }
3315
3338
 
@@ -3458,7 +3481,7 @@ function useOgPlaceholderUrl({
3458
3481
  }
3459
3482
 
3460
3483
  // src/hooks/use-scroll-to-hash.ts
3461
- import { useEffect as useEffect22 } from "react";
3484
+ import { useEffect as useEffect23 } from "react";
3462
3485
 
3463
3486
  // src/utils/scroll-into-view.ts
3464
3487
  var activeRaf = 0;
@@ -3596,7 +3619,7 @@ function navigateSamePageHash(target, options = {}) {
3596
3619
  var MAX_POLL_FRAMES = 60;
3597
3620
  function useScrollToHash(readyDep = true, options) {
3598
3621
  const headerOffset = options?.headerOffset ?? 0;
3599
- useEffect22(() => {
3622
+ useEffect23(() => {
3600
3623
  if (typeof window === "undefined") return;
3601
3624
  if (readyDep === null || readyDep === false) return;
3602
3625
  let rafId = null;
@@ -3694,6 +3717,7 @@ export {
3694
3717
  useMemoizedCallback,
3695
3718
  useNotificationPermission,
3696
3719
  useOnboardingState,
3720
+ useResetOnPageHidden,
3697
3721
  useSearch,
3698
3722
  useSuppressCloneFocus,
3699
3723
  useTablePagination,
@@ -3794,4 +3818,4 @@ export {
3794
3818
  splitCsvEnv,
3795
3819
  useHumanitySignals
3796
3820
  };
3797
- //# sourceMappingURL=chunk-BD3JBEUC.js.map
3821
+ //# sourceMappingURL=chunk-MK2YWJAA.js.map