@flamingo-stack/openframe-frontend-core 0.0.340-snapshot.20260630012353 → 0.0.340
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-D2ETTYT2.cjs → chunk-4K2M2WC4.cjs} +26 -26
- package/dist/{chunk-D2ETTYT2.cjs.map → chunk-4K2M2WC4.cjs.map} +1 -1
- package/dist/{chunk-2GROEWOK.js → chunk-53MGSWCC.js} +4 -4
- package/dist/{chunk-KE2QKKCN.js → chunk-573LTCRV.js} +2 -2
- package/dist/{chunk-QYF6LEDF.js → chunk-7TENQYAJ.js} +2 -2
- package/dist/{chunk-LANAE7MY.cjs → chunk-BMSJTLGO.cjs} +12 -12
- package/dist/{chunk-LANAE7MY.cjs.map → chunk-BMSJTLGO.cjs.map} +1 -1
- package/dist/{chunk-A37AW6CD.cjs → chunk-DFFOCQFO.cjs} +5 -5
- package/dist/{chunk-A37AW6CD.cjs.map → chunk-DFFOCQFO.cjs.map} +1 -1
- package/dist/{chunk-QCREN5A5.cjs → chunk-DRO773DG.cjs} +56 -56
- package/dist/{chunk-QCREN5A5.cjs.map → chunk-DRO773DG.cjs.map} +1 -1
- package/dist/{chunk-I3CNFZOY.cjs → chunk-ERMMMQET.cjs} +319 -351
- package/dist/chunk-ERMMMQET.cjs.map +1 -0
- package/dist/{chunk-OGTHMZIL.cjs → chunk-EXFHHZ2C.cjs} +9 -9
- package/dist/{chunk-OGTHMZIL.cjs.map → chunk-EXFHHZ2C.cjs.map} +1 -1
- package/dist/{chunk-4I46HAN5.js → chunk-GGFJ5OQ3.js} +4 -4
- package/dist/{chunk-BYAXSMET.cjs → chunk-HVYR323G.cjs} +15 -15
- package/dist/{chunk-BYAXSMET.cjs.map → chunk-HVYR323G.cjs.map} +1 -1
- package/dist/{chunk-OLR534KB.js → chunk-KE2PMD6A.js} +2 -2
- package/dist/{chunk-I4BWBQXX.cjs → chunk-L6YX6D26.cjs} +31 -31
- package/dist/{chunk-I4BWBQXX.cjs.map → chunk-L6YX6D26.cjs.map} +1 -1
- package/dist/{chunk-GCYEJLOQ.js → chunk-MNLQMAY3.js} +2 -2
- package/dist/{chunk-EPVDWAVJ.js → chunk-NC3DJLP5.js} +4 -4
- package/dist/{chunk-AZ3DTQU5.js → chunk-NDHQG4I4.js} +154 -186
- package/dist/chunk-NDHQG4I4.js.map +1 -0
- package/dist/{chunk-N3GFEIWF.js → chunk-OVN265XQ.js} +2 -2
- package/dist/{chunk-EYPZ2XLX.cjs → chunk-SIK5LBUN.cjs} +25 -25
- package/dist/{chunk-EYPZ2XLX.cjs.map → chunk-SIK5LBUN.cjs.map} +1 -1
- package/dist/{chunk-KT4KY6OF.js → chunk-T4SW6GOR.js} +4 -4
- package/dist/{chunk-Y2WHQSF6.js → chunk-TOMTBXM7.js} +2 -2
- package/dist/{chunk-CJB4NUD6.cjs → chunk-TVCBMR3N.cjs} +7 -7
- package/dist/{chunk-CJB4NUD6.cjs.map → chunk-TVCBMR3N.cjs.map} +1 -1
- package/dist/{chunk-NIIN3UH4.cjs → chunk-VA3GDVOV.cjs} +37 -37
- package/dist/{chunk-NIIN3UH4.cjs.map → chunk-VA3GDVOV.cjs.map} +1 -1
- package/dist/{chunk-CUQGK4AD.js → chunk-W7J46YKF.js} +2 -2
- package/dist/{chunk-R3MVYKEL.cjs → chunk-YEB5Z76W.cjs} +62 -62
- package/dist/{chunk-R3MVYKEL.cjs.map → chunk-YEB5Z76W.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 -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 +0 -16
- package/dist/components/ui/table/types.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/ui/table/table-row.tsx +3 -16
- package/src/components/ui/table/table.tsx +15 -34
- package/src/components/ui/table/types.ts +0 -17
- package/dist/chunk-AZ3DTQU5.js.map +0 -1
- package/dist/chunk-I3CNFZOY.cjs.map +0 -1
- package/dist/components/ui/table/use-table-motion.d.ts +0 -20
- package/dist/components/ui/table/use-table-motion.d.ts.map +0 -1
- package/src/components/ui/table/use-table-motion.ts +0 -48
- /package/dist/{chunk-2GROEWOK.js.map → chunk-53MGSWCC.js.map} +0 -0
- /package/dist/{chunk-KE2QKKCN.js.map → chunk-573LTCRV.js.map} +0 -0
- /package/dist/{chunk-QYF6LEDF.js.map → chunk-7TENQYAJ.js.map} +0 -0
- /package/dist/{chunk-4I46HAN5.js.map → chunk-GGFJ5OQ3.js.map} +0 -0
- /package/dist/{chunk-OLR534KB.js.map → chunk-KE2PMD6A.js.map} +0 -0
- /package/dist/{chunk-GCYEJLOQ.js.map → chunk-MNLQMAY3.js.map} +0 -0
- /package/dist/{chunk-EPVDWAVJ.js.map → chunk-NC3DJLP5.js.map} +0 -0
- /package/dist/{chunk-N3GFEIWF.js.map → chunk-OVN265XQ.js.map} +0 -0
- /package/dist/{chunk-KT4KY6OF.js.map → chunk-T4SW6GOR.js.map} +0 -0
- /package/dist/{chunk-Y2WHQSF6.js.map → chunk-TOMTBXM7.js.map} +0 -0
- /package/dist/{chunk-CUQGK4AD.js.map → chunk-W7J46YKF.js.map} +0 -0
|
@@ -10985,7 +10985,7 @@ function OnboardingGuideCard({
|
|
|
10985
10985
|
}
|
|
10986
10986
|
|
|
10987
10987
|
// src/components/chat/entity-cards/roadmap-card.tsx
|
|
10988
|
-
import { useState as
|
|
10988
|
+
import { useState as useState97 } from "react";
|
|
10989
10989
|
import { ThumbsUp, ThumbsDown } from "lucide-react";
|
|
10990
10990
|
|
|
10991
10991
|
// src/components/chat/entity-cards/roadmap-vote-button.tsx
|
|
@@ -11026,7 +11026,7 @@ function RoadmapVoteButton({
|
|
|
11026
11026
|
init_button();
|
|
11027
11027
|
|
|
11028
11028
|
// src/components/ui/image-gallery-modal.tsx
|
|
11029
|
-
import { useState as
|
|
11029
|
+
import { useState as useState96, useEffect as useEffect73 } from "react";
|
|
11030
11030
|
|
|
11031
11031
|
// src/components/ui/allowed-domains-input.tsx
|
|
11032
11032
|
init_cn();
|
|
@@ -35140,7 +35140,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx274(ContentLoader, { ...props, va
|
|
|
35140
35140
|
|
|
35141
35141
|
// src/components/ui/table/table.tsx
|
|
35142
35142
|
init_cn();
|
|
35143
|
-
import { useEffect as
|
|
35143
|
+
import { useEffect as useEffect66, useRef as useRef48 } from "react";
|
|
35144
35144
|
init_pagination();
|
|
35145
35145
|
init_button2();
|
|
35146
35146
|
|
|
@@ -35653,14 +35653,9 @@ function TableRow({
|
|
|
35653
35653
|
compact,
|
|
35654
35654
|
selectable,
|
|
35655
35655
|
selected,
|
|
35656
|
-
onSelect
|
|
35657
|
-
animateRowReorder,
|
|
35658
|
-
motionDiv
|
|
35656
|
+
onSelect
|
|
35659
35657
|
}) {
|
|
35660
35658
|
const isLinkMode = Boolean(href) && !onClick;
|
|
35661
|
-
const animate = Boolean(animateRowReorder && motionDiv);
|
|
35662
|
-
const Row = animate ? motionDiv : "div";
|
|
35663
|
-
const motionProps = animate ? { layout: "position", transition: { layout: { duration: 0.35, ease: [0.22, 1, 0.36, 1] } } } : {};
|
|
35664
35659
|
const handleRowClick = (e) => {
|
|
35665
35660
|
const target = e.target;
|
|
35666
35661
|
if (target.closest("[data-no-row-click]")) {
|
|
@@ -35696,9 +35691,8 @@ function TableRow({
|
|
|
35696
35691
|
return String(value);
|
|
35697
35692
|
};
|
|
35698
35693
|
return /* @__PURE__ */ jsxs226(
|
|
35699
|
-
|
|
35694
|
+
"div",
|
|
35700
35695
|
{
|
|
35701
|
-
...motionProps,
|
|
35702
35696
|
className: cn(
|
|
35703
35697
|
"relative rounded-[6px] bg-ods-card border border-ods-border overflow-hidden",
|
|
35704
35698
|
(onClick || isLinkMode) && "cursor-pointer hover:bg-ods-bg-active transition-colors",
|
|
@@ -35750,24 +35744,6 @@ function TableRow({
|
|
|
35750
35744
|
);
|
|
35751
35745
|
}
|
|
35752
35746
|
|
|
35753
|
-
// src/components/ui/table/use-table-motion.ts
|
|
35754
|
-
import { useEffect as useEffect66, useState as useState85 } from "react";
|
|
35755
|
-
function useTableMotion(enabled) {
|
|
35756
|
-
const [runtime, setRuntime] = useState85(null);
|
|
35757
|
-
useEffect66(() => {
|
|
35758
|
-
if (!enabled || runtime) return;
|
|
35759
|
-
let active = true;
|
|
35760
|
-
import("framer-motion").then((m) => {
|
|
35761
|
-
if (active) setRuntime({ motionDiv: m.motion.div, LayoutGroup: m.LayoutGroup });
|
|
35762
|
-
}).catch(() => {
|
|
35763
|
-
});
|
|
35764
|
-
return () => {
|
|
35765
|
-
active = false;
|
|
35766
|
-
};
|
|
35767
|
-
}, [enabled, runtime]);
|
|
35768
|
-
return enabled ? runtime : null;
|
|
35769
|
-
}
|
|
35770
|
-
|
|
35771
35747
|
// src/components/ui/table/table.tsx
|
|
35772
35748
|
import { Fragment as Fragment50, jsx as jsx283, jsxs as jsxs227 } from "react/jsx-runtime";
|
|
35773
35749
|
function injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref) {
|
|
@@ -35853,10 +35829,8 @@ function Table({
|
|
|
35853
35829
|
paginationClassName,
|
|
35854
35830
|
infiniteScroll,
|
|
35855
35831
|
stickyHeader,
|
|
35856
|
-
stickyHeaderOffset
|
|
35857
|
-
animateRowReorder
|
|
35832
|
+
stickyHeaderOffset
|
|
35858
35833
|
}) {
|
|
35859
|
-
const tableMotion = useTableMotion(Boolean(animateRowReorder));
|
|
35860
35834
|
const columnsWithActions = injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref);
|
|
35861
35835
|
const getRowHref = (item) => {
|
|
35862
35836
|
if (onRowClick || !rowHref) return void 0;
|
|
@@ -35903,7 +35877,7 @@ function Table({
|
|
|
35903
35877
|
const sentinelRef = useRef48(null);
|
|
35904
35878
|
const onLoadMoreRef = useRef48(infiniteScroll?.onLoadMore);
|
|
35905
35879
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
35906
|
-
|
|
35880
|
+
useEffect66(() => {
|
|
35907
35881
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
35908
35882
|
const sentinel = sentinelRef.current;
|
|
35909
35883
|
if (!sentinel) return;
|
|
@@ -35972,28 +35946,22 @@ function Table({
|
|
|
35972
35946
|
hasChevron: Boolean(rowHref)
|
|
35973
35947
|
}
|
|
35974
35948
|
) : data.length === 0 ? /* @__PURE__ */ jsx283(TableEmptyState, { message: emptyMessage }) : /* @__PURE__ */ jsxs227(Fragment50, { children: [
|
|
35975
|
-
(() =>
|
|
35976
|
-
|
|
35977
|
-
|
|
35978
|
-
|
|
35979
|
-
|
|
35980
|
-
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
|
|
35984
|
-
|
|
35985
|
-
|
|
35986
|
-
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
|
|
35990
|
-
|
|
35991
|
-
},
|
|
35992
|
-
getRowKey(item, index)
|
|
35993
|
-
));
|
|
35994
|
-
const LayoutGroup = tableMotion?.LayoutGroup;
|
|
35995
|
-
return animateRowReorder && LayoutGroup ? /* @__PURE__ */ jsx283(LayoutGroup, { children: rows }) : rows;
|
|
35996
|
-
})(),
|
|
35949
|
+
data.map((item, index) => /* @__PURE__ */ jsx283(
|
|
35950
|
+
TableRow,
|
|
35951
|
+
{
|
|
35952
|
+
item,
|
|
35953
|
+
columns: columnsWithActions,
|
|
35954
|
+
onClick: onRowClick,
|
|
35955
|
+
href: getRowHref(item),
|
|
35956
|
+
className: getRowClassName(item, index),
|
|
35957
|
+
index,
|
|
35958
|
+
compact,
|
|
35959
|
+
selectable,
|
|
35960
|
+
selected: isRowSelected(item),
|
|
35961
|
+
onSelect: handleSelectRow
|
|
35962
|
+
},
|
|
35963
|
+
getRowKey(item, index)
|
|
35964
|
+
)),
|
|
35997
35965
|
infiniteScroll?.isFetchingNextPage && /* @__PURE__ */ jsx283(
|
|
35998
35966
|
TableCardSkeleton,
|
|
35999
35967
|
{
|
|
@@ -36121,7 +36089,7 @@ import { useMemo as useMemo34 } from "react";
|
|
|
36121
36089
|
|
|
36122
36090
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
36123
36091
|
init_cn();
|
|
36124
|
-
import { useRef as useRef49, useState as
|
|
36092
|
+
import { useRef as useRef49, useState as useState85, useCallback as useCallback38 } from "react";
|
|
36125
36093
|
import { jsx as jsx286, jsxs as jsxs229 } from "react/jsx-runtime";
|
|
36126
36094
|
function QueryReportTableHeader({
|
|
36127
36095
|
columns,
|
|
@@ -36151,7 +36119,7 @@ function QueryReportTableHeader({
|
|
|
36151
36119
|
}
|
|
36152
36120
|
function TruncatedHeaderCell({ value, width }) {
|
|
36153
36121
|
const textRef = useRef49(null);
|
|
36154
|
-
const [isTruncated, setIsTruncated] =
|
|
36122
|
+
const [isTruncated, setIsTruncated] = useState85(false);
|
|
36155
36123
|
const checkTruncation = useCallback38(() => {
|
|
36156
36124
|
const el = textRef.current;
|
|
36157
36125
|
if (el) {
|
|
@@ -36180,7 +36148,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
36180
36148
|
|
|
36181
36149
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
36182
36150
|
init_cn();
|
|
36183
|
-
import { useRef as useRef50, useState as
|
|
36151
|
+
import { useRef as useRef50, useState as useState86, useCallback as useCallback39 } from "react";
|
|
36184
36152
|
import { jsx as jsx287, jsxs as jsxs230 } from "react/jsx-runtime";
|
|
36185
36153
|
function QueryReportTableRow({
|
|
36186
36154
|
row,
|
|
@@ -36227,7 +36195,7 @@ function QueryReportTableRow({
|
|
|
36227
36195
|
}
|
|
36228
36196
|
function TruncatedCell({ value, className }) {
|
|
36229
36197
|
const textRef = useRef50(null);
|
|
36230
|
-
const [isTruncated, setIsTruncated] =
|
|
36198
|
+
const [isTruncated, setIsTruncated] = useState86(false);
|
|
36231
36199
|
const checkTruncation = useCallback39(() => {
|
|
36232
36200
|
const el = textRef.current;
|
|
36233
36201
|
if (el) {
|
|
@@ -36976,7 +36944,7 @@ function DataTableBody({
|
|
|
36976
36944
|
}
|
|
36977
36945
|
|
|
36978
36946
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
36979
|
-
import { useEffect as
|
|
36947
|
+
import { useEffect as useEffect67, useRef as useRef52 } from "react";
|
|
36980
36948
|
import { Fragment as Fragment54, jsx as jsx297, jsxs as jsxs238 } from "react/jsx-runtime";
|
|
36981
36949
|
function DataTableInfiniteFooter({
|
|
36982
36950
|
hasNextPage,
|
|
@@ -36988,7 +36956,7 @@ function DataTableInfiniteFooter({
|
|
|
36988
36956
|
const sentinelRef = useRef52(null);
|
|
36989
36957
|
const onLoadMoreRef = useRef52(onLoadMore);
|
|
36990
36958
|
onLoadMoreRef.current = onLoadMore;
|
|
36991
|
-
|
|
36959
|
+
useEffect67(() => {
|
|
36992
36960
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
36993
36961
|
const sentinel = sentinelRef.current;
|
|
36994
36962
|
if (!sentinel) return;
|
|
@@ -37622,9 +37590,9 @@ function FilterList({
|
|
|
37622
37590
|
|
|
37623
37591
|
// src/components/ui/tag-search-input.tsx
|
|
37624
37592
|
import {
|
|
37625
|
-
useEffect as
|
|
37593
|
+
useEffect as useEffect69,
|
|
37626
37594
|
useRef as useRef54,
|
|
37627
|
-
useState as
|
|
37595
|
+
useState as useState88
|
|
37628
37596
|
} from "react";
|
|
37629
37597
|
init_cn();
|
|
37630
37598
|
import { jsx as jsx301, jsxs as jsxs242 } from "react/jsx-runtime";
|
|
@@ -37661,8 +37629,8 @@ function TagSearchInput({
|
|
|
37661
37629
|
const wrapperRef = useRef54(null);
|
|
37662
37630
|
const hiddenTagsRef = useRef54(null);
|
|
37663
37631
|
const hiddenTagsPopupRef = useRef54(null);
|
|
37664
|
-
const [showHiddenTags, setShowHiddenTags] =
|
|
37665
|
-
|
|
37632
|
+
const [showHiddenTags, setShowHiddenTags] = useState88(false);
|
|
37633
|
+
useEffect69(() => {
|
|
37666
37634
|
if (!showHiddenTags) return;
|
|
37667
37635
|
const handleClick = (e) => {
|
|
37668
37636
|
const target = e.target;
|
|
@@ -37817,7 +37785,7 @@ function TagSearchInput({
|
|
|
37817
37785
|
}
|
|
37818
37786
|
|
|
37819
37787
|
// src/components/ui/markdown-editor.tsx
|
|
37820
|
-
import { useRef as useRef55, useCallback as useCallback42, useState as
|
|
37788
|
+
import { useRef as useRef55, useCallback as useCallback42, useState as useState89, useEffect as useEffect70 } from "react";
|
|
37821
37789
|
init_cn();
|
|
37822
37790
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
37823
37791
|
import { jsx as jsx302, jsxs as jsxs243 } from "react/jsx-runtime";
|
|
@@ -37848,7 +37816,7 @@ body .w-md-editor .w-md-editor-bar::after { content: '' !important; display: blo
|
|
|
37848
37816
|
body .w-md-editor .w-md-editor-bar:hover::after { border-color: var(--color-text-secondary) !important; }
|
|
37849
37817
|
`;
|
|
37850
37818
|
function MarkdownEditorStyles() {
|
|
37851
|
-
|
|
37819
|
+
useEffect70(() => {
|
|
37852
37820
|
if (document.getElementById(MARKDOWN_EDITOR_STYLE_ID)) return;
|
|
37853
37821
|
const style = document.createElement("style");
|
|
37854
37822
|
style.id = MARKDOWN_EDITOR_STYLE_ID;
|
|
@@ -37873,10 +37841,10 @@ function MarkdownEditor({
|
|
|
37873
37841
|
renderPreview
|
|
37874
37842
|
}) {
|
|
37875
37843
|
const fileInputRef = useRef55(null);
|
|
37876
|
-
const [isUploading, setIsUploading] =
|
|
37877
|
-
const [uploadProgress, setUploadProgress] =
|
|
37878
|
-
const [defaultExtraCommands, setDefaultExtraCommands] =
|
|
37879
|
-
|
|
37844
|
+
const [isUploading, setIsUploading] = useState89(false);
|
|
37845
|
+
const [uploadProgress, setUploadProgress] = useState89("");
|
|
37846
|
+
const [defaultExtraCommands, setDefaultExtraCommands] = useState89([]);
|
|
37847
|
+
useEffect70(() => {
|
|
37880
37848
|
import("@uiw/react-md-editor").then((mod) => {
|
|
37881
37849
|
if (mod.commands?.getExtraCommands) {
|
|
37882
37850
|
setDefaultExtraCommands(mod.commands.getExtraCommands());
|
|
@@ -37999,7 +37967,7 @@ function MarkdownEditor({
|
|
|
37999
37967
|
}
|
|
38000
37968
|
rafRef.current = requestAnimationFrame(scrollLoop);
|
|
38001
37969
|
}, []);
|
|
38002
|
-
|
|
37970
|
+
useEffect70(() => {
|
|
38003
37971
|
const wrapper = wrapperRef.current;
|
|
38004
37972
|
if (!wrapper) return;
|
|
38005
37973
|
const onMouseMove = (e) => {
|
|
@@ -39481,8 +39449,8 @@ function ImageGalleryModal({
|
|
|
39481
39449
|
onClose,
|
|
39482
39450
|
initialIndex = 0
|
|
39483
39451
|
}) {
|
|
39484
|
-
const [selectedImageIndex, setSelectedImageIndex] =
|
|
39485
|
-
|
|
39452
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState96(initialIndex);
|
|
39453
|
+
useEffect73(() => {
|
|
39486
39454
|
if (isOpen) {
|
|
39487
39455
|
setSelectedImageIndex(initialIndex);
|
|
39488
39456
|
}
|
|
@@ -39497,7 +39465,7 @@ function ImageGalleryModal({
|
|
|
39497
39465
|
setSelectedImageIndex(selectedImageIndex + 1);
|
|
39498
39466
|
}
|
|
39499
39467
|
};
|
|
39500
|
-
|
|
39468
|
+
useEffect73(() => {
|
|
39501
39469
|
const handleKeyPress = (event) => {
|
|
39502
39470
|
if (!isOpen) return;
|
|
39503
39471
|
switch (event.key) {
|
|
@@ -39700,7 +39668,7 @@ function RoadmapCard({
|
|
|
39700
39668
|
onVote,
|
|
39701
39669
|
isVoting = false
|
|
39702
39670
|
}) {
|
|
39703
|
-
const [showScreenshots, setShowScreenshots] =
|
|
39671
|
+
const [showScreenshots, setShowScreenshots] = useState97(false);
|
|
39704
39672
|
const logoUrl = item.icon && item.icon.startsWith("http") ? item.icon : null;
|
|
39705
39673
|
const iconSrc = logoUrl ? getProxiedImageUrl(logoUrl, { directHttps: true }) || logoUrl : null;
|
|
39706
39674
|
if (size === "sm") {
|
|
@@ -40336,7 +40304,7 @@ function DataRoomDocCardSkeleton({ className }) {
|
|
|
40336
40304
|
}
|
|
40337
40305
|
|
|
40338
40306
|
// src/components/chat/entity-cards/program-card.tsx
|
|
40339
|
-
import { useState as
|
|
40307
|
+
import { useState as useState98 } from "react";
|
|
40340
40308
|
|
|
40341
40309
|
// node_modules/date-fns/toDate.mjs
|
|
40342
40310
|
function toDate(argument) {
|
|
@@ -41973,8 +41941,8 @@ function getHosts(hosts) {
|
|
|
41973
41941
|
return [];
|
|
41974
41942
|
}
|
|
41975
41943
|
function MediaGallery({ images, title }) {
|
|
41976
|
-
const [selectedImageIndex, setSelectedImageIndex] =
|
|
41977
|
-
const [isModalOpen, setIsModalOpen] =
|
|
41944
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState98(null);
|
|
41945
|
+
const [isModalOpen, setIsModalOpen] = useState98(false);
|
|
41978
41946
|
const openImageModal = (index, event) => {
|
|
41979
41947
|
if (event) event.stopPropagation();
|
|
41980
41948
|
setSelectedImageIndex(index);
|
|
@@ -43759,7 +43727,7 @@ function useChunkCatchup({
|
|
|
43759
43727
|
}
|
|
43760
43728
|
|
|
43761
43729
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
43762
|
-
import { useEffect as
|
|
43730
|
+
import { useEffect as useEffect74, useRef as useRef60, useState as useState99 } from "react";
|
|
43763
43731
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
43764
43732
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
43765
43733
|
function useJetStreamDialogSubscription({
|
|
@@ -43778,57 +43746,57 @@ function useJetStreamDialogSubscription({
|
|
|
43778
43746
|
reconnectionBackoff,
|
|
43779
43747
|
inactiveThresholdMs
|
|
43780
43748
|
}) {
|
|
43781
|
-
const [isConnected, setIsConnected] =
|
|
43782
|
-
const [isSubscribed, setIsSubscribed] =
|
|
43783
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
43784
|
-
const [currentStreamSeq, setCurrentStreamSeq] =
|
|
43749
|
+
const [isConnected, setIsConnected] = useState99(false);
|
|
43750
|
+
const [isSubscribed, setIsSubscribed] = useState99(false);
|
|
43751
|
+
const [reconnectionCount, setReconnectionCount] = useState99(0);
|
|
43752
|
+
const [currentStreamSeq, setCurrentStreamSeq] = useState99(null);
|
|
43785
43753
|
const clientRef = useRef60(null);
|
|
43786
43754
|
const subscriptionRef = useRef60(null);
|
|
43787
43755
|
const highestStreamSeqRef = useRef60(null);
|
|
43788
43756
|
const onEventRef = useRef60(onEvent);
|
|
43789
|
-
|
|
43757
|
+
useEffect74(() => {
|
|
43790
43758
|
onEventRef.current = onEvent;
|
|
43791
43759
|
}, [onEvent]);
|
|
43792
43760
|
const onConnectRef = useRef60(onConnect);
|
|
43793
|
-
|
|
43761
|
+
useEffect74(() => {
|
|
43794
43762
|
onConnectRef.current = onConnect;
|
|
43795
43763
|
}, [onConnect]);
|
|
43796
43764
|
const onDisconnectRef = useRef60(onDisconnect);
|
|
43797
|
-
|
|
43765
|
+
useEffect74(() => {
|
|
43798
43766
|
onDisconnectRef.current = onDisconnect;
|
|
43799
43767
|
}, [onDisconnect]);
|
|
43800
43768
|
const onSubscribedRef = useRef60(onSubscribed);
|
|
43801
|
-
|
|
43769
|
+
useEffect74(() => {
|
|
43802
43770
|
onSubscribedRef.current = onSubscribed;
|
|
43803
43771
|
}, [onSubscribed]);
|
|
43804
43772
|
const onBeforeReconnectRef = useRef60(onBeforeReconnect);
|
|
43805
|
-
|
|
43773
|
+
useEffect74(() => {
|
|
43806
43774
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
43807
43775
|
}, [onBeforeReconnect]);
|
|
43808
43776
|
const getNatsWsUrlRef = useRef60(getNatsWsUrl);
|
|
43809
|
-
|
|
43777
|
+
useEffect74(() => {
|
|
43810
43778
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
43811
43779
|
}, [getNatsWsUrl]);
|
|
43812
43780
|
const reconnectionBackoffRef = useRef60(reconnectionBackoff);
|
|
43813
|
-
|
|
43781
|
+
useEffect74(() => {
|
|
43814
43782
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
43815
43783
|
}, [reconnectionBackoff]);
|
|
43816
43784
|
const optStartSeqRef = useRef60(optStartSeq);
|
|
43817
|
-
|
|
43785
|
+
useEffect74(() => {
|
|
43818
43786
|
optStartSeqRef.current = optStartSeq;
|
|
43819
43787
|
}, [optStartSeq]);
|
|
43820
43788
|
const inactiveThresholdRef = useRef60(inactiveThresholdMs);
|
|
43821
|
-
|
|
43789
|
+
useEffect74(() => {
|
|
43822
43790
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
43823
43791
|
}, [inactiveThresholdMs]);
|
|
43824
43792
|
const hadConnectionBeforeRef = useRef60(false);
|
|
43825
43793
|
const clientConfigRef = useRef60(clientConfig);
|
|
43826
|
-
|
|
43794
|
+
useEffect74(() => {
|
|
43827
43795
|
clientConfigRef.current = clientConfig;
|
|
43828
43796
|
}, [clientConfig]);
|
|
43829
43797
|
const currentWsUrlRef = useRef60("");
|
|
43830
43798
|
const wsUrl = getNatsWsUrl();
|
|
43831
|
-
|
|
43799
|
+
useEffect74(() => {
|
|
43832
43800
|
if (!enabled || !wsUrl) {
|
|
43833
43801
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
43834
43802
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -43909,7 +43877,7 @@ function useJetStreamDialogSubscription({
|
|
|
43909
43877
|
}
|
|
43910
43878
|
};
|
|
43911
43879
|
}, [enabled, wsUrl]);
|
|
43912
|
-
|
|
43880
|
+
useEffect74(() => {
|
|
43913
43881
|
if (!enabled || !dialogId || !isConnected) {
|
|
43914
43882
|
if (subscriptionRef.current) {
|
|
43915
43883
|
try {
|
|
@@ -43992,7 +43960,7 @@ function useJetStreamDialogSubscription({
|
|
|
43992
43960
|
setIsSubscribed(false);
|
|
43993
43961
|
};
|
|
43994
43962
|
}, [enabled, dialogId, isConnected, streamName, topic, reconnectionCount]);
|
|
43995
|
-
|
|
43963
|
+
useEffect74(() => {
|
|
43996
43964
|
highestStreamSeqRef.current = null;
|
|
43997
43965
|
setCurrentStreamSeq(null);
|
|
43998
43966
|
}, [dialogId]);
|
|
@@ -44000,7 +43968,7 @@ function useJetStreamDialogSubscription({
|
|
|
44000
43968
|
}
|
|
44001
43969
|
|
|
44002
43970
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
44003
|
-
import { useEffect as
|
|
43971
|
+
import { useEffect as useEffect75, useRef as useRef61, useState as useState100 } from "react";
|
|
44004
43972
|
function useNatsDialogSubscription({
|
|
44005
43973
|
enabled,
|
|
44006
43974
|
dialogId,
|
|
@@ -44014,47 +43982,47 @@ function useNatsDialogSubscription({
|
|
|
44014
43982
|
clientConfig = {},
|
|
44015
43983
|
reconnectionBackoff
|
|
44016
43984
|
}) {
|
|
44017
|
-
const [isConnected, setIsConnected] =
|
|
44018
|
-
const [isSubscribed, setIsSubscribed] =
|
|
44019
|
-
const [reconnectionCount, setReconnectionCount] =
|
|
43985
|
+
const [isConnected, setIsConnected] = useState100(false);
|
|
43986
|
+
const [isSubscribed, setIsSubscribed] = useState100(false);
|
|
43987
|
+
const [reconnectionCount, setReconnectionCount] = useState100(0);
|
|
44020
43988
|
const clientRef = useRef61(null);
|
|
44021
43989
|
const subscriptionRefs = useRef61(/* @__PURE__ */ new Map());
|
|
44022
43990
|
const onEventRef = useRef61(onEvent);
|
|
44023
|
-
|
|
43991
|
+
useEffect75(() => {
|
|
44024
43992
|
onEventRef.current = onEvent;
|
|
44025
43993
|
}, [onEvent]);
|
|
44026
43994
|
const onConnectRef = useRef61(onConnect);
|
|
44027
|
-
|
|
43995
|
+
useEffect75(() => {
|
|
44028
43996
|
onConnectRef.current = onConnect;
|
|
44029
43997
|
}, [onConnect]);
|
|
44030
43998
|
const onDisconnectRef = useRef61(onDisconnect);
|
|
44031
|
-
|
|
43999
|
+
useEffect75(() => {
|
|
44032
44000
|
onDisconnectRef.current = onDisconnect;
|
|
44033
44001
|
}, [onDisconnect]);
|
|
44034
44002
|
const onSubscribedRef = useRef61(onSubscribed);
|
|
44035
|
-
|
|
44003
|
+
useEffect75(() => {
|
|
44036
44004
|
onSubscribedRef.current = onSubscribed;
|
|
44037
44005
|
}, [onSubscribed]);
|
|
44038
44006
|
const onBeforeReconnectRef = useRef61(onBeforeReconnect);
|
|
44039
|
-
|
|
44007
|
+
useEffect75(() => {
|
|
44040
44008
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
44041
44009
|
}, [onBeforeReconnect]);
|
|
44042
44010
|
const hadConnectionBeforeRef = useRef61(false);
|
|
44043
44011
|
const getNatsWsUrlRef = useRef61(getNatsWsUrl);
|
|
44044
|
-
|
|
44012
|
+
useEffect75(() => {
|
|
44045
44013
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
44046
44014
|
}, [getNatsWsUrl]);
|
|
44047
44015
|
const reconnectionBackoffRef = useRef61(reconnectionBackoff);
|
|
44048
|
-
|
|
44016
|
+
useEffect75(() => {
|
|
44049
44017
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
44050
44018
|
}, [reconnectionBackoff]);
|
|
44051
44019
|
const clientConfigRef = useRef61(clientConfig);
|
|
44052
|
-
|
|
44020
|
+
useEffect75(() => {
|
|
44053
44021
|
clientConfigRef.current = clientConfig;
|
|
44054
44022
|
}, [clientConfig]);
|
|
44055
44023
|
const currentWsUrlRef = useRef61("");
|
|
44056
44024
|
const wsUrl = getNatsWsUrl();
|
|
44057
|
-
|
|
44025
|
+
useEffect75(() => {
|
|
44058
44026
|
if (!enabled || !wsUrl) {
|
|
44059
44027
|
if (currentWsUrlRef.current && clientRef.current) {
|
|
44060
44028
|
releaseClient(currentWsUrlRef.current);
|
|
@@ -44138,12 +44106,12 @@ function useNatsDialogSubscription({
|
|
|
44138
44106
|
const topicsKey = topics.join(",");
|
|
44139
44107
|
const lastSubscribedDialogIdRef = useRef61(null);
|
|
44140
44108
|
const isConnectedRef = useRef61(isConnected);
|
|
44141
|
-
|
|
44109
|
+
useEffect75(() => {
|
|
44142
44110
|
isConnectedRef.current = isConnected;
|
|
44143
44111
|
}, [isConnected]);
|
|
44144
44112
|
const currentDialogIdRef = useRef61(null);
|
|
44145
44113
|
const abortControllerRef = useRef61(null);
|
|
44146
|
-
|
|
44114
|
+
useEffect75(() => {
|
|
44147
44115
|
currentDialogIdRef.current = dialogId;
|
|
44148
44116
|
if (!enabled || !dialogId) {
|
|
44149
44117
|
if (subscriptionRefs.current.size > 0) {
|
|
@@ -44224,7 +44192,7 @@ function useNatsDialogSubscription({
|
|
|
44224
44192
|
abortControllerRef.current = null;
|
|
44225
44193
|
};
|
|
44226
44194
|
}, [enabled, dialogId, topicsKey, topics]);
|
|
44227
|
-
|
|
44195
|
+
useEffect75(() => {
|
|
44228
44196
|
if (!enabled || !currentDialogIdRef.current || !isConnected) {
|
|
44229
44197
|
return;
|
|
44230
44198
|
}
|
|
@@ -44274,7 +44242,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
44274
44242
|
}
|
|
44275
44243
|
|
|
44276
44244
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
44277
|
-
import { useCallback as useCallback45, useRef as useRef62, useEffect as
|
|
44245
|
+
import { useCallback as useCallback45, useRef as useRef62, useEffect as useEffect76 } from "react";
|
|
44278
44246
|
|
|
44279
44247
|
// src/components/chat/utils/chunk-parser.ts
|
|
44280
44248
|
function normalizeToolCalls(raw) {
|
|
@@ -44932,7 +44900,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
44932
44900
|
})
|
|
44933
44901
|
);
|
|
44934
44902
|
const hasInitializedWithData = useRef62(false);
|
|
44935
|
-
|
|
44903
|
+
useEffect76(() => {
|
|
44936
44904
|
if (initialState && !hasInitializedWithData.current) {
|
|
44937
44905
|
accumulatorRef.current.initializeWithState(initialState);
|
|
44938
44906
|
if (initialState.escalatedApprovals) {
|
|
@@ -44949,7 +44917,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
44949
44917
|
const hasEverStreamedRef = useRef62(false);
|
|
44950
44918
|
const directModeFlagRef = useRef62(isDirectMode);
|
|
44951
44919
|
const sawDirectMessageRef = useRef62(false);
|
|
44952
|
-
|
|
44920
|
+
useEffect76(() => {
|
|
44953
44921
|
directModeFlagRef.current = isDirectMode;
|
|
44954
44922
|
}, [isDirectMode]);
|
|
44955
44923
|
const pendingEscalatedRef = useRef62(/* @__PURE__ */ new Map());
|
|
@@ -45210,7 +45178,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
45210
45178
|
}
|
|
45211
45179
|
|
|
45212
45180
|
// src/components/chat/hooks/use-slash-commands.ts
|
|
45213
|
-
import { useEffect as
|
|
45181
|
+
import { useEffect as useEffect77, useState as useState101 } from "react";
|
|
45214
45182
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
45215
45183
|
async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
45216
45184
|
try {
|
|
@@ -45227,9 +45195,9 @@ async function fetchSlashCommands(prefix, signal, commandsUrl) {
|
|
|
45227
45195
|
}
|
|
45228
45196
|
}
|
|
45229
45197
|
function useSlashCommands(prefix, commandsUrl) {
|
|
45230
|
-
const [commands, setCommands] =
|
|
45231
|
-
const [loading, setLoading] =
|
|
45232
|
-
|
|
45198
|
+
const [commands, setCommands] = useState101([]);
|
|
45199
|
+
const [loading, setLoading] = useState101(false);
|
|
45200
|
+
useEffect77(() => {
|
|
45233
45201
|
if (prefix == null) {
|
|
45234
45202
|
setCommands([]);
|
|
45235
45203
|
return;
|
|
@@ -45329,7 +45297,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
45329
45297
|
}
|
|
45330
45298
|
|
|
45331
45299
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
45332
|
-
import { useCallback as useCallback46, useMemo as useMemo38, useRef as useRef63, useState as
|
|
45300
|
+
import { useCallback as useCallback46, useMemo as useMemo38, useRef as useRef63, useState as useState102 } from "react";
|
|
45333
45301
|
import { fileTypeFromBlob } from "file-type";
|
|
45334
45302
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
45335
45303
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -45405,7 +45373,7 @@ function uploadWithProgress(url, file, token, onProgress, signal) {
|
|
|
45405
45373
|
function useChatAttachments() {
|
|
45406
45374
|
const runtime = useRequiredChatRuntime();
|
|
45407
45375
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
45408
|
-
const [attachments, setAttachments] =
|
|
45376
|
+
const [attachments, setAttachments] = useState102([]);
|
|
45409
45377
|
const controllersRef = useRef63(/* @__PURE__ */ new Map());
|
|
45410
45378
|
const updateOne = useCallback46((id, patch) => {
|
|
45411
45379
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
@@ -45572,16 +45540,16 @@ function useChatAttachments() {
|
|
|
45572
45540
|
}
|
|
45573
45541
|
|
|
45574
45542
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
45575
|
-
import { useCallback as useCallback47, useEffect as
|
|
45543
|
+
import { useCallback as useCallback47, useEffect as useEffect78, useRef as useRef64, useState as useState103 } from "react";
|
|
45576
45544
|
import { jsx as jsx326 } from "react/jsx-runtime";
|
|
45577
45545
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
45578
45546
|
function useChatAttachmentImageGallery() {
|
|
45579
45547
|
const runtime = useRequiredChatRuntime();
|
|
45580
45548
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
45581
45549
|
const panelRef = useRef64(null);
|
|
45582
|
-
const [state, setState] =
|
|
45550
|
+
const [state, setState] = useState103(CLOSED);
|
|
45583
45551
|
const handleClose = useCallback47(() => setState(CLOSED), []);
|
|
45584
|
-
|
|
45552
|
+
useEffect78(() => {
|
|
45585
45553
|
const root = panelRef.current;
|
|
45586
45554
|
if (!root) return;
|
|
45587
45555
|
const onClick = (ev) => {
|
|
@@ -45627,7 +45595,7 @@ function absolutize(prefix) {
|
|
|
45627
45595
|
}
|
|
45628
45596
|
|
|
45629
45597
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
45630
|
-
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as
|
|
45598
|
+
import { createContext as createContext12, createElement as createElement2, useContext as useContext12, useEffect as useEffect79, useState as useState104 } from "react";
|
|
45631
45599
|
var ANON_DEFAULTS = {
|
|
45632
45600
|
authTier: "anon",
|
|
45633
45601
|
source: null,
|
|
@@ -45638,9 +45606,9 @@ function useResolveChatIdentity(enabled) {
|
|
|
45638
45606
|
const runtime = useRequiredChatRuntime();
|
|
45639
45607
|
const url = runtime.endpoints.identityUrl;
|
|
45640
45608
|
const proxyEmail = getEmbedProxyAuth()?.email ?? null;
|
|
45641
|
-
const [data, setData] =
|
|
45642
|
-
const [isLoading, setIsLoading] =
|
|
45643
|
-
|
|
45609
|
+
const [data, setData] = useState104(ANON_DEFAULTS);
|
|
45610
|
+
const [isLoading, setIsLoading] = useState104(enabled);
|
|
45611
|
+
useEffect79(() => {
|
|
45644
45612
|
if (!enabled) return;
|
|
45645
45613
|
let cancelled = false;
|
|
45646
45614
|
const ctrl = new AbortController();
|
|
@@ -45682,11 +45650,11 @@ function useChatIdentity() {
|
|
|
45682
45650
|
}
|
|
45683
45651
|
|
|
45684
45652
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
45685
|
-
import { useEffect as
|
|
45653
|
+
import { useEffect as useEffect80, useRef as useRef65 } from "react";
|
|
45686
45654
|
function useCloseOnNavigation(close, pathname) {
|
|
45687
45655
|
const prevPathnameRef = useRef65(null);
|
|
45688
45656
|
const initializedRef = useRef65(false);
|
|
45689
|
-
|
|
45657
|
+
useEffect80(() => {
|
|
45690
45658
|
if (!initializedRef.current) {
|
|
45691
45659
|
initializedRef.current = true;
|
|
45692
45660
|
prevPathnameRef.current = pathname;
|
|
@@ -45700,13 +45668,13 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
45700
45668
|
}
|
|
45701
45669
|
|
|
45702
45670
|
// src/components/chat/hooks/use-chat.ts
|
|
45703
|
-
import { useState as
|
|
45671
|
+
import { useState as useState106, useCallback as useCallback49, useEffect as useEffect81, useRef as useRef67 } from "react";
|
|
45704
45672
|
|
|
45705
45673
|
// src/components/chat/hooks/use-sse.ts
|
|
45706
|
-
import { useState as
|
|
45674
|
+
import { useState as useState105, useCallback as useCallback48, useRef as useRef66 } from "react";
|
|
45707
45675
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
45708
|
-
const [isStreaming, setIsStreaming] =
|
|
45709
|
-
const [error, setError] =
|
|
45676
|
+
const [isStreaming, setIsStreaming] = useState105(false);
|
|
45677
|
+
const [error, setError] = useState105(null);
|
|
45710
45678
|
const abortControllerRef = useRef66(null);
|
|
45711
45679
|
const fallbackStream = useCallback48(async function* () {
|
|
45712
45680
|
throw new Error(
|
|
@@ -45773,12 +45741,12 @@ function useChat({
|
|
|
45773
45741
|
initialMessages,
|
|
45774
45742
|
onMessagesChange
|
|
45775
45743
|
} = {}) {
|
|
45776
|
-
const [messages, setMessages] =
|
|
45777
|
-
const [isTyping, setIsTyping] =
|
|
45744
|
+
const [messages, setMessages] = useState106(() => initialMessages ?? []);
|
|
45745
|
+
const [isTyping, setIsTyping] = useState106(false);
|
|
45778
45746
|
const currentAssistantSegmentsRef = useRef67([]);
|
|
45779
45747
|
const onMessagesChangeRef = useRef67(onMessagesChange);
|
|
45780
45748
|
onMessagesChangeRef.current = onMessagesChange;
|
|
45781
|
-
|
|
45749
|
+
useEffect81(() => {
|
|
45782
45750
|
onMessagesChangeRef.current?.(messages);
|
|
45783
45751
|
}, [messages]);
|
|
45784
45752
|
const {
|
|
@@ -46067,7 +46035,7 @@ function useChat({
|
|
|
46067
46035
|
}
|
|
46068
46036
|
|
|
46069
46037
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
46070
|
-
import { useState as
|
|
46038
|
+
import { useState as useState107, useEffect as useEffect82, useCallback as useCallback50, useMemo as useMemo39, useRef as useRef68 } from "react";
|
|
46071
46039
|
function createEmptyTurnMeta() {
|
|
46072
46040
|
return {
|
|
46073
46041
|
provider: null,
|
|
@@ -46402,8 +46370,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46402
46370
|
const metaMapRef = useRef68(/* @__PURE__ */ new Map());
|
|
46403
46371
|
const messagesRef = useRef68(persistedRef.current.messages);
|
|
46404
46372
|
const sendCountRef = useRef68(persistedRef.current.sendCount);
|
|
46405
|
-
const [streamingPhase, setStreamingPhase] =
|
|
46406
|
-
const [metaTick, setMetaTick] =
|
|
46373
|
+
const [streamingPhase, setStreamingPhase] = useState107("idle");
|
|
46374
|
+
const [metaTick, setMetaTick] = useState107(0);
|
|
46407
46375
|
const bumpMetaTick = useCallback50(() => setMetaTick((t) => t + 1), []);
|
|
46408
46376
|
const streamFn = useMemo39(
|
|
46409
46377
|
() => createDocStreamFn(
|
|
@@ -46591,7 +46559,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46591
46559
|
}
|
|
46592
46560
|
}
|
|
46593
46561
|
}, [chatClearMessages, source, bumpMetaTick]);
|
|
46594
|
-
|
|
46562
|
+
useEffect82(() => {
|
|
46595
46563
|
if (!isTyping && !isStreaming && streamingPhase !== "idle") {
|
|
46596
46564
|
setStreamingPhase("idle");
|
|
46597
46565
|
}
|
|
@@ -46673,10 +46641,10 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
46673
46641
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
46674
46642
|
import {
|
|
46675
46643
|
useCallback as useCallback51,
|
|
46676
|
-
useEffect as
|
|
46644
|
+
useEffect as useEffect83,
|
|
46677
46645
|
useMemo as useMemo40,
|
|
46678
46646
|
useRef as useRef69,
|
|
46679
|
-
useState as
|
|
46647
|
+
useState as useState108
|
|
46680
46648
|
} from "react";
|
|
46681
46649
|
|
|
46682
46650
|
// src/components/chat/utils/process-historical-messages.ts
|
|
@@ -47166,23 +47134,23 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47166
47134
|
modelLabel = null
|
|
47167
47135
|
} = config;
|
|
47168
47136
|
const isManagedMode = fetchDialogs !== void 0;
|
|
47169
|
-
const [internalDialogId, setInternalDialogId] =
|
|
47137
|
+
const [internalDialogId, setInternalDialogId] = useState108(null);
|
|
47170
47138
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
47171
|
-
const [messages, setMessages] =
|
|
47172
|
-
const [streamingPhase, setStreamingPhase] =
|
|
47173
|
-
const [approvalStatuses, setApprovalStatuses] =
|
|
47174
|
-
const [dialogs, setDialogs] =
|
|
47175
|
-
const [dialogsNextCursor, setDialogsNextCursor] =
|
|
47176
|
-
const [isDialogsLoading, setIsDialogsLoading] =
|
|
47177
|
-
const [dialogsError, setDialogsError] =
|
|
47178
|
-
const [isCreatingDialog, setIsCreatingDialog] =
|
|
47179
|
-
const [messagesNextCursor, setMessagesNextCursor] =
|
|
47180
|
-
const [isMessagesLoading, setIsMessagesLoading] =
|
|
47181
|
-
const [dialogTokenUsage, setDialogTokenUsage] =
|
|
47139
|
+
const [messages, setMessages] = useState108([]);
|
|
47140
|
+
const [streamingPhase, setStreamingPhase] = useState108("idle");
|
|
47141
|
+
const [approvalStatuses, setApprovalStatuses] = useState108({});
|
|
47142
|
+
const [dialogs, setDialogs] = useState108([]);
|
|
47143
|
+
const [dialogsNextCursor, setDialogsNextCursor] = useState108(null);
|
|
47144
|
+
const [isDialogsLoading, setIsDialogsLoading] = useState108(false);
|
|
47145
|
+
const [dialogsError, setDialogsError] = useState108(false);
|
|
47146
|
+
const [isCreatingDialog, setIsCreatingDialog] = useState108(false);
|
|
47147
|
+
const [messagesNextCursor, setMessagesNextCursor] = useState108(null);
|
|
47148
|
+
const [isMessagesLoading, setIsMessagesLoading] = useState108(false);
|
|
47149
|
+
const [dialogTokenUsage, setDialogTokenUsage] = useState108(
|
|
47182
47150
|
null
|
|
47183
47151
|
);
|
|
47184
|
-
const [liveModel, setLiveModel] =
|
|
47185
|
-
const [connectionState, setConnectionState] =
|
|
47152
|
+
const [liveModel, setLiveModel] = useState108(null);
|
|
47153
|
+
const [connectionState, setConnectionState] = useState108("connecting");
|
|
47186
47154
|
const handleApprove = useCallback51(
|
|
47187
47155
|
async (requestId) => {
|
|
47188
47156
|
if (!approveRequestCallback) return;
|
|
@@ -47323,7 +47291,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47323
47291
|
]
|
|
47324
47292
|
);
|
|
47325
47293
|
const prevDialogIdRef = useRef69(void 0);
|
|
47326
|
-
|
|
47294
|
+
useEffect83(() => {
|
|
47327
47295
|
if (prevDialogIdRef.current === dialogId) return;
|
|
47328
47296
|
prevDialogIdRef.current = dialogId;
|
|
47329
47297
|
historyLoadSeqRef.current += 1;
|
|
@@ -47337,7 +47305,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47337
47305
|
if (!active || !dialogId) return;
|
|
47338
47306
|
void loadDialogHistory(dialogId);
|
|
47339
47307
|
}, [active, dialogId, loadDialogHistory, resetAccumulator]);
|
|
47340
|
-
|
|
47308
|
+
useEffect83(() => {
|
|
47341
47309
|
if (!active || !dialogId) return;
|
|
47342
47310
|
resetChunkTracking();
|
|
47343
47311
|
startInitialBuffering();
|
|
@@ -47359,7 +47327,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47359
47327
|
setConnectionState("connected");
|
|
47360
47328
|
}
|
|
47361
47329
|
});
|
|
47362
|
-
|
|
47330
|
+
useEffect83(() => {
|
|
47363
47331
|
if (!active || !dialogId) {
|
|
47364
47332
|
setConnectionState("connected");
|
|
47365
47333
|
return;
|
|
@@ -47398,7 +47366,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47398
47366
|
const reloadDialogs = useCallback51(() => {
|
|
47399
47367
|
void loadDialogsPage();
|
|
47400
47368
|
}, [loadDialogsPage]);
|
|
47401
|
-
|
|
47369
|
+
useEffect83(() => {
|
|
47402
47370
|
if (!fetchDialogs) return;
|
|
47403
47371
|
if (!active) return;
|
|
47404
47372
|
if (initialDialogsLoadedRef.current) return;
|
|
@@ -47978,7 +47946,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
|
|
|
47978
47946
|
}
|
|
47979
47947
|
|
|
47980
47948
|
// src/components/chat/embeddable-chat.tsx
|
|
47981
|
-
import { useCallback as useCallback54, useEffect as
|
|
47949
|
+
import { useCallback as useCallback54, useEffect as useEffect84, useMemo as useMemo43, useRef as useRef71, useState as useState110 } from "react";
|
|
47982
47950
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
47983
47951
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
47984
47952
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -48059,7 +48027,7 @@ init_button2();
|
|
|
48059
48027
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
48060
48028
|
|
|
48061
48029
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
48062
|
-
import { useCallback as useCallback53, useMemo as useMemo42, useState as
|
|
48030
|
+
import { useCallback as useCallback53, useMemo as useMemo42, useState as useState109 } from "react";
|
|
48063
48031
|
function useChatDialogManager({
|
|
48064
48032
|
dialogs,
|
|
48065
48033
|
activeDialogId,
|
|
@@ -48070,8 +48038,8 @@ function useChatDialogManager({
|
|
|
48070
48038
|
fetchArchivedDialogs,
|
|
48071
48039
|
unarchiveDialog
|
|
48072
48040
|
}) {
|
|
48073
|
-
const [renameTarget, setRenameTarget] =
|
|
48074
|
-
const [archiveTarget, setArchiveTarget] =
|
|
48041
|
+
const [renameTarget, setRenameTarget] = useState109(null);
|
|
48042
|
+
const [archiveTarget, setArchiveTarget] = useState109(null);
|
|
48075
48043
|
const handleConfirmRename = useCallback53(
|
|
48076
48044
|
(name) => {
|
|
48077
48045
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
@@ -48094,10 +48062,10 @@ function useChatDialogManager({
|
|
|
48094
48062
|
}
|
|
48095
48063
|
setArchiveTarget(null);
|
|
48096
48064
|
}, [archiveTarget, archiveDialog, activeDialogId, clearMessages]);
|
|
48097
|
-
const [archiveOpen, setArchiveOpen] =
|
|
48098
|
-
const [archivedDialogs, setArchivedDialogs] =
|
|
48099
|
-
const [archivedCursor, setArchivedCursor] =
|
|
48100
|
-
const [archivedLoading, setArchivedLoading] =
|
|
48065
|
+
const [archiveOpen, setArchiveOpen] = useState109(false);
|
|
48066
|
+
const [archivedDialogs, setArchivedDialogs] = useState109([]);
|
|
48067
|
+
const [archivedCursor, setArchivedCursor] = useState109(null);
|
|
48068
|
+
const [archivedLoading, setArchivedLoading] = useState109(false);
|
|
48101
48069
|
const loadArchivedPage = useCallback53(
|
|
48102
48070
|
async (cursor) => {
|
|
48103
48071
|
if (!fetchArchivedDialogs) return;
|
|
@@ -48123,10 +48091,10 @@ function useChatDialogManager({
|
|
|
48123
48091
|
void loadArchivedPage();
|
|
48124
48092
|
}, [loadArchivedPage]);
|
|
48125
48093
|
const closeArchive = useCallback53(() => setArchiveOpen(false), []);
|
|
48126
|
-
const [viewingArchivedId, setViewingArchivedId] =
|
|
48094
|
+
const [viewingArchivedId, setViewingArchivedId] = useState109(
|
|
48127
48095
|
null
|
|
48128
48096
|
);
|
|
48129
|
-
const [openingDialogId, setOpeningDialogId] =
|
|
48097
|
+
const [openingDialogId, setOpeningDialogId] = useState109(null);
|
|
48130
48098
|
const handleSelectDialog = useCallback53(
|
|
48131
48099
|
(id) => {
|
|
48132
48100
|
setViewingArchivedId(null);
|
|
@@ -48145,7 +48113,7 @@ function useChatDialogManager({
|
|
|
48145
48113
|
},
|
|
48146
48114
|
[selectDialog]
|
|
48147
48115
|
);
|
|
48148
|
-
const [restoreTarget, setRestoreTarget] =
|
|
48116
|
+
const [restoreTarget, setRestoreTarget] = useState109(null);
|
|
48149
48117
|
const handleConfirmRestore = useCallback53(async () => {
|
|
48150
48118
|
if (restoreTarget) {
|
|
48151
48119
|
try {
|
|
@@ -48396,7 +48364,7 @@ function SourceChips({
|
|
|
48396
48364
|
onClose,
|
|
48397
48365
|
onDiscuss
|
|
48398
48366
|
}) {
|
|
48399
|
-
const [expanded, setExpanded] =
|
|
48367
|
+
const [expanded, setExpanded] = useState110(false);
|
|
48400
48368
|
if (cited.length === 0) {
|
|
48401
48369
|
const fallback = uncited.slice(0, FALLBACK_TOP_RETRIEVED);
|
|
48402
48370
|
if (fallback.length === 0) return null;
|
|
@@ -48495,7 +48463,7 @@ function EmbeddableChatInner({
|
|
|
48495
48463
|
const commandsUrl = runtime.endpoints.commandsUrl;
|
|
48496
48464
|
const { attachmentsEnabled, user: identityUser } = useChatIdentity();
|
|
48497
48465
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
48498
|
-
|
|
48466
|
+
useEffect84(() => {
|
|
48499
48467
|
if (process.env.NODE_ENV !== "production") {
|
|
48500
48468
|
const hasOpen = open !== void 0;
|
|
48501
48469
|
const hasHandler = onOpenChange !== void 0;
|
|
@@ -48511,13 +48479,13 @@ function EmbeddableChatInner({
|
|
|
48511
48479
|
defaultProp: defaultOpen ?? false,
|
|
48512
48480
|
onChange: onOpenChange
|
|
48513
48481
|
});
|
|
48514
|
-
const [autoFocusInput] =
|
|
48482
|
+
const [autoFocusInput] = useState110(() => {
|
|
48515
48483
|
if (typeof window === "undefined") return false;
|
|
48516
48484
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
48517
48485
|
});
|
|
48518
48486
|
usePreventScroll({ isDisabled: !isOpen || shellLess });
|
|
48519
48487
|
const navigatingAwayRef = useRef71(false);
|
|
48520
|
-
|
|
48488
|
+
useEffect84(() => {
|
|
48521
48489
|
if (!isOpen) return;
|
|
48522
48490
|
if (shellLess) return;
|
|
48523
48491
|
if (typeof window === "undefined") return;
|
|
@@ -48587,7 +48555,7 @@ function EmbeddableChatInner({
|
|
|
48587
48555
|
}, [mingoState, mingoDialogCapabilities, effectiveModes]);
|
|
48588
48556
|
const hasMingoMode = !!effectiveModes.mingo || !!mingoState;
|
|
48589
48557
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
48590
|
-
const [uncontrolledActiveMode, setUncontrolledActiveMode] =
|
|
48558
|
+
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState110(initialActiveMode);
|
|
48591
48559
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
48592
48560
|
const handleActiveModeChange = useCallback54(
|
|
48593
48561
|
(next) => {
|
|
@@ -48650,15 +48618,15 @@ function EmbeddableChatInner({
|
|
|
48650
48618
|
const { panelRef: galleryPanelRef, modal: galleryModal } = useChatAttachmentImageGallery();
|
|
48651
48619
|
const contextMaxItems = contextPicker?.maxItems ?? 10;
|
|
48652
48620
|
const contextPickerForMode = activeMode === "mingo" ? contextPicker : void 0;
|
|
48653
|
-
const [contextItems, setContextItems] =
|
|
48654
|
-
const [contextPickerOpen, setContextPickerOpen] =
|
|
48655
|
-
const [mentionQuery, setMentionQuery] =
|
|
48621
|
+
const [contextItems, setContextItems] = useState110([]);
|
|
48622
|
+
const [contextPickerOpen, setContextPickerOpen] = useState110(false);
|
|
48623
|
+
const [mentionQuery, setMentionQuery] = useState110(null);
|
|
48656
48624
|
const mentionActiveRef = useRef71(false);
|
|
48657
|
-
|
|
48625
|
+
useEffect84(() => {
|
|
48658
48626
|
mentionActiveRef.current = mentionQuery !== null;
|
|
48659
48627
|
}, [mentionQuery]);
|
|
48660
48628
|
const mentionKeysRef = useRef71(/* @__PURE__ */ new Set());
|
|
48661
|
-
|
|
48629
|
+
useEffect84(() => {
|
|
48662
48630
|
setContextItems([]);
|
|
48663
48631
|
setMentionQuery(null);
|
|
48664
48632
|
mentionKeysRef.current.clear();
|
|
@@ -48862,7 +48830,7 @@ function EmbeddableChatInner({
|
|
|
48862
48830
|
});
|
|
48863
48831
|
const handleOpen = useCallback54(() => setIsOpen(true), [setIsOpen]);
|
|
48864
48832
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
48865
|
-
|
|
48833
|
+
useEffect84(() => {
|
|
48866
48834
|
const handler = (e) => {
|
|
48867
48835
|
const detail = e.detail;
|
|
48868
48836
|
if (!detail || detail.source !== source) return;
|
|
@@ -48918,7 +48886,7 @@ function EmbeddableChatInner({
|
|
|
48918
48886
|
const uncited = sources.filter((s) => !seenOrder.has(s.index));
|
|
48919
48887
|
return { cited, uncited };
|
|
48920
48888
|
}, [lastAssistantMsg, chatLoading]);
|
|
48921
|
-
const [portalHost, setPortalHost] =
|
|
48889
|
+
const [portalHost, setPortalHost] = useState110(null);
|
|
48922
48890
|
const body = /* @__PURE__ */ jsxs265(PortalContainerContext.Provider, { value: portalHost, children: [
|
|
48923
48891
|
/* @__PURE__ */ jsx329(
|
|
48924
48892
|
"div",
|
|
@@ -50162,4 +50130,4 @@ export {
|
|
|
50162
50130
|
FAE_AVATAR_DATA_URI,
|
|
50163
50131
|
assets
|
|
50164
50132
|
};
|
|
50165
|
-
//# sourceMappingURL=chunk-
|
|
50133
|
+
//# sourceMappingURL=chunk-NDHQG4I4.js.map
|