@flamingo-stack/openframe-frontend-core 0.0.388-snapshot.20260709030118 → 0.0.388
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-LFLFQ422.js → chunk-23BJ64AY.js} +2 -2
- package/dist/{chunk-WIMXB5EU.js → chunk-35C3PUUN.js} +4 -4
- package/dist/{chunk-VXJBE5NX.cjs → chunk-6ZAQOYW4.cjs} +59 -59
- package/dist/{chunk-VXJBE5NX.cjs.map → chunk-6ZAQOYW4.cjs.map} +1 -1
- package/dist/{chunk-4OLIDOLO.js → chunk-7CEJO3FE.js} +2 -2
- package/dist/{chunk-NULFIYK2.js → chunk-7UQ74ZJN.js} +2 -2
- package/dist/{chunk-BJPQJNSC.js → chunk-ATKRYY4U.js} +4 -4
- package/dist/{chunk-2JCSORCJ.cjs → chunk-B4JRV4FB.cjs} +26 -26
- package/dist/{chunk-2JCSORCJ.cjs.map → chunk-B4JRV4FB.cjs.map} +1 -1
- package/dist/{chunk-KA4WXCN3.js → chunk-BGYWTU2E.js} +4 -4
- package/dist/{chunk-XGOX5UQ2.js → chunk-DM3JIOFA.js} +4 -4
- package/dist/{chunk-CQXHHVMR.js → chunk-EQKTBIKH.js} +2 -2
- package/dist/{chunk-ZFZAHLI4.cjs → chunk-EYQESL6X.cjs} +7 -7
- package/dist/{chunk-ZFZAHLI4.cjs.map → chunk-EYQESL6X.cjs.map} +1 -1
- package/dist/{chunk-M6ODI2F5.js → chunk-FS4FVNOU.js} +2 -2
- package/dist/{chunk-3JQUNKWY.cjs → chunk-HIODHJCJ.cjs} +15 -15
- package/dist/{chunk-3JQUNKWY.cjs.map → chunk-HIODHJCJ.cjs.map} +1 -1
- package/dist/{chunk-MPOP47ME.cjs → chunk-HQG5AY64.cjs} +12 -12
- package/dist/{chunk-MPOP47ME.cjs.map → chunk-HQG5AY64.cjs.map} +1 -1
- package/dist/{chunk-Q4YGG3CL.cjs → chunk-KYN2GYUI.cjs} +31 -31
- package/dist/{chunk-Q4YGG3CL.cjs.map → chunk-KYN2GYUI.cjs.map} +1 -1
- package/dist/{chunk-OBKCQ7LA.cjs → chunk-ONXN77KP.cjs} +62 -62
- package/dist/{chunk-OBKCQ7LA.cjs.map → chunk-ONXN77KP.cjs.map} +1 -1
- package/dist/{chunk-44Q3IXZM.js → chunk-SENYQRPF.js} +2 -2
- package/dist/{chunk-TQZLC3BQ.cjs → chunk-SNFSLYVA.cjs} +5 -5
- package/dist/{chunk-TQZLC3BQ.cjs.map → chunk-SNFSLYVA.cjs.map} +1 -1
- package/dist/{chunk-JSFHTIKA.js → chunk-UCQWQ7LM.js} +2 -2
- package/dist/{chunk-IDWKP5H5.js → chunk-VCRUAKOJ.js} +245 -521
- package/dist/chunk-VCRUAKOJ.js.map +1 -0
- package/dist/{chunk-GNB5ERZP.cjs → chunk-VOPTCR5I.cjs} +735 -1011
- package/dist/chunk-VOPTCR5I.cjs.map +1 -0
- package/dist/{chunk-MIEODAAV.cjs → chunk-WIKFWION.cjs} +9 -9
- package/dist/{chunk-MIEODAAV.cjs.map → chunk-WIKFWION.cjs.map} +1 -1
- package/dist/{chunk-7MKU2EB4.cjs → chunk-YKPQINSZ.cjs} +26 -26
- package/dist/{chunk-7MKU2EB4.cjs.map → chunk-YKPQINSZ.cjs.map} +1 -1
- package/dist/{chunk-EHTE3CTT.cjs → chunk-ZVFDJ35S.cjs} +37 -37
- package/dist/{chunk-EHTE3CTT.cjs.map → chunk-ZVFDJ35S.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -4
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +1 -3
- package/dist/components/features/video-bites-strip.d.ts +4 -43
- package/dist/components/features/video-bites-strip.d.ts.map +1 -1
- package/dist/components/features/video.d.ts +0 -6
- package/dist/components/features/video.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +120 -122
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +9 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -3
- package/dist/types/case-study.d.ts +1 -1
- package/dist/types/case-study.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/features/video-bites-strip.tsx +72 -317
- package/src/components/features/video.tsx +37 -167
- package/src/components/user-display.tsx +2 -2
- package/src/types/case-study.ts +1 -1
- package/dist/chunk-GNB5ERZP.cjs.map +0 -1
- package/dist/chunk-IDWKP5H5.js.map +0 -1
- /package/dist/{chunk-LFLFQ422.js.map → chunk-23BJ64AY.js.map} +0 -0
- /package/dist/{chunk-WIMXB5EU.js.map → chunk-35C3PUUN.js.map} +0 -0
- /package/dist/{chunk-4OLIDOLO.js.map → chunk-7CEJO3FE.js.map} +0 -0
- /package/dist/{chunk-NULFIYK2.js.map → chunk-7UQ74ZJN.js.map} +0 -0
- /package/dist/{chunk-BJPQJNSC.js.map → chunk-ATKRYY4U.js.map} +0 -0
- /package/dist/{chunk-KA4WXCN3.js.map → chunk-BGYWTU2E.js.map} +0 -0
- /package/dist/{chunk-XGOX5UQ2.js.map → chunk-DM3JIOFA.js.map} +0 -0
- /package/dist/{chunk-CQXHHVMR.js.map → chunk-EQKTBIKH.js.map} +0 -0
- /package/dist/{chunk-M6ODI2F5.js.map → chunk-FS4FVNOU.js.map} +0 -0
- /package/dist/{chunk-44Q3IXZM.js.map → chunk-SENYQRPF.js.map} +0 -0
- /package/dist/{chunk-JSFHTIKA.js.map → chunk-UCQWQ7LM.js.map} +0 -0
|
@@ -139,7 +139,6 @@ import {
|
|
|
139
139
|
UserPlusIcon,
|
|
140
140
|
UserSearchIcon,
|
|
141
141
|
VideoRecorderIcon,
|
|
142
|
-
VolumeXmarkIcon,
|
|
143
142
|
WindowsLogoGreyIcon,
|
|
144
143
|
WrenchIcon,
|
|
145
144
|
XmarkAltIcon,
|
|
@@ -9397,7 +9396,7 @@ var TabsContent = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
9397
9396
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
9398
9397
|
|
|
9399
9398
|
// src/components/features/video.tsx
|
|
9400
|
-
import {
|
|
9399
|
+
import { useEffect as useEffect16, useMemo as useMemo12, useRef as useRef14, useState as useState21 } from "react";
|
|
9401
9400
|
import MuxPlayer from "@mux/mux-player-react";
|
|
9402
9401
|
|
|
9403
9402
|
// src/utils/fetch-priority.ts
|
|
@@ -9431,28 +9430,6 @@ if (typeof window !== "undefined" && typeof console !== "undefined") {
|
|
|
9431
9430
|
};
|
|
9432
9431
|
}
|
|
9433
9432
|
}
|
|
9434
|
-
var userHasInteracted = false;
|
|
9435
|
-
var activationWaiters = /* @__PURE__ */ new Set();
|
|
9436
|
-
if (typeof window !== "undefined") {
|
|
9437
|
-
const w = window;
|
|
9438
|
-
if (!w.__VIDEO_ACTIVATION_TRACKED__) {
|
|
9439
|
-
w.__VIDEO_ACTIVATION_TRACKED__ = true;
|
|
9440
|
-
const markActivated = () => {
|
|
9441
|
-
userHasInteracted = true;
|
|
9442
|
-
activationWaiters.forEach((fn) => {
|
|
9443
|
-
try {
|
|
9444
|
-
fn();
|
|
9445
|
-
} catch {
|
|
9446
|
-
}
|
|
9447
|
-
});
|
|
9448
|
-
activationWaiters.clear();
|
|
9449
|
-
window.removeEventListener("pointerdown", markActivated, true);
|
|
9450
|
-
window.removeEventListener("keydown", markActivated, true);
|
|
9451
|
-
};
|
|
9452
|
-
window.addEventListener("pointerdown", markActivated, true);
|
|
9453
|
-
window.addEventListener("keydown", markActivated, true);
|
|
9454
|
-
}
|
|
9455
|
-
}
|
|
9456
9433
|
var YT_HOSTS = /* @__PURE__ */ new Set([
|
|
9457
9434
|
"youtube.com",
|
|
9458
9435
|
"www.youtube.com",
|
|
@@ -9514,7 +9491,6 @@ function Video2(props) {
|
|
|
9514
9491
|
loop: "loop" in props ? props.loop : void 0,
|
|
9515
9492
|
chromeless: "chromeless" in props ? props.chromeless : void 0,
|
|
9516
9493
|
playOnHover: "playOnHover" in props ? props.playOnHover : void 0,
|
|
9517
|
-
playWhenHovered: "playWhenHovered" in props ? props.playWhenHovered : void 0,
|
|
9518
9494
|
centerControlsOnly: "centerControlsOnly" in props ? props.centerControlsOnly : void 0,
|
|
9519
9495
|
className: props.className
|
|
9520
9496
|
}
|
|
@@ -9550,99 +9526,45 @@ function FilePlayer({
|
|
|
9550
9526
|
loop,
|
|
9551
9527
|
chromeless,
|
|
9552
9528
|
playOnHover,
|
|
9553
|
-
playWhenHovered,
|
|
9554
9529
|
centerControlsOnly,
|
|
9555
9530
|
className
|
|
9556
9531
|
}) {
|
|
9557
9532
|
const [isPlaying, setIsPlaying] = useState21(false);
|
|
9558
|
-
const [hoverMutedFallback, setHoverMutedFallback] = useState21(false);
|
|
9559
9533
|
const hoverPlayerRef = useRef14(null);
|
|
9560
9534
|
const hoverActiveRef = useRef14(false);
|
|
9561
9535
|
const hoverGenerationRef = useRef14(0);
|
|
9562
|
-
const
|
|
9563
|
-
const clearActivationWaiter = useCallback13(() => {
|
|
9564
|
-
if (activationWaiterRef.current) {
|
|
9565
|
-
activationWaiters.delete(activationWaiterRef.current);
|
|
9566
|
-
activationWaiterRef.current = null;
|
|
9567
|
-
}
|
|
9568
|
-
}, []);
|
|
9569
|
-
useEffect16(() => clearActivationWaiter, [clearActivationWaiter]);
|
|
9570
|
-
const startHoverPlayback = useCallback13(() => {
|
|
9536
|
+
const handleHoverEnter = playOnHover ? () => {
|
|
9571
9537
|
hoverActiveRef.current = true;
|
|
9572
9538
|
const generation = ++hoverGenerationRef.current;
|
|
9573
9539
|
const el = hoverPlayerRef.current;
|
|
9574
9540
|
if (!el) return;
|
|
9575
9541
|
try {
|
|
9576
9542
|
el.volume = 0.5;
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9543
|
+
el.muted = false;
|
|
9544
|
+
const attempt = el.play?.();
|
|
9545
|
+
if (attempt && typeof attempt.catch === "function") {
|
|
9546
|
+
attempt.catch((err) => {
|
|
9580
9547
|
const name = err?.name;
|
|
9581
9548
|
if (name === "NotAllowedError" && hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
9582
9549
|
try {
|
|
9583
9550
|
el.muted = true;
|
|
9584
9551
|
el.play?.()?.catch?.(() => {
|
|
9585
9552
|
});
|
|
9586
|
-
setHoverMutedFallback(true);
|
|
9587
9553
|
} catch {
|
|
9588
9554
|
}
|
|
9589
9555
|
}
|
|
9590
9556
|
});
|
|
9591
|
-
} else {
|
|
9592
|
-
el.muted = true;
|
|
9593
|
-
el.play?.()?.catch?.(() => {
|
|
9594
|
-
});
|
|
9595
|
-
setHoverMutedFallback(true);
|
|
9596
|
-
clearActivationWaiter();
|
|
9597
|
-
const waiter = () => {
|
|
9598
|
-
activationWaiterRef.current = null;
|
|
9599
|
-
if (hoverActiveRef.current && generation === hoverGenerationRef.current) {
|
|
9600
|
-
try {
|
|
9601
|
-
el.muted = false;
|
|
9602
|
-
el.volume = 0.5;
|
|
9603
|
-
} catch {
|
|
9604
|
-
}
|
|
9605
|
-
setHoverMutedFallback(false);
|
|
9606
|
-
}
|
|
9607
|
-
};
|
|
9608
|
-
activationWaiterRef.current = waiter;
|
|
9609
|
-
activationWaiters.add(waiter);
|
|
9610
9557
|
}
|
|
9611
9558
|
} catch {
|
|
9612
9559
|
}
|
|
9613
|
-
}
|
|
9614
|
-
const
|
|
9560
|
+
} : void 0;
|
|
9561
|
+
const handleHoverLeave = playOnHover ? () => {
|
|
9615
9562
|
hoverActiveRef.current = false;
|
|
9616
|
-
setHoverMutedFallback(false);
|
|
9617
|
-
clearActivationWaiter();
|
|
9618
9563
|
try {
|
|
9619
9564
|
hoverPlayerRef.current?.pause?.();
|
|
9620
9565
|
} catch {
|
|
9621
9566
|
}
|
|
9622
|
-
}
|
|
9623
|
-
const unmuteNow = useCallback13((e) => {
|
|
9624
|
-
e.stopPropagation();
|
|
9625
|
-
e.preventDefault();
|
|
9626
|
-
const el = hoverPlayerRef.current;
|
|
9627
|
-
try {
|
|
9628
|
-
if (el) {
|
|
9629
|
-
el.muted = false;
|
|
9630
|
-
el.volume = 0.5;
|
|
9631
|
-
el.play?.()?.catch?.(() => {
|
|
9632
|
-
});
|
|
9633
|
-
}
|
|
9634
|
-
} catch {
|
|
9635
|
-
}
|
|
9636
|
-
setHoverMutedFallback(false);
|
|
9637
|
-
}, []);
|
|
9638
|
-
const hoverControlled = typeof playWhenHovered === "boolean";
|
|
9639
|
-
useEffect16(() => {
|
|
9640
|
-
if (!hoverControlled) return;
|
|
9641
|
-
if (playWhenHovered) startHoverPlayback();
|
|
9642
|
-
else stopHoverPlayback();
|
|
9643
|
-
}, [hoverControlled, playWhenHovered, startHoverPlayback, stopHoverPlayback]);
|
|
9644
|
-
const handleHoverEnter = playOnHover && !hoverControlled ? startHoverPlayback : void 0;
|
|
9645
|
-
const handleHoverLeave = playOnHover && !hoverControlled ? stopHoverPlayback : void 0;
|
|
9567
|
+
} : void 0;
|
|
9646
9568
|
if (process.env.NODE_ENV !== "production" && srtContent && !captionsUrl) {
|
|
9647
9569
|
console.warn(
|
|
9648
9570
|
"[Video] srtContent supplied without captionsUrl \u2014 captions will not render. Pass captionsUrl (the VTT URL) instead; raw SRT text overlays are no longer supported."
|
|
@@ -9688,37 +9610,17 @@ function FilePlayer({
|
|
|
9688
9610
|
) : null
|
|
9689
9611
|
}
|
|
9690
9612
|
);
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
{
|
|
9694
|
-
type: "button",
|
|
9695
|
-
"aria-label": "Unmute",
|
|
9696
|
-
title: "Unmute",
|
|
9697
|
-
onClick: unmuteNow,
|
|
9698
|
-
className: "absolute inset-0 z-10 m-auto flex h-14 w-14 items-center justify-center text-ods-text-primary transition-opacity hover:opacity-75",
|
|
9699
|
-
children: /* @__PURE__ */ jsx67(VolumeXmarkIcon, { size: 56 })
|
|
9700
|
-
}
|
|
9701
|
-
) : null;
|
|
9702
|
-
if (playOnHover && !hoverControlled) {
|
|
9703
|
-
return /* @__PURE__ */ jsxs52(
|
|
9613
|
+
if (playOnHover) {
|
|
9614
|
+
return /* @__PURE__ */ jsx67(
|
|
9704
9615
|
"div",
|
|
9705
9616
|
{
|
|
9706
|
-
className: "
|
|
9617
|
+
className: "w-full h-full",
|
|
9707
9618
|
onPointerEnter: handleHoverEnter,
|
|
9708
9619
|
onPointerLeave: handleHoverLeave,
|
|
9709
|
-
children:
|
|
9710
|
-
player,
|
|
9711
|
-
unmuteBadge
|
|
9712
|
-
]
|
|
9620
|
+
children: player
|
|
9713
9621
|
}
|
|
9714
9622
|
);
|
|
9715
9623
|
}
|
|
9716
|
-
if (hoverControlled) {
|
|
9717
|
-
return /* @__PURE__ */ jsxs52("div", { className: "relative w-full h-full", children: [
|
|
9718
|
-
player,
|
|
9719
|
-
unmuteBadge
|
|
9720
|
-
] });
|
|
9721
|
-
}
|
|
9722
9624
|
return player;
|
|
9723
9625
|
}
|
|
9724
9626
|
function YouTubeFacade({
|
|
@@ -9858,7 +9760,7 @@ function YouTubeFacadeInner({
|
|
|
9858
9760
|
|
|
9859
9761
|
// src/components/features/video-bites-strip.tsx
|
|
9860
9762
|
init_cn();
|
|
9861
|
-
import { useCallback as
|
|
9763
|
+
import { useCallback as useCallback13, useEffect as useEffect18, useMemo as useMemo13, useRef as useRef15, useState as useState22 } from "react";
|
|
9862
9764
|
|
|
9863
9765
|
// src/components/features/use-video-warmup.ts
|
|
9864
9766
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -10059,11 +9961,11 @@ function UserDisplay({ name, avatarUrl, subtitle, size: size2 = 32, shape = "squ
|
|
|
10059
9961
|
/* @__PURE__ */ jsxs54("div", { className: "min-w-0 flex-1", children: [
|
|
10060
9962
|
/* @__PURE__ */ jsx70("p", { className: cn(
|
|
10061
9963
|
"font-['DM_Sans'] text-ods-text-primary truncate",
|
|
10062
|
-
compact ? "text-
|
|
9964
|
+
compact ? "text-sm leading-5 font-medium" : "text-lg leading-[22px]"
|
|
10063
9965
|
), children: name }),
|
|
10064
9966
|
subtitle && /* @__PURE__ */ jsx70("span", { className: cn(
|
|
10065
9967
|
"font-['DM_Sans'] text-ods-text-secondary truncate block",
|
|
10066
|
-
compact ? "text-
|
|
9968
|
+
compact ? "text-sm leading-5 font-medium" : "text-md leading-[16px]"
|
|
10067
9969
|
), children: subtitle })
|
|
10068
9970
|
] })
|
|
10069
9971
|
] });
|
|
@@ -10104,7 +10006,7 @@ function VideoBitesStrip({
|
|
|
10104
10006
|
href,
|
|
10105
10007
|
headerSlot,
|
|
10106
10008
|
autoScroll = true,
|
|
10107
|
-
autoScrollSpeed =
|
|
10009
|
+
autoScrollSpeed = 28,
|
|
10108
10010
|
pauseOnHover = true,
|
|
10109
10011
|
cardHeightDesktop = 416,
|
|
10110
10012
|
cardHeightMobile = 300,
|
|
@@ -10139,7 +10041,7 @@ function VideoBitesStrip({
|
|
|
10139
10041
|
const [overflows, setOverflows] = useState22(false);
|
|
10140
10042
|
const singleCopyWidthRef = useRef15(0);
|
|
10141
10043
|
const marqueeActive = autoScroll && !reducedMotion && overflows && items.length > 0;
|
|
10142
|
-
const measure =
|
|
10044
|
+
const measure = useCallback13(() => {
|
|
10143
10045
|
const scroller = scrollerRef.current;
|
|
10144
10046
|
const track = trackRef.current;
|
|
10145
10047
|
if (!scroller || !track) return;
|
|
@@ -10158,6 +10060,7 @@ function VideoBitesStrip({
|
|
|
10158
10060
|
ro.observe(track);
|
|
10159
10061
|
return () => ro.disconnect();
|
|
10160
10062
|
}, [measure, items.length, marqueeActive, isMobile]);
|
|
10063
|
+
const hoveredRef = useRef15(false);
|
|
10161
10064
|
const nearViewportRef = useRef15(true);
|
|
10162
10065
|
const chevronSuppressUntilRef = useRef15(0);
|
|
10163
10066
|
const userScrollSuppressUntilRef = useRef15(0);
|
|
@@ -10173,44 +10076,22 @@ function VideoBitesStrip({
|
|
|
10173
10076
|
io.observe(el);
|
|
10174
10077
|
return () => io.disconnect();
|
|
10175
10078
|
}, []);
|
|
10176
|
-
const marqueePosRef = useRef15(0);
|
|
10177
|
-
const glideRemainingRef = useRef15(0);
|
|
10178
10079
|
useEffect18(() => {
|
|
10179
10080
|
if (!marqueeActive) return;
|
|
10180
10081
|
const scroller = scrollerRef.current;
|
|
10181
10082
|
if (!scroller) return;
|
|
10182
10083
|
let raf = 0;
|
|
10183
10084
|
let last = performance.now();
|
|
10184
|
-
marqueePosRef.current = scroller.scrollLeft;
|
|
10185
|
-
const wrap = (pos) => {
|
|
10186
|
-
const half = singleCopyWidthRef.current;
|
|
10187
|
-
if (half <= 0) return pos;
|
|
10188
|
-
while (pos >= half) pos -= half;
|
|
10189
|
-
while (pos < 0) pos += half;
|
|
10190
|
-
return pos;
|
|
10191
|
-
};
|
|
10192
10085
|
const tick = (now) => {
|
|
10193
10086
|
const dt = Math.min(now - last, 100) / 1e3;
|
|
10194
10087
|
last = now;
|
|
10195
|
-
const paused = pauseOnHover &&
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
const step = Math.sign(glide) * Math.min(Math.abs(glide), speed * dt);
|
|
10203
|
-
glideRemainingRef.current = Math.abs(glide - step) < 0.5 ? 0 : glide - step;
|
|
10204
|
-
marqueePosRef.current = wrap(marqueePosRef.current + step);
|
|
10205
|
-
scroller.scrollLeft = marqueePosRef.current;
|
|
10206
|
-
} else if (!paused) {
|
|
10207
|
-
if (Math.abs(scroller.scrollLeft - marqueePosRef.current) > 1.5) {
|
|
10208
|
-
marqueePosRef.current = scroller.scrollLeft;
|
|
10209
|
-
}
|
|
10210
|
-
marqueePosRef.current = wrap(marqueePosRef.current + autoScrollSpeed * dt);
|
|
10211
|
-
scroller.scrollLeft = marqueePosRef.current;
|
|
10212
|
-
} else {
|
|
10213
|
-
marqueePosRef.current = scroller.scrollLeft;
|
|
10088
|
+
const paused = pauseOnHover && hoveredRef.current || !nearViewportRef.current || document.visibilityState === "hidden" || now < Math.max(chevronSuppressUntilRef.current, userScrollSuppressUntilRef.current);
|
|
10089
|
+
if (!paused) {
|
|
10090
|
+
scroller.scrollLeft += autoScrollSpeed * dt;
|
|
10091
|
+
const half = singleCopyWidthRef.current;
|
|
10092
|
+
if (half > 0 && scroller.scrollLeft >= half) {
|
|
10093
|
+
scroller.scrollLeft -= half;
|
|
10094
|
+
}
|
|
10214
10095
|
}
|
|
10215
10096
|
raf = requestAnimationFrame(tick);
|
|
10216
10097
|
};
|
|
@@ -10218,105 +10099,23 @@ function VideoBitesStrip({
|
|
|
10218
10099
|
return () => cancelAnimationFrame(raf);
|
|
10219
10100
|
}, [marqueeActive, autoScrollSpeed, pauseOnHover]);
|
|
10220
10101
|
const [activeKey, setActiveKey] = useState22(null);
|
|
10221
|
-
const
|
|
10222
|
-
const
|
|
10223
|
-
|
|
10224
|
-
setActiveKey(key);
|
|
10225
|
-
}, []);
|
|
10226
|
-
const deactivate = useCallback14((key) => {
|
|
10227
|
-
setActiveKey((current) => {
|
|
10228
|
-
const next = current === key ? null : current;
|
|
10229
|
-
activeKeyRef.current = next;
|
|
10230
|
-
return next;
|
|
10231
|
-
});
|
|
10102
|
+
const activate = useCallback13((key) => setActiveKey(key), []);
|
|
10103
|
+
const deactivate = useCallback13((key) => {
|
|
10104
|
+
setActiveKey((current) => current === key ? null : current);
|
|
10232
10105
|
}, []);
|
|
10233
10106
|
const warmup = useVideoWarmup({ videoUrl: items[0]?.url || null });
|
|
10234
|
-
const
|
|
10235
|
-
const cardObserverRef = useRef15(null);
|
|
10236
|
-
const cardElIdxRef = useRef15(/* @__PURE__ */ new Map());
|
|
10237
|
-
const cardElNearRef = useRef15(/* @__PURE__ */ new Map());
|
|
10238
|
-
useEffect18(() => {
|
|
10239
|
-
if (typeof IntersectionObserver === "undefined") return;
|
|
10240
|
-
const io = new IntersectionObserver((entries) => {
|
|
10241
|
-
for (const e of entries) cardElNearRef.current.set(e.target, e.isIntersecting);
|
|
10242
|
-
const next = /* @__PURE__ */ new Set();
|
|
10243
|
-
cardElNearRef.current.forEach((near, el) => {
|
|
10244
|
-
if (!near) return;
|
|
10245
|
-
const idx = cardElIdxRef.current.get(el);
|
|
10246
|
-
if (idx !== void 0) next.add(idx);
|
|
10247
|
-
});
|
|
10248
|
-
setMountedIdx((prev) => {
|
|
10249
|
-
if (prev.size === next.size) {
|
|
10250
|
-
let same = true;
|
|
10251
|
-
next.forEach((i) => {
|
|
10252
|
-
if (!prev.has(i)) same = false;
|
|
10253
|
-
});
|
|
10254
|
-
if (same) return prev;
|
|
10255
|
-
}
|
|
10256
|
-
return next;
|
|
10257
|
-
});
|
|
10258
|
-
}, { rootMargin: "500px" });
|
|
10259
|
-
cardObserverRef.current = io;
|
|
10260
|
-
cardElIdxRef.current.forEach((_idx, el) => io.observe(el));
|
|
10261
|
-
return () => {
|
|
10262
|
-
io.disconnect();
|
|
10263
|
-
cardObserverRef.current = null;
|
|
10264
|
-
};
|
|
10265
|
-
}, []);
|
|
10266
|
-
const cardRefFnsRef = useRef15(/* @__PURE__ */ new Map());
|
|
10267
|
-
const getCardRef = useCallback14((idx) => {
|
|
10268
|
-
let fn = cardRefFnsRef.current.get(idx);
|
|
10269
|
-
if (!fn) {
|
|
10270
|
-
fn = (el) => {
|
|
10271
|
-
if (!el) return void 0;
|
|
10272
|
-
cardElIdxRef.current.set(el, idx);
|
|
10273
|
-
cardObserverRef.current?.observe(el);
|
|
10274
|
-
return () => {
|
|
10275
|
-
cardElIdxRef.current.delete(el);
|
|
10276
|
-
cardElNearRef.current.delete(el);
|
|
10277
|
-
cardObserverRef.current?.unobserve(el);
|
|
10278
|
-
};
|
|
10279
|
-
};
|
|
10280
|
-
cardRefFnsRef.current.set(idx, fn);
|
|
10281
|
-
}
|
|
10282
|
-
return fn;
|
|
10283
|
-
}, []);
|
|
10284
|
-
const scrollByCard = useCallback14((dir) => {
|
|
10107
|
+
const scrollByCard = useCallback13((dir) => {
|
|
10285
10108
|
const scroller = scrollerRef.current;
|
|
10286
10109
|
const track = trackRef.current;
|
|
10287
10110
|
if (!scroller || !track) return;
|
|
10288
10111
|
const firstCard = track.firstElementChild;
|
|
10289
10112
|
const step = (firstCard?.offsetWidth ?? 320) + TRACK_GAP_PX;
|
|
10290
10113
|
chevronSuppressUntilRef.current = performance.now() + CHEVRON_SUPPRESS_MS;
|
|
10291
|
-
|
|
10292
|
-
glideRemainingRef.current += dir * step;
|
|
10293
|
-
} else {
|
|
10294
|
-
scroller.scrollBy({ left: dir * step, behavior: "smooth" });
|
|
10295
|
-
}
|
|
10114
|
+
scroller.scrollBy({ left: dir * step, behavior: "smooth" });
|
|
10296
10115
|
}, []);
|
|
10297
|
-
const onUserScrollIntent =
|
|
10116
|
+
const onUserScrollIntent = useCallback13(() => {
|
|
10298
10117
|
userScrollSuppressUntilRef.current = performance.now() + USER_SCROLL_SUPPRESS_MS;
|
|
10299
10118
|
}, []);
|
|
10300
|
-
const lastScrollLeftRef = useRef15(0);
|
|
10301
|
-
const marqueeActiveRef = useRef15(false);
|
|
10302
|
-
marqueeActiveRef.current = marqueeActive;
|
|
10303
|
-
const onSeamWarp = useCallback14(() => {
|
|
10304
|
-
const scroller = scrollerRef.current;
|
|
10305
|
-
if (!scroller || !marqueeActiveRef.current) return;
|
|
10306
|
-
const half = singleCopyWidthRef.current;
|
|
10307
|
-
if (half <= 0) return;
|
|
10308
|
-
let sl = scroller.scrollLeft;
|
|
10309
|
-
if (sl >= half) {
|
|
10310
|
-
sl -= half;
|
|
10311
|
-
scroller.scrollLeft = sl;
|
|
10312
|
-
marqueePosRef.current = sl;
|
|
10313
|
-
} else if (sl <= 0 && lastScrollLeftRef.current > 0.5) {
|
|
10314
|
-
sl += half;
|
|
10315
|
-
scroller.scrollLeft = sl;
|
|
10316
|
-
marqueePosRef.current = sl;
|
|
10317
|
-
}
|
|
10318
|
-
lastScrollLeftRef.current = sl;
|
|
10319
|
-
}, []);
|
|
10320
10119
|
if (items.length === 0) return null;
|
|
10321
10120
|
const cardHeight = isMobile ? cardHeightMobile : cardHeightDesktop;
|
|
10322
10121
|
const copies = marqueeActive ? 2 : 1;
|
|
@@ -10328,6 +10127,12 @@ function VideoBitesStrip({
|
|
|
10328
10127
|
warmup.ref(node);
|
|
10329
10128
|
},
|
|
10330
10129
|
className: cn("flex flex-col gap-6 w-full min-w-0", className),
|
|
10130
|
+
onPointerEnter: () => {
|
|
10131
|
+
hoveredRef.current = true;
|
|
10132
|
+
},
|
|
10133
|
+
onPointerLeave: () => {
|
|
10134
|
+
hoveredRef.current = false;
|
|
10135
|
+
},
|
|
10331
10136
|
children: [
|
|
10332
10137
|
showTitle && /* @__PURE__ */ jsx72("h2", { className: `${SECTION_HEADING_CLASS} break-words`, children: title }),
|
|
10333
10138
|
headerSlot,
|
|
@@ -10340,7 +10145,6 @@ function VideoBitesStrip({
|
|
|
10340
10145
|
onWheel: onUserScrollIntent,
|
|
10341
10146
|
onTouchStart: onUserScrollIntent,
|
|
10342
10147
|
onPointerDown: onUserScrollIntent,
|
|
10343
|
-
onScroll: onSeamWarp,
|
|
10344
10148
|
children: /* @__PURE__ */ jsx72("div", { ref: trackRef, "data-copies": copies, className: "flex w-max items-stretch gap-4", children: Array.from(
|
|
10345
10149
|
{ length: copies },
|
|
10346
10150
|
(_, copyIndex) => items.map((bite, i) => {
|
|
@@ -10351,7 +10155,7 @@ function VideoBitesStrip({
|
|
|
10351
10155
|
// same rule as quick-action-marquee). Clones stay pointer-
|
|
10352
10156
|
// interactive (briefly visible near the wrap seam).
|
|
10353
10157
|
/* @__PURE__ */ jsx72(
|
|
10354
|
-
|
|
10158
|
+
BiteStripCard,
|
|
10355
10159
|
{
|
|
10356
10160
|
bite,
|
|
10357
10161
|
index: i,
|
|
@@ -10362,8 +10166,6 @@ function VideoBitesStrip({
|
|
|
10362
10166
|
active: activeKey === key,
|
|
10363
10167
|
onActivate: activate,
|
|
10364
10168
|
onDeactivate: deactivate,
|
|
10365
|
-
playerMounted: mountedIdx.has(i),
|
|
10366
|
-
rootRef: getCardRef(i),
|
|
10367
10169
|
profile: bite.profile ?? profile ?? null,
|
|
10368
10170
|
sectionHref: href,
|
|
10369
10171
|
onBiteNavigate
|
|
@@ -10402,42 +10204,27 @@ function VideoBitesStrip({
|
|
|
10402
10204
|
}
|
|
10403
10205
|
);
|
|
10404
10206
|
}
|
|
10405
|
-
function
|
|
10207
|
+
function BiteStripCard({
|
|
10406
10208
|
bite,
|
|
10407
10209
|
index,
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10210
|
+
cardKey,
|
|
10211
|
+
isClone,
|
|
10212
|
+
isTouch,
|
|
10411
10213
|
height,
|
|
10412
10214
|
active,
|
|
10413
10215
|
onActivate,
|
|
10414
10216
|
onDeactivate,
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
playerMounted,
|
|
10419
|
-
rootRef,
|
|
10420
|
-
toolbar,
|
|
10421
|
-
titleEditable = false,
|
|
10422
|
-
onTitleChange,
|
|
10423
|
-
onTitleCommit,
|
|
10424
|
-
className
|
|
10217
|
+
profile,
|
|
10218
|
+
sectionHref,
|
|
10219
|
+
onBiteNavigate
|
|
10425
10220
|
}) {
|
|
10426
10221
|
const cssAspect = RATIO_TO_CSS_ASPECT[ratioToCategory(detectAspectRatio(bite.aspect_ratio))];
|
|
10427
10222
|
const targetHref = bite.href ?? sectionHref;
|
|
10428
10223
|
const hasTarget = !!(targetHref || bite.onNavigate || onBiteNavigate);
|
|
10429
|
-
const
|
|
10430
|
-
const controlled = active !== void 0;
|
|
10431
|
-
const [selfActive, setSelfActive] = useState22(false);
|
|
10432
|
-
const isActive = controlled ? !!active : selfActive;
|
|
10433
|
-
const activate = () => controlled ? onActivate?.(key) : setSelfActive(true);
|
|
10434
|
-
const deactivate = () => controlled ? onDeactivate?.(key) : setSelfActive(false);
|
|
10435
|
-
const gateControlled = playerMounted !== void 0;
|
|
10436
|
-
const rootElRef = useRef15(null);
|
|
10224
|
+
const nearRef = useRef15(null);
|
|
10437
10225
|
const [isNear, setIsNear] = useState22(false);
|
|
10438
10226
|
useEffect18(() => {
|
|
10439
|
-
|
|
10440
|
-
const el = rootElRef.current;
|
|
10227
|
+
const el = nearRef.current;
|
|
10441
10228
|
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
10442
10229
|
const io = new IntersectionObserver(
|
|
10443
10230
|
(entries) => setIsNear(entries[0]?.isIntersecting ?? false),
|
|
@@ -10445,56 +10232,22 @@ function VideoBiteCard({
|
|
|
10445
10232
|
);
|
|
10446
10233
|
io.observe(el);
|
|
10447
10234
|
return () => io.disconnect();
|
|
10448
|
-
}, [
|
|
10449
|
-
const showPlayer = gateControlled ? playerMounted : isNear;
|
|
10235
|
+
}, []);
|
|
10450
10236
|
const navigate = () => {
|
|
10451
10237
|
if (bite.onNavigate) bite.onNavigate();
|
|
10452
10238
|
else onBiteNavigate?.(bite, index);
|
|
10453
10239
|
};
|
|
10454
10240
|
const handlePointerEnter = () => {
|
|
10455
|
-
if (!isTouch)
|
|
10241
|
+
if (!isTouch) onActivate(cardKey);
|
|
10456
10242
|
};
|
|
10457
10243
|
const handlePointerLeave = () => {
|
|
10458
|
-
if (!isTouch)
|
|
10244
|
+
if (!isTouch) onDeactivate(cardKey);
|
|
10459
10245
|
};
|
|
10460
10246
|
const handleClick = () => {
|
|
10461
|
-
if (isTouch && !
|
|
10247
|
+
if (isTouch && !active) onActivate(cardKey);
|
|
10462
10248
|
};
|
|
10463
|
-
const titleClass = "font-['DM_Sans'] text-sm font-medium leading-5 text-ods-text-primary";
|
|
10464
10249
|
const overlayContent = /* @__PURE__ */ jsxs56(Fragment18, { children: [
|
|
10465
|
-
|
|
10466
|
-
// Textarea, not input: the public title wraps to two lines
|
|
10467
|
-
// (line-clamp-2) and the editor must render identically. rows=1 +
|
|
10468
|
-
// auto-grow keeps short titles single-line; max-height caps at the
|
|
10469
|
-
// same two lines the clamp allows.
|
|
10470
|
-
/* @__PURE__ */ jsx72(
|
|
10471
|
-
"textarea",
|
|
10472
|
-
{
|
|
10473
|
-
value: bite.title || "",
|
|
10474
|
-
placeholder: "Title (optional)",
|
|
10475
|
-
"aria-label": "Bite title",
|
|
10476
|
-
rows: 1,
|
|
10477
|
-
onChange: (e) => {
|
|
10478
|
-
e.target.style.height = "auto";
|
|
10479
|
-
e.target.style.height = `${Math.min(e.target.scrollHeight, 40)}px`;
|
|
10480
|
-
onTitleChange?.(e.target.value);
|
|
10481
|
-
},
|
|
10482
|
-
ref: (el) => {
|
|
10483
|
-
if (el) {
|
|
10484
|
-
el.style.height = "auto";
|
|
10485
|
-
el.style.height = `${Math.min(el.scrollHeight, 40)}px`;
|
|
10486
|
-
}
|
|
10487
|
-
},
|
|
10488
|
-
onBlur: (e) => onTitleCommit?.(e.target.value),
|
|
10489
|
-
onClick: (e) => e.stopPropagation(),
|
|
10490
|
-
className: cn(
|
|
10491
|
-
titleClass,
|
|
10492
|
-
"w-full max-h-10 resize-none overflow-hidden bg-transparent outline-none",
|
|
10493
|
-
"placeholder:text-ods-text-secondary border-b border-transparent focus:border-ods-border"
|
|
10494
|
-
)
|
|
10495
|
-
}
|
|
10496
|
-
)
|
|
10497
|
-
) : bite.title && /* @__PURE__ */ jsx72("p", { className: cn(titleClass, "line-clamp-2"), children: bite.title }),
|
|
10250
|
+
bite.title && /* @__PURE__ */ jsx72("p", { className: "font-['DM_Sans'] text-sm font-medium leading-5 text-ods-text-primary line-clamp-1", children: bite.title }),
|
|
10498
10251
|
(profile || hasTarget) && /* @__PURE__ */ jsxs56("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
10499
10252
|
profile && /* @__PURE__ */ jsx72(
|
|
10500
10253
|
UserDisplay,
|
|
@@ -10502,7 +10255,7 @@ function VideoBiteCard({
|
|
|
10502
10255
|
name: profile.name,
|
|
10503
10256
|
avatarUrl: profile.avatarUrl,
|
|
10504
10257
|
subtitle: profile.subtitle,
|
|
10505
|
-
size:
|
|
10258
|
+
size: 28,
|
|
10506
10259
|
shape: "round",
|
|
10507
10260
|
compact: true,
|
|
10508
10261
|
className: "flex-1"
|
|
@@ -10514,67 +10267,39 @@ function VideoBiteCard({
|
|
|
10514
10267
|
const overlayClass = cn(
|
|
10515
10268
|
"absolute inset-x-0 bottom-0 p-3 gap-2 bg-black/75 border border-ods-border shadow-2xl",
|
|
10516
10269
|
"flex flex-col transition-opacity duration-200",
|
|
10517
|
-
|
|
10270
|
+
active ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100",
|
|
10518
10271
|
// Non-interactive while invisible so it never swallows clicks on the
|
|
10519
10272
|
// resting card / player controls.
|
|
10520
|
-
|
|
10521
|
-
);
|
|
10522
|
-
const media = /* @__PURE__ */ jsxs56(
|
|
10523
|
-
"div",
|
|
10524
|
-
{
|
|
10525
|
-
className: "relative w-full",
|
|
10526
|
-
style: { aspectRatio: cssAspect, ...height !== void 0 ? { height, maxWidth: "90vw" } : {} },
|
|
10527
|
-
children: [
|
|
10528
|
-
showPlayer ? (
|
|
10529
|
-
// Clones: `inert` (not just the wrapper's aria-hidden) — the player's
|
|
10530
|
-
// shadow-DOM center control is otherwise still tab-reachable inside a
|
|
10531
|
-
// hidden subtree (axe aria-hidden-focus). Hover preview on clones
|
|
10532
|
-
// keeps working: playback is driven imperatively from the CARD's own
|
|
10533
|
-
// pointer handlers, never from focus/clicks on the player chrome.
|
|
10534
|
-
/* @__PURE__ */ jsx72("div", { className: "absolute inset-0", inert: isClone || void 0, children: /* @__PURE__ */ jsx72(
|
|
10535
|
-
Video2,
|
|
10536
|
-
{
|
|
10537
|
-
kind: "file",
|
|
10538
|
-
url: bite.url,
|
|
10539
|
-
poster: bite.thumbnail_url,
|
|
10540
|
-
playWhenHovered: isActive,
|
|
10541
|
-
centerControlsOnly: true,
|
|
10542
|
-
layout: "fill"
|
|
10543
|
-
}
|
|
10544
|
-
) })
|
|
10545
|
-
) : (
|
|
10546
|
-
// Aspect-matched placeholder until the card nears the viewport (CLS-free).
|
|
10547
|
-
/* @__PURE__ */ jsx72("div", { className: "absolute inset-0 bg-ods-card" })
|
|
10548
|
-
),
|
|
10549
|
-
hasTarget && !isClone && !titleEditable ? targetHref ? /* @__PURE__ */ jsx72("a", { href: targetHref, "aria-label": `Open ${bite.title || "source content"}`, className: overlayClass, children: overlayContent }) : /* @__PURE__ */ jsx72("button", { type: "button", onClick: navigate, "aria-label": `Open ${bite.title || "source content"}`, className: cn(overlayClass, "text-left w-full"), children: overlayContent }) : /* @__PURE__ */ jsx72("div", { className: overlayClass, children: overlayContent })
|
|
10550
|
-
]
|
|
10551
|
-
}
|
|
10273
|
+
active ? "pointer-events-auto" : "pointer-events-none group-hover/card:pointer-events-auto"
|
|
10552
10274
|
);
|
|
10553
10275
|
return /* @__PURE__ */ jsxs56(
|
|
10554
10276
|
"div",
|
|
10555
10277
|
{
|
|
10556
|
-
ref:
|
|
10557
|
-
rootElRef.current = node;
|
|
10558
|
-
return rootRef?.(node);
|
|
10559
|
-
},
|
|
10278
|
+
ref: nearRef,
|
|
10560
10279
|
"aria-hidden": isClone || void 0,
|
|
10561
|
-
className:
|
|
10562
|
-
|
|
10563
|
-
height !== void 0 ? "shrink-0" : "w-full",
|
|
10564
|
-
className
|
|
10565
|
-
),
|
|
10566
|
-
style: height !== void 0 ? { maxWidth: "90vw" } : void 0,
|
|
10280
|
+
className: "relative shrink-0 rounded-md border border-ods-border bg-ods-card overflow-hidden group/card",
|
|
10281
|
+
style: { height, aspectRatio: cssAspect, maxWidth: "90vw" },
|
|
10567
10282
|
onPointerEnter: handlePointerEnter,
|
|
10568
10283
|
onPointerLeave: handlePointerLeave,
|
|
10569
10284
|
onClick: handleClick,
|
|
10570
|
-
onFocus:
|
|
10571
|
-
onBlur:
|
|
10285
|
+
onFocus: () => onActivate(cardKey),
|
|
10286
|
+
onBlur: () => onDeactivate(cardKey),
|
|
10572
10287
|
children: [
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10288
|
+
isNear ? /* @__PURE__ */ jsx72("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx72(
|
|
10289
|
+
Video2,
|
|
10290
|
+
{
|
|
10291
|
+
kind: "file",
|
|
10292
|
+
url: bite.url,
|
|
10293
|
+
poster: bite.thumbnail_url,
|
|
10294
|
+
playOnHover: true,
|
|
10295
|
+
centerControlsOnly: true,
|
|
10296
|
+
layout: "fill"
|
|
10297
|
+
}
|
|
10298
|
+
) }) : (
|
|
10299
|
+
// Aspect-matched placeholder until the card nears the viewport (CLS-free).
|
|
10300
|
+
/* @__PURE__ */ jsx72("div", { className: "absolute inset-0 bg-ods-card" })
|
|
10301
|
+
),
|
|
10302
|
+
hasTarget && !isClone ? targetHref ? /* @__PURE__ */ jsx72("a", { href: targetHref, "aria-label": `Open ${bite.title || "source content"}`, className: overlayClass, children: overlayContent }) : /* @__PURE__ */ jsx72("button", { type: "button", onClick: navigate, "aria-label": `Open ${bite.title || "source content"}`, className: cn(overlayClass, "text-left w-full"), children: overlayContent }) : /* @__PURE__ */ jsx72("div", { className: overlayClass, children: overlayContent })
|
|
10578
10303
|
]
|
|
10579
10304
|
}
|
|
10580
10305
|
);
|
|
@@ -17285,7 +17010,7 @@ function TabContent({
|
|
|
17285
17010
|
// src/components/ui/tab-navigation.tsx
|
|
17286
17011
|
init_next_navigation();
|
|
17287
17012
|
init_cn();
|
|
17288
|
-
import { useState as useState36, useEffect as useEffect28, useMemo as useMemo19, useRef as useRef22, useCallback as
|
|
17013
|
+
import { useState as useState36, useEffect as useEffect28, useMemo as useMemo19, useRef as useRef22, useCallback as useCallback18 } from "react";
|
|
17289
17014
|
import { Fragment as Fragment26, jsx as jsx125, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
17290
17015
|
function TabNavigation({
|
|
17291
17016
|
activeTab: controlledActiveTab,
|
|
@@ -17342,7 +17067,7 @@ function TabNavigation({
|
|
|
17342
17067
|
const isFirstActiveScrollRef = useRef22(true);
|
|
17343
17068
|
const [canScrollLeft, setCanScrollLeft] = useState36(false);
|
|
17344
17069
|
const [canScrollRight, setCanScrollRight] = useState36(false);
|
|
17345
|
-
const updateScrollShadows =
|
|
17070
|
+
const updateScrollShadows = useCallback18(() => {
|
|
17346
17071
|
const el = scrollRef.current;
|
|
17347
17072
|
if (!el) return;
|
|
17348
17073
|
setCanScrollLeft(el.scrollLeft > 0);
|
|
@@ -17594,7 +17319,7 @@ import { useState as useState47 } from "react";
|
|
|
17594
17319
|
import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
17595
17320
|
|
|
17596
17321
|
// src/components/ui/rich-markdown-renderer.tsx
|
|
17597
|
-
import { useEffect as useEffect36, useState as useState46, useRef as useRef28, useMemo as useMemo22, useCallback as
|
|
17322
|
+
import { useEffect as useEffect36, useState as useState46, useRef as useRef28, useMemo as useMemo22, useCallback as useCallback21 } from "react";
|
|
17598
17323
|
import ReactMarkdown2 from "react-markdown";
|
|
17599
17324
|
import remarkGfm2 from "remark-gfm";
|
|
17600
17325
|
import remarkBreaks2 from "remark-breaks";
|
|
@@ -17884,7 +17609,7 @@ var socialCache = SocialEmbedCache.getInstance();
|
|
|
17884
17609
|
|
|
17885
17610
|
// src/components/media-carousel.tsx
|
|
17886
17611
|
init_cn();
|
|
17887
|
-
import { useState as useState38, useRef as useRef24, useEffect as useEffect30, memo as memo4, useCallback as
|
|
17612
|
+
import { useState as useState38, useRef as useRef24, useEffect as useEffect30, memo as memo4, useCallback as useCallback19 } from "react";
|
|
17888
17613
|
import { Fragment as Fragment28, jsx as jsx130, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
17889
17614
|
var ChevronLeftIcon = () => /* @__PURE__ */ jsx130("svg", { width: "24", height: "24", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx130("polyline", { points: "15,18 9,12 15,6" }) });
|
|
17890
17615
|
var ChevronRightIcon = () => /* @__PURE__ */ jsx130("svg", { width: "24", height: "24", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx130("polyline", { points: "9,18 15,12 9,6" }) });
|
|
@@ -17913,17 +17638,17 @@ var MediaCarousel = memo4(function MediaCarousel2({
|
|
|
17913
17638
|
if (!currentItem) {
|
|
17914
17639
|
return null;
|
|
17915
17640
|
}
|
|
17916
|
-
const nextSlide =
|
|
17641
|
+
const nextSlide = useCallback19(() => {
|
|
17917
17642
|
setCurrentIndex((prev) => (prev + 1) % media.length);
|
|
17918
17643
|
}, [media.length]);
|
|
17919
|
-
const prevSlide =
|
|
17644
|
+
const prevSlide = useCallback19(() => {
|
|
17920
17645
|
setCurrentIndex((prev) => (prev - 1 + media.length) % media.length);
|
|
17921
17646
|
}, [media.length]);
|
|
17922
|
-
const selectSlide =
|
|
17647
|
+
const selectSlide = useCallback19((index) => {
|
|
17923
17648
|
if (index === currentIndex) return;
|
|
17924
17649
|
setCurrentIndex(index);
|
|
17925
17650
|
}, [currentIndex]);
|
|
17926
|
-
const handleKeyDown =
|
|
17651
|
+
const handleKeyDown = useCallback19((e) => {
|
|
17927
17652
|
if (media.length <= 1) return;
|
|
17928
17653
|
if (e.key === "ArrowLeft") {
|
|
17929
17654
|
e.preventDefault();
|
|
@@ -19175,7 +18900,7 @@ function toFigmaOriginalUrl(url) {
|
|
|
19175
18900
|
}
|
|
19176
18901
|
|
|
19177
18902
|
// src/components/embeds/embed-iframe.tsx
|
|
19178
|
-
import { useState as useState43, useCallback as
|
|
18903
|
+
import { useState as useState43, useCallback as useCallback20, useRef as useRef27, useEffect as useEffect34 } from "react";
|
|
19179
18904
|
import { Fragment as Fragment29, jsx as jsx137, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
19180
18905
|
function EmbedLoadingSkeleton({ height }) {
|
|
19181
18906
|
return /* @__PURE__ */ jsx137(
|
|
@@ -19198,7 +18923,7 @@ function EmbedIframe({
|
|
|
19198
18923
|
}) {
|
|
19199
18924
|
const [isLoaded, setIsLoaded] = useState43(false);
|
|
19200
18925
|
const iframeRef = useRef27(null);
|
|
19201
|
-
const handleLoad =
|
|
18926
|
+
const handleLoad = useCallback20(() => setIsLoaded(true), []);
|
|
19202
18927
|
useEffect34(() => {
|
|
19203
18928
|
setIsLoaded(false);
|
|
19204
18929
|
}, [src]);
|
|
@@ -19833,7 +19558,7 @@ var RichMarkdownInner = ({
|
|
|
19833
19558
|
return map;
|
|
19834
19559
|
}, [sectionIds]);
|
|
19835
19560
|
const isDarkMode = true;
|
|
19836
|
-
const generateHeadingId =
|
|
19561
|
+
const generateHeadingId = useCallback21((text, level) => {
|
|
19837
19562
|
if (sectionIds && (level === 1 || level === 2)) {
|
|
19838
19563
|
const variations = [
|
|
19839
19564
|
text,
|
|
@@ -20411,7 +20136,7 @@ function StatusIndicator({ status, label, href }) {
|
|
|
20411
20136
|
}
|
|
20412
20137
|
|
|
20413
20138
|
// src/components/ui/hover-dropdown.tsx
|
|
20414
|
-
import { useState as useState48, useRef as useRef29, useCallback as
|
|
20139
|
+
import { useState as useState48, useRef as useRef29, useCallback as useCallback22 } from "react";
|
|
20415
20140
|
import { Fragment as Fragment31, jsx as jsx145, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
20416
20141
|
function DefaultAnchor({
|
|
20417
20142
|
href,
|
|
@@ -20431,15 +20156,15 @@ function HoverDropdown({
|
|
|
20431
20156
|
const [open, setOpen] = useState48(false);
|
|
20432
20157
|
const timeoutRef = useRef29(void 0);
|
|
20433
20158
|
const containerRef = useRef29(null);
|
|
20434
|
-
const show =
|
|
20159
|
+
const show = useCallback22(() => {
|
|
20435
20160
|
clearTimeout(timeoutRef.current);
|
|
20436
20161
|
setOpen(true);
|
|
20437
20162
|
}, []);
|
|
20438
|
-
const hide =
|
|
20163
|
+
const hide = useCallback22(() => {
|
|
20439
20164
|
timeoutRef.current = setTimeout(() => setOpen(false), hideDelay);
|
|
20440
20165
|
}, [hideDelay]);
|
|
20441
20166
|
if (items.length === 0) return /* @__PURE__ */ jsx145(Fragment31, { children });
|
|
20442
|
-
const toggle =
|
|
20167
|
+
const toggle = useCallback22((e) => {
|
|
20443
20168
|
e.stopPropagation();
|
|
20444
20169
|
clearTimeout(timeoutRef.current);
|
|
20445
20170
|
setOpen((prev) => !prev);
|
|
@@ -26449,7 +26174,7 @@ var ErrorBoundary = class extends Component3 {
|
|
|
26449
26174
|
|
|
26450
26175
|
// src/components/features/figma-prototype-viewer.tsx
|
|
26451
26176
|
init_cn();
|
|
26452
|
-
import { useState as useState59, useRef as useRef32, useEffect as useEffect44, useCallback as
|
|
26177
|
+
import { useState as useState59, useRef as useRef32, useEffect as useEffect44, useCallback as useCallback24, useMemo as useMemo25 } from "react";
|
|
26453
26178
|
|
|
26454
26179
|
// src/components/features/section-selector.tsx
|
|
26455
26180
|
init_cn();
|
|
@@ -26957,7 +26682,7 @@ var FigmaPrototypeViewer = ({
|
|
|
26957
26682
|
window.addEventListener("message", handleMessage);
|
|
26958
26683
|
return () => window.removeEventListener("message", handleMessage);
|
|
26959
26684
|
}, [config.sections, activeSection, isNavigating, externalActiveSection, config.onSectionChange, viewMode]);
|
|
26960
|
-
const navigateToSection =
|
|
26685
|
+
const navigateToSection = useCallback24((sectionId) => {
|
|
26961
26686
|
const section = config.sections.find((s) => s.id === sectionId);
|
|
26962
26687
|
if (!section || !iframeRef.current?.contentWindow || !isInitialized) {
|
|
26963
26688
|
return;
|
|
@@ -26981,7 +26706,7 @@ var FigmaPrototypeViewer = ({
|
|
|
26981
26706
|
if (navTimerRef.current) clearTimeout(navTimerRef.current);
|
|
26982
26707
|
navTimerRef.current = setTimeout(() => setIsNavigating(false), 500);
|
|
26983
26708
|
}, [config, isInitialized, viewMode, externalActiveSection]);
|
|
26984
|
-
const handleSectionClick =
|
|
26709
|
+
const handleSectionClick = useCallback24((sectionId) => {
|
|
26985
26710
|
const sectionsDisabled = iframeState !== "READY" || isNavigating;
|
|
26986
26711
|
if (sectionId === activeSection || sectionsDisabled) {
|
|
26987
26712
|
return;
|
|
@@ -26992,7 +26717,7 @@ var FigmaPrototypeViewer = ({
|
|
|
26992
26717
|
navigateToSection(sectionId);
|
|
26993
26718
|
}
|
|
26994
26719
|
}, [activeSection, iframeState, isNavigating, externalOnSectionClick, navigateToSection]);
|
|
26995
|
-
const handleTouchStart =
|
|
26720
|
+
const handleTouchStart = useCallback24((e) => {
|
|
26996
26721
|
const overlayElement = e.currentTarget;
|
|
26997
26722
|
console.log("[Touch] Touch detected, allowing iframe interaction");
|
|
26998
26723
|
overlayElement.style.pointerEvents = "none";
|
|
@@ -27556,7 +27281,7 @@ function useLoading() {
|
|
|
27556
27281
|
}
|
|
27557
27282
|
|
|
27558
27283
|
// src/components/features/media-gallery-manager.tsx
|
|
27559
|
-
import { useState as useState62, useRef as useRef34, useCallback as
|
|
27284
|
+
import { useState as useState62, useRef as useRef34, useCallback as useCallback25 } from "react";
|
|
27560
27285
|
import {
|
|
27561
27286
|
Upload,
|
|
27562
27287
|
Image as ImageIcon2,
|
|
@@ -27579,7 +27304,7 @@ function MediaGalleryManager({
|
|
|
27579
27304
|
const fileInputRef = useRef34(null);
|
|
27580
27305
|
const [deletingIndex, setDeletingIndex] = useState62(null);
|
|
27581
27306
|
const [draggedIndex, setDraggedIndex] = useState62(null);
|
|
27582
|
-
const handleFileSelect =
|
|
27307
|
+
const handleFileSelect = useCallback25(async (event) => {
|
|
27583
27308
|
const file = event.target.files?.[0];
|
|
27584
27309
|
if (!file) return;
|
|
27585
27310
|
let mediaType;
|
|
@@ -27605,18 +27330,18 @@ function MediaGalleryManager({
|
|
|
27605
27330
|
console.error("Upload failed:", error);
|
|
27606
27331
|
}
|
|
27607
27332
|
}, [media, onChange, onUpload]);
|
|
27608
|
-
const handleDeleteMedia =
|
|
27333
|
+
const handleDeleteMedia = useCallback25((index) => {
|
|
27609
27334
|
setDeletingIndex(index);
|
|
27610
27335
|
onChange(media.filter((_, i) => i !== index));
|
|
27611
27336
|
setDeletingIndex(null);
|
|
27612
27337
|
}, [media, onChange]);
|
|
27613
|
-
const handleDragStart =
|
|
27338
|
+
const handleDragStart = useCallback25((index) => {
|
|
27614
27339
|
setDraggedIndex(index);
|
|
27615
27340
|
}, []);
|
|
27616
|
-
const handleDragOver =
|
|
27341
|
+
const handleDragOver = useCallback25((e) => {
|
|
27617
27342
|
e.preventDefault();
|
|
27618
27343
|
}, []);
|
|
27619
|
-
const handleDrop =
|
|
27344
|
+
const handleDrop = useCallback25((e, targetIndex) => {
|
|
27620
27345
|
e.preventDefault();
|
|
27621
27346
|
if (draggedIndex === null || draggedIndex === targetIndex) {
|
|
27622
27347
|
setDraggedIndex(null);
|
|
@@ -27628,7 +27353,7 @@ function MediaGalleryManager({
|
|
|
27628
27353
|
onChange(newMedia.map((item, i) => ({ ...item, display_order: i })));
|
|
27629
27354
|
setDraggedIndex(null);
|
|
27630
27355
|
}, [media, draggedIndex, onChange]);
|
|
27631
|
-
const renderMediaItem =
|
|
27356
|
+
const renderMediaItem = useCallback25((mediaItem, index) => {
|
|
27632
27357
|
const isDeleting = deletingIndex === index;
|
|
27633
27358
|
return /* @__PURE__ */ jsxs164(
|
|
27634
27359
|
Card,
|
|
@@ -29349,7 +29074,7 @@ function getCaptionsUrl(entityType, entityId, srtContent) {
|
|
|
29349
29074
|
}
|
|
29350
29075
|
|
|
29351
29076
|
// src/components/features/video-source-selector.tsx
|
|
29352
|
-
import { useState as useState67, useCallback as
|
|
29077
|
+
import { useState as useState67, useCallback as useCallback26, useEffect as useEffect48 } from "react";
|
|
29353
29078
|
import { Upload as Upload4, X as X8, Video as Video7, Loader2 as Loader27 } from "lucide-react";
|
|
29354
29079
|
init_button2();
|
|
29355
29080
|
import { jsx as jsx227, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
@@ -29380,7 +29105,7 @@ function VideoSourceSelector({
|
|
|
29380
29105
|
const [uploadProgress, setUploadProgress] = useState67(0);
|
|
29381
29106
|
const [uploadMessage, setUploadMessage] = useState67("");
|
|
29382
29107
|
const [uploadError, setUploadError] = useState67(null);
|
|
29383
|
-
const handleUploadClick =
|
|
29108
|
+
const handleUploadClick = useCallback26(() => {
|
|
29384
29109
|
const input = document.createElement("input");
|
|
29385
29110
|
input.type = "file";
|
|
29386
29111
|
input.accept = "video/*";
|
|
@@ -29411,7 +29136,7 @@ function VideoSourceSelector({
|
|
|
29411
29136
|
};
|
|
29412
29137
|
input.click();
|
|
29413
29138
|
}, [onUploadVideo, onMainVideoUrlChange]);
|
|
29414
|
-
const handleDeleteVideo =
|
|
29139
|
+
const handleDeleteVideo = useCallback26(() => {
|
|
29415
29140
|
onMainVideoUrlChange("");
|
|
29416
29141
|
}, [onMainVideoUrlChange]);
|
|
29417
29142
|
return /* @__PURE__ */ jsxs177("div", { className: `space-y-4 p-6 bg-ods-card border border-ods-border rounded-lg ${className}`, children: [
|
|
@@ -31219,7 +30944,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
31219
30944
|
init_button2();
|
|
31220
30945
|
|
|
31221
30946
|
// src/components/ui/phone-input.tsx
|
|
31222
|
-
import { useCallback as
|
|
30947
|
+
import { useCallback as useCallback27, useEffect as useEffect50, useMemo as useMemo26, useRef as useRef38, useState as useState70 } from "react";
|
|
31223
30948
|
import { jsx as jsx247, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
31224
30949
|
function PhoneInput({
|
|
31225
30950
|
value,
|
|
@@ -31238,8 +30963,8 @@ function PhoneInput({
|
|
|
31238
30963
|
);
|
|
31239
30964
|
const [isInvalid, setIsInvalid] = useState70(false);
|
|
31240
30965
|
const debounceRef = useRef38(null);
|
|
31241
|
-
const digitCount =
|
|
31242
|
-
const runValidation =
|
|
30966
|
+
const digitCount = useCallback27((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
30967
|
+
const runValidation = useCallback27((phone) => {
|
|
31243
30968
|
if (!phone || digitCount(phone) === 0) {
|
|
31244
30969
|
setIsInvalid(false);
|
|
31245
30970
|
onValidationChange?.(false);
|
|
@@ -31249,7 +30974,7 @@ function PhoneInput({
|
|
|
31249
30974
|
setIsInvalid(invalid);
|
|
31250
30975
|
onValidationChange?.(invalid);
|
|
31251
30976
|
}, [countryCode, digitCount, onValidationChange]);
|
|
31252
|
-
const debouncedValidation =
|
|
30977
|
+
const debouncedValidation = useCallback27((phone) => {
|
|
31253
30978
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
31254
30979
|
debounceRef.current = setTimeout(() => runValidation(phone), 300);
|
|
31255
30980
|
}, [runValidation]);
|
|
@@ -33506,7 +33231,7 @@ function EmptyState2() {
|
|
|
33506
33231
|
}
|
|
33507
33232
|
|
|
33508
33233
|
// src/components/features/board/use-board-collapse.ts
|
|
33509
|
-
import { useCallback as
|
|
33234
|
+
import { useCallback as useCallback31, useState as useState79 } from "react";
|
|
33510
33235
|
function useBoardCollapse(storageKey) {
|
|
33511
33236
|
const [persisted, setPersisted] = useLocalStorage(
|
|
33512
33237
|
storageKey ?? "__board_collapse_unused__",
|
|
@@ -33515,13 +33240,13 @@ function useBoardCollapse(storageKey) {
|
|
|
33515
33240
|
const [memory, setMemory] = useState79({});
|
|
33516
33241
|
const collapsed = storageKey ? persisted : memory;
|
|
33517
33242
|
const setMap = storageKey ? setPersisted : setMemory;
|
|
33518
|
-
const toggle =
|
|
33243
|
+
const toggle = useCallback31(
|
|
33519
33244
|
(columnId) => {
|
|
33520
33245
|
setMap((prev) => ({ ...prev, [columnId]: !prev[columnId] }));
|
|
33521
33246
|
},
|
|
33522
33247
|
[setMap]
|
|
33523
33248
|
);
|
|
33524
|
-
const setCollapsed =
|
|
33249
|
+
const setCollapsed = useCallback31(
|
|
33525
33250
|
(columnId, value) => {
|
|
33526
33251
|
setMap((prev) => ({ ...prev, [columnId]: value }));
|
|
33527
33252
|
},
|
|
@@ -34525,7 +34250,7 @@ function SlidingSidebar({ config }) {
|
|
|
34525
34250
|
}
|
|
34526
34251
|
|
|
34527
34252
|
// src/components/navigation/sticky-section-nav.tsx
|
|
34528
|
-
import { useEffect as useEffect63, useState as useState84, useCallback as
|
|
34253
|
+
import { useEffect as useEffect63, useState as useState84, useCallback as useCallback33, useRef as useRef45 } from "react";
|
|
34529
34254
|
import { jsx as jsx270, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
34530
34255
|
function StickySectionNav({
|
|
34531
34256
|
sections,
|
|
@@ -34589,7 +34314,7 @@ function useSectionNavigation(sections, options) {
|
|
|
34589
34314
|
const [activeSection, setActiveSection] = useState84(sections[0]?.id || "");
|
|
34590
34315
|
const isScrollingFromClick = useRef45(false);
|
|
34591
34316
|
const { offset: offset2 = 100 } = options || {};
|
|
34592
|
-
const handleSectionClick =
|
|
34317
|
+
const handleSectionClick = useCallback33((sectionId) => {
|
|
34593
34318
|
const targetElement = document.getElementById(sectionId);
|
|
34594
34319
|
if (!targetElement) return;
|
|
34595
34320
|
isScrollingFromClick.current = true;
|
|
@@ -34639,7 +34364,7 @@ function useSectionNavigation(sections, options) {
|
|
|
34639
34364
|
}
|
|
34640
34365
|
|
|
34641
34366
|
// src/components/navigation/navigation-sidebar.tsx
|
|
34642
|
-
import { useCallback as
|
|
34367
|
+
import { useCallback as useCallback34, useEffect as useEffect64, useLayoutEffect as useLayoutEffect6, useMemo as useMemo33, useState as useState85 } from "react";
|
|
34643
34368
|
|
|
34644
34369
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
34645
34370
|
import { jsx as jsx271, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
@@ -34795,7 +34520,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
34795
34520
|
const [transitionsEnabled, setTransitionsEnabled] = useState85(false);
|
|
34796
34521
|
const isOverlayOpen = isTablet && !minimized;
|
|
34797
34522
|
const showLabel = !minimized;
|
|
34798
|
-
const handleToggle =
|
|
34523
|
+
const handleToggle = useCallback34(() => {
|
|
34799
34524
|
if (isTablet) {
|
|
34800
34525
|
setTabletMinimized((prev) => !prev);
|
|
34801
34526
|
} else {
|
|
@@ -34803,7 +34528,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
34803
34528
|
}
|
|
34804
34529
|
config.onToggleMinimized?.();
|
|
34805
34530
|
}, [isTablet, setDesktopMinimized, config]);
|
|
34806
|
-
const closeOverlay =
|
|
34531
|
+
const closeOverlay = useCallback34(() => {
|
|
34807
34532
|
setTabletMinimized(true);
|
|
34808
34533
|
}, []);
|
|
34809
34534
|
useEffect64(() => {
|
|
@@ -34814,7 +34539,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
34814
34539
|
document.addEventListener("keydown", handleKeyDown);
|
|
34815
34540
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
34816
34541
|
}, [isOverlayOpen, closeOverlay]);
|
|
34817
|
-
const handleItemClick =
|
|
34542
|
+
const handleItemClick = useCallback34((item, event) => {
|
|
34818
34543
|
event?.stopPropagation();
|
|
34819
34544
|
if (item.onClick) {
|
|
34820
34545
|
item.onClick();
|
|
@@ -35287,10 +35012,10 @@ function NotificationsHeaderButton({
|
|
|
35287
35012
|
}
|
|
35288
35013
|
|
|
35289
35014
|
// src/components/navigation/app-layout.tsx
|
|
35290
|
-
import { createContext as createContext9, Suspense as Suspense2, useCallback as
|
|
35015
|
+
import { createContext as createContext9, Suspense as Suspense2, useCallback as useCallback36, useContext as useContext9, useMemo as useMemo34, useRef as useRef46, useState as useState86 } from "react";
|
|
35291
35016
|
|
|
35292
35017
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
35293
|
-
import React111, { useCallback as
|
|
35018
|
+
import React111, { useCallback as useCallback35, useEffect as useEffect65 } from "react";
|
|
35294
35019
|
import { Fragment as Fragment51, jsx as jsx279, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
35295
35020
|
var HEADER_HEIGHT = 48;
|
|
35296
35021
|
var MobileBurgerMenu = React111.memo(function MobileBurgerMenu2({
|
|
@@ -35324,7 +35049,7 @@ var MobileBurgerMenu = React111.memo(function MobileBurgerMenu2({
|
|
|
35324
35049
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
35325
35050
|
}
|
|
35326
35051
|
}, [isOpen, onClose]);
|
|
35327
|
-
const handleItemClick =
|
|
35052
|
+
const handleItemClick = useCallback35((item) => {
|
|
35328
35053
|
if (item.onClick) {
|
|
35329
35054
|
item.onClick();
|
|
35330
35055
|
} else if (item.path) {
|
|
@@ -35514,14 +35239,14 @@ function AppLayout({
|
|
|
35514
35239
|
const mobileMenuOpenRef = useRef46(mobileMenuOpen);
|
|
35515
35240
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
35516
35241
|
const drawerHandlesRef = useRef46(/* @__PURE__ */ new Set());
|
|
35517
|
-
const handleToggleMobileMenu =
|
|
35242
|
+
const handleToggleMobileMenu = useCallback36(() => {
|
|
35518
35243
|
const opening = !mobileMenuOpenRef.current;
|
|
35519
35244
|
if (opening) {
|
|
35520
35245
|
for (const handle of drawerHandlesRef.current) handle.close();
|
|
35521
35246
|
}
|
|
35522
35247
|
setMobileMenuOpen(opening);
|
|
35523
35248
|
}, []);
|
|
35524
|
-
const handleCloseMobileMenu =
|
|
35249
|
+
const handleCloseMobileMenu = useCallback36(() => {
|
|
35525
35250
|
setMobileMenuOpen(false);
|
|
35526
35251
|
}, []);
|
|
35527
35252
|
const drawerCoordination = useMemo34(() => ({
|
|
@@ -36607,7 +36332,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
36607
36332
|
|
|
36608
36333
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
36609
36334
|
init_button2();
|
|
36610
|
-
import React114, { useRef as useRef48, useCallback as
|
|
36335
|
+
import React114, { useRef as useRef48, useCallback as useCallback38 } from "react";
|
|
36611
36336
|
|
|
36612
36337
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
36613
36338
|
import React113 from "react";
|
|
@@ -36760,7 +36485,7 @@ function OnboardingWalkthrough({
|
|
|
36760
36485
|
lastCompletionStatusRef.current = statusKey;
|
|
36761
36486
|
}
|
|
36762
36487
|
}, [completionStatus, isLoadingCompletion, state.completedSteps, markMultipleComplete]);
|
|
36763
|
-
const handleStepAction =
|
|
36488
|
+
const handleStepAction = useCallback38(async (step) => {
|
|
36764
36489
|
if (actionInProgressRef.current.has(step.id)) {
|
|
36765
36490
|
console.log(`\u23F3 Action already in progress for "${step.id}", skipping`);
|
|
36766
36491
|
return;
|
|
@@ -38403,7 +38128,7 @@ import { useMemo as useMemo36 } from "react";
|
|
|
38403
38128
|
|
|
38404
38129
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
38405
38130
|
init_cn();
|
|
38406
|
-
import { useRef as useRef51, useState as useState90, useCallback as
|
|
38131
|
+
import { useRef as useRef51, useState as useState90, useCallback as useCallback39 } from "react";
|
|
38407
38132
|
import { jsx as jsx311, jsxs as jsxs246 } from "react/jsx-runtime";
|
|
38408
38133
|
function QueryReportTableHeader({
|
|
38409
38134
|
columns,
|
|
@@ -38434,7 +38159,7 @@ function QueryReportTableHeader({
|
|
|
38434
38159
|
function TruncatedHeaderCell({ value, width }) {
|
|
38435
38160
|
const textRef = useRef51(null);
|
|
38436
38161
|
const [isTruncated, setIsTruncated] = useState90(false);
|
|
38437
|
-
const checkTruncation =
|
|
38162
|
+
const checkTruncation = useCallback39(() => {
|
|
38438
38163
|
const el = textRef.current;
|
|
38439
38164
|
if (el) {
|
|
38440
38165
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -38462,7 +38187,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
38462
38187
|
|
|
38463
38188
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
38464
38189
|
init_cn();
|
|
38465
|
-
import { useRef as useRef52, useState as useState91, useCallback as
|
|
38190
|
+
import { useRef as useRef52, useState as useState91, useCallback as useCallback40 } from "react";
|
|
38466
38191
|
import { jsx as jsx312, jsxs as jsxs247 } from "react/jsx-runtime";
|
|
38467
38192
|
function QueryReportTableRow({
|
|
38468
38193
|
row,
|
|
@@ -38510,7 +38235,7 @@ function QueryReportTableRow({
|
|
|
38510
38235
|
function TruncatedCell({ value, className }) {
|
|
38511
38236
|
const textRef = useRef52(null);
|
|
38512
38237
|
const [isTruncated, setIsTruncated] = useState91(false);
|
|
38513
|
-
const checkTruncation =
|
|
38238
|
+
const checkTruncation = useCallback40(() => {
|
|
38514
38239
|
const el = textRef.current;
|
|
38515
38240
|
if (el) {
|
|
38516
38241
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -38773,7 +38498,7 @@ init_cn();
|
|
|
38773
38498
|
|
|
38774
38499
|
// src/components/ui/data-table/data-table-column-filter.tsx
|
|
38775
38500
|
init_cn();
|
|
38776
|
-
import { useCallback as
|
|
38501
|
+
import { useCallback as useCallback41, useMemo as useMemo37 } from "react";
|
|
38777
38502
|
|
|
38778
38503
|
// src/components/ui/data-table/utils.ts
|
|
38779
38504
|
function getHideClasses2(hideAt) {
|
|
@@ -38833,14 +38558,14 @@ function DataTableColumnFilter({
|
|
|
38833
38558
|
() => ({ [column.id]: currentValue ?? EMPTY_ARRAY }),
|
|
38834
38559
|
[column.id, currentValue]
|
|
38835
38560
|
);
|
|
38836
|
-
const handleApply =
|
|
38561
|
+
const handleApply = useCallback41(
|
|
38837
38562
|
(applied) => {
|
|
38838
38563
|
const next = applied[column.id] ?? [];
|
|
38839
38564
|
column.setFilterValue(next.length > 0 ? next : void 0);
|
|
38840
38565
|
},
|
|
38841
38566
|
[column]
|
|
38842
38567
|
);
|
|
38843
|
-
const handleReset =
|
|
38568
|
+
const handleReset = useCallback41(() => {
|
|
38844
38569
|
column.setFilterValue(void 0);
|
|
38845
38570
|
}, [column]);
|
|
38846
38571
|
return /* @__PURE__ */ jsx316(
|
|
@@ -39008,7 +38733,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
39008
38733
|
// src/components/ui/data-table/data-table-row.tsx
|
|
39009
38734
|
init_next_link();
|
|
39010
38735
|
init_cn();
|
|
39011
|
-
import { memo as memo5, useCallback as
|
|
38736
|
+
import { memo as memo5, useCallback as useCallback42, useRef as useRef53 } from "react";
|
|
39012
38737
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
39013
38738
|
|
|
39014
38739
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -39094,7 +38819,7 @@ function DataTableRowImpl({
|
|
|
39094
38819
|
const isLinkMode = Boolean(href) && !onClick;
|
|
39095
38820
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
39096
38821
|
const containerRef = useRef53(null);
|
|
39097
|
-
const handleClick =
|
|
38822
|
+
const handleClick = useCallback42(
|
|
39098
38823
|
(e) => {
|
|
39099
38824
|
const target = e.target;
|
|
39100
38825
|
if (!containerRef.current?.contains(target)) {
|
|
@@ -40102,7 +39827,7 @@ function TagSearchInput({
|
|
|
40102
39827
|
}
|
|
40103
39828
|
|
|
40104
39829
|
// src/components/ui/markdown-editor.tsx
|
|
40105
|
-
import { useRef as useRef57, useCallback as
|
|
39830
|
+
import { useRef as useRef57, useCallback as useCallback43, useState as useState94, useEffect as useEffect72 } from "react";
|
|
40106
39831
|
init_cn();
|
|
40107
39832
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
40108
39833
|
import { jsx as jsx327, jsxs as jsxs260 } from "react/jsx-runtime";
|
|
@@ -40171,7 +39896,7 @@ function MarkdownEditor({
|
|
|
40171
39896
|
const handleChange = (val) => {
|
|
40172
39897
|
onChange(val || "");
|
|
40173
39898
|
};
|
|
40174
|
-
const insertTextAtCursor =
|
|
39899
|
+
const insertTextAtCursor = useCallback43(
|
|
40175
39900
|
(text) => {
|
|
40176
39901
|
const textarea = document.querySelector(
|
|
40177
39902
|
".w-md-editor-text-textarea"
|
|
@@ -40187,7 +39912,7 @@ function MarkdownEditor({
|
|
|
40187
39912
|
},
|
|
40188
39913
|
[value, onChange]
|
|
40189
39914
|
);
|
|
40190
|
-
const handleFileUpload =
|
|
39915
|
+
const handleFileUpload = useCallback43(
|
|
40191
39916
|
async (file) => {
|
|
40192
39917
|
if (!onUploadFile) return;
|
|
40193
39918
|
setIsUploading(true);
|
|
@@ -40208,7 +39933,7 @@ function MarkdownEditor({
|
|
|
40208
39933
|
},
|
|
40209
39934
|
[onUploadFile, insertTextAtCursor, onFileUploaded]
|
|
40210
39935
|
);
|
|
40211
|
-
const handleFileInputChange =
|
|
39936
|
+
const handleFileInputChange = useCallback43(
|
|
40212
39937
|
(e) => {
|
|
40213
39938
|
const file = e.target.files?.[0];
|
|
40214
39939
|
if (file) {
|
|
@@ -40218,7 +39943,7 @@ function MarkdownEditor({
|
|
|
40218
39943
|
},
|
|
40219
39944
|
[handleFileUpload]
|
|
40220
39945
|
);
|
|
40221
|
-
const handlePaste =
|
|
39946
|
+
const handlePaste = useCallback43(
|
|
40222
39947
|
(e) => {
|
|
40223
39948
|
if (!onUploadFile) return;
|
|
40224
39949
|
const items = e.clipboardData?.items;
|
|
@@ -40257,7 +39982,7 @@ function MarkdownEditor({
|
|
|
40257
39982
|
const scrollParentRef = useRef57(window);
|
|
40258
39983
|
const EDGE_ZONE = 60;
|
|
40259
39984
|
const MAX_SCROLL_SPEED = 15;
|
|
40260
|
-
const findScrollParent =
|
|
39985
|
+
const findScrollParent = useCallback43((el) => {
|
|
40261
39986
|
let node = el?.parentElement;
|
|
40262
39987
|
while (node && node !== document.documentElement) {
|
|
40263
39988
|
const { overflowY } = window.getComputedStyle(node);
|
|
@@ -40268,7 +39993,7 @@ function MarkdownEditor({
|
|
|
40268
39993
|
}
|
|
40269
39994
|
return window;
|
|
40270
39995
|
}, []);
|
|
40271
|
-
const scrollLoop =
|
|
39996
|
+
const scrollLoop = useCallback43(() => {
|
|
40272
39997
|
if (!isDraggingRef.current) return;
|
|
40273
39998
|
const parent = scrollParentRef.current;
|
|
40274
39999
|
const isWindow = parent === window;
|
|
@@ -45832,7 +45557,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
45832
45557
|
}
|
|
45833
45558
|
|
|
45834
45559
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
45835
|
-
import { useCallback as
|
|
45560
|
+
import { useCallback as useCallback45, useRef as useRef61 } from "react";
|
|
45836
45561
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
45837
45562
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
45838
45563
|
}
|
|
@@ -45869,7 +45594,7 @@ function useChunkCatchup({
|
|
|
45869
45594
|
fetchChunksRef.current = fetchChunks;
|
|
45870
45595
|
const onChunkReceivedRef = useRef61(onChunkReceived);
|
|
45871
45596
|
onChunkReceivedRef.current = onChunkReceived;
|
|
45872
|
-
const processChunk =
|
|
45597
|
+
const processChunk = useCallback45((chunk, messageType, forceProcess = false) => {
|
|
45873
45598
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
45874
45599
|
chunkBuffer.current.push({ chunk, messageType });
|
|
45875
45600
|
return true;
|
|
@@ -45882,7 +45607,7 @@ function useChunkCatchup({
|
|
|
45882
45607
|
onChunkReceivedRef.current(chunk, messageType);
|
|
45883
45608
|
return true;
|
|
45884
45609
|
}, []);
|
|
45885
|
-
const flushBufferedRealtimeChunks =
|
|
45610
|
+
const flushBufferedRealtimeChunks = useCallback45(() => {
|
|
45886
45611
|
if (chunkBuffer.current.length === 0) return;
|
|
45887
45612
|
const buffered = [...chunkBuffer.current];
|
|
45888
45613
|
chunkBuffer.current = [];
|
|
@@ -45895,7 +45620,7 @@ function useChunkCatchup({
|
|
|
45895
45620
|
processChunk(chunk, messageType, true);
|
|
45896
45621
|
});
|
|
45897
45622
|
}, [processChunk]);
|
|
45898
|
-
const catchUpChunks =
|
|
45623
|
+
const catchUpChunks = useCallback45(async (fromSequenceId) => {
|
|
45899
45624
|
const dialogId2 = dialogIdRef.current;
|
|
45900
45625
|
const chatTypes2 = chatTypesRef.current;
|
|
45901
45626
|
const fetchChunks2 = fetchChunksRef.current;
|
|
@@ -46008,7 +45733,7 @@ function useChunkCatchup({
|
|
|
46008
45733
|
}
|
|
46009
45734
|
}
|
|
46010
45735
|
}, [flushBufferedRealtimeChunks]);
|
|
46011
|
-
const resetChunkTracking =
|
|
45736
|
+
const resetChunkTracking = useCallback45(() => {
|
|
46012
45737
|
processedSequenceKeys.current.clear();
|
|
46013
45738
|
lastSequenceId.current = null;
|
|
46014
45739
|
fetchingInProgress.current = false;
|
|
@@ -46017,13 +45742,13 @@ function useChunkCatchup({
|
|
|
46017
45742
|
bufferUntilInitialCatchupComplete.current = false;
|
|
46018
45743
|
hasCompletedInitialCatchup.current = false;
|
|
46019
45744
|
}, []);
|
|
46020
|
-
const startInitialBuffering =
|
|
45745
|
+
const startInitialBuffering = useCallback45(() => {
|
|
46021
45746
|
chunkBuffer.current = [];
|
|
46022
45747
|
bufferUntilInitialCatchupComplete.current = true;
|
|
46023
45748
|
hasCompletedInitialCatchup.current = false;
|
|
46024
45749
|
}, []);
|
|
46025
|
-
const isBufferingActive =
|
|
46026
|
-
const resetAndCatchUp =
|
|
45750
|
+
const isBufferingActive = useCallback45(() => bufferUntilInitialCatchupComplete.current, []);
|
|
45751
|
+
const resetAndCatchUp = useCallback45(async () => {
|
|
46027
45752
|
if (!dialogIdRef.current) return;
|
|
46028
45753
|
const fromSeq = lastSequenceId.current;
|
|
46029
45754
|
hasCompletedInitialCatchup.current = false;
|
|
@@ -46559,7 +46284,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
46559
46284
|
}
|
|
46560
46285
|
|
|
46561
46286
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
46562
|
-
import { useCallback as
|
|
46287
|
+
import { useCallback as useCallback46, useRef as useRef64, useEffect as useEffect78 } from "react";
|
|
46563
46288
|
|
|
46564
46289
|
// src/components/chat/utils/chunk-parser.ts
|
|
46565
46290
|
function normalizeToolCalls(raw) {
|
|
@@ -47238,7 +46963,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
47238
46963
|
directModeFlagRef.current = isDirectMode;
|
|
47239
46964
|
}, [isDirectMode]);
|
|
47240
46965
|
const pendingEscalatedRef = useRef64(/* @__PURE__ */ new Map());
|
|
47241
|
-
const processChunk =
|
|
46966
|
+
const processChunk = useCallback46(
|
|
47242
46967
|
(chunk) => {
|
|
47243
46968
|
const action = parseChunkToAction(chunk);
|
|
47244
46969
|
if (!action) return;
|
|
@@ -47467,22 +47192,22 @@ function useRealtimeChunkProcessor(options) {
|
|
|
47467
47192
|
},
|
|
47468
47193
|
[callbacks, displayApprovalTypes, approvalStatuses, initialState]
|
|
47469
47194
|
);
|
|
47470
|
-
const getSegments =
|
|
47195
|
+
const getSegments = useCallback46(() => {
|
|
47471
47196
|
return accumulatorRef.current.getSegments();
|
|
47472
47197
|
}, []);
|
|
47473
|
-
const reset =
|
|
47198
|
+
const reset = useCallback46(() => {
|
|
47474
47199
|
accumulatorRef.current.reset();
|
|
47475
47200
|
pendingEscalatedRef.current.clear();
|
|
47476
47201
|
hasInitializedWithData.current = false;
|
|
47477
47202
|
sawDirectMessageRef.current = false;
|
|
47478
47203
|
}, []);
|
|
47479
|
-
const updateApprovalStatus =
|
|
47204
|
+
const updateApprovalStatus = useCallback46(
|
|
47480
47205
|
(requestId, status, resolvedByName) => {
|
|
47481
47206
|
return accumulatorRef.current.updateApprovalStatus(requestId, status, resolvedByName);
|
|
47482
47207
|
},
|
|
47483
47208
|
[]
|
|
47484
47209
|
);
|
|
47485
|
-
const getPendingApprovals =
|
|
47210
|
+
const getPendingApprovals = useCallback46(() => {
|
|
47486
47211
|
return new Map(pendingEscalatedRef.current);
|
|
47487
47212
|
}, []);
|
|
47488
47213
|
return {
|
|
@@ -47620,7 +47345,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
47620
47345
|
}
|
|
47621
47346
|
|
|
47622
47347
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
47623
|
-
import { useCallback as
|
|
47348
|
+
import { useCallback as useCallback47, useMemo as useMemo40, useRef as useRef65, useState as useState107 } from "react";
|
|
47624
47349
|
import { fileTypeFromBlob } from "file-type";
|
|
47625
47350
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
47626
47351
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -47698,10 +47423,10 @@ function useChatAttachments() {
|
|
|
47698
47423
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
47699
47424
|
const [attachments, setAttachments] = useState107([]);
|
|
47700
47425
|
const controllersRef = useRef65(/* @__PURE__ */ new Map());
|
|
47701
|
-
const updateOne =
|
|
47426
|
+
const updateOne = useCallback47((id, patch) => {
|
|
47702
47427
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
47703
47428
|
}, []);
|
|
47704
|
-
const removeAttachment =
|
|
47429
|
+
const removeAttachment = useCallback47((id) => {
|
|
47705
47430
|
const ctrl = controllersRef.current.get(id);
|
|
47706
47431
|
if (ctrl) {
|
|
47707
47432
|
ctrl.abort();
|
|
@@ -47709,12 +47434,12 @@ function useChatAttachments() {
|
|
|
47709
47434
|
}
|
|
47710
47435
|
setAttachments((prev) => prev.filter((a) => a.id !== id));
|
|
47711
47436
|
}, []);
|
|
47712
|
-
const clear =
|
|
47437
|
+
const clear = useCallback47(() => {
|
|
47713
47438
|
for (const ctrl of controllersRef.current.values()) ctrl.abort();
|
|
47714
47439
|
controllersRef.current.clear();
|
|
47715
47440
|
setAttachments([]);
|
|
47716
47441
|
}, []);
|
|
47717
|
-
const uploadOne =
|
|
47442
|
+
const uploadOne = useCallback47(
|
|
47718
47443
|
async (att) => {
|
|
47719
47444
|
const ctrl = controllersRef.current.get(att.id);
|
|
47720
47445
|
try {
|
|
@@ -47788,7 +47513,7 @@ function useChatAttachments() {
|
|
|
47788
47513
|
);
|
|
47789
47514
|
const attachmentsRef = useRef65([]);
|
|
47790
47515
|
attachmentsRef.current = attachments;
|
|
47791
|
-
const addFiles =
|
|
47516
|
+
const addFiles = useCallback47(
|
|
47792
47517
|
(files) => {
|
|
47793
47518
|
const arr = Array.from(files);
|
|
47794
47519
|
if (arr.length === 0) return;
|
|
@@ -47863,7 +47588,7 @@ function useChatAttachments() {
|
|
|
47863
47588
|
}
|
|
47864
47589
|
|
|
47865
47590
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
47866
|
-
import { useCallback as
|
|
47591
|
+
import { useCallback as useCallback48, useEffect as useEffect80, useRef as useRef66, useState as useState108 } from "react";
|
|
47867
47592
|
import { jsx as jsx351 } from "react/jsx-runtime";
|
|
47868
47593
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
47869
47594
|
function useChatAttachmentImageGallery() {
|
|
@@ -47871,7 +47596,7 @@ function useChatAttachmentImageGallery() {
|
|
|
47871
47596
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
47872
47597
|
const panelRef = useRef66(null);
|
|
47873
47598
|
const [state, setState] = useState108(CLOSED);
|
|
47874
|
-
const handleClose =
|
|
47599
|
+
const handleClose = useCallback48(() => setState(CLOSED), []);
|
|
47875
47600
|
useEffect80(() => {
|
|
47876
47601
|
const root = panelRef.current;
|
|
47877
47602
|
if (!root) return;
|
|
@@ -47991,20 +47716,20 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
47991
47716
|
}
|
|
47992
47717
|
|
|
47993
47718
|
// src/components/chat/hooks/use-chat.ts
|
|
47994
|
-
import { useState as useState111, useCallback as
|
|
47719
|
+
import { useState as useState111, useCallback as useCallback50, useEffect as useEffect83, useRef as useRef69 } from "react";
|
|
47995
47720
|
|
|
47996
47721
|
// src/components/chat/hooks/use-sse.ts
|
|
47997
|
-
import { useState as useState110, useCallback as
|
|
47722
|
+
import { useState as useState110, useCallback as useCallback49, useRef as useRef68 } from "react";
|
|
47998
47723
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
47999
47724
|
const [isStreaming, setIsStreaming] = useState110(false);
|
|
48000
47725
|
const [error, setError] = useState110(null);
|
|
48001
47726
|
const abortControllerRef = useRef68(null);
|
|
48002
|
-
const fallbackStream =
|
|
47727
|
+
const fallbackStream = useCallback49(async function* () {
|
|
48003
47728
|
throw new Error(
|
|
48004
47729
|
"[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the mock to your host code."
|
|
48005
47730
|
);
|
|
48006
47731
|
}, []);
|
|
48007
|
-
const streamMessage =
|
|
47732
|
+
const streamMessage = useCallback49(
|
|
48008
47733
|
async function* (message2, extra) {
|
|
48009
47734
|
setIsStreaming(true);
|
|
48010
47735
|
setError(null);
|
|
@@ -48034,13 +47759,13 @@ function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
|
48034
47759
|
},
|
|
48035
47760
|
[streamFn, fallbackStream]
|
|
48036
47761
|
);
|
|
48037
|
-
const abort =
|
|
47762
|
+
const abort = useCallback49(() => {
|
|
48038
47763
|
if (abortControllerRef.current) {
|
|
48039
47764
|
abortControllerRef.current.abort();
|
|
48040
47765
|
}
|
|
48041
47766
|
setIsStreaming(false);
|
|
48042
47767
|
}, []);
|
|
48043
|
-
const reset =
|
|
47768
|
+
const reset = useCallback49(() => {
|
|
48044
47769
|
}, []);
|
|
48045
47770
|
return {
|
|
48046
47771
|
streamMessage,
|
|
@@ -48083,10 +47808,10 @@ function useChat({
|
|
|
48083
47808
|
debugMode,
|
|
48084
47809
|
streamFn
|
|
48085
47810
|
});
|
|
48086
|
-
const addMessage =
|
|
47811
|
+
const addMessage = useCallback50((message2) => {
|
|
48087
47812
|
setMessages((prev) => [...prev, message2]);
|
|
48088
47813
|
}, []);
|
|
48089
|
-
const updateLastAssistantMessage =
|
|
47814
|
+
const updateLastAssistantMessage = useCallback50((segments) => {
|
|
48090
47815
|
setMessages((prev) => {
|
|
48091
47816
|
const newMessages = [...prev];
|
|
48092
47817
|
const lastMessage = newMessages[newMessages.length - 1];
|
|
@@ -48099,7 +47824,7 @@ function useChat({
|
|
|
48099
47824
|
return newMessages;
|
|
48100
47825
|
});
|
|
48101
47826
|
}, []);
|
|
48102
|
-
const sendMessage =
|
|
47827
|
+
const sendMessage = useCallback50(
|
|
48103
47828
|
async (text, extra, options) => {
|
|
48104
47829
|
const userMessage = {
|
|
48105
47830
|
id: `user-${Date.now()}`,
|
|
@@ -48329,18 +48054,18 @@ function useChat({
|
|
|
48329
48054
|
},
|
|
48330
48055
|
[streamMessage, addMessage, updateLastAssistantMessage, assistantName, assistantAvatar]
|
|
48331
48056
|
);
|
|
48332
|
-
const handleQuickAction =
|
|
48057
|
+
const handleQuickAction = useCallback50(
|
|
48333
48058
|
(actionText) => {
|
|
48334
48059
|
sendMessage(actionText);
|
|
48335
48060
|
},
|
|
48336
48061
|
[sendMessage]
|
|
48337
48062
|
);
|
|
48338
|
-
const clearMessages =
|
|
48063
|
+
const clearMessages = useCallback50(() => {
|
|
48339
48064
|
setMessages([]);
|
|
48340
48065
|
setIsTyping(false);
|
|
48341
48066
|
reset();
|
|
48342
48067
|
}, [reset]);
|
|
48343
|
-
const stopMessage =
|
|
48068
|
+
const stopMessage = useCallback50(() => {
|
|
48344
48069
|
abort();
|
|
48345
48070
|
setIsTyping(false);
|
|
48346
48071
|
}, [abort]);
|
|
@@ -48358,7 +48083,7 @@ function useChat({
|
|
|
48358
48083
|
}
|
|
48359
48084
|
|
|
48360
48085
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
48361
|
-
import { useState as useState112, useEffect as useEffect84, useCallback as
|
|
48086
|
+
import { useState as useState112, useEffect as useEffect84, useCallback as useCallback51, useMemo as useMemo41, useRef as useRef70 } from "react";
|
|
48362
48087
|
function createEmptyTurnMeta() {
|
|
48363
48088
|
return {
|
|
48364
48089
|
provider: null,
|
|
@@ -48695,7 +48420,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
48695
48420
|
const sendCountRef = useRef70(persistedRef.current.sendCount);
|
|
48696
48421
|
const [streamingPhase, setStreamingPhase] = useState112("idle");
|
|
48697
48422
|
const [metaTick, setMetaTick] = useState112(0);
|
|
48698
|
-
const bumpMetaTick =
|
|
48423
|
+
const bumpMetaTick = useCallback51(() => setMetaTick((t) => t + 1), []);
|
|
48699
48424
|
const streamFn = useMemo41(
|
|
48700
48425
|
() => createDocStreamFn(
|
|
48701
48426
|
source,
|
|
@@ -48742,7 +48467,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
48742
48467
|
}
|
|
48743
48468
|
return map;
|
|
48744
48469
|
}, [slashCommands]);
|
|
48745
|
-
const persist =
|
|
48470
|
+
const persist = useCallback51(
|
|
48746
48471
|
(nextMessages) => {
|
|
48747
48472
|
savePersistedChat(source, {
|
|
48748
48473
|
messages: nextMessages,
|
|
@@ -48796,7 +48521,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
48796
48521
|
...m.hidden ? { hidden: true } : {}
|
|
48797
48522
|
};
|
|
48798
48523
|
});
|
|
48799
|
-
const sendMessage =
|
|
48524
|
+
const sendMessage = useCallback51(
|
|
48800
48525
|
async (text, options2) => {
|
|
48801
48526
|
const {
|
|
48802
48527
|
hidden,
|
|
@@ -48815,7 +48540,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
48815
48540
|
},
|
|
48816
48541
|
[chatSendMessage]
|
|
48817
48542
|
);
|
|
48818
|
-
const displayRef =
|
|
48543
|
+
const displayRef = useCallback51(
|
|
48819
48544
|
(reference) => {
|
|
48820
48545
|
const tableId = tableIdForDocumentType(reference.type);
|
|
48821
48546
|
if (!tableId) {
|
|
@@ -48839,7 +48564,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
48839
48564
|
},
|
|
48840
48565
|
[sendMessage, source, cmdIdByTableId, tableIdForDocumentType]
|
|
48841
48566
|
);
|
|
48842
|
-
const discussRef =
|
|
48567
|
+
const discussRef = useCallback51(
|
|
48843
48568
|
(reference) => {
|
|
48844
48569
|
const tableId = tableIdForDocumentType(reference.type);
|
|
48845
48570
|
if (!tableId) {
|
|
@@ -48863,11 +48588,11 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
48863
48588
|
},
|
|
48864
48589
|
[sendMessage, tableIdForDocumentType]
|
|
48865
48590
|
);
|
|
48866
|
-
const stopMessage =
|
|
48591
|
+
const stopMessage = useCallback51(() => {
|
|
48867
48592
|
chatStopMessage();
|
|
48868
48593
|
setStreamingPhase("idle");
|
|
48869
48594
|
}, [chatStopMessage]);
|
|
48870
|
-
const clearMessages =
|
|
48595
|
+
const clearMessages = useCallback51(() => {
|
|
48871
48596
|
sourcesMapRef.current.clear();
|
|
48872
48597
|
refsMapRef.current.clear();
|
|
48873
48598
|
metaMapRef.current.clear();
|
|
@@ -48963,7 +48688,7 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
48963
48688
|
|
|
48964
48689
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
48965
48690
|
import {
|
|
48966
|
-
useCallback as
|
|
48691
|
+
useCallback as useCallback52,
|
|
48967
48692
|
useEffect as useEffect85,
|
|
48968
48693
|
useMemo as useMemo42,
|
|
48969
48694
|
useRef as useRef71,
|
|
@@ -49474,7 +49199,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49474
49199
|
);
|
|
49475
49200
|
const [liveModel, setLiveModel] = useState113(null);
|
|
49476
49201
|
const [connectionState, setConnectionState] = useState113("connecting");
|
|
49477
|
-
const handleApprove =
|
|
49202
|
+
const handleApprove = useCallback52(
|
|
49478
49203
|
async (requestId) => {
|
|
49479
49204
|
if (!approveRequestCallback) return;
|
|
49480
49205
|
setApprovalStatuses((prev) => ({ ...prev, [requestId]: "approved" }));
|
|
@@ -49491,7 +49216,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49491
49216
|
},
|
|
49492
49217
|
[approveRequestCallback]
|
|
49493
49218
|
);
|
|
49494
|
-
const handleReject =
|
|
49219
|
+
const handleReject = useCallback52(
|
|
49495
49220
|
async (requestId, reason) => {
|
|
49496
49221
|
if (!rejectRequestCallback) return;
|
|
49497
49222
|
setApprovalStatuses((prev) => ({ ...prev, [requestId]: "rejected" }));
|
|
@@ -49512,11 +49237,11 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49512
49237
|
handleApproveRef.current = handleApprove;
|
|
49513
49238
|
const handleRejectRef = useRef71(handleReject);
|
|
49514
49239
|
handleRejectRef.current = handleReject;
|
|
49515
|
-
const accumApprove =
|
|
49240
|
+
const accumApprove = useCallback52((requestId) => {
|
|
49516
49241
|
if (!requestId) return;
|
|
49517
49242
|
return handleApproveRef.current(requestId);
|
|
49518
49243
|
}, []);
|
|
49519
|
-
const accumReject =
|
|
49244
|
+
const accumReject = useCallback52((requestId) => {
|
|
49520
49245
|
if (!requestId) return;
|
|
49521
49246
|
return handleRejectRef.current(requestId);
|
|
49522
49247
|
}, []);
|
|
@@ -49559,7 +49284,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49559
49284
|
fetchChunks
|
|
49560
49285
|
});
|
|
49561
49286
|
const historyLoadSeqRef = useRef71(0);
|
|
49562
|
-
const loadDialogHistory =
|
|
49287
|
+
const loadDialogHistory = useCallback52(
|
|
49563
49288
|
async (id, cursor) => {
|
|
49564
49289
|
if (!fetchDialogMessages) return;
|
|
49565
49290
|
historyLoadSeqRef.current += 1;
|
|
@@ -49658,7 +49383,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49658
49383
|
setConnectionState("connecting");
|
|
49659
49384
|
}, [active, dialogId]);
|
|
49660
49385
|
const initialDialogsLoadedRef = useRef71(false);
|
|
49661
|
-
const loadDialogsPage =
|
|
49386
|
+
const loadDialogsPage = useCallback52(
|
|
49662
49387
|
async (cursor) => {
|
|
49663
49388
|
if (!fetchDialogs) return;
|
|
49664
49389
|
setIsDialogsLoading(true);
|
|
@@ -49686,7 +49411,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49686
49411
|
},
|
|
49687
49412
|
[fetchDialogs, dialogsPageSize]
|
|
49688
49413
|
);
|
|
49689
|
-
const reloadDialogs =
|
|
49414
|
+
const reloadDialogs = useCallback52(() => {
|
|
49690
49415
|
void loadDialogsPage();
|
|
49691
49416
|
}, [loadDialogsPage]);
|
|
49692
49417
|
useEffect85(() => {
|
|
@@ -49696,7 +49421,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49696
49421
|
initialDialogsLoadedRef.current = true;
|
|
49697
49422
|
void loadDialogsPage();
|
|
49698
49423
|
}, [active, fetchDialogs, loadDialogsPage]);
|
|
49699
|
-
const sendMessage =
|
|
49424
|
+
const sendMessage = useCallback52(
|
|
49700
49425
|
async (text, sendOptions) => {
|
|
49701
49426
|
const hidden = sendOptions?.hidden ?? false;
|
|
49702
49427
|
setMessages((prev) => [
|
|
@@ -49719,7 +49444,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49719
49444
|
},
|
|
49720
49445
|
[publishUserMessage, dialogId]
|
|
49721
49446
|
);
|
|
49722
|
-
const stopMessage =
|
|
49447
|
+
const stopMessage = useCallback52(() => {
|
|
49723
49448
|
setStreamingPhase("idle");
|
|
49724
49449
|
if (stopGenerationCallback && dialogId) {
|
|
49725
49450
|
void stopGenerationCallback(dialogId).catch((err) => {
|
|
@@ -49727,12 +49452,12 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49727
49452
|
});
|
|
49728
49453
|
}
|
|
49729
49454
|
}, [stopGenerationCallback, dialogId]);
|
|
49730
|
-
const clearMessages =
|
|
49455
|
+
const clearMessages = useCallback52(() => {
|
|
49731
49456
|
setMessages([]);
|
|
49732
49457
|
resetAccumulator();
|
|
49733
49458
|
setStreamingPhase("idle");
|
|
49734
49459
|
}, [resetAccumulator]);
|
|
49735
|
-
const selectDialog =
|
|
49460
|
+
const selectDialog = useCallback52(
|
|
49736
49461
|
(id) => {
|
|
49737
49462
|
if (!isManagedMode) {
|
|
49738
49463
|
return;
|
|
@@ -49741,7 +49466,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49741
49466
|
},
|
|
49742
49467
|
[isManagedMode]
|
|
49743
49468
|
);
|
|
49744
|
-
const startNewDialog =
|
|
49469
|
+
const startNewDialog = useCallback52(async () => {
|
|
49745
49470
|
if (!createDialogCallback) return null;
|
|
49746
49471
|
if (isCreatingDialog) return null;
|
|
49747
49472
|
try {
|
|
@@ -49766,7 +49491,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49766
49491
|
setIsCreatingDialog(false);
|
|
49767
49492
|
}
|
|
49768
49493
|
}, [createDialogCallback, isCreatingDialog, isManagedMode]);
|
|
49769
|
-
const deleteDialog =
|
|
49494
|
+
const deleteDialog = useCallback52(
|
|
49770
49495
|
async (id) => {
|
|
49771
49496
|
if (!deleteDialogCallback) return;
|
|
49772
49497
|
try {
|
|
@@ -49781,7 +49506,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49781
49506
|
},
|
|
49782
49507
|
[deleteDialogCallback, internalDialogId, isManagedMode]
|
|
49783
49508
|
);
|
|
49784
|
-
const renameDialog =
|
|
49509
|
+
const renameDialog = useCallback52(
|
|
49785
49510
|
async (id, title) => {
|
|
49786
49511
|
if (!renameDialogCallback) return;
|
|
49787
49512
|
let previous;
|
|
@@ -49805,7 +49530,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49805
49530
|
},
|
|
49806
49531
|
[renameDialogCallback]
|
|
49807
49532
|
);
|
|
49808
|
-
const archiveDialog =
|
|
49533
|
+
const archiveDialog = useCallback52(
|
|
49809
49534
|
async (id) => {
|
|
49810
49535
|
if (!archiveDialogCallback) return;
|
|
49811
49536
|
try {
|
|
@@ -49820,29 +49545,29 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49820
49545
|
},
|
|
49821
49546
|
[archiveDialogCallback, internalDialogId, isManagedMode]
|
|
49822
49547
|
);
|
|
49823
|
-
const loadMoreDialogs =
|
|
49548
|
+
const loadMoreDialogs = useCallback52(async () => {
|
|
49824
49549
|
if (!dialogsNextCursor) return;
|
|
49825
49550
|
await loadDialogsPage(dialogsNextCursor);
|
|
49826
49551
|
}, [dialogsNextCursor, loadDialogsPage]);
|
|
49827
|
-
const loadMoreMessages =
|
|
49552
|
+
const loadMoreMessages = useCallback52(async () => {
|
|
49828
49553
|
if (!dialogId || !messagesNextCursor) return;
|
|
49829
49554
|
await loadDialogHistory(dialogId, messagesNextCursor);
|
|
49830
49555
|
}, [dialogId, messagesNextCursor, loadDialogHistory]);
|
|
49831
|
-
const approveRequest =
|
|
49556
|
+
const approveRequest = useCallback52(
|
|
49832
49557
|
async (requestId) => {
|
|
49833
49558
|
await handleApproveRef.current(requestId);
|
|
49834
49559
|
},
|
|
49835
49560
|
[]
|
|
49836
49561
|
);
|
|
49837
|
-
const rejectRequest =
|
|
49562
|
+
const rejectRequest = useCallback52(
|
|
49838
49563
|
async (requestId, reason) => {
|
|
49839
49564
|
await handleRejectRef.current(requestId, reason);
|
|
49840
49565
|
},
|
|
49841
49566
|
[]
|
|
49842
49567
|
);
|
|
49843
|
-
const discussRef =
|
|
49568
|
+
const discussRef = useCallback52((_ref) => {
|
|
49844
49569
|
}, []);
|
|
49845
|
-
const displayRef =
|
|
49570
|
+
const displayRef = useCallback52((_ref) => {
|
|
49846
49571
|
}, []);
|
|
49847
49572
|
const isLoading = streamingPhase !== "idle";
|
|
49848
49573
|
const hasMoreDialogs = dialogsNextCursor != null;
|
|
@@ -49930,7 +49655,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
49930
49655
|
}
|
|
49931
49656
|
|
|
49932
49657
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
49933
|
-
import { useCallback as
|
|
49658
|
+
import { useCallback as useCallback53, useMemo as useMemo43, useRef as useRef72 } from "react";
|
|
49934
49659
|
var EMPTY_SSE_OPTIONS = {};
|
|
49935
49660
|
function createDisabledNatsConfig() {
|
|
49936
49661
|
return {
|
|
@@ -49961,60 +49686,60 @@ function useUnifiedChat(options) {
|
|
|
49961
49686
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
49962
49687
|
const activeStateRef = useRef72(activeState);
|
|
49963
49688
|
activeStateRef.current = activeState;
|
|
49964
|
-
const stopMessage =
|
|
49965
|
-
const clearMessages =
|
|
49689
|
+
const stopMessage = useCallback53(() => activeStateRef.current.stopMessage(), []);
|
|
49690
|
+
const clearMessages = useCallback53(
|
|
49966
49691
|
() => activeStateRef.current.clearMessages(),
|
|
49967
49692
|
[]
|
|
49968
49693
|
);
|
|
49969
|
-
const sendMessage =
|
|
49694
|
+
const sendMessage = useCallback53(
|
|
49970
49695
|
(text, opts) => activeStateRef.current.sendMessage(text, opts),
|
|
49971
49696
|
[]
|
|
49972
49697
|
);
|
|
49973
|
-
const discussRef =
|
|
49698
|
+
const discussRef = useCallback53(
|
|
49974
49699
|
(ref) => activeStateRef.current.discussRef(ref),
|
|
49975
49700
|
[]
|
|
49976
49701
|
);
|
|
49977
|
-
const displayRef =
|
|
49702
|
+
const displayRef = useCallback53(
|
|
49978
49703
|
(ref) => activeStateRef.current.displayRef(ref),
|
|
49979
49704
|
[]
|
|
49980
49705
|
);
|
|
49981
|
-
const selectDialog =
|
|
49706
|
+
const selectDialog = useCallback53(
|
|
49982
49707
|
(id) => activeStateRef.current.selectDialog(id),
|
|
49983
49708
|
[]
|
|
49984
49709
|
);
|
|
49985
|
-
const startNewDialog =
|
|
49710
|
+
const startNewDialog = useCallback53(
|
|
49986
49711
|
() => activeStateRef.current.startNewDialog(),
|
|
49987
49712
|
[]
|
|
49988
49713
|
);
|
|
49989
|
-
const deleteDialog =
|
|
49714
|
+
const deleteDialog = useCallback53(
|
|
49990
49715
|
(id) => activeStateRef.current.deleteDialog(id),
|
|
49991
49716
|
[]
|
|
49992
49717
|
);
|
|
49993
|
-
const renameDialog =
|
|
49718
|
+
const renameDialog = useCallback53(
|
|
49994
49719
|
(id, title) => activeStateRef.current.renameDialog(id, title),
|
|
49995
49720
|
[]
|
|
49996
49721
|
);
|
|
49997
|
-
const archiveDialog =
|
|
49722
|
+
const archiveDialog = useCallback53(
|
|
49998
49723
|
(id) => activeStateRef.current.archiveDialog(id),
|
|
49999
49724
|
[]
|
|
50000
49725
|
);
|
|
50001
|
-
const loadMoreDialogs =
|
|
49726
|
+
const loadMoreDialogs = useCallback53(
|
|
50002
49727
|
() => activeStateRef.current.loadMoreDialogs(),
|
|
50003
49728
|
[]
|
|
50004
49729
|
);
|
|
50005
|
-
const reloadDialogs =
|
|
49730
|
+
const reloadDialogs = useCallback53(
|
|
50006
49731
|
() => activeStateRef.current.reloadDialogs(),
|
|
50007
49732
|
[]
|
|
50008
49733
|
);
|
|
50009
|
-
const loadMoreMessages =
|
|
49734
|
+
const loadMoreMessages = useCallback53(
|
|
50010
49735
|
() => activeStateRef.current.loadMoreMessages(),
|
|
50011
49736
|
[]
|
|
50012
49737
|
);
|
|
50013
|
-
const approveRequest =
|
|
49738
|
+
const approveRequest = useCallback53(
|
|
50014
49739
|
(requestId) => activeStateRef.current.approveRequest(requestId),
|
|
50015
49740
|
[]
|
|
50016
49741
|
);
|
|
50017
|
-
const rejectRequest =
|
|
49742
|
+
const rejectRequest = useCallback53(
|
|
50018
49743
|
(requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
|
|
50019
49744
|
[]
|
|
50020
49745
|
);
|
|
@@ -50269,7 +49994,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
|
|
|
50269
49994
|
}
|
|
50270
49995
|
|
|
50271
49996
|
// src/components/chat/embeddable-chat.tsx
|
|
50272
|
-
import { useCallback as
|
|
49997
|
+
import { useCallback as useCallback55, useEffect as useEffect86, useMemo as useMemo45, useRef as useRef73, useState as useState115 } from "react";
|
|
50273
49998
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
50274
49999
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
50275
50000
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -50350,7 +50075,7 @@ init_button2();
|
|
|
50350
50075
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
50351
50076
|
|
|
50352
50077
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
50353
|
-
import { useCallback as
|
|
50078
|
+
import { useCallback as useCallback54, useMemo as useMemo44, useState as useState114 } from "react";
|
|
50354
50079
|
function useChatDialogManager({
|
|
50355
50080
|
dialogs,
|
|
50356
50081
|
activeDialogId,
|
|
@@ -50363,14 +50088,14 @@ function useChatDialogManager({
|
|
|
50363
50088
|
}) {
|
|
50364
50089
|
const [renameTarget, setRenameTarget] = useState114(null);
|
|
50365
50090
|
const [archiveTarget, setArchiveTarget] = useState114(null);
|
|
50366
|
-
const handleConfirmRename =
|
|
50091
|
+
const handleConfirmRename = useCallback54(
|
|
50367
50092
|
(name) => {
|
|
50368
50093
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
50369
50094
|
setRenameTarget(null);
|
|
50370
50095
|
},
|
|
50371
50096
|
[renameTarget, renameDialog]
|
|
50372
50097
|
);
|
|
50373
|
-
const handleConfirmArchive =
|
|
50098
|
+
const handleConfirmArchive = useCallback54(async () => {
|
|
50374
50099
|
if (archiveTarget) {
|
|
50375
50100
|
try {
|
|
50376
50101
|
await archiveDialog(archiveTarget.id);
|
|
@@ -50389,7 +50114,7 @@ function useChatDialogManager({
|
|
|
50389
50114
|
const [archivedDialogs, setArchivedDialogs] = useState114([]);
|
|
50390
50115
|
const [archivedCursor, setArchivedCursor] = useState114(null);
|
|
50391
50116
|
const [archivedLoading, setArchivedLoading] = useState114(false);
|
|
50392
|
-
const loadArchivedPage =
|
|
50117
|
+
const loadArchivedPage = useCallback54(
|
|
50393
50118
|
async (cursor) => {
|
|
50394
50119
|
if (!fetchArchivedDialogs) return;
|
|
50395
50120
|
setArchivedLoading(true);
|
|
@@ -50407,18 +50132,18 @@ function useChatDialogManager({
|
|
|
50407
50132
|
},
|
|
50408
50133
|
[fetchArchivedDialogs]
|
|
50409
50134
|
);
|
|
50410
|
-
const openArchive =
|
|
50135
|
+
const openArchive = useCallback54(() => {
|
|
50411
50136
|
setArchiveOpen(true);
|
|
50412
50137
|
setArchivedDialogs([]);
|
|
50413
50138
|
setArchivedCursor(null);
|
|
50414
50139
|
void loadArchivedPage();
|
|
50415
50140
|
}, [loadArchivedPage]);
|
|
50416
|
-
const closeArchive =
|
|
50141
|
+
const closeArchive = useCallback54(() => setArchiveOpen(false), []);
|
|
50417
50142
|
const [viewingArchivedId, setViewingArchivedId] = useState114(
|
|
50418
50143
|
null
|
|
50419
50144
|
);
|
|
50420
50145
|
const [openingDialogId, setOpeningDialogId] = useState114(null);
|
|
50421
|
-
const handleSelectDialog =
|
|
50146
|
+
const handleSelectDialog = useCallback54(
|
|
50422
50147
|
(id) => {
|
|
50423
50148
|
setViewingArchivedId(null);
|
|
50424
50149
|
setOpeningDialogId(id);
|
|
@@ -50427,7 +50152,7 @@ function useChatDialogManager({
|
|
|
50427
50152
|
[selectDialog]
|
|
50428
50153
|
);
|
|
50429
50154
|
const isOpeningDialog = openingDialogId != null && openingDialogId === activeDialogId;
|
|
50430
|
-
const handleArchivedSelect =
|
|
50155
|
+
const handleArchivedSelect = useCallback54(
|
|
50431
50156
|
(id) => {
|
|
50432
50157
|
setArchiveOpen(false);
|
|
50433
50158
|
setOpeningDialogId(null);
|
|
@@ -50437,7 +50162,7 @@ function useChatDialogManager({
|
|
|
50437
50162
|
[selectDialog]
|
|
50438
50163
|
);
|
|
50439
50164
|
const [restoreTarget, setRestoreTarget] = useState114(null);
|
|
50440
|
-
const handleConfirmRestore =
|
|
50165
|
+
const handleConfirmRestore = useCallback54(async () => {
|
|
50441
50166
|
if (restoreTarget) {
|
|
50442
50167
|
try {
|
|
50443
50168
|
await unarchiveDialog?.(restoreTarget.id);
|
|
@@ -50451,7 +50176,7 @@ function useChatDialogManager({
|
|
|
50451
50176
|
setRestoreTarget(null);
|
|
50452
50177
|
}, [restoreTarget, unarchiveDialog]);
|
|
50453
50178
|
const isViewingArchived = viewingArchivedId != null && viewingArchivedId === activeDialogId;
|
|
50454
|
-
const handleBack =
|
|
50179
|
+
const handleBack = useCallback54(() => {
|
|
50455
50180
|
const wasArchived = isViewingArchived;
|
|
50456
50181
|
setViewingArchivedId(null);
|
|
50457
50182
|
setOpeningDialogId(null);
|
|
@@ -50887,7 +50612,7 @@ function EmbeddableChatInner({
|
|
|
50887
50612
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
50888
50613
|
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState115(initialActiveMode);
|
|
50889
50614
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
50890
|
-
const handleActiveModeChange =
|
|
50615
|
+
const handleActiveModeChange = useCallback55(
|
|
50891
50616
|
(next) => {
|
|
50892
50617
|
if (controlledActiveMode === void 0) {
|
|
50893
50618
|
setUncontrolledActiveMode(next);
|
|
@@ -50991,7 +50716,7 @@ function EmbeddableChatInner({
|
|
|
50991
50716
|
for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
|
|
50992
50717
|
return (item) => byType.get(item.type);
|
|
50993
50718
|
}, [contextEntityTypes]);
|
|
50994
|
-
const toggleContextItem =
|
|
50719
|
+
const toggleContextItem = useCallback55(
|
|
50995
50720
|
(item) => {
|
|
50996
50721
|
const key = `${item.type}:${item.id}`;
|
|
50997
50722
|
if (mentionActiveRef.current) {
|
|
@@ -51014,7 +50739,7 @@ function EmbeddableChatInner({
|
|
|
51014
50739
|
},
|
|
51015
50740
|
[contextMaxItems, contextItems, mentionMarkerByType, resolveContextIcon]
|
|
51016
50741
|
);
|
|
51017
|
-
const removeContextItem =
|
|
50742
|
+
const removeContextItem = useCallback55((item) => {
|
|
51018
50743
|
const key = `${item.type}:${item.id}`;
|
|
51019
50744
|
setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
|
|
51020
50745
|
if (mentionKeysRef.current.has(key)) {
|
|
@@ -51024,7 +50749,7 @@ function EmbeddableChatInner({
|
|
|
51024
50749
|
chatInputRef.current?.setValue(next);
|
|
51025
50750
|
}
|
|
51026
50751
|
}, [mentionMarkerByType]);
|
|
51027
|
-
const handleContextValueChange =
|
|
50752
|
+
const handleContextValueChange = useCallback55((value) => {
|
|
51028
50753
|
for (const key of Array.from(mentionKeysRef.current)) {
|
|
51029
50754
|
if (!value.includes(`@${mentionTokenOf(key, mentionMarkerByType)}`)) {
|
|
51030
50755
|
mentionKeysRef.current.delete(key);
|
|
@@ -51032,24 +50757,24 @@ function EmbeddableChatInner({
|
|
|
51032
50757
|
}
|
|
51033
50758
|
}
|
|
51034
50759
|
}, [mentionMarkerByType]);
|
|
51035
|
-
const openContextPicker =
|
|
50760
|
+
const openContextPicker = useCallback55(() => {
|
|
51036
50761
|
setMentionQuery(null);
|
|
51037
50762
|
setContextPickerOpen(true);
|
|
51038
50763
|
}, []);
|
|
51039
|
-
const closeContextPicker =
|
|
50764
|
+
const closeContextPicker = useCallback55(() => {
|
|
51040
50765
|
if (mentionActiveRef.current) {
|
|
51041
50766
|
chatInputRef.current?.removeMentionTrigger();
|
|
51042
50767
|
}
|
|
51043
50768
|
setContextPickerOpen(false);
|
|
51044
50769
|
setMentionQuery(null);
|
|
51045
50770
|
}, []);
|
|
51046
|
-
const handleMentionQueryChange =
|
|
50771
|
+
const handleMentionQueryChange = useCallback55((query) => {
|
|
51047
50772
|
setMentionQuery(query);
|
|
51048
50773
|
setContextPickerOpen(query !== null);
|
|
51049
50774
|
}, []);
|
|
51050
50775
|
const resolvedBaseRoute = baseRoute || (source === "flamingo" ? "/knowledge-base" : "/data-room");
|
|
51051
|
-
const handleClose =
|
|
51052
|
-
const handleNavigationClose =
|
|
50776
|
+
const handleClose = useCallback55(() => setIsOpen(false), [setIsOpen]);
|
|
50777
|
+
const handleNavigationClose = useCallback55(() => {
|
|
51053
50778
|
navigatingAwayRef.current = true;
|
|
51054
50779
|
setIsOpen(false);
|
|
51055
50780
|
}, [setIsOpen]);
|
|
@@ -51057,7 +50782,7 @@ function EmbeddableChatInner({
|
|
|
51057
50782
|
() => ({ closeChat: handleNavigationClose }),
|
|
51058
50783
|
[handleNavigationClose]
|
|
51059
50784
|
);
|
|
51060
|
-
const renderEntityCard =
|
|
50785
|
+
const renderEntityCard = useCallback55(
|
|
51061
50786
|
(reference) => renderChatInlineEntityCard(reference, {
|
|
51062
50787
|
onDiscuss: discussRef,
|
|
51063
50788
|
onDisplay: displayRef,
|
|
@@ -51114,7 +50839,7 @@ function EmbeddableChatInner({
|
|
|
51114
50839
|
}
|
|
51115
50840
|
return mapped;
|
|
51116
50841
|
}, [rawMessages, guideUserName, guideUserAvatar]);
|
|
51117
|
-
const handleSend =
|
|
50842
|
+
const handleSend = useCallback55(
|
|
51118
50843
|
(text) => {
|
|
51119
50844
|
let augmentedText = text;
|
|
51120
50845
|
if (readyAttachments.length > 0) {
|
|
@@ -51194,7 +50919,7 @@ function EmbeddableChatInner({
|
|
|
51194
50919
|
fetchArchivedDialogs: mingoCaps.fetchArchivedDialogs,
|
|
51195
50920
|
unarchiveDialog: mingoCaps.unarchiveDialog
|
|
51196
50921
|
});
|
|
51197
|
-
const handleOpen =
|
|
50922
|
+
const handleOpen = useCallback55(() => setIsOpen(true), [setIsOpen]);
|
|
51198
50923
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
51199
50924
|
useEffect86(() => {
|
|
51200
50925
|
const handler = (e) => {
|
|
@@ -51992,7 +51717,6 @@ export {
|
|
|
51992
51717
|
SECTION_HEADING_CLASS,
|
|
51993
51718
|
PageHeading,
|
|
51994
51719
|
VideoBitesStrip,
|
|
51995
|
-
VideoBiteCard,
|
|
51996
51720
|
EntityVideoSection,
|
|
51997
51721
|
ChatVideoEntityCard,
|
|
51998
51722
|
ProductReleaseCard,
|
|
@@ -52531,4 +52255,4 @@ export {
|
|
|
52531
52255
|
LogsList,
|
|
52532
52256
|
assets
|
|
52533
52257
|
};
|
|
52534
|
-
//# sourceMappingURL=chunk-
|
|
52258
|
+
//# sourceMappingURL=chunk-VCRUAKOJ.js.map
|