@swisper.ai/web-chat-ui 0.0.8 → 0.1.0
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/components/chat-card/components/chat-card-header.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -1
- package/dist/components/rich-text-field/utils.d.ts +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +932 -930
- package/dist/index.es.js.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts +20 -15
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts +0 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +4 -4
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts +13 -13
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/chat-card/components/chat-card-header.tsx +3 -7
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +4 -12
- package/src/components/rich-text-area/__tests__/rich-text-area.spec.tsx +12 -2
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-list.tsx +6 -9
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.sizing.test.ts +10 -12
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx +71 -26
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +18 -12
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts +0 -2
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +20 -56
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx +36 -34
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts +33 -22
- package/src/layouts/chat-card-two-column-layout/__stories__/route-map.tsx +1 -1
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { Slot as e } from "@radix-ui/react-slot";
|
|
2
2
|
import t, { Children as n, cloneElement as r, createContext as i, forwardRef as a, isValidElement as o, memo as s, useCallback as c, useContext as l, useEffect as u, useImperativeHandle as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
3
|
-
import { Button as g, Chip as _, Collapsible as v,
|
|
4
|
-
import { cn as L, useElementMeasure as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { cva as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { $
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { $
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import { Streamdown as
|
|
27
|
-
import
|
|
3
|
+
import { Button as g, Chip as _, Collapsible as v, CollapsibleChevron as y, CollapsibleContent as b, CollapsibleTrigger as x, Divider as S, EmptyState as C, EmptyStateActionRow as w, EmptyStateDescription as T, EmptyStateIcon as E, EmptyStateTitle as ee, IconButton as D, List as te, ListItem as O, ListItemAction as k, ListItemTitle as A, ListItemTrigger as j, Menu as ne, MenuProvider as M, MenuTrigger as re, OrderChip as N, Panel as ie, PanelActionButton as P, PanelActionCloseButton as ae, PanelBody as oe, PanelContent as se, PanelFooter as ce, PanelHeader as F, PanelProvider as le, PanelTitle as ue, Popover as de, PopoverContent as fe, PopoverTrigger as pe, ScrollArea as me, SelectField as he, Skeleton as ge, Tooltip as _e, Typography as I, listItemVariants as ve, panelBodyPadding as ye, useIsResolution as be } from "@swisper.ai/ui";
|
|
4
|
+
import { cn as L, useElementMeasure as xe } from "@swisper.ai/web-core";
|
|
5
|
+
import { Fragment as Se, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
6
|
+
import { cva as B } from "class-variance-authority";
|
|
7
|
+
import { CodeNode as Ce } from "@lexical/code";
|
|
8
|
+
import { $isLinkNode as we, LinkNode as Te, TOGGLE_LINK_COMMAND as Ee } from "@lexical/link";
|
|
9
|
+
import { $createListItemNode as De, $createListNode as Oe, ListItemNode as ke, ListNode as Ae } from "@lexical/list";
|
|
10
|
+
import { LexicalComposer as je } from "@lexical/react/LexicalComposer";
|
|
11
|
+
import { ContentEditable as Me } from "@lexical/react/LexicalContentEditable";
|
|
12
|
+
import { LexicalErrorBoundary as Ne } from "@lexical/react/LexicalErrorBoundary";
|
|
13
|
+
import { HistoryPlugin as Pe } from "@lexical/react/LexicalHistoryPlugin";
|
|
14
|
+
import { RichTextPlugin as Fe } from "@lexical/react/LexicalRichTextPlugin";
|
|
15
|
+
import { $createHeadingNode as Ie, HeadingNode as Le, QuoteNode as Re } from "@lexical/rich-text";
|
|
16
|
+
import { useLexicalComposerContext as ze } from "@lexical/react/LexicalComposerContext";
|
|
17
|
+
import { $convertFromMarkdownString as Be, $convertToMarkdownString as Ve, TRANSFORMERS as He, TRANSFORMERS as Ue } from "@lexical/markdown";
|
|
18
|
+
import { $addUpdateTag as V, $createParagraphNode as We, $createRangeSelection as Ge, $createTextNode as Ke, $getPreviousSelection as qe, $getRoot as H, $getSelection as U, $insertNodes as Je, $isElementNode as Ye, $isParagraphNode as Xe, $isRangeSelection as W, $isTextNode as G, $selectAll as Ze, $setSelection as Qe, $setState as $e, COMMAND_PRIORITY_CRITICAL as et, COMMAND_PRIORITY_EDITOR as tt, COMMAND_PRIORITY_LOW as nt, DecoratorNode as rt, ElementNode as it, FORMAT_ELEMENT_COMMAND as at, FORMAT_TEXT_COMMAND as ot, PASTE_COMMAND as st, SELECTION_CHANGE_COMMAND as ct, SKIP_DOM_SELECTION_TAG as lt, SKIP_SELECTION_FOCUS_TAG as ut, createCommand as dt, createState as ft, isHTMLElement as pt, setNodeIndentFromDOM as mt } from "lexical";
|
|
19
|
+
import { OnChangePlugin as ht } from "@lexical/react/LexicalOnChangePlugin";
|
|
20
|
+
import { createPortal as gt } from "react-dom";
|
|
21
|
+
import { useVirtualizer as _t } from "@tanstack/react-virtual";
|
|
22
|
+
import * as vt from "@radix-ui/react-scroll-area";
|
|
23
|
+
import { nanoid as yt } from "nanoid";
|
|
24
|
+
import { AttachmentsIcon as bt, ChevronDownIcon as xt, ChevronUpIcon as St, CloseIcon as Ct, CodeIcon as wt, DeleteIcon as Tt, DocIcon as Et, DraftIcon as Dt, FormatAlignCenterIcon as Ot, FormatAlignLeftIcon as kt, FormatAlignRightIcon as At, FormatBoldIcon as jt, FormatCleanIcon as Mt, FormatColorIcon as Nt, FormatItalicIcon as Pt, FormatUnderlineIcon as Ft, ImageIcon as It, LinkOffIcon as Lt, LinkOnIcon as Rt, MoreHorizontalIcon as zt, OpenInFullIcon as Bt, PdfIcon as Vt, PptIcon as Ht, SignalReadIcon as Ut, SignalUnreadIcon as Wt, SnoozeIcon as Gt, XlsIcon as Kt } from "@swisper.ai/icons";
|
|
25
|
+
import qt from "mime";
|
|
26
|
+
import { Streamdown as Jt, defaultRehypePlugins as Yt, defaultRemarkPlugins as Xt } from "streamdown";
|
|
27
|
+
import Zt, { defaultSchema as Qt } from "rehype-sanitize";
|
|
28
28
|
import "katex/dist/katex.min.css";
|
|
29
|
-
import { MessageScroller as
|
|
30
|
-
import { AnimatePresence as
|
|
31
|
-
import { TablePlugin as
|
|
32
|
-
import { TableCellNode as
|
|
33
|
-
import { $generateHtmlFromNodes as
|
|
34
|
-
import { EditorRefPlugin as
|
|
35
|
-
import { $getNearestBlockElementAncestorOrThrow as
|
|
36
|
-
import { $forEachSelectedTextNode as
|
|
29
|
+
import { MessageScroller as K, useMessageScroller as $t, useMessageScrollerScrollable as en } from "@shadcn/react/message-scroller";
|
|
30
|
+
import { AnimatePresence as tn, motion as nn } from "motion/react";
|
|
31
|
+
import { TablePlugin as rn } from "@lexical/react/LexicalTablePlugin";
|
|
32
|
+
import { TableCellNode as an, TableNode as on, TableRowNode as sn } from "@lexical/table";
|
|
33
|
+
import { $generateHtmlFromNodes as cn, $generateNodesFromDOM as ln } from "@lexical/html";
|
|
34
|
+
import { EditorRefPlugin as un } from "@lexical/react/LexicalEditorRefPlugin";
|
|
35
|
+
import { $getNearestBlockElementAncestorOrThrow as dn, mergeRegister as fn } from "@lexical/utils";
|
|
36
|
+
import { $forEachSelectedTextNode as pn, $getSelectionStyleValueForProperty as mn, $isAtNodeEnd as hn, $patchStyleText as gn } from "@lexical/selection";
|
|
37
37
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import { unified as
|
|
42
|
-
import { visit as
|
|
43
|
-
import { createParser as
|
|
38
|
+
import _n from "inline-style-parser";
|
|
39
|
+
import vn from "remark-gfm";
|
|
40
|
+
import yn from "remark-parse";
|
|
41
|
+
import { unified as bn } from "unified";
|
|
42
|
+
import { visit as xn } from "unist-util-visit";
|
|
43
|
+
import { createParser as Sn } from "eventsource-parser";
|
|
44
44
|
//#region src/layouts/chat-card-list-layout/chat-card-list-layout.tsx
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
let e = l(
|
|
45
|
+
var Cn = 3, wn = i(null);
|
|
46
|
+
function Tn() {
|
|
47
|
+
let e = l(wn);
|
|
48
48
|
if (!e) throw Error("[web-chat-ui] \"useChatCardListLayoutContext\" must be used within a ChatCardListLayout. ChatCardListLayoutItems and ChatCardListLayoutShowMore both read it, so both must be rendered inside the ChatCardListLayout element, not as siblings of it.");
|
|
49
49
|
return e;
|
|
50
50
|
}
|
|
51
|
-
var
|
|
51
|
+
var En = a(function({ children: t, className: n, visibleCount: r = Cn, defaultExpanded: i = !1, expanded: a, onExpandedChange: o, asChild: s = !1, ...l }, u) {
|
|
52
52
|
let [d, f] = h(i), [m, g] = h(0), _ = a ?? d, v = c(() => {
|
|
53
53
|
a === void 0 && f(!0), o?.(!0);
|
|
54
54
|
}, [a, o]), y = p(() => ({
|
|
@@ -63,9 +63,9 @@ var wn = a(function({ children: t, className: n, visibleCount: r = xn, defaultEx
|
|
|
63
63
|
v,
|
|
64
64
|
m
|
|
65
65
|
]), b = s ? e : "div";
|
|
66
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ R(wn.Provider, {
|
|
67
67
|
value: y,
|
|
68
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ R(b, {
|
|
69
69
|
ref: u,
|
|
70
70
|
"data-slot": "chat-card-list-layout",
|
|
71
71
|
"data-testid": "chat-card-list-layout",
|
|
@@ -76,19 +76,19 @@ var wn = a(function({ children: t, className: n, visibleCount: r = xn, defaultEx
|
|
|
76
76
|
})
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
function
|
|
81
|
-
let { visibleCount: t, isExpanded: r, setHiddenCount: i } =
|
|
79
|
+
En.displayName = "ChatCardListLayout";
|
|
80
|
+
function Dn({ children: e }) {
|
|
81
|
+
let { visibleCount: t, isExpanded: r, setHiddenCount: i } = Tn(), a = n.toArray(e), o = r ? 0 : Math.max(0, a.length - t);
|
|
82
82
|
return f(() => {
|
|
83
83
|
i(o);
|
|
84
|
-
}, [o, i]), /* @__PURE__ */
|
|
84
|
+
}, [o, i]), /* @__PURE__ */ R(Se, { children: r ? a : a.slice(0, t) });
|
|
85
85
|
}
|
|
86
|
-
var
|
|
87
|
-
let { isExpanded: a, hiddenCount: o, expand: s } =
|
|
86
|
+
var On = a(function({ children: e, onClick: t, className: n, ...r }, i) {
|
|
87
|
+
let { isExpanded: a, hiddenCount: o, expand: s } = Tn();
|
|
88
88
|
function c(e) {
|
|
89
89
|
s(), t?.(e);
|
|
90
90
|
}
|
|
91
|
-
return a || o === 0 ? null : /* @__PURE__ */
|
|
91
|
+
return a || o === 0 ? null : /* @__PURE__ */ R(g, {
|
|
92
92
|
ref: i,
|
|
93
93
|
variant: "tertiary",
|
|
94
94
|
size: "sm",
|
|
@@ -100,224 +100,228 @@ var En = a(function({ children: e, onClick: t, className: n, ...r }, i) {
|
|
|
100
100
|
children: e
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
function
|
|
103
|
+
On.displayName = "ChatCardListLayoutShowMore";
|
|
104
|
+
function kn(e) {
|
|
105
105
|
return e >= 1132 ? "xl" : e >= 698 ? "lg" : e >= 640 ? "md" : "sm";
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
let n = e === "unset" ? "xl" :
|
|
107
|
+
function An(e, t) {
|
|
108
|
+
let n = e === "unset" ? "xl" : kn(e);
|
|
109
109
|
return {
|
|
110
110
|
size: n,
|
|
111
|
-
isListFloating: n === "sm" || n === "md",
|
|
112
111
|
isDetailsFloating: t === "floating" || n !== "xl",
|
|
113
112
|
isDetailsSheet: n === "sm"
|
|
114
113
|
};
|
|
115
114
|
}
|
|
116
115
|
//#endregion
|
|
117
116
|
//#region src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts
|
|
118
|
-
var
|
|
117
|
+
var jn = "responsive", Mn = B([
|
|
119
118
|
"relative grid gap-[8px]",
|
|
120
119
|
"grid-cols-[1fr] [grid-template-areas:'main']",
|
|
121
120
|
"data-[size=lg]:grid-cols-[290px_1fr] data-[size=lg]:[grid-template-areas:'list_main']",
|
|
122
121
|
"data-[size=xl]:grid-cols-[358px_1fr] data-[size=xl]:[grid-template-areas:'list_main']",
|
|
123
122
|
"data-[details-floating=false]:has-[>[data-slot=chat-card-three-column-layout-details]]:grid-cols-[358px_1fr_358px]",
|
|
124
123
|
"data-[details-floating=false]:has-[>[data-slot=chat-card-three-column-layout-details]]:[grid-template-areas:'list_main_details']"
|
|
125
|
-
]),
|
|
124
|
+
]), Nn = B([
|
|
126
125
|
"min-w-0",
|
|
127
|
-
"data-[
|
|
128
|
-
"data-[
|
|
129
|
-
]
|
|
126
|
+
"data-[size=lg]:[grid-area:list] data-[size=lg]:min-h-0 data-[size=lg]:h-full data-[size=lg]:overflow-hidden",
|
|
127
|
+
"data-[size=xl]:[grid-area:list] data-[size=xl]:min-h-0 data-[size=xl]:h-full data-[size=xl]:overflow-hidden"
|
|
128
|
+
], {
|
|
129
|
+
variants: { hideOnMobile: {
|
|
130
|
+
true: "data-[size=sm]:hidden data-[size=md]:hidden",
|
|
131
|
+
false: ""
|
|
132
|
+
} },
|
|
133
|
+
defaultVariants: { hideOnMobile: !1 }
|
|
134
|
+
}), Pn = B(["[grid-area:main] relative min-w-0 min-h-0 h-full"]), Fn = B([
|
|
130
135
|
"min-h-0 min-w-0 max-w-full",
|
|
131
136
|
"data-[floating=false]:[grid-area:details] data-[floating=false]:h-full",
|
|
132
137
|
"data-[floating=true]:z-20 data-[floating=true]:[grid-area:main]",
|
|
133
138
|
"data-[floating=true]:data-[sheet=false]:w-[358px] data-[floating=true]:data-[sheet=false]:h-full data-[floating=true]:data-[sheet=false]:justify-self-end data-[floating=true]:data-[sheet=false]:self-stretch data-[floating=true]:data-[sheet=false]:p-[12px]",
|
|
134
139
|
"data-[sheet=true]:w-full data-[sheet=true]:h-[85%] data-[sheet=true]:justify-self-start data-[sheet=true]:self-end"
|
|
135
|
-
]),
|
|
140
|
+
]), In = B([
|
|
136
141
|
"relative z-30 min-w-0 min-h-0 h-full p-[12px] row-1",
|
|
137
|
-
"
|
|
138
|
-
"data-[
|
|
139
|
-
]),
|
|
140
|
-
function
|
|
141
|
-
let t = l(
|
|
142
|
-
if (!t) throw Error(`[web-chat-ui] "${e}" must be used within a ChatCardThreeColumnLayout. It reads its
|
|
142
|
+
"col-span-full",
|
|
143
|
+
"data-[size=lg]:col-[2/-1] data-[size=xl]:col-[2/-1]"
|
|
144
|
+
]), Ln = B(["data-[state=open]:w-(--message-list-content-width) data-[state=open]:mx-0", "data-[state=open]:min-w-[min(1432px,calc(var(--chat-window-width,100%)-var(--spacing-message)*2))]"]), Rn = i(null);
|
|
145
|
+
function zn(e) {
|
|
146
|
+
let t = l(Rn);
|
|
147
|
+
if (!t) throw Error(`[web-chat-ui] "${e}" must be used within a ChatCardThreeColumnLayout. It reads its placement from the layout, so render it as a child of the ChatCardThreeColumnLayout element, not as a sibling of it.`);
|
|
143
148
|
return t;
|
|
144
149
|
}
|
|
145
|
-
function
|
|
150
|
+
function Bn(e, t) {
|
|
146
151
|
return typeof e == "function" ? e(t) : e;
|
|
147
152
|
}
|
|
148
|
-
function
|
|
153
|
+
function Vn(e, t) {
|
|
149
154
|
return c((n) => {
|
|
150
155
|
e(n), typeof t == "function" ? t(n) : t && (t.current = n);
|
|
151
156
|
}, [e, t]);
|
|
152
157
|
}
|
|
153
|
-
var
|
|
154
|
-
let { ref: s, width: c } =
|
|
155
|
-
|
|
156
|
-
isDetailsFloating:
|
|
157
|
-
isDetailsSheet:
|
|
158
|
+
var Hn = a(function({ children: t, className: n, detailsPlacement: r = jn, asChild: i = !1, ...a }, o) {
|
|
159
|
+
let { ref: s, width: c } = xe(), l = Vn(s, o), { size: u, isDetailsFloating: d, isDetailsSheet: f } = An(c, r), m = p(() => ({
|
|
160
|
+
size: u,
|
|
161
|
+
isDetailsFloating: d,
|
|
162
|
+
isDetailsSheet: f
|
|
158
163
|
}), [
|
|
164
|
+
u,
|
|
159
165
|
d,
|
|
160
|
-
f
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
children: /* @__PURE__ */ z(g, {
|
|
166
|
+
f
|
|
167
|
+
]), h = i ? e : "div";
|
|
168
|
+
return /* @__PURE__ */ R(Rn.Provider, {
|
|
169
|
+
value: m,
|
|
170
|
+
children: /* @__PURE__ */ R(h, {
|
|
166
171
|
ref: l,
|
|
167
172
|
"data-testid": "chat-card-three-column-layout",
|
|
168
173
|
"data-slot": "chat-card-three-column-layout",
|
|
169
174
|
"data-details-placement": r,
|
|
170
175
|
"data-size": u,
|
|
171
|
-
"data-
|
|
172
|
-
|
|
173
|
-
className: L(An(), n),
|
|
176
|
+
"data-details-floating": d,
|
|
177
|
+
className: L(Mn(), n),
|
|
174
178
|
...a,
|
|
175
179
|
children: t
|
|
176
180
|
})
|
|
177
181
|
});
|
|
178
182
|
});
|
|
179
|
-
|
|
180
|
-
var
|
|
181
|
-
let {
|
|
182
|
-
return /* @__PURE__ */
|
|
183
|
-
ref:
|
|
183
|
+
Hn.displayName = "ChatCardThreeColumnLayout";
|
|
184
|
+
var Un = a(function({ children: t, className: n, hideOnMobile: r = !1, asChild: i = !1, ...a }, o) {
|
|
185
|
+
let { size: s } = zn("ChatCardThreeColumnLayoutList");
|
|
186
|
+
return /* @__PURE__ */ R(i ? e : "aside", {
|
|
187
|
+
ref: o,
|
|
184
188
|
"data-testid": "chat-card-three-column-layout-list",
|
|
185
189
|
"data-slot": "chat-card-three-column-layout-list",
|
|
186
|
-
"data-
|
|
187
|
-
className: L(
|
|
188
|
-
...
|
|
189
|
-
children:
|
|
190
|
+
"data-size": s,
|
|
191
|
+
className: L(Nn({ hideOnMobile: r }), n),
|
|
192
|
+
...a,
|
|
193
|
+
children: t
|
|
190
194
|
});
|
|
191
195
|
});
|
|
192
|
-
|
|
193
|
-
var
|
|
194
|
-
return
|
|
196
|
+
Un.displayName = "ChatCardThreeColumnLayoutList";
|
|
197
|
+
var Wn = a(function({ children: t, className: n, asChild: r = !1, ...i }, a) {
|
|
198
|
+
return zn("ChatCardThreeColumnLayoutMain"), /* @__PURE__ */ R(r ? e : "main", {
|
|
195
199
|
ref: a,
|
|
196
200
|
"data-testid": "chat-card-three-column-layout-main",
|
|
197
201
|
"data-slot": "chat-card-three-column-layout-main",
|
|
198
|
-
className: L(
|
|
202
|
+
className: L(Pn(), n),
|
|
199
203
|
...i,
|
|
200
204
|
children: t
|
|
201
205
|
});
|
|
202
206
|
});
|
|
203
|
-
|
|
204
|
-
var
|
|
205
|
-
let { isDetailsFloating: o, isDetailsSheet: s } =
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
+
Wn.displayName = "ChatCardThreeColumnLayoutMain";
|
|
208
|
+
var Gn = a(function({ children: t, className: n, asChild: r = !1, ...i }, a) {
|
|
209
|
+
let { isDetailsFloating: o, isDetailsSheet: s } = zn("ChatCardThreeColumnLayoutDetails");
|
|
210
|
+
return /* @__PURE__ */ R(r ? e : "aside", {
|
|
207
211
|
ref: a,
|
|
208
212
|
"data-testid": "chat-card-three-column-layout-details",
|
|
209
213
|
"data-slot": "chat-card-three-column-layout-details",
|
|
210
214
|
"data-floating": o,
|
|
211
215
|
"data-sheet": s,
|
|
212
|
-
className: L(
|
|
216
|
+
className: L(Fn(), n),
|
|
213
217
|
...i,
|
|
214
|
-
children:
|
|
218
|
+
children: Bn(t, o)
|
|
215
219
|
});
|
|
216
220
|
});
|
|
217
|
-
|
|
218
|
-
var
|
|
219
|
-
let {
|
|
220
|
-
return /* @__PURE__ */
|
|
221
|
+
Gn.displayName = "ChatCardThreeColumnLayoutDetails";
|
|
222
|
+
var Kn = a(function({ children: t, className: n, asChild: r = !1, ...i }, a) {
|
|
223
|
+
let { size: o } = zn("ChatCardThreeColumnLayoutPanel");
|
|
224
|
+
return /* @__PURE__ */ R(r ? e : "section", {
|
|
221
225
|
ref: a,
|
|
222
226
|
"data-testid": "chat-card-three-column-layout-panel",
|
|
223
227
|
"data-slot": "chat-card-three-column-layout-panel",
|
|
224
|
-
"data-
|
|
225
|
-
className: L(
|
|
228
|
+
"data-size": o,
|
|
229
|
+
className: L(In(), n),
|
|
226
230
|
...i,
|
|
227
231
|
children: t
|
|
228
232
|
});
|
|
229
233
|
});
|
|
230
|
-
|
|
234
|
+
Kn.displayName = "ChatCardThreeColumnLayoutPanel";
|
|
231
235
|
//#endregion
|
|
232
236
|
//#region src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.ts
|
|
233
|
-
var
|
|
237
|
+
var qn = B(["@container/chat-card-two-column-layout"]), Jn = B([
|
|
234
238
|
"grid h-full gap-16",
|
|
235
239
|
"grid-cols-[minmax(0,1fr)] grid-rows-[auto_1fr]",
|
|
236
240
|
"@[744px]/chat-card-two-column-layout:grid-cols-[336px_minmax(0,1fr)] @[744px]/chat-card-two-column-layout:grid-rows-[minmax(0,1fr)]"
|
|
237
|
-
]),
|
|
238
|
-
function
|
|
239
|
-
if (!l(
|
|
241
|
+
]), Yn = B(["min-w-0 min-h-0", "@[744px]/chat-card-two-column-layout:h-full @[744px]/chat-card-two-column-layout:overflow-hidden"]), Xn = B(["relative min-w-0 min-h-0 h-full"]), Zn = B(["data-[state=open]:w-full data-[state=open]:mx-0", "data-[state=open]:min-w-[min(1130px,calc(var(--chat-window-width,100%)-var(--spacing-message)*2))]"]), Qn = i(!1);
|
|
242
|
+
function $n(e) {
|
|
243
|
+
if (!l(Qn)) throw Error(`[web-chat-ui] "${e}" must be used within a ChatCardTwoColumnLayout. Its columns come from the layout’s container query, so render it as a child of the ChatCardTwoColumnLayout element, not as a sibling of it.`);
|
|
240
244
|
}
|
|
241
|
-
var
|
|
245
|
+
var er = a(function({ children: t, className: n, gridClassName: r, asChild: i = !1, ...a }, o) {
|
|
242
246
|
let s = i ? e : "div";
|
|
243
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ R(Qn.Provider, {
|
|
244
248
|
value: !0,
|
|
245
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ R(s, {
|
|
246
250
|
ref: o,
|
|
247
251
|
"data-testid": "chat-card-two-column-layout",
|
|
248
252
|
"data-slot": "chat-card-two-column-layout",
|
|
249
|
-
className: L(
|
|
253
|
+
className: L(qn(), n),
|
|
250
254
|
...a,
|
|
251
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ R("div", {
|
|
252
256
|
"data-testid": "chat-card-two-column-layout-grid",
|
|
253
257
|
"data-slot": "chat-card-two-column-layout-grid",
|
|
254
|
-
className: L(
|
|
258
|
+
className: L(Jn(), r),
|
|
255
259
|
children: t
|
|
256
260
|
})
|
|
257
261
|
})
|
|
258
262
|
});
|
|
259
263
|
});
|
|
260
|
-
|
|
261
|
-
var
|
|
262
|
-
return
|
|
264
|
+
er.displayName = "ChatCardTwoColumnLayout";
|
|
265
|
+
var tr = a(function({ children: t, className: n, asChild: r = !1, ...i }, a) {
|
|
266
|
+
return $n("ChatCardTwoColumnLayoutAside"), /* @__PURE__ */ R(r ? e : "aside", {
|
|
263
267
|
ref: a,
|
|
264
268
|
"data-testid": "chat-card-two-column-layout-aside",
|
|
265
269
|
"data-slot": "chat-card-two-column-layout-aside",
|
|
266
|
-
className: L(
|
|
270
|
+
className: L(Yn(), n),
|
|
267
271
|
...i,
|
|
268
272
|
children: t
|
|
269
273
|
});
|
|
270
274
|
});
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
return
|
|
275
|
+
tr.displayName = "ChatCardTwoColumnLayoutAside";
|
|
276
|
+
var nr = a(function({ children: t, className: n, asChild: r = !1, ...i }, a) {
|
|
277
|
+
return $n("ChatCardTwoColumnLayoutMain"), /* @__PURE__ */ R(r ? e : "main", {
|
|
274
278
|
ref: a,
|
|
275
279
|
"data-testid": "chat-card-two-column-layout-main",
|
|
276
280
|
"data-slot": "chat-card-two-column-layout-main",
|
|
277
|
-
className: L(
|
|
281
|
+
className: L(Xn(), n),
|
|
278
282
|
...i,
|
|
279
283
|
children: t
|
|
280
284
|
});
|
|
281
285
|
});
|
|
282
|
-
|
|
286
|
+
nr.displayName = "ChatCardTwoColumnLayoutMain";
|
|
283
287
|
//#endregion
|
|
284
288
|
//#region src/components/chat-card/context.tsx
|
|
285
|
-
var
|
|
286
|
-
function
|
|
287
|
-
let e = l(
|
|
289
|
+
var rr = i(null);
|
|
290
|
+
function q() {
|
|
291
|
+
let e = l(rr);
|
|
288
292
|
if (!e) throw Error("[web-chat-ui] useChatCardContext() called outside ChatCard. Wrap this component in <ChatCard>, or the provider and the caller resolved two copies of the package.");
|
|
289
293
|
return e;
|
|
290
294
|
}
|
|
291
|
-
function
|
|
292
|
-
return /* @__PURE__ */
|
|
295
|
+
function ir({ value: e, children: t }) {
|
|
296
|
+
return /* @__PURE__ */ R(rr.Provider, {
|
|
293
297
|
value: e,
|
|
294
298
|
children: t
|
|
295
299
|
});
|
|
296
300
|
}
|
|
297
301
|
//#endregion
|
|
298
302
|
//#region src/components/chat-card/components/chat-card-header.tsx
|
|
299
|
-
function
|
|
300
|
-
let { isCollapsible: i, level: a } =
|
|
303
|
+
function ar({ className: e, children: t, hoverAreaClassName: n, ...r }) {
|
|
304
|
+
let { isCollapsible: i, level: a } = q(), o = /* @__PURE__ */ R("div", {
|
|
301
305
|
"data-slot": "chat-card-header-hover-area",
|
|
302
306
|
className: L("w-full", "flex flex-row items-start", "gap-card-header-gap", a === 1 && "px-card-header-hover-area rounded-card-header", a === 1 && i && "hover:bg-layout-accent-low-background-hover-base", a === 1 && "group-hover/chat-card:bg-layout-accent-low-background-hover-base", !i && "cursor-default", n),
|
|
303
307
|
children: t
|
|
304
308
|
});
|
|
305
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ R("header", {
|
|
306
310
|
"data-slot": "chat-card-header",
|
|
307
311
|
"data-level": a,
|
|
308
312
|
"data-collapsible": i,
|
|
309
313
|
className: L("flex items-start", a === 1 ? "p-card-header-lvl-1" : "px-card-header-lvl-2", e),
|
|
310
314
|
...r,
|
|
311
|
-
children: i ? /* @__PURE__ */
|
|
315
|
+
children: i ? /* @__PURE__ */ R(x, {
|
|
312
316
|
className: "w-full",
|
|
313
317
|
asChild: !0,
|
|
314
318
|
children: o
|
|
315
319
|
}) : o
|
|
316
320
|
});
|
|
317
321
|
}
|
|
318
|
-
function
|
|
319
|
-
let { level: r } =
|
|
320
|
-
return /* @__PURE__ */
|
|
322
|
+
function or({ className: e, children: t, ...n }) {
|
|
323
|
+
let { level: r } = q();
|
|
324
|
+
return /* @__PURE__ */ R("div", {
|
|
321
325
|
"data-slot": "chat-card-icon",
|
|
322
326
|
"data-testid": "chat-card-icon",
|
|
323
327
|
"data-level": r,
|
|
@@ -326,9 +330,9 @@ function ir({ className: e, children: t, ...n }) {
|
|
|
326
330
|
children: t
|
|
327
331
|
});
|
|
328
332
|
}
|
|
329
|
-
function
|
|
330
|
-
let { level: r } =
|
|
331
|
-
return /* @__PURE__ */
|
|
333
|
+
function sr({ className: e, children: t, ...n }) {
|
|
334
|
+
let { level: r } = q();
|
|
335
|
+
return /* @__PURE__ */ R("div", {
|
|
332
336
|
"data-slot": "chat-card-header-content",
|
|
333
337
|
"data-testid": "chat-card-header-content",
|
|
334
338
|
"data-level": r,
|
|
@@ -337,8 +341,8 @@ function ar({ className: e, children: t, ...n }) {
|
|
|
337
341
|
children: t
|
|
338
342
|
});
|
|
339
343
|
}
|
|
340
|
-
function
|
|
341
|
-
return /* @__PURE__ */
|
|
344
|
+
function cr({ className: e, children: t, ...n }) {
|
|
345
|
+
return /* @__PURE__ */ R(I, {
|
|
342
346
|
"data-testid": "chat-card-title",
|
|
343
347
|
variant: "body-medium",
|
|
344
348
|
className: L(e),
|
|
@@ -346,8 +350,8 @@ function or({ className: e, children: t, ...n }) {
|
|
|
346
350
|
children: t
|
|
347
351
|
});
|
|
348
352
|
}
|
|
349
|
-
function
|
|
350
|
-
return /* @__PURE__ */
|
|
353
|
+
function lr({ className: e, children: t, ...n }) {
|
|
354
|
+
return /* @__PURE__ */ R(I, {
|
|
351
355
|
"data-testid": "chat-card-sub-title",
|
|
352
356
|
variant: "body-small-high",
|
|
353
357
|
className: L("text-text-secondary", e),
|
|
@@ -355,9 +359,9 @@ function sr({ className: e, children: t, ...n }) {
|
|
|
355
359
|
children: t
|
|
356
360
|
});
|
|
357
361
|
}
|
|
358
|
-
function
|
|
359
|
-
let { level: r } =
|
|
360
|
-
return /* @__PURE__ */
|
|
362
|
+
function ur({ className: e, children: t, ...n }) {
|
|
363
|
+
let { level: r } = q();
|
|
364
|
+
return /* @__PURE__ */ R("div", {
|
|
361
365
|
role: "group",
|
|
362
366
|
"data-slot": "chat-card-actions",
|
|
363
367
|
"data-testid": "chat-card-actions",
|
|
@@ -367,11 +371,11 @@ function cr({ className: e, children: t, ...n }) {
|
|
|
367
371
|
children: t
|
|
368
372
|
});
|
|
369
373
|
}
|
|
370
|
-
function
|
|
374
|
+
function dr({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip: r, onClick: i, ...a }) {
|
|
371
375
|
function o(e) {
|
|
372
376
|
n && e.stopPropagation(), i?.(e);
|
|
373
377
|
}
|
|
374
|
-
let s = /* @__PURE__ */
|
|
378
|
+
let s = /* @__PURE__ */ R(D, {
|
|
375
379
|
"data-slot": "chat-card-action-button",
|
|
376
380
|
variant: "tertiary",
|
|
377
381
|
size: "sm",
|
|
@@ -380,26 +384,26 @@ function lr({ className: e, children: t, shouldPreventCollapse: n = !0, tooltip:
|
|
|
380
384
|
...a,
|
|
381
385
|
children: t
|
|
382
386
|
});
|
|
383
|
-
return r ? /* @__PURE__ */
|
|
387
|
+
return r ? /* @__PURE__ */ R(_e, {
|
|
384
388
|
tooltip: r,
|
|
385
389
|
children: s
|
|
386
390
|
}) : s;
|
|
387
391
|
}
|
|
388
|
-
function
|
|
389
|
-
let { isCollapsible: n } =
|
|
390
|
-
if (n) return /* @__PURE__ */
|
|
392
|
+
function fr({ className: e, ...t }) {
|
|
393
|
+
let { isCollapsible: n } = q();
|
|
394
|
+
if (n) return /* @__PURE__ */ R(dr, {
|
|
391
395
|
"data-slot": "chat-card-collapsible-button",
|
|
392
396
|
shouldPreventCollapse: !1,
|
|
393
397
|
isSemantic: !1,
|
|
394
|
-
className:
|
|
398
|
+
className: e,
|
|
395
399
|
...t,
|
|
396
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ R(y, {})
|
|
397
401
|
});
|
|
398
402
|
}
|
|
399
403
|
//#endregion
|
|
400
404
|
//#region src/components/chat-card/components/chat-card-body.tsx
|
|
401
|
-
function
|
|
402
|
-
return /* @__PURE__ */
|
|
405
|
+
function pr({ className: e, children: t, ...n }) {
|
|
406
|
+
return /* @__PURE__ */ R("figure", {
|
|
403
407
|
"data-slot": "chat-card-media",
|
|
404
408
|
"data-testid": "chat-card-media",
|
|
405
409
|
className: L("min-h-0 shrink-0 h-[222px]", e),
|
|
@@ -407,20 +411,20 @@ function dr({ className: e, children: t, ...n }) {
|
|
|
407
411
|
children: t
|
|
408
412
|
});
|
|
409
413
|
}
|
|
410
|
-
function
|
|
414
|
+
function mr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
411
415
|
let a = r ? e : "div";
|
|
412
|
-
return /* @__PURE__ */
|
|
416
|
+
return /* @__PURE__ */ R(b, {
|
|
413
417
|
"data-slot": "chat-card-body",
|
|
414
418
|
"data-testid": "chat-card-body",
|
|
415
419
|
className: L("flex flex-1 flex-col", "min-h-0", "md:group-data-[collapsible=true]/chat-card:max-h-[90vh]", "overflow-hidden", t),
|
|
416
420
|
asChild: !0,
|
|
417
421
|
...i,
|
|
418
|
-
children: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ R(a, { children: n })
|
|
419
423
|
});
|
|
420
424
|
}
|
|
421
|
-
function
|
|
422
|
-
let { level: s } =
|
|
423
|
-
return /* @__PURE__ */
|
|
425
|
+
function hr({ className: t, children: n, asChild: r = !1, hasPadding: i = !0, hasHeaderPadding: a = !0, ...o }) {
|
|
426
|
+
let { level: s } = q();
|
|
427
|
+
return /* @__PURE__ */ R(r ? e : "div", {
|
|
424
428
|
"data-slot": "chat-card-content",
|
|
425
429
|
"data-testid": "chat-card-content",
|
|
426
430
|
"data-padding": i,
|
|
@@ -431,9 +435,9 @@ function pr({ className: t, children: n, asChild: r = !1, hasPadding: i = !0, ha
|
|
|
431
435
|
children: n
|
|
432
436
|
});
|
|
433
437
|
}
|
|
434
|
-
function
|
|
435
|
-
let { level: r } =
|
|
436
|
-
return /* @__PURE__ */
|
|
438
|
+
function gr({ className: e, children: t, ...n }) {
|
|
439
|
+
let { level: r } = q();
|
|
440
|
+
return /* @__PURE__ */ R("div", {
|
|
437
441
|
"data-slot": "chat-card-preview",
|
|
438
442
|
"data-testid": "chat-card-preview",
|
|
439
443
|
"data-level": r,
|
|
@@ -444,9 +448,9 @@ function mr({ className: e, children: t, ...n }) {
|
|
|
444
448
|
}
|
|
445
449
|
//#endregion
|
|
446
450
|
//#region src/components/chat-card/components/chat-card-footer.tsx
|
|
447
|
-
function
|
|
448
|
-
let { level: r } =
|
|
449
|
-
return /* @__PURE__ */
|
|
451
|
+
function _r({ className: e, children: t, ...n }) {
|
|
452
|
+
let { level: r } = q();
|
|
453
|
+
return /* @__PURE__ */ R("footer", {
|
|
450
454
|
"data-slot": "chat-card-footer",
|
|
451
455
|
"data-level": r,
|
|
452
456
|
className: L("mt-auto", "flex flex-row items-center justify-end", "gap-card-footer-gap", "w-full", "data-[level=1]:p-card-footer-lvl-1", "data-[level=2]:p-card-footer-lvl-2", e),
|
|
@@ -454,24 +458,24 @@ function hr({ className: e, children: t, ...n }) {
|
|
|
454
458
|
children: t
|
|
455
459
|
});
|
|
456
460
|
}
|
|
457
|
-
function
|
|
458
|
-
return /* @__PURE__ */
|
|
461
|
+
function vr({ className: e, children: t }) {
|
|
462
|
+
return /* @__PURE__ */ R("div", {
|
|
459
463
|
"data-slot": "chat-card-footer-notes",
|
|
460
464
|
"data-testid": "chat-card-footer-notes",
|
|
461
465
|
className: L("mr-auto shrink-0", "flex flex-col items-start justify-center", "gap-card-footer-gap-left-notes", e),
|
|
462
466
|
children: t
|
|
463
467
|
});
|
|
464
468
|
}
|
|
465
|
-
function
|
|
466
|
-
return /* @__PURE__ */
|
|
469
|
+
function yr({ className: e, children: t }) {
|
|
470
|
+
return /* @__PURE__ */ R("div", {
|
|
467
471
|
"data-slot": "chat-card-footer-price",
|
|
468
472
|
"data-testid": "chat-card-footer-price",
|
|
469
473
|
className: L("flex flex-col items-end justify-center", "gap-card-footer-gap-prices", "shrink-0", e),
|
|
470
474
|
children: t
|
|
471
475
|
});
|
|
472
476
|
}
|
|
473
|
-
function
|
|
474
|
-
return /* @__PURE__ */
|
|
477
|
+
function br({ className: e, children: t, ...n }) {
|
|
478
|
+
return /* @__PURE__ */ R("div", {
|
|
475
479
|
role: "group",
|
|
476
480
|
"data-slot": "chat-card-footer-actions",
|
|
477
481
|
"data-testid": "chat-card-footer-actions",
|
|
@@ -482,8 +486,8 @@ function vr({ className: e, children: t, ...n }) {
|
|
|
482
486
|
}
|
|
483
487
|
//#endregion
|
|
484
488
|
//#region src/components/chat-card/components/chat-card-form.tsx
|
|
485
|
-
var
|
|
486
|
-
return /* @__PURE__ */
|
|
489
|
+
var xr = a(function({ className: t, children: n, asChild: r, ...i }, a) {
|
|
490
|
+
return /* @__PURE__ */ R(r ? e : "form", {
|
|
487
491
|
ref: a,
|
|
488
492
|
"data-slot": "chat-card-form",
|
|
489
493
|
"data-testid": "chat-card-form",
|
|
@@ -492,17 +496,17 @@ var yr = a(function({ className: t, children: n, asChild: r, ...i }, a) {
|
|
|
492
496
|
children: n
|
|
493
497
|
});
|
|
494
498
|
});
|
|
495
|
-
|
|
496
|
-
function
|
|
497
|
-
return /* @__PURE__ */
|
|
499
|
+
xr.displayName = "ChatCardForm";
|
|
500
|
+
function Sr({ className: e, children: t }) {
|
|
501
|
+
return /* @__PURE__ */ R("ul", {
|
|
498
502
|
"data-slot": "chat-card-attributes",
|
|
499
503
|
"data-testid": "chat-card-attributes",
|
|
500
504
|
className: L("flex flex-col justify-start items-start gap-8", "mb-24", e),
|
|
501
505
|
children: t
|
|
502
506
|
});
|
|
503
507
|
}
|
|
504
|
-
function
|
|
505
|
-
return /* @__PURE__ */
|
|
508
|
+
function Cr({ className: e, children: t, ...n }) {
|
|
509
|
+
return /* @__PURE__ */ R("li", {
|
|
506
510
|
"data-slot": "chat-card-attribute",
|
|
507
511
|
"data-testid": "chat-card-attribute-item",
|
|
508
512
|
className: L("grid grid-cols-[66px_1fr] gap-8", "w-full", "min-h-24", e),
|
|
@@ -510,8 +514,8 @@ function xr({ className: e, children: t, ...n }) {
|
|
|
510
514
|
children: t
|
|
511
515
|
});
|
|
512
516
|
}
|
|
513
|
-
function
|
|
514
|
-
return /* @__PURE__ */
|
|
517
|
+
function wr({ className: e, children: t, hasPadding: n = !1, ...r }) {
|
|
518
|
+
return /* @__PURE__ */ R(_, {
|
|
515
519
|
variant: "outlined",
|
|
516
520
|
size: "md",
|
|
517
521
|
color: "info",
|
|
@@ -523,8 +527,8 @@ function Sr({ className: e, children: t, hasPadding: n = !1, ...r }) {
|
|
|
523
527
|
children: t
|
|
524
528
|
});
|
|
525
529
|
}
|
|
526
|
-
function
|
|
527
|
-
return /* @__PURE__ */
|
|
530
|
+
function Tr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
531
|
+
return /* @__PURE__ */ R(r ? e : I, {
|
|
528
532
|
"data-testid": "chat-card-attribute-value",
|
|
529
533
|
variant: "body-sm",
|
|
530
534
|
className: L("flex-1 text-text-secondary", t),
|
|
@@ -534,7 +538,7 @@ function Cr({ className: t, children: n, asChild: r = !1, ...i }) {
|
|
|
534
538
|
}
|
|
535
539
|
//#endregion
|
|
536
540
|
//#region src/components/chat-card/chat-card.tsx
|
|
537
|
-
var
|
|
541
|
+
var Er = a(function({ className: e, variant: t = "default", level: n = 1, children: r, fullWidth: i = !1, defaultOpen: a = !0, open: o, isRounded: s = !0, isCollapsible: l = !0, isSelected: u = !1, onOpenChange: d, onClick: f, ...m }, g) {
|
|
538
542
|
let _ = o !== void 0, [y, b] = h(a), x = _ ? o : y, S = c((e) => {
|
|
539
543
|
_ || b(e), d?.(e);
|
|
540
544
|
}, [_, d]), C = p(() => ({
|
|
@@ -549,14 +553,14 @@ var wr = a(function({ className: e, variant: t = "default", level: n = 1, childr
|
|
|
549
553
|
function w(e) {
|
|
550
554
|
f?.(e), !e.defaultPrevented && l && !x && S(!0);
|
|
551
555
|
}
|
|
552
|
-
return /* @__PURE__ */
|
|
556
|
+
return /* @__PURE__ */ R(ir, {
|
|
553
557
|
value: C,
|
|
554
|
-
children: /* @__PURE__ */
|
|
558
|
+
children: /* @__PURE__ */ R(v, {
|
|
555
559
|
isDisabled: !l,
|
|
556
560
|
open: x,
|
|
557
561
|
onOpenChange: S,
|
|
558
562
|
asChild: !0,
|
|
559
|
-
children: /* @__PURE__ */
|
|
563
|
+
children: /* @__PURE__ */ R("section", {
|
|
560
564
|
ref: g,
|
|
561
565
|
role: "region",
|
|
562
566
|
"data-slot": "chat-card",
|
|
@@ -576,10 +580,10 @@ var wr = a(function({ className: e, variant: t = "default", level: n = 1, childr
|
|
|
576
580
|
})
|
|
577
581
|
});
|
|
578
582
|
});
|
|
579
|
-
|
|
583
|
+
Er.displayName = "ChatCard";
|
|
580
584
|
//#endregion
|
|
581
585
|
//#region src/components/chat-card/hooks.ts
|
|
582
|
-
function
|
|
586
|
+
function Dr({ isEditable: e, defaultEditing: t = !1 }) {
|
|
583
587
|
let [n, r] = h(t);
|
|
584
588
|
function i() {
|
|
585
589
|
return e ? !0 : (console.warn("Chat card is not editable"), !1);
|
|
@@ -603,26 +607,26 @@ function Tr({ isEditable: e, defaultEditing: t = !1 }) {
|
|
|
603
607
|
}
|
|
604
608
|
//#endregion
|
|
605
609
|
//#region src/components/chat-card/contexts.tsx
|
|
606
|
-
var
|
|
607
|
-
function
|
|
608
|
-
let e = l(
|
|
610
|
+
var Or = i(null);
|
|
611
|
+
function kr() {
|
|
612
|
+
let e = l(Or);
|
|
609
613
|
if (!e) throw Error("\"useEditableChatCardContext\" must be used within a EditableChatCardContextProvider");
|
|
610
614
|
return e;
|
|
611
615
|
}
|
|
612
|
-
function
|
|
613
|
-
let r =
|
|
616
|
+
function Ar({ children: e, defaultEditing: t = !1, isEditable: n = !1 }) {
|
|
617
|
+
let r = Dr({
|
|
614
618
|
isEditable: n,
|
|
615
619
|
defaultEditing: t
|
|
616
620
|
});
|
|
617
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ R(Or.Provider, {
|
|
618
622
|
value: r,
|
|
619
623
|
children: e
|
|
620
624
|
});
|
|
621
625
|
}
|
|
622
626
|
//#endregion
|
|
623
627
|
//#region src/components/chat-card-container/chat-card-container.tsx
|
|
624
|
-
function
|
|
625
|
-
return /* @__PURE__ */
|
|
628
|
+
function jr({ children: e, variant: t = "fixed", inline: n = !1, className: r, ...i }) {
|
|
629
|
+
return /* @__PURE__ */ R("div", {
|
|
626
630
|
"data-slot": "chat-card-container",
|
|
627
631
|
"data-testid": "chat-card-container",
|
|
628
632
|
"data-variant": t,
|
|
@@ -634,21 +638,21 @@ function kr({ children: e, variant: t = "fixed", inline: n = !1, className: r, .
|
|
|
634
638
|
}
|
|
635
639
|
//#endregion
|
|
636
640
|
//#region src/components/chat-container/chat-container.tsx
|
|
637
|
-
var
|
|
641
|
+
var Mr = "var(--spacing-chat-area)", Nr = {
|
|
638
642
|
prompt: "--type-window-height",
|
|
639
643
|
welcome: "--welcome-screen-box-height"
|
|
640
644
|
};
|
|
641
|
-
function
|
|
645
|
+
function Pr(e) {
|
|
642
646
|
return e === "unset" ? "unset" : `${e}px`;
|
|
643
647
|
}
|
|
644
|
-
var
|
|
645
|
-
function
|
|
646
|
-
let e = l(
|
|
648
|
+
var Fr = i(null);
|
|
649
|
+
function Ir() {
|
|
650
|
+
let e = l(Fr);
|
|
647
651
|
if (!e) throw Error("[web-chat-ui] ChatContainer slot rendered outside a ChatContainer. ChatContainerPrompt and ChatContainerWelcome report their measured height up to the container, so one must be mounted above them. If it is mounted, check the slot is not rendered through a portal that escapes the provider.");
|
|
648
652
|
return e;
|
|
649
653
|
}
|
|
650
|
-
function
|
|
651
|
-
let s = t ? e : "section", { ref: l, width: u, height: d } =
|
|
654
|
+
function Lr({ asChild: t = !1, children: n, className: r, contentWidth: i = Mr, style: a, ...o }) {
|
|
655
|
+
let s = t ? e : "section", { ref: l, width: u, height: d } = xe(), [f, m] = h({
|
|
652
656
|
prompt: "unset",
|
|
653
657
|
welcome: "unset"
|
|
654
658
|
}), g = c((e, t) => {
|
|
@@ -660,8 +664,8 @@ function Fr({ asChild: t = !1, children: n, className: r, contentWidth: i = Ar,
|
|
|
660
664
|
"--chat-window-width": u === "unset" ? "100%" : `${u}px`,
|
|
661
665
|
"--chat-window-height": d === "unset" ? "100%" : `${d}px`,
|
|
662
666
|
"--message-list-content-width": `min(${i}, var(--chat-window-width))`,
|
|
663
|
-
[
|
|
664
|
-
[
|
|
667
|
+
[Nr.prompt]: Pr(f.prompt),
|
|
668
|
+
[Nr.welcome]: Pr(f.welcome),
|
|
665
669
|
...a
|
|
666
670
|
}), [
|
|
667
671
|
u,
|
|
@@ -670,9 +674,9 @@ function Fr({ asChild: t = !1, children: n, className: r, contentWidth: i = Ar,
|
|
|
670
674
|
f,
|
|
671
675
|
a
|
|
672
676
|
]);
|
|
673
|
-
return /* @__PURE__ */
|
|
677
|
+
return /* @__PURE__ */ R(Fr.Provider, {
|
|
674
678
|
value: _,
|
|
675
|
-
children: /* @__PURE__ */
|
|
679
|
+
children: /* @__PURE__ */ R(s, {
|
|
676
680
|
ref: l,
|
|
677
681
|
"data-slot": "chat-container",
|
|
678
682
|
"data-testid": "chat-container",
|
|
@@ -683,17 +687,17 @@ function Fr({ asChild: t = !1, children: n, className: r, contentWidth: i = Ar,
|
|
|
683
687
|
})
|
|
684
688
|
});
|
|
685
689
|
}
|
|
686
|
-
function
|
|
687
|
-
let { setSlotHeight: t } =
|
|
690
|
+
function Rr(e) {
|
|
691
|
+
let { setSlotHeight: t } = Ir(), { ref: n, height: r } = xe();
|
|
688
692
|
return f(() => (t(e, r), () => t(e, "unset")), [
|
|
689
693
|
e,
|
|
690
694
|
r,
|
|
691
695
|
t
|
|
692
696
|
]), n;
|
|
693
697
|
}
|
|
694
|
-
function
|
|
695
|
-
let a =
|
|
696
|
-
return /* @__PURE__ */
|
|
698
|
+
function zr({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
699
|
+
let a = Rr("prompt");
|
|
700
|
+
return /* @__PURE__ */ R(t ? e : "div", {
|
|
697
701
|
ref: a,
|
|
698
702
|
"data-slot": "chat-container-prompt",
|
|
699
703
|
"data-testid": "chat-container-prompt",
|
|
@@ -702,9 +706,9 @@ function Lr({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
|
702
706
|
children: n
|
|
703
707
|
});
|
|
704
708
|
}
|
|
705
|
-
function
|
|
706
|
-
let a =
|
|
707
|
-
return /* @__PURE__ */
|
|
709
|
+
function Br({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
710
|
+
let a = Rr("welcome");
|
|
711
|
+
return /* @__PURE__ */ R(t ? e : "div", {
|
|
708
712
|
ref: a,
|
|
709
713
|
"data-slot": "chat-container-welcome",
|
|
710
714
|
"data-testid": "chat-container-welcome",
|
|
@@ -715,8 +719,8 @@ function Rr({ asChild: t = !1, children: n, className: r, ...i }) {
|
|
|
715
719
|
}
|
|
716
720
|
//#endregion
|
|
717
721
|
//#region src/components/chat-input/plugins/auto-focus-plugin.tsx
|
|
718
|
-
function
|
|
719
|
-
let [r] =
|
|
722
|
+
function Vr({ defaultSelection: e = "rootEnd", autoFocus: t, isDisabled: n }) {
|
|
723
|
+
let [r] = ze();
|
|
720
724
|
return u(() => {
|
|
721
725
|
t && !n && r.focus(() => {
|
|
722
726
|
let e = document.activeElement, t = r.getRootElement();
|
|
@@ -731,36 +735,36 @@ function zr({ defaultSelection: e = "rootEnd", autoFocus: t, isDisabled: n }) {
|
|
|
731
735
|
}
|
|
732
736
|
//#endregion
|
|
733
737
|
//#region src/components/chat-input/transformers.ts
|
|
734
|
-
var
|
|
738
|
+
var Hr = He, Ur = He;
|
|
735
739
|
//#endregion
|
|
736
740
|
//#region src/components/chat-input/plugins/hooks.ts
|
|
737
|
-
function
|
|
738
|
-
let [e] =
|
|
741
|
+
function J() {
|
|
742
|
+
let [e] = ze();
|
|
739
743
|
return e;
|
|
740
744
|
}
|
|
741
745
|
//#endregion
|
|
742
746
|
//#region src/components/chat-input/plugins/utils.ts
|
|
743
|
-
function Ur() {
|
|
744
|
-
return U().getTextContent();
|
|
745
|
-
}
|
|
746
747
|
function Wr() {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
748
|
+
return H().getTextContent();
|
|
749
|
+
}
|
|
750
|
+
function Gr() {
|
|
751
|
+
let e = H().getLastDescendant();
|
|
752
|
+
if (e && G(e)) {
|
|
753
|
+
let t = Ge(), n = e.getTextContentSize();
|
|
754
|
+
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"), Qe(t);
|
|
751
755
|
} else {
|
|
752
|
-
|
|
753
|
-
let e =
|
|
754
|
-
if (
|
|
755
|
-
let t = e.focus.getNode(), n =
|
|
756
|
-
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type),
|
|
756
|
+
Ze();
|
|
757
|
+
let e = U();
|
|
758
|
+
if (W(e)) {
|
|
759
|
+
let t = e.focus.getNode(), n = G(t) ? t.getTextContentSize() : 0;
|
|
760
|
+
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type), Qe(e);
|
|
757
761
|
}
|
|
758
762
|
}
|
|
759
763
|
}
|
|
760
764
|
//#endregion
|
|
761
765
|
//#region src/components/chat-input/plugins/controlled-value-plugin.tsx
|
|
762
|
-
function
|
|
763
|
-
let n =
|
|
766
|
+
function Kr({ value: e, emittedValuesRef: t }) {
|
|
767
|
+
let n = J(), r = m();
|
|
764
768
|
return u(() => {
|
|
765
769
|
if (!n || e === r.current) return;
|
|
766
770
|
if (r.current = e, t && e !== void 0) {
|
|
@@ -769,9 +773,9 @@ function Gr({ value: e, emittedValuesRef: t }) {
|
|
|
769
773
|
}
|
|
770
774
|
let i = "";
|
|
771
775
|
n.getEditorState().read(() => {
|
|
772
|
-
i =
|
|
776
|
+
i = Ve(Hr);
|
|
773
777
|
}), e !== void 0 && e !== i && n.update(() => {
|
|
774
|
-
|
|
778
|
+
V(lt), Be(e ?? "", Ur), Gr();
|
|
775
779
|
}, { discrete: !0 });
|
|
776
780
|
}, [
|
|
777
781
|
n,
|
|
@@ -781,8 +785,8 @@ function Gr({ value: e, emittedValuesRef: t }) {
|
|
|
781
785
|
}
|
|
782
786
|
//#endregion
|
|
783
787
|
//#region src/components/chat-input/plugins/disabled-plugin.tsx
|
|
784
|
-
function
|
|
785
|
-
let n =
|
|
788
|
+
function qr({ isDisabled: e, isReadOnly: t }) {
|
|
789
|
+
let n = J();
|
|
786
790
|
return u(() => {
|
|
787
791
|
n.setEditable(!e && !t);
|
|
788
792
|
}, [
|
|
@@ -793,8 +797,8 @@ function Kr({ isDisabled: e, isReadOnly: t }) {
|
|
|
793
797
|
}
|
|
794
798
|
//#endregion
|
|
795
799
|
//#region src/components/chat-input/plugins/focus-plugin.tsx
|
|
796
|
-
function
|
|
797
|
-
let t =
|
|
800
|
+
function Jr({ onFocusChange: e }) {
|
|
801
|
+
let t = J();
|
|
798
802
|
return u(() => {
|
|
799
803
|
if (!e) return;
|
|
800
804
|
let n = t.getRootElement();
|
|
@@ -812,80 +816,80 @@ function qr({ onFocusChange: e }) {
|
|
|
812
816
|
}
|
|
813
817
|
//#endregion
|
|
814
818
|
//#region src/components/chat-input/plugins/has-value-plugin.tsx
|
|
815
|
-
function
|
|
819
|
+
function Yr(e) {
|
|
816
820
|
let t = !1;
|
|
817
821
|
return e.getEditorState().read(() => {
|
|
818
|
-
t =
|
|
822
|
+
t = Wr().length > 0;
|
|
819
823
|
}), t;
|
|
820
824
|
}
|
|
821
|
-
function
|
|
822
|
-
let r =
|
|
825
|
+
function Xr(e, t, n) {
|
|
826
|
+
let r = Yr(e);
|
|
823
827
|
n.current !== r && (n.current = r, t?.(r));
|
|
824
828
|
}
|
|
825
|
-
function
|
|
826
|
-
let t =
|
|
829
|
+
function Zr({ onHasValueChange: e }) {
|
|
830
|
+
let t = J(), n = m();
|
|
827
831
|
return u(() => {
|
|
828
|
-
if (t) return
|
|
829
|
-
|
|
832
|
+
if (t) return Xr(t, e, n), t.registerUpdateListener(() => {
|
|
833
|
+
Xr(t, e, n);
|
|
830
834
|
});
|
|
831
835
|
}, [t, e]), null;
|
|
832
836
|
}
|
|
833
837
|
//#endregion
|
|
834
838
|
//#region src/components/chat-input/plugins/markdown-plain-paste-plugin.tsx
|
|
835
|
-
function
|
|
836
|
-
let e =
|
|
837
|
-
return u(() => e.registerCommand(
|
|
839
|
+
function Qr() {
|
|
840
|
+
let e = J();
|
|
841
|
+
return u(() => e.registerCommand(st, (t) => {
|
|
838
842
|
let { clipboardData: n } = t;
|
|
839
843
|
if (!n) return !1;
|
|
840
844
|
let r = n.getData("text/plain");
|
|
841
845
|
return r ? (t.preventDefault(), e.update(() => {
|
|
842
|
-
let e =
|
|
843
|
-
if (
|
|
846
|
+
let e = U();
|
|
847
|
+
if (W(e)) {
|
|
844
848
|
e.insertText(r);
|
|
845
849
|
return;
|
|
846
850
|
}
|
|
847
|
-
let t =
|
|
851
|
+
let t = H();
|
|
848
852
|
t.clear(), r.split(/\r?\n/).forEach((e) => {
|
|
849
|
-
let n =
|
|
850
|
-
e.length > 0 && n.append(
|
|
853
|
+
let n = We();
|
|
854
|
+
e.length > 0 && n.append(Ke(e)), t.append(n);
|
|
851
855
|
});
|
|
852
856
|
}), !0) : !1;
|
|
853
|
-
},
|
|
857
|
+
}, et), [e]), null;
|
|
854
858
|
}
|
|
855
859
|
//#endregion
|
|
856
860
|
//#region src/components/chat-input/plugins/value-plugin.tsx
|
|
857
|
-
var
|
|
858
|
-
function
|
|
861
|
+
var $r = 50;
|
|
862
|
+
function ei({ onChange: e, emittedValuesRef: t }) {
|
|
859
863
|
let n = c((n, r, i) => {
|
|
860
864
|
if (!i.has("focus") && e) try {
|
|
861
865
|
n.read(() => {
|
|
862
|
-
let n =
|
|
863
|
-
t && (t.current.push(n), t.current.splice(0, t.current.length -
|
|
866
|
+
let n = Ve(Hr);
|
|
867
|
+
t && (t.current.push(n), t.current.splice(0, t.current.length - $r)), e(n);
|
|
864
868
|
});
|
|
865
869
|
} catch (e) {
|
|
866
870
|
console.error("ValuePlugin error:", e);
|
|
867
871
|
}
|
|
868
872
|
}, [e, t]);
|
|
869
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ R(ht, { onChange: n });
|
|
870
874
|
}
|
|
871
875
|
//#endregion
|
|
872
876
|
//#region src/components/chat-input/chat-input.tsx
|
|
873
|
-
var
|
|
874
|
-
function
|
|
875
|
-
let e = l(
|
|
877
|
+
var ti = i(null);
|
|
878
|
+
function ni() {
|
|
879
|
+
let e = l(ti);
|
|
876
880
|
if (!e) throw Error("\"useChatInputContext\" must be used within a ChatInputContextProvider");
|
|
877
881
|
return e;
|
|
878
882
|
}
|
|
879
|
-
var
|
|
883
|
+
var ri = {
|
|
880
884
|
namespace: "chat-input",
|
|
881
885
|
editable: !0,
|
|
882
886
|
nodes: [
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
887
|
+
Le,
|
|
888
|
+
Re,
|
|
889
|
+
Ae,
|
|
890
|
+
ke,
|
|
891
|
+
Ce,
|
|
892
|
+
Te
|
|
889
893
|
],
|
|
890
894
|
theme: {
|
|
891
895
|
paragraph: "m-0 min-h-[26px]",
|
|
@@ -898,7 +902,7 @@ var ni = {
|
|
|
898
902
|
onError: (e) => {
|
|
899
903
|
console.error("ChatInput Lexical error:", e);
|
|
900
904
|
}
|
|
901
|
-
},
|
|
905
|
+
}, ii = a(function({ className: e, children: t, initialConfig: n = ri, ...r }, i) {
|
|
902
906
|
let [a, o] = h(!1), [s, c] = h(!1), [l, u] = h(!1), d = p(() => ({
|
|
903
907
|
hasError: a,
|
|
904
908
|
hasValue: s,
|
|
@@ -911,11 +915,11 @@ var ni = {
|
|
|
911
915
|
s,
|
|
912
916
|
l
|
|
913
917
|
]);
|
|
914
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ R(ti.Provider, {
|
|
915
919
|
value: d,
|
|
916
|
-
children: /* @__PURE__ */
|
|
920
|
+
children: /* @__PURE__ */ R(je, {
|
|
917
921
|
initialConfig: n,
|
|
918
|
-
children: /* @__PURE__ */
|
|
922
|
+
children: /* @__PURE__ */ R("div", {
|
|
919
923
|
ref: i,
|
|
920
924
|
"data-slot": "chat-input",
|
|
921
925
|
"data-testid": "chat-input",
|
|
@@ -930,24 +934,24 @@ var ni = {
|
|
|
930
934
|
})
|
|
931
935
|
});
|
|
932
936
|
});
|
|
933
|
-
|
|
934
|
-
var
|
|
935
|
-
return /* @__PURE__ */
|
|
937
|
+
ii.displayName = "ChatInput";
|
|
938
|
+
var ai = a(function({ className: e, children: t, ...n }, r) {
|
|
939
|
+
return /* @__PURE__ */ R(I, {
|
|
936
940
|
ref: r,
|
|
937
941
|
variant: "body",
|
|
938
942
|
className: L("pointer-events-none absolute inset-0 z-0", "min-h-[26px]", "text-text-tertiary", e),
|
|
939
943
|
asChild: !0,
|
|
940
944
|
...n,
|
|
941
|
-
children: /* @__PURE__ */
|
|
945
|
+
children: /* @__PURE__ */ R("p", {
|
|
942
946
|
"data-slot": "chat-input-placeholder",
|
|
943
947
|
children: t
|
|
944
948
|
})
|
|
945
949
|
});
|
|
946
950
|
});
|
|
947
|
-
|
|
948
|
-
var
|
|
949
|
-
let { setHasValue: p, setIsFocused: h } =
|
|
950
|
-
return /* @__PURE__ */
|
|
951
|
+
ai.displayName = "ChatInputPlaceholder";
|
|
952
|
+
var oi = a(function({ className: e, style: t, placeholderClassName: n, placeholder: r = "Input your message...", children: i, value: a, autoFocus: o = !0, isDisabled: s = !1, isReadOnly: c = !1, onChange: l, onKeyDown: u, ...d }, f) {
|
|
953
|
+
let { setHasValue: p, setIsFocused: h } = ni(), g = c && !s, _ = m([]);
|
|
954
|
+
return /* @__PURE__ */ z("div", {
|
|
951
955
|
"data-slot": "chat-input-textarea",
|
|
952
956
|
"data-testid": "chat-input-textarea",
|
|
953
957
|
"data-disabled": s,
|
|
@@ -958,38 +962,38 @@ var ai = a(function({ className: e, style: t, placeholderClassName: n, placehold
|
|
|
958
962
|
style: t,
|
|
959
963
|
...d,
|
|
960
964
|
children: [
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
contentEditable: /* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ R(Fe, {
|
|
966
|
+
contentEditable: /* @__PURE__ */ R(Me, {
|
|
963
967
|
ref: f,
|
|
964
968
|
"data-slot": "chat-input-editable",
|
|
965
969
|
className: L("min-h-[26px]!", "overflow-y-auto text-wrap outline-none", e),
|
|
966
970
|
"aria-label": "Chat input",
|
|
967
971
|
"aria-placeholder": r,
|
|
968
|
-
placeholder: /* @__PURE__ */
|
|
972
|
+
placeholder: /* @__PURE__ */ R(ai, {
|
|
969
973
|
className: n,
|
|
970
974
|
children: r
|
|
971
975
|
}),
|
|
972
976
|
onKeyDown: u
|
|
973
977
|
}),
|
|
974
|
-
ErrorBoundary:
|
|
978
|
+
ErrorBoundary: Ne
|
|
975
979
|
}),
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ R(Pe, {}),
|
|
981
|
+
/* @__PURE__ */ R(qr, {
|
|
978
982
|
isDisabled: s,
|
|
979
983
|
isReadOnly: c
|
|
980
984
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ R(Kr, {
|
|
982
986
|
value: a,
|
|
983
987
|
emittedValuesRef: _
|
|
984
988
|
}),
|
|
985
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ R(ei, {
|
|
986
990
|
onChange: l,
|
|
987
991
|
emittedValuesRef: _
|
|
988
992
|
}),
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
+
/* @__PURE__ */ R(Qr, {}),
|
|
994
|
+
/* @__PURE__ */ R(Zr, { onHasValueChange: p }),
|
|
995
|
+
/* @__PURE__ */ R(Jr, { onFocusChange: h }),
|
|
996
|
+
/* @__PURE__ */ R(Vr, {
|
|
993
997
|
autoFocus: o,
|
|
994
998
|
isDisabled: s || c
|
|
995
999
|
}),
|
|
@@ -997,12 +1001,12 @@ var ai = a(function({ className: e, style: t, placeholderClassName: n, placehold
|
|
|
997
1001
|
]
|
|
998
1002
|
});
|
|
999
1003
|
});
|
|
1000
|
-
|
|
1004
|
+
oi.displayName = "ChatInputTextarea";
|
|
1001
1005
|
//#endregion
|
|
1002
1006
|
//#region src/components/chat-list/chat-list.tsx
|
|
1003
|
-
var
|
|
1004
|
-
function
|
|
1005
|
-
let e = l(
|
|
1007
|
+
var si = i(null);
|
|
1008
|
+
function Y() {
|
|
1009
|
+
let e = l(si);
|
|
1006
1010
|
if (!e) throw Error("\"useChatListContext\" must be used within a ChatList");
|
|
1007
1011
|
return e;
|
|
1008
1012
|
}
|
|
@@ -1043,9 +1047,9 @@ function ci({ children: e, className: t, loadedCount: n, totalCount: r, hasMore:
|
|
|
1043
1047
|
C,
|
|
1044
1048
|
y
|
|
1045
1049
|
]);
|
|
1046
|
-
return /* @__PURE__ */
|
|
1050
|
+
return /* @__PURE__ */ R(si.Provider, {
|
|
1047
1051
|
value: E,
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1052
|
+
children: /* @__PURE__ */ R("div", {
|
|
1049
1053
|
"data-slot": "chat-list",
|
|
1050
1054
|
"data-testid": "chat-list",
|
|
1051
1055
|
"data-loading": a,
|
|
@@ -1061,30 +1065,30 @@ function ci({ children: e, className: t, loadedCount: n, totalCount: r, hasMore:
|
|
|
1061
1065
|
}
|
|
1062
1066
|
var li = ["w-2/3", "w-1/2"], ui = ["w-full", "w-4/5"];
|
|
1063
1067
|
function di({ children: e, rows: t = 16, className: n, rowClassName: r }) {
|
|
1064
|
-
let { isLoading: i, loadedCount: a, skeletonContainer: o } =
|
|
1065
|
-
return !(i && a === 0) || !o ? null :
|
|
1068
|
+
let { isLoading: i, loadedCount: a, skeletonContainer: o } = Y();
|
|
1069
|
+
return !(i && a === 0) || !o ? null : gt(/* @__PURE__ */ R("div", {
|
|
1066
1070
|
"data-slot": "chat-list-skeleton",
|
|
1067
1071
|
"data-testid": "chat-list-skeleton",
|
|
1068
1072
|
role: "status",
|
|
1069
1073
|
"aria-busy": "true",
|
|
1070
1074
|
"aria-label": "Loading chats",
|
|
1071
1075
|
className: L("flex min-h-0 flex-1 flex-col gap-4 overflow-hidden", n),
|
|
1072
|
-
children: e ?? Array.from({ length: t }, (e, t) => /* @__PURE__ */
|
|
1076
|
+
children: e ?? Array.from({ length: t }, (e, t) => /* @__PURE__ */ z("div", {
|
|
1073
1077
|
"data-slot": "chat-list-skeleton-row",
|
|
1074
1078
|
className: L("flex shrink-0 flex-col gap-4 px-12 py-8", r),
|
|
1075
|
-
children: [/* @__PURE__ */
|
|
1079
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1076
1080
|
className: "flex h-20 items-center",
|
|
1077
|
-
children: /* @__PURE__ */
|
|
1078
|
-
}), /* @__PURE__ */
|
|
1081
|
+
children: /* @__PURE__ */ R(ge, { className: L("h-12", li[t % 2]) })
|
|
1082
|
+
}), /* @__PURE__ */ R("div", {
|
|
1079
1083
|
className: "flex h-16 items-center",
|
|
1080
|
-
children: /* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ R(ge, { className: L("h-10", ui[t % 2]) })
|
|
1081
1085
|
})]
|
|
1082
1086
|
}, t))
|
|
1083
1087
|
}), o);
|
|
1084
1088
|
}
|
|
1085
1089
|
function fi({ children: e, className: t }) {
|
|
1086
|
-
let { isEmpty: n } =
|
|
1087
|
-
return n ? /* @__PURE__ */
|
|
1090
|
+
let { isEmpty: n } = Y();
|
|
1091
|
+
return n ? /* @__PURE__ */ R("div", {
|
|
1088
1092
|
"data-slot": "chat-list-empty-state",
|
|
1089
1093
|
"data-testid": "chat-list-empty-state",
|
|
1090
1094
|
role: "status",
|
|
@@ -1095,15 +1099,15 @@ function fi({ children: e, className: t }) {
|
|
|
1095
1099
|
}) : null;
|
|
1096
1100
|
}
|
|
1097
1101
|
function pi({ children: e, error: t, className: n, messageClassName: r }) {
|
|
1098
|
-
let { hasError: i, loadedCount: a } =
|
|
1099
|
-
return i && a === 0 ? /* @__PURE__ */
|
|
1102
|
+
let { hasError: i, loadedCount: a } = Y();
|
|
1103
|
+
return i && a === 0 ? /* @__PURE__ */ R("div", {
|
|
1100
1104
|
"data-slot": "chat-list-error",
|
|
1101
1105
|
"data-testid": "chat-list-error",
|
|
1102
1106
|
role: "alert",
|
|
1103
1107
|
"aria-live": "assertive",
|
|
1104
1108
|
"aria-label": "Error loading chats",
|
|
1105
1109
|
className: L("flex flex-1 items-center justify-center", n),
|
|
1106
|
-
children: e || /* @__PURE__ */
|
|
1110
|
+
children: e || /* @__PURE__ */ R("div", {
|
|
1107
1111
|
"data-slot": "chat-list-error-message",
|
|
1108
1112
|
className: L("text-text-error-main", r),
|
|
1109
1113
|
children: t instanceof Error ? t.message : t || "An error occurred"
|
|
@@ -1111,7 +1115,7 @@ function pi({ children: e, error: t, className: n, messageClassName: r }) {
|
|
|
1111
1115
|
}) : null;
|
|
1112
1116
|
}
|
|
1113
1117
|
function mi({ children: e }) {
|
|
1114
|
-
let { loadMoreContentRef: t, bumpLoadMore: n } =
|
|
1118
|
+
let { loadMoreContentRef: t, bumpLoadMore: n } = Y();
|
|
1115
1119
|
return t.current = e ?? null, f(() => (n(), () => {
|
|
1116
1120
|
t.current = null, n();
|
|
1117
1121
|
}), [n, t]), null;
|
|
@@ -1119,7 +1123,7 @@ function mi({ children: e }) {
|
|
|
1119
1123
|
//#endregion
|
|
1120
1124
|
//#region src/components/chat-list/chat-list-items.tsx
|
|
1121
1125
|
var hi = "chat-list-load-more", gi = s(function({ children: e, className: t, listClassName: n, rowClassName: r, estimateSize: i = 54, overscan: a = 6, gap: o = 4 }) {
|
|
1122
|
-
let { loadedCount: s, hasMore: l, isLoading: d, isLoadingMore: f, onLoadMore: p, getItemKey: m, scrollElementRef: h, setScrollElement: g, loadMoreContentRef: _, loadMoreVersion: v, setSkeletonContainer: y } =
|
|
1126
|
+
let { loadedCount: s, hasMore: l, isLoading: d, isLoadingMore: f, onLoadMore: p, getItemKey: m, scrollElementRef: h, setScrollElement: g, loadMoreContentRef: _, loadMoreVersion: v, setSkeletonContainer: y } = Y(), b = v >= 0 ? _.current : null, x = d && s === 0, S = l ? s + 1 : s, C = c((e) => e >= s ? hi : m(e), [m, s]), w = _t({
|
|
1123
1127
|
count: x ? 0 : S,
|
|
1124
1128
|
getScrollElement: () => h.current,
|
|
1125
1129
|
estimateSize: () => i,
|
|
@@ -1138,17 +1142,17 @@ var hi = "chat-list-load-more", gi = s(function({ children: e, className: t, lis
|
|
|
1138
1142
|
f,
|
|
1139
1143
|
p,
|
|
1140
1144
|
x
|
|
1141
|
-
]), x ? /* @__PURE__ */
|
|
1145
|
+
]), x ? /* @__PURE__ */ R("div", {
|
|
1142
1146
|
ref: y,
|
|
1143
1147
|
"data-slot": "chat-list-items",
|
|
1144
1148
|
"data-testid": "chat-list-items",
|
|
1145
1149
|
className: L("flex min-h-0 flex-1 flex-col overflow-hidden", t)
|
|
1146
|
-
}) : /* @__PURE__ */
|
|
1150
|
+
}) : /* @__PURE__ */ R(me, {
|
|
1147
1151
|
ref: g,
|
|
1148
1152
|
"data-slot": "chat-list-items",
|
|
1149
1153
|
"data-testid": "chat-list-items",
|
|
1150
1154
|
className: L("min-h-0 flex-1", "overflow-auto", t),
|
|
1151
|
-
children: /* @__PURE__ */
|
|
1155
|
+
children: /* @__PURE__ */ R("ul", {
|
|
1152
1156
|
"data-slot": "chat-list-items-list",
|
|
1153
1157
|
role: "list",
|
|
1154
1158
|
"aria-label": "Chats",
|
|
@@ -1156,7 +1160,7 @@ var hi = "chat-list-load-more", gi = s(function({ children: e, className: t, lis
|
|
|
1156
1160
|
style: { height: `${w.getTotalSize()}px` },
|
|
1157
1161
|
children: T.map((t) => {
|
|
1158
1162
|
let n = t.index >= s;
|
|
1159
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ R("li", {
|
|
1160
1164
|
"data-slot": "chat-list-items-row",
|
|
1161
1165
|
"data-index": t.index,
|
|
1162
1166
|
"data-load-more": n,
|
|
@@ -1178,7 +1182,7 @@ var hi = "chat-list-load-more", gi = s(function({ children: e, className: t, lis
|
|
|
1178
1182
|
})
|
|
1179
1183
|
});
|
|
1180
1184
|
}), _i = a(function({ children: t, className: n, asChild: r = !1, isSelected: i = !1, ...a }, o) {
|
|
1181
|
-
return /* @__PURE__ */
|
|
1185
|
+
return /* @__PURE__ */ R(r ? e : "div", {
|
|
1182
1186
|
ref: o,
|
|
1183
1187
|
"data-slot": "chat-list-item",
|
|
1184
1188
|
"data-testid": "chat-list-item",
|
|
@@ -1218,7 +1222,7 @@ function bi({ children: e, reportInputHeight: t, resetCompact: n }) {
|
|
|
1218
1222
|
a,
|
|
1219
1223
|
o
|
|
1220
1224
|
]);
|
|
1221
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ R(vi.Provider, {
|
|
1222
1226
|
value: s,
|
|
1223
1227
|
children: e
|
|
1224
1228
|
});
|
|
@@ -1226,7 +1230,7 @@ function bi({ children: e, reportInputHeight: t, resetCompact: n }) {
|
|
|
1226
1230
|
//#endregion
|
|
1227
1231
|
//#region src/components/chat-prompt-box/chat-prompt-box-focus-plugin.tsx
|
|
1228
1232
|
function xi() {
|
|
1229
|
-
let e =
|
|
1233
|
+
let e = J(), { registerFocusInput: t, unregisterFocusInput: n } = yi();
|
|
1230
1234
|
return u(() => (t(() => {
|
|
1231
1235
|
e.focus();
|
|
1232
1236
|
}), () => {
|
|
@@ -1249,10 +1253,10 @@ var Ti = a(function(e, t) {
|
|
|
1249
1253
|
}, []), a = c(() => {
|
|
1250
1254
|
r(!0);
|
|
1251
1255
|
}, []);
|
|
1252
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ R(bi, {
|
|
1253
1257
|
reportInputHeight: i,
|
|
1254
1258
|
resetCompact: a,
|
|
1255
|
-
children: /* @__PURE__ */
|
|
1259
|
+
children: /* @__PURE__ */ R(Ei, {
|
|
1256
1260
|
ref: t,
|
|
1257
1261
|
"data-compact": n,
|
|
1258
1262
|
...e
|
|
@@ -1264,29 +1268,29 @@ var Ei = a(function({ className: e, innerClassName: t, children: n, onMouseDown:
|
|
|
1264
1268
|
let { focusInput: o } = yi(), s = c((e) => {
|
|
1265
1269
|
wi(e.target) || o(), r?.(e);
|
|
1266
1270
|
}, [o, r]);
|
|
1267
|
-
return /* @__PURE__ */
|
|
1271
|
+
return /* @__PURE__ */ z(ii, {
|
|
1268
1272
|
ref: a,
|
|
1269
1273
|
"data-slot": "chat-prompt-box",
|
|
1270
1274
|
className: L("group/chat-prompt-box", "relative overflow-hidden", "cursor-text", "p-px", "rounded-[16px]", "bg-transparent", "hover:bg-promptbox-background-border-base", "data-[focused=true]:bg-promptbox-background-border-base", e),
|
|
1271
1275
|
onMouseDown: s,
|
|
1272
1276
|
...i,
|
|
1273
|
-
children: [/* @__PURE__ */
|
|
1277
|
+
children: [/* @__PURE__ */ R("div", {
|
|
1274
1278
|
"data-slot": "chat-prompt-box-inner",
|
|
1275
1279
|
className: L("rounded-[15px]", "p-[4px]", "bg-[#171A20]", "group-hover/chat-prompt-box:bg-[#252931]", "group-data-[focused=true]/chat-prompt-box:bg-[linear-gradient(var(--color-promptbox-background-hover),var(--color-promptbox-background-hover)),var(--color-promptbox-background-base)]", "group-data-[focused=true]/chat-prompt-box:group-hover/chat-prompt-box:bg-[linear-gradient(var(--color-promptbox-background-hover),var(--color-promptbox-background-hover)),var(--color-promptbox-background-base)]", t),
|
|
1276
1280
|
children: n
|
|
1277
|
-
}), /* @__PURE__ */
|
|
1281
|
+
}), /* @__PURE__ */ R(Di, {})]
|
|
1278
1282
|
});
|
|
1279
1283
|
});
|
|
1280
1284
|
Ei.displayName = "ChatPromptBoxContainer";
|
|
1281
1285
|
function Di() {
|
|
1282
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ z(Se, { children: [/* @__PURE__ */ R("div", {
|
|
1283
1287
|
"data-slot": "chat-prompt-box-glow-top",
|
|
1284
1288
|
className: L("absolute left-1/2 top-[-40px]", "translate-x-[-50%]", "pointer-events-none", "w-[380px] h-[72px]", "opacity-0 group-data-[focused=true]/chat-prompt-box:opacity-50"),
|
|
1285
1289
|
style: {
|
|
1286
1290
|
borderRadius: "380px",
|
|
1287
1291
|
background: "gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.00) 100%)"
|
|
1288
1292
|
}
|
|
1289
|
-
}), /* @__PURE__ */
|
|
1293
|
+
}), /* @__PURE__ */ R("div", {
|
|
1290
1294
|
"data-slot": "chat-prompt-box-glow-bottom",
|
|
1291
1295
|
className: L("absolute left-1/2 -bottom-22", "translate-x-[-50%]", "pointer-events-none", "w-[1082px] h-[172px]", "opacity-0 group-data-[focused=true]/chat-prompt-box:opacity-5"),
|
|
1292
1296
|
style: {
|
|
@@ -1296,7 +1300,7 @@ function Di() {
|
|
|
1296
1300
|
})] });
|
|
1297
1301
|
}
|
|
1298
1302
|
function Oi({ className: e, children: t, ...n }) {
|
|
1299
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ R("div", {
|
|
1300
1304
|
"data-slot": "chat-prompt-box-toolbar",
|
|
1301
1305
|
"data-testid": "chat-prompt-box-toolbar",
|
|
1302
1306
|
className: L(e),
|
|
@@ -1305,7 +1309,7 @@ function Oi({ className: e, children: t, ...n }) {
|
|
|
1305
1309
|
});
|
|
1306
1310
|
}
|
|
1307
1311
|
function ki({ className: e, children: t, ...n }) {
|
|
1308
|
-
return /* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ R("div", {
|
|
1309
1313
|
"data-slot": "chat-prompt-box-content",
|
|
1310
1314
|
"data-testid": "chat-prompt-box-content",
|
|
1311
1315
|
className: L("relative", "px-[8px] py-[8px]", "flex flex-row gap-[8px]", "group-data-[compact=false]/chat-prompt-box:pb-[calc(8px+4px+40px)]", e),
|
|
@@ -1314,7 +1318,7 @@ function ki({ className: e, children: t, ...n }) {
|
|
|
1314
1318
|
});
|
|
1315
1319
|
}
|
|
1316
1320
|
var Ai = a(function({ className: e, textareaClassName: t, placeholderClassName: n, children: r, ...i }, a) {
|
|
1317
|
-
let { reportInputHeight: o, resetCompact: s } = yi(), { hasValue: l } =
|
|
1321
|
+
let { reportInputHeight: o, resetCompact: s } = yi(), { hasValue: l } = ni(), { ref: u, height: d } = xe();
|
|
1318
1322
|
f(() => {
|
|
1319
1323
|
typeof d == "number" && o(d);
|
|
1320
1324
|
}, [d, o]), f(() => () => {
|
|
@@ -1325,22 +1329,22 @@ var Ai = a(function({ className: e, textareaClassName: t, placeholderClassName:
|
|
|
1325
1329
|
let p = c((e) => {
|
|
1326
1330
|
u(e), typeof a == "function" ? a(e) : a && (a.current = e);
|
|
1327
1331
|
}, [u, a]);
|
|
1328
|
-
return /* @__PURE__ */
|
|
1332
|
+
return /* @__PURE__ */ R("div", {
|
|
1329
1333
|
"data-slot": "chat-prompt-box-input",
|
|
1330
1334
|
"data-testid": "chat-prompt-box-input",
|
|
1331
1335
|
className: L("min-h-[40px]", "inline-flex justify-center items-center", "group-data-[compact=false]/chat-prompt-box:items-start", "group-data-[compact=false]/chat-prompt-box:min-h-[48px]", "order-2 grow min-w-0 flex-1", "[&>div]:flex-1 [&>div]:min-w-0", e),
|
|
1332
|
-
children: /* @__PURE__ */
|
|
1336
|
+
children: /* @__PURE__ */ z(oi, {
|
|
1333
1337
|
ref: p,
|
|
1334
1338
|
className: L("max-h-[72px]!", t),
|
|
1335
1339
|
placeholderClassName: L("leading-[24px]!", n),
|
|
1336
1340
|
...i,
|
|
1337
|
-
children: [/* @__PURE__ */
|
|
1341
|
+
children: [/* @__PURE__ */ R(xi, {}), r]
|
|
1338
1342
|
})
|
|
1339
1343
|
});
|
|
1340
1344
|
});
|
|
1341
1345
|
Ai.displayName = "ChatPromptBoxInput";
|
|
1342
1346
|
function ji({ className: e, children: t, ...n }) {
|
|
1343
|
-
return /* @__PURE__ */
|
|
1347
|
+
return /* @__PURE__ */ R("div", {
|
|
1344
1348
|
"data-slot": "chat-prompt-box-actions-left",
|
|
1345
1349
|
"data-testid": "chat-prompt-box-actions-left",
|
|
1346
1350
|
role: "group",
|
|
@@ -1350,7 +1354,7 @@ function ji({ className: e, children: t, ...n }) {
|
|
|
1350
1354
|
});
|
|
1351
1355
|
}
|
|
1352
1356
|
function Mi({ className: e, children: t, ...n }) {
|
|
1353
|
-
return /* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ R("div", {
|
|
1354
1358
|
"data-slot": "chat-prompt-box-actions-right",
|
|
1355
1359
|
"data-testid": "chat-prompt-box-actions-right",
|
|
1356
1360
|
role: "group",
|
|
@@ -1362,7 +1366,7 @@ function Mi({ className: e, children: t, ...n }) {
|
|
|
1362
1366
|
//#endregion
|
|
1363
1367
|
//#region src/components/chat-message/chat-message.tsx
|
|
1364
1368
|
function Ni({ children: e, className: t, isQuestion: n }) {
|
|
1365
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ R("div", {
|
|
1366
1370
|
"data-slot": "chat-message",
|
|
1367
1371
|
"data-question": n,
|
|
1368
1372
|
className: L("group/message", "flex flex-col", "data-[question=true]:items-end", "gap-8", t),
|
|
@@ -1370,7 +1374,7 @@ function Ni({ children: e, className: t, isQuestion: n }) {
|
|
|
1370
1374
|
});
|
|
1371
1375
|
}
|
|
1372
1376
|
function Pi({ children: e, className: t }) {
|
|
1373
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ R("div", {
|
|
1374
1378
|
"data-slot": "chat-message-content",
|
|
1375
1379
|
"data-bubble": !0,
|
|
1376
1380
|
className: L("w-fit", "min-w-message-mobile-min md:min-w-auto", "group-data-[question=true]/message:data-[bubble=true]:p-16", "group-data-[question=true]/message:data-[bubble=true]:rounded-[20px]", "group-data-[question=true]/message:data-[bubble=true]:bg-[#22283499]", t),
|
|
@@ -1378,7 +1382,7 @@ function Pi({ children: e, className: t }) {
|
|
|
1378
1382
|
});
|
|
1379
1383
|
}
|
|
1380
1384
|
function Fi({ children: e, className: t }) {
|
|
1381
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ R("div", {
|
|
1382
1386
|
"data-slot": "chat-message-actions",
|
|
1383
1387
|
className: L("transition-opacity duration-300", "md:opacity-0 group-hover/message:opacity-100", t),
|
|
1384
1388
|
children: e
|
|
@@ -1387,12 +1391,12 @@ function Fi({ children: e, className: t }) {
|
|
|
1387
1391
|
//#endregion
|
|
1388
1392
|
//#region src/contexts/chat-context/utils.ts
|
|
1389
1393
|
function Ii() {
|
|
1390
|
-
return `__${
|
|
1394
|
+
return `__${yt()}__`;
|
|
1391
1395
|
}
|
|
1392
1396
|
//#endregion
|
|
1393
1397
|
//#region src/contexts/chat-context/chat-context.tsx
|
|
1394
1398
|
var Li = i(null);
|
|
1395
|
-
function
|
|
1399
|
+
function X() {
|
|
1396
1400
|
let e = l(Li);
|
|
1397
1401
|
if (!e) throw Error("\"useChatContext\" must be used within a ChatProvider");
|
|
1398
1402
|
return e;
|
|
@@ -1432,7 +1436,7 @@ function Ri({ children: e, chatId: t }) {
|
|
|
1432
1436
|
f,
|
|
1433
1437
|
g
|
|
1434
1438
|
]);
|
|
1435
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ R(Li.Provider, {
|
|
1436
1440
|
value: _,
|
|
1437
1441
|
children: e
|
|
1438
1442
|
});
|
|
@@ -1453,7 +1457,7 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1453
1457
|
isProgrammaticScroll: !1,
|
|
1454
1458
|
userScrollIntent: !1,
|
|
1455
1459
|
scrollStrategy: "lastItem"
|
|
1456
|
-
}), s = m(null), l = m(null), u = m(null), d = m(null), f = m(null), g = m(null), _ = m(0), v = m(!0), y = m(!1), b = m(!1), x = m(!1), S = m(!1), C = m(null), w = m(null), T = m("lastItem"), E = m(0),
|
|
1460
|
+
}), s = m(null), l = m(null), u = m(null), d = m(null), f = m(null), g = m(null), _ = m(0), v = m(!0), y = m(!1), b = m(!1), x = m(!1), S = m(!1), C = m(null), w = m(null), T = m("lastItem"), E = m(0), ee = m(() => {}), D = m(() => {}), te = m(() => {}), O = m(() => {});
|
|
1457
1461
|
O.current = c(() => {
|
|
1458
1462
|
n && o({
|
|
1459
1463
|
isAtBottom: v.current,
|
|
@@ -1470,31 +1474,31 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1470
1474
|
te.current = k;
|
|
1471
1475
|
let A = c(() => {
|
|
1472
1476
|
g.current?.disconnect(), g.current = null;
|
|
1473
|
-
}, []),
|
|
1477
|
+
}, []), j = c(() => {
|
|
1474
1478
|
f.current?.disconnect(), f.current = null;
|
|
1475
|
-
}, []),
|
|
1479
|
+
}, []), ne = m(() => {}), M = c(() => {
|
|
1476
1480
|
requestAnimationFrame(() => {
|
|
1477
1481
|
requestAnimationFrame(() => {
|
|
1478
|
-
x.current = !1,
|
|
1482
|
+
x.current = !1, ne.current(), O.current();
|
|
1479
1483
|
});
|
|
1480
1484
|
});
|
|
1481
|
-
}, []),
|
|
1485
|
+
}, []), re = c(() => {
|
|
1482
1486
|
C.current &&= (clearTimeout(C.current), null), S.current && (S.current = !1, O.current());
|
|
1483
|
-
}, []),
|
|
1487
|
+
}, []), N = c(() => {
|
|
1484
1488
|
S.current = !0, C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
1485
1489
|
C.current = null, S.current = !1, O.current();
|
|
1486
1490
|
}, Bi), O.current();
|
|
1487
|
-
}, []),
|
|
1491
|
+
}, []), ie = c(() => {
|
|
1488
1492
|
T.current = "lastItem", te.current(), O.current();
|
|
1489
1493
|
}, []), P = c((e) => {
|
|
1490
|
-
b.current !== e && (b.current = e, e &&
|
|
1494
|
+
b.current !== e && (b.current = e, e && ne.current(), O.current());
|
|
1491
1495
|
}, []), ae = c(() => {
|
|
1492
1496
|
if (b.current) return;
|
|
1493
1497
|
x.current = !0, O.current();
|
|
1494
1498
|
let e = y.current ? "smooth" : "instant";
|
|
1495
1499
|
y.current = !0, requestAnimationFrame(() => {
|
|
1496
1500
|
if (b.current) {
|
|
1497
|
-
|
|
1501
|
+
M();
|
|
1498
1502
|
return;
|
|
1499
1503
|
}
|
|
1500
1504
|
T.current === "lastItem" ? u.current?.scrollIntoView({
|
|
@@ -1504,10 +1508,10 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1504
1508
|
}) : s.current?.scrollTo({
|
|
1505
1509
|
top: s.current.scrollHeight,
|
|
1506
1510
|
behavior: e
|
|
1507
|
-
}),
|
|
1511
|
+
}), M(), O.current();
|
|
1508
1512
|
});
|
|
1509
|
-
}, [
|
|
1510
|
-
|
|
1513
|
+
}, [M]);
|
|
1514
|
+
ee.current = ae;
|
|
1511
1515
|
let oe = c(() => {
|
|
1512
1516
|
let e = s.current;
|
|
1513
1517
|
if (!e) return;
|
|
@@ -1516,37 +1520,37 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1516
1520
|
e.scrollTo({
|
|
1517
1521
|
top: t,
|
|
1518
1522
|
behavior: "instant"
|
|
1519
|
-
}), E.current = e.scrollHeight,
|
|
1523
|
+
}), E.current = e.scrollHeight, M(), O.current();
|
|
1520
1524
|
}));
|
|
1521
|
-
}, [
|
|
1525
|
+
}, [M]), se = c(() => {
|
|
1522
1526
|
let e = s.current;
|
|
1523
1527
|
if (!e) return;
|
|
1524
1528
|
let t = e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
|
|
1525
1529
|
(t || b.current) && (v.current = t, i(t), T.current === "end" && t && oe(), O.current());
|
|
1526
1530
|
}, [oe]);
|
|
1527
|
-
|
|
1531
|
+
ne.current = se;
|
|
1528
1532
|
let ce = c(() => {
|
|
1529
|
-
|
|
1533
|
+
j();
|
|
1530
1534
|
let e = s.current;
|
|
1531
1535
|
if (!e) return;
|
|
1532
1536
|
let t = new ResizeObserver(() => {
|
|
1533
|
-
|
|
1537
|
+
ne.current();
|
|
1534
1538
|
});
|
|
1535
1539
|
t.observe(e), f.current = t;
|
|
1536
|
-
}, [
|
|
1540
|
+
}, [j]), F = c((e) => {
|
|
1537
1541
|
if (k(), T.current !== "end") return;
|
|
1538
1542
|
let t = new ResizeObserver(() => {
|
|
1539
1543
|
T.current === "end" && oe();
|
|
1540
1544
|
});
|
|
1541
1545
|
t.observe(e), d.current = t;
|
|
1542
1546
|
}, [k, oe]);
|
|
1543
|
-
|
|
1547
|
+
D.current = F;
|
|
1544
1548
|
let le = c(() => {
|
|
1545
1549
|
if (!S.current || T.current === "end") return;
|
|
1546
|
-
T.current = "end",
|
|
1550
|
+
T.current = "end", re();
|
|
1547
1551
|
let e = u.current;
|
|
1548
|
-
e &&
|
|
1549
|
-
}, [
|
|
1552
|
+
e && D.current(e), O.current();
|
|
1553
|
+
}, [re]), ue = c((e) => {
|
|
1550
1554
|
if (!e && !b.current) {
|
|
1551
1555
|
O.current();
|
|
1552
1556
|
return;
|
|
@@ -1565,23 +1569,23 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1565
1569
|
T.current !== "end" && ue(!0);
|
|
1566
1570
|
return;
|
|
1567
1571
|
}
|
|
1568
|
-
i && (P(!0),
|
|
1572
|
+
i && (P(!0), ie());
|
|
1569
1573
|
}, [
|
|
1570
|
-
|
|
1574
|
+
ie,
|
|
1571
1575
|
ue,
|
|
1572
1576
|
P
|
|
1573
1577
|
]), fe = c((e) => {
|
|
1574
1578
|
let t = s.current;
|
|
1575
|
-
e.deltaY < 0 && t && t.scrollHeight > t.clientHeight && (P(!0),
|
|
1579
|
+
e.deltaY < 0 && t && t.scrollHeight > t.clientHeight && (P(!0), ie()), N();
|
|
1576
1580
|
}, [
|
|
1581
|
+
ie,
|
|
1577
1582
|
N,
|
|
1578
|
-
M,
|
|
1579
1583
|
P
|
|
1580
1584
|
]), pe = c(() => {
|
|
1581
|
-
|
|
1582
|
-
}, [
|
|
1583
|
-
|
|
1584
|
-
}, [
|
|
1585
|
+
N();
|
|
1586
|
+
}, [N]), me = c(() => {
|
|
1587
|
+
N();
|
|
1588
|
+
}, [N]), he = c(() => {
|
|
1585
1589
|
A();
|
|
1586
1590
|
let e = s.current, t = l.current;
|
|
1587
1591
|
if (!e || !t) return;
|
|
@@ -1593,21 +1597,21 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1593
1597
|
});
|
|
1594
1598
|
n.observe(t), g.current = n;
|
|
1595
1599
|
}, [A, ue]), ge = c((e) => {
|
|
1596
|
-
s.current && (s.current.removeEventListener("scroll", de), s.current.removeEventListener("wheel", fe), s.current.removeEventListener("touchstart", pe), s.current.removeEventListener("pointerdown", me),
|
|
1600
|
+
s.current && (s.current.removeEventListener("scroll", de), s.current.removeEventListener("wheel", fe), s.current.removeEventListener("touchstart", pe), s.current.removeEventListener("pointerdown", me), j()), s.current = e, e ? (w.current = e.scrollTop, E.current = e.scrollHeight, e.addEventListener("scroll", de, { passive: !0 }), e.addEventListener("wheel", fe, { passive: !0 }), e.addEventListener("touchstart", pe, { passive: !0 }), e.addEventListener("pointerdown", me), he(), ce(), se()) : (re(), A(), j());
|
|
1597
1601
|
}, [
|
|
1598
1602
|
he,
|
|
1599
1603
|
ce,
|
|
1600
|
-
|
|
1604
|
+
re,
|
|
1601
1605
|
A,
|
|
1602
|
-
|
|
1606
|
+
j,
|
|
1603
1607
|
me,
|
|
1604
1608
|
de,
|
|
1605
1609
|
pe,
|
|
1606
1610
|
fe,
|
|
1607
1611
|
se
|
|
1608
|
-
]),
|
|
1612
|
+
]), _e = c((e) => {
|
|
1609
1613
|
l.current = e, e ? he() : A();
|
|
1610
|
-
}, [he, A]),
|
|
1614
|
+
}, [he, A]), I = c((e) => {
|
|
1611
1615
|
let t = u.current;
|
|
1612
1616
|
if (e === null) {
|
|
1613
1617
|
k(), u.current = null, O.current();
|
|
@@ -1631,42 +1635,42 @@ function Ui({ children: e, chatId: t, debug: n = !1 }) {
|
|
|
1631
1635
|
O.current();
|
|
1632
1636
|
}, [F, k]), ye = c(() => {
|
|
1633
1637
|
P(!1), _.current < zi && (T.current = "lastItem", k()), O.current();
|
|
1634
|
-
}, [k, P]),
|
|
1635
|
-
ye(),
|
|
1638
|
+
}, [k, P]), be = c(() => {
|
|
1639
|
+
ye(), N(), le(), x.current = !0, O.current();
|
|
1636
1640
|
let e = y.current ? "smooth" : "instant";
|
|
1637
1641
|
y.current = !0, requestAnimationFrame(() => {
|
|
1638
1642
|
s.current?.scrollTo({
|
|
1639
1643
|
top: s.current.scrollHeight,
|
|
1640
1644
|
behavior: e
|
|
1641
|
-
}),
|
|
1645
|
+
}), M(), O.current();
|
|
1642
1646
|
});
|
|
1643
1647
|
}, [
|
|
1644
1648
|
le,
|
|
1645
|
-
j,
|
|
1646
1649
|
M,
|
|
1650
|
+
N,
|
|
1647
1651
|
ye
|
|
1648
|
-
]),
|
|
1652
|
+
]), L = c(() => {
|
|
1649
1653
|
ae();
|
|
1650
|
-
}, [ae]),
|
|
1654
|
+
}, [ae]), xe = p(() => ({
|
|
1651
1655
|
viewportRef: ge,
|
|
1652
|
-
bottomTriggerRef:
|
|
1653
|
-
lastItemRef:
|
|
1656
|
+
bottomTriggerRef: _e,
|
|
1657
|
+
lastItemRef: I,
|
|
1654
1658
|
isAtBottom: r,
|
|
1655
1659
|
setMessageCount: ve,
|
|
1656
|
-
scrollBottom:
|
|
1657
|
-
scrollToLatest:
|
|
1660
|
+
scrollBottom: be,
|
|
1661
|
+
scrollToLatest: L
|
|
1658
1662
|
}), [
|
|
1659
1663
|
ge,
|
|
1660
|
-
I,
|
|
1661
1664
|
_e,
|
|
1665
|
+
I,
|
|
1662
1666
|
r,
|
|
1663
1667
|
ve,
|
|
1664
|
-
|
|
1665
|
-
|
|
1668
|
+
be,
|
|
1669
|
+
L
|
|
1666
1670
|
]);
|
|
1667
|
-
return /* @__PURE__ */
|
|
1668
|
-
value:
|
|
1669
|
-
children: [n && /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ z(Vi.Provider, {
|
|
1672
|
+
value: xe,
|
|
1673
|
+
children: [n && /* @__PURE__ */ R("code", {
|
|
1670
1674
|
className: "absolute top-0 left-0 z-50 w-full bg-red-500/90 p-8 text-white pointer-events-none",
|
|
1671
1675
|
children: JSON.stringify(a, null, 2)
|
|
1672
1676
|
}), e]
|
|
@@ -1684,9 +1688,9 @@ function qi({ children: e, className: t, messageCount: n = 0, gap: r = 16 }) {
|
|
|
1684
1688
|
let { setMessageCount: i } = Hi(), a = p(() => ({ messageCount: n }), [n]);
|
|
1685
1689
|
return f(() => {
|
|
1686
1690
|
i(n);
|
|
1687
|
-
}, [n, i]), /* @__PURE__ */
|
|
1691
|
+
}, [n, i]), /* @__PURE__ */ R(Wi.Provider, {
|
|
1688
1692
|
value: a,
|
|
1689
|
-
children: /* @__PURE__ */
|
|
1693
|
+
children: /* @__PURE__ */ R("div", {
|
|
1690
1694
|
"data-slot": "chat-messages",
|
|
1691
1695
|
"data-testid": "chat-messages",
|
|
1692
1696
|
className: L("relative flex min-h-0 flex-1 flex-col", t),
|
|
@@ -1699,39 +1703,39 @@ function Ji({ children: e, className: t, scrollAreaClassName: n, viewportClassNa
|
|
|
1699
1703
|
let { viewportRef: a, bottomTriggerRef: o, scrollToLatest: s } = Hi(), { messageCount: c } = Ki(), l = p(() => Array.from({ length: c }, (e, t) => t), [c]), u = c - 1;
|
|
1700
1704
|
return f(() => {
|
|
1701
1705
|
s();
|
|
1702
|
-
}, [c, s]), /* @__PURE__ */
|
|
1706
|
+
}, [c, s]), /* @__PURE__ */ z(vt.Root, {
|
|
1703
1707
|
"data-slot": "chat-messages-scroll-area",
|
|
1704
1708
|
className: L("min-h-0 flex-1", "relative group/scroll-area", "overflow-y-hidden", "transform-gpu", n),
|
|
1705
|
-
children: [/* @__PURE__ */
|
|
1709
|
+
children: [/* @__PURE__ */ R(vt.Viewport, {
|
|
1706
1710
|
ref: a,
|
|
1707
1711
|
"data-slot": "chat-messages-viewport",
|
|
1708
1712
|
className: L("@container-[size]", "will-change-scroll h-full w-full", r),
|
|
1709
1713
|
style: { scrollbarGutter: "stable both-edges" },
|
|
1710
|
-
children: /* @__PURE__ */
|
|
1714
|
+
children: /* @__PURE__ */ z("ul", {
|
|
1711
1715
|
"data-slot": "chat-messages-list",
|
|
1712
1716
|
"data-testid": "chat-messages-list",
|
|
1713
1717
|
role: "log",
|
|
1714
1718
|
"aria-label": "Message list",
|
|
1715
1719
|
"aria-atomic": "false",
|
|
1716
1720
|
className: L("m-0 flex flex-col gap-(--chat-messages-gap) p-0", t),
|
|
1717
|
-
children: [l.map((t) => /* @__PURE__ */
|
|
1721
|
+
children: [l.map((t) => /* @__PURE__ */ R(Yi, {
|
|
1718
1722
|
index: t,
|
|
1719
1723
|
isLast: t === u,
|
|
1720
1724
|
children: e
|
|
1721
|
-
}, t)), /* @__PURE__ */
|
|
1725
|
+
}, t)), /* @__PURE__ */ R("li", {
|
|
1722
1726
|
ref: o,
|
|
1723
1727
|
"data-slot": "chat-messages-bottom-trigger",
|
|
1724
1728
|
className: L("h-px -mt-(--chat-messages-gap)", i),
|
|
1725
1729
|
"aria-hidden": "true"
|
|
1726
1730
|
})]
|
|
1727
1731
|
})
|
|
1728
|
-
}), /* @__PURE__ */
|
|
1732
|
+
}), /* @__PURE__ */ R(Zi, { orientation: "vertical" })]
|
|
1729
1733
|
});
|
|
1730
1734
|
}
|
|
1731
1735
|
var Yi = s(function({ children: e, index: t, isLast: n }) {
|
|
1732
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ R("li", {
|
|
1733
1737
|
"data-slot": "chat-messages-row",
|
|
1734
|
-
children: /* @__PURE__ */
|
|
1738
|
+
children: /* @__PURE__ */ R(Gi.Provider, {
|
|
1735
1739
|
value: n,
|
|
1736
1740
|
children: e(t)
|
|
1737
1741
|
})
|
|
@@ -1739,7 +1743,7 @@ var Yi = s(function({ children: e, index: t, isLast: n }) {
|
|
|
1739
1743
|
});
|
|
1740
1744
|
function Xi({ children: e, className: t, ...n }) {
|
|
1741
1745
|
let r = l(Gi), { lastItemRef: i } = Hi();
|
|
1742
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ R("div", {
|
|
1743
1747
|
ref: r ? i : void 0,
|
|
1744
1748
|
"data-slot": "chat-message-list-group",
|
|
1745
1749
|
"data-is-last": r,
|
|
@@ -1749,12 +1753,12 @@ function Xi({ children: e, className: t, ...n }) {
|
|
|
1749
1753
|
});
|
|
1750
1754
|
}
|
|
1751
1755
|
function Zi({ className: e, orientation: t = "vertical", ...n }) {
|
|
1752
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ R(vt.ScrollAreaScrollbar, {
|
|
1753
1757
|
"data-slot": "scroll-area-scrollbar",
|
|
1754
1758
|
orientation: t,
|
|
1755
1759
|
className: L("opacity-0 group-hover/scroll-area:opacity-100", "rounded-[8px]", "bg-scrollbar-track hover:bg-scrollbar-track-hover", "transition-opacity duration-200 ease-in-out", "flextouch-none select-none transition-colors", t === "vertical" && "h-full w-scrollbar border-l border-l-transparent px-4 py-[12px]", t === "horizontal" && "h-scrollbar w-full border-t border-t-transparent px-[12px] py-4", e),
|
|
1756
1760
|
...n,
|
|
1757
|
-
children: /* @__PURE__ */
|
|
1761
|
+
children: /* @__PURE__ */ R(vt.ScrollAreaThumb, {
|
|
1758
1762
|
"data-slot": "scroll-area-thumb",
|
|
1759
1763
|
className: L("relative flex-1 rounded-full", "bg-scrollbar-thumb hover:bg-scrollbar-thumb-hover", t === "vertical" && "w-scrollbar-thumb!", t === "horizontal" && "h-scrollbar-thumb!")
|
|
1760
1764
|
})
|
|
@@ -1762,23 +1766,23 @@ function Zi({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
1762
1766
|
}
|
|
1763
1767
|
var Qi = s(function({ className: e, buttonClassName: t, tooltip: n, children: r }) {
|
|
1764
1768
|
let { isAtBottom: i, scrollBottom: a } = Hi();
|
|
1765
|
-
return /* @__PURE__ */
|
|
1769
|
+
return /* @__PURE__ */ R("div", {
|
|
1766
1770
|
"data-slot": "chat-messages-scroll-button",
|
|
1767
1771
|
"data-testid": "chat-message-history-scroll-button",
|
|
1768
1772
|
"data-hidden": i,
|
|
1769
1773
|
"aria-hidden": i ? !0 : void 0,
|
|
1770
1774
|
className: L("absolute", "px-[12px]", "bottom-0", "right-0 -translate-x-[12px]", "md:right-auto md:left-1/2 md:-translate-x-1/2", "-translate-y-[12px]", "flex items-center justify-center", "transition-opacity duration-200 ease-in-out", "data-[hidden=true]:pointer-events-none", "data-[hidden=true]:opacity-0 data-[hidden=false]:opacity-100", e),
|
|
1771
|
-
children: /* @__PURE__ */
|
|
1775
|
+
children: /* @__PURE__ */ R(_e, {
|
|
1772
1776
|
tooltip: n,
|
|
1773
1777
|
side: "top",
|
|
1774
|
-
children: /* @__PURE__ */
|
|
1778
|
+
children: /* @__PURE__ */ R(D, {
|
|
1775
1779
|
className: L("bg-paper-elevation-2", t),
|
|
1776
1780
|
color: "primary",
|
|
1777
1781
|
size: "md",
|
|
1778
1782
|
onClick: () => a(),
|
|
1779
1783
|
tabIndex: -1,
|
|
1780
1784
|
"aria-label": n,
|
|
1781
|
-
children: r || /* @__PURE__ */
|
|
1785
|
+
children: r || /* @__PURE__ */ R(xt, {})
|
|
1782
1786
|
})
|
|
1783
1787
|
})
|
|
1784
1788
|
});
|
|
@@ -1786,7 +1790,7 @@ var Qi = s(function({ className: e, buttonClassName: t, tooltip: n, children: r
|
|
|
1786
1790
|
//#endregion
|
|
1787
1791
|
//#region src/components/chat-message-attachment-card/chat-message-attachment-card.tsx
|
|
1788
1792
|
function $i({ className: e, children: t, isPreview: n, isInteractive: r = !0 }) {
|
|
1789
|
-
return /* @__PURE__ */
|
|
1793
|
+
return /* @__PURE__ */ R("div", {
|
|
1790
1794
|
role: "group",
|
|
1791
1795
|
"data-slot": "chat-message-attachment-card",
|
|
1792
1796
|
"data-testid": "chat-message-attachment-card",
|
|
@@ -1797,7 +1801,7 @@ function $i({ className: e, children: t, isPreview: n, isInteractive: r = !0 })
|
|
|
1797
1801
|
});
|
|
1798
1802
|
}
|
|
1799
1803
|
function ea({ className: e, children: t }) {
|
|
1800
|
-
return /* @__PURE__ */
|
|
1804
|
+
return /* @__PURE__ */ R("div", {
|
|
1801
1805
|
"data-slot": "chat-message-attachment-card-content",
|
|
1802
1806
|
"data-testid": "chat-message-attachment-card-content",
|
|
1803
1807
|
className: L("flex-1", "flex items-center", "overflow-hidden", e),
|
|
@@ -1805,7 +1809,7 @@ function ea({ className: e, children: t }) {
|
|
|
1805
1809
|
});
|
|
1806
1810
|
}
|
|
1807
1811
|
function ta({ className: e, children: t }) {
|
|
1808
|
-
return /* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ R(I, {
|
|
1809
1813
|
variant: "body-sm",
|
|
1810
1814
|
"data-slot": "chat-message-attachment-card-title",
|
|
1811
1815
|
"data-testid": "chat-message-attachment-card-title",
|
|
@@ -1814,11 +1818,11 @@ function ta({ className: e, children: t }) {
|
|
|
1814
1818
|
});
|
|
1815
1819
|
}
|
|
1816
1820
|
function na({ className: e, imageClassName: t, previewSrc: n }) {
|
|
1817
|
-
return /* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ R("figure", {
|
|
1818
1822
|
"data-slot": "chat-message-attachment-card-preview",
|
|
1819
1823
|
"data-testid": "chat-message-attachment-card-preview",
|
|
1820
1824
|
className: L("absolute top-0 left-0", "inset-0 w-full h-full", "overflow-hidden rounded-promptbox-attachment", "pointer-events-none", e),
|
|
1821
|
-
children: /* @__PURE__ */
|
|
1825
|
+
children: /* @__PURE__ */ R("img", {
|
|
1822
1826
|
"data-slot": "chat-message-attachment-card-preview-image",
|
|
1823
1827
|
src: n,
|
|
1824
1828
|
alt: "Preview",
|
|
@@ -1827,18 +1831,18 @@ function na({ className: e, imageClassName: t, previewSrc: n }) {
|
|
|
1827
1831
|
});
|
|
1828
1832
|
}
|
|
1829
1833
|
function ra({ className: e, buttonClassName: t, onDelete: n }) {
|
|
1830
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ R("div", {
|
|
1831
1835
|
role: "group",
|
|
1832
1836
|
"data-slot": "chat-message-attachment-card-actions",
|
|
1833
1837
|
"data-testid": "chat-message-attachment-card-actions",
|
|
1834
1838
|
className: L("absolute top-0 right-0", "translate-x-1/2 -translate-y-1/2", "hidden", "group-data-[interactive=true]/chat-message-attachment-card:group-hover/chat-message-attachment-card:flex", "rounded-overlay-tools-wrapper", "bg-overlay-tools-background-base", e),
|
|
1835
|
-
children: /* @__PURE__ */
|
|
1839
|
+
children: /* @__PURE__ */ R(D, {
|
|
1836
1840
|
variant: "tertiary",
|
|
1837
1841
|
isSemantic: !1,
|
|
1838
1842
|
onClick: n,
|
|
1839
1843
|
size: "xs",
|
|
1840
1844
|
className: L("size-[24px]", "text-icon-button-tertiary-icon", t),
|
|
1841
|
-
children: /* @__PURE__ */
|
|
1845
|
+
children: /* @__PURE__ */ R(Ct, {})
|
|
1842
1846
|
})
|
|
1843
1847
|
});
|
|
1844
1848
|
}
|
|
@@ -1846,38 +1850,38 @@ function ra({ className: e, buttonClassName: t, onDelete: n }) {
|
|
|
1846
1850
|
//#region src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx
|
|
1847
1851
|
var ia = {
|
|
1848
1852
|
spreadsheet: {
|
|
1849
|
-
component:
|
|
1853
|
+
component: Kt,
|
|
1850
1854
|
className: "bg-data-d"
|
|
1851
1855
|
},
|
|
1852
1856
|
pdf: {
|
|
1853
|
-
component:
|
|
1857
|
+
component: Vt,
|
|
1854
1858
|
className: "bg-data-a"
|
|
1855
1859
|
},
|
|
1856
1860
|
presentation: {
|
|
1857
|
-
component:
|
|
1861
|
+
component: Ht,
|
|
1858
1862
|
className: "bg-data-e"
|
|
1859
1863
|
},
|
|
1860
1864
|
document: {
|
|
1861
|
-
component:
|
|
1865
|
+
component: Et,
|
|
1862
1866
|
className: "bg-data-c"
|
|
1863
1867
|
},
|
|
1864
1868
|
code: {
|
|
1865
|
-
component:
|
|
1869
|
+
component: wt,
|
|
1866
1870
|
className: "bg-data-f"
|
|
1867
1871
|
},
|
|
1868
1872
|
unknown: {
|
|
1869
|
-
component:
|
|
1873
|
+
component: Dt,
|
|
1870
1874
|
className: "bg-data-f"
|
|
1871
1875
|
}
|
|
1872
1876
|
};
|
|
1873
1877
|
function aa({ icon: e, className: t, ...n }) {
|
|
1874
1878
|
let { component: r, className: i } = ia[e];
|
|
1875
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ R("span", {
|
|
1876
1880
|
"data-slot": "chat-message-attachment-card-icon",
|
|
1877
1881
|
"data-testid": "chat-attachment-icon",
|
|
1878
1882
|
"data-icon": e,
|
|
1879
1883
|
className: L("inline-flex items-center justify-center", "rounded-[8px]", "p-8", "size-promptbox-attachment-size-icon-container", "text-icon-fill-inverse", "[&_svg]:size-[24px]", i, t),
|
|
1880
|
-
children: /* @__PURE__ */
|
|
1884
|
+
children: /* @__PURE__ */ R(r, { ...n })
|
|
1881
1885
|
});
|
|
1882
1886
|
}
|
|
1883
1887
|
//#endregion
|
|
@@ -1896,7 +1900,7 @@ var oa = {
|
|
|
1896
1900
|
"application/vnd.oasis.opendocument.text": "document"
|
|
1897
1901
|
};
|
|
1898
1902
|
function sa(e) {
|
|
1899
|
-
let t =
|
|
1903
|
+
let t = qt.getType(e.name);
|
|
1900
1904
|
return t ? t in oa ? oa[t] : t.startsWith("text/") || t.includes("javascript") || t.includes("json") ? "code" : "unknown" : "unknown";
|
|
1901
1905
|
}
|
|
1902
1906
|
//#endregion
|
|
@@ -1910,14 +1914,14 @@ function la({ customComponents: e }) {
|
|
|
1910
1914
|
let t = p(() => Object.keys(e).filter((e) => ca(e) ? !0 : (console.warn(`[MarkdownViewer] Invalid custom component tag: ${e}`), !1)), [e]);
|
|
1911
1915
|
return {
|
|
1912
1916
|
components: e,
|
|
1913
|
-
remarkPlugins: p(() => [...Object.values(
|
|
1914
|
-
rehypePlugins: p(() => [...Object.values(
|
|
1915
|
-
...
|
|
1916
|
-
tagNames: [...
|
|
1917
|
+
remarkPlugins: p(() => [...Object.values(Xt)], []),
|
|
1918
|
+
rehypePlugins: p(() => [...Object.values(Yt), [Zt, {
|
|
1919
|
+
...Qt,
|
|
1920
|
+
tagNames: [...Qt?.tagNames || [], ...t],
|
|
1917
1921
|
protocols: {
|
|
1918
|
-
...
|
|
1922
|
+
...Qt?.protocols,
|
|
1919
1923
|
href: [
|
|
1920
|
-
...
|
|
1924
|
+
...Qt?.protocols?.href ?? [],
|
|
1921
1925
|
"swisper",
|
|
1922
1926
|
"swisper://"
|
|
1923
1927
|
]
|
|
@@ -1929,7 +1933,7 @@ function la({ customComponents: e }) {
|
|
|
1929
1933
|
//#region src/components/markdown-viewer/markdown-viewer.tsx
|
|
1930
1934
|
function ua({ markdown: e, className: t, isStreaming: n = !1, hasCaret: r = !1, customComponents: i = {} }) {
|
|
1931
1935
|
let { components: a, remarkPlugins: o, rehypePlugins: s } = la({ customComponents: i });
|
|
1932
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ R(Jt, {
|
|
1933
1937
|
className: t,
|
|
1934
1938
|
caret: r ? "block" : void 0,
|
|
1935
1939
|
isAnimating: n,
|
|
@@ -1968,7 +1972,7 @@ function da(e, t = "|") {
|
|
|
1968
1972
|
//#region src/components/chat-message-response/chat-message-response.tsx
|
|
1969
1973
|
function fa({ message: e, isStreaming: t }) {
|
|
1970
1974
|
let n = p(() => ({}), []);
|
|
1971
|
-
return /* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ R(ua, {
|
|
1972
1976
|
hasCaret: !1,
|
|
1973
1977
|
markdown: e,
|
|
1974
1978
|
isStreaming: t,
|
|
@@ -1978,7 +1982,7 @@ function fa({ message: e, isStreaming: t }) {
|
|
|
1978
1982
|
//#endregion
|
|
1979
1983
|
//#region src/components/chat-message-toolbar/chat-message-toolbar.tsx
|
|
1980
1984
|
function pa({ children: e, className: t, reverse: n = !1, ...r }) {
|
|
1981
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ R("div", {
|
|
1982
1986
|
"data-slot": "chat-message-toolbar",
|
|
1983
1987
|
"data-testid": "chat-message-toolbar",
|
|
1984
1988
|
"data-reverse": n,
|
|
@@ -1988,7 +1992,7 @@ function pa({ children: e, className: t, reverse: n = !1, ...r }) {
|
|
|
1988
1992
|
});
|
|
1989
1993
|
}
|
|
1990
1994
|
function ma({ children: e, className: t, ...n }) {
|
|
1991
|
-
return /* @__PURE__ */
|
|
1995
|
+
return /* @__PURE__ */ R("div", {
|
|
1992
1996
|
"data-slot": "chat-message-toolbar-actions",
|
|
1993
1997
|
"data-testid": "chat-message-toolbar-actions",
|
|
1994
1998
|
role: "group",
|
|
@@ -1998,7 +2002,7 @@ function ma({ children: e, className: t, ...n }) {
|
|
|
1998
2002
|
});
|
|
1999
2003
|
}
|
|
2000
2004
|
var ha = a(function({ children: e, className: t, tooltip: n, ...r }, i) {
|
|
2001
|
-
let a = /* @__PURE__ */
|
|
2005
|
+
let a = /* @__PURE__ */ R(D, {
|
|
2002
2006
|
ref: i,
|
|
2003
2007
|
variant: "tertiary",
|
|
2004
2008
|
isSemantic: !1,
|
|
@@ -2008,14 +2012,14 @@ var ha = a(function({ children: e, className: t, tooltip: n, ...r }, i) {
|
|
|
2008
2012
|
...r,
|
|
2009
2013
|
children: e
|
|
2010
2014
|
});
|
|
2011
|
-
return n ? /* @__PURE__ */
|
|
2015
|
+
return n ? /* @__PURE__ */ R(_e, {
|
|
2012
2016
|
tooltip: n,
|
|
2013
2017
|
children: a
|
|
2014
2018
|
}) : a;
|
|
2015
2019
|
});
|
|
2016
2020
|
ha.displayName = "ChatMessageToolbarActionButton";
|
|
2017
2021
|
function ga({ className: e, children: t, ...n }) {
|
|
2018
|
-
return /* @__PURE__ */
|
|
2022
|
+
return /* @__PURE__ */ R("div", {
|
|
2019
2023
|
"data-slot": "chat-message-toolbar-timestamp",
|
|
2020
2024
|
className: L("text-action-active", e),
|
|
2021
2025
|
...n,
|
|
@@ -2057,9 +2061,9 @@ function Ta({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
2057
2061
|
f,
|
|
2058
2062
|
m
|
|
2059
2063
|
]);
|
|
2060
|
-
return /* @__PURE__ */
|
|
2064
|
+
return /* @__PURE__ */ R(Ca.Provider, {
|
|
2061
2065
|
value: g,
|
|
2062
|
-
children: /* @__PURE__ */
|
|
2066
|
+
children: /* @__PURE__ */ z("div", {
|
|
2063
2067
|
role: "alert",
|
|
2064
2068
|
"data-slot": "chat-notification-card",
|
|
2065
2069
|
"data-testid": "chat-notification-card",
|
|
@@ -2068,7 +2072,7 @@ function Ta({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
2068
2072
|
"aria-expanded": d,
|
|
2069
2073
|
className: L("group/chat-notification-card", "relative", "p-[12px]", "rounded-[12px] overflow-hidden", "bg-paper-elevation-2", "flex flex-col gap-8", "bg-paper-elevation-2", "data-[variant=floating]:border data-[variant=floating]:border-component-divider", n),
|
|
2070
2074
|
onClick: s,
|
|
2071
|
-
children: [e, /* @__PURE__ */
|
|
2075
|
+
children: [e, /* @__PURE__ */ R("div", {
|
|
2072
2076
|
"data-slot": "chat-notification-card-overlay",
|
|
2073
2077
|
className: L("absolute inset-0 pointer-events-none bg-secondary-states-hover opacity-0 group-hover/chat-notification-card:opacity-100 transition-opacity duration-200 ease-in-out", r)
|
|
2074
2078
|
})]
|
|
@@ -2076,7 +2080,7 @@ function Ta({ children: e, variant: t = "default", className: n, overlayClassNam
|
|
|
2076
2080
|
});
|
|
2077
2081
|
}
|
|
2078
2082
|
function Ea({ children: e, className: t }) {
|
|
2079
|
-
return /* @__PURE__ */
|
|
2083
|
+
return /* @__PURE__ */ R("header", {
|
|
2080
2084
|
"data-slot": "chat-notification-card-head",
|
|
2081
2085
|
"data-testid": "chat-notification-card-head",
|
|
2082
2086
|
className: L("grid grid-cols-[minmax(0,1fr)_auto] items-center gap-8", "min-h-[32px]", t),
|
|
@@ -2084,7 +2088,7 @@ function Ea({ children: e, className: t }) {
|
|
|
2084
2088
|
});
|
|
2085
2089
|
}
|
|
2086
2090
|
function Da({ children: e, className: t }) {
|
|
2087
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ R("div", {
|
|
2088
2092
|
"data-slot": "chat-notification-card-header",
|
|
2089
2093
|
"data-testid": "chat-notification-card-header",
|
|
2090
2094
|
className: L("min-w-0 flex items-center gap-8 overflow-hidden", "text-layout-feedback-info-background-default", t),
|
|
@@ -2092,7 +2096,7 @@ function Da({ children: e, className: t }) {
|
|
|
2092
2096
|
});
|
|
2093
2097
|
}
|
|
2094
2098
|
function Oa({ children: e, className: t }) {
|
|
2095
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ R("div", {
|
|
2096
2100
|
"data-slot": "chat-notification-card-header-icon",
|
|
2097
2101
|
"data-testid": "chat-notification-card-header-icon",
|
|
2098
2102
|
className: L("shrink-0", "inline-flex items-center justify-center", "pointer-events-none", "[&_svg]:size-[20px]!", t),
|
|
@@ -2100,7 +2104,7 @@ function Oa({ children: e, className: t }) {
|
|
|
2100
2104
|
});
|
|
2101
2105
|
}
|
|
2102
2106
|
function ka({ children: e, className: t }) {
|
|
2103
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ R("div", {
|
|
2104
2108
|
"data-slot": "chat-notification-card-header-title",
|
|
2105
2109
|
"data-testid": "chat-notification-card-header-title",
|
|
2106
2110
|
className: L("min-w-0 flex flex-1 items-center gap-8 overflow-hidden", t),
|
|
@@ -2108,14 +2112,14 @@ function ka({ children: e, className: t }) {
|
|
|
2108
2112
|
});
|
|
2109
2113
|
}
|
|
2110
2114
|
function Aa({ children: e, className: t }) {
|
|
2111
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ R(I, {
|
|
2112
2116
|
variant: "body-sm",
|
|
2113
2117
|
fontWeight: "semibold",
|
|
2114
2118
|
"data-slot": "chat-notification-card-header-title-label",
|
|
2115
2119
|
"data-testid": "chat-notification-card-header-title-label",
|
|
2116
2120
|
className: L("min-w-0 truncate", "text-left text-inherit uppercase", t),
|
|
2117
2121
|
asChild: !0,
|
|
2118
|
-
children: /* @__PURE__ */
|
|
2122
|
+
children: /* @__PURE__ */ R("span", { children: e })
|
|
2119
2123
|
});
|
|
2120
2124
|
}
|
|
2121
2125
|
var ja = {
|
|
@@ -2125,7 +2129,7 @@ var ja = {
|
|
|
2125
2129
|
};
|
|
2126
2130
|
function Ma({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
2127
2131
|
let i = ja[t];
|
|
2128
|
-
return t === "low" ? null : /* @__PURE__ */
|
|
2132
|
+
return t === "low" ? null : /* @__PURE__ */ R(_, {
|
|
2129
2133
|
"data-slot": "chat-notification-card-header-status",
|
|
2130
2134
|
"data-testid": "chat-notification-card-header-status",
|
|
2131
2135
|
"data-priority": t,
|
|
@@ -2138,7 +2142,7 @@ function Ma({ children: e, priority: t = "medium", className: n, ...r }) {
|
|
|
2138
2142
|
});
|
|
2139
2143
|
}
|
|
2140
2144
|
function Na({ children: e, className: t }) {
|
|
2141
|
-
return /* @__PURE__ */
|
|
2145
|
+
return /* @__PURE__ */ R("div", {
|
|
2142
2146
|
"data-slot": "chat-notification-card-actions",
|
|
2143
2147
|
"data-testid": "chat-notification-card-actions",
|
|
2144
2148
|
role: "group",
|
|
@@ -2147,13 +2151,13 @@ function Na({ children: e, className: t }) {
|
|
|
2147
2151
|
});
|
|
2148
2152
|
}
|
|
2149
2153
|
function Pa({ children: e, className: t }) {
|
|
2150
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ R(I, {
|
|
2151
2155
|
variant: "caption",
|
|
2152
2156
|
"data-slot": "chat-notification-card-timestamp",
|
|
2153
2157
|
"data-testid": "chat-notification-card-timestamp",
|
|
2154
2158
|
className: L("text-text-secondary", "inline-flex px-8", "leading-[32px]", t),
|
|
2155
2159
|
asChild: !0,
|
|
2156
|
-
children: /* @__PURE__ */
|
|
2160
|
+
children: /* @__PURE__ */ R("span", { children: e })
|
|
2157
2161
|
});
|
|
2158
2162
|
}
|
|
2159
2163
|
function Fa({ children: e, className: t }) {
|
|
@@ -2163,7 +2167,7 @@ function Fa({ children: e, className: t }) {
|
|
|
2163
2167
|
function r(e) {
|
|
2164
2168
|
e.stopPropagation();
|
|
2165
2169
|
}
|
|
2166
|
-
return /* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ R("div", {
|
|
2167
2171
|
"data-slot": "chat-notification-card-buttons",
|
|
2168
2172
|
"data-testid": "chat-notification-card-buttons",
|
|
2169
2173
|
role: "group",
|
|
@@ -2177,7 +2181,7 @@ var Ia = a(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
|
2177
2181
|
function a() {
|
|
2178
2182
|
n?.(!t);
|
|
2179
2183
|
}
|
|
2180
|
-
return /* @__PURE__ */
|
|
2184
|
+
return /* @__PURE__ */ R(D, {
|
|
2181
2185
|
ref: i,
|
|
2182
2186
|
"data-slot": "chat-notification-card-read-action-button",
|
|
2183
2187
|
"data-read": t,
|
|
@@ -2187,7 +2191,7 @@ var Ia = a(function({ className: e, isRead: t = !1, onRead: n, ...r }, i) {
|
|
|
2187
2191
|
className: e,
|
|
2188
2192
|
onClick: a,
|
|
2189
2193
|
...r,
|
|
2190
|
-
children:
|
|
2194
|
+
children: R(t ? Wt : Ut, {})
|
|
2191
2195
|
});
|
|
2192
2196
|
});
|
|
2193
2197
|
Ia.displayName = "ChatNotificationCardReadActionButton";
|
|
@@ -2205,12 +2209,12 @@ var La = a(function({ className: e, labelClassName: t, cancelLabelClassName: n,
|
|
|
2205
2209
|
function b() {
|
|
2206
2210
|
m(!1), o?.();
|
|
2207
2211
|
}
|
|
2208
|
-
return _ ? /* @__PURE__ */
|
|
2212
|
+
return _ ? /* @__PURE__ */ z(g, {
|
|
2209
2213
|
ref: f,
|
|
2210
2214
|
"data-slot": "chat-notification-card-snooze-button",
|
|
2211
2215
|
"data-snoozed": "true",
|
|
2212
2216
|
"data-hover": p,
|
|
2213
|
-
startIcon:
|
|
2217
|
+
startIcon: R(p ? Ct : Gt, {}),
|
|
2214
2218
|
variant: "tertiary",
|
|
2215
2219
|
size: "md",
|
|
2216
2220
|
onMouseEnter: v,
|
|
@@ -2218,16 +2222,16 @@ var La = a(function({ className: e, labelClassName: t, cancelLabelClassName: n,
|
|
|
2218
2222
|
onClick: b,
|
|
2219
2223
|
className: L("group/snooze-button", "text-chip-outlined-warning-text h-[32px]!", e),
|
|
2220
2224
|
...d,
|
|
2221
|
-
children: [/* @__PURE__ */
|
|
2225
|
+
children: [/* @__PURE__ */ R("span", {
|
|
2222
2226
|
"data-slot": "chat-notification-card-snooze-button-label",
|
|
2223
2227
|
className: L("group-data-[hover=true]/snooze-button:opacity-0", "transition-opacity duration-200 ease-in-out", t),
|
|
2224
2228
|
children: a(r)
|
|
2225
|
-
}), /* @__PURE__ */
|
|
2229
|
+
}), /* @__PURE__ */ R("span", {
|
|
2226
2230
|
"data-slot": "chat-notification-card-snooze-button-cancel-label",
|
|
2227
2231
|
className: L("absolute left-0 w-full text-center pl-[16px]", "transition-opacity duration-200 ease-in-out", "opacity-0", "group-data-[hover=true]/snooze-button:opacity-100", n),
|
|
2228
2232
|
children: i
|
|
2229
2233
|
})]
|
|
2230
|
-
}) : /* @__PURE__ */
|
|
2234
|
+
}) : /* @__PURE__ */ R(D, {
|
|
2231
2235
|
ref: f,
|
|
2232
2236
|
"data-slot": "chat-notification-card-snooze-button",
|
|
2233
2237
|
"data-snoozed": "false",
|
|
@@ -2237,12 +2241,12 @@ var La = a(function({ className: e, labelClassName: t, cancelLabelClassName: n,
|
|
|
2237
2241
|
className: L("group/snooze-button", e),
|
|
2238
2242
|
onClick: s,
|
|
2239
2243
|
...d,
|
|
2240
|
-
children: /* @__PURE__ */
|
|
2244
|
+
children: /* @__PURE__ */ R(Gt, {})
|
|
2241
2245
|
});
|
|
2242
2246
|
});
|
|
2243
2247
|
La.displayName = "ChatNotificationCardSnoozeButton";
|
|
2244
2248
|
var Ra = a(function({ className: e, ...t }, n) {
|
|
2245
|
-
return /* @__PURE__ */
|
|
2249
|
+
return /* @__PURE__ */ R(D, {
|
|
2246
2250
|
ref: n,
|
|
2247
2251
|
"data-slot": "chat-notification-card-delete-button",
|
|
2248
2252
|
"aria-label": "Delete notification",
|
|
@@ -2250,12 +2254,12 @@ var Ra = a(function({ className: e, ...t }, n) {
|
|
|
2250
2254
|
variant: "tertiary",
|
|
2251
2255
|
className: e,
|
|
2252
2256
|
...t,
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2257
|
+
children: /* @__PURE__ */ R(Tt, {})
|
|
2254
2258
|
});
|
|
2255
2259
|
});
|
|
2256
2260
|
Ra.displayName = "ChatNotificationCardDeleteButton";
|
|
2257
2261
|
var za = a(function({ className: e, ...t }, n) {
|
|
2258
|
-
return /* @__PURE__ */
|
|
2262
|
+
return /* @__PURE__ */ R(D, {
|
|
2259
2263
|
ref: n,
|
|
2260
2264
|
"data-slot": "chat-notification-card-close-button",
|
|
2261
2265
|
"aria-label": "Close notification",
|
|
@@ -2263,41 +2267,41 @@ var za = a(function({ className: e, ...t }, n) {
|
|
|
2263
2267
|
variant: "tertiary",
|
|
2264
2268
|
className: e,
|
|
2265
2269
|
...t,
|
|
2266
|
-
children: /* @__PURE__ */
|
|
2270
|
+
children: /* @__PURE__ */ R(Ct, {})
|
|
2267
2271
|
});
|
|
2268
2272
|
});
|
|
2269
2273
|
za.displayName = "ChatNotificationCardCloseButton";
|
|
2270
2274
|
function Ba({ children: e, className: t }) {
|
|
2271
|
-
return /* @__PURE__ */
|
|
2275
|
+
return /* @__PURE__ */ z("div", {
|
|
2272
2276
|
"data-slot": "chat-notification-card-content",
|
|
2273
2277
|
"data-testid": "chat-notification-card-content",
|
|
2274
2278
|
className: L("flex flex-col items-start text-left gap-4", "relative pr-[40px]", t),
|
|
2275
|
-
children: [e, /* @__PURE__ */
|
|
2279
|
+
children: [e, /* @__PURE__ */ R(Wa, {})]
|
|
2276
2280
|
});
|
|
2277
2281
|
}
|
|
2278
2282
|
function Va({ children: e, className: t }) {
|
|
2279
|
-
return /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ R(I, {
|
|
2280
2284
|
variant: "body-sm",
|
|
2281
2285
|
fontWeight: "semibold",
|
|
2282
2286
|
"data-slot": "chat-notification-card-content-title",
|
|
2283
2287
|
"data-testid": "chat-notification-card-content-title",
|
|
2284
2288
|
className: L("text-text-primary", "text-left", t),
|
|
2285
2289
|
asChild: !0,
|
|
2286
|
-
children: /* @__PURE__ */
|
|
2290
|
+
children: /* @__PURE__ */ R("span", { children: e })
|
|
2287
2291
|
});
|
|
2288
2292
|
}
|
|
2289
2293
|
function Ha({ children: e, className: t }) {
|
|
2290
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ R(I, {
|
|
2291
2295
|
variant: "body-sm",
|
|
2292
2296
|
"data-slot": "chat-notification-card-content-description",
|
|
2293
2297
|
"data-testid": "chat-notification-card-content-description",
|
|
2294
2298
|
className: L("text-text-primary", "mt-8", "group-data-[expanded=false]/chat-notification-card:line-clamp-2", "w-full [&>div>*]:wrap-break-word", t),
|
|
2295
2299
|
asChild: !0,
|
|
2296
|
-
children: /* @__PURE__ */
|
|
2300
|
+
children: /* @__PURE__ */ R("div", { children: e })
|
|
2297
2301
|
});
|
|
2298
2302
|
}
|
|
2299
2303
|
function Ua({ children: e, className: t }) {
|
|
2300
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ R("div", {
|
|
2301
2305
|
"data-slot": "chat-notification-card-content-actions",
|
|
2302
2306
|
"data-testid": "chat-notification-card-content-actions",
|
|
2303
2307
|
role: "group",
|
|
@@ -2313,7 +2317,7 @@ var Wa = a(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
|
2313
2317
|
function c(e) {
|
|
2314
2318
|
e.stopPropagation(), o(), n?.(e);
|
|
2315
2319
|
}
|
|
2316
|
-
return /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ R(D, {
|
|
2317
2321
|
ref: i,
|
|
2318
2322
|
"data-slot": "chat-notification-card-expand-button",
|
|
2319
2323
|
"data-testid": "chat-notification-card-expand-button",
|
|
@@ -2324,7 +2328,7 @@ var Wa = a(function({ className: e, onMouseDown: t, onClick: n, ...r }, i) {
|
|
|
2324
2328
|
onMouseDown: s,
|
|
2325
2329
|
onClick: c,
|
|
2326
2330
|
...r,
|
|
2327
|
-
children:
|
|
2331
|
+
children: R(a ? St : xt, {})
|
|
2328
2332
|
});
|
|
2329
2333
|
});
|
|
2330
2334
|
Wa.displayName = "ChatNotificationCardExpandButton";
|
|
@@ -2332,13 +2336,13 @@ var Ga = Oa, Ka = Ha, qa = Pa;
|
|
|
2332
2336
|
//#endregion
|
|
2333
2337
|
//#region src/components/chat-notification-popup/chat-notification-popup.tsx
|
|
2334
2338
|
function Ja({ children: e, ...t }) {
|
|
2335
|
-
return /* @__PURE__ */
|
|
2339
|
+
return /* @__PURE__ */ R(de, {
|
|
2336
2340
|
...t,
|
|
2337
2341
|
children: e
|
|
2338
2342
|
});
|
|
2339
2343
|
}
|
|
2340
2344
|
var Ya = a(function({ children: e, ...t }, n) {
|
|
2341
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ R(pe, {
|
|
2342
2346
|
ref: n,
|
|
2343
2347
|
"data-slot": "chat-notification-popup-trigger",
|
|
2344
2348
|
...t,
|
|
@@ -2347,7 +2351,7 @@ var Ya = a(function({ children: e, ...t }, n) {
|
|
|
2347
2351
|
});
|
|
2348
2352
|
Ya.displayName = "ChatNotificationPopupTrigger";
|
|
2349
2353
|
var Xa = a(function({ children: e, className: t, ...n }, r) {
|
|
2350
|
-
return /* @__PURE__ */
|
|
2354
|
+
return /* @__PURE__ */ R(fe, {
|
|
2351
2355
|
ref: r,
|
|
2352
2356
|
"data-slot": "chat-notification-popup-content",
|
|
2353
2357
|
className: L("md:w-[467px]", t),
|
|
@@ -2359,7 +2363,7 @@ Xa.displayName = "ChatNotificationPopupContent";
|
|
|
2359
2363
|
//#endregion
|
|
2360
2364
|
//#region src/components/chat-reply/chat-reply.tsx
|
|
2361
2365
|
function Za({ className: e, children: t, hasPadding: n = !0 }) {
|
|
2362
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ R("ul", {
|
|
2363
2367
|
"data-testid": "chat-replies",
|
|
2364
2368
|
"data-slot": "chat-replies",
|
|
2365
2369
|
"data-padding": n,
|
|
@@ -2368,7 +2372,7 @@ function Za({ className: e, children: t, hasPadding: n = !0 }) {
|
|
|
2368
2372
|
});
|
|
2369
2373
|
}
|
|
2370
2374
|
function Qa({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
2371
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ R("li", {
|
|
2372
2376
|
"data-testid": "chat-reply",
|
|
2373
2377
|
"data-slot": "chat-reply",
|
|
2374
2378
|
"data-multiline": n,
|
|
@@ -2378,7 +2382,7 @@ function Qa({ className: e, children: t, isMultiline: n = !1, ...r }) {
|
|
|
2378
2382
|
});
|
|
2379
2383
|
}
|
|
2380
2384
|
function $a({ className: e, children: t, ...n }) {
|
|
2381
|
-
return /* @__PURE__ */
|
|
2385
|
+
return /* @__PURE__ */ R(_, {
|
|
2382
2386
|
variant: "outlined",
|
|
2383
2387
|
size: "sm",
|
|
2384
2388
|
color: "secondary",
|
|
@@ -2390,14 +2394,14 @@ function $a({ className: e, children: t, ...n }) {
|
|
|
2390
2394
|
});
|
|
2391
2395
|
}
|
|
2392
2396
|
function eo({ className: e, children: t, asChild: n = !1, ...r }) {
|
|
2393
|
-
return /* @__PURE__ */
|
|
2397
|
+
return /* @__PURE__ */ R(I, {
|
|
2394
2398
|
"data-testid": "chat-reply-value",
|
|
2395
2399
|
"data-slot": "chat-reply-value",
|
|
2396
2400
|
variant: "body-sm",
|
|
2397
2401
|
className: L("leading-[24px]", "flex flex-1 min-w-0 text-text-secondary", "items-start", "group-data-[multiline=false]/chat-reply:flex-1 truncate", "group-data-[multiline=true]/chat-reply:flex-wrap", "group-data-[multiline=true]/chat-reply:gap-4", e),
|
|
2398
2402
|
asChild: !0,
|
|
2399
2403
|
...r,
|
|
2400
|
-
children: /* @__PURE__ */
|
|
2404
|
+
children: /* @__PURE__ */ R("div", { children: t })
|
|
2401
2405
|
});
|
|
2402
2406
|
}
|
|
2403
2407
|
//#endregion
|
|
@@ -2409,12 +2413,12 @@ function no() {
|
|
|
2409
2413
|
return e;
|
|
2410
2414
|
}
|
|
2411
2415
|
var ro = a(function({ children: e, className: t, hasLoop: i = !0, ...a }, s) {
|
|
2412
|
-
return /* @__PURE__ */
|
|
2416
|
+
return /* @__PURE__ */ R(te, {
|
|
2413
2417
|
asChild: !0,
|
|
2414
2418
|
hasLoop: i,
|
|
2415
2419
|
ref: s,
|
|
2416
2420
|
...a,
|
|
2417
|
-
children: /* @__PURE__ */
|
|
2421
|
+
children: /* @__PURE__ */ R("ol", {
|
|
2418
2422
|
"data-slot": "chat-suggestions",
|
|
2419
2423
|
"data-testid": "chat-suggestions",
|
|
2420
2424
|
className: L("m-0 p-0 list-none flex flex-col items-stretch gap-0", t),
|
|
@@ -2428,51 +2432,51 @@ var io = a(function({ index: e, children: t, className: n, triggerClassName: r,
|
|
|
2428
2432
|
function l(e) {
|
|
2429
2433
|
a?.(e), i?.();
|
|
2430
2434
|
}
|
|
2431
|
-
return /* @__PURE__ */
|
|
2435
|
+
return /* @__PURE__ */ R(to.Provider, {
|
|
2432
2436
|
value: c,
|
|
2433
|
-
children: /* @__PURE__ */
|
|
2437
|
+
children: /* @__PURE__ */ z(O, {
|
|
2434
2438
|
ref: s,
|
|
2435
2439
|
"data-slot": "chat-suggestion",
|
|
2436
|
-
className:
|
|
2440
|
+
className: ve(L("relative items-start gap-0 p-4 text-typography-text-secondary", n), { highlighted: "bg-layout-accent-low-background-hover-default" }),
|
|
2437
2441
|
...o,
|
|
2438
2442
|
onMouseEnter: l,
|
|
2439
|
-
children: [/* @__PURE__ */
|
|
2443
|
+
children: [/* @__PURE__ */ R(j, { className: L("absolute inset-0 rounded-[inherit] outline-none", r) }), t]
|
|
2440
2444
|
})
|
|
2441
2445
|
});
|
|
2442
2446
|
});
|
|
2443
2447
|
io.displayName = "ChatSuggestion";
|
|
2444
2448
|
function ao({ children: e, className: t, innerClassName: n }) {
|
|
2445
2449
|
let { index: r = 0 } = no();
|
|
2446
|
-
return /* @__PURE__ */
|
|
2450
|
+
return /* @__PURE__ */ R("span", {
|
|
2447
2451
|
"aria-hidden": "true",
|
|
2448
2452
|
"data-slot": "chat-suggestion-label-icon",
|
|
2449
2453
|
className: L("inline-flex flex-row justify-center items-center shrink-0 size-auto text-inherit", t),
|
|
2450
|
-
children: /* @__PURE__ */
|
|
2454
|
+
children: /* @__PURE__ */ R("span", {
|
|
2451
2455
|
"aria-hidden": "true",
|
|
2452
2456
|
"data-slot": "chat-suggestion-label-icon-inner",
|
|
2453
2457
|
className: L("size-[32px]", "inline-flex items-center justify-center", "px-8 py-[7px]", "[&_svg]:size-[18px]!", n),
|
|
2454
|
-
children: e || /* @__PURE__ */
|
|
2458
|
+
children: e || /* @__PURE__ */ R(N, { children: /* @__PURE__ */ R(I, {
|
|
2455
2459
|
variant: "caption-md",
|
|
2456
2460
|
fontWeight: "semibold",
|
|
2457
2461
|
className: "text-inherit",
|
|
2458
2462
|
asChild: !0,
|
|
2459
|
-
children: /* @__PURE__ */
|
|
2463
|
+
children: /* @__PURE__ */ R("span", { children: r + 1 })
|
|
2460
2464
|
}) })
|
|
2461
2465
|
})
|
|
2462
2466
|
});
|
|
2463
2467
|
}
|
|
2464
2468
|
function oo({ children: e, className: t, isMultiline: n = !0 }) {
|
|
2465
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ R(I, {
|
|
2466
2470
|
variant: "body-small-low",
|
|
2467
2471
|
"data-slot": "chat-suggestion-label",
|
|
2468
2472
|
"data-multiline": n,
|
|
2469
2473
|
className: L("gap-0 px-4 my-[7px]", "h-full min-w-0 flex-1 items-center justify-center text-left text-inherit", "data-[multiline=false]:truncate", "data-[multiline=true]:line-clamp-3", t),
|
|
2470
2474
|
asChild: !0,
|
|
2471
|
-
children: /* @__PURE__ */
|
|
2475
|
+
children: /* @__PURE__ */ R(A, { children: e })
|
|
2472
2476
|
});
|
|
2473
2477
|
}
|
|
2474
2478
|
function so({ children: e, className: t }) {
|
|
2475
|
-
return /* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ R("div", {
|
|
2476
2480
|
role: "group",
|
|
2477
2481
|
"data-slot": "chat-suggestion-actions",
|
|
2478
2482
|
className: L("shrink-0 flex items-center justify-center gap-8", "self-start", "min-w-[32px] h-[32px]", "pointer-events-none", "*:text-secondary-main", "[&>svg]:size-[18px]!", "opacity-0", "group-data-highlighted/list-item:opacity-100", t),
|
|
@@ -2480,7 +2484,7 @@ function so({ children: e, className: t }) {
|
|
|
2480
2484
|
});
|
|
2481
2485
|
}
|
|
2482
2486
|
var co = a(function({ className: e, children: t, ...n }, r) {
|
|
2483
|
-
return /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ R(k, {
|
|
2484
2488
|
ref: r,
|
|
2485
2489
|
className: L("pointer-events-auto", e),
|
|
2486
2490
|
...n,
|
|
@@ -2497,7 +2501,7 @@ function lo(e, t) {
|
|
|
2497
2501
|
}));
|
|
2498
2502
|
return n.displayName = t, n;
|
|
2499
2503
|
}
|
|
2500
|
-
var uo = lo(
|
|
2504
|
+
var uo = lo(K.Viewport, "ChatThreadViewportPrimitive"), fo = lo(K.Content, "ChatThreadContentPrimitive"), po = lo(K.Item, "ChatThreadItemPrimitive");
|
|
2501
2505
|
function mo(e, t) {
|
|
2502
2506
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
2503
2507
|
}
|
|
@@ -2510,7 +2514,7 @@ function yo() {
|
|
|
2510
2514
|
return l(vo) ?? _o;
|
|
2511
2515
|
}
|
|
2512
2516
|
function bo({ children: e }) {
|
|
2513
|
-
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } =
|
|
2517
|
+
let { scrollToEnd: t, scrollToMessage: n, scrollToStart: r } = $t(), i = p(() => ({
|
|
2514
2518
|
scrollToEnd: t,
|
|
2515
2519
|
scrollToMessage: n,
|
|
2516
2520
|
scrollToStart: r
|
|
@@ -2519,7 +2523,7 @@ function bo({ children: e }) {
|
|
|
2519
2523
|
n,
|
|
2520
2524
|
r
|
|
2521
2525
|
]);
|
|
2522
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ R(vo.Provider, {
|
|
2523
2527
|
value: i,
|
|
2524
2528
|
children: e
|
|
2525
2529
|
});
|
|
@@ -2551,23 +2555,23 @@ function wo({ children: e, conversationId: t, groupIds: n, isStreaming: r = !1,
|
|
|
2551
2555
|
i,
|
|
2552
2556
|
f
|
|
2553
2557
|
]);
|
|
2554
|
-
return /* @__PURE__ */
|
|
2558
|
+
return /* @__PURE__ */ R(K.Provider, {
|
|
2555
2559
|
autoScroll: a,
|
|
2556
2560
|
scrollPreviousItemPeek: s,
|
|
2557
2561
|
scrollMargin: c,
|
|
2558
2562
|
defaultScrollPosition: o,
|
|
2559
2563
|
...l,
|
|
2560
|
-
children: /* @__PURE__ */
|
|
2564
|
+
children: /* @__PURE__ */ z(xo.Provider, {
|
|
2561
2565
|
value: m,
|
|
2562
|
-
children: [i === "follow" && /* @__PURE__ */
|
|
2566
|
+
children: [i === "follow" && /* @__PURE__ */ R(To, {
|
|
2563
2567
|
groupIds: n,
|
|
2564
2568
|
knownGroupIds: f
|
|
2565
|
-
}), /* @__PURE__ */
|
|
2569
|
+
}), /* @__PURE__ */ R(bo, { children: e })]
|
|
2566
2570
|
})
|
|
2567
2571
|
}, u.id);
|
|
2568
2572
|
}
|
|
2569
2573
|
function To({ groupIds: e, knownGroupIds: t }) {
|
|
2570
|
-
let { scrollToEnd: n } =
|
|
2574
|
+
let { scrollToEnd: n } = $t(), r = e.at(-1);
|
|
2571
2575
|
return f(() => {
|
|
2572
2576
|
r === void 0 || t === null || t.has(r) || n({ behavior: "auto" });
|
|
2573
2577
|
}, [
|
|
@@ -2582,7 +2586,7 @@ var Eo = a(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2582
2586
|
}, [i, g]), w = c((e) => {
|
|
2583
2587
|
S.current = e, mo(a, e);
|
|
2584
2588
|
}, [a]);
|
|
2585
|
-
return Do(x, S, v, b), /* @__PURE__ */
|
|
2589
|
+
return Do(x, S, v, b), /* @__PURE__ */ z(K.Root, {
|
|
2586
2590
|
"data-slot": "chat-thread",
|
|
2587
2591
|
"data-testid": "chat-thread",
|
|
2588
2592
|
"data-scroll-mode": y,
|
|
@@ -2592,7 +2596,7 @@ var Eo = a(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2592
2596
|
className: L("relative flex flex-col flex-1 min-h-0 overflow-hidden", t),
|
|
2593
2597
|
...h,
|
|
2594
2598
|
children: [
|
|
2595
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ R(uo, {
|
|
2596
2600
|
ref: C,
|
|
2597
2601
|
"data-slot": "chat-thread-viewport",
|
|
2598
2602
|
"aria-label": "Chat message history",
|
|
@@ -2602,7 +2606,7 @@ var Eo = a(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2602
2606
|
scrollbarWidth: "thin",
|
|
2603
2607
|
scrollbarColor: "var(--color-scrollbar-thumb) transparent"
|
|
2604
2608
|
},
|
|
2605
|
-
children: /* @__PURE__ */
|
|
2609
|
+
children: /* @__PURE__ */ R(fo, {
|
|
2606
2610
|
ref: w,
|
|
2607
2611
|
"data-slot": "chat-thread-content",
|
|
2608
2612
|
"aria-busy": _,
|
|
@@ -2611,11 +2615,11 @@ var Eo = a(function({ children: e, className: t, viewportClassName: n, contentCl
|
|
|
2611
2615
|
children: e
|
|
2612
2616
|
})
|
|
2613
2617
|
}),
|
|
2614
|
-
d && !u && /* @__PURE__ */
|
|
2618
|
+
d && !u && /* @__PURE__ */ R(Mo, {
|
|
2615
2619
|
error: f,
|
|
2616
2620
|
children: p?.(f)
|
|
2617
2621
|
}),
|
|
2618
|
-
o && /* @__PURE__ */
|
|
2622
|
+
o && /* @__PURE__ */ R(jo, {
|
|
2619
2623
|
className: s,
|
|
2620
2624
|
tooltip: l
|
|
2621
2625
|
})
|
|
@@ -2647,7 +2651,7 @@ function Do(e, t, n, r) {
|
|
|
2647
2651
|
}
|
|
2648
2652
|
var Oo = a(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
2649
2653
|
let { knownGroupIds: a, scrollMode: o } = So("ChatThreadGroup"), s = o === "anchor" && a !== null && !a.has(e);
|
|
2650
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ R(po, {
|
|
2651
2655
|
ref: i,
|
|
2652
2656
|
messageId: `chat-thread-group-${e}`,
|
|
2653
2657
|
scrollAnchor: s,
|
|
@@ -2660,7 +2664,7 @@ var Oo = a(function({ groupId: e, className: t, children: n, ...r }, i) {
|
|
|
2660
2664
|
});
|
|
2661
2665
|
Oo.displayName = "ChatThreadGroup";
|
|
2662
2666
|
var ko = a(function({ messageId: e, children: t, ...n }, r) {
|
|
2663
|
-
return /* @__PURE__ */
|
|
2667
|
+
return /* @__PURE__ */ R("div", {
|
|
2664
2668
|
ref: r,
|
|
2665
2669
|
"data-slot": "chat-thread-question",
|
|
2666
2670
|
"data-chat-thread-question": "",
|
|
@@ -2671,7 +2675,7 @@ var ko = a(function({ messageId: e, children: t, ...n }, r) {
|
|
|
2671
2675
|
});
|
|
2672
2676
|
ko.displayName = "ChatThreadQuestion";
|
|
2673
2677
|
var Ao = a(function({ messageId: e, children: t, ...n }, r) {
|
|
2674
|
-
return /* @__PURE__ */
|
|
2678
|
+
return /* @__PURE__ */ R("div", {
|
|
2675
2679
|
ref: r,
|
|
2676
2680
|
"data-slot": "chat-thread-answer",
|
|
2677
2681
|
"data-chat-thread-answer": "",
|
|
@@ -2682,19 +2686,19 @@ var Ao = a(function({ messageId: e, children: t, ...n }, r) {
|
|
|
2682
2686
|
});
|
|
2683
2687
|
Ao.displayName = "ChatThreadAnswer";
|
|
2684
2688
|
function jo({ className: e, tooltip: t }) {
|
|
2685
|
-
let { end: n } =
|
|
2686
|
-
return /* @__PURE__ */
|
|
2689
|
+
let { end: n } = en();
|
|
2690
|
+
return /* @__PURE__ */ R("div", {
|
|
2687
2691
|
"data-slot": "chat-thread-scroll-button",
|
|
2688
2692
|
"data-testid": "chat-message-history-scroll-button",
|
|
2689
2693
|
"data-hidden": !n,
|
|
2690
2694
|
"aria-hidden": !n || void 0,
|
|
2691
2695
|
className: L("absolute", "px-[12px]", "bottom-0", "right-0 -translate-x-[12px]", "md:right-auto md:left-1/2 md:-translate-x-1/2", "-translate-y-[12px]", "flex items-center justify-center", "transition-opacity duration-200 ease-in-out", "data-[hidden=true]:pointer-events-none", "data-[hidden=true]:opacity-0 data-[hidden=false]:opacity-100", e),
|
|
2692
|
-
children: /* @__PURE__ */
|
|
2696
|
+
children: /* @__PURE__ */ R(K.Button, {
|
|
2693
2697
|
direction: "end",
|
|
2694
|
-
render: ({ inert: e, children: n, ...r }) => /* @__PURE__ */
|
|
2698
|
+
render: ({ inert: e, children: n, ...r }) => /* @__PURE__ */ R(_e, {
|
|
2695
2699
|
tooltip: t,
|
|
2696
2700
|
side: "top",
|
|
2697
|
-
children: /* @__PURE__ */
|
|
2701
|
+
children: /* @__PURE__ */ R(D, {
|
|
2698
2702
|
...r,
|
|
2699
2703
|
inert: e ? "" : void 0,
|
|
2700
2704
|
className: "bg-paper-elevation-2",
|
|
@@ -2702,21 +2706,21 @@ function jo({ className: e, tooltip: t }) {
|
|
|
2702
2706
|
size: "md",
|
|
2703
2707
|
tabIndex: -1,
|
|
2704
2708
|
"aria-label": t,
|
|
2705
|
-
children: /* @__PURE__ */
|
|
2709
|
+
children: /* @__PURE__ */ R(xt, {})
|
|
2706
2710
|
})
|
|
2707
2711
|
})
|
|
2708
2712
|
})
|
|
2709
2713
|
});
|
|
2710
2714
|
}
|
|
2711
2715
|
function Mo({ children: e, error: t, className: n }) {
|
|
2712
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ R("div", {
|
|
2713
2717
|
"data-slot": "chat-thread-error-state",
|
|
2714
2718
|
"data-testid": "chat-message-history-error-state",
|
|
2715
2719
|
role: "alert",
|
|
2716
2720
|
"aria-live": "assertive",
|
|
2717
2721
|
"aria-label": "Error loading messages",
|
|
2718
2722
|
className: L("absolute inset-0 flex items-center justify-center", n),
|
|
2719
|
-
children: e || /* @__PURE__ */
|
|
2723
|
+
children: e || /* @__PURE__ */ R("div", {
|
|
2720
2724
|
className: "text-text-error-main",
|
|
2721
2725
|
children: t instanceof Error ? t.message : t || "An error occurred"
|
|
2722
2726
|
})
|
|
@@ -2725,9 +2729,9 @@ function Mo({ children: e, error: t, className: n }) {
|
|
|
2725
2729
|
//#endregion
|
|
2726
2730
|
//#region src/components/canvas-shell/canvas-shell.tsx
|
|
2727
2731
|
function No({ className: e, children: t, ...n }) {
|
|
2728
|
-
return /* @__PURE__ */
|
|
2732
|
+
return /* @__PURE__ */ R(le, {
|
|
2729
2733
|
isCollapsible: !1,
|
|
2730
|
-
children: /* @__PURE__ */
|
|
2734
|
+
children: /* @__PURE__ */ R(ie, {
|
|
2731
2735
|
"data-slot": "canvas-shell",
|
|
2732
2736
|
className: e,
|
|
2733
2737
|
...n,
|
|
@@ -2736,7 +2740,7 @@ function No({ className: e, children: t, ...n }) {
|
|
|
2736
2740
|
});
|
|
2737
2741
|
}
|
|
2738
2742
|
function Po({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
2739
|
-
return /* @__PURE__ */
|
|
2743
|
+
return /* @__PURE__ */ R(F, {
|
|
2740
2744
|
"data-slot": "canvas-shell-header",
|
|
2741
2745
|
hasBorder: n,
|
|
2742
2746
|
className: e,
|
|
@@ -2745,7 +2749,7 @@ function Po({ className: e, children: t, hasBorder: n = !0, ...r }) {
|
|
|
2745
2749
|
});
|
|
2746
2750
|
}
|
|
2747
2751
|
function Fo({ className: e, children: t, ...n }) {
|
|
2748
|
-
return /* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ R(ue, {
|
|
2749
2753
|
"data-slot": "canvas-shell-title",
|
|
2750
2754
|
className: e,
|
|
2751
2755
|
...n,
|
|
@@ -2753,7 +2757,7 @@ function Fo({ className: e, children: t, ...n }) {
|
|
|
2753
2757
|
});
|
|
2754
2758
|
}
|
|
2755
2759
|
function Io({ className: e, children: t, ...n }) {
|
|
2756
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ R(ae, {
|
|
2757
2761
|
"data-slot": "canvas-shell-close-trigger",
|
|
2758
2762
|
className: e,
|
|
2759
2763
|
...n,
|
|
@@ -2761,13 +2765,13 @@ function Io({ className: e, children: t, ...n }) {
|
|
|
2761
2765
|
});
|
|
2762
2766
|
}
|
|
2763
2767
|
function Lo({ className: e, children: t, isFullScreen: n, labels: r, ...i }) {
|
|
2764
|
-
return /* @__PURE__ */
|
|
2768
|
+
return /* @__PURE__ */ R(P, {
|
|
2765
2769
|
"data-slot": "canvas-shell-full-screen-trigger",
|
|
2766
2770
|
"aria-pressed": n,
|
|
2767
2771
|
"aria-label": n ? r?.exit ?? "Exit full screen" : r?.enter ?? "Full screen",
|
|
2768
2772
|
className: L("max-md:hidden", e),
|
|
2769
2773
|
...i,
|
|
2770
|
-
children: t || /* @__PURE__ */
|
|
2774
|
+
children: t || /* @__PURE__ */ R(Bt, {})
|
|
2771
2775
|
});
|
|
2772
2776
|
}
|
|
2773
2777
|
function Ro({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i }) {
|
|
@@ -2775,33 +2779,33 @@ function Ro({ className: e, children: t, menuClassName: n, onOpenChange: r, ...i
|
|
|
2775
2779
|
function s(e) {
|
|
2776
2780
|
o(e), r?.(e);
|
|
2777
2781
|
}
|
|
2778
|
-
return /* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ z(M, {
|
|
2779
2783
|
modal: !1,
|
|
2780
2784
|
onOpenChange: s,
|
|
2781
|
-
children: [/* @__PURE__ */
|
|
2785
|
+
children: [/* @__PURE__ */ R(re, {
|
|
2782
2786
|
asChild: !0,
|
|
2783
|
-
children: /* @__PURE__ */
|
|
2787
|
+
children: /* @__PURE__ */ R(P, {
|
|
2784
2788
|
"data-slot": "canvas-shell-options-button",
|
|
2785
2789
|
isActive: a,
|
|
2786
2790
|
"aria-label": "More options",
|
|
2787
2791
|
className: e,
|
|
2788
2792
|
...i,
|
|
2789
|
-
children: /* @__PURE__ */
|
|
2793
|
+
children: /* @__PURE__ */ R(zt, {})
|
|
2790
2794
|
})
|
|
2791
|
-
}), /* @__PURE__ */
|
|
2795
|
+
}), /* @__PURE__ */ R(ne, {
|
|
2792
2796
|
className: L("w-[200px]", n),
|
|
2793
2797
|
children: t
|
|
2794
2798
|
})]
|
|
2795
2799
|
});
|
|
2796
2800
|
}
|
|
2797
|
-
var zo =
|
|
2801
|
+
var zo = ye;
|
|
2798
2802
|
function Bo({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, hasScroll: i = !0, ...a }) {
|
|
2799
|
-
return /* @__PURE__ */
|
|
2803
|
+
return /* @__PURE__ */ R(se, {
|
|
2800
2804
|
"data-slot": "canvas-shell-content",
|
|
2801
2805
|
"data-has-scroll": i,
|
|
2802
2806
|
className: e,
|
|
2803
2807
|
...a,
|
|
2804
|
-
children: /* @__PURE__ */
|
|
2808
|
+
children: /* @__PURE__ */ R(oe, {
|
|
2805
2809
|
"data-slot": "canvas-shell-content-body",
|
|
2806
2810
|
hasPadding: r,
|
|
2807
2811
|
hasScroll: i,
|
|
@@ -2811,7 +2815,7 @@ function Bo({ className: e, children: t, bodyClassName: n, hasPadding: r = !0, h
|
|
|
2811
2815
|
});
|
|
2812
2816
|
}
|
|
2813
2817
|
function Vo({ className: e, children: t, ...n }) {
|
|
2814
|
-
return /* @__PURE__ */
|
|
2818
|
+
return /* @__PURE__ */ R(ce, {
|
|
2815
2819
|
"data-slot": "canvas-shell-footer",
|
|
2816
2820
|
className: e,
|
|
2817
2821
|
...n,
|
|
@@ -2821,11 +2825,11 @@ function Vo({ className: e, children: t, ...n }) {
|
|
|
2821
2825
|
//#endregion
|
|
2822
2826
|
//#region src/components/new-chat-trigger/new-chat-trigger.tsx
|
|
2823
2827
|
var Ho = a(({ asChild: t = !1, children: n, onClick: r, ...i }, a) => {
|
|
2824
|
-
let { goToNewChat: o } =
|
|
2828
|
+
let { goToNewChat: o } = X(), s = t ? e : "button";
|
|
2825
2829
|
function c(e) {
|
|
2826
2830
|
r?.(e), o();
|
|
2827
2831
|
}
|
|
2828
|
-
return /* @__PURE__ */
|
|
2832
|
+
return /* @__PURE__ */ R(s, {
|
|
2829
2833
|
ref: a,
|
|
2830
2834
|
"data-testid": "new-chat-trigger",
|
|
2831
2835
|
onClick: c,
|
|
@@ -2837,11 +2841,11 @@ Ho.displayName = "NewChatTrigger";
|
|
|
2837
2841
|
//#endregion
|
|
2838
2842
|
//#region src/components/chat-thinking-process/chat-thinking-process.tsx
|
|
2839
2843
|
var Uo = a(function({ children: e, className: t, defaultOpen: n = !1, isStreaming: r = !1, ...i }, a) {
|
|
2840
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ R(v, {
|
|
2841
2845
|
defaultOpen: n,
|
|
2842
2846
|
asChild: !0,
|
|
2843
2847
|
...i,
|
|
2844
|
-
children: /* @__PURE__ */
|
|
2848
|
+
children: /* @__PURE__ */ R("div", {
|
|
2845
2849
|
ref: a,
|
|
2846
2850
|
"data-slot": "chat-thinking-process",
|
|
2847
2851
|
"data-testid": "chat-thinking-process",
|
|
@@ -2853,16 +2857,16 @@ var Uo = a(function({ children: e, className: t, defaultOpen: n = !1, isStreamin
|
|
|
2853
2857
|
});
|
|
2854
2858
|
Uo.displayName = "ChatThinkingProcess";
|
|
2855
2859
|
function Wo({ children: e, className: t, ...n }) {
|
|
2856
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ z(x, {
|
|
2857
2861
|
"data-slot": "chat-thinking-process-trigger",
|
|
2858
2862
|
"data-testid": "chat-thinking-process-trigger",
|
|
2859
2863
|
className: L("flex w-full items-center gap-4", "cursor-pointer text-left", t),
|
|
2860
2864
|
...n,
|
|
2861
|
-
children: [e, /* @__PURE__ */
|
|
2865
|
+
children: [e, /* @__PURE__ */ R("style", { children: "\n @keyframes shimmer {\n 100% {\n mask-position: left;\n }\n }\n " })]
|
|
2862
2866
|
});
|
|
2863
2867
|
}
|
|
2864
2868
|
function Go({ children: e, className: t, ...n }) {
|
|
2865
|
-
return /* @__PURE__ */
|
|
2869
|
+
return /* @__PURE__ */ R("span", {
|
|
2866
2870
|
"data-slot": "chat-thinking-process-trigger-icon",
|
|
2867
2871
|
"data-testid": "chat-thinking-process-trigger-icon",
|
|
2868
2872
|
className: L("inline-flex shrink-0 items-center justify-center", t),
|
|
@@ -2871,26 +2875,24 @@ function Go({ children: e, className: t, ...n }) {
|
|
|
2871
2875
|
});
|
|
2872
2876
|
}
|
|
2873
2877
|
function Ko({ children: e, className: t, ...n }) {
|
|
2874
|
-
return /* @__PURE__ */
|
|
2878
|
+
return /* @__PURE__ */ R(I, {
|
|
2875
2879
|
asChild: !0,
|
|
2876
2880
|
variant: "body-sm",
|
|
2877
2881
|
"data-slot": "chat-thinking-process-trigger-label",
|
|
2878
2882
|
"data-testid": "chat-thinking-process-trigger-label",
|
|
2879
2883
|
className: L("text-text-secondary", "font-semibold", "group-data-[streaming=true]/thinking-process:mask-[linear-gradient(-60deg,#000_30%,rgba(0,0,0,0.2),#192029_70%)]", "group-data-[streaming=true]/thinking-process:mask-size-[300%_100%]", "group-data-[streaming=true]/thinking-process:mask-right", "group-data-[streaming=true]/thinking-process:animate-[shimmer_3.2s_infinite]", t),
|
|
2880
|
-
children: /* @__PURE__ */
|
|
2884
|
+
children: /* @__PURE__ */ R("span", {
|
|
2881
2885
|
...n,
|
|
2882
2886
|
children: e
|
|
2883
2887
|
})
|
|
2884
2888
|
});
|
|
2885
2889
|
}
|
|
2886
2890
|
function qo({ className: e, ...t }) {
|
|
2887
|
-
return /* @__PURE__ */
|
|
2891
|
+
return /* @__PURE__ */ R(y, {
|
|
2888
2892
|
"data-slot": "chat-thinking-process-trigger-arrow",
|
|
2889
2893
|
"data-testid": "chat-thinking-process-trigger-arrow",
|
|
2890
|
-
"
|
|
2891
|
-
|
|
2892
|
-
...t,
|
|
2893
|
-
children: /* @__PURE__ */ z(Se, {})
|
|
2894
|
+
className: L("items-center justify-center text-text-secondary", e),
|
|
2895
|
+
...t
|
|
2894
2896
|
});
|
|
2895
2897
|
}
|
|
2896
2898
|
function Jo({ children: e, className: n, itemsClassName: r, rowClassName: i, markerClassName: a, connectorClassName: o, previewClassName: s, hasLastMessagePreview: c = !0, ...l }) {
|
|
@@ -2901,37 +2903,37 @@ function Jo({ children: e, className: n, itemsClassName: r, rowClassName: i, mar
|
|
|
2901
2903
|
lastItemIndex: String(n.length)
|
|
2902
2904
|
};
|
|
2903
2905
|
}, [e]);
|
|
2904
|
-
return /* @__PURE__ */
|
|
2906
|
+
return /* @__PURE__ */ z("div", {
|
|
2905
2907
|
"data-slot": "chat-thinking-process-content",
|
|
2906
2908
|
"data-testid": "chat-thinking-process-content",
|
|
2907
2909
|
"data-preview": c,
|
|
2908
2910
|
className: L("pt-8", n),
|
|
2909
|
-
children: [c && u && /* @__PURE__ */
|
|
2911
|
+
children: [c && u && /* @__PURE__ */ R(tn, {
|
|
2910
2912
|
mode: "wait",
|
|
2911
|
-
children: /* @__PURE__ */
|
|
2913
|
+
children: /* @__PURE__ */ R(Yo, {
|
|
2912
2914
|
contentId: d,
|
|
2913
2915
|
className: s,
|
|
2914
2916
|
children: u
|
|
2915
2917
|
})
|
|
2916
|
-
}), /* @__PURE__ */
|
|
2918
|
+
}), /* @__PURE__ */ R(b, {
|
|
2917
2919
|
"data-slot": "chat-thinking-process-content-items",
|
|
2918
2920
|
"data-testid": "chat-thinking-process-content-items",
|
|
2919
2921
|
className: L("flex flex-col", r),
|
|
2920
2922
|
...l,
|
|
2921
|
-
children: t.Children.map(e, (e) => /* @__PURE__ */
|
|
2923
|
+
children: t.Children.map(e, (e) => /* @__PURE__ */ z("div", {
|
|
2922
2924
|
"data-slot": "chat-thinking-process-content-row",
|
|
2923
2925
|
className: L("relative flex gap-8 text-text-secondary text-sm last:pb-0", "pl-8", "last:[&>div:first-child>span:last-child]:hidden", i),
|
|
2924
|
-
children: [/* @__PURE__ */
|
|
2926
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2925
2927
|
className: "relative flex w-8 shrink-0 flex-col items-center self-stretch",
|
|
2926
2928
|
"aria-hidden": !0,
|
|
2927
|
-
children: [/* @__PURE__ */
|
|
2929
|
+
children: [/* @__PURE__ */ R("span", {
|
|
2928
2930
|
"data-slot": "chat-thinking-process-content-marker",
|
|
2929
2931
|
className: L("mt-[7px] size-[6px] shrink-0 rounded-full bg-text-secondary", a)
|
|
2930
|
-
}), /* @__PURE__ */
|
|
2932
|
+
}), /* @__PURE__ */ R("span", {
|
|
2931
2933
|
"data-slot": "chat-thinking-process-content-connector",
|
|
2932
2934
|
className: L("absolute top-[16px] bottom-[-4px] left-1/2 w-px -translate-x-1/2 bg-component-divider", o)
|
|
2933
2935
|
})]
|
|
2934
|
-
}), /* @__PURE__ */
|
|
2936
|
+
}), /* @__PURE__ */ R("div", {
|
|
2935
2937
|
className: "min-w-0 flex-1 pb-8",
|
|
2936
2938
|
children: e
|
|
2937
2939
|
})]
|
|
@@ -2940,7 +2942,7 @@ function Jo({ children: e, className: n, itemsClassName: r, rowClassName: i, mar
|
|
|
2940
2942
|
});
|
|
2941
2943
|
}
|
|
2942
2944
|
function Yo({ children: e, className: t, contentId: n }) {
|
|
2943
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ R(nn.div, {
|
|
2944
2946
|
"data-slot": "chat-thinking-process-content-preview",
|
|
2945
2947
|
"data-testid": "chat-thinking-process-content-preview",
|
|
2946
2948
|
initial: { opacity: 0 },
|
|
@@ -2955,7 +2957,7 @@ function Yo({ children: e, className: t, contentId: n }) {
|
|
|
2955
2957
|
}, n);
|
|
2956
2958
|
}
|
|
2957
2959
|
function Xo({ children: e, className: t, ...n }) {
|
|
2958
|
-
return /* @__PURE__ */
|
|
2960
|
+
return /* @__PURE__ */ R("div", {
|
|
2959
2961
|
"data-slot": "chat-thinking-process-content-item",
|
|
2960
2962
|
"data-testid": "chat-thinking-process-content-item",
|
|
2961
2963
|
className: L("text-text-secondary text-sm", t),
|
|
@@ -2965,14 +2967,14 @@ function Xo({ children: e, className: t, ...n }) {
|
|
|
2965
2967
|
}
|
|
2966
2968
|
//#endregion
|
|
2967
2969
|
//#region src/components/deprecated-empty-state.ts
|
|
2968
|
-
var Zo =
|
|
2970
|
+
var Zo = C, Qo = E, $o = ee, es = T, ts = w, ns = {
|
|
2969
2971
|
paragraph: "editor-paragraph",
|
|
2970
2972
|
text: {
|
|
2971
2973
|
bold: "editor-text-bold",
|
|
2972
2974
|
italic: "editor-text-italic",
|
|
2973
2975
|
underline: "editor-text-underline"
|
|
2974
2976
|
}
|
|
2975
|
-
}, rs = class e extends
|
|
2977
|
+
}, rs = class e extends rt {
|
|
2976
2978
|
__src;
|
|
2977
2979
|
__altText;
|
|
2978
2980
|
static getType() {
|
|
@@ -2992,7 +2994,7 @@ var Zo = S, Qo = T, $o = E, es = w, ts = C, ns = {
|
|
|
2992
2994
|
return !1;
|
|
2993
2995
|
}
|
|
2994
2996
|
decorate() {
|
|
2995
|
-
return /* @__PURE__ */
|
|
2997
|
+
return /* @__PURE__ */ R("img", {
|
|
2996
2998
|
src: this.__src,
|
|
2997
2999
|
alt: this.__altText,
|
|
2998
3000
|
style: {
|
|
@@ -3054,7 +3056,7 @@ var ss = {
|
|
|
3054
3056
|
importRegExp: /./,
|
|
3055
3057
|
dependencies: [],
|
|
3056
3058
|
export: (e) => {
|
|
3057
|
-
if (!
|
|
3059
|
+
if (!G(e)) return null;
|
|
3058
3060
|
let t = e.getStyle() ?? "", n = e.getTextContent(), r = os(t);
|
|
3059
3061
|
if (r.fontSize || r.fontFamily || r.color) {
|
|
3060
3062
|
let e = "";
|
|
@@ -3069,7 +3071,7 @@ var ss = {
|
|
|
3069
3071
|
importRegExp: /<span\s+style="([^"]+)">(.+?)<\/span>/,
|
|
3070
3072
|
dependencies: [],
|
|
3071
3073
|
replace: (e, t) => {
|
|
3072
|
-
let [, n, r] = t, i =
|
|
3074
|
+
let [, n, r] = t, i = Ke(r);
|
|
3073
3075
|
return i.setFormat(e.getFormat()), i.setStyle(n), e.replace(i), i;
|
|
3074
3076
|
}
|
|
3075
3077
|
}, ls = {
|
|
@@ -3079,10 +3081,10 @@ var ss = {
|
|
|
3079
3081
|
importRegExp: /<ins>(.*?)<\/ins>/,
|
|
3080
3082
|
dependencies: [],
|
|
3081
3083
|
replace: (e, t) => {
|
|
3082
|
-
let n =
|
|
3084
|
+
let n = Ke(t[1]);
|
|
3083
3085
|
return n.setFormat(e.getFormat()), n.hasFormat("underline") || n.toggleFormat("underline"), e.replace(n), n;
|
|
3084
3086
|
},
|
|
3085
|
-
export: (e) => !
|
|
3087
|
+
export: (e) => !G(e) || !e.hasFormat("underline") ? null : `<ins>${e.getTextContent()}</ins>`
|
|
3086
3088
|
}, us = (e) => {
|
|
3087
3089
|
let t = /text-align:\s*(\w+)/i.exec(e);
|
|
3088
3090
|
return t ? t[1].trim() : null;
|
|
@@ -3095,10 +3097,10 @@ var ss = {
|
|
|
3095
3097
|
if (!r) return !1;
|
|
3096
3098
|
if (!n[2]) return;
|
|
3097
3099
|
let i = t[0];
|
|
3098
|
-
|
|
3100
|
+
G(i) && i.setTextContent(n[2]), e.setFormat(r), e.append(...t);
|
|
3099
3101
|
},
|
|
3100
3102
|
export: (e, t) => {
|
|
3101
|
-
if (!
|
|
3103
|
+
if (!Xe(e)) return null;
|
|
3102
3104
|
let n = e.getFormatType();
|
|
3103
3105
|
return !n || n === "left" ? null : `<div style="text-align: ${n}">${t(e)}</div>`;
|
|
3104
3106
|
}
|
|
@@ -3120,13 +3122,13 @@ var ss = {
|
|
|
3120
3122
|
e.replace(i);
|
|
3121
3123
|
}
|
|
3122
3124
|
}, ms = [
|
|
3123
|
-
...
|
|
3125
|
+
...Ue,
|
|
3124
3126
|
ss,
|
|
3125
3127
|
ls,
|
|
3126
3128
|
ds,
|
|
3127
3129
|
fs
|
|
3128
3130
|
], hs = [
|
|
3129
|
-
...
|
|
3131
|
+
...Ue,
|
|
3130
3132
|
cs,
|
|
3131
3133
|
ls,
|
|
3132
3134
|
ds,
|
|
@@ -3134,52 +3136,52 @@ var ss = {
|
|
|
3134
3136
|
];
|
|
3135
3137
|
//#endregion
|
|
3136
3138
|
//#region src/components/rich-text-area/html-config.ts
|
|
3137
|
-
function
|
|
3139
|
+
function gs(e) {
|
|
3138
3140
|
let t = e.nodeName.toLowerCase();
|
|
3139
3141
|
if (t !== "h1" && t !== "h2" && t !== "h3" && t !== "h4" && t !== "h5" && t !== "h6") return null;
|
|
3140
|
-
let n =
|
|
3142
|
+
let n = Ie(t), r = e.getAttribute("style") ?? "";
|
|
3141
3143
|
if (n.setStyle(r), e.style) {
|
|
3142
3144
|
let t = e.style.textAlign;
|
|
3143
|
-
(t === "left" || t === "right" || t === "center" || t === "justify" || t === "start" || t === "end") && n.setFormat(t),
|
|
3145
|
+
(t === "left" || t === "right" || t === "center" || t === "justify" || t === "start" || t === "end") && n.setFormat(t), mt(e, n);
|
|
3144
3146
|
}
|
|
3145
3147
|
return { node: n };
|
|
3146
3148
|
}
|
|
3147
|
-
function
|
|
3149
|
+
function _s(e) {
|
|
3148
3150
|
if (e.getAttribute("__lexicallisttype") === "check" || e.classList.contains("contains-task-list")) return !0;
|
|
3149
|
-
for (let t of e.childNodes) if (
|
|
3151
|
+
for (let t of e.childNodes) if (pt(t) && t.hasAttribute("aria-checked")) return !0;
|
|
3150
3152
|
return !1;
|
|
3151
3153
|
}
|
|
3152
|
-
function
|
|
3154
|
+
function vs(e) {
|
|
3153
3155
|
let t = e.nodeName.toLowerCase(), n = null;
|
|
3154
3156
|
if (t === "ol") {
|
|
3155
3157
|
let t = e.start;
|
|
3156
|
-
n =
|
|
3157
|
-
} else t === "ul" && (n =
|
|
3158
|
+
n = Oe("number", t);
|
|
3159
|
+
} else t === "ul" && (n = _s(e) ? Oe("check") : Oe("bullet"));
|
|
3158
3160
|
if (!n) return null;
|
|
3159
3161
|
let r = e.getAttribute("style") ?? "";
|
|
3160
3162
|
return n.setStyle(r), { node: n };
|
|
3161
3163
|
}
|
|
3162
|
-
function
|
|
3164
|
+
function ys(e) {
|
|
3163
3165
|
if (e.classList.contains("task-list-item")) {
|
|
3164
3166
|
for (let t of e.children) if (t.tagName === "INPUT") {
|
|
3165
3167
|
let n = t;
|
|
3166
3168
|
if (n.getAttribute("type") === "checkbox") {
|
|
3167
|
-
let t = n.hasAttribute("checked"), r =
|
|
3169
|
+
let t = n.hasAttribute("checked"), r = De(t), i = e.getAttribute("style") ?? "";
|
|
3168
3170
|
return r.setStyle(i), { node: r };
|
|
3169
3171
|
}
|
|
3170
3172
|
}
|
|
3171
3173
|
}
|
|
3172
|
-
let t = e.getAttribute("aria-checked"), n =
|
|
3174
|
+
let t = e.getAttribute("aria-checked"), n = De(t === "true" || t !== "false" && void 0), r = e.getAttribute("style") ?? "";
|
|
3173
3175
|
return n.setStyle(r), { node: n };
|
|
3174
3176
|
}
|
|
3175
3177
|
var Z = 4;
|
|
3176
|
-
function
|
|
3178
|
+
function bs(e) {
|
|
3177
3179
|
let { color: t, fontSize: n, fontFamily: r } = os(e.getAttribute("style") ?? "");
|
|
3178
3180
|
if (!t && !n && !r) return null;
|
|
3179
3181
|
let i = e.style;
|
|
3180
3182
|
return {
|
|
3181
3183
|
forChild: (e) => {
|
|
3182
|
-
if (!
|
|
3184
|
+
if (!G(e)) return e;
|
|
3183
3185
|
let a = i.fontWeight, o = (i.textDecoration || "").split(" ");
|
|
3184
3186
|
(a === "700" || a === "bold") && !e.hasFormat("bold") && e.toggleFormat("bold"), o.includes("line-through") && !e.hasFormat("strikethrough") && e.toggleFormat("strikethrough"), i.fontStyle === "italic" && !e.hasFormat("italic") && e.toggleFormat("italic"), o.includes("underline") && !e.hasFormat("underline") && e.toggleFormat("underline"), i.verticalAlign === "sub" && !e.hasFormat("subscript") && e.toggleFormat("subscript"), i.verticalAlign === "super" && !e.hasFormat("superscript") && e.toggleFormat("superscript");
|
|
3185
3187
|
let s = "";
|
|
@@ -3188,59 +3190,59 @@ function ys(e) {
|
|
|
3188
3190
|
node: null
|
|
3189
3191
|
};
|
|
3190
3192
|
}
|
|
3191
|
-
var
|
|
3193
|
+
var xs = {
|
|
3192
3194
|
h1: () => ({
|
|
3193
|
-
conversion:
|
|
3195
|
+
conversion: gs,
|
|
3194
3196
|
priority: Z
|
|
3195
3197
|
}),
|
|
3196
3198
|
h2: () => ({
|
|
3197
|
-
conversion:
|
|
3199
|
+
conversion: gs,
|
|
3198
3200
|
priority: Z
|
|
3199
3201
|
}),
|
|
3200
3202
|
h3: () => ({
|
|
3201
|
-
conversion:
|
|
3203
|
+
conversion: gs,
|
|
3202
3204
|
priority: Z
|
|
3203
3205
|
}),
|
|
3204
3206
|
h4: () => ({
|
|
3205
|
-
conversion:
|
|
3207
|
+
conversion: gs,
|
|
3206
3208
|
priority: Z
|
|
3207
3209
|
}),
|
|
3208
3210
|
h5: () => ({
|
|
3209
|
-
conversion:
|
|
3211
|
+
conversion: gs,
|
|
3210
3212
|
priority: Z
|
|
3211
3213
|
}),
|
|
3212
3214
|
h6: () => ({
|
|
3213
|
-
conversion:
|
|
3215
|
+
conversion: gs,
|
|
3214
3216
|
priority: Z
|
|
3215
3217
|
}),
|
|
3216
3218
|
ul: () => ({
|
|
3217
|
-
conversion:
|
|
3219
|
+
conversion: vs,
|
|
3218
3220
|
priority: Z
|
|
3219
3221
|
}),
|
|
3220
3222
|
ol: () => ({
|
|
3221
|
-
conversion:
|
|
3223
|
+
conversion: vs,
|
|
3222
3224
|
priority: Z
|
|
3223
3225
|
}),
|
|
3224
3226
|
li: () => ({
|
|
3225
|
-
conversion:
|
|
3227
|
+
conversion: ys,
|
|
3226
3228
|
priority: Z
|
|
3227
3229
|
}),
|
|
3228
3230
|
span: () => ({
|
|
3229
|
-
conversion:
|
|
3231
|
+
conversion: bs,
|
|
3230
3232
|
priority: Z
|
|
3231
3233
|
})
|
|
3232
3234
|
};
|
|
3233
|
-
function
|
|
3235
|
+
function Ss(e) {
|
|
3234
3236
|
return (t, n) => {
|
|
3235
3237
|
let r = e.prototype.exportDOM.call(n, t), i = n.getStyle();
|
|
3236
3238
|
return r.element && i && r.element.setAttribute("style", i), r;
|
|
3237
3239
|
};
|
|
3238
3240
|
}
|
|
3239
|
-
var
|
|
3240
|
-
[
|
|
3241
|
-
[
|
|
3242
|
-
[
|
|
3243
|
-
]),
|
|
3241
|
+
var Cs = /* @__PURE__ */ new Map([
|
|
3242
|
+
[Le, Ss(Le)],
|
|
3243
|
+
[Ae, Ss(Ae)],
|
|
3244
|
+
[ke, Ss(ke)]
|
|
3245
|
+
]), ws = class e extends it {
|
|
3244
3246
|
static getType() {
|
|
3245
3247
|
return "div-block";
|
|
3246
3248
|
}
|
|
@@ -3257,7 +3259,7 @@ var Ss = /* @__PURE__ */ new Map([
|
|
|
3257
3259
|
}
|
|
3258
3260
|
static importDOM() {
|
|
3259
3261
|
return { div: () => ({
|
|
3260
|
-
conversion:
|
|
3262
|
+
conversion: Ts,
|
|
3261
3263
|
priority: 4
|
|
3262
3264
|
}) };
|
|
3263
3265
|
}
|
|
@@ -3269,7 +3271,7 @@ var Ss = /* @__PURE__ */ new Map([
|
|
|
3269
3271
|
} : e;
|
|
3270
3272
|
}
|
|
3271
3273
|
static importJSON(e) {
|
|
3272
|
-
let t =
|
|
3274
|
+
let t = Es().updateFromJSON(e);
|
|
3273
3275
|
return e.style !== void 0 && t.setStyle(e.style), t;
|
|
3274
3276
|
}
|
|
3275
3277
|
updateFromJSON(e) {
|
|
@@ -3278,36 +3280,36 @@ var Ss = /* @__PURE__ */ new Map([
|
|
|
3278
3280
|
}
|
|
3279
3281
|
collapseAtStart(e) {
|
|
3280
3282
|
let t = this.getChildren();
|
|
3281
|
-
if (t.length === 0 ||
|
|
3283
|
+
if (t.length === 0 || G(t[0]) && t[0].getTextContent().trim() === "") {
|
|
3282
3284
|
if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
|
|
3283
3285
|
if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
|
|
3284
3286
|
} else {
|
|
3285
|
-
let e =
|
|
3287
|
+
let e = We();
|
|
3286
3288
|
return e.setFormat(this.getFormatType()), e.setStyle(this.getStyle()), e.setIndent(this.getIndent()), e.setDirection(this.getDirection()), t.forEach((t) => e.append(t)), this.replace(e), !0;
|
|
3287
3289
|
}
|
|
3288
3290
|
return !1;
|
|
3289
3291
|
}
|
|
3290
3292
|
};
|
|
3291
|
-
function
|
|
3292
|
-
let t =
|
|
3293
|
+
function Ts(e) {
|
|
3294
|
+
let t = Es(), n = e.getAttribute("style") ?? "";
|
|
3293
3295
|
if (t.setStyle(n), e.style) {
|
|
3294
3296
|
let n = e.style.textAlign;
|
|
3295
|
-
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n),
|
|
3297
|
+
(n === "left" || n === "right" || n === "center" || n === "justify" || n === "start" || n === "end") && t.setFormat(n), mt(e, t);
|
|
3296
3298
|
}
|
|
3297
3299
|
return { node: t };
|
|
3298
3300
|
}
|
|
3299
|
-
function
|
|
3300
|
-
return new
|
|
3301
|
+
function Es() {
|
|
3302
|
+
return new ws();
|
|
3301
3303
|
}
|
|
3302
3304
|
//#endregion
|
|
3303
3305
|
//#region src/components/rich-text-area/plugins/value-plugin.tsx
|
|
3304
|
-
var
|
|
3305
|
-
function
|
|
3306
|
+
var Ds = 50;
|
|
3307
|
+
function Os({ onChange: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
3306
3308
|
let r = c((r, i, a) => {
|
|
3307
3309
|
if (!a.has("focus") && e) try {
|
|
3308
3310
|
r.read(() => {
|
|
3309
|
-
let r = t === "html" ?
|
|
3310
|
-
n && (n.current.push(r), n.current.splice(0, n.current.length -
|
|
3311
|
+
let r = t === "html" ? cn(i) : Ve(ms);
|
|
3312
|
+
n && (n.current.push(r), n.current.splice(0, n.current.length - Ds)), e(r);
|
|
3311
3313
|
});
|
|
3312
3314
|
} catch {}
|
|
3313
3315
|
}, [
|
|
@@ -3315,26 +3317,26 @@ function Ds({ onChange: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
3315
3317
|
t,
|
|
3316
3318
|
n
|
|
3317
3319
|
]);
|
|
3318
|
-
return /* @__PURE__ */
|
|
3320
|
+
return /* @__PURE__ */ R(ht, { onChange: r });
|
|
3319
3321
|
}
|
|
3320
3322
|
//#endregion
|
|
3321
3323
|
//#region src/components/rich-text-area/hooks.ts
|
|
3322
3324
|
function Q() {
|
|
3323
|
-
let [e] =
|
|
3325
|
+
let [e] = ze();
|
|
3324
3326
|
return e;
|
|
3325
3327
|
}
|
|
3326
|
-
function
|
|
3327
|
-
let [e] =
|
|
3328
|
+
function ks() {
|
|
3329
|
+
let [e] = ze();
|
|
3328
3330
|
return c(() => {
|
|
3329
3331
|
let t = "";
|
|
3330
3332
|
return e.getEditorState().read(() => {
|
|
3331
|
-
t =
|
|
3333
|
+
t = U()?.getTextContent() ?? "";
|
|
3332
3334
|
}), t;
|
|
3333
3335
|
}, [e]);
|
|
3334
3336
|
}
|
|
3335
3337
|
//#endregion
|
|
3336
3338
|
//#region src/components/rich-text-area/plugins/disabled-plugin.tsx
|
|
3337
|
-
function
|
|
3339
|
+
function As({ isDisabled: e }) {
|
|
3338
3340
|
let t = Q();
|
|
3339
3341
|
return u(() => {
|
|
3340
3342
|
t.setEditable(!e);
|
|
@@ -3342,60 +3344,60 @@ function ks({ isDisabled: e }) {
|
|
|
3342
3344
|
}
|
|
3343
3345
|
//#endregion
|
|
3344
3346
|
//#region src/components/rich-text-area/plugins/controlled-plugin.tsx
|
|
3345
|
-
function
|
|
3347
|
+
function js({ controlledRef: e }) {
|
|
3346
3348
|
let t = m(null);
|
|
3347
3349
|
return d(e, () => ({ focus: () => {
|
|
3348
3350
|
Promise.resolve().then(() => {
|
|
3349
3351
|
t.current?.focus();
|
|
3350
3352
|
});
|
|
3351
|
-
} }), []), /* @__PURE__ */
|
|
3353
|
+
} }), []), /* @__PURE__ */ R(un, { editorRef: t });
|
|
3352
3354
|
}
|
|
3353
3355
|
//#endregion
|
|
3354
3356
|
//#region src/components/rich-text-area/utils/index.ts
|
|
3355
|
-
function
|
|
3357
|
+
function Ms(e) {
|
|
3356
3358
|
let t = e.getRootElement();
|
|
3357
3359
|
t && (t.scrollTop = t.scrollHeight);
|
|
3358
3360
|
}
|
|
3359
|
-
function
|
|
3360
|
-
let e =
|
|
3361
|
-
if (e &&
|
|
3362
|
-
let t =
|
|
3363
|
-
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"),
|
|
3361
|
+
function Ns() {
|
|
3362
|
+
let e = H().getLastDescendant();
|
|
3363
|
+
if (e && G(e)) {
|
|
3364
|
+
let t = Ge(), n = e.getTextContentSize();
|
|
3365
|
+
t.anchor.set(e.getKey(), n, "text"), t.focus.set(e.getKey(), n, "text"), Qe(t);
|
|
3364
3366
|
} else {
|
|
3365
|
-
|
|
3366
|
-
let e =
|
|
3367
|
-
if (
|
|
3368
|
-
let t = e.focus.getNode(), n =
|
|
3369
|
-
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type),
|
|
3367
|
+
Ze();
|
|
3368
|
+
let e = U();
|
|
3369
|
+
if (W(e)) {
|
|
3370
|
+
let t = e.focus.getNode(), n = G(t) ? t.getTextContentSize() : 0;
|
|
3371
|
+
e.anchor.set(e.focus.key, e.focus.offset, e.focus.type), e.focus.set(e.focus.key, n, e.focus.type), Qe(e);
|
|
3370
3372
|
}
|
|
3371
3373
|
}
|
|
3372
3374
|
}
|
|
3373
|
-
function
|
|
3375
|
+
function Ps(e, t) {
|
|
3374
3376
|
let n = new DOMParser().parseFromString(t, "text/html");
|
|
3375
|
-
return
|
|
3376
|
-
if (
|
|
3377
|
-
let t =
|
|
3377
|
+
return ln(e, n).map((e) => {
|
|
3378
|
+
if (G(e)) {
|
|
3379
|
+
let t = We();
|
|
3378
3380
|
return t.append(e), t;
|
|
3379
3381
|
}
|
|
3380
3382
|
return e;
|
|
3381
3383
|
});
|
|
3382
3384
|
}
|
|
3383
|
-
function Ps(e, t) {
|
|
3384
|
-
let n = U();
|
|
3385
|
-
n.clear(), Ns(e, t).forEach((e) => n.append(e));
|
|
3386
|
-
}
|
|
3387
3385
|
function Fs(e, t) {
|
|
3388
|
-
let n =
|
|
3389
|
-
|
|
3386
|
+
let n = H();
|
|
3387
|
+
n.clear(), Ps(e, t).forEach((e) => n.append(e));
|
|
3388
|
+
}
|
|
3389
|
+
function Is(e, t) {
|
|
3390
|
+
let n = U(), r = Ps(e, t);
|
|
3391
|
+
if (W(n)) n.insertNodes(r);
|
|
3390
3392
|
else {
|
|
3391
|
-
let e =
|
|
3393
|
+
let e = H();
|
|
3392
3394
|
e.clear(), r.forEach((t) => e.append(t));
|
|
3393
3395
|
}
|
|
3394
3396
|
}
|
|
3395
3397
|
//#endregion
|
|
3396
3398
|
//#region src/components/rich-text-area/plugins/controlled-value-plugin.tsx
|
|
3397
|
-
function
|
|
3398
|
-
let r = Q(), i = m(), a = m(!!e?.trim()), o =
|
|
3399
|
+
function Ls({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
3400
|
+
let r = Q(), i = m(), a = m(!!e?.trim()), o = be("desktop");
|
|
3399
3401
|
return u(() => {
|
|
3400
3402
|
if (!r || e === i.current) return;
|
|
3401
3403
|
if (i.current = e, n && e !== void 0) {
|
|
@@ -3404,20 +3406,20 @@ function Is({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
3404
3406
|
}
|
|
3405
3407
|
let s = "";
|
|
3406
3408
|
if (r.getEditorState().read(() => {
|
|
3407
|
-
s = t === "html" ?
|
|
3409
|
+
s = t === "html" ? cn(r) : Ve(ms);
|
|
3408
3410
|
}), e !== void 0 && e !== s) {
|
|
3409
3411
|
if (e === "") {
|
|
3410
3412
|
r.update(() => {
|
|
3411
|
-
|
|
3413
|
+
V(lt), t === "html" ? H().clear() : Be("", hs), Ns();
|
|
3412
3414
|
}, { discrete: !0 }), Promise.resolve().then(() => {
|
|
3413
3415
|
o ? r.focus() : r.blur();
|
|
3414
3416
|
});
|
|
3415
3417
|
return;
|
|
3416
3418
|
}
|
|
3417
3419
|
r.update(() => {
|
|
3418
|
-
|
|
3420
|
+
V(lt), t === "html" ? Fs(r, e) : Be(e, hs), Ns();
|
|
3419
3421
|
}), a.current && (a.current = !1, Promise.resolve().then(() => {
|
|
3420
|
-
requestAnimationFrame(() =>
|
|
3422
|
+
requestAnimationFrame(() => Ms(r));
|
|
3421
3423
|
})), o && Promise.resolve().then(() => {
|
|
3422
3424
|
r.focus();
|
|
3423
3425
|
});
|
|
@@ -3432,7 +3434,7 @@ function Is({ value: e, source: t = "markdown", emittedValuesRef: n }) {
|
|
|
3432
3434
|
}
|
|
3433
3435
|
//#endregion
|
|
3434
3436
|
//#region src/components/rich-text-area/plugins/blur-plugin.tsx
|
|
3435
|
-
function
|
|
3437
|
+
function Rs({ onBlur: e }) {
|
|
3436
3438
|
let t = Q();
|
|
3437
3439
|
return u(() => {
|
|
3438
3440
|
if (!e) return;
|
|
@@ -3448,7 +3450,7 @@ function Ls({ onBlur: e }) {
|
|
|
3448
3450
|
}
|
|
3449
3451
|
//#endregion
|
|
3450
3452
|
//#region src/components/rich-text-area/plugins/focus-plugin.tsx
|
|
3451
|
-
function
|
|
3453
|
+
function zs({ onFocusChange: e }) {
|
|
3452
3454
|
let t = Q();
|
|
3453
3455
|
return u(() => {
|
|
3454
3456
|
if (!e) return;
|
|
@@ -3467,91 +3469,91 @@ function Rs({ onFocusChange: e }) {
|
|
|
3467
3469
|
}
|
|
3468
3470
|
//#endregion
|
|
3469
3471
|
//#region src/components/rich-text-area/plugins/image-drop-plugin.tsx
|
|
3470
|
-
var
|
|
3472
|
+
var Bs = dt("INSERT_IMAGE_COMMAND"), Vs = "helvetiq:insert-image", Hs = class extends CustomEvent {
|
|
3471
3473
|
constructor(e) {
|
|
3472
|
-
super(
|
|
3474
|
+
super(Vs, { detail: e });
|
|
3473
3475
|
}
|
|
3474
3476
|
};
|
|
3475
|
-
function
|
|
3477
|
+
function Us() {
|
|
3476
3478
|
let e = Q();
|
|
3477
|
-
return u(() => e.registerCommand(
|
|
3479
|
+
return u(() => e.registerCommand(Bs, (t) => (e.update(() => {
|
|
3478
3480
|
let e = is(t.src, t.altText);
|
|
3479
|
-
|
|
3480
|
-
}), !0),
|
|
3481
|
+
Je([e]);
|
|
3482
|
+
}), !0), tt), [e]), u(() => {
|
|
3481
3483
|
if (!e.getRootElement()) return;
|
|
3482
3484
|
function t(t) {
|
|
3483
3485
|
let n = t;
|
|
3484
|
-
e.dispatchCommand(
|
|
3486
|
+
e.dispatchCommand(Bs, n.detail);
|
|
3485
3487
|
}
|
|
3486
|
-
return document.addEventListener(
|
|
3487
|
-
document.removeEventListener(
|
|
3488
|
+
return document.addEventListener(Vs, t), () => {
|
|
3489
|
+
document.removeEventListener(Vs, t);
|
|
3488
3490
|
};
|
|
3489
3491
|
}, [e]), null;
|
|
3490
3492
|
}
|
|
3491
3493
|
//#endregion
|
|
3492
3494
|
//#region src/components/rich-text-area/plugins/html-paste-plugin.tsx
|
|
3493
|
-
var
|
|
3495
|
+
var Ws = dt("PASTE_HTML_COMMAND"), Gs = dt("INSERT_HTML_COMMAND"), Ks = "helvetiq:paste-html", qs = "helvetiq:insert-html", Js = class extends CustomEvent {
|
|
3494
3496
|
constructor(e) {
|
|
3495
|
-
super(
|
|
3497
|
+
super(Ks, { detail: e });
|
|
3496
3498
|
}
|
|
3497
|
-
},
|
|
3499
|
+
}, Ys = class extends CustomEvent {
|
|
3498
3500
|
constructor(e) {
|
|
3499
|
-
super(
|
|
3501
|
+
super(qs, { detail: e });
|
|
3500
3502
|
}
|
|
3501
3503
|
};
|
|
3502
|
-
function
|
|
3504
|
+
function Xs() {
|
|
3503
3505
|
let e = Q();
|
|
3504
|
-
return u(() => e.registerCommand(
|
|
3505
|
-
let n =
|
|
3506
|
+
return u(() => e.registerCommand(Ws, (t) => (e.update(() => {
|
|
3507
|
+
let n = H();
|
|
3506
3508
|
n.clear();
|
|
3507
|
-
let r = new DOMParser().parseFromString(t.html, "text/html"), i =
|
|
3509
|
+
let r = new DOMParser().parseFromString(t.html, "text/html"), i = ln(e, r);
|
|
3508
3510
|
n.append(...i);
|
|
3509
|
-
}), !0),
|
|
3510
|
-
let n = new DOMParser().parseFromString(t.html, "text/html"), r =
|
|
3511
|
-
|
|
3512
|
-
}), !0),
|
|
3511
|
+
}), !0), tt), [e]), u(() => e.registerCommand(Gs, (t) => (e.update(() => {
|
|
3512
|
+
let n = new DOMParser().parseFromString(t.html, "text/html"), r = ln(e, n);
|
|
3513
|
+
Je(r);
|
|
3514
|
+
}), !0), tt), [e]), u(() => {
|
|
3513
3515
|
if (!e.getRootElement()) return;
|
|
3514
3516
|
function t(t) {
|
|
3515
3517
|
let n = t;
|
|
3516
|
-
e.dispatchCommand(
|
|
3518
|
+
e.dispatchCommand(Ws, n.detail);
|
|
3517
3519
|
}
|
|
3518
3520
|
function n(t) {
|
|
3519
3521
|
let n = t;
|
|
3520
|
-
e.dispatchCommand(
|
|
3522
|
+
e.dispatchCommand(Gs, n.detail);
|
|
3521
3523
|
}
|
|
3522
|
-
return document.addEventListener(
|
|
3523
|
-
document.removeEventListener(
|
|
3524
|
+
return document.addEventListener(Ks, t), document.addEventListener(qs, n), () => {
|
|
3525
|
+
document.removeEventListener(Ks, t), document.removeEventListener(qs, n);
|
|
3524
3526
|
};
|
|
3525
3527
|
}, [e]), null;
|
|
3526
3528
|
}
|
|
3527
3529
|
//#endregion
|
|
3528
3530
|
//#region src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx
|
|
3529
|
-
function
|
|
3531
|
+
function Zs() {
|
|
3530
3532
|
let e = Q();
|
|
3531
|
-
return u(() => e.registerCommand(
|
|
3533
|
+
return u(() => e.registerCommand(st, (t) => {
|
|
3532
3534
|
let { clipboardData: n } = t;
|
|
3533
3535
|
if (!n) return !1;
|
|
3534
3536
|
let r = n.getData("text/plain");
|
|
3535
3537
|
return r ? (t.preventDefault(), e.update(() => {
|
|
3536
|
-
let e =
|
|
3537
|
-
if (
|
|
3538
|
+
let e = U();
|
|
3539
|
+
if (W(e)) {
|
|
3538
3540
|
e.insertText(r);
|
|
3539
3541
|
return;
|
|
3540
3542
|
}
|
|
3541
|
-
let t =
|
|
3543
|
+
let t = H();
|
|
3542
3544
|
t.clear(), r.split(/\r?\n/).forEach((e) => {
|
|
3543
|
-
let n =
|
|
3544
|
-
e.length > 0 && n.append(
|
|
3545
|
+
let n = We();
|
|
3546
|
+
e.length > 0 && n.append(Ke(e)), t.append(n);
|
|
3545
3547
|
});
|
|
3546
3548
|
}), !0) : !1;
|
|
3547
|
-
},
|
|
3549
|
+
}, et), [e]), null;
|
|
3548
3550
|
}
|
|
3549
3551
|
//#endregion
|
|
3550
3552
|
//#region src/components/rich-text-area/plugins/file-attachment-plugin.tsx
|
|
3551
|
-
var
|
|
3552
|
-
function
|
|
3553
|
+
var Qs = dt("ATTACH_FILE_COMMAND");
|
|
3554
|
+
function $s({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
3553
3555
|
let r = Q(), i = m(null);
|
|
3554
|
-
u(() => r.registerCommand(
|
|
3556
|
+
u(() => r.registerCommand(Qs, () => (i.current?.click(), !0), tt), [r]);
|
|
3555
3557
|
function a(e) {
|
|
3556
3558
|
let r = Array.from(e.target.files ?? []);
|
|
3557
3559
|
if (t) n?.(r);
|
|
@@ -3561,7 +3563,7 @@ function Qs({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
|
3561
3563
|
}
|
|
3562
3564
|
e.target.value = "";
|
|
3563
3565
|
}
|
|
3564
|
-
return /* @__PURE__ */
|
|
3566
|
+
return /* @__PURE__ */ R("input", {
|
|
3565
3567
|
ref: i,
|
|
3566
3568
|
type: "file",
|
|
3567
3569
|
multiple: t,
|
|
@@ -3573,45 +3575,45 @@ function Qs({ acceptedFiles: e = [], isMultiple: t = !1, onFileAttach: n }) {
|
|
|
3573
3575
|
}
|
|
3574
3576
|
//#endregion
|
|
3575
3577
|
//#region src/components/rich-text-area/styled.tsx
|
|
3576
|
-
var
|
|
3578
|
+
var ec = a(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ R("div", {
|
|
3577
3579
|
ref: r,
|
|
3578
3580
|
className: L("w-full resize-none border-none outline-none bg-transparent font-[inherit] text-[inherit] flex items-center [&_.editor-paragraph]:m-0 [&_.editor-paragraph]:min-h-[26px] [&_.editor-text-bold]:font-bold [&_.editor-text-italic]:italic [&_.editor-text-underline]:underline", e),
|
|
3579
3581
|
...n,
|
|
3580
3582
|
children: t
|
|
3581
3583
|
}));
|
|
3582
|
-
|
|
3584
|
+
ec.displayName = "Wrapper";
|
|
3583
3585
|
//#endregion
|
|
3584
3586
|
//#region src/components/rich-text-area/rich-text-area.tsx
|
|
3585
|
-
var
|
|
3587
|
+
var tc = {
|
|
3586
3588
|
namespace: "helvetiq",
|
|
3587
3589
|
theme: ns,
|
|
3588
3590
|
editable: !0,
|
|
3589
3591
|
nodes: [
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3592
|
+
Ae,
|
|
3593
|
+
ke,
|
|
3594
|
+
Le,
|
|
3595
|
+
Re,
|
|
3596
|
+
Ce,
|
|
3597
|
+
Te,
|
|
3596
3598
|
rs,
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3599
|
+
ws,
|
|
3600
|
+
on,
|
|
3601
|
+
an,
|
|
3602
|
+
sn
|
|
3601
3603
|
],
|
|
3602
3604
|
html: {
|
|
3603
|
-
import:
|
|
3604
|
-
export:
|
|
3605
|
+
import: xs,
|
|
3606
|
+
export: Cs
|
|
3605
3607
|
},
|
|
3606
3608
|
onError: (e) => {
|
|
3607
3609
|
console.error("Lexical error:", e);
|
|
3608
3610
|
}
|
|
3609
3611
|
};
|
|
3610
|
-
function
|
|
3612
|
+
function nc({ children: e, name: t, value: n, source: r = "markdown", className: i, containerClassName: a, placeholderClassName: o, placeholder: s = "", isDisabled: c = !1, onChange: l, onBlur: u, onKeyDown: d, onFocusChange: f, forwardedRef: p, ...h }) {
|
|
3611
3613
|
let g = m([]);
|
|
3612
|
-
return /* @__PURE__ */
|
|
3613
|
-
initialConfig:
|
|
3614
|
-
children: /* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ R(je, {
|
|
3615
|
+
initialConfig: tc,
|
|
3616
|
+
children: /* @__PURE__ */ z(ec, {
|
|
3615
3617
|
"data-slot": "rich-text-area",
|
|
3616
3618
|
"data-testid": "rich-text-area",
|
|
3617
3619
|
"aria-disabled": c,
|
|
@@ -3619,17 +3621,17 @@ function tc({ children: e, name: t, value: n, source: r = "markdown", className:
|
|
|
3619
3621
|
className: L("relative size-full overflow-hidden", "data-[disabled=true]:opacity-80", "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:select-none", a),
|
|
3620
3622
|
...h,
|
|
3621
3623
|
children: [
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
contentEditable: /* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ R(Fe, {
|
|
3625
|
+
contentEditable: /* @__PURE__ */ R(Me, {
|
|
3624
3626
|
"data-slot": "rich-text-area-editable",
|
|
3625
3627
|
className: L("relative inset-0 overflow-y-auto", i),
|
|
3626
3628
|
"data-name": t,
|
|
3627
3629
|
"aria-placeholder": s,
|
|
3628
|
-
placeholder: /* @__PURE__ */
|
|
3630
|
+
placeholder: /* @__PURE__ */ R(I, {
|
|
3629
3631
|
variant: "body",
|
|
3630
3632
|
className: L("absolute left-0 top-0", "text-text-tertiary", "pointer-events-none user-select-none", o),
|
|
3631
3633
|
asChild: !0,
|
|
3632
|
-
children: /* @__PURE__ */
|
|
3634
|
+
children: /* @__PURE__ */ R("p", {
|
|
3633
3635
|
"data-slot": "rich-text-area-placeholder",
|
|
3634
3636
|
children: s
|
|
3635
3637
|
})
|
|
@@ -3640,38 +3642,38 @@ function tc({ children: e, name: t, value: n, source: r = "markdown", className:
|
|
|
3640
3642
|
minHeight: "20px"
|
|
3641
3643
|
}
|
|
3642
3644
|
}),
|
|
3643
|
-
ErrorBoundary:
|
|
3645
|
+
ErrorBoundary: Ne
|
|
3644
3646
|
}),
|
|
3645
|
-
/* @__PURE__ */
|
|
3646
|
-
/* @__PURE__ */
|
|
3647
|
+
/* @__PURE__ */ R(As, { isDisabled: c }),
|
|
3648
|
+
/* @__PURE__ */ R(Ls, {
|
|
3647
3649
|
value: n,
|
|
3648
3650
|
source: r,
|
|
3649
3651
|
emittedValuesRef: g
|
|
3650
3652
|
}),
|
|
3651
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ R(Os, {
|
|
3652
3654
|
onChange: l,
|
|
3653
3655
|
source: r,
|
|
3654
3656
|
emittedValuesRef: g
|
|
3655
3657
|
}),
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
r === "markdown" && /* @__PURE__ */
|
|
3658
|
+
/* @__PURE__ */ R(Rs, { onBlur: u }),
|
|
3659
|
+
/* @__PURE__ */ R(Pe, {}),
|
|
3660
|
+
/* @__PURE__ */ R(js, { controlledRef: p ?? null }),
|
|
3661
|
+
/* @__PURE__ */ R(zs, { onFocusChange: f }),
|
|
3662
|
+
/* @__PURE__ */ R(rn, {}),
|
|
3663
|
+
r === "markdown" && /* @__PURE__ */ R(Zs, {}),
|
|
3662
3664
|
e
|
|
3663
3665
|
]
|
|
3664
3666
|
})
|
|
3665
3667
|
});
|
|
3666
3668
|
}
|
|
3667
|
-
var
|
|
3669
|
+
var rc = a((e, t) => /* @__PURE__ */ R(nc, {
|
|
3668
3670
|
...e,
|
|
3669
3671
|
forwardedRef: t
|
|
3670
3672
|
}));
|
|
3671
|
-
|
|
3673
|
+
rc.displayName = "RichTextArea";
|
|
3672
3674
|
//#endregion
|
|
3673
3675
|
//#region src/components/rich-text-field/constants.ts
|
|
3674
|
-
var
|
|
3676
|
+
var ic = "Arial, sans-serif", ac = [
|
|
3675
3677
|
{
|
|
3676
3678
|
value: "Arial, sans-serif",
|
|
3677
3679
|
label: "Arial"
|
|
@@ -3708,7 +3710,7 @@ var rc = "Arial, sans-serif", ic = [
|
|
|
3708
3710
|
value: "\"Brush Script MT\", cursive",
|
|
3709
3711
|
label: "Brush Script MT"
|
|
3710
3712
|
}
|
|
3711
|
-
],
|
|
3713
|
+
], oc = ic, sc = [
|
|
3712
3714
|
{
|
|
3713
3715
|
label: "10",
|
|
3714
3716
|
value: "10"
|
|
@@ -3737,11 +3739,11 @@ var rc = "Arial, sans-serif", ic = [
|
|
|
3737
3739
|
label: "48",
|
|
3738
3740
|
value: "48"
|
|
3739
3741
|
}
|
|
3740
|
-
],
|
|
3742
|
+
], cc = "left", lc = "#000000";
|
|
3741
3743
|
//#endregion
|
|
3742
3744
|
//#region src/components/rich-text-field/components/toolbar-select.tsx
|
|
3743
|
-
function
|
|
3744
|
-
return /* @__PURE__ */
|
|
3745
|
+
function uc({ className: e, selectItemClassName: t, ...n }) {
|
|
3746
|
+
return /* @__PURE__ */ R(he, {
|
|
3745
3747
|
fullWidth: !1,
|
|
3746
3748
|
size: "small",
|
|
3747
3749
|
className: L(e),
|
|
@@ -3751,44 +3753,44 @@ function lc({ className: e, selectItemClassName: t, ...n }) {
|
|
|
3751
3753
|
}
|
|
3752
3754
|
//#endregion
|
|
3753
3755
|
//#region src/components/rich-text-field/components/alignment-select.tsx
|
|
3754
|
-
function
|
|
3756
|
+
function dc(e) {
|
|
3755
3757
|
return e === "center" || e === "right" ? e : e === "end" ? "right" : "left";
|
|
3756
3758
|
}
|
|
3757
|
-
var
|
|
3759
|
+
var fc = {
|
|
3758
3760
|
left: {
|
|
3759
3761
|
label: "Left",
|
|
3760
|
-
icon: /* @__PURE__ */
|
|
3762
|
+
icon: /* @__PURE__ */ R(kt, { fontSize: "inherit" })
|
|
3761
3763
|
},
|
|
3762
3764
|
center: {
|
|
3763
3765
|
label: "Center",
|
|
3764
|
-
icon: /* @__PURE__ */
|
|
3766
|
+
icon: /* @__PURE__ */ R(Ot, { fontSize: "inherit" })
|
|
3765
3767
|
},
|
|
3766
3768
|
right: {
|
|
3767
3769
|
label: "Right",
|
|
3768
|
-
icon: /* @__PURE__ */
|
|
3770
|
+
icon: /* @__PURE__ */ R(At, { fontSize: "inherit" })
|
|
3769
3771
|
}
|
|
3770
3772
|
};
|
|
3771
|
-
function
|
|
3772
|
-
let t = Q(), [n, r] = h(
|
|
3773
|
+
function pc({ className: e }) {
|
|
3774
|
+
let t = Q(), [n, r] = h(cc), i = p(() => Object.entries(fc).map(([e, { label: t, icon: n }]) => ({
|
|
3773
3775
|
value: e,
|
|
3774
3776
|
label: t,
|
|
3775
3777
|
icon: n
|
|
3776
3778
|
})), []), a = c(() => {
|
|
3777
|
-
let e =
|
|
3778
|
-
if (
|
|
3779
|
-
let t = e.anchor.getNode(), n = t.getParent(), i =
|
|
3780
|
-
|
|
3779
|
+
let e = U();
|
|
3780
|
+
if (W(e)) {
|
|
3781
|
+
let t = e.anchor.getNode(), n = t.getParent(), i = Ye(t) ? t : n;
|
|
3782
|
+
Ye(i) && r(dc(i.getFormatType() || "left"));
|
|
3781
3783
|
}
|
|
3782
3784
|
}, []);
|
|
3783
|
-
u(() =>
|
|
3785
|
+
u(() => fn(t.registerUpdateListener(({ editorState: e }) => {
|
|
3784
3786
|
e.read(() => {
|
|
3785
3787
|
a();
|
|
3786
3788
|
});
|
|
3787
|
-
}), t.registerCommand(
|
|
3789
|
+
}), t.registerCommand(ct, () => (a(), !1), nt)), [t, a]);
|
|
3788
3790
|
function o(e) {
|
|
3789
|
-
t.dispatchCommand(
|
|
3791
|
+
t.dispatchCommand(at, e);
|
|
3790
3792
|
}
|
|
3791
|
-
return /* @__PURE__ */
|
|
3793
|
+
return /* @__PURE__ */ R(uc, {
|
|
3792
3794
|
shouldShowOnlyIcon: !0,
|
|
3793
3795
|
options: i,
|
|
3794
3796
|
value: n,
|
|
@@ -3799,7 +3801,7 @@ function fc({ className: e }) {
|
|
|
3799
3801
|
//#endregion
|
|
3800
3802
|
//#region src/components/rich-text-field/components/toolbar-button.tsx
|
|
3801
3803
|
function $({ className: e, children: t, isActive: n, isDisabled: r = !1, ...i }) {
|
|
3802
|
-
return /* @__PURE__ */
|
|
3804
|
+
return /* @__PURE__ */ R(D, {
|
|
3803
3805
|
isActive: n,
|
|
3804
3806
|
className: L("border-none bg-transparent", e),
|
|
3805
3807
|
size: "sm",
|
|
@@ -3811,91 +3813,91 @@ function $({ className: e, children: t, isActive: n, isDisabled: r = !1, ...i })
|
|
|
3811
3813
|
}
|
|
3812
3814
|
//#endregion
|
|
3813
3815
|
//#region src/components/rich-text-field/components/attachment-button.tsx
|
|
3814
|
-
function
|
|
3816
|
+
function mc(e) {
|
|
3815
3817
|
let t = Q();
|
|
3816
3818
|
function n() {
|
|
3817
|
-
t.dispatchCommand(
|
|
3819
|
+
t.dispatchCommand(Qs, void 0);
|
|
3818
3820
|
}
|
|
3819
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ R($, {
|
|
3820
3822
|
"data-testid": "attachment-button",
|
|
3821
3823
|
"aria-label": "Add Attachment",
|
|
3822
3824
|
onClick: n,
|
|
3823
3825
|
...e,
|
|
3824
|
-
children: /* @__PURE__ */
|
|
3826
|
+
children: /* @__PURE__ */ R(bt, {})
|
|
3825
3827
|
});
|
|
3826
3828
|
}
|
|
3827
3829
|
//#endregion
|
|
3828
3830
|
//#region src/components/rich-text-field/utils.ts
|
|
3829
|
-
function
|
|
3831
|
+
function hc(e) {
|
|
3830
3832
|
let t;
|
|
3831
|
-
for (let n of
|
|
3832
|
-
return t ||
|
|
3833
|
-
}
|
|
3834
|
-
var hc = Object.freeze({});
|
|
3835
|
-
function gc(e) {
|
|
3836
|
-
return typeof e == "string" ? mc(e) : hc;
|
|
3833
|
+
for (let n of _n(e, { silent: !0 })) n.type === "declaration" && n.value && (t ||= {}, t[n.property] = n.value);
|
|
3834
|
+
return t || gc;
|
|
3837
3835
|
}
|
|
3836
|
+
var gc = Object.freeze({});
|
|
3838
3837
|
function _c(e) {
|
|
3838
|
+
return typeof e == "string" ? hc(e) : gc;
|
|
3839
|
+
}
|
|
3840
|
+
function vc(e) {
|
|
3839
3841
|
let t = [];
|
|
3840
3842
|
for (let [n, r] of Object.entries(e)) n && r && t.push(`${n}: ${r};`);
|
|
3841
3843
|
return t.sort().join(" ");
|
|
3842
3844
|
}
|
|
3843
|
-
function
|
|
3845
|
+
function yc(e, t) {
|
|
3844
3846
|
return e === t || !e && !t;
|
|
3845
3847
|
}
|
|
3846
|
-
function
|
|
3848
|
+
function bc(e, t) {
|
|
3847
3849
|
if (e === t) return !0;
|
|
3848
|
-
for (let n in e) if (!(n in t &&
|
|
3850
|
+
for (let n in e) if (!(n in t && yc(e[n], t[n]))) return !1;
|
|
3849
3851
|
for (let n in t) if (!(n in e)) return !1;
|
|
3850
3852
|
return !0;
|
|
3851
3853
|
}
|
|
3852
|
-
var
|
|
3853
|
-
isEqual:
|
|
3854
|
-
parse:
|
|
3855
|
-
unparse:
|
|
3854
|
+
var xc = ft("style", {
|
|
3855
|
+
isEqual: bc,
|
|
3856
|
+
parse: _c,
|
|
3857
|
+
unparse: vc
|
|
3856
3858
|
});
|
|
3857
|
-
function xc(e, t) {
|
|
3858
|
-
return wt(e, bc, t);
|
|
3859
|
-
}
|
|
3860
3859
|
function Sc(e, t) {
|
|
3861
|
-
return e
|
|
3860
|
+
return $e(e, xc, t);
|
|
3861
|
+
}
|
|
3862
|
+
function Cc(e, t) {
|
|
3863
|
+
return e === gc || e === t ? t : {
|
|
3862
3864
|
...e,
|
|
3863
3865
|
...t
|
|
3864
3866
|
};
|
|
3865
3867
|
}
|
|
3866
|
-
|
|
3867
|
-
function
|
|
3868
|
-
let t =
|
|
3868
|
+
dt("PATCH_TEXT_STYLE_COMMAND");
|
|
3869
|
+
function wc(e) {
|
|
3870
|
+
let t = U();
|
|
3869
3871
|
if (!t) {
|
|
3870
|
-
let e =
|
|
3872
|
+
let e = qe();
|
|
3871
3873
|
if (!e) return !1;
|
|
3872
|
-
t = e.clone(),
|
|
3874
|
+
t = e.clone(), Qe(t);
|
|
3873
3875
|
}
|
|
3874
|
-
let n = typeof e == "function" ? e : (t) =>
|
|
3875
|
-
if (
|
|
3876
|
+
let n = typeof e == "function" ? e : (t) => Cc(t, e);
|
|
3877
|
+
if (W(t) && t.isCollapsed()) {
|
|
3876
3878
|
let e = t.focus.getNode();
|
|
3877
|
-
|
|
3878
|
-
} else
|
|
3879
|
+
G(e) && Sc(e, n);
|
|
3880
|
+
} else pn((e) => Sc(e, n));
|
|
3879
3881
|
return !0;
|
|
3880
3882
|
}
|
|
3881
|
-
function
|
|
3883
|
+
function Tc(e) {
|
|
3882
3884
|
let t = e.anchor, n = e.focus, r = e.anchor.getNode(), i = e.focus.getNode();
|
|
3883
|
-
return r === i ? r : e.isBackward() ?
|
|
3885
|
+
return r === i ? r : e.isBackward() ? hn(n) ? r : i : hn(t) ? r : i;
|
|
3884
3886
|
}
|
|
3885
|
-
var
|
|
3887
|
+
var Ec = (e, t, n, r) => {
|
|
3886
3888
|
e.update(() => {
|
|
3887
|
-
if (r &&
|
|
3888
|
-
let e =
|
|
3889
|
-
e !== null &&
|
|
3889
|
+
if (r && V(lt), e.isEditable()) {
|
|
3890
|
+
let e = U();
|
|
3891
|
+
e !== null && gn(e, { "font-size": t + "px" });
|
|
3890
3892
|
}
|
|
3891
3893
|
});
|
|
3892
|
-
},
|
|
3893
|
-
function
|
|
3894
|
-
let e = l(
|
|
3894
|
+
}, Dc = (e) => e.startsWith("http") ? e : `https://${e}`, Oc = i(null);
|
|
3895
|
+
function kc() {
|
|
3896
|
+
let e = l(Oc);
|
|
3895
3897
|
if (!e) throw Error("\"useRichTextFieldContext\" must be used within a RichTextFieldContextProvider");
|
|
3896
3898
|
return e;
|
|
3897
3899
|
}
|
|
3898
|
-
function
|
|
3900
|
+
function Ac(e) {
|
|
3899
3901
|
let t = e.trim(), n = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);
|
|
3900
3902
|
if (n) {
|
|
3901
3903
|
let e = n[1];
|
|
@@ -3910,49 +3912,49 @@ function kc(e) {
|
|
|
3910
3912
|
let e = (e) => Math.max(0, Math.min(255, e)), [t, n, i] = r.slice(1, 4).map((t) => e(Number.parseInt(t, 10))), a = (e) => e.toString(16).padStart(2, "0");
|
|
3911
3913
|
return `#${a(t)}${a(n)}${a(i)}`;
|
|
3912
3914
|
}
|
|
3913
|
-
return
|
|
3915
|
+
return lc;
|
|
3914
3916
|
}
|
|
3915
|
-
function
|
|
3916
|
-
let t = Q(), [n, r] = h(
|
|
3917
|
-
let e =
|
|
3918
|
-
if (
|
|
3919
|
-
r(
|
|
3920
|
-
let t =
|
|
3917
|
+
function jc({ children: e }) {
|
|
3918
|
+
let t = Q(), [n, r] = h(oc), [i, a] = h("16"), [o, s] = h(!1), [l, d] = h(!1), [f, m] = h(!1), [g, _] = h(lc), [v, y] = h(!1), b = c(() => {
|
|
3919
|
+
let e = U();
|
|
3920
|
+
if (W(e)) {
|
|
3921
|
+
r(mn(e, "font-family", oc));
|
|
3922
|
+
let t = mn(e, "font-size", "16px");
|
|
3921
3923
|
a(t ? t.replace("px", "") : "16"), s(e.hasFormat("bold")), d(e.hasFormat("italic")), m(e.hasFormat("underline"));
|
|
3922
|
-
let n =
|
|
3923
|
-
_(
|
|
3924
|
-
let i =
|
|
3924
|
+
let n = mn(e, "color", "#000000") || "#000000";
|
|
3925
|
+
_(Ac(n));
|
|
3926
|
+
let i = Tc(e), o = i.getParent(), c = we(o) || we(i);
|
|
3925
3927
|
y(c);
|
|
3926
3928
|
}
|
|
3927
3929
|
}, []);
|
|
3928
|
-
u(() =>
|
|
3930
|
+
u(() => fn(t.registerUpdateListener(({ editorState: e }) => {
|
|
3929
3931
|
e.read(() => {
|
|
3930
3932
|
b();
|
|
3931
3933
|
});
|
|
3932
|
-
}), t.registerCommand(
|
|
3934
|
+
}), t.registerCommand(ct, () => (b(), !1), nt)), [t, b]);
|
|
3933
3935
|
let x = c((e) => {
|
|
3934
3936
|
t.update(() => {
|
|
3935
|
-
|
|
3936
|
-
let t =
|
|
3937
|
-
t !== null &&
|
|
3937
|
+
V(ut);
|
|
3938
|
+
let t = U();
|
|
3939
|
+
t !== null && gn(t, { "font-family": e });
|
|
3938
3940
|
});
|
|
3939
3941
|
}, [t]), S = c((e) => {
|
|
3940
|
-
|
|
3942
|
+
Ec(t, e, null, !1);
|
|
3941
3943
|
}, [t]), C = c(() => {
|
|
3942
|
-
t.dispatchCommand(
|
|
3944
|
+
t.dispatchCommand(ot, "bold");
|
|
3943
3945
|
}, [t]), w = c(() => {
|
|
3944
|
-
t.dispatchCommand(
|
|
3946
|
+
t.dispatchCommand(ot, "italic");
|
|
3945
3947
|
}, [t]), T = c(() => {
|
|
3946
|
-
t.dispatchCommand(
|
|
3948
|
+
t.dispatchCommand(ot, "underline");
|
|
3947
3949
|
}, [t]), E = c((e) => {
|
|
3948
3950
|
t.update(() => {
|
|
3949
|
-
|
|
3950
|
-
let t =
|
|
3951
|
-
t !== null &&
|
|
3951
|
+
V(ut);
|
|
3952
|
+
let t = U();
|
|
3953
|
+
t !== null && gn(t, { color: e });
|
|
3952
3954
|
});
|
|
3953
|
-
}, [t]),
|
|
3954
|
-
v ? (y(!1), t.dispatchCommand(
|
|
3955
|
-
}, [v, y]),
|
|
3955
|
+
}, [t]), ee = c(() => {
|
|
3956
|
+
v ? (y(!1), t.dispatchCommand(Ee, null)) : (y(!0), t.dispatchCommand(Ee, Dc("https://")));
|
|
3957
|
+
}, [v, y]), D = p(() => ({
|
|
3956
3958
|
fontFamily: n,
|
|
3957
3959
|
fontSize: i,
|
|
3958
3960
|
textColor: g,
|
|
@@ -3966,7 +3968,7 @@ function Ac({ children: e }) {
|
|
|
3966
3968
|
onBold: C,
|
|
3967
3969
|
onItalic: w,
|
|
3968
3970
|
onUnderline: T,
|
|
3969
|
-
onLink:
|
|
3971
|
+
onLink: ee
|
|
3970
3972
|
}), [
|
|
3971
3973
|
n,
|
|
3972
3974
|
i,
|
|
@@ -3981,84 +3983,84 @@ function Ac({ children: e }) {
|
|
|
3981
3983
|
C,
|
|
3982
3984
|
w,
|
|
3983
3985
|
T,
|
|
3984
|
-
|
|
3986
|
+
ee
|
|
3985
3987
|
]);
|
|
3986
|
-
return /* @__PURE__ */
|
|
3987
|
-
value:
|
|
3988
|
+
return /* @__PURE__ */ R(Oc.Provider, {
|
|
3989
|
+
value: D,
|
|
3988
3990
|
children: e
|
|
3989
3991
|
});
|
|
3990
3992
|
}
|
|
3991
3993
|
//#endregion
|
|
3992
3994
|
//#region src/components/rich-text-field/components/bold-button.tsx
|
|
3993
|
-
function
|
|
3994
|
-
let { isBold: t, onBold: n } =
|
|
3995
|
-
return /* @__PURE__ */
|
|
3995
|
+
function Mc({ ...e }) {
|
|
3996
|
+
let { isBold: t, onBold: n } = kc();
|
|
3997
|
+
return /* @__PURE__ */ R($, {
|
|
3996
3998
|
"data-testid": "bold-button",
|
|
3997
3999
|
"aria-label": "Format Bold",
|
|
3998
4000
|
isActive: t,
|
|
3999
4001
|
onClick: n,
|
|
4000
4002
|
...e,
|
|
4001
|
-
children: /* @__PURE__ */
|
|
4003
|
+
children: /* @__PURE__ */ R(jt, {})
|
|
4002
4004
|
});
|
|
4003
4005
|
}
|
|
4004
4006
|
//#endregion
|
|
4005
4007
|
//#region src/components/rich-text-field/components/clean-format-button.tsx
|
|
4006
|
-
function
|
|
4008
|
+
function Nc({ ...e }) {
|
|
4007
4009
|
let t = Q(), n = c(() => {
|
|
4008
4010
|
t.update(() => {
|
|
4009
|
-
let e =
|
|
4010
|
-
if (
|
|
4011
|
-
|
|
4012
|
-
for (let t of e.extract())
|
|
4011
|
+
let e = U();
|
|
4012
|
+
if (W(e)) {
|
|
4013
|
+
wc(() => gc);
|
|
4014
|
+
for (let t of e.extract()) G(t) && (t.setFormat(0), t.setStyle(""), dn(t).setFormat(""));
|
|
4013
4015
|
}
|
|
4014
4016
|
});
|
|
4015
4017
|
}, [t]);
|
|
4016
|
-
return /* @__PURE__ */
|
|
4018
|
+
return /* @__PURE__ */ R($, {
|
|
4017
4019
|
"data-testid": "clean-format-button",
|
|
4018
4020
|
"aria-label": "Reset Formatting",
|
|
4019
4021
|
onClick: n,
|
|
4020
4022
|
...e,
|
|
4021
|
-
children: /* @__PURE__ */
|
|
4023
|
+
children: /* @__PURE__ */ R(Mt, {})
|
|
4022
4024
|
});
|
|
4023
4025
|
}
|
|
4024
4026
|
//#endregion
|
|
4025
4027
|
//#region src/components/rich-text-field/components/image-button.tsx
|
|
4026
|
-
function
|
|
4027
|
-
return /* @__PURE__ */
|
|
4028
|
+
function Pc({ ...e }) {
|
|
4029
|
+
return /* @__PURE__ */ R($, {
|
|
4028
4030
|
"data-testid": "image-button",
|
|
4029
4031
|
"aria-label": "Add Image",
|
|
4030
4032
|
...e,
|
|
4031
|
-
children: /* @__PURE__ */
|
|
4033
|
+
children: /* @__PURE__ */ R(It, {})
|
|
4032
4034
|
});
|
|
4033
4035
|
}
|
|
4034
4036
|
//#endregion
|
|
4035
4037
|
//#region src/components/rich-text-field/components/italic-button.tsx
|
|
4036
|
-
function
|
|
4037
|
-
let { isItalic: t, onItalic: n } =
|
|
4038
|
-
return /* @__PURE__ */
|
|
4038
|
+
function Fc({ ...e }) {
|
|
4039
|
+
let { isItalic: t, onItalic: n } = kc();
|
|
4040
|
+
return /* @__PURE__ */ R($, {
|
|
4039
4041
|
"data-testid": "italic-button",
|
|
4040
4042
|
"aria-label": "Format Italics",
|
|
4041
4043
|
isActive: t,
|
|
4042
4044
|
onClick: n,
|
|
4043
4045
|
...e,
|
|
4044
|
-
children: /* @__PURE__ */
|
|
4046
|
+
children: /* @__PURE__ */ R(Pt, {})
|
|
4045
4047
|
});
|
|
4046
4048
|
}
|
|
4047
4049
|
//#endregion
|
|
4048
4050
|
//#region src/components/rich-text-field/components/link-button.tsx
|
|
4049
|
-
function
|
|
4050
|
-
return /* @__PURE__ */
|
|
4051
|
+
function Ic({ isActive: e, ...t }) {
|
|
4052
|
+
return /* @__PURE__ */ R($, {
|
|
4051
4053
|
"data-testid": "link-button",
|
|
4052
4054
|
"aria-label": "Add Link",
|
|
4053
4055
|
...t,
|
|
4054
|
-
children:
|
|
4056
|
+
children: R(e ? Rt : Lt, {})
|
|
4055
4057
|
});
|
|
4056
4058
|
}
|
|
4057
4059
|
//#endregion
|
|
4058
4060
|
//#region src/components/rich-text-field/components/size-select.tsx
|
|
4059
|
-
function
|
|
4060
|
-
let { fontSize: t, onFontSize: n } =
|
|
4061
|
-
return /* @__PURE__ */
|
|
4061
|
+
function Lc({ className: e }) {
|
|
4062
|
+
let { fontSize: t, onFontSize: n } = kc(), r = p(() => [...sc], []);
|
|
4063
|
+
return /* @__PURE__ */ R(uc, {
|
|
4062
4064
|
"data-testid": "size-select",
|
|
4063
4065
|
options: r,
|
|
4064
4066
|
value: t,
|
|
@@ -4068,23 +4070,23 @@ function Ic({ className: e }) {
|
|
|
4068
4070
|
}
|
|
4069
4071
|
//#endregion
|
|
4070
4072
|
//#region src/components/rich-text-field/components/text-color-button.tsx
|
|
4071
|
-
function
|
|
4072
|
-
let { textColor: n, onTextColor: r } =
|
|
4073
|
+
function Rc({ wrapperClassName: e, ...t }) {
|
|
4074
|
+
let { textColor: n, onTextColor: r } = kc(), i = n === lc;
|
|
4073
4075
|
function a(e) {
|
|
4074
4076
|
r(e.target.value);
|
|
4075
4077
|
}
|
|
4076
|
-
return /* @__PURE__ */
|
|
4078
|
+
return /* @__PURE__ */ z("div", {
|
|
4077
4079
|
"data-slot": "rich-text-field-text-color",
|
|
4078
4080
|
className: L("relative", e),
|
|
4079
|
-
children: [/* @__PURE__ */
|
|
4081
|
+
children: [/* @__PURE__ */ R($, {
|
|
4080
4082
|
"data-testid": "text-color-button",
|
|
4081
4083
|
"aria-label": "Text Color",
|
|
4082
4084
|
...t,
|
|
4083
|
-
children: /* @__PURE__ */
|
|
4085
|
+
children: /* @__PURE__ */ R("span", {
|
|
4084
4086
|
style: i ? {} : { color: n },
|
|
4085
|
-
children: /* @__PURE__ */
|
|
4087
|
+
children: /* @__PURE__ */ R(Nt, {})
|
|
4086
4088
|
})
|
|
4087
|
-
}), /* @__PURE__ */
|
|
4089
|
+
}), /* @__PURE__ */ R("input", {
|
|
4088
4090
|
type: "color",
|
|
4089
4091
|
"data-slot": "rich-text-field-text-color-input",
|
|
4090
4092
|
value: n,
|
|
@@ -4103,9 +4105,9 @@ function Lc({ wrapperClassName: e, ...t }) {
|
|
|
4103
4105
|
}
|
|
4104
4106
|
//#endregion
|
|
4105
4107
|
//#region src/components/rich-text-field/components/typography-select.tsx
|
|
4106
|
-
function
|
|
4107
|
-
let { fontFamily: t, onFontFamily: n } =
|
|
4108
|
-
return /* @__PURE__ */
|
|
4108
|
+
function zc({ className: e }) {
|
|
4109
|
+
let { fontFamily: t, onFontFamily: n } = kc(), r = p(() => [...ac], []);
|
|
4110
|
+
return /* @__PURE__ */ R(uc, {
|
|
4109
4111
|
"data-testid": "typography-select",
|
|
4110
4112
|
options: r,
|
|
4111
4113
|
value: t,
|
|
@@ -4115,38 +4117,38 @@ function Rc({ className: e }) {
|
|
|
4115
4117
|
}
|
|
4116
4118
|
//#endregion
|
|
4117
4119
|
//#region src/components/rich-text-field/components/underline-button.tsx
|
|
4118
|
-
function
|
|
4119
|
-
let { isUnderline: t, onUnderline: n } =
|
|
4120
|
-
return /* @__PURE__ */
|
|
4120
|
+
function Bc({ ...e }) {
|
|
4121
|
+
let { isUnderline: t, onUnderline: n } = kc();
|
|
4122
|
+
return /* @__PURE__ */ R($, {
|
|
4121
4123
|
"data-testid": "underline-button",
|
|
4122
4124
|
"aria-label": "Format Underline",
|
|
4123
4125
|
isActive: t,
|
|
4124
4126
|
onClick: n,
|
|
4125
4127
|
...e,
|
|
4126
|
-
children: /* @__PURE__ */
|
|
4128
|
+
children: /* @__PURE__ */ R(Ft, {})
|
|
4127
4129
|
});
|
|
4128
4130
|
}
|
|
4129
4131
|
//#endregion
|
|
4130
4132
|
//#region src/components/rich-text-field/components/formatting-toolbar-plugin.tsx
|
|
4131
|
-
var
|
|
4132
|
-
/* @__PURE__ */
|
|
4133
|
-
/* @__PURE__ */
|
|
4134
|
-
/* @__PURE__ */
|
|
4135
|
-
/* @__PURE__ */
|
|
4136
|
-
/* @__PURE__ */
|
|
4137
|
-
/* @__PURE__ */
|
|
4138
|
-
/* @__PURE__ */
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
/* @__PURE__ */
|
|
4141
|
-
/* @__PURE__ */
|
|
4142
|
-
/* @__PURE__ */
|
|
4143
|
-
/* @__PURE__ */
|
|
4144
|
-
/* @__PURE__ */
|
|
4145
|
-
/* @__PURE__ */
|
|
4146
|
-
/* @__PURE__ */
|
|
4133
|
+
var Vc = ({ hasAttachments: e }) => /* @__PURE__ */ z(Se, { children: [
|
|
4134
|
+
/* @__PURE__ */ R(zc, {}),
|
|
4135
|
+
/* @__PURE__ */ R(Lc, {}),
|
|
4136
|
+
/* @__PURE__ */ R(S, { orientation: "vertical" }),
|
|
4137
|
+
/* @__PURE__ */ R(Mc, {}),
|
|
4138
|
+
/* @__PURE__ */ R(Fc, {}),
|
|
4139
|
+
/* @__PURE__ */ R(Bc, {}),
|
|
4140
|
+
/* @__PURE__ */ R(Rc, {}),
|
|
4141
|
+
/* @__PURE__ */ R(S, { orientation: "vertical" }),
|
|
4142
|
+
/* @__PURE__ */ R(Ic, { isDisabled: !0 }),
|
|
4143
|
+
/* @__PURE__ */ R(mc, { isDisabled: !e }),
|
|
4144
|
+
/* @__PURE__ */ R(Pc, { isDisabled: !0 }),
|
|
4145
|
+
/* @__PURE__ */ R(S, { orientation: "vertical" }),
|
|
4146
|
+
/* @__PURE__ */ R(pc, {}),
|
|
4147
|
+
/* @__PURE__ */ R(S, { orientation: "vertical" }),
|
|
4148
|
+
/* @__PURE__ */ R(Nc, {})
|
|
4147
4149
|
] });
|
|
4148
|
-
function
|
|
4149
|
-
return /* @__PURE__ */
|
|
4150
|
+
function Hc({ className: e, children: t = Vc, hasAttachments: n = !1 }) {
|
|
4151
|
+
return /* @__PURE__ */ R("div", {
|
|
4150
4152
|
"data-testid": "formatting-toolbar",
|
|
4151
4153
|
"data-slot": "rich-text-field-toolbar",
|
|
4152
4154
|
className: L("flex items-center gap-[2px]", "px-[16px] py-[8px] overflow-x-auto", "bg-paper-elevation-1 border-b border-divider-border-base", e),
|
|
@@ -4155,9 +4157,9 @@ function Vc({ className: e, children: t = Bc, hasAttachments: n = !1 }) {
|
|
|
4155
4157
|
}
|
|
4156
4158
|
//#endregion
|
|
4157
4159
|
//#region src/components/rich-text-field/rich-text-field.tsx
|
|
4158
|
-
var
|
|
4160
|
+
var Uc = a(({ children: e, className: t, placeholderClassName: n, containerClassName: r, toolbarPlacement: i = "top", toolbarChildren: a, toolbarClassName: o, isMultipleAttachments: s, enableAttachments: c, acceptedFiles: l, onFileAttach: u, ...d }, f) => {
|
|
4159
4161
|
let p = i === "top";
|
|
4160
|
-
return /* @__PURE__ */
|
|
4162
|
+
return /* @__PURE__ */ z(rc, {
|
|
4161
4163
|
ref: f,
|
|
4162
4164
|
"data-testid": "rich-text-field",
|
|
4163
4165
|
"data-slot": "rich-text-field",
|
|
@@ -4166,21 +4168,21 @@ var Hc = a(({ children: e, className: t, placeholderClassName: n, containerClass
|
|
|
4166
4168
|
containerClassName: L("h-rich-text-field-height", "rounded-rich-text-field-toolbar", p ? "pt-rich-text-field-toolbar-height" : "pb-rich-text-field-toolbar-height", r),
|
|
4167
4169
|
className: L("p-rich-text-field-editor-padding", "bg-rich-text-field-background", "size-full", t),
|
|
4168
4170
|
...d,
|
|
4169
|
-
children: [/* @__PURE__ */
|
|
4171
|
+
children: [/* @__PURE__ */ R(jc, { children: /* @__PURE__ */ R(Hc, {
|
|
4170
4172
|
hasAttachments: c,
|
|
4171
4173
|
className: L("absolute right-0 w-full", p ? "top-0" : "bottom-0", o),
|
|
4172
4174
|
children: a
|
|
4173
|
-
}) }), /* @__PURE__ */
|
|
4175
|
+
}) }), /* @__PURE__ */ R($s, {
|
|
4174
4176
|
acceptedFiles: l,
|
|
4175
4177
|
onFileAttach: u,
|
|
4176
4178
|
isMultiple: s
|
|
4177
4179
|
})]
|
|
4178
4180
|
});
|
|
4179
4181
|
});
|
|
4180
|
-
|
|
4182
|
+
Uc.displayName = "RichTextField";
|
|
4181
4183
|
//#endregion
|
|
4182
4184
|
//#region src/components/topmenu/topmenu.tsx
|
|
4183
|
-
var
|
|
4185
|
+
var Wc = B("flex shrink-0 items-center justify-end", {
|
|
4184
4186
|
variants: {
|
|
4185
4187
|
size: {
|
|
4186
4188
|
md: ["px-[4px]", "rounded-overlay-tools-wrapper bg-overlay-tools-background-base"],
|
|
@@ -4205,8 +4207,8 @@ var Uc = V("flex shrink-0 items-center justify-end", {
|
|
|
4205
4207
|
hasBorder: !0
|
|
4206
4208
|
}
|
|
4207
4209
|
});
|
|
4208
|
-
function
|
|
4209
|
-
return /* @__PURE__ */
|
|
4210
|
+
function Gc({ className: e, children: t, ...n }) {
|
|
4211
|
+
return /* @__PURE__ */ R("div", {
|
|
4210
4212
|
"data-slot": "topmenu",
|
|
4211
4213
|
role: "group",
|
|
4212
4214
|
className: L("absolute top-0 right-0", "flex flex-col items-end w-fit", e),
|
|
@@ -4214,11 +4216,11 @@ function Wc({ className: e, children: t, ...n }) {
|
|
|
4214
4216
|
children: t
|
|
4215
4217
|
});
|
|
4216
4218
|
}
|
|
4217
|
-
function
|
|
4218
|
-
return /* @__PURE__ */
|
|
4219
|
+
function Kc({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
4220
|
+
return /* @__PURE__ */ R("div", {
|
|
4219
4221
|
"data-slot": "topmenu-actions",
|
|
4220
4222
|
"data-size": t ?? "lg",
|
|
4221
|
-
className: L(
|
|
4223
|
+
className: L(Wc({
|
|
4222
4224
|
size: t,
|
|
4223
4225
|
hasBorder: n
|
|
4224
4226
|
}), e),
|
|
@@ -4228,42 +4230,42 @@ function Gc({ className: e, size: t, hasBorder: n, children: r, ...i }) {
|
|
|
4228
4230
|
}
|
|
4229
4231
|
//#endregion
|
|
4230
4232
|
//#region src/domain/actions/constants.ts
|
|
4231
|
-
var
|
|
4233
|
+
var qc = "swisper";
|
|
4232
4234
|
//#endregion
|
|
4233
4235
|
//#region src/domain/actions/utils/index.ts
|
|
4234
|
-
function
|
|
4235
|
-
let n = `${
|
|
4236
|
+
function Jc(e, t) {
|
|
4237
|
+
let n = `${qc}://action/${e}`;
|
|
4236
4238
|
return t ? `${n}?${new URLSearchParams(t).toString()}` : n;
|
|
4237
4239
|
}
|
|
4238
|
-
function
|
|
4239
|
-
return `[${t}](${
|
|
4240
|
+
function Yc({ action: e, label: t, params: n }) {
|
|
4241
|
+
return `[${t}](${Jc(e, n)})`;
|
|
4240
4242
|
}
|
|
4241
|
-
function
|
|
4243
|
+
function Xc(e) {
|
|
4242
4244
|
if (!e?.startsWith("swisper://")) return !1;
|
|
4243
4245
|
let t = new URL(e);
|
|
4244
4246
|
return t.protocol === "swisper:" && t.hostname === "action" && t.pathname.startsWith("/") && t.pathname.split("/").length === 2;
|
|
4245
4247
|
}
|
|
4246
|
-
function
|
|
4248
|
+
function Zc(e) {
|
|
4247
4249
|
let t;
|
|
4248
4250
|
try {
|
|
4249
4251
|
t = new URL(e);
|
|
4250
4252
|
} catch {
|
|
4251
4253
|
return null;
|
|
4252
4254
|
}
|
|
4253
|
-
return
|
|
4255
|
+
return Xc(e) ? {
|
|
4254
4256
|
option: t.pathname.replace("/", ""),
|
|
4255
4257
|
payload: Object.fromEntries(t.searchParams.entries())
|
|
4256
4258
|
} : null;
|
|
4257
4259
|
}
|
|
4258
|
-
function
|
|
4260
|
+
function Qc(e) {
|
|
4259
4261
|
for (let t of e) if (t.type === "text" && typeof t.value == "string") return t.value;
|
|
4260
4262
|
return null;
|
|
4261
4263
|
}
|
|
4262
|
-
function
|
|
4263
|
-
let t =
|
|
4264
|
-
return
|
|
4264
|
+
function $c(e) {
|
|
4265
|
+
let t = bn().use(yn).use(vn).parse(e), n = null;
|
|
4266
|
+
return xn(t, (e) => {
|
|
4265
4267
|
if (e.type !== "link") return;
|
|
4266
|
-
let t =
|
|
4268
|
+
let t = Zc(e.url), r = Qc(e.children);
|
|
4267
4269
|
if (t && r) {
|
|
4268
4270
|
n = {
|
|
4269
4271
|
label: r,
|
|
@@ -4277,23 +4279,23 @@ function Qc(e) {
|
|
|
4277
4279
|
}
|
|
4278
4280
|
//#endregion
|
|
4279
4281
|
//#region src/domain/actions/hooks/index.ts
|
|
4280
|
-
function
|
|
4281
|
-
return p(() => e.map((e) =>
|
|
4282
|
+
function el(e) {
|
|
4283
|
+
return p(() => e.map((e) => $c(e) || { label: e }).filter((e) => e !== null), [e]);
|
|
4282
4284
|
}
|
|
4283
4285
|
//#endregion
|
|
4284
4286
|
//#region src/hooks/use-chat-stream-message.ts
|
|
4285
|
-
function
|
|
4287
|
+
function tl(e) {
|
|
4286
4288
|
return JSON.parse(e);
|
|
4287
4289
|
}
|
|
4288
|
-
function
|
|
4290
|
+
function nl(e) {
|
|
4289
4291
|
return e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
4290
4292
|
}
|
|
4291
|
-
function
|
|
4293
|
+
function rl(e, t) {
|
|
4292
4294
|
return e instanceof Error ? e : Error(t);
|
|
4293
4295
|
}
|
|
4294
|
-
function
|
|
4296
|
+
function il() {
|
|
4295
4297
|
return { streamMessage: c(async ({ stream: e, abortController: t, timeout: n = 2e4, tokenParser: r, onChunkReceived: i, onAbort: a, onFinish: o, onError: s }) => {
|
|
4296
|
-
let c = r ??
|
|
4298
|
+
let c = r ?? tl, l, u = !1, d = () => {
|
|
4297
4299
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
4298
4300
|
}, f = (e) => {
|
|
4299
4301
|
u || (u = !0, d(), a?.(e));
|
|
@@ -4304,7 +4306,7 @@ function rl() {
|
|
|
4304
4306
|
}, n));
|
|
4305
4307
|
};
|
|
4306
4308
|
try {
|
|
4307
|
-
let n = "", r = new TextDecoder("utf-8"), a =
|
|
4309
|
+
let n = "", r = new TextDecoder("utf-8"), a = Sn({
|
|
4308
4310
|
onEvent(e) {
|
|
4309
4311
|
try {
|
|
4310
4312
|
n += e.data;
|
|
@@ -4320,7 +4322,7 @@ function rl() {
|
|
|
4320
4322
|
}
|
|
4321
4323
|
});
|
|
4322
4324
|
for (t?.signal.addEventListener("abort", () => {
|
|
4323
|
-
let e =
|
|
4325
|
+
let e = rl(t.signal.reason, "Stream aborted");
|
|
4324
4326
|
f(e);
|
|
4325
4327
|
}, { once: !0 }), p(); !u;) {
|
|
4326
4328
|
let { value: t, done: n } = await e.read(), i = r.decode(t, { stream: !0 });
|
|
@@ -4329,8 +4331,8 @@ function rl() {
|
|
|
4329
4331
|
d(), !u && !t?.signal.aborted && o?.(n);
|
|
4330
4332
|
} catch (e) {
|
|
4331
4333
|
let n = e;
|
|
4332
|
-
if (u || t?.signal.aborted ||
|
|
4333
|
-
u || f(
|
|
4334
|
+
if (u || t?.signal.aborted || nl(n)) {
|
|
4335
|
+
u || f(rl(n, "Stream aborted"));
|
|
4334
4336
|
return;
|
|
4335
4337
|
}
|
|
4336
4338
|
t?.abort(n), console.error("Error while reading stream:", n), s?.(n);
|
|
@@ -4339,8 +4341,8 @@ function rl() {
|
|
|
4339
4341
|
}
|
|
4340
4342
|
//#endregion
|
|
4341
4343
|
//#region src/hooks/use-on-chat-changed.ts
|
|
4342
|
-
function
|
|
4343
|
-
let { chatId: t, isNewChat: n } =
|
|
4344
|
+
function al(e) {
|
|
4345
|
+
let { chatId: t, isNewChat: n } = X(), r = m(n), i = m(t), a = m(e);
|
|
4344
4346
|
a.current = e, r.current = n, u(() => {
|
|
4345
4347
|
i.current !== t && (a.current({
|
|
4346
4348
|
chatId: t,
|
|
@@ -4351,20 +4353,20 @@ function il(e) {
|
|
|
4351
4353
|
}
|
|
4352
4354
|
//#endregion
|
|
4353
4355
|
//#region src/hooks/use-current-chat-id.ts
|
|
4354
|
-
function
|
|
4355
|
-
let { chatId: e } =
|
|
4356
|
+
function ol() {
|
|
4357
|
+
let { chatId: e } = X();
|
|
4356
4358
|
return e;
|
|
4357
4359
|
}
|
|
4358
4360
|
//#endregion
|
|
4359
4361
|
//#region src/hooks/use-is-current-chat-new.ts
|
|
4360
|
-
function
|
|
4361
|
-
let { isNewChat: e } =
|
|
4362
|
+
function sl() {
|
|
4363
|
+
let { isNewChat: e } = X();
|
|
4362
4364
|
return e;
|
|
4363
4365
|
}
|
|
4364
4366
|
//#endregion
|
|
4365
4367
|
//#region src/hooks/use-loaded-chat-ids.ts
|
|
4366
|
-
function
|
|
4367
|
-
let { loadedChatIdsRef: e } =
|
|
4368
|
+
function cl() {
|
|
4369
|
+
let { loadedChatIdsRef: e } = X();
|
|
4368
4370
|
return {
|
|
4369
4371
|
getIsChatLoaded: c((t) => e.current?.has(t) ?? !1, []),
|
|
4370
4372
|
markAsLoaded: c((t) => {
|
|
@@ -4377,8 +4379,8 @@ function sl() {
|
|
|
4377
4379
|
}
|
|
4378
4380
|
//#endregion
|
|
4379
4381
|
//#region src/hooks/use-chat-prompt-placeholder.ts
|
|
4380
|
-
function
|
|
4381
|
-
let { promptPlaceholder: e, setPromptPlaceholder: t, clearPromptPlaceholder: n } =
|
|
4382
|
+
function ll() {
|
|
4383
|
+
let { promptPlaceholder: e, setPromptPlaceholder: t, clearPromptPlaceholder: n } = X();
|
|
4382
4384
|
return {
|
|
4383
4385
|
promptPlaceholder: e,
|
|
4384
4386
|
setPromptPlaceholder: t,
|
|
@@ -4386,6 +4388,6 @@ function cl() {
|
|
|
4386
4388
|
};
|
|
4387
4389
|
}
|
|
4388
4390
|
//#endregion
|
|
4389
|
-
export {
|
|
4391
|
+
export { Fs as $replaceEditorHTMLContent, Is as $replaceEditorSelectionHTMLContent, Ns as $setSelectionToEnd, pc as AlignmentSelect, mc as AttachmentButton, Mc as BoldButton, qc as CHAT_ACTION_PROTOCOL, No as CanvasShell, Io as CanvasShellCloseTrigger, Bo as CanvasShellContent, Vo as CanvasShellFooter, Lo as CanvasShellFullScreenTrigger, Po as CanvasShellHeader, Ro as CanvasShellOptionsButton, Fo as CanvasShellTitle, Er as ChatCard, dr as ChatCardActionButton, ur as ChatCardActions, Cr as ChatCardAttribute, wr as ChatCardAttributeLabel, Tr as ChatCardAttributeValue, Sr as ChatCardAttributes, mr as ChatCardBody, fr as ChatCardCollapsibleButton, jr as ChatCardContainer, hr as ChatCardContent, _r as ChatCardFooter, br as ChatCardFooterActions, vr as ChatCardFooterNotes, yr as ChatCardFooterPrice, xr as ChatCardForm, ar as ChatCardHeader, sr as ChatCardHeaderContent, or as ChatCardIcon, En as ChatCardListLayout, Dn as ChatCardListLayoutItems, On as ChatCardListLayoutShowMore, pr as ChatCardMedia, gr as ChatCardPreview, lr as ChatCardSubTitle, Hn as ChatCardThreeColumnLayout, Gn as ChatCardThreeColumnLayoutDetails, Un as ChatCardThreeColumnLayoutList, Wn as ChatCardThreeColumnLayoutMain, Kn as ChatCardThreeColumnLayoutPanel, cr as ChatCardTitle, er as ChatCardTwoColumnLayout, tr as ChatCardTwoColumnLayoutAside, nr as ChatCardTwoColumnLayoutMain, Lr as ChatContainer, zr as ChatContainerPrompt, Br as ChatContainerWelcome, Ui as ChatConversationProvider, ii as ChatInput, oi as ChatInputTextarea, ci as ChatList, fi as ChatListEmptyState, pi as ChatListError, _i as ChatListItem, gi as ChatListItems, mi as ChatListLoadMore, di as ChatListSkeleton, Ni as ChatMessage, Fi as ChatMessageActions, $i as ChatMessageAttachmentCard, ra as ChatMessageAttachmentCardActions, ea as ChatMessageAttachmentCardContent, aa as ChatMessageAttachmentCardIcon, na as ChatMessageAttachmentCardPreview, ta as ChatMessageAttachmentCardTitle, Pi as ChatMessageContent, Xi as ChatMessageListGroup, fa as ChatMessageResponse, pa as ChatMessageToolbar, ha as ChatMessageToolbarActionButton, ma as ChatMessageToolbarActions, ga as ChatMessageToolbarTimestamp, qi as ChatMessages, Ji as ChatMessagesList, Qi as ChatMessagesScrollButton, Ta as ChatNotificationCard, Na as ChatNotificationCardActions, Fa as ChatNotificationCardButtons, za as ChatNotificationCardCloseButton, Ba as ChatNotificationCardContent, Ua as ChatNotificationCardContentActions, Ha as ChatNotificationCardContentDescription, Va as ChatNotificationCardContentTitle, Ra as ChatNotificationCardDeleteButton, Ka as ChatNotificationCardDescription, Wa as ChatNotificationCardExpandButton, Ea as ChatNotificationCardHead, Da as ChatNotificationCardHeader, Oa as ChatNotificationCardHeaderIcon, Ma as ChatNotificationCardHeaderStatus, ka as ChatNotificationCardHeaderTitle, Aa as ChatNotificationCardHeaderTitleLabel, Ga as ChatNotificationCardIcon, Ia as ChatNotificationCardReadActionButton, La as ChatNotificationCardSnoozeButton, qa as ChatNotificationCardTimeStamp, Pa as ChatNotificationCardTimestamp, Ja as ChatNotificationPopup, Xa as ChatNotificationPopupContent, Ya as ChatNotificationPopupTrigger, Ti as ChatPromptBox, ji as ChatPromptBoxActionsLeft, Mi as ChatPromptBoxActionsRight, ki as ChatPromptBoxContent, Ai as ChatPromptBoxInput, Oi as ChatPromptBoxToolbar, Ri as ChatProvider, Za as ChatReplies, Qa as ChatReply, $a as ChatReplyLabel, eo as ChatReplyValue, io as ChatSuggestion, co as ChatSuggestionAction, so as ChatSuggestionActions, oo as ChatSuggestionLabel, ao as ChatSuggestionLabelIcon, ro as ChatSuggestions, Uo as ChatThinkingProcess, Jo as ChatThinkingProcessContent, Xo as ChatThinkingProcessContentItem, Wo as ChatThinkingProcessTrigger, qo as ChatThinkingProcessTriggerArrow, Go as ChatThinkingProcessTriggerIcon, Ko as ChatThinkingProcessTriggerLabel, Eo as ChatThread, Ao as ChatThreadAnswer, Mo as ChatThreadErrorState, Oo as ChatThreadGroup, wo as ChatThreadProvider, ko as ChatThreadQuestion, Nc as CleanFormatButton, Ar as EditableChatCardContextProvider, Zo as EmptyState, ts as EmptyStateActionRow, es as EmptyStateDescription, Qo as EmptyStateIcon, $o as EmptyStateTitle, Hc as FormattingToolbarPlugin, Xs as HtmlPastePlugin, Gs as INSERT_HTML_COMMAND, qs as INSERT_HTML_EVENT, Bs as INSERT_IMAGE_COMMAND, Vs as INSERT_IMAGE_EVENT_NAME, Hs as ImageAddedEvent, Pc as ImageButton, Us as ImageDropPlugin, Ys as InsertHtmlEvent, Fc as ItalicButton, Ic as LinkButton, ua as MarkdownViewer, Ho as NewChatTrigger, Ws as PASTE_HTML_COMMAND, Ks as PASTE_HTML_EVENT, Js as PasteHtmlEvent, rc as RichTextArea, Uc as RichTextField, Lc as SizeSelect, Rc as TextColorButton, $ as ToolbarButton, Gc as TopMenu, Kc as TopMenuActions, zc as TypographySelect, Bc as UnderlineButton, zo as canvasShellContentPadding, Ln as chatCardThreeColumnLayoutCardVariants, Fn as chatCardThreeColumnLayoutDetailsVariants, Nn as chatCardThreeColumnLayoutListVariants, Pn as chatCardThreeColumnLayoutMainVariants, In as chatCardThreeColumnLayoutPanelVariants, Mn as chatCardThreeColumnLayoutVariants, Yn as chatCardTwoColumnLayoutAsideVariants, Zn as chatCardTwoColumnLayoutCardVariants, Jn as chatCardTwoColumnLayoutGridVariants, Xn as chatCardTwoColumnLayoutMainVariants, qn as chatCardTwoColumnLayoutVariants, Yc as createChatActionLink, $c as extractChatActionFromLink, Sa as formatSnoozeDate, sa as getAttachmentIcon, _a as getSnoozeUntilDate, Xc as isChatActionURL, Ms as scrollRichTextAreaToBottom, el as useChatActions, Tn as useChatCardListLayoutContext, X as useChatContext, Hi as useChatConversationContext, ni as useChatInputContext, Y as useChatListContext, cl as useChatLoadedIds, wa as useChatNotificationCardContext, ll as useChatPromptPlaceholder, il as useChatStreamMessage, no as useChatSuggestionContext, yo as useChatThread, en as useChatThreadScrollable, ol as useCurrentChatId, Dr as useEditChatCard, kr as useEditableChatCardContext, sl as useIsCurrentChatNew, al as useOnChatChanged, Q as useRichTextAreaEditor, ks as useRichTextAreaSelectedText };
|
|
4390
4392
|
|
|
4391
4393
|
//# sourceMappingURL=index.es.js.map
|