@flamingo-stack/openframe-frontend-core 0.0.454 → 0.0.455
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-AJAF456I.js → chunk-2KUIA2AR.js} +3 -3
- package/dist/{chunk-55ISAJFV.js → chunk-5YPKZM6Y.js} +6 -6
- package/dist/{chunk-72VDY6MM.cjs → chunk-62AXZKYN.cjs} +539 -674
- package/dist/chunk-62AXZKYN.cjs.map +1 -0
- package/dist/{chunk-TMST2WFZ.js → chunk-6W4ZEVIC.js} +3 -3
- package/dist/{chunk-MLFFBQ5B.js → chunk-BD3JBEUC.js} +65 -135
- package/dist/chunk-BD3JBEUC.js.map +1 -0
- package/dist/{chunk-ACUD4XVZ.cjs → chunk-BE77G7GW.cjs} +40 -40
- package/dist/{chunk-ACUD4XVZ.cjs.map → chunk-BE77G7GW.cjs.map} +1 -1
- package/dist/{chunk-OZZ4VQ52.cjs → chunk-D5PBUVGB.cjs} +5 -5
- package/dist/{chunk-OZZ4VQ52.cjs.map → chunk-D5PBUVGB.cjs.map} +1 -1
- package/dist/{chunk-UGFB5EAW.js → chunk-DGPKGESY.js} +4 -4
- package/dist/{chunk-OGKDOG5D.js → chunk-EGTGRG7N.js} +2 -2
- package/dist/{chunk-XH33VG5A.cjs → chunk-FCVF4YAB.cjs} +40 -40
- package/dist/{chunk-XH33VG5A.cjs.map → chunk-FCVF4YAB.cjs.map} +1 -1
- package/dist/{chunk-WLUIXASU.cjs → chunk-GNYV6HYO.cjs} +15 -15
- package/dist/{chunk-WLUIXASU.cjs.map → chunk-GNYV6HYO.cjs.map} +1 -1
- package/dist/{chunk-PB24PKG2.cjs → chunk-IDCPYG7N.cjs} +29 -29
- package/dist/{chunk-PB24PKG2.cjs.map → chunk-IDCPYG7N.cjs.map} +1 -1
- package/dist/{chunk-YED55PQY.js → chunk-JUUPMMKI.js} +3 -3
- package/dist/{chunk-QF3NQW7C.cjs → chunk-KTGGM5WA.cjs} +2 -72
- package/dist/chunk-KTGGM5WA.cjs.map +1 -0
- package/dist/{chunk-GOWE4WSU.js → chunk-LB3OZE4B.js} +6 -6
- package/dist/{chunk-IM5A5F2E.cjs → chunk-M5RT26WQ.cjs} +73 -73
- package/dist/{chunk-IM5A5F2E.cjs.map → chunk-M5RT26WQ.cjs.map} +1 -1
- package/dist/{chunk-UOTHXOCS.js → chunk-N4CHA7T7.js} +5416 -5551
- package/dist/chunk-N4CHA7T7.js.map +1 -0
- package/dist/{chunk-44AD5D3C.cjs → chunk-NNDNJCJ3.cjs} +18 -18
- package/dist/{chunk-44AD5D3C.cjs.map → chunk-NNDNJCJ3.cjs.map} +1 -1
- package/dist/{chunk-PT233TJV.js → chunk-QSIZW6EX.js} +2 -2
- package/dist/{chunk-UPRY4I63.cjs → chunk-RT7DIGTN.cjs} +3 -3
- package/dist/{chunk-UPRY4I63.cjs.map → chunk-RT7DIGTN.cjs.map} +1 -1
- package/dist/{chunk-N2UFIQAD.cjs → chunk-RZL7I6YN.cjs} +7 -7
- package/dist/{chunk-N2UFIQAD.cjs.map → chunk-RZL7I6YN.cjs.map} +1 -1
- package/dist/{chunk-5HQV2F5K.cjs → chunk-UJZ6O2ON.cjs} +32 -32
- package/dist/{chunk-5HQV2F5K.cjs.map → chunk-UJZ6O2ON.cjs.map} +1 -1
- package/dist/{chunk-JUNKHNWE.js → chunk-VNE5R4LQ.js} +5 -5
- package/dist/{chunk-EQWE64RJ.js → chunk-X62ICFPJ.js} +2 -2
- package/dist/{chunk-YJ7SPS7I.js → chunk-XAQLBUCP.js} +2 -2
- package/dist/{chunk-NUT3HRKS.cjs → chunk-XT6S6DYS.cjs} +12 -12
- package/dist/{chunk-NUT3HRKS.cjs.map → chunk-XT6S6DYS.cjs.map} +1 -1
- package/dist/{chunk-YAZIVPUF.cjs → chunk-YSKSBLCG.cjs} +73 -73
- package/dist/{chunk-YAZIVPUF.cjs.map → chunk-YSKSBLCG.cjs.map} +1 -1
- package/dist/{chunk-MX2ITMKK.js → chunk-YXCYQKAX.js} +5 -5
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/guide-welcome.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +3 -9
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.d.ts +0 -2
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +2 -8
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/quick-action-chip.d.ts +48 -0
- package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
- package/dist/components/chat/quick-action-marquee.d.ts.map +1 -1
- package/dist/components/chat/quick-action-wall.d.ts +1 -2
- package/dist/components/chat/quick-action-wall.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +0 -12
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/faq/index.js +4 -4
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +135 -141
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +11 -17
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/onboarding-guides/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.js +6 -6
- package/dist/components/related-content/index.cjs +5 -5
- package/dist/components/related-content/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +3 -9
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +2 -8
- package/dist/hooks/index.cjs +2 -4
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -3
- package/dist/index.cjs +3 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -10
- package/package.json +1 -1
- package/src/components/chat/approval-request-message.tsx +1 -1
- package/src/components/chat/chat-context-picker.tsx +1 -1
- package/src/components/chat/chat-input.tsx +1 -1
- package/src/components/chat/chat-message-list.tsx +5 -1
- package/src/components/chat/chat-message-skeleton.tsx +1 -1
- package/src/components/chat/chat-sidebar-skeleton.tsx +1 -1
- package/src/components/chat/chat-sidebar.tsx +2 -2
- package/src/components/chat/chat-ticket-list.tsx +1 -1
- package/src/components/chat/context-items-list.tsx +1 -1
- package/src/components/chat/embeddable-chat.tsx +15 -3
- package/src/components/chat/guide-welcome.tsx +23 -14
- package/src/components/chat/index.ts +0 -2
- package/src/components/chat/mingo-chat-history.tsx +1 -1
- package/src/components/chat/mingo-welcome.tsx +41 -27
- package/src/components/chat/quick-action-chip.tsx +77 -0
- package/src/components/chat/quick-action-marquee.tsx +1 -2
- package/src/components/chat/quick-action-wall.tsx +6 -4
- package/src/components/chat/slash-command-suggestions.tsx +1 -1
- package/src/components/chat/tool-call-blocks.tsx +1 -1
- package/src/components/chat/types/component.types.ts +0 -15
- package/src/hooks/.index.md +0 -1
- package/src/hooks/index.ts +0 -1
- package/src/stories/ChatContainer.stories.tsx +15 -12
- package/src/stories/QuickActionWall.stories.tsx +1 -2
- package/dist/chunk-72VDY6MM.cjs.map +0 -1
- package/dist/chunk-MLFFBQ5B.js.map +0 -1
- package/dist/chunk-QF3NQW7C.cjs.map +0 -1
- package/dist/chunk-UOTHXOCS.js.map +0 -1
- package/dist/components/chat/chat-quick-action-row.d.ts +0 -84
- package/dist/components/chat/chat-quick-action-row.d.ts.map +0 -1
- package/dist/components/chat/chat-quick-action.d.ts +0 -11
- package/dist/components/chat/chat-quick-action.d.ts.map +0 -1
- package/dist/hooks/use-quick-action-hint.d.ts +0 -25
- package/dist/hooks/use-quick-action-hint.d.ts.map +0 -1
- package/src/components/chat/.chat-quick-action.md +0 -46
- package/src/components/chat/chat-quick-action-row.tsx +0 -282
- package/src/components/chat/chat-quick-action.tsx +0 -59
- package/src/hooks/.use-quick-action-hint.md +0 -43
- package/src/hooks/use-quick-action-hint.ts +0 -126
- /package/dist/{chunk-AJAF456I.js.map → chunk-2KUIA2AR.js.map} +0 -0
- /package/dist/{chunk-55ISAJFV.js.map → chunk-5YPKZM6Y.js.map} +0 -0
- /package/dist/{chunk-TMST2WFZ.js.map → chunk-6W4ZEVIC.js.map} +0 -0
- /package/dist/{chunk-UGFB5EAW.js.map → chunk-DGPKGESY.js.map} +0 -0
- /package/dist/{chunk-OGKDOG5D.js.map → chunk-EGTGRG7N.js.map} +0 -0
- /package/dist/{chunk-YED55PQY.js.map → chunk-JUUPMMKI.js.map} +0 -0
- /package/dist/{chunk-GOWE4WSU.js.map → chunk-LB3OZE4B.js.map} +0 -0
- /package/dist/{chunk-PT233TJV.js.map → chunk-QSIZW6EX.js.map} +0 -0
- /package/dist/{chunk-JUNKHNWE.js.map → chunk-VNE5R4LQ.js.map} +0 -0
- /package/dist/{chunk-EQWE64RJ.js.map → chunk-X62ICFPJ.js.map} +0 -0
- /package/dist/{chunk-YJ7SPS7I.js.map → chunk-XAQLBUCP.js.map} +0 -0
- /package/dist/{chunk-MX2ITMKK.js.map → chunk-YXCYQKAX.js.map} +0 -0
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
resolveExternalNavigation,
|
|
7
7
|
resolveSourceIcon,
|
|
8
8
|
stripSameOriginToPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N4CHA7T7.js";
|
|
10
10
|
import {
|
|
11
11
|
contentFetch,
|
|
12
12
|
useDebounce
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BD3JBEUC.js";
|
|
14
14
|
import {
|
|
15
15
|
useChatRuntime
|
|
16
16
|
} from "./chunk-KFQXO7QB.js";
|
|
@@ -347,4 +347,4 @@ export {
|
|
|
347
347
|
resolveSearchResultAction,
|
|
348
348
|
useDocSearch
|
|
349
349
|
};
|
|
350
|
-
//# sourceMappingURL=chunk-
|
|
350
|
+
//# sourceMappingURL=chunk-6W4ZEVIC.js.map
|
|
@@ -2009,77 +2009,8 @@ function useContactSubmission(options = {}) {
|
|
|
2009
2009
|
return { submit, isSubmitting, isSuccess, setIsSuccess };
|
|
2010
2010
|
}
|
|
2011
2011
|
|
|
2012
|
-
// src/hooks/use-quick-action-hint.ts
|
|
2013
|
-
import { useEffect as useEffect16, useState as useState17, useRef as useRef9, useCallback as useCallback10 } from "react";
|
|
2014
|
-
function useQuickActionHint({
|
|
2015
|
-
actionCount,
|
|
2016
|
-
cycleDuration = 5e3,
|
|
2017
|
-
enabled = true
|
|
2018
|
-
}) {
|
|
2019
|
-
const [activeHintIndex, setActiveHintIndex] = useState17(-1);
|
|
2020
|
-
const containerRef = useRef9(null);
|
|
2021
|
-
const timeoutRef = useRef9(null);
|
|
2022
|
-
const cycleCountRef = useRef9(0);
|
|
2023
|
-
const currentIndexRef = useRef9(0);
|
|
2024
|
-
const sequenceRef = useRef9([]);
|
|
2025
|
-
const shuffleIndices = useCallback10((length) => {
|
|
2026
|
-
const indices = Array.from({ length }, (_, i) => i);
|
|
2027
|
-
for (let i = indices.length - 1; i > 0; i--) {
|
|
2028
|
-
const j = Math.floor(Math.random() * (i + 1));
|
|
2029
|
-
[indices[i], indices[j]] = [indices[j], indices[i]];
|
|
2030
|
-
}
|
|
2031
|
-
return indices;
|
|
2032
|
-
}, []);
|
|
2033
|
-
const stopHint = useCallback10(() => {
|
|
2034
|
-
if (timeoutRef.current) {
|
|
2035
|
-
clearTimeout(timeoutRef.current);
|
|
2036
|
-
timeoutRef.current = null;
|
|
2037
|
-
}
|
|
2038
|
-
setActiveHintIndex(-1);
|
|
2039
|
-
cycleCountRef.current = 0;
|
|
2040
|
-
currentIndexRef.current = 0;
|
|
2041
|
-
sequenceRef.current = [];
|
|
2042
|
-
}, []);
|
|
2043
|
-
const advanceHint = useCallback10(() => {
|
|
2044
|
-
if (currentIndexRef.current === 0) {
|
|
2045
|
-
sequenceRef.current = shuffleIndices(actionCount);
|
|
2046
|
-
}
|
|
2047
|
-
const nextIndex = sequenceRef.current[currentIndexRef.current];
|
|
2048
|
-
setActiveHintIndex(nextIndex);
|
|
2049
|
-
currentIndexRef.current++;
|
|
2050
|
-
if (currentIndexRef.current >= actionCount) {
|
|
2051
|
-
currentIndexRef.current = 0;
|
|
2052
|
-
cycleCountRef.current++;
|
|
2053
|
-
}
|
|
2054
|
-
timeoutRef.current = setTimeout(advanceHint, cycleDuration);
|
|
2055
|
-
}, [actionCount, cycleDuration, shuffleIndices]);
|
|
2056
|
-
useEffect16(() => {
|
|
2057
|
-
if (!enabled || actionCount === 0) {
|
|
2058
|
-
return;
|
|
2059
|
-
}
|
|
2060
|
-
if (typeof window !== "undefined") {
|
|
2061
|
-
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2062
|
-
if (prefersReducedMotion) return;
|
|
2063
|
-
}
|
|
2064
|
-
const startTimeout = setTimeout(() => {
|
|
2065
|
-
cycleCountRef.current = 0;
|
|
2066
|
-
currentIndexRef.current = 0;
|
|
2067
|
-
advanceHint();
|
|
2068
|
-
}, 500);
|
|
2069
|
-
return () => {
|
|
2070
|
-
clearTimeout(startTimeout);
|
|
2071
|
-
stopHint();
|
|
2072
|
-
};
|
|
2073
|
-
}, [enabled, actionCount, advanceHint, stopHint]);
|
|
2074
|
-
return {
|
|
2075
|
-
activeHintIndex,
|
|
2076
|
-
stopHint,
|
|
2077
|
-
containerRef
|
|
2078
|
-
};
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
2012
|
// src/hooks/use-copy-to-clipboard.ts
|
|
2082
|
-
import { useCallback as
|
|
2013
|
+
import { useCallback as useCallback10, useState as useState17 } from "react";
|
|
2083
2014
|
function useCopyToClipboard({
|
|
2084
2015
|
successTitle = "Copied",
|
|
2085
2016
|
successDescription = "Copied to clipboard",
|
|
@@ -2088,8 +2019,8 @@ function useCopyToClipboard({
|
|
|
2088
2019
|
resetDelay = 2e3
|
|
2089
2020
|
} = {}) {
|
|
2090
2021
|
const { toast: toast2 } = useToast();
|
|
2091
|
-
const [copied, setCopied] =
|
|
2092
|
-
const copy =
|
|
2022
|
+
const [copied, setCopied] = useState17(false);
|
|
2023
|
+
const copy = useCallback10(
|
|
2093
2024
|
async (text) => {
|
|
2094
2025
|
try {
|
|
2095
2026
|
await navigator.clipboard.writeText(text);
|
|
@@ -2106,7 +2037,7 @@ function useCopyToClipboard({
|
|
|
2106
2037
|
}
|
|
2107
2038
|
|
|
2108
2039
|
// src/hooks/use-batch-images.ts
|
|
2109
|
-
import { useEffect as
|
|
2040
|
+
import { useEffect as useEffect16, useMemo as useMemo2, useState as useState18, useRef as useRef9 } from "react";
|
|
2110
2041
|
var globalBatchImageConfig = {};
|
|
2111
2042
|
function configureBatchImageFetch(config) {
|
|
2112
2043
|
globalBatchImageConfig = { ...globalBatchImageConfig, ...config };
|
|
@@ -2179,14 +2110,14 @@ async function batchFetchAuthenticatedImages(imageUrls, config) {
|
|
|
2179
2110
|
return results;
|
|
2180
2111
|
}
|
|
2181
2112
|
function useBatchImages(imageUrls, config) {
|
|
2182
|
-
const [fetchedImages, setFetchedImages] =
|
|
2183
|
-
const [loading, setLoading] =
|
|
2113
|
+
const [fetchedImages, setFetchedImages] = useState18({});
|
|
2114
|
+
const [loading, setLoading] = useState18(false);
|
|
2184
2115
|
const uniqueUrls = useMemo2(
|
|
2185
2116
|
() => Array.from(new Set(imageUrls.filter((url) => Boolean(url)))),
|
|
2186
2117
|
[imageUrls]
|
|
2187
2118
|
);
|
|
2188
|
-
const requestedUrls =
|
|
2189
|
-
|
|
2119
|
+
const requestedUrls = useRef9(/* @__PURE__ */ new Set());
|
|
2120
|
+
useEffect16(() => {
|
|
2190
2121
|
if (uniqueUrls.length === 0) {
|
|
2191
2122
|
setFetchedImages({});
|
|
2192
2123
|
return;
|
|
@@ -2216,7 +2147,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
2216
2147
|
}
|
|
2217
2148
|
|
|
2218
2149
|
// src/hooks/use-authenticated-image.ts
|
|
2219
|
-
import { useEffect as
|
|
2150
|
+
import { useEffect as useEffect17, useState as useState19, useRef as useRef10 } from "react";
|
|
2220
2151
|
var globalImageConfig = {};
|
|
2221
2152
|
var imageCache = /* @__PURE__ */ new Map();
|
|
2222
2153
|
var pendingRequests = /* @__PURE__ */ new Map();
|
|
@@ -2245,11 +2176,11 @@ function getImageConfig() {
|
|
|
2245
2176
|
};
|
|
2246
2177
|
}
|
|
2247
2178
|
function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
2248
|
-
const [fetchedImageUrl, setFetchedImageUrl] =
|
|
2249
|
-
const [isLoading, setIsLoading] =
|
|
2250
|
-
const [error, setError] =
|
|
2251
|
-
const currentCacheKeyRef =
|
|
2252
|
-
|
|
2179
|
+
const [fetchedImageUrl, setFetchedImageUrl] = useState19();
|
|
2180
|
+
const [isLoading, setIsLoading] = useState19(false);
|
|
2181
|
+
const [error, setError] = useState19(null);
|
|
2182
|
+
const currentCacheKeyRef = useRef10(null);
|
|
2183
|
+
useEffect17(() => {
|
|
2253
2184
|
if (!imageUrl) {
|
|
2254
2185
|
setFetchedImageUrl(void 0);
|
|
2255
2186
|
setIsLoading(false);
|
|
@@ -2360,7 +2291,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
2360
2291
|
});
|
|
2361
2292
|
pendingRequests.set(cacheKey, fetchPromise2);
|
|
2362
2293
|
}, [imageUrl, refreshKey, config]);
|
|
2363
|
-
|
|
2294
|
+
useEffect17(() => {
|
|
2364
2295
|
return () => {
|
|
2365
2296
|
if (currentCacheKeyRef.current) {
|
|
2366
2297
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -2375,7 +2306,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
2375
2306
|
|
|
2376
2307
|
// src/hooks/state/use-query-params.ts
|
|
2377
2308
|
init_next_navigation();
|
|
2378
|
-
import { useEffect as
|
|
2309
|
+
import { useEffect as useEffect18, useState as useState20, useMemo as useMemo3, useCallback as useCallback11 } from "react";
|
|
2379
2310
|
|
|
2380
2311
|
// src/hooks/state/graphql-parser.ts
|
|
2381
2312
|
import {
|
|
@@ -2837,14 +2768,14 @@ var introspector = new GraphQLIntrospector();
|
|
|
2837
2768
|
function useQueryParams(query, options = {}) {
|
|
2838
2769
|
const router = useRouter();
|
|
2839
2770
|
const searchParams = useSearchParams();
|
|
2840
|
-
const [isLoading, setIsLoading] =
|
|
2841
|
-
const [isReady, setIsReady] =
|
|
2842
|
-
const [error, setError] =
|
|
2843
|
-
const [schema, setSchema] =
|
|
2771
|
+
const [isLoading, setIsLoading] = useState20(true);
|
|
2772
|
+
const [isReady, setIsReady] = useState20(false);
|
|
2773
|
+
const [error, setError] = useState20(null);
|
|
2774
|
+
const [schema, setSchema] = useState20({});
|
|
2844
2775
|
const defaultValues = options.defaultValues || {};
|
|
2845
2776
|
const skipIntrospection = options.skipIntrospection || false;
|
|
2846
2777
|
const debug = options.debug || false;
|
|
2847
|
-
|
|
2778
|
+
useEffect18(() => {
|
|
2848
2779
|
async function initialize() {
|
|
2849
2780
|
try {
|
|
2850
2781
|
if (debug) console.log("[useQueryParams] Initializing...");
|
|
@@ -2914,14 +2845,14 @@ function useQueryParams(query, options = {}) {
|
|
|
2914
2845
|
});
|
|
2915
2846
|
return result;
|
|
2916
2847
|
}, [searchParams]);
|
|
2917
|
-
const updateUrl =
|
|
2848
|
+
const updateUrl = useCallback11((newParams) => {
|
|
2918
2849
|
const url = newParams.toString() ? `?${newParams.toString()}` : window.location.pathname;
|
|
2919
2850
|
if (debug) {
|
|
2920
2851
|
console.log("[useQueryParams] Updating URL:", url);
|
|
2921
2852
|
}
|
|
2922
2853
|
router.replace(url, { scroll: false });
|
|
2923
2854
|
}, [router, debug]);
|
|
2924
|
-
const setParam =
|
|
2855
|
+
const setParam = useCallback11((key, value) => {
|
|
2925
2856
|
if (!isReady) {
|
|
2926
2857
|
console.warn("[useQueryParams] Schema not ready, cannot set param");
|
|
2927
2858
|
return;
|
|
@@ -2935,7 +2866,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2935
2866
|
console.error("[useQueryParams] Failed to set param:", err);
|
|
2936
2867
|
}
|
|
2937
2868
|
}, [variables, schema, isReady, updateUrl]);
|
|
2938
|
-
const setParams =
|
|
2869
|
+
const setParams = useCallback11((updates) => {
|
|
2939
2870
|
if (!isReady) {
|
|
2940
2871
|
console.warn("[useQueryParams] Schema not ready, cannot set params");
|
|
2941
2872
|
return;
|
|
@@ -2949,7 +2880,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2949
2880
|
console.error("[useQueryParams] Failed to set params:", err);
|
|
2950
2881
|
}
|
|
2951
2882
|
}, [variables, schema, isReady, updateUrl]);
|
|
2952
|
-
const clearParamsHandler =
|
|
2883
|
+
const clearParamsHandler = useCallback11((keys) => {
|
|
2953
2884
|
if (!isReady) {
|
|
2954
2885
|
console.warn("[useQueryParams] Schema not ready, cannot clear params");
|
|
2955
2886
|
return;
|
|
@@ -2963,7 +2894,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2963
2894
|
console.error("[useQueryParams] Failed to clear params:", err);
|
|
2964
2895
|
}
|
|
2965
2896
|
}, [variables, schema, isReady, updateUrl]);
|
|
2966
|
-
const resetParams =
|
|
2897
|
+
const resetParams = useCallback11(() => {
|
|
2967
2898
|
if (debug) {
|
|
2968
2899
|
console.log("[useQueryParams] Resetting params");
|
|
2969
2900
|
}
|
|
@@ -2996,9 +2927,9 @@ function applyParamMapping(schema, mapping) {
|
|
|
2996
2927
|
|
|
2997
2928
|
// src/hooks/state/use-api-params.ts
|
|
2998
2929
|
init_next_navigation();
|
|
2999
|
-
import { useCallback as
|
|
2930
|
+
import { useCallback as useCallback12, useMemo as useMemo4, useRef as useRef11 } from "react";
|
|
3000
2931
|
function useContentStable(value, key) {
|
|
3001
|
-
const ref =
|
|
2932
|
+
const ref = useRef11(void 0);
|
|
3002
2933
|
if (ref.current && ref.current.key === key) return ref.current.value;
|
|
3003
2934
|
ref.current = { value, key };
|
|
3004
2935
|
return value;
|
|
@@ -3031,7 +2962,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3031
2962
|
}
|
|
3032
2963
|
return flattened;
|
|
3033
2964
|
}, [schemaKey]);
|
|
3034
|
-
const prevParamsRef =
|
|
2965
|
+
const prevParamsRef = useRef11(void 0);
|
|
3035
2966
|
const params = useMemo4(() => {
|
|
3036
2967
|
const sp = new URLSearchParams(searchString);
|
|
3037
2968
|
const result = {};
|
|
@@ -3055,7 +2986,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3055
2986
|
prevParamsRef.current = result;
|
|
3056
2987
|
return result;
|
|
3057
2988
|
}, [searchString, schemaKey, debug]);
|
|
3058
|
-
const addParamToSearchParams =
|
|
2989
|
+
const addParamToSearchParams = useCallback12((searchParams, key, value) => {
|
|
3059
2990
|
if (value === void 0 || value === "" || value === null) {
|
|
3060
2991
|
return;
|
|
3061
2992
|
}
|
|
@@ -3083,7 +3014,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3083
3014
|
}
|
|
3084
3015
|
return newParams;
|
|
3085
3016
|
}, [params, schemaKey, flattenedSchema, addParamToSearchParams]);
|
|
3086
|
-
const updateUrl =
|
|
3017
|
+
const updateUrl = useCallback12((newParams, keysToRemove = []) => {
|
|
3087
3018
|
const finalParams = new URLSearchParams(searchString);
|
|
3088
3019
|
keysToRemove.forEach((key) => {
|
|
3089
3020
|
if (key in stableSchema) {
|
|
@@ -3119,7 +3050,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3119
3050
|
}
|
|
3120
3051
|
return false;
|
|
3121
3052
|
};
|
|
3122
|
-
const setParam =
|
|
3053
|
+
const setParam = useCallback12((key, value) => {
|
|
3123
3054
|
const config = stableSchema[key];
|
|
3124
3055
|
if (!config) {
|
|
3125
3056
|
console.warn(`[useApiParams] Unknown parameter: ${key}`);
|
|
@@ -3133,7 +3064,7 @@ function useApiParams(schema, options = {}) {
|
|
|
3133
3064
|
updateUrl(newParams);
|
|
3134
3065
|
}
|
|
3135
3066
|
}, [schemaKey, updateUrl, addParamToSearchParams]);
|
|
3136
|
-
const setParams =
|
|
3067
|
+
const setParams = useCallback12((updates) => {
|
|
3137
3068
|
const newParams = new URLSearchParams();
|
|
3138
3069
|
const keysToRemove = [];
|
|
3139
3070
|
for (const [key, value] of Object.entries(updates)) {
|
|
@@ -3150,11 +3081,11 @@ function useApiParams(schema, options = {}) {
|
|
|
3150
3081
|
}
|
|
3151
3082
|
updateUrl(newParams, keysToRemove);
|
|
3152
3083
|
}, [schemaKey, updateUrl, addParamToSearchParams]);
|
|
3153
|
-
const clearParams2 =
|
|
3084
|
+
const clearParams2 = useCallback12((keys) => {
|
|
3154
3085
|
const newParams = new URLSearchParams();
|
|
3155
3086
|
updateUrl(newParams, keys);
|
|
3156
3087
|
}, [updateUrl]);
|
|
3157
|
-
const resetParams =
|
|
3088
|
+
const resetParams = useCallback12(() => {
|
|
3158
3089
|
if (debug) {
|
|
3159
3090
|
console.log("[useApiParams] Resetting params");
|
|
3160
3091
|
}
|
|
@@ -3191,7 +3122,7 @@ function createSearchParams(params) {
|
|
|
3191
3122
|
}
|
|
3192
3123
|
|
|
3193
3124
|
// src/hooks/state/use-cursor-pagination-state.ts
|
|
3194
|
-
import { useCallback as
|
|
3125
|
+
import { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef12, useState as useState21 } from "react";
|
|
3195
3126
|
var urlSchema = {
|
|
3196
3127
|
search: { type: "string", default: "" },
|
|
3197
3128
|
cursor: { type: "string", default: "" }
|
|
@@ -3202,13 +3133,13 @@ function useCursorPaginationState(options) {
|
|
|
3202
3133
|
onSearchChange
|
|
3203
3134
|
} = options;
|
|
3204
3135
|
const { params, setParam, setParams } = useApiParams(urlSchema);
|
|
3205
|
-
const [searchInput, setSearchInput] =
|
|
3206
|
-
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] =
|
|
3207
|
-
const [initialLoadCount, setInitialLoadCount] =
|
|
3208
|
-
const lastSearchRef =
|
|
3209
|
-
const isSyncingFromUrl =
|
|
3210
|
-
const isInitialLoadInProgress =
|
|
3211
|
-
|
|
3136
|
+
const [searchInput, setSearchInput] = useState21(params.search || "");
|
|
3137
|
+
const [hasLoadedBeyondFirst, setHasLoadedBeyondFirst] = useState21(false);
|
|
3138
|
+
const [initialLoadCount, setInitialLoadCount] = useState21(0);
|
|
3139
|
+
const lastSearchRef = useRef12(null);
|
|
3140
|
+
const isSyncingFromUrl = useRef12(false);
|
|
3141
|
+
const isInitialLoadInProgress = useRef12(true);
|
|
3142
|
+
useEffect19(() => {
|
|
3212
3143
|
if (isInitialLoadInProgress.current) return;
|
|
3213
3144
|
const urlSearch = params.search || "";
|
|
3214
3145
|
if (urlSearch !== searchInput) {
|
|
@@ -3219,7 +3150,7 @@ function useCursorPaginationState(options) {
|
|
|
3219
3150
|
}, 0);
|
|
3220
3151
|
}
|
|
3221
3152
|
}, [params.search, initialLoadCount]);
|
|
3222
|
-
|
|
3153
|
+
useEffect19(() => {
|
|
3223
3154
|
if (isInitialLoadInProgress.current) return;
|
|
3224
3155
|
if (isSyncingFromUrl.current) return;
|
|
3225
3156
|
if (searchInput !== params.search) {
|
|
@@ -3230,7 +3161,7 @@ function useCursorPaginationState(options) {
|
|
|
3230
3161
|
});
|
|
3231
3162
|
}
|
|
3232
3163
|
}, [searchInput, params.search, setParams, initialLoadCount]);
|
|
3233
|
-
|
|
3164
|
+
useEffect19(() => {
|
|
3234
3165
|
if (initialLoadCount === 0) {
|
|
3235
3166
|
const cursor = params.cursor || null;
|
|
3236
3167
|
const search = params.search || "";
|
|
@@ -3244,7 +3175,7 @@ function useCursorPaginationState(options) {
|
|
|
3244
3175
|
});
|
|
3245
3176
|
}
|
|
3246
3177
|
}, []);
|
|
3247
|
-
|
|
3178
|
+
useEffect19(() => {
|
|
3248
3179
|
if (isInitialLoadInProgress.current) return;
|
|
3249
3180
|
if (initialLoadCount === 0) return;
|
|
3250
3181
|
const currentSearch = params.search || "";
|
|
@@ -3254,7 +3185,7 @@ function useCursorPaginationState(options) {
|
|
|
3254
3185
|
onSearchChange(currentSearch);
|
|
3255
3186
|
}
|
|
3256
3187
|
}, [params.search, onSearchChange, initialLoadCount]);
|
|
3257
|
-
const handleNextPage =
|
|
3188
|
+
const handleNextPage = useCallback13(
|
|
3258
3189
|
async (endCursor, fetchFn) => {
|
|
3259
3190
|
setParam("cursor", endCursor);
|
|
3260
3191
|
await fetchFn();
|
|
@@ -3262,7 +3193,7 @@ function useCursorPaginationState(options) {
|
|
|
3262
3193
|
},
|
|
3263
3194
|
[setParam]
|
|
3264
3195
|
);
|
|
3265
|
-
const handleResetToFirstPage =
|
|
3196
|
+
const handleResetToFirstPage = useCallback13(
|
|
3266
3197
|
async (fetchFn) => {
|
|
3267
3198
|
setParam("cursor", "");
|
|
3268
3199
|
await fetchFn();
|
|
@@ -3284,16 +3215,16 @@ function useCursorPaginationState(options) {
|
|
|
3284
3215
|
}
|
|
3285
3216
|
|
|
3286
3217
|
// src/hooks/nats/use-nats-client.ts
|
|
3287
|
-
import { useEffect as
|
|
3218
|
+
import { useEffect as useEffect20, useMemo as useMemo5, useState as useState22 } from "react";
|
|
3288
3219
|
function useNatsClient(clientOptions, options = {}) {
|
|
3289
3220
|
const { autoConnect = true } = options;
|
|
3290
3221
|
const client = useMemo5(() => {
|
|
3291
3222
|
if (!clientOptions) return null;
|
|
3292
3223
|
return createNatsClient(clientOptions);
|
|
3293
3224
|
}, [clientOptions]);
|
|
3294
|
-
const [status, setStatus] =
|
|
3295
|
-
const [lastError, setLastError] =
|
|
3296
|
-
|
|
3225
|
+
const [status, setStatus] = useState22("disconnected");
|
|
3226
|
+
const [lastError, setLastError] = useState22(null);
|
|
3227
|
+
useEffect20(() => {
|
|
3297
3228
|
if (!client) {
|
|
3298
3229
|
setStatus("disconnected");
|
|
3299
3230
|
setLastError(null);
|
|
@@ -3324,7 +3255,7 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
3324
3255
|
}
|
|
3325
3256
|
|
|
3326
3257
|
// src/hooks/use-near-viewport.ts
|
|
3327
|
-
import { useEffect as
|
|
3258
|
+
import { useEffect as useEffect21, useRef as useRef13, useState as useState23, useCallback as useCallback14 } from "react";
|
|
3328
3259
|
var observers = /* @__PURE__ */ new Map();
|
|
3329
3260
|
var subscribers = /* @__PURE__ */ new WeakMap();
|
|
3330
3261
|
function getObserverFor(rootMargin) {
|
|
@@ -3349,9 +3280,9 @@ function getObserverFor(rootMargin) {
|
|
|
3349
3280
|
}
|
|
3350
3281
|
var NEAR_VIEWPORT_ROOT_MARGIN = "500px";
|
|
3351
3282
|
function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN) {
|
|
3352
|
-
const [isNear, setIsNear] =
|
|
3353
|
-
const elRef =
|
|
3354
|
-
const ref =
|
|
3283
|
+
const [isNear, setIsNear] = useState23(false);
|
|
3284
|
+
const elRef = useRef13(null);
|
|
3285
|
+
const ref = useCallback14(
|
|
3355
3286
|
(node) => {
|
|
3356
3287
|
const prev = elRef.current;
|
|
3357
3288
|
if (prev) {
|
|
@@ -3369,7 +3300,7 @@ function useNearViewport(rootMargin = NEAR_VIEWPORT_ROOT_MARGIN) {
|
|
|
3369
3300
|
},
|
|
3370
3301
|
[rootMargin]
|
|
3371
3302
|
);
|
|
3372
|
-
|
|
3303
|
+
useEffect21(() => {
|
|
3373
3304
|
return () => {
|
|
3374
3305
|
const el = elRef.current;
|
|
3375
3306
|
if (!el) return;
|
|
@@ -3527,7 +3458,7 @@ function useOgPlaceholderUrl({
|
|
|
3527
3458
|
}
|
|
3528
3459
|
|
|
3529
3460
|
// src/hooks/use-scroll-to-hash.ts
|
|
3530
|
-
import { useEffect as
|
|
3461
|
+
import { useEffect as useEffect22 } from "react";
|
|
3531
3462
|
|
|
3532
3463
|
// src/utils/scroll-into-view.ts
|
|
3533
3464
|
var activeRaf = 0;
|
|
@@ -3665,7 +3596,7 @@ function navigateSamePageHash(target, options = {}) {
|
|
|
3665
3596
|
var MAX_POLL_FRAMES = 60;
|
|
3666
3597
|
function useScrollToHash(readyDep = true, options) {
|
|
3667
3598
|
const headerOffset = options?.headerOffset ?? 0;
|
|
3668
|
-
|
|
3599
|
+
useEffect22(() => {
|
|
3669
3600
|
if (typeof window === "undefined") return;
|
|
3670
3601
|
if (readyDep === null || readyDep === false) return;
|
|
3671
3602
|
let rafId = null;
|
|
@@ -3705,7 +3636,7 @@ function useScrollToHash(readyDep = true, options) {
|
|
|
3705
3636
|
}
|
|
3706
3637
|
|
|
3707
3638
|
// src/hooks/use-humanity-signals.ts
|
|
3708
|
-
import { useCallback as
|
|
3639
|
+
import { useCallback as useCallback15, useRef as useRef14 } from "react";
|
|
3709
3640
|
|
|
3710
3641
|
// src/utils/humanity-signals.ts
|
|
3711
3642
|
var HONEYPOT_FIELD = "contact_url_confirm";
|
|
@@ -3729,16 +3660,16 @@ var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [
|
|
|
3729
3660
|
|
|
3730
3661
|
// src/hooks/use-humanity-signals.ts
|
|
3731
3662
|
function useHumanitySignals() {
|
|
3732
|
-
const ref =
|
|
3733
|
-
const mountedAt =
|
|
3734
|
-
const getSignals =
|
|
3663
|
+
const ref = useRef14(null);
|
|
3664
|
+
const mountedAt = useRef14(typeof performance !== "undefined" ? performance.now() : 0);
|
|
3665
|
+
const getSignals = useCallback15(
|
|
3735
3666
|
() => ({
|
|
3736
3667
|
[HONEYPOT_FIELD]: ref.current?.value ?? "",
|
|
3737
3668
|
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - mountedAt.current) : 0
|
|
3738
3669
|
}),
|
|
3739
3670
|
[]
|
|
3740
3671
|
);
|
|
3741
|
-
const resetSignals =
|
|
3672
|
+
const resetSignals = useCallback15(() => {
|
|
3742
3673
|
if (ref.current) ref.current.value = "";
|
|
3743
3674
|
if (typeof performance !== "undefined") mountedAt.current = performance.now();
|
|
3744
3675
|
}, []);
|
|
@@ -3811,7 +3742,6 @@ export {
|
|
|
3811
3742
|
embedAuthedFetch,
|
|
3812
3743
|
contentFetch,
|
|
3813
3744
|
useContactSubmission,
|
|
3814
|
-
useQuickActionHint,
|
|
3815
3745
|
useCopyToClipboard,
|
|
3816
3746
|
configureBatchImageFetch,
|
|
3817
3747
|
batchFetchAuthenticatedImages,
|
|
@@ -3864,4 +3794,4 @@ export {
|
|
|
3864
3794
|
splitCsvEnv,
|
|
3865
3795
|
useHumanitySignals
|
|
3866
3796
|
};
|
|
3867
|
-
//# sourceMappingURL=chunk-
|
|
3797
|
+
//# sourceMappingURL=chunk-BD3JBEUC.js.map
|