@flamingo-stack/openframe-frontend-core 0.0.324-snapshot.20260625182754 → 0.0.324
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-XTV2EZHO.cjs → chunk-2YESJYW6.cjs} +31 -31
- package/dist/{chunk-XTV2EZHO.cjs.map → chunk-2YESJYW6.cjs.map} +1 -1
- package/dist/{chunk-WAYJ7VBD.cjs → chunk-3MVY3CT6.cjs} +12 -12
- package/dist/{chunk-WAYJ7VBD.cjs.map → chunk-3MVY3CT6.cjs.map} +1 -1
- package/dist/{chunk-5CWJGCOL.js → chunk-7343ZUA2.js} +4 -4
- package/dist/{chunk-AYBSXRRC.cjs → chunk-ALXY56MH.cjs} +527 -659
- package/dist/chunk-ALXY56MH.cjs.map +1 -0
- package/dist/{chunk-VUE2FSVD.js → chunk-BXBRH4VK.js} +2 -2
- package/dist/{chunk-P3IIAUCL.js → chunk-F3DK3ETT.js} +179 -311
- package/dist/chunk-F3DK3ETT.js.map +1 -0
- package/dist/{chunk-XQBK7IVF.cjs → chunk-FAJRYL3A.cjs} +15 -15
- package/dist/{chunk-XQBK7IVF.cjs.map → chunk-FAJRYL3A.cjs.map} +1 -1
- package/dist/{chunk-5YGKK636.js → chunk-FM4KGO75.js} +4 -4
- package/dist/{chunk-U74OC6PM.cjs → chunk-G5NW2RHD.cjs} +26 -26
- package/dist/{chunk-U74OC6PM.cjs.map → chunk-G5NW2RHD.cjs.map} +1 -1
- package/dist/{chunk-UJIDDEXD.js → chunk-M2ZHKEZG.js} +2 -2
- package/dist/{chunk-4USOR7KK.cjs → chunk-NPM3PSRW.cjs} +25 -25
- package/dist/{chunk-4USOR7KK.cjs.map → chunk-NPM3PSRW.cjs.map} +1 -1
- package/dist/{chunk-GYWMN4AK.js → chunk-O4SGWVZK.js} +4 -4
- package/dist/{chunk-5HRCKYFX.cjs → chunk-OZORBZ23.cjs} +9 -9
- package/dist/{chunk-5HRCKYFX.cjs.map → chunk-OZORBZ23.cjs.map} +1 -1
- package/dist/{chunk-VSUBZBG7.js → chunk-PBHJEI4L.js} +2 -2
- package/dist/{chunk-XFRQUV5M.js → chunk-PD2G6OXQ.js} +2 -2
- package/dist/{chunk-K2PS5MJH.cjs → chunk-POMQVPWA.cjs} +5 -5
- package/dist/{chunk-K2PS5MJH.cjs.map → chunk-POMQVPWA.cjs.map} +1 -1
- package/dist/{chunk-QLSUOQMU.cjs → chunk-QVWKPHD3.cjs} +7 -7
- package/dist/{chunk-QLSUOQMU.cjs.map → chunk-QVWKPHD3.cjs.map} +1 -1
- package/dist/{chunk-6GSM6K5W.js → chunk-RTPVAKRQ.js} +2 -2
- package/dist/{chunk-HS2YU2NF.js → chunk-SIQWYHZF.js} +2 -2
- package/dist/{chunk-MIVP6B6P.js → chunk-TQX5O6OU.js} +4 -4
- package/dist/{chunk-5DXWGCTW.cjs → chunk-UNFD5VKD.cjs} +56 -56
- package/dist/{chunk-5DXWGCTW.cjs.map → chunk-UNFD5VKD.cjs.map} +1 -1
- package/dist/{chunk-5GXMQPG7.cjs → chunk-VD2JHSBW.cjs} +37 -37
- package/dist/{chunk-5GXMQPG7.cjs.map → chunk-VD2JHSBW.cjs.map} +1 -1
- package/dist/{chunk-EQSGC5WT.js → chunk-WRRZKIFU.js} +2 -2
- package/dist/{chunk-5COLEZW6.cjs → chunk-X6NDSU3W.cjs} +62 -62
- package/dist/{chunk-5COLEZW6.cjs.map → chunk-X6NDSU3W.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 +120 -122
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +9 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/date-picker.d.ts +0 -47
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +2 -4
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +1 -3
- package/dist/index.cjs +2 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -3
- package/package.json +1 -1
- package/src/components/ui/date-picker.tsx +9 -214
- package/src/stories/DatePicker.stories.tsx +0 -141
- package/dist/chunk-AYBSXRRC.cjs.map +0 -1
- package/dist/chunk-P3IIAUCL.js.map +0 -1
- /package/dist/{chunk-5CWJGCOL.js.map → chunk-7343ZUA2.js.map} +0 -0
- /package/dist/{chunk-VUE2FSVD.js.map → chunk-BXBRH4VK.js.map} +0 -0
- /package/dist/{chunk-5YGKK636.js.map → chunk-FM4KGO75.js.map} +0 -0
- /package/dist/{chunk-UJIDDEXD.js.map → chunk-M2ZHKEZG.js.map} +0 -0
- /package/dist/{chunk-GYWMN4AK.js.map → chunk-O4SGWVZK.js.map} +0 -0
- /package/dist/{chunk-VSUBZBG7.js.map → chunk-PBHJEI4L.js.map} +0 -0
- /package/dist/{chunk-XFRQUV5M.js.map → chunk-PD2G6OXQ.js.map} +0 -0
- /package/dist/{chunk-6GSM6K5W.js.map → chunk-RTPVAKRQ.js.map} +0 -0
- /package/dist/{chunk-HS2YU2NF.js.map → chunk-SIQWYHZF.js.map} +0 -0
- /package/dist/{chunk-MIVP6B6P.js.map → chunk-TQX5O6OU.js.map} +0 -0
- /package/dist/{chunk-EQSGC5WT.js.map → chunk-WRRZKIFU.js.map} +0 -0
|
@@ -11835,7 +11835,7 @@ CheckboxWithDescription.displayName = "CheckboxWithDescription";
|
|
|
11835
11835
|
|
|
11836
11836
|
// src/components/ui/date-picker.tsx
|
|
11837
11837
|
import * as Popover from "@radix-ui/react-popover";
|
|
11838
|
-
import {
|
|
11838
|
+
import { Calendar as Calendar2, ChevronLeft, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
11839
11839
|
import * as React38 from "react";
|
|
11840
11840
|
import {
|
|
11841
11841
|
DayPicker
|
|
@@ -12013,8 +12013,7 @@ function DatePickerCalendar({
|
|
|
12013
12013
|
numberOfMonths = 1,
|
|
12014
12014
|
fromDate,
|
|
12015
12015
|
toDate: toDate2,
|
|
12016
|
-
locale
|
|
12017
|
-
fluid = false
|
|
12016
|
+
locale
|
|
12018
12017
|
}) {
|
|
12019
12018
|
const today = /* @__PURE__ */ new Date();
|
|
12020
12019
|
const isMdUp = useMdUp() ?? true;
|
|
@@ -12043,33 +12042,28 @@ function DatePickerCalendar({
|
|
|
12043
12042
|
setHoveredDate(void 0);
|
|
12044
12043
|
onSelect(completed);
|
|
12045
12044
|
};
|
|
12046
|
-
const cellOuter = fluid ? "flex-1 aspect-square min-w-0" : "size-10";
|
|
12047
|
-
const cellInner = fluid ? "size-full" : "size-10";
|
|
12048
12045
|
const classNames = {
|
|
12049
|
-
root:
|
|
12046
|
+
root: "p-4 date-picker-calendar",
|
|
12050
12047
|
months: "flex gap-8",
|
|
12051
|
-
month:
|
|
12048
|
+
month: "flex flex-col gap-2",
|
|
12052
12049
|
month_caption: "hidden",
|
|
12053
12050
|
nav: "hidden",
|
|
12054
|
-
month_grid:
|
|
12051
|
+
month_grid: "border-collapse",
|
|
12055
12052
|
weekdays: "flex",
|
|
12056
12053
|
weekday: cn(
|
|
12057
|
-
|
|
12058
|
-
"flex items-center justify-center",
|
|
12054
|
+
"size-10 flex items-center justify-center",
|
|
12059
12055
|
"text-[14px] font-medium leading-5 text-ods-text-secondary"
|
|
12060
12056
|
),
|
|
12061
12057
|
week: "flex",
|
|
12062
12058
|
day: cn(
|
|
12063
|
-
|
|
12064
|
-
"flex items-center justify-center",
|
|
12059
|
+
"size-10 flex items-center justify-center",
|
|
12065
12060
|
"text-h4 text-ods-text-primary",
|
|
12066
12061
|
"cursor-pointer",
|
|
12067
12062
|
"transition-colors duration-150",
|
|
12068
12063
|
"hover:bg-ods-bg-surface hover:rounded-[6px]"
|
|
12069
12064
|
),
|
|
12070
12065
|
day_button: cn(
|
|
12071
|
-
|
|
12072
|
-
"flex items-center justify-center",
|
|
12066
|
+
"size-10 flex items-center justify-center",
|
|
12073
12067
|
"cursor-pointer bg-transparent border-none outline-none",
|
|
12074
12068
|
"text-inherit font-inherit"
|
|
12075
12069
|
),
|
|
@@ -12152,7 +12146,7 @@ function DatePickerCalendar({
|
|
|
12152
12146
|
}
|
|
12153
12147
|
`;
|
|
12154
12148
|
if (mode === "single") {
|
|
12155
|
-
return /* @__PURE__ */ jsxs70("div", { className:
|
|
12149
|
+
return /* @__PURE__ */ jsxs70("div", { className: "bg-ods-card border border-ods-border rounded-[6px] overflow-hidden", children: [
|
|
12156
12150
|
/* @__PURE__ */ jsxs70("div", { className: "flex items-center justify-between px-4 pt-4", children: [
|
|
12157
12151
|
/* @__PURE__ */ jsx87(
|
|
12158
12152
|
CalendarNavButton,
|
|
@@ -12194,7 +12188,7 @@ function DatePickerCalendar({
|
|
|
12194
12188
|
return /* @__PURE__ */ jsxs70(
|
|
12195
12189
|
"div",
|
|
12196
12190
|
{
|
|
12197
|
-
className:
|
|
12191
|
+
className: "bg-ods-card border border-ods-border rounded-md overflow-hidden",
|
|
12198
12192
|
onMouseLeave: () => setHoveredDate(void 0),
|
|
12199
12193
|
children: [
|
|
12200
12194
|
/* @__PURE__ */ jsx87("style", { children: rangeStyles }),
|
|
@@ -12718,131 +12712,6 @@ function DatePickerInputSimple({
|
|
|
12718
12712
|
] });
|
|
12719
12713
|
return /* @__PURE__ */ jsx87(FieldWrapper, { label, error, className, children: content });
|
|
12720
12714
|
}
|
|
12721
|
-
function DateFilterMenu({
|
|
12722
|
-
mode = "range",
|
|
12723
|
-
sort = "desc",
|
|
12724
|
-
date,
|
|
12725
|
-
range,
|
|
12726
|
-
onApply,
|
|
12727
|
-
onClose,
|
|
12728
|
-
disabled = false,
|
|
12729
|
-
fromDate,
|
|
12730
|
-
toDate: toDate2,
|
|
12731
|
-
locale,
|
|
12732
|
-
align = "start",
|
|
12733
|
-
ascLabel = "Sort by Ascending",
|
|
12734
|
-
descLabel = "Sort by Descending",
|
|
12735
|
-
className,
|
|
12736
|
-
"aria-label": ariaLabel = "Open date filter"
|
|
12737
|
-
}) {
|
|
12738
|
-
const [open, setOpen] = React38.useState(false);
|
|
12739
|
-
const [draftSort, setDraftSort] = React38.useState(sort);
|
|
12740
|
-
const [draftSelected, setDraftSelected] = React38.useState(mode === "single" ? date : range);
|
|
12741
|
-
const resetDraft = React38.useCallback(() => {
|
|
12742
|
-
setDraftSort(sort);
|
|
12743
|
-
setDraftSelected(mode === "single" ? date : range);
|
|
12744
|
-
}, [sort, date, range, mode]);
|
|
12745
|
-
const handleOpenChange = (next) => {
|
|
12746
|
-
if (next) {
|
|
12747
|
-
resetDraft();
|
|
12748
|
-
} else {
|
|
12749
|
-
onClose?.();
|
|
12750
|
-
}
|
|
12751
|
-
setOpen(next);
|
|
12752
|
-
};
|
|
12753
|
-
const handleApply = () => {
|
|
12754
|
-
const result = mode === "single" ? { sort: draftSort, date: draftSelected } : { sort: draftSort, range: draftSelected };
|
|
12755
|
-
onApply?.(result);
|
|
12756
|
-
setOpen(false);
|
|
12757
|
-
};
|
|
12758
|
-
const handleClose = () => {
|
|
12759
|
-
onClose?.();
|
|
12760
|
-
setOpen(false);
|
|
12761
|
-
};
|
|
12762
|
-
return /* @__PURE__ */ jsxs70(Popover.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
12763
|
-
/* @__PURE__ */ jsx87(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx87(
|
|
12764
|
-
Button,
|
|
12765
|
-
{
|
|
12766
|
-
type: "button",
|
|
12767
|
-
variant: "outline",
|
|
12768
|
-
size: "icon",
|
|
12769
|
-
disabled,
|
|
12770
|
-
"aria-label": ariaLabel,
|
|
12771
|
-
className,
|
|
12772
|
-
leftIcon: /* @__PURE__ */ jsx87(Calendar2, { className: "size-6" })
|
|
12773
|
-
}
|
|
12774
|
-
) }),
|
|
12775
|
-
/* @__PURE__ */ jsx87(Popover.Portal, { children: /* @__PURE__ */ jsxs70(
|
|
12776
|
-
Popover.Content,
|
|
12777
|
-
{
|
|
12778
|
-
className: cn(
|
|
12779
|
-
"z-[9999] w-80 max-w-[calc(100vw-2rem)]",
|
|
12780
|
-
"flex flex-col gap-4 rounded-[6px] border border-ods-border bg-ods-bg p-4",
|
|
12781
|
-
"animate-in fade-in-0 zoom-in-95",
|
|
12782
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
12783
|
-
"data-[side=bottom]:slide-in-from-top-2",
|
|
12784
|
-
"data-[side=top]:slide-in-from-bottom-2"
|
|
12785
|
-
),
|
|
12786
|
-
sideOffset: 8,
|
|
12787
|
-
align,
|
|
12788
|
-
children: [
|
|
12789
|
-
/* @__PURE__ */ jsxs70(
|
|
12790
|
-
Select,
|
|
12791
|
-
{
|
|
12792
|
-
value: draftSort,
|
|
12793
|
-
onValueChange: (value) => setDraftSort(value),
|
|
12794
|
-
children: [
|
|
12795
|
-
/* @__PURE__ */ jsx87(SelectTrigger, { className: "gap-2", "aria-label": "Sort direction", children: /* @__PURE__ */ jsxs70("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
12796
|
-
/* @__PURE__ */ jsx87(ArrowUpDown, { className: "size-6 shrink-0 text-ods-text-secondary" }),
|
|
12797
|
-
/* @__PURE__ */ jsx87("span", { className: "truncate", children: /* @__PURE__ */ jsx87(SelectValue, {}) })
|
|
12798
|
-
] }) }),
|
|
12799
|
-
/* @__PURE__ */ jsxs70(SelectContent, { children: [
|
|
12800
|
-
/* @__PURE__ */ jsx87(SelectItem, { value: "asc", children: ascLabel }),
|
|
12801
|
-
/* @__PURE__ */ jsx87(SelectItem, { value: "desc", children: descLabel })
|
|
12802
|
-
] })
|
|
12803
|
-
]
|
|
12804
|
-
}
|
|
12805
|
-
),
|
|
12806
|
-
/* @__PURE__ */ jsx87(
|
|
12807
|
-
DatePickerCalendar,
|
|
12808
|
-
{
|
|
12809
|
-
mode,
|
|
12810
|
-
selected: draftSelected,
|
|
12811
|
-
onSelect: setDraftSelected,
|
|
12812
|
-
numberOfMonths: 1,
|
|
12813
|
-
fromDate,
|
|
12814
|
-
toDate: toDate2,
|
|
12815
|
-
locale,
|
|
12816
|
-
fluid: true
|
|
12817
|
-
}
|
|
12818
|
-
),
|
|
12819
|
-
/* @__PURE__ */ jsxs70("div", { className: "flex w-full items-stretch gap-4", children: [
|
|
12820
|
-
/* @__PURE__ */ jsx87(
|
|
12821
|
-
Button,
|
|
12822
|
-
{
|
|
12823
|
-
type: "button",
|
|
12824
|
-
variant: "outline",
|
|
12825
|
-
fullWidth: true,
|
|
12826
|
-
onClick: handleClose,
|
|
12827
|
-
children: "Close"
|
|
12828
|
-
}
|
|
12829
|
-
),
|
|
12830
|
-
/* @__PURE__ */ jsx87(
|
|
12831
|
-
Button,
|
|
12832
|
-
{
|
|
12833
|
-
type: "button",
|
|
12834
|
-
variant: "accent",
|
|
12835
|
-
fullWidth: true,
|
|
12836
|
-
onClick: handleApply,
|
|
12837
|
-
children: "Apply"
|
|
12838
|
-
}
|
|
12839
|
-
)
|
|
12840
|
-
] })
|
|
12841
|
-
]
|
|
12842
|
-
}
|
|
12843
|
-
) })
|
|
12844
|
-
] });
|
|
12845
|
-
}
|
|
12846
12715
|
|
|
12847
12716
|
// src/components/ui/duration-input.tsx
|
|
12848
12717
|
init_cn();
|
|
@@ -15458,7 +15327,7 @@ function TabContent({
|
|
|
15458
15327
|
// src/components/ui/tab-navigation.tsx
|
|
15459
15328
|
init_next_navigation();
|
|
15460
15329
|
init_cn();
|
|
15461
|
-
import { useState as useState33, useEffect as useEffect24, useMemo as useMemo16, useRef as useRef21, useCallback as
|
|
15330
|
+
import { useState as useState33, useEffect as useEffect24, useMemo as useMemo16, useRef as useRef21, useCallback as useCallback15 } from "react";
|
|
15462
15331
|
import { Fragment as Fragment23, jsx as jsx116, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
15463
15332
|
function TabNavigation({
|
|
15464
15333
|
activeTab: controlledActiveTab,
|
|
@@ -15513,7 +15382,7 @@ function TabNavigation({
|
|
|
15513
15382
|
const scrollRef = useRef21(null);
|
|
15514
15383
|
const [canScrollLeft, setCanScrollLeft] = useState33(false);
|
|
15515
15384
|
const [canScrollRight, setCanScrollRight] = useState33(false);
|
|
15516
|
-
const updateScrollShadows =
|
|
15385
|
+
const updateScrollShadows = useCallback15(() => {
|
|
15517
15386
|
const el = scrollRef.current;
|
|
15518
15387
|
if (!el) return;
|
|
15519
15388
|
setCanScrollLeft(el.scrollLeft > 0);
|
|
@@ -15673,7 +15542,7 @@ import { useState as useState43, useRef as useRef27, useEffect as useEffect32 }
|
|
|
15673
15542
|
import { ChevronDown as ChevronDown4 } from "lucide-react";
|
|
15674
15543
|
|
|
15675
15544
|
// src/components/ui/rich-markdown-renderer.tsx
|
|
15676
|
-
import { useEffect as useEffect31, useState as useState42, useRef as useRef26, useMemo as useMemo19, useCallback as
|
|
15545
|
+
import { useEffect as useEffect31, useState as useState42, useRef as useRef26, useMemo as useMemo19, useCallback as useCallback18 } from "react";
|
|
15677
15546
|
import ReactMarkdown2 from "react-markdown";
|
|
15678
15547
|
import remarkGfm2 from "remark-gfm";
|
|
15679
15548
|
import remarkBreaks2 from "remark-breaks";
|
|
@@ -15963,7 +15832,7 @@ var socialCache = SocialEmbedCache.getInstance();
|
|
|
15963
15832
|
|
|
15964
15833
|
// src/components/media-carousel.tsx
|
|
15965
15834
|
init_cn();
|
|
15966
|
-
import { useState as useState34, useRef as useRef22, useEffect as useEffect25, memo as memo4, useCallback as
|
|
15835
|
+
import { useState as useState34, useRef as useRef22, useEffect as useEffect25, memo as memo4, useCallback as useCallback16 } from "react";
|
|
15967
15836
|
import { Fragment as Fragment24, jsx as jsx119, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
15968
15837
|
var ChevronLeftIcon = () => /* @__PURE__ */ jsx119("svg", { width: "24", height: "24", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx119("polyline", { points: "15,18 9,12 15,6" }) });
|
|
15969
15838
|
var ChevronRightIcon = () => /* @__PURE__ */ jsx119("svg", { width: "24", height: "24", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx119("polyline", { points: "9,18 15,12 9,6" }) });
|
|
@@ -15992,17 +15861,17 @@ var MediaCarousel = memo4(function MediaCarousel2({
|
|
|
15992
15861
|
if (!currentItem) {
|
|
15993
15862
|
return null;
|
|
15994
15863
|
}
|
|
15995
|
-
const nextSlide =
|
|
15864
|
+
const nextSlide = useCallback16(() => {
|
|
15996
15865
|
setCurrentIndex((prev) => (prev + 1) % media.length);
|
|
15997
15866
|
}, [media.length]);
|
|
15998
|
-
const prevSlide =
|
|
15867
|
+
const prevSlide = useCallback16(() => {
|
|
15999
15868
|
setCurrentIndex((prev) => (prev - 1 + media.length) % media.length);
|
|
16000
15869
|
}, [media.length]);
|
|
16001
|
-
const selectSlide =
|
|
15870
|
+
const selectSlide = useCallback16((index) => {
|
|
16002
15871
|
if (index === currentIndex) return;
|
|
16003
15872
|
setCurrentIndex(index);
|
|
16004
15873
|
}, [currentIndex]);
|
|
16005
|
-
const handleKeyDown =
|
|
15874
|
+
const handleKeyDown = useCallback16((e) => {
|
|
16006
15875
|
if (media.length <= 1) return;
|
|
16007
15876
|
if (e.key === "ArrowLeft") {
|
|
16008
15877
|
e.preventDefault();
|
|
@@ -17254,7 +17123,7 @@ function toFigmaOriginalUrl(url) {
|
|
|
17254
17123
|
}
|
|
17255
17124
|
|
|
17256
17125
|
// src/components/embeds/embed-iframe.tsx
|
|
17257
|
-
import { useState as useState39, useCallback as
|
|
17126
|
+
import { useState as useState39, useCallback as useCallback17, useRef as useRef25, useEffect as useEffect29 } from "react";
|
|
17258
17127
|
import { Fragment as Fragment25, jsx as jsx126, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
17259
17128
|
function EmbedLoadingSkeleton({ height }) {
|
|
17260
17129
|
return /* @__PURE__ */ jsx126(
|
|
@@ -17277,7 +17146,7 @@ function EmbedIframe({
|
|
|
17277
17146
|
}) {
|
|
17278
17147
|
const [isLoaded, setIsLoaded] = useState39(false);
|
|
17279
17148
|
const iframeRef = useRef25(null);
|
|
17280
|
-
const handleLoad =
|
|
17149
|
+
const handleLoad = useCallback17(() => setIsLoaded(true), []);
|
|
17281
17150
|
useEffect29(() => {
|
|
17282
17151
|
setIsLoaded(false);
|
|
17283
17152
|
}, [src]);
|
|
@@ -17912,7 +17781,7 @@ var RichMarkdownInner = ({
|
|
|
17912
17781
|
return map;
|
|
17913
17782
|
}, [sectionIds]);
|
|
17914
17783
|
const isDarkMode = true;
|
|
17915
|
-
const generateHeadingId =
|
|
17784
|
+
const generateHeadingId = useCallback18((text, level) => {
|
|
17916
17785
|
if (sectionIds && (level === 1 || level === 2)) {
|
|
17917
17786
|
const variations = [
|
|
17918
17787
|
text,
|
|
@@ -18437,7 +18306,7 @@ function StatusIndicator({ status, label, href }) {
|
|
|
18437
18306
|
}
|
|
18438
18307
|
|
|
18439
18308
|
// src/components/ui/hover-dropdown.tsx
|
|
18440
|
-
import { useState as useState44, useRef as useRef28, useCallback as
|
|
18309
|
+
import { useState as useState44, useRef as useRef28, useCallback as useCallback19 } from "react";
|
|
18441
18310
|
import { Fragment as Fragment26, jsx as jsx132, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
18442
18311
|
function DefaultAnchor({
|
|
18443
18312
|
href,
|
|
@@ -18457,15 +18326,15 @@ function HoverDropdown({
|
|
|
18457
18326
|
const [open, setOpen] = useState44(false);
|
|
18458
18327
|
const timeoutRef = useRef28(void 0);
|
|
18459
18328
|
const containerRef = useRef28(null);
|
|
18460
|
-
const show =
|
|
18329
|
+
const show = useCallback19(() => {
|
|
18461
18330
|
clearTimeout(timeoutRef.current);
|
|
18462
18331
|
setOpen(true);
|
|
18463
18332
|
}, []);
|
|
18464
|
-
const hide =
|
|
18333
|
+
const hide = useCallback19(() => {
|
|
18465
18334
|
timeoutRef.current = setTimeout(() => setOpen(false), hideDelay);
|
|
18466
18335
|
}, [hideDelay]);
|
|
18467
18336
|
if (items.length === 0) return /* @__PURE__ */ jsx132(Fragment26, { children });
|
|
18468
|
-
const toggle =
|
|
18337
|
+
const toggle = useCallback19((e) => {
|
|
18469
18338
|
e.stopPropagation();
|
|
18470
18339
|
clearTimeout(timeoutRef.current);
|
|
18471
18340
|
setOpen((prev) => !prev);
|
|
@@ -23628,7 +23497,7 @@ var ErrorBoundary = class extends Component3 {
|
|
|
23628
23497
|
|
|
23629
23498
|
// src/components/features/figma-prototype-viewer.tsx
|
|
23630
23499
|
init_cn();
|
|
23631
|
-
import { useState as useState54, useRef as useRef31, useEffect as useEffect40, useCallback as
|
|
23500
|
+
import { useState as useState54, useRef as useRef31, useEffect as useEffect40, useCallback as useCallback21, useMemo as useMemo22 } from "react";
|
|
23632
23501
|
|
|
23633
23502
|
// src/components/features/section-selector.tsx
|
|
23634
23503
|
init_cn();
|
|
@@ -24136,7 +24005,7 @@ var FigmaPrototypeViewer = ({
|
|
|
24136
24005
|
window.addEventListener("message", handleMessage);
|
|
24137
24006
|
return () => window.removeEventListener("message", handleMessage);
|
|
24138
24007
|
}, [config.sections, activeSection, isNavigating, externalActiveSection, config.onSectionChange, viewMode]);
|
|
24139
|
-
const navigateToSection =
|
|
24008
|
+
const navigateToSection = useCallback21((sectionId) => {
|
|
24140
24009
|
const section = config.sections.find((s) => s.id === sectionId);
|
|
24141
24010
|
if (!section || !iframeRef.current?.contentWindow || !isInitialized) {
|
|
24142
24011
|
return;
|
|
@@ -24160,7 +24029,7 @@ var FigmaPrototypeViewer = ({
|
|
|
24160
24029
|
if (navTimerRef.current) clearTimeout(navTimerRef.current);
|
|
24161
24030
|
navTimerRef.current = setTimeout(() => setIsNavigating(false), 500);
|
|
24162
24031
|
}, [config, isInitialized, viewMode, externalActiveSection]);
|
|
24163
|
-
const handleSectionClick =
|
|
24032
|
+
const handleSectionClick = useCallback21((sectionId) => {
|
|
24164
24033
|
const sectionsDisabled = iframeState !== "READY" || isNavigating;
|
|
24165
24034
|
if (sectionId === activeSection || sectionsDisabled) {
|
|
24166
24035
|
return;
|
|
@@ -24171,7 +24040,7 @@ var FigmaPrototypeViewer = ({
|
|
|
24171
24040
|
navigateToSection(sectionId);
|
|
24172
24041
|
}
|
|
24173
24042
|
}, [activeSection, iframeState, isNavigating, externalOnSectionClick, navigateToSection]);
|
|
24174
|
-
const handleTouchStart =
|
|
24043
|
+
const handleTouchStart = useCallback21((e) => {
|
|
24175
24044
|
const overlayElement = e.currentTarget;
|
|
24176
24045
|
console.log("[Touch] Touch detected, allowing iframe interaction");
|
|
24177
24046
|
overlayElement.style.pointerEvents = "none";
|
|
@@ -24735,7 +24604,7 @@ function useLoading() {
|
|
|
24735
24604
|
}
|
|
24736
24605
|
|
|
24737
24606
|
// src/components/features/media-gallery-manager.tsx
|
|
24738
|
-
import { useState as useState57, useRef as useRef33, useCallback as
|
|
24607
|
+
import { useState as useState57, useRef as useRef33, useCallback as useCallback22 } from "react";
|
|
24739
24608
|
import {
|
|
24740
24609
|
Upload,
|
|
24741
24610
|
Image as ImageIcon2,
|
|
@@ -24758,7 +24627,7 @@ function MediaGalleryManager({
|
|
|
24758
24627
|
const fileInputRef = useRef33(null);
|
|
24759
24628
|
const [deletingIndex, setDeletingIndex] = useState57(null);
|
|
24760
24629
|
const [draggedIndex, setDraggedIndex] = useState57(null);
|
|
24761
|
-
const handleFileSelect =
|
|
24630
|
+
const handleFileSelect = useCallback22(async (event) => {
|
|
24762
24631
|
const file = event.target.files?.[0];
|
|
24763
24632
|
if (!file) return;
|
|
24764
24633
|
let mediaType;
|
|
@@ -24784,18 +24653,18 @@ function MediaGalleryManager({
|
|
|
24784
24653
|
console.error("Upload failed:", error);
|
|
24785
24654
|
}
|
|
24786
24655
|
}, [media, onChange, onUpload]);
|
|
24787
|
-
const handleDeleteMedia =
|
|
24656
|
+
const handleDeleteMedia = useCallback22((index) => {
|
|
24788
24657
|
setDeletingIndex(index);
|
|
24789
24658
|
onChange(media.filter((_, i) => i !== index));
|
|
24790
24659
|
setDeletingIndex(null);
|
|
24791
24660
|
}, [media, onChange]);
|
|
24792
|
-
const handleDragStart =
|
|
24661
|
+
const handleDragStart = useCallback22((index) => {
|
|
24793
24662
|
setDraggedIndex(index);
|
|
24794
24663
|
}, []);
|
|
24795
|
-
const handleDragOver =
|
|
24664
|
+
const handleDragOver = useCallback22((e) => {
|
|
24796
24665
|
e.preventDefault();
|
|
24797
24666
|
}, []);
|
|
24798
|
-
const handleDrop =
|
|
24667
|
+
const handleDrop = useCallback22((e, targetIndex) => {
|
|
24799
24668
|
e.preventDefault();
|
|
24800
24669
|
if (draggedIndex === null || draggedIndex === targetIndex) {
|
|
24801
24670
|
setDraggedIndex(null);
|
|
@@ -24807,7 +24676,7 @@ function MediaGalleryManager({
|
|
|
24807
24676
|
onChange(newMedia.map((item, i) => ({ ...item, display_order: i })));
|
|
24808
24677
|
setDraggedIndex(null);
|
|
24809
24678
|
}, [media, draggedIndex, onChange]);
|
|
24810
|
-
const renderMediaItem =
|
|
24679
|
+
const renderMediaItem = useCallback22((mediaItem, index) => {
|
|
24811
24680
|
const isDeleting = deletingIndex === index;
|
|
24812
24681
|
return /* @__PURE__ */ jsxs143(
|
|
24813
24682
|
Card,
|
|
@@ -26570,7 +26439,7 @@ function getCaptionsUrl(entityType, entityId, srtContent) {
|
|
|
26570
26439
|
|
|
26571
26440
|
// src/components/features/video-source-selector.tsx
|
|
26572
26441
|
init_button2();
|
|
26573
|
-
import { useState as useState62, useCallback as
|
|
26442
|
+
import { useState as useState62, useCallback as useCallback23, useEffect as useEffect45 } from "react";
|
|
26574
26443
|
import { Upload as Upload4, Sparkles as Sparkles3, X as X8, Video as Video7, Loader2 as Loader27 } from "lucide-react";
|
|
26575
26444
|
import { jsx as jsx198, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
26576
26445
|
function VideoSourceSelector({
|
|
@@ -26600,7 +26469,7 @@ function VideoSourceSelector({
|
|
|
26600
26469
|
const [uploadProgress, setUploadProgress] = useState62(0);
|
|
26601
26470
|
const [uploadMessage, setUploadMessage] = useState62("");
|
|
26602
26471
|
const [uploadError, setUploadError] = useState62(null);
|
|
26603
|
-
const handleUploadClick =
|
|
26472
|
+
const handleUploadClick = useCallback23(() => {
|
|
26604
26473
|
const input = document.createElement("input");
|
|
26605
26474
|
input.type = "file";
|
|
26606
26475
|
input.accept = "video/*";
|
|
@@ -26631,7 +26500,7 @@ function VideoSourceSelector({
|
|
|
26631
26500
|
};
|
|
26632
26501
|
input.click();
|
|
26633
26502
|
}, [onUploadVideo, onMainVideoUrlChange]);
|
|
26634
|
-
const handleDeleteVideo =
|
|
26503
|
+
const handleDeleteVideo = useCallback23(() => {
|
|
26635
26504
|
onMainVideoUrlChange("");
|
|
26636
26505
|
}, [onMainVideoUrlChange]);
|
|
26637
26506
|
return /* @__PURE__ */ jsxs156("div", { className: `space-y-4 p-6 bg-ods-card border border-ods-border rounded-lg ${className}`, children: [
|
|
@@ -28464,7 +28333,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
28464
28333
|
init_button2();
|
|
28465
28334
|
|
|
28466
28335
|
// src/components/ui/phone-input.tsx
|
|
28467
|
-
import { useCallback as
|
|
28336
|
+
import { useCallback as useCallback24, useEffect as useEffect47, useMemo as useMemo23, useRef as useRef37, useState as useState65 } from "react";
|
|
28468
28337
|
import { jsx as jsx218, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
28469
28338
|
function PhoneInput({
|
|
28470
28339
|
value,
|
|
@@ -28483,8 +28352,8 @@ function PhoneInput({
|
|
|
28483
28352
|
);
|
|
28484
28353
|
const [isInvalid, setIsInvalid] = useState65(false);
|
|
28485
28354
|
const debounceRef = useRef37(null);
|
|
28486
|
-
const digitCount =
|
|
28487
|
-
const runValidation =
|
|
28355
|
+
const digitCount = useCallback24((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
28356
|
+
const runValidation = useCallback24((phone) => {
|
|
28488
28357
|
if (!phone || digitCount(phone) === 0) {
|
|
28489
28358
|
setIsInvalid(false);
|
|
28490
28359
|
onValidationChange?.(false);
|
|
@@ -28494,7 +28363,7 @@ function PhoneInput({
|
|
|
28494
28363
|
setIsInvalid(invalid);
|
|
28495
28364
|
onValidationChange?.(invalid);
|
|
28496
28365
|
}, [countryCode, digitCount, onValidationChange]);
|
|
28497
|
-
const debouncedValidation =
|
|
28366
|
+
const debouncedValidation = useCallback24((phone) => {
|
|
28498
28367
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
28499
28368
|
debounceRef.current = setTimeout(() => runValidation(phone), 300);
|
|
28500
28369
|
}, [runValidation]);
|
|
@@ -30628,7 +30497,7 @@ function EmptyState2() {
|
|
|
30628
30497
|
}
|
|
30629
30498
|
|
|
30630
30499
|
// src/components/features/board/use-board-collapse.ts
|
|
30631
|
-
import { useCallback as
|
|
30500
|
+
import { useCallback as useCallback28, useState as useState73 } from "react";
|
|
30632
30501
|
function useBoardCollapse(storageKey) {
|
|
30633
30502
|
const [persisted, setPersisted] = useLocalStorage(
|
|
30634
30503
|
storageKey ?? "__board_collapse_unused__",
|
|
@@ -30637,13 +30506,13 @@ function useBoardCollapse(storageKey) {
|
|
|
30637
30506
|
const [memory, setMemory] = useState73({});
|
|
30638
30507
|
const collapsed = storageKey ? persisted : memory;
|
|
30639
30508
|
const setMap = storageKey ? setPersisted : setMemory;
|
|
30640
|
-
const toggle =
|
|
30509
|
+
const toggle = useCallback28(
|
|
30641
30510
|
(columnId) => {
|
|
30642
30511
|
setMap((prev) => ({ ...prev, [columnId]: !prev[columnId] }));
|
|
30643
30512
|
},
|
|
30644
30513
|
[setMap]
|
|
30645
30514
|
);
|
|
30646
|
-
const setCollapsed =
|
|
30515
|
+
const setCollapsed = useCallback28(
|
|
30647
30516
|
(columnId, value) => {
|
|
30648
30517
|
setMap((prev) => ({ ...prev, [columnId]: value }));
|
|
30649
30518
|
},
|
|
@@ -31647,7 +31516,7 @@ function SlidingSidebar({ config }) {
|
|
|
31647
31516
|
}
|
|
31648
31517
|
|
|
31649
31518
|
// src/components/navigation/sticky-section-nav.tsx
|
|
31650
|
-
import { useEffect as useEffect60, useState as useState78, useCallback as
|
|
31519
|
+
import { useEffect as useEffect60, useState as useState78, useCallback as useCallback30, useRef as useRef44 } from "react";
|
|
31651
31520
|
import { jsx as jsx241, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
31652
31521
|
function StickySectionNav({
|
|
31653
31522
|
sections,
|
|
@@ -31711,7 +31580,7 @@ function useSectionNavigation(sections, options) {
|
|
|
31711
31580
|
const [activeSection, setActiveSection] = useState78(sections[0]?.id || "");
|
|
31712
31581
|
const isScrollingFromClick = useRef44(false);
|
|
31713
31582
|
const { offset: offset2 = 100 } = options || {};
|
|
31714
|
-
const handleSectionClick =
|
|
31583
|
+
const handleSectionClick = useCallback30((sectionId) => {
|
|
31715
31584
|
const targetElement = document.getElementById(sectionId);
|
|
31716
31585
|
if (!targetElement) return;
|
|
31717
31586
|
isScrollingFromClick.current = true;
|
|
@@ -31761,7 +31630,7 @@ function useSectionNavigation(sections, options) {
|
|
|
31761
31630
|
}
|
|
31762
31631
|
|
|
31763
31632
|
// src/components/navigation/navigation-sidebar.tsx
|
|
31764
|
-
import { useCallback as
|
|
31633
|
+
import { useCallback as useCallback31, useEffect as useEffect61, useLayoutEffect as useLayoutEffect6, useMemo as useMemo30, useState as useState79 } from "react";
|
|
31765
31634
|
|
|
31766
31635
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
31767
31636
|
import { jsx as jsx242, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
@@ -31927,7 +31796,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
31927
31796
|
const [transitionsEnabled, setTransitionsEnabled] = useState79(false);
|
|
31928
31797
|
const isOverlayOpen = isTablet && !minimized;
|
|
31929
31798
|
const showLabel = !minimized;
|
|
31930
|
-
const handleToggle =
|
|
31799
|
+
const handleToggle = useCallback31(() => {
|
|
31931
31800
|
if (isTablet) {
|
|
31932
31801
|
setTabletMinimized((prev) => !prev);
|
|
31933
31802
|
} else {
|
|
@@ -31935,7 +31804,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
31935
31804
|
}
|
|
31936
31805
|
config.onToggleMinimized?.();
|
|
31937
31806
|
}, [isTablet, setDesktopMinimized, config]);
|
|
31938
|
-
const closeOverlay =
|
|
31807
|
+
const closeOverlay = useCallback31(() => {
|
|
31939
31808
|
setTabletMinimized(true);
|
|
31940
31809
|
}, []);
|
|
31941
31810
|
useEffect61(() => {
|
|
@@ -31946,7 +31815,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
31946
31815
|
document.addEventListener("keydown", handleKeyDown);
|
|
31947
31816
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
31948
31817
|
}, [isOverlayOpen, closeOverlay]);
|
|
31949
|
-
const handleItemClick =
|
|
31818
|
+
const handleItemClick = useCallback31((item, event) => {
|
|
31950
31819
|
event?.stopPropagation();
|
|
31951
31820
|
if (item.onClick) {
|
|
31952
31821
|
item.onClick();
|
|
@@ -32414,10 +32283,10 @@ function NotificationsHeaderButton({
|
|
|
32414
32283
|
}
|
|
32415
32284
|
|
|
32416
32285
|
// src/components/navigation/app-layout.tsx
|
|
32417
|
-
import { createContext as createContext9, Suspense as Suspense2, useCallback as
|
|
32286
|
+
import { createContext as createContext9, Suspense as Suspense2, useCallback as useCallback33, useContext as useContext9, useState as useState80 } from "react";
|
|
32418
32287
|
|
|
32419
32288
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
32420
|
-
import React104, { useCallback as
|
|
32289
|
+
import React104, { useCallback as useCallback32, useEffect as useEffect62 } from "react";
|
|
32421
32290
|
import { Fragment as Fragment45, jsx as jsx250, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
32422
32291
|
var HEADER_HEIGHT = 48;
|
|
32423
32292
|
var MobileBurgerMenu = React104.memo(function MobileBurgerMenu2({
|
|
@@ -32451,7 +32320,7 @@ var MobileBurgerMenu = React104.memo(function MobileBurgerMenu2({
|
|
|
32451
32320
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
32452
32321
|
}
|
|
32453
32322
|
}, [isOpen, onClose]);
|
|
32454
|
-
const handleItemClick =
|
|
32323
|
+
const handleItemClick = useCallback32((item) => {
|
|
32455
32324
|
if (item.onClick) {
|
|
32456
32325
|
item.onClick();
|
|
32457
32326
|
} else if (item.path) {
|
|
@@ -32633,10 +32502,10 @@ function AppLayout({
|
|
|
32633
32502
|
}) {
|
|
32634
32503
|
const [mobileMenuOpen, setMobileMenuOpen] = useState80(false);
|
|
32635
32504
|
const [drawerContainer, setDrawerContainer] = useState80(null);
|
|
32636
|
-
const handleToggleMobileMenu =
|
|
32505
|
+
const handleToggleMobileMenu = useCallback33(() => {
|
|
32637
32506
|
setMobileMenuOpen((prev) => !prev);
|
|
32638
32507
|
}, []);
|
|
32639
|
-
const handleCloseMobileMenu =
|
|
32508
|
+
const handleCloseMobileMenu = useCallback33(() => {
|
|
32640
32509
|
setMobileMenuOpen(false);
|
|
32641
32510
|
}, []);
|
|
32642
32511
|
return /* @__PURE__ */ jsx251(AppLayoutDrawerContainerContext.Provider, { value: drawerContainer, children: /* @__PURE__ */ jsxs199("div", { className: cn("flex h-screen bg-ods-bg", className), children: [
|
|
@@ -33696,7 +33565,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
33696
33565
|
|
|
33697
33566
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
33698
33567
|
init_button2();
|
|
33699
|
-
import React107, { useRef as useRef46, useCallback as
|
|
33568
|
+
import React107, { useRef as useRef46, useCallback as useCallback35 } from "react";
|
|
33700
33569
|
|
|
33701
33570
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
33702
33571
|
import React106 from "react";
|
|
@@ -33849,7 +33718,7 @@ function OnboardingWalkthrough({
|
|
|
33849
33718
|
lastCompletionStatusRef.current = statusKey;
|
|
33850
33719
|
}
|
|
33851
33720
|
}, [completionStatus, isLoadingCompletion, state.completedSteps, markMultipleComplete]);
|
|
33852
|
-
const handleStepAction =
|
|
33721
|
+
const handleStepAction = useCallback35(async (step) => {
|
|
33853
33722
|
if (actionInProgressRef.current.has(step.id)) {
|
|
33854
33723
|
console.log(`\u23F3 Action already in progress for "${step.id}", skipping`);
|
|
33855
33724
|
return;
|
|
@@ -35456,7 +35325,7 @@ import { useMemo as useMemo32 } from "react";
|
|
|
35456
35325
|
|
|
35457
35326
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
35458
35327
|
init_cn();
|
|
35459
|
-
import { useRef as useRef49, useState as useState83, useCallback as
|
|
35328
|
+
import { useRef as useRef49, useState as useState83, useCallback as useCallback36 } from "react";
|
|
35460
35329
|
import { jsx as jsx282, jsxs as jsxs225 } from "react/jsx-runtime";
|
|
35461
35330
|
function QueryReportTableHeader({
|
|
35462
35331
|
columns,
|
|
@@ -35487,7 +35356,7 @@ function QueryReportTableHeader({
|
|
|
35487
35356
|
function TruncatedHeaderCell({ value, width }) {
|
|
35488
35357
|
const textRef = useRef49(null);
|
|
35489
35358
|
const [isTruncated, setIsTruncated] = useState83(false);
|
|
35490
|
-
const checkTruncation =
|
|
35359
|
+
const checkTruncation = useCallback36(() => {
|
|
35491
35360
|
const el = textRef.current;
|
|
35492
35361
|
if (el) {
|
|
35493
35362
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -35515,7 +35384,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
35515
35384
|
|
|
35516
35385
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
35517
35386
|
init_cn();
|
|
35518
|
-
import { useRef as useRef50, useState as useState84, useCallback as
|
|
35387
|
+
import { useRef as useRef50, useState as useState84, useCallback as useCallback37 } from "react";
|
|
35519
35388
|
import { jsx as jsx283, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
35520
35389
|
function QueryReportTableRow({
|
|
35521
35390
|
row,
|
|
@@ -35563,7 +35432,7 @@ function QueryReportTableRow({
|
|
|
35563
35432
|
function TruncatedCell({ value, className }) {
|
|
35564
35433
|
const textRef = useRef50(null);
|
|
35565
35434
|
const [isTruncated, setIsTruncated] = useState84(false);
|
|
35566
|
-
const checkTruncation =
|
|
35435
|
+
const checkTruncation = useCallback37(() => {
|
|
35567
35436
|
const el = textRef.current;
|
|
35568
35437
|
if (el) {
|
|
35569
35438
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -35826,7 +35695,7 @@ init_cn();
|
|
|
35826
35695
|
|
|
35827
35696
|
// src/components/ui/data-table/data-table-column-filter.tsx
|
|
35828
35697
|
init_cn();
|
|
35829
|
-
import { useCallback as
|
|
35698
|
+
import { useCallback as useCallback38, useMemo as useMemo33 } from "react";
|
|
35830
35699
|
|
|
35831
35700
|
// src/components/ui/data-table/utils.ts
|
|
35832
35701
|
function getHideClasses2(hideAt) {
|
|
@@ -35886,14 +35755,14 @@ function DataTableColumnFilter({
|
|
|
35886
35755
|
() => ({ [column.id]: currentValue ?? EMPTY_ARRAY }),
|
|
35887
35756
|
[column.id, currentValue]
|
|
35888
35757
|
);
|
|
35889
|
-
const handleApply =
|
|
35758
|
+
const handleApply = useCallback38(
|
|
35890
35759
|
(applied) => {
|
|
35891
35760
|
const next = applied[column.id] ?? [];
|
|
35892
35761
|
column.setFilterValue(next.length > 0 ? next : void 0);
|
|
35893
35762
|
},
|
|
35894
35763
|
[column]
|
|
35895
35764
|
);
|
|
35896
|
-
const handleReset =
|
|
35765
|
+
const handleReset = useCallback38(() => {
|
|
35897
35766
|
column.setFilterValue(void 0);
|
|
35898
35767
|
}, [column]);
|
|
35899
35768
|
return /* @__PURE__ */ jsx287(
|
|
@@ -36061,7 +35930,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
36061
35930
|
// src/components/ui/data-table/data-table-row.tsx
|
|
36062
35931
|
init_next_link();
|
|
36063
35932
|
init_cn();
|
|
36064
|
-
import { memo as memo5, useCallback as
|
|
35933
|
+
import { memo as memo5, useCallback as useCallback39, useRef as useRef51 } from "react";
|
|
36065
35934
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
36066
35935
|
|
|
36067
35936
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -36146,7 +36015,7 @@ function DataTableRowImpl({
|
|
|
36146
36015
|
const isLinkMode = Boolean(href) && !onClick;
|
|
36147
36016
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
36148
36017
|
const containerRef = useRef51(null);
|
|
36149
|
-
const handleClick =
|
|
36018
|
+
const handleClick = useCallback39(
|
|
36150
36019
|
(e) => {
|
|
36151
36020
|
const target = e.target;
|
|
36152
36021
|
if (!containerRef.current?.contains(target)) {
|
|
@@ -37152,7 +37021,7 @@ function TagSearchInput({
|
|
|
37152
37021
|
}
|
|
37153
37022
|
|
|
37154
37023
|
// src/components/ui/markdown-editor.tsx
|
|
37155
|
-
import { useRef as useRef55, useCallback as
|
|
37024
|
+
import { useRef as useRef55, useCallback as useCallback40, useState as useState87, useEffect as useEffect68 } from "react";
|
|
37156
37025
|
init_cn();
|
|
37157
37026
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
37158
37027
|
import { jsx as jsx298, jsxs as jsxs239 } from "react/jsx-runtime";
|
|
@@ -37221,7 +37090,7 @@ function MarkdownEditor({
|
|
|
37221
37090
|
const handleChange = (val) => {
|
|
37222
37091
|
onChange(val || "");
|
|
37223
37092
|
};
|
|
37224
|
-
const insertTextAtCursor =
|
|
37093
|
+
const insertTextAtCursor = useCallback40(
|
|
37225
37094
|
(text) => {
|
|
37226
37095
|
const textarea = document.querySelector(
|
|
37227
37096
|
".w-md-editor-text-textarea"
|
|
@@ -37237,7 +37106,7 @@ function MarkdownEditor({
|
|
|
37237
37106
|
},
|
|
37238
37107
|
[value, onChange]
|
|
37239
37108
|
);
|
|
37240
|
-
const handleFileUpload =
|
|
37109
|
+
const handleFileUpload = useCallback40(
|
|
37241
37110
|
async (file) => {
|
|
37242
37111
|
if (!onUploadFile) return;
|
|
37243
37112
|
setIsUploading(true);
|
|
@@ -37258,7 +37127,7 @@ function MarkdownEditor({
|
|
|
37258
37127
|
},
|
|
37259
37128
|
[onUploadFile, insertTextAtCursor, onFileUploaded]
|
|
37260
37129
|
);
|
|
37261
|
-
const handleFileInputChange =
|
|
37130
|
+
const handleFileInputChange = useCallback40(
|
|
37262
37131
|
(e) => {
|
|
37263
37132
|
const file = e.target.files?.[0];
|
|
37264
37133
|
if (file) {
|
|
@@ -37268,7 +37137,7 @@ function MarkdownEditor({
|
|
|
37268
37137
|
},
|
|
37269
37138
|
[handleFileUpload]
|
|
37270
37139
|
);
|
|
37271
|
-
const handlePaste =
|
|
37140
|
+
const handlePaste = useCallback40(
|
|
37272
37141
|
(e) => {
|
|
37273
37142
|
if (!onUploadFile) return;
|
|
37274
37143
|
const items = e.clipboardData?.items;
|
|
@@ -37307,7 +37176,7 @@ function MarkdownEditor({
|
|
|
37307
37176
|
const scrollParentRef = useRef55(window);
|
|
37308
37177
|
const EDGE_ZONE = 60;
|
|
37309
37178
|
const MAX_SCROLL_SPEED = 15;
|
|
37310
|
-
const findScrollParent =
|
|
37179
|
+
const findScrollParent = useCallback40((el) => {
|
|
37311
37180
|
let node = el?.parentElement;
|
|
37312
37181
|
while (node && node !== document.documentElement) {
|
|
37313
37182
|
const { overflowY } = window.getComputedStyle(node);
|
|
@@ -37318,7 +37187,7 @@ function MarkdownEditor({
|
|
|
37318
37187
|
}
|
|
37319
37188
|
return window;
|
|
37320
37189
|
}, []);
|
|
37321
|
-
const scrollLoop =
|
|
37190
|
+
const scrollLoop = useCallback40(() => {
|
|
37322
37191
|
if (!isDraggingRef.current) return;
|
|
37323
37192
|
const parent = scrollParentRef.current;
|
|
37324
37193
|
const isWindow = parent === window;
|
|
@@ -43121,7 +42990,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
43121
42990
|
}
|
|
43122
42991
|
|
|
43123
42992
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
43124
|
-
import { useCallback as
|
|
42993
|
+
import { useCallback as useCallback43, useRef as useRef59 } from "react";
|
|
43125
42994
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
43126
42995
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
43127
42996
|
}
|
|
@@ -43158,7 +43027,7 @@ function useChunkCatchup({
|
|
|
43158
43027
|
fetchChunksRef.current = fetchChunks;
|
|
43159
43028
|
const onChunkReceivedRef = useRef59(onChunkReceived);
|
|
43160
43029
|
onChunkReceivedRef.current = onChunkReceived;
|
|
43161
|
-
const processChunk =
|
|
43030
|
+
const processChunk = useCallback43((chunk, messageType, forceProcess = false) => {
|
|
43162
43031
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
43163
43032
|
chunkBuffer.current.push({ chunk, messageType });
|
|
43164
43033
|
return true;
|
|
@@ -43171,7 +43040,7 @@ function useChunkCatchup({
|
|
|
43171
43040
|
onChunkReceivedRef.current(chunk, messageType);
|
|
43172
43041
|
return true;
|
|
43173
43042
|
}, []);
|
|
43174
|
-
const flushBufferedRealtimeChunks =
|
|
43043
|
+
const flushBufferedRealtimeChunks = useCallback43(() => {
|
|
43175
43044
|
if (chunkBuffer.current.length === 0) return;
|
|
43176
43045
|
const buffered = [...chunkBuffer.current];
|
|
43177
43046
|
chunkBuffer.current = [];
|
|
@@ -43184,7 +43053,7 @@ function useChunkCatchup({
|
|
|
43184
43053
|
processChunk(chunk, messageType, true);
|
|
43185
43054
|
});
|
|
43186
43055
|
}, [processChunk]);
|
|
43187
|
-
const catchUpChunks =
|
|
43056
|
+
const catchUpChunks = useCallback43(async (fromSequenceId) => {
|
|
43188
43057
|
const dialogId2 = dialogIdRef.current;
|
|
43189
43058
|
const chatTypes2 = chatTypesRef.current;
|
|
43190
43059
|
const fetchChunks2 = fetchChunksRef.current;
|
|
@@ -43297,7 +43166,7 @@ function useChunkCatchup({
|
|
|
43297
43166
|
}
|
|
43298
43167
|
}
|
|
43299
43168
|
}, [flushBufferedRealtimeChunks]);
|
|
43300
|
-
const resetChunkTracking =
|
|
43169
|
+
const resetChunkTracking = useCallback43(() => {
|
|
43301
43170
|
processedSequenceKeys.current.clear();
|
|
43302
43171
|
lastSequenceId.current = null;
|
|
43303
43172
|
fetchingInProgress.current = false;
|
|
@@ -43306,13 +43175,13 @@ function useChunkCatchup({
|
|
|
43306
43175
|
bufferUntilInitialCatchupComplete.current = false;
|
|
43307
43176
|
hasCompletedInitialCatchup.current = false;
|
|
43308
43177
|
}, []);
|
|
43309
|
-
const startInitialBuffering =
|
|
43178
|
+
const startInitialBuffering = useCallback43(() => {
|
|
43310
43179
|
chunkBuffer.current = [];
|
|
43311
43180
|
bufferUntilInitialCatchupComplete.current = true;
|
|
43312
43181
|
hasCompletedInitialCatchup.current = false;
|
|
43313
43182
|
}, []);
|
|
43314
|
-
const isBufferingActive =
|
|
43315
|
-
const resetAndCatchUp =
|
|
43183
|
+
const isBufferingActive = useCallback43(() => bufferUntilInitialCatchupComplete.current, []);
|
|
43184
|
+
const resetAndCatchUp = useCallback43(async () => {
|
|
43316
43185
|
if (!dialogIdRef.current) return;
|
|
43317
43186
|
const fromSeq = lastSequenceId.current;
|
|
43318
43187
|
hasCompletedInitialCatchup.current = false;
|
|
@@ -43848,7 +43717,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
43848
43717
|
}
|
|
43849
43718
|
|
|
43850
43719
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
43851
|
-
import { useCallback as
|
|
43720
|
+
import { useCallback as useCallback44, useRef as useRef62, useEffect as useEffect75 } from "react";
|
|
43852
43721
|
|
|
43853
43722
|
// src/components/chat/utils/chunk-parser.ts
|
|
43854
43723
|
function normalizeToolCalls(raw) {
|
|
@@ -44527,7 +44396,7 @@ function useRealtimeChunkProcessor(options) {
|
|
|
44527
44396
|
directModeFlagRef.current = isDirectMode;
|
|
44528
44397
|
}, [isDirectMode]);
|
|
44529
44398
|
const pendingEscalatedRef = useRef62(/* @__PURE__ */ new Map());
|
|
44530
|
-
const processChunk =
|
|
44399
|
+
const processChunk = useCallback44(
|
|
44531
44400
|
(chunk) => {
|
|
44532
44401
|
const action = parseChunkToAction(chunk);
|
|
44533
44402
|
if (!action) return;
|
|
@@ -44756,22 +44625,22 @@ function useRealtimeChunkProcessor(options) {
|
|
|
44756
44625
|
},
|
|
44757
44626
|
[callbacks, displayApprovalTypes, approvalStatuses, initialState]
|
|
44758
44627
|
);
|
|
44759
|
-
const getSegments =
|
|
44628
|
+
const getSegments = useCallback44(() => {
|
|
44760
44629
|
return accumulatorRef.current.getSegments();
|
|
44761
44630
|
}, []);
|
|
44762
|
-
const reset =
|
|
44631
|
+
const reset = useCallback44(() => {
|
|
44763
44632
|
accumulatorRef.current.reset();
|
|
44764
44633
|
pendingEscalatedRef.current.clear();
|
|
44765
44634
|
hasInitializedWithData.current = false;
|
|
44766
44635
|
sawDirectMessageRef.current = false;
|
|
44767
44636
|
}, []);
|
|
44768
|
-
const updateApprovalStatus =
|
|
44637
|
+
const updateApprovalStatus = useCallback44(
|
|
44769
44638
|
(requestId, status, resolvedByName) => {
|
|
44770
44639
|
return accumulatorRef.current.updateApprovalStatus(requestId, status, resolvedByName);
|
|
44771
44640
|
},
|
|
44772
44641
|
[]
|
|
44773
44642
|
);
|
|
44774
|
-
const getPendingApprovals =
|
|
44643
|
+
const getPendingApprovals = useCallback44(() => {
|
|
44775
44644
|
return new Map(pendingEscalatedRef.current);
|
|
44776
44645
|
}, []);
|
|
44777
44646
|
return {
|
|
@@ -44903,7 +44772,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
44903
44772
|
}
|
|
44904
44773
|
|
|
44905
44774
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
44906
|
-
import { useCallback as
|
|
44775
|
+
import { useCallback as useCallback45, useMemo as useMemo37, useRef as useRef63, useState as useState101 } from "react";
|
|
44907
44776
|
import { fileTypeFromBlob } from "file-type";
|
|
44908
44777
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
44909
44778
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -44981,10 +44850,10 @@ function useChatAttachments() {
|
|
|
44981
44850
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
44982
44851
|
const [attachments, setAttachments] = useState101([]);
|
|
44983
44852
|
const controllersRef = useRef63(/* @__PURE__ */ new Map());
|
|
44984
|
-
const updateOne =
|
|
44853
|
+
const updateOne = useCallback45((id, patch) => {
|
|
44985
44854
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
44986
44855
|
}, []);
|
|
44987
|
-
const removeAttachment =
|
|
44856
|
+
const removeAttachment = useCallback45((id) => {
|
|
44988
44857
|
const ctrl = controllersRef.current.get(id);
|
|
44989
44858
|
if (ctrl) {
|
|
44990
44859
|
ctrl.abort();
|
|
@@ -44992,12 +44861,12 @@ function useChatAttachments() {
|
|
|
44992
44861
|
}
|
|
44993
44862
|
setAttachments((prev) => prev.filter((a) => a.id !== id));
|
|
44994
44863
|
}, []);
|
|
44995
|
-
const clear =
|
|
44864
|
+
const clear = useCallback45(() => {
|
|
44996
44865
|
for (const ctrl of controllersRef.current.values()) ctrl.abort();
|
|
44997
44866
|
controllersRef.current.clear();
|
|
44998
44867
|
setAttachments([]);
|
|
44999
44868
|
}, []);
|
|
45000
|
-
const uploadOne =
|
|
44869
|
+
const uploadOne = useCallback45(
|
|
45001
44870
|
async (att) => {
|
|
45002
44871
|
const ctrl = controllersRef.current.get(att.id);
|
|
45003
44872
|
try {
|
|
@@ -45071,7 +44940,7 @@ function useChatAttachments() {
|
|
|
45071
44940
|
);
|
|
45072
44941
|
const attachmentsRef = useRef63([]);
|
|
45073
44942
|
attachmentsRef.current = attachments;
|
|
45074
|
-
const addFiles =
|
|
44943
|
+
const addFiles = useCallback45(
|
|
45075
44944
|
(files) => {
|
|
45076
44945
|
const arr = Array.from(files);
|
|
45077
44946
|
if (arr.length === 0) return;
|
|
@@ -45146,7 +45015,7 @@ function useChatAttachments() {
|
|
|
45146
45015
|
}
|
|
45147
45016
|
|
|
45148
45017
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
45149
|
-
import { useCallback as
|
|
45018
|
+
import { useCallback as useCallback46, useEffect as useEffect77, useRef as useRef64, useState as useState102 } from "react";
|
|
45150
45019
|
import { jsx as jsx323 } from "react/jsx-runtime";
|
|
45151
45020
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
45152
45021
|
function useChatAttachmentImageGallery() {
|
|
@@ -45154,7 +45023,7 @@ function useChatAttachmentImageGallery() {
|
|
|
45154
45023
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
45155
45024
|
const panelRef = useRef64(null);
|
|
45156
45025
|
const [state, setState] = useState102(CLOSED);
|
|
45157
|
-
const handleClose =
|
|
45026
|
+
const handleClose = useCallback46(() => setState(CLOSED), []);
|
|
45158
45027
|
useEffect77(() => {
|
|
45159
45028
|
const root = panelRef.current;
|
|
45160
45029
|
if (!root) return;
|
|
@@ -45274,20 +45143,20 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
45274
45143
|
}
|
|
45275
45144
|
|
|
45276
45145
|
// src/components/chat/hooks/use-chat.ts
|
|
45277
|
-
import { useState as useState105, useCallback as
|
|
45146
|
+
import { useState as useState105, useCallback as useCallback48, useEffect as useEffect80, useRef as useRef67 } from "react";
|
|
45278
45147
|
|
|
45279
45148
|
// src/components/chat/hooks/use-sse.ts
|
|
45280
|
-
import { useState as useState104, useCallback as
|
|
45149
|
+
import { useState as useState104, useCallback as useCallback47, useRef as useRef66 } from "react";
|
|
45281
45150
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
45282
45151
|
const [isStreaming, setIsStreaming] = useState104(false);
|
|
45283
45152
|
const [error, setError] = useState104(null);
|
|
45284
45153
|
const abortControllerRef = useRef66(null);
|
|
45285
|
-
const fallbackStream =
|
|
45154
|
+
const fallbackStream = useCallback47(async function* () {
|
|
45286
45155
|
throw new Error(
|
|
45287
45156
|
"[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the mock to your host code."
|
|
45288
45157
|
);
|
|
45289
45158
|
}, []);
|
|
45290
|
-
const streamMessage =
|
|
45159
|
+
const streamMessage = useCallback47(
|
|
45291
45160
|
async function* (message2, extra) {
|
|
45292
45161
|
setIsStreaming(true);
|
|
45293
45162
|
setError(null);
|
|
@@ -45317,13 +45186,13 @@ function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
|
45317
45186
|
},
|
|
45318
45187
|
[streamFn, fallbackStream]
|
|
45319
45188
|
);
|
|
45320
|
-
const abort =
|
|
45189
|
+
const abort = useCallback47(() => {
|
|
45321
45190
|
if (abortControllerRef.current) {
|
|
45322
45191
|
abortControllerRef.current.abort();
|
|
45323
45192
|
}
|
|
45324
45193
|
setIsStreaming(false);
|
|
45325
45194
|
}, []);
|
|
45326
|
-
const reset =
|
|
45195
|
+
const reset = useCallback47(() => {
|
|
45327
45196
|
}, []);
|
|
45328
45197
|
return {
|
|
45329
45198
|
streamMessage,
|
|
@@ -45366,10 +45235,10 @@ function useChat({
|
|
|
45366
45235
|
debugMode,
|
|
45367
45236
|
streamFn
|
|
45368
45237
|
});
|
|
45369
|
-
const addMessage =
|
|
45238
|
+
const addMessage = useCallback48((message2) => {
|
|
45370
45239
|
setMessages((prev) => [...prev, message2]);
|
|
45371
45240
|
}, []);
|
|
45372
|
-
const updateLastAssistantMessage =
|
|
45241
|
+
const updateLastAssistantMessage = useCallback48((segments) => {
|
|
45373
45242
|
setMessages((prev) => {
|
|
45374
45243
|
const newMessages = [...prev];
|
|
45375
45244
|
const lastMessage = newMessages[newMessages.length - 1];
|
|
@@ -45382,7 +45251,7 @@ function useChat({
|
|
|
45382
45251
|
return newMessages;
|
|
45383
45252
|
});
|
|
45384
45253
|
}, []);
|
|
45385
|
-
const sendMessage =
|
|
45254
|
+
const sendMessage = useCallback48(
|
|
45386
45255
|
async (text, extra, options) => {
|
|
45387
45256
|
const userMessage = {
|
|
45388
45257
|
id: `user-${Date.now()}`,
|
|
@@ -45612,18 +45481,18 @@ function useChat({
|
|
|
45612
45481
|
},
|
|
45613
45482
|
[streamMessage, addMessage, updateLastAssistantMessage, assistantName, assistantAvatar]
|
|
45614
45483
|
);
|
|
45615
|
-
const handleQuickAction =
|
|
45484
|
+
const handleQuickAction = useCallback48(
|
|
45616
45485
|
(actionText) => {
|
|
45617
45486
|
sendMessage(actionText);
|
|
45618
45487
|
},
|
|
45619
45488
|
[sendMessage]
|
|
45620
45489
|
);
|
|
45621
|
-
const clearMessages =
|
|
45490
|
+
const clearMessages = useCallback48(() => {
|
|
45622
45491
|
setMessages([]);
|
|
45623
45492
|
setIsTyping(false);
|
|
45624
45493
|
reset();
|
|
45625
45494
|
}, [reset]);
|
|
45626
|
-
const stopMessage =
|
|
45495
|
+
const stopMessage = useCallback48(() => {
|
|
45627
45496
|
abort();
|
|
45628
45497
|
setIsTyping(false);
|
|
45629
45498
|
}, [abort]);
|
|
@@ -45641,7 +45510,7 @@ function useChat({
|
|
|
45641
45510
|
}
|
|
45642
45511
|
|
|
45643
45512
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
45644
|
-
import { useState as useState106, useEffect as useEffect81, useCallback as
|
|
45513
|
+
import { useState as useState106, useEffect as useEffect81, useCallback as useCallback49, useMemo as useMemo38, useRef as useRef68 } from "react";
|
|
45645
45514
|
function createEmptyTurnMeta() {
|
|
45646
45515
|
return {
|
|
45647
45516
|
provider: null,
|
|
@@ -45978,7 +45847,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
45978
45847
|
const sendCountRef = useRef68(persistedRef.current.sendCount);
|
|
45979
45848
|
const [streamingPhase, setStreamingPhase] = useState106("idle");
|
|
45980
45849
|
const [metaTick, setMetaTick] = useState106(0);
|
|
45981
|
-
const bumpMetaTick =
|
|
45850
|
+
const bumpMetaTick = useCallback49(() => setMetaTick((t) => t + 1), []);
|
|
45982
45851
|
const streamFn = useMemo38(
|
|
45983
45852
|
() => createDocStreamFn(
|
|
45984
45853
|
source,
|
|
@@ -46025,7 +45894,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46025
45894
|
}
|
|
46026
45895
|
return map;
|
|
46027
45896
|
}, [slashCommands]);
|
|
46028
|
-
const persist =
|
|
45897
|
+
const persist = useCallback49(
|
|
46029
45898
|
(nextMessages) => {
|
|
46030
45899
|
savePersistedChat(source, {
|
|
46031
45900
|
messages: nextMessages,
|
|
@@ -46079,7 +45948,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46079
45948
|
...m.hidden ? { hidden: true } : {}
|
|
46080
45949
|
};
|
|
46081
45950
|
});
|
|
46082
|
-
const sendMessage =
|
|
45951
|
+
const sendMessage = useCallback49(
|
|
46083
45952
|
async (text, options2) => {
|
|
46084
45953
|
const {
|
|
46085
45954
|
hidden,
|
|
@@ -46098,7 +45967,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46098
45967
|
},
|
|
46099
45968
|
[chatSendMessage]
|
|
46100
45969
|
);
|
|
46101
|
-
const displayRef =
|
|
45970
|
+
const displayRef = useCallback49(
|
|
46102
45971
|
(reference) => {
|
|
46103
45972
|
const tableId = tableIdForDocumentType(reference.type);
|
|
46104
45973
|
if (!tableId) {
|
|
@@ -46122,7 +45991,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46122
45991
|
},
|
|
46123
45992
|
[sendMessage, source, cmdIdByTableId, tableIdForDocumentType]
|
|
46124
45993
|
);
|
|
46125
|
-
const discussRef =
|
|
45994
|
+
const discussRef = useCallback49(
|
|
46126
45995
|
(reference) => {
|
|
46127
45996
|
const tableId = tableIdForDocumentType(reference.type);
|
|
46128
45997
|
if (!tableId) {
|
|
@@ -46146,11 +46015,11 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
46146
46015
|
},
|
|
46147
46016
|
[sendMessage, tableIdForDocumentType]
|
|
46148
46017
|
);
|
|
46149
|
-
const stopMessage =
|
|
46018
|
+
const stopMessage = useCallback49(() => {
|
|
46150
46019
|
chatStopMessage();
|
|
46151
46020
|
setStreamingPhase("idle");
|
|
46152
46021
|
}, [chatStopMessage]);
|
|
46153
|
-
const clearMessages =
|
|
46022
|
+
const clearMessages = useCallback49(() => {
|
|
46154
46023
|
sourcesMapRef.current.clear();
|
|
46155
46024
|
refsMapRef.current.clear();
|
|
46156
46025
|
metaMapRef.current.clear();
|
|
@@ -46246,7 +46115,7 @@ var noopRejectRequest = async (_id, _reason) => {
|
|
|
46246
46115
|
|
|
46247
46116
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
46248
46117
|
import {
|
|
46249
|
-
useCallback as
|
|
46118
|
+
useCallback as useCallback50,
|
|
46250
46119
|
useEffect as useEffect82,
|
|
46251
46120
|
useMemo as useMemo39,
|
|
46252
46121
|
useRef as useRef69,
|
|
@@ -46757,7 +46626,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46757
46626
|
);
|
|
46758
46627
|
const [liveModel, setLiveModel] = useState107(null);
|
|
46759
46628
|
const [connectionState, setConnectionState] = useState107("connecting");
|
|
46760
|
-
const handleApprove =
|
|
46629
|
+
const handleApprove = useCallback50(
|
|
46761
46630
|
async (requestId) => {
|
|
46762
46631
|
if (!approveRequestCallback) return;
|
|
46763
46632
|
setApprovalStatuses((prev) => ({ ...prev, [requestId]: "approved" }));
|
|
@@ -46774,7 +46643,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46774
46643
|
},
|
|
46775
46644
|
[approveRequestCallback]
|
|
46776
46645
|
);
|
|
46777
|
-
const handleReject =
|
|
46646
|
+
const handleReject = useCallback50(
|
|
46778
46647
|
async (requestId, reason) => {
|
|
46779
46648
|
if (!rejectRequestCallback) return;
|
|
46780
46649
|
setApprovalStatuses((prev) => ({ ...prev, [requestId]: "rejected" }));
|
|
@@ -46795,11 +46664,11 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46795
46664
|
handleApproveRef.current = handleApprove;
|
|
46796
46665
|
const handleRejectRef = useRef69(handleReject);
|
|
46797
46666
|
handleRejectRef.current = handleReject;
|
|
46798
|
-
const accumApprove =
|
|
46667
|
+
const accumApprove = useCallback50((requestId) => {
|
|
46799
46668
|
if (!requestId) return;
|
|
46800
46669
|
return handleApproveRef.current(requestId);
|
|
46801
46670
|
}, []);
|
|
46802
|
-
const accumReject =
|
|
46671
|
+
const accumReject = useCallback50((requestId) => {
|
|
46803
46672
|
if (!requestId) return;
|
|
46804
46673
|
return handleRejectRef.current(requestId);
|
|
46805
46674
|
}, []);
|
|
@@ -46842,7 +46711,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46842
46711
|
fetchChunks
|
|
46843
46712
|
});
|
|
46844
46713
|
const historyLoadSeqRef = useRef69(0);
|
|
46845
|
-
const loadDialogHistory =
|
|
46714
|
+
const loadDialogHistory = useCallback50(
|
|
46846
46715
|
async (id, cursor) => {
|
|
46847
46716
|
if (!fetchDialogMessages) return;
|
|
46848
46717
|
historyLoadSeqRef.current += 1;
|
|
@@ -46941,7 +46810,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46941
46810
|
setConnectionState("connecting");
|
|
46942
46811
|
}, [active, dialogId]);
|
|
46943
46812
|
const initialDialogsLoadedRef = useRef69(false);
|
|
46944
|
-
const loadDialogsPage =
|
|
46813
|
+
const loadDialogsPage = useCallback50(
|
|
46945
46814
|
async (cursor) => {
|
|
46946
46815
|
if (!fetchDialogs) return;
|
|
46947
46816
|
setIsDialogsLoading(true);
|
|
@@ -46969,7 +46838,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46969
46838
|
},
|
|
46970
46839
|
[fetchDialogs, dialogsPageSize]
|
|
46971
46840
|
);
|
|
46972
|
-
const reloadDialogs =
|
|
46841
|
+
const reloadDialogs = useCallback50(() => {
|
|
46973
46842
|
void loadDialogsPage();
|
|
46974
46843
|
}, [loadDialogsPage]);
|
|
46975
46844
|
useEffect82(() => {
|
|
@@ -46979,7 +46848,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
46979
46848
|
initialDialogsLoadedRef.current = true;
|
|
46980
46849
|
void loadDialogsPage();
|
|
46981
46850
|
}, [active, fetchDialogs, loadDialogsPage]);
|
|
46982
|
-
const sendMessage =
|
|
46851
|
+
const sendMessage = useCallback50(
|
|
46983
46852
|
async (text, sendOptions) => {
|
|
46984
46853
|
const hidden = sendOptions?.hidden ?? false;
|
|
46985
46854
|
setMessages((prev) => [
|
|
@@ -47002,7 +46871,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47002
46871
|
},
|
|
47003
46872
|
[publishUserMessage, dialogId]
|
|
47004
46873
|
);
|
|
47005
|
-
const stopMessage =
|
|
46874
|
+
const stopMessage = useCallback50(() => {
|
|
47006
46875
|
setStreamingPhase("idle");
|
|
47007
46876
|
if (stopGenerationCallback && dialogId) {
|
|
47008
46877
|
void stopGenerationCallback(dialogId).catch((err) => {
|
|
@@ -47010,12 +46879,12 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47010
46879
|
});
|
|
47011
46880
|
}
|
|
47012
46881
|
}, [stopGenerationCallback, dialogId]);
|
|
47013
|
-
const clearMessages =
|
|
46882
|
+
const clearMessages = useCallback50(() => {
|
|
47014
46883
|
setMessages([]);
|
|
47015
46884
|
resetAccumulator();
|
|
47016
46885
|
setStreamingPhase("idle");
|
|
47017
46886
|
}, [resetAccumulator]);
|
|
47018
|
-
const selectDialog =
|
|
46887
|
+
const selectDialog = useCallback50(
|
|
47019
46888
|
(id) => {
|
|
47020
46889
|
if (!isManagedMode) {
|
|
47021
46890
|
return;
|
|
@@ -47024,7 +46893,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47024
46893
|
},
|
|
47025
46894
|
[isManagedMode]
|
|
47026
46895
|
);
|
|
47027
|
-
const startNewDialog =
|
|
46896
|
+
const startNewDialog = useCallback50(async () => {
|
|
47028
46897
|
if (!createDialogCallback) return null;
|
|
47029
46898
|
if (isCreatingDialog) return null;
|
|
47030
46899
|
try {
|
|
@@ -47049,7 +46918,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47049
46918
|
setIsCreatingDialog(false);
|
|
47050
46919
|
}
|
|
47051
46920
|
}, [createDialogCallback, isCreatingDialog, isManagedMode]);
|
|
47052
|
-
const deleteDialog =
|
|
46921
|
+
const deleteDialog = useCallback50(
|
|
47053
46922
|
async (id) => {
|
|
47054
46923
|
if (!deleteDialogCallback) return;
|
|
47055
46924
|
try {
|
|
@@ -47064,7 +46933,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47064
46933
|
},
|
|
47065
46934
|
[deleteDialogCallback, internalDialogId, isManagedMode]
|
|
47066
46935
|
);
|
|
47067
|
-
const renameDialog =
|
|
46936
|
+
const renameDialog = useCallback50(
|
|
47068
46937
|
async (id, title) => {
|
|
47069
46938
|
if (!renameDialogCallback) return;
|
|
47070
46939
|
let previous;
|
|
@@ -47088,7 +46957,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47088
46957
|
},
|
|
47089
46958
|
[renameDialogCallback]
|
|
47090
46959
|
);
|
|
47091
|
-
const archiveDialog =
|
|
46960
|
+
const archiveDialog = useCallback50(
|
|
47092
46961
|
async (id) => {
|
|
47093
46962
|
if (!archiveDialogCallback) return;
|
|
47094
46963
|
try {
|
|
@@ -47103,29 +46972,29 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47103
46972
|
},
|
|
47104
46973
|
[archiveDialogCallback, internalDialogId, isManagedMode]
|
|
47105
46974
|
);
|
|
47106
|
-
const loadMoreDialogs =
|
|
46975
|
+
const loadMoreDialogs = useCallback50(async () => {
|
|
47107
46976
|
if (!dialogsNextCursor) return;
|
|
47108
46977
|
await loadDialogsPage(dialogsNextCursor);
|
|
47109
46978
|
}, [dialogsNextCursor, loadDialogsPage]);
|
|
47110
|
-
const loadMoreMessages =
|
|
46979
|
+
const loadMoreMessages = useCallback50(async () => {
|
|
47111
46980
|
if (!dialogId || !messagesNextCursor) return;
|
|
47112
46981
|
await loadDialogHistory(dialogId, messagesNextCursor);
|
|
47113
46982
|
}, [dialogId, messagesNextCursor, loadDialogHistory]);
|
|
47114
|
-
const approveRequest =
|
|
46983
|
+
const approveRequest = useCallback50(
|
|
47115
46984
|
async (requestId) => {
|
|
47116
46985
|
await handleApproveRef.current(requestId);
|
|
47117
46986
|
},
|
|
47118
46987
|
[]
|
|
47119
46988
|
);
|
|
47120
|
-
const rejectRequest =
|
|
46989
|
+
const rejectRequest = useCallback50(
|
|
47121
46990
|
async (requestId, reason) => {
|
|
47122
46991
|
await handleRejectRef.current(requestId, reason);
|
|
47123
46992
|
},
|
|
47124
46993
|
[]
|
|
47125
46994
|
);
|
|
47126
|
-
const discussRef =
|
|
46995
|
+
const discussRef = useCallback50((_ref) => {
|
|
47127
46996
|
}, []);
|
|
47128
|
-
const displayRef =
|
|
46997
|
+
const displayRef = useCallback50((_ref) => {
|
|
47129
46998
|
}, []);
|
|
47130
46999
|
const isLoading = streamingPhase !== "idle";
|
|
47131
47000
|
const hasMoreDialogs = dialogsNextCursor != null;
|
|
@@ -47213,7 +47082,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
47213
47082
|
}
|
|
47214
47083
|
|
|
47215
47084
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
47216
|
-
import { useCallback as
|
|
47085
|
+
import { useCallback as useCallback51, useMemo as useMemo40, useRef as useRef70 } from "react";
|
|
47217
47086
|
var EMPTY_SSE_OPTIONS = {};
|
|
47218
47087
|
function createDisabledNatsConfig() {
|
|
47219
47088
|
return {
|
|
@@ -47244,60 +47113,60 @@ function useUnifiedChat(options) {
|
|
|
47244
47113
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
47245
47114
|
const activeStateRef = useRef70(activeState);
|
|
47246
47115
|
activeStateRef.current = activeState;
|
|
47247
|
-
const stopMessage =
|
|
47248
|
-
const clearMessages =
|
|
47116
|
+
const stopMessage = useCallback51(() => activeStateRef.current.stopMessage(), []);
|
|
47117
|
+
const clearMessages = useCallback51(
|
|
47249
47118
|
() => activeStateRef.current.clearMessages(),
|
|
47250
47119
|
[]
|
|
47251
47120
|
);
|
|
47252
|
-
const sendMessage =
|
|
47121
|
+
const sendMessage = useCallback51(
|
|
47253
47122
|
(text, opts) => activeStateRef.current.sendMessage(text, opts),
|
|
47254
47123
|
[]
|
|
47255
47124
|
);
|
|
47256
|
-
const discussRef =
|
|
47125
|
+
const discussRef = useCallback51(
|
|
47257
47126
|
(ref) => activeStateRef.current.discussRef(ref),
|
|
47258
47127
|
[]
|
|
47259
47128
|
);
|
|
47260
|
-
const displayRef =
|
|
47129
|
+
const displayRef = useCallback51(
|
|
47261
47130
|
(ref) => activeStateRef.current.displayRef(ref),
|
|
47262
47131
|
[]
|
|
47263
47132
|
);
|
|
47264
|
-
const selectDialog =
|
|
47133
|
+
const selectDialog = useCallback51(
|
|
47265
47134
|
(id) => activeStateRef.current.selectDialog(id),
|
|
47266
47135
|
[]
|
|
47267
47136
|
);
|
|
47268
|
-
const startNewDialog =
|
|
47137
|
+
const startNewDialog = useCallback51(
|
|
47269
47138
|
() => activeStateRef.current.startNewDialog(),
|
|
47270
47139
|
[]
|
|
47271
47140
|
);
|
|
47272
|
-
const deleteDialog =
|
|
47141
|
+
const deleteDialog = useCallback51(
|
|
47273
47142
|
(id) => activeStateRef.current.deleteDialog(id),
|
|
47274
47143
|
[]
|
|
47275
47144
|
);
|
|
47276
|
-
const renameDialog =
|
|
47145
|
+
const renameDialog = useCallback51(
|
|
47277
47146
|
(id, title) => activeStateRef.current.renameDialog(id, title),
|
|
47278
47147
|
[]
|
|
47279
47148
|
);
|
|
47280
|
-
const archiveDialog =
|
|
47149
|
+
const archiveDialog = useCallback51(
|
|
47281
47150
|
(id) => activeStateRef.current.archiveDialog(id),
|
|
47282
47151
|
[]
|
|
47283
47152
|
);
|
|
47284
|
-
const loadMoreDialogs =
|
|
47153
|
+
const loadMoreDialogs = useCallback51(
|
|
47285
47154
|
() => activeStateRef.current.loadMoreDialogs(),
|
|
47286
47155
|
[]
|
|
47287
47156
|
);
|
|
47288
|
-
const reloadDialogs =
|
|
47157
|
+
const reloadDialogs = useCallback51(
|
|
47289
47158
|
() => activeStateRef.current.reloadDialogs(),
|
|
47290
47159
|
[]
|
|
47291
47160
|
);
|
|
47292
|
-
const loadMoreMessages =
|
|
47161
|
+
const loadMoreMessages = useCallback51(
|
|
47293
47162
|
() => activeStateRef.current.loadMoreMessages(),
|
|
47294
47163
|
[]
|
|
47295
47164
|
);
|
|
47296
|
-
const approveRequest =
|
|
47165
|
+
const approveRequest = useCallback51(
|
|
47297
47166
|
(requestId) => activeStateRef.current.approveRequest(requestId),
|
|
47298
47167
|
[]
|
|
47299
47168
|
);
|
|
47300
|
-
const rejectRequest =
|
|
47169
|
+
const rejectRequest = useCallback51(
|
|
47301
47170
|
(requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
|
|
47302
47171
|
[]
|
|
47303
47172
|
);
|
|
@@ -47552,7 +47421,7 @@ function chatChipClass({ tone, density = "chip", extra }) {
|
|
|
47552
47421
|
}
|
|
47553
47422
|
|
|
47554
47423
|
// src/components/chat/embeddable-chat.tsx
|
|
47555
|
-
import { useCallback as
|
|
47424
|
+
import { useCallback as useCallback53, useEffect as useEffect83, useMemo as useMemo42, useRef as useRef71, useState as useState109 } from "react";
|
|
47556
47425
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
47557
47426
|
import { usePreventScroll } from "@react-aria/overlays";
|
|
47558
47427
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -47633,7 +47502,7 @@ init_button2();
|
|
|
47633
47502
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
47634
47503
|
|
|
47635
47504
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
47636
|
-
import { useCallback as
|
|
47505
|
+
import { useCallback as useCallback52, useMemo as useMemo41, useState as useState108 } from "react";
|
|
47637
47506
|
function useChatDialogManager({
|
|
47638
47507
|
dialogs,
|
|
47639
47508
|
activeDialogId,
|
|
@@ -47646,14 +47515,14 @@ function useChatDialogManager({
|
|
|
47646
47515
|
}) {
|
|
47647
47516
|
const [renameTarget, setRenameTarget] = useState108(null);
|
|
47648
47517
|
const [archiveTarget, setArchiveTarget] = useState108(null);
|
|
47649
|
-
const handleConfirmRename =
|
|
47518
|
+
const handleConfirmRename = useCallback52(
|
|
47650
47519
|
(name) => {
|
|
47651
47520
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
47652
47521
|
setRenameTarget(null);
|
|
47653
47522
|
},
|
|
47654
47523
|
[renameTarget, renameDialog]
|
|
47655
47524
|
);
|
|
47656
|
-
const handleConfirmArchive =
|
|
47525
|
+
const handleConfirmArchive = useCallback52(async () => {
|
|
47657
47526
|
if (archiveTarget) {
|
|
47658
47527
|
try {
|
|
47659
47528
|
await archiveDialog(archiveTarget.id);
|
|
@@ -47672,7 +47541,7 @@ function useChatDialogManager({
|
|
|
47672
47541
|
const [archivedDialogs, setArchivedDialogs] = useState108([]);
|
|
47673
47542
|
const [archivedCursor, setArchivedCursor] = useState108(null);
|
|
47674
47543
|
const [archivedLoading, setArchivedLoading] = useState108(false);
|
|
47675
|
-
const loadArchivedPage =
|
|
47544
|
+
const loadArchivedPage = useCallback52(
|
|
47676
47545
|
async (cursor) => {
|
|
47677
47546
|
if (!fetchArchivedDialogs) return;
|
|
47678
47547
|
setArchivedLoading(true);
|
|
@@ -47690,18 +47559,18 @@ function useChatDialogManager({
|
|
|
47690
47559
|
},
|
|
47691
47560
|
[fetchArchivedDialogs]
|
|
47692
47561
|
);
|
|
47693
|
-
const openArchive =
|
|
47562
|
+
const openArchive = useCallback52(() => {
|
|
47694
47563
|
setArchiveOpen(true);
|
|
47695
47564
|
setArchivedDialogs([]);
|
|
47696
47565
|
setArchivedCursor(null);
|
|
47697
47566
|
void loadArchivedPage();
|
|
47698
47567
|
}, [loadArchivedPage]);
|
|
47699
|
-
const closeArchive =
|
|
47568
|
+
const closeArchive = useCallback52(() => setArchiveOpen(false), []);
|
|
47700
47569
|
const [viewingArchivedId, setViewingArchivedId] = useState108(
|
|
47701
47570
|
null
|
|
47702
47571
|
);
|
|
47703
47572
|
const [openingDialogId, setOpeningDialogId] = useState108(null);
|
|
47704
|
-
const handleSelectDialog =
|
|
47573
|
+
const handleSelectDialog = useCallback52(
|
|
47705
47574
|
(id) => {
|
|
47706
47575
|
setViewingArchivedId(null);
|
|
47707
47576
|
setOpeningDialogId(id);
|
|
@@ -47710,7 +47579,7 @@ function useChatDialogManager({
|
|
|
47710
47579
|
[selectDialog]
|
|
47711
47580
|
);
|
|
47712
47581
|
const isOpeningDialog = openingDialogId != null && openingDialogId === activeDialogId;
|
|
47713
|
-
const handleArchivedSelect =
|
|
47582
|
+
const handleArchivedSelect = useCallback52(
|
|
47714
47583
|
(id) => {
|
|
47715
47584
|
setArchiveOpen(false);
|
|
47716
47585
|
setOpeningDialogId(null);
|
|
@@ -47720,7 +47589,7 @@ function useChatDialogManager({
|
|
|
47720
47589
|
[selectDialog]
|
|
47721
47590
|
);
|
|
47722
47591
|
const [restoreTarget, setRestoreTarget] = useState108(null);
|
|
47723
|
-
const handleConfirmRestore =
|
|
47592
|
+
const handleConfirmRestore = useCallback52(async () => {
|
|
47724
47593
|
if (restoreTarget) {
|
|
47725
47594
|
try {
|
|
47726
47595
|
await unarchiveDialog?.(restoreTarget.id);
|
|
@@ -47734,7 +47603,7 @@ function useChatDialogManager({
|
|
|
47734
47603
|
setRestoreTarget(null);
|
|
47735
47604
|
}, [restoreTarget, unarchiveDialog]);
|
|
47736
47605
|
const isViewingArchived = viewingArchivedId != null && viewingArchivedId === activeDialogId;
|
|
47737
|
-
const handleBack =
|
|
47606
|
+
const handleBack = useCallback52(() => {
|
|
47738
47607
|
const wasArchived = isViewingArchived;
|
|
47739
47608
|
setViewingArchivedId(null);
|
|
47740
47609
|
setOpeningDialogId(null);
|
|
@@ -48162,7 +48031,7 @@ function EmbeddableChatInner({
|
|
|
48162
48031
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
48163
48032
|
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState109(initialActiveMode);
|
|
48164
48033
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
48165
|
-
const handleActiveModeChange =
|
|
48034
|
+
const handleActiveModeChange = useCallback53(
|
|
48166
48035
|
(next) => {
|
|
48167
48036
|
if (controlledActiveMode === void 0) {
|
|
48168
48037
|
setUncontrolledActiveMode(next);
|
|
@@ -48247,7 +48116,7 @@ function EmbeddableChatInner({
|
|
|
48247
48116
|
for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
|
|
48248
48117
|
return (item) => byType.get(item.type);
|
|
48249
48118
|
}, [contextEntityTypes]);
|
|
48250
|
-
const toggleContextItem =
|
|
48119
|
+
const toggleContextItem = useCallback53(
|
|
48251
48120
|
(item) => {
|
|
48252
48121
|
const key = `${item.type}:${item.id}`;
|
|
48253
48122
|
if (mentionActiveRef.current) {
|
|
@@ -48270,7 +48139,7 @@ function EmbeddableChatInner({
|
|
|
48270
48139
|
},
|
|
48271
48140
|
[contextMaxItems, contextItems, mentionMarkerByType, resolveContextIcon]
|
|
48272
48141
|
);
|
|
48273
|
-
const removeContextItem =
|
|
48142
|
+
const removeContextItem = useCallback53((item) => {
|
|
48274
48143
|
const key = `${item.type}:${item.id}`;
|
|
48275
48144
|
setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
|
|
48276
48145
|
if (mentionKeysRef.current.has(key)) {
|
|
@@ -48280,7 +48149,7 @@ function EmbeddableChatInner({
|
|
|
48280
48149
|
chatInputRef.current?.setValue(next);
|
|
48281
48150
|
}
|
|
48282
48151
|
}, [mentionMarkerByType]);
|
|
48283
|
-
const handleContextValueChange =
|
|
48152
|
+
const handleContextValueChange = useCallback53((value) => {
|
|
48284
48153
|
for (const key of Array.from(mentionKeysRef.current)) {
|
|
48285
48154
|
if (!value.includes(`@${mentionTokenOf(key, mentionMarkerByType)}`)) {
|
|
48286
48155
|
mentionKeysRef.current.delete(key);
|
|
@@ -48288,24 +48157,24 @@ function EmbeddableChatInner({
|
|
|
48288
48157
|
}
|
|
48289
48158
|
}
|
|
48290
48159
|
}, [mentionMarkerByType]);
|
|
48291
|
-
const openContextPicker =
|
|
48160
|
+
const openContextPicker = useCallback53(() => {
|
|
48292
48161
|
setMentionQuery(null);
|
|
48293
48162
|
setContextPickerOpen(true);
|
|
48294
48163
|
}, []);
|
|
48295
|
-
const closeContextPicker =
|
|
48164
|
+
const closeContextPicker = useCallback53(() => {
|
|
48296
48165
|
if (mentionActiveRef.current) {
|
|
48297
48166
|
chatInputRef.current?.removeMentionTrigger();
|
|
48298
48167
|
}
|
|
48299
48168
|
setContextPickerOpen(false);
|
|
48300
48169
|
setMentionQuery(null);
|
|
48301
48170
|
}, []);
|
|
48302
|
-
const handleMentionQueryChange =
|
|
48171
|
+
const handleMentionQueryChange = useCallback53((query) => {
|
|
48303
48172
|
setMentionQuery(query);
|
|
48304
48173
|
setContextPickerOpen(query !== null);
|
|
48305
48174
|
}, []);
|
|
48306
48175
|
const resolvedBaseRoute = baseRoute || (source === "flamingo" ? "/knowledge-base" : "/data-room");
|
|
48307
|
-
const handleClose =
|
|
48308
|
-
const handleNavigationClose =
|
|
48176
|
+
const handleClose = useCallback53(() => setIsOpen(false), [setIsOpen]);
|
|
48177
|
+
const handleNavigationClose = useCallback53(() => {
|
|
48309
48178
|
navigatingAwayRef.current = true;
|
|
48310
48179
|
setIsOpen(false);
|
|
48311
48180
|
}, [setIsOpen]);
|
|
@@ -48313,7 +48182,7 @@ function EmbeddableChatInner({
|
|
|
48313
48182
|
() => ({ closeChat: handleNavigationClose }),
|
|
48314
48183
|
[handleNavigationClose]
|
|
48315
48184
|
);
|
|
48316
|
-
const renderEntityCard =
|
|
48185
|
+
const renderEntityCard = useCallback53(
|
|
48317
48186
|
(reference) => renderChatInlineEntityCard(reference, {
|
|
48318
48187
|
onDiscuss: discussRef,
|
|
48319
48188
|
onDisplay: displayRef,
|
|
@@ -48370,7 +48239,7 @@ function EmbeddableChatInner({
|
|
|
48370
48239
|
}
|
|
48371
48240
|
return mapped;
|
|
48372
48241
|
}, [rawMessages, guideUserName, guideUserAvatar]);
|
|
48373
|
-
const handleSend =
|
|
48242
|
+
const handleSend = useCallback53(
|
|
48374
48243
|
(text) => {
|
|
48375
48244
|
let augmentedText = text;
|
|
48376
48245
|
if (readyAttachments.length > 0) {
|
|
@@ -48433,7 +48302,7 @@ function EmbeddableChatInner({
|
|
|
48433
48302
|
fetchArchivedDialogs: mingoCaps.fetchArchivedDialogs,
|
|
48434
48303
|
unarchiveDialog: mingoCaps.unarchiveDialog
|
|
48435
48304
|
});
|
|
48436
|
-
const handleOpen =
|
|
48305
|
+
const handleOpen = useCallback53(() => setIsOpen(true), [setIsOpen]);
|
|
48437
48306
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
48438
48307
|
useEffect83(() => {
|
|
48439
48308
|
const handler = (e) => {
|
|
@@ -48841,7 +48710,6 @@ export {
|
|
|
48841
48710
|
DatePicker,
|
|
48842
48711
|
DatePickerInput,
|
|
48843
48712
|
DatePickerInputSimple,
|
|
48844
|
-
DateFilterMenu,
|
|
48845
48713
|
DurationInput,
|
|
48846
48714
|
HoneypotField,
|
|
48847
48715
|
ProgressBar,
|
|
@@ -49715,4 +49583,4 @@ export {
|
|
|
49715
49583
|
LogsList,
|
|
49716
49584
|
assets
|
|
49717
49585
|
};
|
|
49718
|
-
//# sourceMappingURL=chunk-
|
|
49586
|
+
//# sourceMappingURL=chunk-F3DK3ETT.js.map
|