laif-ds 0.2.80 → 0.2.84
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/CHANGELOG.md +40 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +2 -5
- package/dist/agent-docs/adoption-report.json +17 -13
- package/dist/agent-docs/components/AppEditor.md +117 -7
- package/dist/agent-docs/components/Chat.md +1 -0
- package/dist/agent-docs/components/FileUploader.md +8 -3
- package/dist/agent-docs/manifest.json +125 -19
- package/dist/components/editor/nodes/mention-node.js +113 -0
- package/dist/components/editor/plugins/mention-plugin.js +215 -0
- package/dist/components/editor/plugins/toolbar/mention-insert-toolbar-plugin.js +41 -0
- package/dist/components/ui/app-editor.js +150 -112
- package/dist/components/ui/chat.js +35 -33
- package/dist/components/ui/file-previewer.js +66 -61
- package/dist/components/ui/file-uploader.js +116 -112
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/index.d.ts +44 -5
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +5 -5
- package/dist/node_modules/@lexical/react/LexicalTypeaheadMenuPlugin.prod.js +220 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/lexical/Lexical.prod.js +314 -303
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- /package/dist/agent-docs/{truncated-cell.md → components/truncated-cell.md} +0 -0
|
@@ -1,169 +1,207 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import { ListNode as
|
|
4
|
-
import {
|
|
5
|
-
import { CheckListPlugin as
|
|
6
|
-
import { ClearEditorPlugin as
|
|
7
|
-
import { LexicalComposer as
|
|
8
|
-
import { useLexicalComposerContext as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HistoryPlugin as
|
|
11
|
-
import { ListPlugin as
|
|
12
|
-
import { OnChangePlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { HeadingNode as
|
|
15
|
-
import { ParagraphNode as
|
|
16
|
-
import { useState as
|
|
17
|
-
import { ContentEditable as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
2
|
+
import { jsx as r, jsxs as t, Fragment as p } from "react/jsx-runtime";
|
|
3
|
+
import { ListNode as D, ListItemNode as H } from "../../node_modules/@lexical/list/LexicalList.prod.js";
|
|
4
|
+
import { TRANSFORMERS as z, $convertToMarkdownString as U, $convertFromMarkdownString as _ } from "../../node_modules/@lexical/markdown/LexicalMarkdown.prod.js";
|
|
5
|
+
import { CheckListPlugin as Q } from "../../node_modules/@lexical/react/LexicalCheckListPlugin.prod.js";
|
|
6
|
+
import { ClearEditorPlugin as J } from "../../node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js";
|
|
7
|
+
import { LexicalComposer as q } from "../../node_modules/@lexical/react/LexicalComposer.prod.js";
|
|
8
|
+
import { useLexicalComposerContext as G } from "../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
9
|
+
import { LexicalErrorBoundary as K } from "../../node_modules/@lexical/react/LexicalErrorBoundary.prod.js";
|
|
10
|
+
import { HistoryPlugin as W } from "../../node_modules/@lexical/react/LexicalHistoryPlugin.prod.js";
|
|
11
|
+
import { ListPlugin as X } from "../../node_modules/@lexical/react/LexicalListPlugin.prod.js";
|
|
12
|
+
import { OnChangePlugin as Y } from "../../node_modules/@lexical/react/LexicalOnChangePlugin.prod.js";
|
|
13
|
+
import { RichTextPlugin as Z } from "../../node_modules/@lexical/react/LexicalRichTextPlugin.prod.js";
|
|
14
|
+
import { HeadingNode as V, QuoteNode as rr } from "../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
|
|
15
|
+
import { ParagraphNode as g, TextNode as h, $nodesOfType as or, $getRoot as b } from "../../node_modules/lexical/Lexical.prod.js";
|
|
16
|
+
import { useState as er, useMemo as tr, useEffect as ir } from "react";
|
|
17
|
+
import { ContentEditable as nr } from "../editor/editor-ui/content-editable.js";
|
|
18
|
+
import { MentionNode as S } from "../editor/nodes/mention-node.js";
|
|
19
|
+
import { ActionsPlugin as lr } from "../editor/plugins/actions/actions-plugin.js";
|
|
20
|
+
import { ClearEditorActionPlugin as ar } from "../editor/plugins/actions/clear-editor-plugin.js";
|
|
21
|
+
import { CounterCharacterPlugin as sr } from "../editor/plugins/actions/counter-character-plugin.js";
|
|
22
|
+
import { MENTION_TRANSFORMER as mr, MentionPlugin as cr, collectMentions as dr } from "../editor/plugins/mention-plugin.js";
|
|
23
|
+
import { FormatBulletedList as fr } from "../editor/plugins/toolbar/block-format/format-bulleted-list.js";
|
|
24
|
+
import { FormatCheckList as pr } from "../editor/plugins/toolbar/block-format/format-check-list.js";
|
|
25
|
+
import { FormatHeading as ur } from "../editor/plugins/toolbar/block-format/format-heading.js";
|
|
26
|
+
import { FormatNumberedList as gr } from "../editor/plugins/toolbar/block-format/format-numbered-list.js";
|
|
27
|
+
import { FormatParagraph as hr } from "../editor/plugins/toolbar/block-format/format-paragraph.js";
|
|
28
|
+
import { FormatQuote as br } from "../editor/plugins/toolbar/block-format/format-quote.js";
|
|
29
|
+
import { BlockFormatDropDown as xr } from "../editor/plugins/toolbar/block-format-toolbar-plugin.js";
|
|
30
|
+
import { FontFormatToolbarPlugin as d } from "../editor/plugins/toolbar/font-format-toolbar-plugin.js";
|
|
31
|
+
import { MentionInsertToolbarPlugin as Nr } from "../editor/plugins/toolbar/mention-insert-toolbar-plugin.js";
|
|
32
|
+
import { ToolbarPlugin as u } from "../editor/plugins/toolbar/toolbar-plugin.js";
|
|
33
|
+
import { editorTheme as vr } from "../editor/themes/editor-theme.js";
|
|
34
|
+
import { TooltipProvider as Er } from "./tooltip.js";
|
|
35
|
+
import { HistoryToolbarPlugin as Fr } from "../editor/plugins/toolbar/history-toolbar-plugin.js";
|
|
36
|
+
import { cn as Pr } from "../../lib/utils.js";
|
|
37
|
+
const yr = "Start typing...", Cr = {
|
|
35
38
|
format: ["underline"],
|
|
36
39
|
tag: "++",
|
|
37
40
|
type: "text-format"
|
|
38
|
-
},
|
|
39
|
-
...
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
function
|
|
41
|
+
}, w = [
|
|
42
|
+
...z,
|
|
43
|
+
Cr
|
|
44
|
+
], Rr = (o) => o.replace(/<u>(.*?)<\/u>/g, "++$1++"), Tr = (o) => o.replace(/\+\+(.+?)\+\+/g, "<u>$1</u>");
|
|
45
|
+
function Sr({
|
|
43
46
|
defaultValue: o,
|
|
44
|
-
onlyMarkdown:
|
|
47
|
+
onlyMarkdown: a,
|
|
48
|
+
transformers: n
|
|
45
49
|
}) {
|
|
46
|
-
const [
|
|
47
|
-
return
|
|
48
|
-
o &&
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
) :
|
|
53
|
-
new
|
|
50
|
+
const [s] = G();
|
|
51
|
+
return ir(() => {
|
|
52
|
+
o && s.update(() => {
|
|
53
|
+
a ? _(
|
|
54
|
+
Rr(o),
|
|
55
|
+
n
|
|
56
|
+
) : b().append(
|
|
57
|
+
new g().append(new h(o))
|
|
54
58
|
);
|
|
55
|
-
const
|
|
56
|
-
(
|
|
59
|
+
const m = b();
|
|
60
|
+
(m.getFirstChild() ?? m).selectStart();
|
|
57
61
|
});
|
|
58
|
-
}, [
|
|
62
|
+
}, [s, o, a, n]), null;
|
|
59
63
|
}
|
|
60
|
-
function
|
|
64
|
+
function co({
|
|
61
65
|
defaultValue: o,
|
|
62
|
-
onMarkdownEdit:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
onMarkdownEdit: a,
|
|
67
|
+
onValueChange: n,
|
|
68
|
+
plugins: s = [],
|
|
69
|
+
toolbars: m = [],
|
|
70
|
+
placeholder: M = yr,
|
|
71
|
+
onlyMarkdown: x = !0,
|
|
72
|
+
className: L = "rounded-lg border border-d-border",
|
|
73
|
+
wrpClassName: A = "",
|
|
74
|
+
mentions: c,
|
|
75
|
+
mentionTrigger: N = "@"
|
|
69
76
|
}) {
|
|
70
|
-
const [,
|
|
77
|
+
const [, k] = er(null), l = c !== void 0, v = tr(
|
|
78
|
+
() => l ? [mr, ...w] : w,
|
|
79
|
+
[l]
|
|
80
|
+
), O = {
|
|
71
81
|
namespace: "AppEditor",
|
|
72
|
-
theme:
|
|
82
|
+
theme: vr,
|
|
73
83
|
nodes: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
V,
|
|
85
|
+
g,
|
|
86
|
+
h,
|
|
87
|
+
rr,
|
|
88
|
+
D,
|
|
89
|
+
H,
|
|
90
|
+
...l ? [S] : []
|
|
80
91
|
],
|
|
81
|
-
onError: (
|
|
82
|
-
console.error(
|
|
92
|
+
onError: (e) => {
|
|
93
|
+
console.error(e);
|
|
83
94
|
},
|
|
84
|
-
...o && !
|
|
95
|
+
...o && !x ? {
|
|
85
96
|
editorState: () => {
|
|
86
|
-
|
|
87
|
-
new
|
|
97
|
+
b().append(
|
|
98
|
+
new g().append(new h(o))
|
|
88
99
|
);
|
|
89
100
|
}
|
|
90
101
|
} : {}
|
|
91
|
-
},
|
|
92
|
-
return /* @__PURE__ */ r("div", { className:
|
|
102
|
+
}, E = (e) => s.includes(e), f = (e) => m.includes(e), F = E("clear"), P = E("counter"), y = f("block-format"), I = f("font-format"), C = f("history");
|
|
103
|
+
return /* @__PURE__ */ r("div", { className: Pr("bg-d-background flex h-96 flex-col", A), children: /* @__PURE__ */ r(q, { initialConfig: O, children: /* @__PURE__ */ t(Er, { children: [
|
|
93
104
|
o && /* @__PURE__ */ r(
|
|
94
|
-
|
|
105
|
+
Sr,
|
|
95
106
|
{
|
|
96
107
|
defaultValue: o,
|
|
97
|
-
onlyMarkdown:
|
|
108
|
+
onlyMarkdown: x,
|
|
109
|
+
transformers: v
|
|
98
110
|
}
|
|
99
111
|
),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */ r(
|
|
105
|
-
/* @__PURE__ */ r(
|
|
106
|
-
/* @__PURE__ */ r(
|
|
107
|
-
/* @__PURE__ */ r(
|
|
108
|
-
/* @__PURE__ */ r(
|
|
112
|
+
l && /* @__PURE__ */ r(cr, { source: c, trigger: N }),
|
|
113
|
+
/* @__PURE__ */ t("div", { className: "border-d-border flex items-center border-b", children: [
|
|
114
|
+
C && /* @__PURE__ */ r(u, { children: () => /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ r(Fr, {}) }) }),
|
|
115
|
+
y && /* @__PURE__ */ r(u, { children: () => /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ t(xr, { children: [
|
|
116
|
+
/* @__PURE__ */ r(hr, {}),
|
|
117
|
+
/* @__PURE__ */ r(ur, { levels: ["h1", "h2", "h3"] }),
|
|
118
|
+
/* @__PURE__ */ r(gr, {}),
|
|
119
|
+
/* @__PURE__ */ r(fr, {}),
|
|
120
|
+
/* @__PURE__ */ r(pr, {}),
|
|
121
|
+
/* @__PURE__ */ r(br, {})
|
|
109
122
|
] }) }) }) }),
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */ r(
|
|
112
|
-
/* @__PURE__ */ r(
|
|
113
|
-
/* @__PURE__ */ r(
|
|
114
|
-
/* @__PURE__ */ r(
|
|
123
|
+
I && /* @__PURE__ */ r(u, { children: () => /* @__PURE__ */ t("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: [
|
|
124
|
+
/* @__PURE__ */ r(d, { format: "bold" }),
|
|
125
|
+
/* @__PURE__ */ r(d, { format: "italic" }),
|
|
126
|
+
/* @__PURE__ */ r(d, { format: "underline" }),
|
|
127
|
+
/* @__PURE__ */ r(d, { format: "strikethrough" }),
|
|
128
|
+
l && /* @__PURE__ */ r(
|
|
129
|
+
Nr,
|
|
130
|
+
{
|
|
131
|
+
trigger: N ?? "@"
|
|
132
|
+
}
|
|
133
|
+
)
|
|
115
134
|
] }) })
|
|
116
135
|
] }),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
136
|
+
/* @__PURE__ */ t("div", { className: "relative flex min-h-0 w-full flex-1 flex-col", children: [
|
|
137
|
+
C && /* @__PURE__ */ r(W, {}),
|
|
119
138
|
/* @__PURE__ */ r(
|
|
120
|
-
|
|
139
|
+
Z,
|
|
121
140
|
{
|
|
122
|
-
ErrorBoundary:
|
|
141
|
+
ErrorBoundary: K,
|
|
123
142
|
contentEditable: /* @__PURE__ */ r(
|
|
124
143
|
"div",
|
|
125
144
|
{
|
|
126
|
-
ref:
|
|
145
|
+
ref: k,
|
|
127
146
|
className: "flex min-h-0 w-full flex-1 overflow-auto",
|
|
128
147
|
children: /* @__PURE__ */ r(
|
|
129
|
-
|
|
148
|
+
nr,
|
|
130
149
|
{
|
|
131
|
-
placeholder:
|
|
132
|
-
className: `border-d-border w-full rounded-none border-b ${
|
|
150
|
+
placeholder: M,
|
|
151
|
+
className: `border-d-border w-full rounded-none border-b ${L}`
|
|
133
152
|
}
|
|
134
153
|
)
|
|
135
154
|
}
|
|
136
155
|
)
|
|
137
156
|
}
|
|
138
157
|
),
|
|
139
|
-
|
|
140
|
-
/* @__PURE__ */ r(
|
|
141
|
-
/* @__PURE__ */ r(
|
|
158
|
+
y && /* @__PURE__ */ t(p, { children: [
|
|
159
|
+
/* @__PURE__ */ r(X, {}),
|
|
160
|
+
/* @__PURE__ */ r(Q, {})
|
|
142
161
|
] }),
|
|
143
|
-
(
|
|
162
|
+
(F || P) && /* @__PURE__ */ r(lr, { children: /* @__PURE__ */ t("div", { className: "clear-both flex items-center justify-between gap-2 p-1", children: [
|
|
144
163
|
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-start" }),
|
|
145
|
-
/* @__PURE__ */ r("div", { children:
|
|
146
|
-
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-end gap-2", children:
|
|
147
|
-
/* @__PURE__ */ r(
|
|
148
|
-
/* @__PURE__ */ r(
|
|
164
|
+
/* @__PURE__ */ r("div", { children: P && /* @__PURE__ */ r(sr, { charset: "UTF-16" }) }),
|
|
165
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-end gap-2", children: F && /* @__PURE__ */ t(p, { children: [
|
|
166
|
+
/* @__PURE__ */ r(ar, {}),
|
|
167
|
+
/* @__PURE__ */ r(J, {})
|
|
149
168
|
] }) })
|
|
150
169
|
] }) })
|
|
151
170
|
] }),
|
|
152
171
|
/* @__PURE__ */ r(
|
|
153
|
-
|
|
172
|
+
Y,
|
|
154
173
|
{
|
|
155
174
|
ignoreSelectionChange: !0,
|
|
156
|
-
onChange: (
|
|
157
|
-
if (!
|
|
158
|
-
const R =
|
|
159
|
-
() =>
|
|
175
|
+
onChange: (e) => {
|
|
176
|
+
if (!n && !a) return;
|
|
177
|
+
const R = Tr(
|
|
178
|
+
e.read(() => U(v))
|
|
160
179
|
);
|
|
161
|
-
|
|
180
|
+
if (!n) {
|
|
181
|
+
a?.(R);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
let T = [];
|
|
185
|
+
if (l) {
|
|
186
|
+
const $ = e.read(
|
|
187
|
+
() => dr(or(S))
|
|
188
|
+
), j = Array.isArray(c) ? c : [], B = new Map(
|
|
189
|
+
j.map((i) => [String(i.id), i])
|
|
190
|
+
);
|
|
191
|
+
T = $.map(
|
|
192
|
+
(i) => B.get(String(i.id)) ?? {
|
|
193
|
+
id: i.id,
|
|
194
|
+
label: i.label,
|
|
195
|
+
value: i.value
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
n(R, { mentions: T });
|
|
162
200
|
}
|
|
163
201
|
}
|
|
164
202
|
)
|
|
165
203
|
] }) }) });
|
|
166
204
|
}
|
|
167
205
|
export {
|
|
168
|
-
|
|
206
|
+
co as AppEditor
|
|
169
207
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as b, Fragment as y, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as A, useRef as
|
|
3
|
+
import { forwardRef as A, useRef as O, useCallback as k, useState as q } from "react";
|
|
4
4
|
import { Button as v } from "./button.js";
|
|
5
5
|
import { CopyButton as S } from "./copy-button.js";
|
|
6
|
-
import { MessageInput as
|
|
7
|
-
import { MessageList as
|
|
8
|
-
import { PromptSuggestions as
|
|
9
|
-
import { useAutoScroll as
|
|
10
|
-
import { cn as
|
|
6
|
+
import { MessageInput as H } from "./message-input.js";
|
|
7
|
+
import { MessageList as J } from "./message-list.js";
|
|
8
|
+
import { PromptSuggestions as K } from "./prompt-suggestions.js";
|
|
9
|
+
import { useAutoScroll as Q } from "../../hooks/use-auto-scroll.js";
|
|
10
|
+
import { cn as V } from "../../lib/utils.js";
|
|
11
11
|
import { Typo as z } from "./typo.js";
|
|
12
12
|
import j from "../../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
function
|
|
13
|
+
import W from "../../node_modules/lucide-react/dist/esm/icons/thumbs-up.js";
|
|
14
|
+
import X from "../../node_modules/lucide-react/dist/esm/icons/thumbs-down.js";
|
|
15
|
+
import Y from "../../node_modules/lucide-react/dist/esm/icons/arrow-down.js";
|
|
16
|
+
function Z({
|
|
17
17
|
messages: o,
|
|
18
18
|
welcomeTitle: n = "Da dove iniziamo?",
|
|
19
19
|
handleSubmit: i,
|
|
@@ -29,11 +29,12 @@ function Y({
|
|
|
29
29
|
transcribeAudio: D,
|
|
30
30
|
allowAttachments: L = !1,
|
|
31
31
|
onEdit: B,
|
|
32
|
-
onMessageSave: d
|
|
32
|
+
onMessageSave: d,
|
|
33
|
+
placeholder: P
|
|
33
34
|
}) {
|
|
34
|
-
const
|
|
35
|
+
const U = o.at(-1), T = o.length === 0, I = U?.role === "user", C = O(o);
|
|
35
36
|
C.current = o;
|
|
36
|
-
const
|
|
37
|
+
const E = k(() => {
|
|
37
38
|
if (s?.(), !x) return;
|
|
38
39
|
const e = [...C.current], l = e.findLast(
|
|
39
40
|
(a) => a.role === "assistant"
|
|
@@ -81,7 +82,7 @@ function Y({
|
|
|
81
82
|
);
|
|
82
83
|
a !== -1 && (e[a] = p, x(e));
|
|
83
84
|
}
|
|
84
|
-
}, [s, x, C]),
|
|
85
|
+
}, [s, x, C]), M = k(
|
|
85
86
|
(e) => ({
|
|
86
87
|
actions: N ? /* @__PURE__ */ b(y, { children: [
|
|
87
88
|
/* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
|
|
@@ -109,7 +110,7 @@ function Y({
|
|
|
109
110
|
variant: "ghost",
|
|
110
111
|
className: "h-6 w-6",
|
|
111
112
|
onClick: () => N(e.id, "thumbs-up"),
|
|
112
|
-
children: /* @__PURE__ */ t(
|
|
113
|
+
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
113
114
|
}
|
|
114
115
|
),
|
|
115
116
|
/* @__PURE__ */ t(
|
|
@@ -119,7 +120,7 @@ function Y({
|
|
|
119
120
|
variant: "ghost",
|
|
120
121
|
className: "h-6 w-6",
|
|
121
122
|
onClick: () => N(e.id, "thumbs-down"),
|
|
122
|
-
children: /* @__PURE__ */ t(
|
|
123
|
+
children: /* @__PURE__ */ t(X, { className: "h-4 w-4" })
|
|
123
124
|
}
|
|
124
125
|
)
|
|
125
126
|
] }) : /* @__PURE__ */ b(y, { children: [
|
|
@@ -150,7 +151,7 @@ function Y({
|
|
|
150
151
|
T && /* @__PURE__ */ t("div", { className: "flex flex-1 flex-col items-center justify-center p-8", children: m && u && /* @__PURE__ */ b(y, { children: [
|
|
151
152
|
/* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
|
|
152
153
|
/* @__PURE__ */ t(
|
|
153
|
-
|
|
154
|
+
K,
|
|
154
155
|
{
|
|
155
156
|
label: "",
|
|
156
157
|
append: m,
|
|
@@ -158,12 +159,12 @@ function Y({
|
|
|
158
159
|
}
|
|
159
160
|
)
|
|
160
161
|
] }) }),
|
|
161
|
-
o.length > 0 ? /* @__PURE__ */ t(
|
|
162
|
-
|
|
162
|
+
o.length > 0 ? /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
163
|
+
J,
|
|
163
164
|
{
|
|
164
165
|
messages: o,
|
|
165
166
|
isTyping: I,
|
|
166
|
-
messageOptions:
|
|
167
|
+
messageOptions: M,
|
|
167
168
|
onEdit: B,
|
|
168
169
|
onMessageSave: d
|
|
169
170
|
}
|
|
@@ -176,31 +177,32 @@ function Y({
|
|
|
176
177
|
isPending: w || I,
|
|
177
178
|
handleSubmit: i,
|
|
178
179
|
children: ({ files: e, setFiles: l }) => /* @__PURE__ */ t(
|
|
179
|
-
|
|
180
|
+
H,
|
|
180
181
|
{
|
|
181
182
|
value: f,
|
|
182
183
|
onChange: c,
|
|
183
184
|
allowAttachments: L,
|
|
184
185
|
files: e,
|
|
185
186
|
setFiles: l,
|
|
186
|
-
stop:
|
|
187
|
+
stop: E,
|
|
187
188
|
isGenerating: w,
|
|
188
|
-
transcribeAudio: D
|
|
189
|
+
transcribeAudio: D,
|
|
190
|
+
placeholder: P
|
|
189
191
|
}
|
|
190
192
|
)
|
|
191
193
|
}
|
|
192
194
|
)
|
|
193
195
|
] });
|
|
194
196
|
}
|
|
195
|
-
|
|
196
|
-
function
|
|
197
|
+
Z.displayName = "Chat";
|
|
198
|
+
function $({ children: o }) {
|
|
197
199
|
const {
|
|
198
200
|
containerRef: n,
|
|
199
201
|
scrollToBottom: i,
|
|
200
202
|
handleScroll: f,
|
|
201
203
|
shouldAutoScroll: c,
|
|
202
204
|
handleTouchStart: s
|
|
203
|
-
} =
|
|
205
|
+
} = Q();
|
|
204
206
|
return /* @__PURE__ */ b(
|
|
205
207
|
"div",
|
|
206
208
|
{
|
|
@@ -217,7 +219,7 @@ function Z({ children: o }) {
|
|
|
217
219
|
className: "animate-in fade-in-0 slide-in-from-bottom-1 pointer-events-auto h-8 w-8 rounded-full ease-in-out",
|
|
218
220
|
size: "icon",
|
|
219
221
|
variant: "ghost",
|
|
220
|
-
children: /* @__PURE__ */ t(
|
|
222
|
+
children: /* @__PURE__ */ t(Y, { className: "h-4 w-4" })
|
|
221
223
|
}
|
|
222
224
|
) }) })
|
|
223
225
|
]
|
|
@@ -228,26 +230,26 @@ const F = A(({ className: o, ...n }, i) => /* @__PURE__ */ t(
|
|
|
228
230
|
"div",
|
|
229
231
|
{
|
|
230
232
|
ref: i,
|
|
231
|
-
className:
|
|
233
|
+
className: V("flex h-full max-h-full w-full flex-col", o),
|
|
232
234
|
...n
|
|
233
235
|
}
|
|
234
236
|
));
|
|
235
237
|
F.displayName = "ChatContainer";
|
|
236
238
|
const _ = A(
|
|
237
239
|
({ children: o, handleSubmit: n, className: i }, f) => {
|
|
238
|
-
const [c, s] =
|
|
240
|
+
const [c, s] = q(null);
|
|
239
241
|
return /* @__PURE__ */ t("form", { ref: f, onSubmit: (m) => {
|
|
240
242
|
if (!c) {
|
|
241
243
|
n(m);
|
|
242
244
|
return;
|
|
243
245
|
}
|
|
244
|
-
const u =
|
|
246
|
+
const u = G(c);
|
|
245
247
|
n(m, { experimental_attachments: u }), s(null);
|
|
246
248
|
}, className: i, children: o({ files: c, setFiles: s }) });
|
|
247
249
|
}
|
|
248
250
|
);
|
|
249
251
|
_.displayName = "ChatForm";
|
|
250
|
-
function
|
|
252
|
+
function G(o) {
|
|
251
253
|
if (typeof window > "u")
|
|
252
254
|
return {};
|
|
253
255
|
const n = new DataTransfer();
|
|
@@ -256,8 +258,8 @@ function $(o) {
|
|
|
256
258
|
return n.files;
|
|
257
259
|
}
|
|
258
260
|
export {
|
|
259
|
-
|
|
261
|
+
Z as Chat,
|
|
260
262
|
F as ChatContainer,
|
|
261
263
|
_ as ChatForm,
|
|
262
|
-
|
|
264
|
+
$ as ChatMessages
|
|
263
265
|
};
|