@flamingo-stack/openframe-frontend-core 0.0.340 → 0.0.341-snapshot.20260630022404
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-4K2M2WC4.cjs → chunk-2L6PCJGJ.cjs} +26 -26
- package/dist/{chunk-4K2M2WC4.cjs.map → chunk-2L6PCJGJ.cjs.map} +1 -1
- package/dist/{chunk-TVCBMR3N.cjs → chunk-3GNUN3UF.cjs} +7 -7
- package/dist/{chunk-TVCBMR3N.cjs.map → chunk-3GNUN3UF.cjs.map} +1 -1
- package/dist/{chunk-7TENQYAJ.js → chunk-6DKQW5OB.js} +2 -2
- package/dist/{chunk-53MGSWCC.js → chunk-D6OFQCBQ.js} +4 -4
- package/dist/{chunk-DRO773DG.cjs → chunk-EEAUFJOJ.cjs} +56 -56
- package/dist/{chunk-DRO773DG.cjs.map → chunk-EEAUFJOJ.cjs.map} +1 -1
- package/dist/{chunk-MNLQMAY3.js → chunk-G5BJ5EJ3.js} +2 -2
- package/dist/{chunk-KE2PMD6A.js → chunk-GGHWEV6K.js} +2 -2
- package/dist/{chunk-SIK5LBUN.cjs → chunk-HHEN6U6D.cjs} +25 -25
- package/dist/{chunk-SIK5LBUN.cjs.map → chunk-HHEN6U6D.cjs.map} +1 -1
- package/dist/{chunk-YEB5Z76W.cjs → chunk-K4NVJM6V.cjs} +62 -62
- package/dist/{chunk-YEB5Z76W.cjs.map → chunk-K4NVJM6V.cjs.map} +1 -1
- package/dist/{chunk-OVN265XQ.js → chunk-KDFQXI6L.js} +2 -2
- package/dist/{chunk-NDHQG4I4.js → chunk-M4JER3ZJ.js} +227 -173
- package/dist/chunk-M4JER3ZJ.js.map +1 -0
- package/dist/{chunk-EXFHHZ2C.cjs → chunk-MGYDI2R4.cjs} +9 -9
- package/dist/{chunk-EXFHHZ2C.cjs.map → chunk-MGYDI2R4.cjs.map} +1 -1
- package/dist/{chunk-W7J46YKF.js → chunk-MQXK5YZJ.js} +2 -2
- package/dist/{chunk-HVYR323G.cjs → chunk-NBZR5OEQ.cjs} +15 -15
- package/dist/{chunk-HVYR323G.cjs.map → chunk-NBZR5OEQ.cjs.map} +1 -1
- package/dist/{chunk-BMSJTLGO.cjs → chunk-NLJUVRVX.cjs} +12 -12
- package/dist/{chunk-BMSJTLGO.cjs.map → chunk-NLJUVRVX.cjs.map} +1 -1
- package/dist/{chunk-ERMMMQET.cjs → chunk-NRRBPW33.cjs} +388 -334
- package/dist/chunk-NRRBPW33.cjs.map +1 -0
- package/dist/{chunk-DFFOCQFO.cjs → chunk-NXDUUG3E.cjs} +5 -5
- package/dist/{chunk-DFFOCQFO.cjs.map → chunk-NXDUUG3E.cjs.map} +1 -1
- package/dist/{chunk-L6YX6D26.cjs → chunk-PRVRFN5Y.cjs} +31 -31
- package/dist/{chunk-L6YX6D26.cjs.map → chunk-PRVRFN5Y.cjs.map} +1 -1
- package/dist/{chunk-NC3DJLP5.js → chunk-SSWHDTUV.js} +4 -4
- package/dist/{chunk-573LTCRV.js → chunk-TV3BIALE.js} +2 -2
- package/dist/{chunk-TOMTBXM7.js → chunk-VVKLQXWF.js} +2 -2
- package/dist/{chunk-GGFJ5OQ3.js → chunk-VZM3OH26.js} +4 -4
- package/dist/{chunk-VA3GDVOV.cjs → chunk-YHHGM3EL.cjs} +37 -37
- package/dist/{chunk-VA3GDVOV.cjs.map → chunk-YHHGM3EL.cjs.map} +1 -1
- package/dist/{chunk-T4SW6GOR.js → chunk-YHXX7WEL.js} +4 -4
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/chat-composer.d.ts +4 -1
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-quick-action-row.d.ts +6 -1
- package/dist/components/chat/chat-quick-action-row.d.ts.map +1 -1
- package/dist/components/chat/guide-welcome.d.ts +5 -5
- package/dist/components/chat/guide-welcome.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/types/component.types.d.ts +6 -0
- package/dist/components/chat/types/component.types.d.ts.map +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 -2
- package/dist/components/features/index.js +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 +121 -121
- package/dist/components/index.js +9 -9
- 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/components/ui/table/table-row.d.ts +1 -1
- package/dist/components/ui/table/table-row.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/table/types.d.ts +16 -0
- package/dist/components/ui/table/types.d.ts.map +1 -1
- package/dist/components/ui/table/use-table-motion.d.ts +20 -0
- package/dist/components/ui/table/use-table-motion.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/chat/chat-composer.tsx +5 -0
- package/src/components/chat/chat-input.tsx +39 -1
- package/src/components/chat/chat-quick-action-row.tsx +20 -0
- package/src/components/chat/embeddable-chat.tsx +21 -23
- package/src/components/chat/guide-welcome.tsx +21 -11
- package/src/components/chat/types/component.types.ts +6 -0
- package/src/components/ui/table/table-row.tsx +16 -3
- package/src/components/ui/table/table.tsx +34 -15
- package/src/components/ui/table/types.ts +17 -0
- package/src/components/ui/table/use-table-motion.ts +48 -0
- package/dist/chunk-ERMMMQET.cjs.map +0 -1
- package/dist/chunk-NDHQG4I4.js.map +0 -1
- /package/dist/{chunk-7TENQYAJ.js.map → chunk-6DKQW5OB.js.map} +0 -0
- /package/dist/{chunk-53MGSWCC.js.map → chunk-D6OFQCBQ.js.map} +0 -0
- /package/dist/{chunk-MNLQMAY3.js.map → chunk-G5BJ5EJ3.js.map} +0 -0
- /package/dist/{chunk-KE2PMD6A.js.map → chunk-GGHWEV6K.js.map} +0 -0
- /package/dist/{chunk-OVN265XQ.js.map → chunk-KDFQXI6L.js.map} +0 -0
- /package/dist/{chunk-W7J46YKF.js.map → chunk-MQXK5YZJ.js.map} +0 -0
- /package/dist/{chunk-NC3DJLP5.js.map → chunk-SSWHDTUV.js.map} +0 -0
- /package/dist/{chunk-573LTCRV.js.map → chunk-TV3BIALE.js.map} +0 -0
- /package/dist/{chunk-TOMTBXM7.js.map → chunk-VVKLQXWF.js.map} +0 -0
- /package/dist/{chunk-GGFJ5OQ3.js.map → chunk-VZM3OH26.js.map} +0 -0
- /package/dist/{chunk-T4SW6GOR.js.map → chunk-YHXX7WEL.js.map} +0 -0
|
@@ -3730,13 +3730,15 @@ var ChatInput = forwardRef9((allProps, ref) => {
|
|
|
3730
3730
|
onMentionQueryChange,
|
|
3731
3731
|
onValueChange,
|
|
3732
3732
|
startIcon,
|
|
3733
|
-
hideBorder
|
|
3733
|
+
hideBorder,
|
|
3734
|
+
previewText
|
|
3734
3735
|
// Remaining textarea-only attrs are intentionally dropped — the editor is a
|
|
3735
3736
|
// contenteditable div, not a <textarea>, so spreading them would warn.
|
|
3736
3737
|
} = rest;
|
|
3737
3738
|
const [value, setValue] = useState8("");
|
|
3738
3739
|
const [focused, setFocused] = useState8(false);
|
|
3739
3740
|
const [isStopping, setIsStopping] = useState8(false);
|
|
3741
|
+
const [previewDismissed, setPreviewDismissed] = useState8(false);
|
|
3740
3742
|
const editorRef = useRef4(null);
|
|
3741
3743
|
const shouldRefocusRef = useRef4(false);
|
|
3742
3744
|
const prevSendingRef = useRef4(sending);
|
|
@@ -3755,6 +3757,12 @@ var ChatInput = forwardRef9((allProps, ref) => {
|
|
|
3755
3757
|
useEffect4(() => {
|
|
3756
3758
|
onValueChange?.(value);
|
|
3757
3759
|
}, [value, onValueChange]);
|
|
3760
|
+
useEffect4(() => {
|
|
3761
|
+
setPreviewDismissed(false);
|
|
3762
|
+
}, [previewText]);
|
|
3763
|
+
useEffect4(() => {
|
|
3764
|
+
if (previewText) setPreviewDismissed(true);
|
|
3765
|
+
}, [value]);
|
|
3758
3766
|
const applyValue = useCallback4((next, caret = "end") => {
|
|
3759
3767
|
const el = editorRef.current;
|
|
3760
3768
|
if (el) {
|
|
@@ -3977,6 +3985,7 @@ var ChatInput = forwardRef9((allProps, ref) => {
|
|
|
3977
3985
|
const sendDisabled = sending || disabled || !hasContent;
|
|
3978
3986
|
const isEmpty = value.length === 0;
|
|
3979
3987
|
const isDisabled = sending || disabled;
|
|
3988
|
+
const showPreview = !isDisabled && !!previewText && !previewDismissed;
|
|
3980
3989
|
return /* @__PURE__ */ jsx20(
|
|
3981
3990
|
"div",
|
|
3982
3991
|
{
|
|
@@ -4025,7 +4034,8 @@ var ChatInput = forwardRef9((allProps, ref) => {
|
|
|
4025
4034
|
children: [
|
|
4026
4035
|
startIcon && /* @__PURE__ */ jsx20("span", { className: "flex h-6 shrink-0 items-center", children: startIcon }),
|
|
4027
4036
|
/* @__PURE__ */ jsxs16("div", { className: "relative flex-1 min-w-0", children: [
|
|
4028
|
-
isEmpty && /* @__PURE__ */ jsx20("span", { className: "pointer-events-none absolute left-0 top-0 select-none text-h4 !leading-9 text-ods-text-secondary", children: disabled ? "Connection lost. Waiting to reconnect..." : placeholder }),
|
|
4037
|
+
isEmpty && !showPreview && /* @__PURE__ */ jsx20("span", { className: "pointer-events-none absolute left-0 top-0 select-none text-h4 !leading-9 text-ods-text-secondary", children: disabled ? "Connection lost. Waiting to reconnect..." : placeholder }),
|
|
4038
|
+
showPreview && /* @__PURE__ */ jsx20("p", { className: "pointer-events-none m-0 select-none whitespace-pre-wrap break-words text-h4 !leading-9 text-ods-text-secondary", children: previewText }),
|
|
4029
4039
|
/* @__PURE__ */ jsx20(
|
|
4030
4040
|
"div",
|
|
4031
4041
|
{
|
|
@@ -4052,6 +4062,9 @@ var ChatInput = forwardRef9((allProps, ref) => {
|
|
|
4052
4062
|
onBlur: () => setFocused(false),
|
|
4053
4063
|
className: cn(
|
|
4054
4064
|
"max-h-[160px] overflow-y-auto whitespace-pre-wrap break-words outline-none",
|
|
4065
|
+
// While a ghost preview shows, the editor is empty — collapse it
|
|
4066
|
+
// out of flow + transparent so the in-flow preview drives height.
|
|
4067
|
+
showPreview && "absolute inset-0 opacity-0",
|
|
4055
4068
|
// `leading-9` (36px) sits just above the 32px chip's line-box need
|
|
4056
4069
|
// (~35.5px incl. vertical-align overhead): the LINE drives row
|
|
4057
4070
|
// height (deterministic 48px, no overflow) AND the near-zero slack
|
|
@@ -5684,6 +5697,7 @@ function ChipButton({ chip }) {
|
|
|
5684
5697
|
function ChatQuickActionRow({
|
|
5685
5698
|
leading,
|
|
5686
5699
|
chips,
|
|
5700
|
+
wrap = false,
|
|
5687
5701
|
className
|
|
5688
5702
|
}) {
|
|
5689
5703
|
const auto = useAutoLimitTags({
|
|
@@ -5693,6 +5707,12 @@ function ChatQuickActionRow({
|
|
|
5693
5707
|
const visibleChips = chips.slice(0, auto.visibleCount);
|
|
5694
5708
|
const hiddenChips = chips.slice(auto.visibleCount);
|
|
5695
5709
|
if (!leading && chips.length === 0) return null;
|
|
5710
|
+
if (wrap) {
|
|
5711
|
+
return /* @__PURE__ */ jsxs26("div", { className: cn("flex shrink-0 flex-wrap items-center gap-1", className), children: [
|
|
5712
|
+
leading,
|
|
5713
|
+
chips.map((chip) => /* @__PURE__ */ jsx30(ChipButton, { chip }, chip.id))
|
|
5714
|
+
] });
|
|
5715
|
+
}
|
|
5696
5716
|
return /* @__PURE__ */ jsxs26(
|
|
5697
5717
|
"div",
|
|
5698
5718
|
{
|
|
@@ -6677,7 +6697,14 @@ function GuideWelcome({
|
|
|
6677
6697
|
}
|
|
6678
6698
|
)
|
|
6679
6699
|
] }),
|
|
6680
|
-
quickActions.length > 0 && /* @__PURE__ */ jsx36(
|
|
6700
|
+
quickActions.length > 0 && /* @__PURE__ */ jsx36(
|
|
6701
|
+
ChatQuickActionRow,
|
|
6702
|
+
{
|
|
6703
|
+
wrap: true,
|
|
6704
|
+
chips: chipItems,
|
|
6705
|
+
className: "max-h-28 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-ods-border/30"
|
|
6706
|
+
}
|
|
6707
|
+
)
|
|
6681
6708
|
]
|
|
6682
6709
|
}
|
|
6683
6710
|
);
|
|
@@ -7678,7 +7705,8 @@ function ChatComposer({
|
|
|
7678
7705
|
onCloseContextPicker,
|
|
7679
7706
|
mentionQuery = null,
|
|
7680
7707
|
onMentionQueryChange,
|
|
7681
|
-
onValueChange
|
|
7708
|
+
onValueChange,
|
|
7709
|
+
previewText
|
|
7682
7710
|
}) {
|
|
7683
7711
|
const contextEnabled = !!contextPicker && !archived;
|
|
7684
7712
|
const selected = selectedContextItems ?? [];
|
|
@@ -7700,6 +7728,7 @@ function ChatComposer({
|
|
|
7700
7728
|
onStop,
|
|
7701
7729
|
sending,
|
|
7702
7730
|
placeholder,
|
|
7731
|
+
previewText,
|
|
7703
7732
|
fullWidth: true,
|
|
7704
7733
|
className: "px-0",
|
|
7705
7734
|
reserveAvatarOffset: false,
|
|
@@ -10985,7 +11014,7 @@ function OnboardingGuideCard({
|
|
|
10985
11014
|
}
|
|
10986
11015
|
|
|
10987
11016
|
// src/components/chat/entity-cards/roadmap-card.tsx
|
|
10988
|
-
import { useState as
|
|
11017
|
+
import { useState as useState98 } from "react";
|
|
10989
11018
|
import { ThumbsUp, ThumbsDown } from "lucide-react";
|
|
10990
11019
|
|
|
10991
11020
|
// src/components/chat/entity-cards/roadmap-vote-button.tsx
|
|
@@ -11026,7 +11055,7 @@ function RoadmapVoteButton({
|
|
|
11026
11055
|
init_button();
|
|
11027
11056
|
|
|
11028
11057
|
// src/components/ui/image-gallery-modal.tsx
|
|
11029
|
-
import { useState as
|
|
11058
|
+
import { useState as useState97, useEffect as useEffect74 } from "react";
|
|
11030
11059
|
|
|
11031
11060
|
// src/components/ui/allowed-domains-input.tsx
|
|
11032
11061
|
init_cn();
|
|
@@ -35140,7 +35169,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx274(ContentLoader, { ...props, va
|
|
|
35140
35169
|
|
|
35141
35170
|
// src/components/ui/table/table.tsx
|
|
35142
35171
|
init_cn();
|
|
35143
|
-
import { useEffect as
|
|
35172
|
+
import { useEffect as useEffect67, useRef as useRef48 } from "react";
|
|
35144
35173
|
init_pagination();
|
|
35145
35174
|
init_button2();
|
|
35146
35175
|
|
|
@@ -35653,9 +35682,14 @@ function TableRow({
|
|
|
35653
35682
|
compact,
|
|
35654
35683
|
selectable,
|
|
35655
35684
|
selected,
|
|
35656
|
-
onSelect
|
|
35685
|
+
onSelect,
|
|
35686
|
+
animateRowReorder,
|
|
35687
|
+
motionDiv
|
|
35657
35688
|
}) {
|
|
35658
35689
|
const isLinkMode = Boolean(href) && !onClick;
|
|
35690
|
+
const animate = Boolean(animateRowReorder && motionDiv);
|
|
35691
|
+
const Row = animate ? motionDiv : "div";
|
|
35692
|
+
const motionProps = animate ? { layout: "position", transition: { layout: { duration: 0.35, ease: [0.22, 1, 0.36, 1] } } } : {};
|
|
35659
35693
|
const handleRowClick = (e) => {
|
|
35660
35694
|
const target = e.target;
|
|
35661
35695
|
if (target.closest("[data-no-row-click]")) {
|
|
@@ -35691,8 +35725,9 @@ function TableRow({
|
|
|
35691
35725
|
return String(value);
|
|
35692
35726
|
};
|
|
35693
35727
|
return /* @__PURE__ */ jsxs226(
|
|
35694
|
-
|
|
35728
|
+
Row,
|
|
35695
35729
|
{
|
|
35730
|
+
...motionProps,
|
|
35696
35731
|
className: cn(
|
|
35697
35732
|
"relative rounded-[6px] bg-ods-card border border-ods-border overflow-hidden",
|
|
35698
35733
|
(onClick || isLinkMode) && "cursor-pointer hover:bg-ods-bg-active transition-colors",
|
|
@@ -35744,6 +35779,24 @@ function TableRow({
|
|
|
35744
35779
|
);
|
|
35745
35780
|
}
|
|
35746
35781
|
|
|
35782
|
+
// src/components/ui/table/use-table-motion.ts
|
|
35783
|
+
import { useEffect as useEffect66, useState as useState85 } from "react";
|
|
35784
|
+
function useTableMotion(enabled) {
|
|
35785
|
+
const [runtime, setRuntime] = useState85(null);
|
|
35786
|
+
useEffect66(() => {
|
|
35787
|
+
if (!enabled || runtime) return;
|
|
35788
|
+
let active = true;
|
|
35789
|
+
import("framer-motion").then((m) => {
|
|
35790
|
+
if (active) setRuntime({ motionDiv: m.motion.div, LayoutGroup: m.LayoutGroup });
|
|
35791
|
+
}).catch(() => {
|
|
35792
|
+
});
|
|
35793
|
+
return () => {
|
|
35794
|
+
active = false;
|
|
35795
|
+
};
|
|
35796
|
+
}, [enabled, runtime]);
|
|
35797
|
+
return enabled ? runtime : null;
|
|
35798
|
+
}
|
|
35799
|
+
|
|
35747
35800
|
// src/components/ui/table/table.tsx
|
|
35748
35801
|
import { Fragment as Fragment50, jsx as jsx283, jsxs as jsxs227 } from "react/jsx-runtime";
|
|
35749
35802
|
function injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref) {
|
|
@@ -35829,8 +35882,10 @@ function Table({
|
|
|
35829
35882
|
paginationClassName,
|
|
35830
35883
|
infiniteScroll,
|
|
35831
35884
|
stickyHeader,
|
|
35832
|
-
stickyHeaderOffset
|
|
35885
|
+
stickyHeaderOffset,
|
|
35886
|
+
animateRowReorder
|
|
35833
35887
|
}) {
|
|
35888
|
+
const tableMotion = useTableMotion(Boolean(animateRowReorder));
|
|
35834
35889
|
const columnsWithActions = injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref);
|
|
35835
35890
|
const getRowHref = (item) => {
|
|
35836
35891
|
if (onRowClick || !rowHref) return void 0;
|
|
@@ -35877,7 +35932,7 @@ function Table({
|
|
|
35877
35932
|
const sentinelRef = useRef48(null);
|
|
35878
35933
|
const onLoadMoreRef = useRef48(infiniteScroll?.onLoadMore);
|
|
35879
35934
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
35880
|
-
|
|
35935
|
+
useEffect67(() => {
|
|
35881
35936
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
35882
35937
|
const sentinel = sentinelRef.current;
|
|
35883
35938
|
if (!sentinel) return;
|
|
@@ -35946,22 +36001,28 @@ function Table({
|
|
|
35946
36001
|
hasChevron: Boolean(rowHref)
|
|
35947
36002
|
}
|
|
35948
36003
|
) : data.length === 0 ? /* @__PURE__ */ jsx283(TableEmptyState, { message: emptyMessage }) : /* @__PURE__ */ jsxs227(Fragment50, { children: [
|
|
35949
|
-
|
|
35950
|
-
|
|
35951
|
-
|
|
35952
|
-
|
|
35953
|
-
|
|
35954
|
-
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
35958
|
-
|
|
35959
|
-
|
|
35960
|
-
|
|
35961
|
-
|
|
35962
|
-
|
|
35963
|
-
|
|
35964
|
-
|
|
36004
|
+
(() => {
|
|
36005
|
+
const rows = data.map((item, index) => /* @__PURE__ */ jsx283(
|
|
36006
|
+
TableRow,
|
|
36007
|
+
{
|
|
36008
|
+
item,
|
|
36009
|
+
columns: columnsWithActions,
|
|
36010
|
+
onClick: onRowClick,
|
|
36011
|
+
href: getRowHref(item),
|
|
36012
|
+
className: getRowClassName(item, index),
|
|
36013
|
+
index,
|
|
36014
|
+
compact,
|
|
36015
|
+
selectable,
|
|
36016
|
+
selected: isRowSelected(item),
|
|
36017
|
+
onSelect: handleSelectRow,
|
|
36018
|
+
animateRowReorder,
|
|
36019
|
+
motionDiv: tableMotion?.motionDiv
|
|
36020
|
+
},
|
|
36021
|
+
getRowKey(item, index)
|
|
36022
|
+
));
|
|
36023
|
+
const LayoutGroup = tableMotion?.LayoutGroup;
|
|
36024
|
+
return animateRowReorder && LayoutGroup ? /* @__PURE__ */ jsx283(LayoutGroup, { children: rows }) : rows;
|
|
36025
|
+
})(),
|
|
35965
36026
|
infiniteScroll?.isFetchingNextPage && /* @__PURE__ */ jsx283(
|
|
35966
36027
|
TableCardSkeleton,
|
|
35967
36028
|
{
|
|
@@ -36089,7 +36150,7 @@ import { useMemo as useMemo34 } from "react";
|
|
|
36089
36150
|
|
|
36090
36151
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
36091
36152
|
init_cn();
|
|
36092
|
-
import { useRef as useRef49, useState as
|
|
36153
|
+
import { useRef as useRef49, useState as useState86, useCallback as useCallback38 } from "react";
|
|
36093
36154
|
import { jsx as jsx286, jsxs as jsxs229 } from "react/jsx-runtime";
|
|
36094
36155
|
function QueryReportTableHeader({
|
|
36095
36156
|
columns,
|
|
@@ -36119,7 +36180,7 @@ function QueryReportTableHeader({
|
|
|
36119
36180
|
}
|
|
36120
36181
|
function TruncatedHeaderCell({ value, width }) {
|
|
36121
36182
|
const textRef = useRef49(null);
|
|
36122
|
-
const [isTruncated, setIsTruncated] =
|
|
36183
|
+
const [isTruncated, setIsTruncated] = useState86(false);
|
|
36123
36184
|
const checkTruncation = useCallback38(() => {
|
|
36124
36185
|
const el = textRef.current;
|
|
36125
36186
|
if (el) {
|
|
@@ -36148,7 +36209,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
36148
36209
|
|
|
36149
36210
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
36150
36211
|
init_cn();
|
|
36151
|
-
import { useRef as useRef50, useState as
|
|
36212
|
+
import { useRef as useRef50, useState as useState87, useCallback as useCallback39 } from "react";
|
|
36152
36213
|
import { jsx as jsx287, jsxs as jsxs230 } from "react/jsx-runtime";
|
|
36153
36214
|
function QueryReportTableRow({
|
|
36154
36215
|
row,
|
|
@@ -36195,7 +36256,7 @@ function QueryReportTableRow({
|
|
|
36195
36256
|
}
|
|
36196
36257
|
function TruncatedCell({ value, className }) {
|
|
36197
36258
|
const textRef = useRef50(null);
|
|
36198
|
-
const [isTruncated, setIsTruncated] =
|
|
36259
|
+
const [isTruncated, setIsTruncated] = useState87(false);
|
|
36199
36260
|
const checkTruncation = useCallback39(() => {
|
|
36200
36261
|
const el = textRef.current;
|
|
36201
36262
|
if (el) {
|
|
@@ -36944,7 +37005,7 @@ function DataTableBody({
|
|
|
36944
37005
|
}
|
|
36945
37006
|
|
|
36946
37007
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
36947
|
-
import { useEffect as
|
|
37008
|
+
import { useEffect as useEffect68, useRef as useRef52 } from "react";
|
|
36948
37009
|
import { Fragment as Fragment54, jsx as jsx297, jsxs as jsxs238 } from "react/jsx-runtime";
|
|
36949
37010
|
function DataTableInfiniteFooter({
|
|
36950
37011
|
hasNextPage,
|
|
@@ -36956,7 +37017,7 @@ function DataTableInfiniteFooter({
|
|
|
36956
37017
|
const sentinelRef = useRef52(null);
|
|
36957
37018
|
const onLoadMoreRef = useRef52(onLoadMore);
|
|
36958
37019
|
onLoadMoreRef.current = onLoadMore;
|
|
36959
|
-
|
|
37020
|
+
useEffect68(() => {
|
|
36960
37021
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
36961
37022
|
const sentinel = sentinelRef.current;
|
|
36962
37023
|
if (!sentinel) return;
|
|
@@ -37590,9 +37651,9 @@ function FilterList({
|
|
|
37590
37651
|
|
|
37591
37652
|
// src/components/ui/tag-search-input.tsx
|
|
37592
37653
|
import {
|
|
37593
|
-
useEffect as
|
|
37654
|
+
useEffect as useEffect70,
|
|
37594
37655
|
useRef as useRef54,
|
|
37595
|
-
useState as
|
|
37656
|
+
useState as useState89
|
|
37596
37657
|
} from "react";
|
|
37597
37658
|
init_cn();
|
|
37598
37659
|
import { jsx as jsx301, jsxs as jsxs242 } from "react/jsx-runtime";
|
|
@@ -37629,8 +37690,8 @@ function TagSearchInput({
|
|
|
37629
37690
|
const wrapperRef = useRef54(null);
|
|
37630
37691
|
const hiddenTagsRef = useRef54(null);
|
|
37631
37692
|
const hiddenTagsPopupRef = useRef54(null);
|
|
37632
|
-
const [showHiddenTags, setShowHiddenTags] =
|
|
37633
|
-
|
|
37693
|
+
const [showHiddenTags, setShowHiddenTags] = useState89(false);
|
|
37694
|
+
useEffect70(() => {
|
|
37634
37695
|
if (!showHiddenTags) return;
|
|
37635
37696
|
const handleClick = (e) => {
|
|
37636
37697
|
const target = e.target;
|
|
@@ -37785,7 +37846,7 @@ function TagSearchInput({
|
|
|
37785
37846
|
}
|
|
37786
37847
|
|
|
37787
37848
|
// src/components/ui/markdown-editor.tsx
|
|
37788
|
-
import { useRef as useRef55, useCallback as useCallback42, useState as
|
|
37849
|
+
import { useRef as useRef55, useCallback as useCallback42, useState as useState90, useEffect as useEffect71 } from "react";
|
|
37789
37850
|
init_cn();
|
|
37790
37851
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
37791
37852
|
import { jsx as jsx302, jsxs as jsxs243 } from "react/jsx-runtime";
|
|
@@ -37816,7 +37877,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
|
|
|
37816
37877
|
body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
|
|
37817
37878
|
`;
|
|
37818
37879
|
function MarkdownEditorStyles() {
|
|
37819
|
-
|
|
37880
|
+
useEffect71(() => {
|
|
37820
37881
|
if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
|
|
37821
37882
|
const style = document.createElement("style");
|
|
37822
37883
|
style.id = MARKDOWN_EDITOR_STYLE_ID;
|
|
@@ -37841,10 +37902,10 @@ function MarkdownEditor({
|
|
|
37841
37902
|
renderPreview
|
|
37842
37903
|
}) {
|
|
37843
37904
|
const fileInputRef = useRef55(null);
|
|
37844
|
-
const [isUploading, setIsUploading] =
|
|
37845
|
-
const [uploadProgress, setUploadProgress] =
|
|
37846
|
-
const [defaultExtraCommands, setDefaultExtraCommands] =
|
|
37847
|
-
|
|
37905
|
+
const [isUploading, setIsUploading] = useState90(false);
|
|
37906
|
+
const [uploadProgress, setUploadProgress] = useState90("");
|
|
37907
|
+
const [defaultExtraCommands, setDefaultExtraCommands] = useState90([]);
|
|
37908
|
+
useEffect71(() => {
|
|
37848
37909
|
import("@uiw/react-md-editor").then((mod) => {
|
|
37849
37910
|
if (mod.commands?.getExtraCommands) {
|
|
37850
37911
|
setDefaultExtraCommands(mod.commands.getExtraCommands());
|
|
@@ -37967,7 +38028,7 @@ function MarkdownEditor({
|
|
|
37967
38028
|
}
|
|
37968
38029
|
rafRef.current = requestAnimationFrame(scrollLoop);
|
|
37969
38030
|
}, []);
|
|
37970
|
-
|
|
38031
|
+
useEffect71(() => {
|
|
37971
38032
|
const wrapper = wrapperRef.current;
|
|
37972
38033
|
if (!wrapper) return;
|
|
37973
38034
|
const onMouseMove = (e) => {
|
|
@@ -39449,8 +39510,8 @@ function ImageGalleryModal({
|
|
|
39449
39510
|
onClose,
|
|
39450
39511
|
initialIndex = 0
|
|
39451
39512
|
}) {
|
|
39452
|
-
const [selectedImageIndex, setSelectedImageIndex] =
|
|
39453
|
-
|
|
39513
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState97(initialIndex);
|
|
39514
|
+
useEffect74(() => {
|
|
39454
39515
|
if (isOpen) {
|
|
39455
39516
|
setSelectedImageIndex(initialIndex);
|
|
39456
39517
|
}
|
|
@@ -39465,7 +39526,7 @@ function ImageGalleryModal({
|
|
|
39465
39526
|
setSelectedImageIndex(selectedImageIndex + 1);
|
|
39466
39527
|
}
|
|
39467
39528
|
};
|
|
39468
|
-
|
|
39529
|
+
useEffect74(() => {
|
|
39469
39530
|
const handleKeyPress = (event) => {
|
|
39470
39531
|
if (!isOpen) return;
|
|
39471
39532
|
switch (event.key) {
|
|
@@ -39668,7 +39729,7 @@ function RoadmapCard({
|
|
|
39668
39729
|
onVote,
|
|
39669
39730
|
isVoting = false
|
|
39670
39731
|
}) {
|
|
39671
|
-
const [showScreenshots, setShowScreenshots] =
|
|
39732
|
+
const [showScreenshots, setShowScreenshots] = useState98(false);
|
|
39672
39733
|
const logoUrl = item.icon && item.icon.startsWith("http") ? item.icon : null;
|
|
39673
39734
|
const iconSrc = logoUrl ? getProxiedImageUrl(logoUrl, { directHttps: true }) || logoUrl : null;
|
|
39674
39735
|
if (size === "sm") {
|
|
@@ -40304,7 +40365,7 @@ function DataRoomDocCardSkeleton({ className }) {
|
|
|
40304
40365
|
}
|
|
40305
40366
|
|
|
40306
40367
|
// src/components/chat/entity-cards/program-card.tsx
|
|
40307
|
-
import { useState as
|
|
40368
|
+
import { useState as useState99 } from "react";
|
|
40308
40369
|
|
|
40309
40370
|
// node_modules/date-fns/toDate.mjs
|
|
40310
40371
|
function toDate(argument) {
|
|
@@ -41941,8 +42002,8 @@ function getHosts(hosts) {
|
|
|
41941
42002
|
return [];
|
|
41942
42003
|
}
|
|
41943
42004
|
function MediaGallery({ images, title }) {
|
|
41944
|
-
const [selectedImageIndex, setSelectedImageIndex] =
|
|
41945
|
-
const [isModalOpen, setIsModalOpen] =
|
|
42005
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState99(null);
|
|
42006
|
+
const [isModalOpen, setIsModalOpen] = useState99(false);
|
|
41946
42007
|
const openImageModal = (index, event) => {
|
|
41947
42008
|
if (event) event.stopPropagation();
|
|
41948
42009
|
setSelectedImageIndex(index);
|
|
@@ -43727,7 +43788,7 @@ function useChunkCatchup({
|
|
|
43727
43788
|
}
|
|
43728
43789
|
|
|
43729
43790
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
43730
|
-
import { useEffect as
|
|
43791
|
+
import { useEffect as useEffect75, useRef as useRef60, useState as useState100 } from "react";
|
|
43731
43792
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
43732
43793
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
43733
43794
|
function useJetStreamDialogSubscription({
|
|
@@ -43746,57 +43807,57 @@ function useJetStreamDialogSubscription({
|
|
|
43746
43807
|
reconnectionBackoff,
|
|
43747
43808
|
inactiveThresholdMs
|
|
43748
43809
|
}) {
|
|
43749
|
-
const [isConnected, setIsConnected] =
|
|
43750
|
-
const [isSubscribed, setIsSubscribed] =
|
|
43751
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
43752
|
-
const [currentStreamSeq, setCurrentStreamSeq] =
|
|
43810
|
+
const [isConnected, setIsConnected] = useState100(false);
|
|
43811
|
+
const [isSubscribed, setIsSubscribed] = useState100(false);
|
|
43812
|
+
const [reconnectionCount, setReconnectionCount] = useState100(0);
|
|
43813
|
+
const [currentStreamSeq, setCurrentStreamSeq] = useState100(null);
|
|
43753
43814
|
const clientRef = useRef60(null);
|
|
43754
43815
|
const subscriptionRef = useRef60(null);
|
|
43755
43816
|
const highestStreamSeqRef = useRef60(null);
|
|
43756
43817
|
const onEventRef = useRef60(onEvent);
|
|
43757
|
-
|
|
43818
|
+
useEffect75(() => {
|
|
43758
43819
|
onEventRef.current = onEvent;
|
|
43759
43820
|
}, [onEvent]);
|
|
43760
43821
|
const onConnectRef = useRef60(onConnect);
|
|
43761
|
-
|
|
43822
|
+
useEffect75(() => {
|
|
43762
43823
|
onConnectRef.current = onConnect;
|
|
43763
43824
|
}, [onConnect]);
|
|
43764
43825
|
const onDisconnectRef = useRef60(onDisconnect);
|
|
43765
|
-
|
|
43826
|
+
useEffect75(() => {
|
|
43766
43827
|
onDisconnectRef.current = onDisconnect;
|
|
43767
43828
|
}, [onDisconnect]);
|
|
43768
43829
|
const onSubscribedRef = useRef60(onSubscribed);
|
|
43769
|
-
|
|
43830
|
+
useEffect75(() => {
|
|
43770
43831
|
onSubscribedRef.current = onSubscribed;
|
|
43771
43832
|
}, [onSubscribed]);
|
|
43772
43833
|
const onBeforeReconnectRef = useRef60(onBeforeReconnect);
|
|
43773
|
-
|
|
43834
|
+
useEffect75(() => {
|
|
43774
43835
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
43775
43836
|
}, [onBeforeReconnect]);
|
|
43776
43837
|
const getNatsWsUrlRef = useRef60(getNatsWsUrl);
|
|
43777
|
-
|
|
43838
|
+
useEffect75(() => {
|
|
43778
43839
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
43779
43840
|
}, [getNatsWsUrl]);
|
|
43780
43841
|
const reconnectionBackoffRef = useRef60(reconnectionBackoff);
|
|
43781
|
-
|
|
43842
|
+
useEffect75(() => {
|
|
43782
43843
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
43783
43844
|
}, [reconnectionBackoff]);
|
|
43784
43845
|
const optStartSeqRef = useRef60(optStartSeq);
|
|
43785
|
-
|
|
43846
|
+
useEffect75(() => {
|
|
43786
43847
|
optStartSeqRef.current = optStartSeq;
|
|
43787
43848
|
}, [optStartSeq]);
|
|
43788
43849
|
const inactiveThresholdRef = useRef60(inactiveThresholdMs);
|
|
43789
|
-
|
|
43850
|
+
useEffect75(() => {
|
|
43790
43851
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
43791
43852
|
}, [inactiveThresholdMs]);
|
|
43792
43853
|
const hadConnectionBeforeRef = useRef60(false);
|
|
43793
43854
|
const clientConfigRef = useRef60(clientConfig);
|
|
43794
|
-
|
|
43855
|
+
useEffect75(() => {
|
|
43795
43856
|
clientConfigRef.current = clientConfig;
|
|
43796
43857
|
}, [clientConfig]);
|
|
43797
43858
|
const currentWsUrlRef = useRef60("");
|
|
43798
43859
|
const wsUrl = getNatsWsUrl();
|
|
43799
|
-
|
|
43860
|
+
useEffect75(() => {
|
|
43800
43861
|
if (!enabled || !wsUrl) {
|
|
43801
43862
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
43802
43863
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -43877,7 +43938,7 @@ function useJetStreamDialogSubscription({
|
|
|
43877
43938
|
}
|
|
43878
43939
|
};
|
|
43879
43940
|
}, [enabled, wsUrl]);
|
|
43880
|
-
|
|
43941
|
+
useEffect75(() => {
|
|
43881
43942
|
if (!enabled || !dialogId || !isConnected) {
|
|
43882
43943
|
if (subscriptionRef.current) {
|
|
43883
43944
|
try {
|
|
@@ -43960,7 +44021,7 @@ function useJetStreamDialogSubscription({
|
|
|
43960
44021
|
setIsSubscribed(false);
|
|
43961
44022
|
};
|
|
43962
44023
|
}, [enabled, dialogId, isConnected, streamName, topic, reconnectionCount]);
|
|
43963
|
-
|
|
44024
|
+
useEffect75(() => {
|
|
43964
44025
|
highestStreamSeqRef.current = null;
|
|
43965
44026
|
setCurrentStreamSeq(null);
|
|
43966
44027
|
}, [dialogId]);
|
|
@@ -43968,7 +44029,7 @@ function useJetStreamDialogSubscription({
|
|
|
43968
44029
|
}
|
|
43969
44030
|
|
|
43970
44031
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
43971
|
-
import { useEffect as
|
|
44032
|
+
import { useEffect as useEffect76, useRef as useRef61, useState as useState101 } from "react";
|
|
43972
44033
|
function useNatsDialogSubscription({
|
|
43973
44034
|
enabled,
|
|
43974
44035
|
dialogId,
|
|
@@ -43982,47 +44043,47 @@ function useNatsDialogSubscription({
|
|
|
43982
44043
|
clientConfig = {},
|
|
43983
44044
|
reconnectionBackoff
|
|
43984
44045
|
}) {
|
|
43985
|
-
const [isConnected, setIsConnected] =
|
|
43986
|
-
const [isSubscribed, setIsSubscribed] =
|
|
43987
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
44046
|
+
const [isConnected, setIsConnected] = useState101(false);
|
|
44047
|
+
const [isSubscribed, setIsSubscribed] = useState101(false);
|
|
44048
|
+
const [reconnectionCount, setReconnectionCount] = useState101(0);
|
|
43988
44049
|
const clientRef = useRef61(null);
|
|
43989
44050
|
const subscriptionRefs = useRef61(/* @__PURE__ */ new Map());
|
|
43990
44051
|
const onEventRef = useRef61(onEvent);
|
|
43991
|
-
|
|
44052
|
+
useEffect76(() => {
|
|
43992
44053
|
onEventRef.current = onEvent;
|
|
43993
44054
|
}, [onEvent]);
|
|
43994
44055
|
const onConnectRef = useRef61(onConnect);
|
|
43995
|
-
|
|
44056
|
+
useEffect76(() => {
|
|
43996
44057
|
onConnectRef.current = onConnect;
|
|
43997
44058
|
}, [onConnect]);
|
|
43998
44059
|
const onDisconnectRef = useRef61(onDisconnect);
|
|
43999
|
-
|
|
44060
|
+
useEffect76(() => {
|
|
44000
44061
|
onDisconnectRef.current = onDisconnect;
|
|
44001
44062
|
}, [onDisconnect]);
|
|
44002
44063
|
const onSubscribedRef = useRef61(onSubscribed);
|
|
44003
|
-
|
|
44064
|
+
useEffect76(() => {
|
|
44004
44065
|
onSubscribedRef.current = onSubscribed;
|
|
44005
44066
|
}, [onSubscribed]);
|
|
44006
44067
|
const onBeforeReconnectRef = useRef61(onBeforeReconnect);
|
|
44007
|
-
|
|
44068
|
+
useEffect76(() => {
|
|
44008
44069
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
44009
44070
|
}, [onBeforeReconnect]);
|
|
44010
44071
|
const hadConnectionBeforeRef = useRef61(false);
|
|
44011
44072
|
const getNatsWsUrlRef = useRef61(getNatsWsUrl);
|
|
44012
|
-
|
|
44073
|
+
useEffect76(() => {
|
|
44013
44074
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
44014
44075
|
}, [getNatsWsUrl]);
|
|
44015
44076
|
const reconnectionBackoffRef = useRef61(reconnectionBackoff);
|
|
44016
|
-
|
|
44077
|
+
useEffect76(() => {
|
|
44017
44078
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
44018
44079
|
}, [reconnectionBackoff]);
|
|
44019
44080
|
const clientConfigRef = useRef61(clientConfig);
|
|
44020
|
-
|
|
44081
|
+
useEffect76(() => {
|
|
44021
44082
|
clientConfigRef.current = clientConfig;
|
|
44022
44083
|
}, [clientConfig]);
|
|
44023
44084
|
const currentWsUrlRef = useRef61("");
|
|
44024
44085
|
const wsUrl = getNatsWsUrl();
|
|
44025
|
-
|
|
44086
|
+
useEffect76(() => {
|
|
44026
44087
|
if (!enabled || !wsUrl) {
|
|
44027
44088
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
44028
44089
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -44106,12 +44167,12 @@ function useNatsDialogSubscription({
|
|
|
44106
44167
|
const topicsKey = topics.join(",");
|
|
44107
44168
|
const lastSubscribedDialogIdRef = useRef61(null);
|
|
44108
44169
|
const isConnectedRef = useRef61(isConnected);
|
|
44109
|
-
|
|
44170
|
+
useEffect76(() => {
|
|
44110
44171
|
isConnectedRef.current = isConnected;
|
|
44111
44172
|
}, [isConnected]);
|
|
44112
44173
|
const currentDialogIdRef = useRef61(null);
|
|
44113
44174
|
const abortControllerRef = useRef61(null);
|
|
44114
|
-
|
|
44175
|
+
useEffect76(() => {
|
|
44115
44176
|
currentDialogIdRef.current = dialogId;
|
|
44116
44177
|
if (!enabled || !dialogId) {
|
|
44117
44178
|
if (subscriptionRefs.current.size > 0) {
|
|
@@ -44192,7 +44253,7 @@ function useNatsDialogSubscription({
|
|
|
44192
44253
|
abortControllerRef.current = null;
|
|
44193
44254
|
};
|
|
44194
44255
|
}, [enabled, dialogId, topicsKey, topics]);
|
|
44195
|
-
|
|
44256
|
+
useEffect76(() => {
|
|
44196
44257
|
if (!enabled || !currentDialogIdRef.current || !isConnected) {
|
|
44197
44258
|
return;
|
|
44198
44259
|
}
|
|
@@ -44242,7 +44303,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
44242
44303
|
}
|
|
44243
44304
|
|
|
44244
44305
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
44245
|
-
import { useCallback as useCallback45, useRef as useRef62, useEffect as
|
|
44306
|
+
import { useCallback as useCallback45, useRef as useRef62, useEffect as useEffect77 } from "react";
|
|
44246
44307
|
|
|
44247
44308
|
// src/components/chat/utils/chunk-parser.ts
|
|
44248
44309
|
function normalizeToolCalls(raw) {
|
|
@@ -44900,7 +44961,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
44900
44961
|
})
|
|
44901
44962
|
);
|
|
44902
44963
|
const hasInitializedWithData = useRef62(false);
|
|
44903
|
-
|
|
44964
|
+
useEffect77(() => {
|
|
44904
44965
|
if (initialState && !hasInitializedWithData.current) {
|
|
44905
44966
|
accumulatorRef.current.initializeWithState(initialState);
|
|
44906
44967
|
if (initialState.escalatedApprovals) {
|
|
@@ -44917,7 +44978,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
44917
44978
|
const hasEverStreamedRef = useRef62(false);
|
|
44918
44979
|
const directModeFlagRef = useRef62(isDirectMode);
|
|
44919
44980
|
const sawDirectMessageRef = useRef62(false);
|
|
44920
|
-
|
|
44981
|
+
useEffect77(() => {
|
|
44921
44982
|
directModeFlagRef.current = isDirectMode;
|
|
44922
44983
|
}, [isDirectMode]);
|
|
44923
44984
|
const pendingEscalatedRef = useRef62(/* @__PURE__ */ new Map());
|
|
@@ -45178,7 +45239,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
45178
45239
|
}
|
|
45179
45240
|
|
|
45180
45241
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
45181
|
-
import { useEffect as
|
|
45242
|
+
import { useEffect as useEffect78, useState as useState102 } from "react";
|
|
45182
45243
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
45183
45244
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
45184
45245
|
try {
|
|
@@ -45195,9 +45256,9 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
45195
45256
|
}
|
|
45196
45257
|
}
|
|
45197
45258
|
function useSlashCommands(prefix, commandsUrl) {
|
|
45198
|
-
const [commands, setCommands] =
|
|
45199
|
-
const [loading, setLoading] =
|
|
45200
|
-
|
|
45259
|
+
const [commands, setCommands] = useState102([]);
|
|
45260
|
+
const [loading, setLoading] = useState102(false);
|
|
45261
|
+
useEffect78(() => {
|
|
45201
45262
|
if (prefix == null) {
|
|
45202
45263
|
setCommands([]);
|
|
45203
45264
|
return;
|
|
@@ -45297,7 +45358,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
45297
45358
|
}
|
|
45298
45359
|
|
|
45299
45360
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
45300
|
-
import { useCallback as useCallback46, useMemo as useMemo38, useRef as useRef63, useState as
|
|
45361
|
+
import { useCallback as useCallback46, useMemo as useMemo38, useRef as useRef63, useState as useState103 } from "react";
|
|
45301
45362
|
import { fileTypeFromBlob } from "file-type";
|
|
45302
45363
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
45303
45364
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -45373,7 +45434,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
|
45373
45434
|
function useChatAttachments() {
|
|
45374
45435
|
const runtime = useRequiredChatRuntime();
|
|
45375
45436
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
45376
|
-
const [attachments, setAttachments] =
|
|
45437
|
+
const [attachments, setAttachments] = useState103([]);
|
|
45377
45438
|
const controllersRef = useRef63(/* @__PURE__ */ new Map());
|
|
45378
45439
|
const updateOne = useCallback46((id, patch) => {
|
|
45379
45440
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
@@ -45540,16 +45601,16 @@ function useChatAttachments() {
|
|
|
45540
45601
|
}
|
|
45541
45602
|
|
|
45542
45603
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
45543
|
-
import { useCallback as useCallback47, useEffect as
|
|
45604
|
+
import { useCallback as useCallback47, useEffect as useEffect79, useRef as useRef64, useState as useState104 } from "react";
|
|
45544
45605
|
import { jsx as jsx326 } from "react/jsx-runtime";
|
|
45545
45606
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
45546
45607
|
function useChatAttachmentImageGallery() {
|
|
45547
45608
|
const runtime = useRequiredChatRuntime();
|
|
45548
45609
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
45549
45610
|
const panelRef = useRef64(null);
|
|
45550
|
-
const [state, setState] =
|
|
45611
|
+
const [state, setState] = useState104(CLOSED);
|
|
45551
45612
|
const handleClose = useCallback47(() => setState(CLOSED), []);
|
|
45552
|
-
|
|
45613
|
+
useEffect79(() => {
|
|
45553
45614
|
const root = panelRef.current;
|
|
45554
45615
|
if (!root) return;
|
|
45555
45616
|
const onClick = (ev) => {
|
|
@@ -45595,7 +45656,7 @@ function absolutize(prefix) {
|
|
|
45595
45656
|
}
|
|
45596
45657
|
|
|
45597
45658
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
45598
|
-
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as
|
|
45659
|
+
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect80, useState as useState105 } from "react";
|
|
45599
45660
|
var ANON_DEFAULTS = {
|
|
45600
45661
|
authTier: "anon",
|
|
45601
45662
|
source: null,
|
|
@@ -45606,9 +45667,9 @@ function useResolveChatIdentity(enabled) {
|
|
|
45606
45667
|
const runtime = useRequiredChatRuntime();
|
|
45607
45668
|
const url = runtime.endpoints.identityUrl;
|
|
45608
45669
|
const proxyEmail = getEmbedProxyAuth()?.email ?? null;
|
|
45609
|
-
const [data, setData] =
|
|
45610
|
-
const [isLoading, setIsLoading] =
|
|
45611
|
-
|
|
45670
|
+
const [data, setData] = useState105(ANON_DEFAULTS);
|
|
45671
|
+
const [isLoading, setIsLoading] = useState105(enabled);
|
|
45672
|
+
useEffect80(() => {
|
|
45612
45673
|
if (!enabled) return;
|
|
45613
45674
|
let cancelled = false;
|
|
45614
45675
|
const ctrl = new AbortController();
|
|
@@ -45650,11 +45711,11 @@ function useChatIdentity() {
|
|
|
45650
45711
|
}
|
|
45651
45712
|
|
|
45652
45713
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
45653
|
-
import { useEffect as
|
|
45714
|
+
import { useEffect as useEffect81, useRef as useRef65 } from "react";
|
|
45654
45715
|
function useCloseOnNavigation(close, pathname) {
|
|
45655
45716
|
const prevPathnameRef = useRef65(null);
|
|
45656
45717
|
const initializedRef = useRef65(false);
|
|
45657
|
-
|
|
45718
|
+
useEffect81(() => {
|
|
45658
45719
|
if (!initializedRef.current) {
|
|
45659
45720
|
initializedRef.current = true;
|
|
45660
45721
|
prevPathnameRef.current = pathname;
|
|
@@ -45668,13 +45729,13 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
45668
45729
|
}
|
|
45669
45730
|
|
|
45670
45731
|
// src/components/chat/hooks/use-chat.ts
|
|
45671
|
-
import { useState as
|
|
45732
|
+
import { useState as useState107, useCallback as useCallback49, useEffect as useEffect82, useRef as useRef67 } from "react";
|
|
45672
45733
|
|
|
45673
45734
|
// src/components/chat/hooks/use-sse.ts
|
|
45674
|
-
import { useState as
|
|
45735
|
+
import { useState as useState106, useCallback as useCallback48, useRef as useRef66 } from "react";
|
|
45675
45736
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
45676
|
-
const [isStreaming, setIsStreaming] =
|
|
45677
|
-
const [error, setError] =
|
|
45737
|
+
const [isStreaming, setIsStreaming] = useState106(false);
|
|
45738
|
+
const [error, setError] = useState106(null);
|
|
45678
45739
|
const abortControllerRef = useRef66(null);
|
|
45679
45740
|
const fallbackStream = useCallback48(async function* () {
|
|
45680
45741
|
throw new Error(
|
|
@@ -45741,12 +45802,12 @@ function useChat({
|
|
|
45741
45802
|
initialMessages,
|
|
45742
45803
|
onMessagesChange
|
|
45743
45804
|
} = {}) {
|
|
45744
|
-
const [messages, setMessages] =
|
|
45745
|
-
const [isTyping, setIsTyping] =
|
|
45805
|
+
const [messages, setMessages] = useState107(() => initialMessages ?? []);
|
|
45806
|
+
const [isTyping, setIsTyping] = useState107(false);
|
|
45746
45807
|
const currentAssistantSegmentsRef = useRef67([]);
|
|
45747
45808
|
const onMessagesChangeRef = useRef67(onMessagesChange);
|
|
45748
45809
|
onMessagesChangeRef.current = onMessagesChange;
|
|
45749
|
-
|
|
45810
|
+
useEffect82(() => {
|
|
45750
45811
|
onMessagesChangeRef.current?.(messages);
|
|
45751
45812
|
}, [messages]);
|
|
45752
45813
|
const {
|
|
@@ -46035,7 +46096,7 @@ function useChat({
|
|
|
46035
46096
|
}
|
|
46036
46097
|
|
|
46037
46098
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
46038
|
-
import { useState as
|
|
46099
|
+
import { useState as useState108, useEffect as useEffect83, useCallback as useCallback50, useMemo as useMemo39, useRef as useRef68 } from "react";
|
|
46039
46100
|
function createEmptyTurnMeta() {
|
|
46040
46101
|
return {
|
|
46041
46102
|
provider: null,
|
|
@@ -46370,8 +46431,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46370
46431
|
const metaMapRef = useRef68(/* @__PURE__ */ new Map());
|
|
46371
46432
|
const messagesRef = useRef68(persistedRef.current.messages);
|
|
46372
46433
|
const sendCountRef = useRef68(persistedRef.current.sendCount);
|
|
46373
|
-
const [streamingPhase, setStreamingPhase] =
|
|
46374
|
-
const [metaTick, setMetaTick] =
|
|
46434
|
+
const [streamingPhase, setStreamingPhase] = useState108("idle");
|
|
46435
|
+
const [metaTick, setMetaTick] = useState108(0);
|
|
46375
46436
|
const bumpMetaTick = useCallback50(() => setMetaTick((t) => t + 1), []);
|
|
46376
46437
|
const streamFn = useMemo39(
|
|
46377
46438
|
() => createDocStreamFn(
|
|
@@ -46559,7 +46620,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46559
46620
|
}
|
|
46560
46621
|
}
|
|
46561
46622
|
}, [chatClearMessages, source, bumpMetaTick]);
|
|
46562
|
-
|
|
46623
|
+
useEffect83(() => {
|
|
46563
46624
|
if (!isTyping && !isStreaming && streamingPhase !== "idle") {
|
|
46564
46625
|
setStreamingPhase("idle");
|
|
46565
46626
|
}
|
|
@@ -46641,10 +46702,10 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
46641
46702
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
46642
46703
|
import {
|
|
46643
46704
|
useCallback as useCallback51,
|
|
46644
|
-
useEffect as
|
|
46705
|
+
useEffect as useEffect84,
|
|
46645
46706
|
useMemo as useMemo40,
|
|
46646
46707
|
useRef as useRef69,
|
|
46647
|
-
useState as
|
|
46708
|
+
useState as useState109
|
|
46648
46709
|
} from "react";
|
|
46649
46710
|
|
|
46650
46711
|
// src/components/chat/utils/process-historical-messages.ts
|
|
@@ -47134,23 +47195,23 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47134
47195
|
modelLabel = null
|
|
47135
47196
|
} = config;
|
|
47136
47197
|
const isManagedMode = fetchDialogs !== void 0;
|
|
47137
|
-
const [internalDialogId, setInternalDialogId] =
|
|
47198
|
+
const [internalDialogId, setInternalDialogId] = useState109(null);
|
|
47138
47199
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
47139
|
-
const [messages, setMessages] =
|
|
47140
|
-
const [streamingPhase, setStreamingPhase] =
|
|
47141
|
-
const [approvalStatuses, setApprovalStatuses] =
|
|
47142
|
-
const [dialogs, setDialogs] =
|
|
47143
|
-
const [dialogsNextCursor, setDialogsNextCursor] =
|
|
47144
|
-
const [isDialogsLoading, setIsDialogsLoading] =
|
|
47145
|
-
const [dialogsError, setDialogsError] =
|
|
47146
|
-
const [isCreatingDialog, setIsCreatingDialog] =
|
|
47147
|
-
const [messagesNextCursor, setMessagesNextCursor] =
|
|
47148
|
-
const [isMessagesLoading, setIsMessagesLoading] =
|
|
47149
|
-
const [dialogTokenUsage, setDialogTokenUsage] =
|
|
47200
|
+
const [messages, setMessages] = useState109([]);
|
|
47201
|
+
const [streamingPhase, setStreamingPhase] = useState109("idle");
|
|
47202
|
+
const [approvalStatuses, setApprovalStatuses] = useState109({});
|
|
47203
|
+
const [dialogs, setDialogs] = useState109([]);
|
|
47204
|
+
const [dialogsNextCursor, setDialogsNextCursor] = useState109(null);
|
|
47205
|
+
const [isDialogsLoading, setIsDialogsLoading] = useState109(false);
|
|
47206
|
+
const [dialogsError, setDialogsError] = useState109(false);
|
|
47207
|
+
const [isCreatingDialog, setIsCreatingDialog] = useState109(false);
|
|
47208
|
+
const [messagesNextCursor, setMessagesNextCursor] = useState109(null);
|
|
47209
|
+
const [isMessagesLoading, setIsMessagesLoading] = useState109(false);
|
|
47210
|
+
const [dialogTokenUsage, setDialogTokenUsage] = useState109(
|
|
47150
47211
|
null
|
|
47151
47212
|
);
|
|
47152
|
-
const [liveModel, setLiveModel] =
|
|
47153
|
-
const [connectionState, setConnectionState] =
|
|
47213
|
+
const [liveModel, setLiveModel] = useState109(null);
|
|
47214
|
+
const [connectionState, setConnectionState] = useState109("connecting");
|
|
47154
47215
|
const handleApprove = useCallback51(
|
|
47155
47216
|
async (requestId) => {
|
|
47156
47217
|
if (!approveRequestCallback) return;
|
|
@@ -47291,7 +47352,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47291
47352
|
]
|
|
47292
47353
|
);
|
|
47293
47354
|
const prevDialogIdRef = useRef69(void 0);
|
|
47294
|
-
|
|
47355
|
+
useEffect84(() => {
|
|
47295
47356
|
if (prevDialogIdRef.current === dialogId) return;
|
|
47296
47357
|
prevDialogIdRef.current = dialogId;
|
|
47297
47358
|
historyLoadSeqRef.current += 1;
|
|
@@ -47305,7 +47366,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47305
47366
|
if (!active || !dialogId) return;
|
|
47306
47367
|
void loadDialogHistory(dialogId);
|
|
47307
47368
|
}, [active, dialogId, loadDialogHistory, resetAccumulator]);
|
|
47308
|
-
|
|
47369
|
+
useEffect84(() => {
|
|
47309
47370
|
if (!active || !dialogId) return;
|
|
47310
47371
|
resetChunkTracking();
|
|
47311
47372
|
startInitialBuffering();
|
|
@@ -47327,7 +47388,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47327
47388
|
setConnectionState("connected");
|
|
47328
47389
|
}
|
|
47329
47390
|
});
|
|
47330
|
-
|
|
47391
|
+
useEffect84(() => {
|
|
47331
47392
|
if (!active || !dialogId) {
|
|
47332
47393
|
setConnectionState("connected");
|
|
47333
47394
|
return;
|
|
@@ -47366,7 +47427,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47366
47427
|
const reloadDialogs = useCallback51(() => {
|
|
47367
47428
|
void loadDialogsPage();
|
|
47368
47429
|
}, [loadDialogsPage]);
|
|
47369
|
-
|
|
47430
|
+
useEffect84(() => {
|
|
47370
47431
|
if (!fetchDialogs) return;
|
|
47371
47432
|
if (!active) return;
|
|
47372
47433
|
if (initialDialogsLoadedRef.current) return;
|
|
@@ -47946,7 +48007,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
|
|
|
47946
48007
|
}
|
|
47947
48008
|
|
|
47948
48009
|
// src/components/chat/embeddable-chat.tsx
|
|
47949
|
-
import { useCallback as useCallback54, useEffect as
|
|
48010
|
+
import { useCallback as useCallback54, useEffect as useEffect85, useMemo as useMemo43, useRef as useRef71, useState as useState111 } from "react";
|
|
47950
48011
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
47951
48012
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
47952
48013
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -48027,7 +48088,7 @@ init_button2();
|
|
|
48027
48088
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
48028
48089
|
|
|
48029
48090
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
48030
|
-
import { useCallback as useCallback53, useMemo as useMemo42, useState as
|
|
48091
|
+
import { useCallback as useCallback53, useMemo as useMemo42, useState as useState110 } from "react";
|
|
48031
48092
|
function useChatDialogManager({
|
|
48032
48093
|
dialogs,
|
|
48033
48094
|
activeDialogId,
|
|
@@ -48038,8 +48099,8 @@ function useChatDialogManager({
|
|
|
48038
48099
|
fetchArchivedDialogs,
|
|
48039
48100
|
unarchiveDialog
|
|
48040
48101
|
}) {
|
|
48041
|
-
const [renameTarget, setRenameTarget] =
|
|
48042
|
-
const [archiveTarget, setArchiveTarget] =
|
|
48102
|
+
const [renameTarget, setRenameTarget] = useState110(null);
|
|
48103
|
+
const [archiveTarget, setArchiveTarget] = useState110(null);
|
|
48043
48104
|
const handleConfirmRename = useCallback53(
|
|
48044
48105
|
(name) => {
|
|
48045
48106
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
@@ -48062,10 +48123,10 @@ function useChatDialogManager({
|
|
|
48062
48123
|
}
|
|
48063
48124
|
setArchiveTarget(null);
|
|
48064
48125
|
}, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
|
|
48065
|
-
const [archiveOpen, setArchiveOpen] =
|
|
48066
|
-
const [archivedDialogs, setArchivedDialogs] =
|
|
48067
|
-
const [archivedCursor, setArchivedCursor] =
|
|
48068
|
-
const [archivedLoading, setArchivedLoading] =
|
|
48126
|
+
const [archiveOpen, setArchiveOpen] = useState110(false);
|
|
48127
|
+
const [archivedDialogs, setArchivedDialogs] = useState110([]);
|
|
48128
|
+
const [archivedCursor, setArchivedCursor] = useState110(null);
|
|
48129
|
+
const [archivedLoading, setArchivedLoading] = useState110(false);
|
|
48069
48130
|
const loadArchivedPage = useCallback53(
|
|
48070
48131
|
async (cursor) => {
|
|
48071
48132
|
if (!fetchArchivedDialogs) return;
|
|
@@ -48091,10 +48152,10 @@ function useChatDialogManager({
|
|
|
48091
48152
|
void loadArchivedPage();
|
|
48092
48153
|
}, [loadArchivedPage]);
|
|
48093
48154
|
const closeArchive = useCallback53(() => setArchiveOpen(false), []);
|
|
48094
|
-
const [viewingArchivedId, setViewingArchivedId] =
|
|
48155
|
+
const [viewingArchivedId, setViewingArchivedId] = useState110(
|
|
48095
48156
|
null
|
|
48096
48157
|
);
|
|
48097
|
-
const [openingDialogId, setOpeningDialogId] =
|
|
48158
|
+
const [openingDialogId, setOpeningDialogId] = useState110(null);
|
|
48098
48159
|
const handleSelectDialog = useCallback53(
|
|
48099
48160
|
(id) => {
|
|
48100
48161
|
setViewingArchivedId(null);
|
|
@@ -48113,7 +48174,7 @@ function useChatDialogManager({
|
|
|
48113
48174
|
},
|
|
48114
48175
|
[selectDialog]
|
|
48115
48176
|
);
|
|
48116
|
-
const [restoreTarget, setRestoreTarget] =
|
|
48177
|
+
const [restoreTarget, setRestoreTarget] = useState110(null);
|
|
48117
48178
|
const handleConfirmRestore = useCallback53(async () => {
|
|
48118
48179
|
if (restoreTarget) {
|
|
48119
48180
|
try {
|
|
@@ -48364,7 +48425,7 @@ function SourceChips({
|
|
|
48364
48425
|
onClose,
|
|
48365
48426
|
onDiscuss
|
|
48366
48427
|
}) {
|
|
48367
|
-
const [expanded, setExpanded] =
|
|
48428
|
+
const [expanded, setExpanded] = useState111(false);
|
|
48368
48429
|
if (cited.length === 0) {
|
|
48369
48430
|
const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
|
|
48370
48431
|
if (fallback.length === 0) return null;
|
|
@@ -48463,7 +48524,7 @@ function EmbeddableChatInner({
|
|
|
48463
48524
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
48464
48525
|
const { attachmentsEnabled, user: identityUser } = useChatIdentity();
|
|
48465
48526
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
48466
|
-
|
|
48527
|
+
useEffect85(() => {
|
|
48467
48528
|
if (process.env.NODE_ENV !== "production") {
|
|
48468
48529
|
const hasOpen = open !== void 0;
|
|
48469
48530
|
const hasHandler = onOpenChange !== void 0;
|
|
@@ -48479,13 +48540,13 @@ function EmbeddableChatInner({
|
|
|
48479
48540
|
defaultProp: defaultOpen ?? false,
|
|
48480
48541
|
onChange: onOpenChange
|
|
48481
48542
|
});
|
|
48482
|
-
const [autoFocusInput] =
|
|
48543
|
+
const [autoFocusInput] = useState111(() => {
|
|
48483
48544
|
if (typeof window === "undefined") return false;
|
|
48484
48545
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
48485
48546
|
});
|
|
48486
48547
|
usePreventScroll({ isDisabled: !isOpen || shellLess });
|
|
48487
48548
|
const navigatingAwayRef = useRef71(false);
|
|
48488
|
-
|
|
48549
|
+
useEffect85(() => {
|
|
48489
48550
|
if (!isOpen) return;
|
|
48490
48551
|
if (shellLess) return;
|
|
48491
48552
|
if (typeof window === "undefined") return;
|
|
@@ -48512,7 +48573,7 @@ function EmbeddableChatInner({
|
|
|
48512
48573
|
};
|
|
48513
48574
|
}, [isOpen, shellLess]);
|
|
48514
48575
|
const chatInputRef = useRef71(null);
|
|
48515
|
-
const
|
|
48576
|
+
const [quickActionPreview, setQuickActionPreview] = useState111(null);
|
|
48516
48577
|
const slashCommandsProp = useMemo43(
|
|
48517
48578
|
() => ({
|
|
48518
48579
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
@@ -48555,7 +48616,7 @@ function EmbeddableChatInner({
|
|
|
48555
48616
|
}, [mingoState, mingoDialogCapabilities, effectiveModes]);
|
|
48556
48617
|
const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
|
|
48557
48618
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
48558
|
-
const [uncontrolledActiveMode, setUncontrolledActiveMode] =
|
|
48619
|
+
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState111(initialActiveMode);
|
|
48559
48620
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
48560
48621
|
const handleActiveModeChange = useCallback54(
|
|
48561
48622
|
(next) => {
|
|
@@ -48618,15 +48679,15 @@ function EmbeddableChatInner({
|
|
|
48618
48679
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
48619
48680
|
const contextMaxItems = contextPicker?.maxItems ?? 10;
|
|
48620
48681
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
48621
|
-
const [contextItems, setContextItems] =
|
|
48622
|
-
const [contextPickerOpen, setContextPickerOpen] =
|
|
48623
|
-
const [mentionQuery, setMentionQuery] =
|
|
48682
|
+
const [contextItems, setContextItems] = useState111([]);
|
|
48683
|
+
const [contextPickerOpen, setContextPickerOpen] = useState111(false);
|
|
48684
|
+
const [mentionQuery, setMentionQuery] = useState111(null);
|
|
48624
48685
|
const mentionActiveRef = useRef71(false);
|
|
48625
|
-
|
|
48686
|
+
useEffect85(() => {
|
|
48626
48687
|
mentionActiveRef.current = mentionQuery !== null;
|
|
48627
48688
|
}, [mentionQuery]);
|
|
48628
48689
|
const mentionKeysRef = useRef71(/* @__PURE__ */ new Set());
|
|
48629
|
-
|
|
48690
|
+
useEffect85(() => {
|
|
48630
48691
|
setContextItems([]);
|
|
48631
48692
|
setMentionQuery(null);
|
|
48632
48693
|
mentionKeysRef.current.clear();
|
|
@@ -48830,7 +48891,7 @@ function EmbeddableChatInner({
|
|
|
48830
48891
|
});
|
|
48831
48892
|
const handleOpen = useCallback54(() => setIsOpen(true), [setIsOpen]);
|
|
48832
48893
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
48833
|
-
|
|
48894
|
+
useEffect85(() => {
|
|
48834
48895
|
const handler = (e) => {
|
|
48835
48896
|
const detail = e.detail;
|
|
48836
48897
|
if (!detail || detail.source !== source) return;
|
|
@@ -48847,6 +48908,9 @@ function EmbeddableChatInner({
|
|
|
48847
48908
|
const messagesInitialLoading = isMessagesLoading && !hasMessages;
|
|
48848
48909
|
const contentViewKey = hasConversation ? "conversation" : activeMode;
|
|
48849
48910
|
const isGuideEmpty = !hasConversation && activeMode === "guide";
|
|
48911
|
+
useEffect85(() => {
|
|
48912
|
+
if (!isGuideEmpty) setQuickActionPreview(null);
|
|
48913
|
+
}, [isGuideEmpty]);
|
|
48850
48914
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
48851
48915
|
const sourceLabel = source === "flamingo" ? "Knowledge Base" : "Data Room";
|
|
48852
48916
|
const enabledSet = useMemo43(
|
|
@@ -48886,7 +48950,7 @@ function EmbeddableChatInner({
|
|
|
48886
48950
|
const uncited = sources.filter((s) => !seenOrder.has(s.index));
|
|
48887
48951
|
return { cited, uncited };
|
|
48888
48952
|
}, [lastAssistantMsg, chatLoading]);
|
|
48889
|
-
const [portalHost, setPortalHost] =
|
|
48953
|
+
const [portalHost, setPortalHost] = useState111(null);
|
|
48890
48954
|
const body = /* @__PURE__ */ jsxs265(PortalContainerContext.Provider, { value: portalHost, children: [
|
|
48891
48955
|
/* @__PURE__ */ jsx329(
|
|
48892
48956
|
"div",
|
|
@@ -49041,22 +49105,11 @@ function EmbeddableChatInner({
|
|
|
49041
49105
|
...guideWelcome,
|
|
49042
49106
|
quickActions: guideWelcome?.quickActions ?? guideSuggestedActions,
|
|
49043
49107
|
onQuickAction: (action) => {
|
|
49044
|
-
|
|
49045
|
-
chatInputRef.current?.setValue("");
|
|
49108
|
+
setQuickActionPreview(null);
|
|
49046
49109
|
handleSend(action.prompt ?? action.label);
|
|
49047
49110
|
},
|
|
49048
|
-
onQuickActionHover: (action) =>
|
|
49049
|
-
|
|
49050
|
-
quickActionDraftRef.current = chatInputRef.current?.getValue() ?? "";
|
|
49051
|
-
}
|
|
49052
|
-
chatInputRef.current?.setValue(action.prompt ?? action.label);
|
|
49053
|
-
},
|
|
49054
|
-
onQuickActionHoverEnd: () => {
|
|
49055
|
-
if (quickActionDraftRef.current !== null) {
|
|
49056
|
-
chatInputRef.current?.setValue(quickActionDraftRef.current);
|
|
49057
|
-
quickActionDraftRef.current = null;
|
|
49058
|
-
}
|
|
49059
|
-
},
|
|
49111
|
+
onQuickActionHover: (action) => setQuickActionPreview(action.prompt ?? action.label),
|
|
49112
|
+
onQuickActionHoverEnd: () => setQuickActionPreview(null),
|
|
49060
49113
|
children: (chipCommands.length > 0 || !commandsLoaded) && /* @__PURE__ */ jsxs265("div", { className: "shrink-0 overflow-hidden rounded-md border border-ods-border", children: [
|
|
49061
49114
|
!commandsLoaded && chipCommands.length === 0 && SKELETON_ROW_VARIANTS.map((variant, i) => /* @__PURE__ */ jsx329(
|
|
49062
49115
|
MingoOnboardingCardSkeleton,
|
|
@@ -49120,6 +49173,7 @@ function EmbeddableChatInner({
|
|
|
49120
49173
|
placeholder: hasInflightUploads ? "Waiting for uploads to finish\u2026" : "Ask a question...",
|
|
49121
49174
|
autoFocus: autoFocusInput,
|
|
49122
49175
|
slashCommands: slashCommandsProp,
|
|
49176
|
+
previewText: quickActionPreview ?? void 0,
|
|
49123
49177
|
showAttachmentButton: attachmentsEnabled && activeMode === "guide",
|
|
49124
49178
|
attachmentsCount: stagedAttachments.length,
|
|
49125
49179
|
onAddFiles: addAttachmentFiles,
|
|
@@ -50130,4 +50184,4 @@ export {
|
|
|
50130
50184
|
FAE_AVATAR_DATA_URI,
|
|
50131
50185
|
assets
|
|
50132
50186
|
};
|
|
50133
|
-
//# sourceMappingURL=chunk-
|
|
50187
|
+
//# sourceMappingURL=chunk-M4JER3ZJ.js.map
|