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