laif-ds 0.1.99 → 0.2.1
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/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/components/ui/chat-message.js +296 -122
- package/dist/components/ui/chat.js +155 -118
- package/dist/components/ui/message-input.js +1 -1
- package/dist/components/ui/message-list.js +21 -17
- package/dist/index.d.ts +10 -2
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- 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
|
@@ -1,218 +1,255 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useAutoScroll as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { CopyButton as
|
|
8
|
-
import { MessageInput as
|
|
9
|
-
import { MessageList as
|
|
10
|
-
import { PromptSuggestions as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
2
|
+
import { jsxs as v, Fragment as y, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as A, useRef as M, useCallback as k, useState as O } from "react";
|
|
4
|
+
import { cn as q } from "../../lib/utils.js";
|
|
5
|
+
import { useAutoScroll as H } from "../../hooks/use-auto-scroll.js";
|
|
6
|
+
import { Button as N } from "./button.js";
|
|
7
|
+
import { CopyButton as S } from "./copy-button.js";
|
|
8
|
+
import { MessageInput as J } from "./message-input.js";
|
|
9
|
+
import { MessageList as K } from "./message-list.js";
|
|
10
|
+
import { PromptSuggestions as Q } from "./prompt-suggestions.js";
|
|
11
|
+
import { Typo as z } from "./typo.js";
|
|
12
|
+
import j from "../../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
13
|
+
import V from "../../node_modules/lucide-react/dist/esm/icons/thumbs-up.js";
|
|
14
|
+
import W from "../../node_modules/lucide-react/dist/esm/icons/thumbs-down.js";
|
|
15
|
+
import X from "../../node_modules/lucide-react/dist/esm/icons/arrow-down.js";
|
|
16
|
+
function Y({
|
|
15
17
|
messages: e,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
welcomeTitle: n = "Da dove iniziamo?",
|
|
19
|
+
handleSubmit: i,
|
|
20
|
+
input: m,
|
|
21
|
+
handleInputChange: c,
|
|
19
22
|
stop: s,
|
|
20
|
-
isGenerating:
|
|
21
|
-
append:
|
|
22
|
-
suggestions:
|
|
23
|
-
className:
|
|
24
|
-
onRateResponse:
|
|
25
|
-
setMessages:
|
|
26
|
-
transcribeAudio:
|
|
23
|
+
isGenerating: u,
|
|
24
|
+
append: f,
|
|
25
|
+
suggestions: h,
|
|
26
|
+
className: D,
|
|
27
|
+
onRateResponse: w,
|
|
28
|
+
setMessages: x,
|
|
29
|
+
transcribeAudio: L,
|
|
30
|
+
allowAttachments: g = !1,
|
|
31
|
+
onEdit: B,
|
|
32
|
+
onMessageSave: d
|
|
27
33
|
}) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
if (s?.(), !
|
|
32
|
-
const
|
|
34
|
+
const P = e.at(-1), T = e.length === 0, I = P?.role === "user", C = M(e);
|
|
35
|
+
C.current = e;
|
|
36
|
+
const U = k(() => {
|
|
37
|
+
if (s?.(), !x) return;
|
|
38
|
+
const o = [...C.current], l = o.findLast(
|
|
33
39
|
(a) => a.role === "assistant"
|
|
34
40
|
);
|
|
35
41
|
if (!l) return;
|
|
36
|
-
let
|
|
42
|
+
let p = !1, b = { ...l };
|
|
37
43
|
if (l.toolInvocations) {
|
|
38
44
|
const a = l.toolInvocations.map(
|
|
39
|
-
(
|
|
40
|
-
...
|
|
45
|
+
(r) => r.state === "call" ? (p = !0, {
|
|
46
|
+
...r,
|
|
41
47
|
state: "result",
|
|
42
48
|
result: {
|
|
43
49
|
content: "Tool execution was cancelled",
|
|
44
50
|
__cancelled: !0
|
|
45
51
|
// Special marker to indicate cancellation
|
|
46
52
|
}
|
|
47
|
-
}) :
|
|
53
|
+
}) : r
|
|
48
54
|
);
|
|
49
|
-
|
|
50
|
-
...
|
|
55
|
+
p && (b = {
|
|
56
|
+
...b,
|
|
51
57
|
toolInvocations: a
|
|
52
58
|
});
|
|
53
59
|
}
|
|
54
60
|
if (l.parts && l.parts.length > 0) {
|
|
55
|
-
const a = l.parts.map((
|
|
56
|
-
...
|
|
61
|
+
const a = l.parts.map((r) => r.type === "tool-invocation" && r.toolInvocation && r.toolInvocation.state === "call" ? (p = !0, {
|
|
62
|
+
...r,
|
|
57
63
|
toolInvocation: {
|
|
58
|
-
...
|
|
64
|
+
...r.toolInvocation,
|
|
59
65
|
state: "result",
|
|
60
66
|
result: {
|
|
61
67
|
content: "Tool execution was cancelled",
|
|
62
68
|
__cancelled: !0
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
|
-
}) :
|
|
66
|
-
|
|
67
|
-
...
|
|
71
|
+
}) : r);
|
|
72
|
+
p && (b = {
|
|
73
|
+
...b,
|
|
68
74
|
parts: a
|
|
69
75
|
});
|
|
70
76
|
}
|
|
71
|
-
if (
|
|
72
|
-
const a =
|
|
73
|
-
(
|
|
77
|
+
if (p) {
|
|
78
|
+
const a = o.findIndex(
|
|
79
|
+
(r) => r.id === l.id
|
|
74
80
|
);
|
|
75
|
-
a !== -1 && (
|
|
81
|
+
a !== -1 && (o[a] = b, x(o));
|
|
76
82
|
}
|
|
77
|
-
}, [s,
|
|
78
|
-
(
|
|
79
|
-
actions:
|
|
83
|
+
}, [s, x, C]), E = k(
|
|
84
|
+
(o) => ({
|
|
85
|
+
actions: w ? /* @__PURE__ */ v(y, { children: [
|
|
80
86
|
/* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
|
|
81
|
-
|
|
87
|
+
S,
|
|
82
88
|
{
|
|
83
|
-
content:
|
|
89
|
+
content: o.content,
|
|
84
90
|
copyMessage: "Copied response to clipboard!"
|
|
85
91
|
}
|
|
86
92
|
) }),
|
|
93
|
+
d && /* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
|
|
94
|
+
N,
|
|
95
|
+
{
|
|
96
|
+
size: "icon",
|
|
97
|
+
variant: "ghost",
|
|
98
|
+
className: "h-6 w-6",
|
|
99
|
+
onClick: () => d(o.id, o.content),
|
|
100
|
+
title: "Save message",
|
|
101
|
+
children: /* @__PURE__ */ t(j, { className: "h-4 w-4" })
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
87
104
|
/* @__PURE__ */ t(
|
|
88
|
-
|
|
105
|
+
N,
|
|
89
106
|
{
|
|
90
107
|
size: "icon",
|
|
91
108
|
variant: "ghost",
|
|
92
109
|
className: "h-6 w-6",
|
|
93
|
-
onClick: () =>
|
|
94
|
-
children: /* @__PURE__ */ t(
|
|
110
|
+
onClick: () => w(o.id, "thumbs-up"),
|
|
111
|
+
children: /* @__PURE__ */ t(V, { className: "h-4 w-4" })
|
|
95
112
|
}
|
|
96
113
|
),
|
|
97
114
|
/* @__PURE__ */ t(
|
|
98
|
-
|
|
115
|
+
N,
|
|
99
116
|
{
|
|
100
117
|
size: "icon",
|
|
101
118
|
variant: "ghost",
|
|
102
119
|
className: "h-6 w-6",
|
|
103
|
-
onClick: () =>
|
|
104
|
-
children: /* @__PURE__ */ t(
|
|
120
|
+
onClick: () => w(o.id, "thumbs-down"),
|
|
121
|
+
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
105
122
|
}
|
|
106
123
|
)
|
|
107
|
-
] }) : /* @__PURE__ */
|
|
108
|
-
|
|
124
|
+
] }) : /* @__PURE__ */ v(y, { children: [
|
|
125
|
+
/* @__PURE__ */ t(
|
|
126
|
+
S,
|
|
127
|
+
{
|
|
128
|
+
content: o.content,
|
|
129
|
+
copyMessage: "Copied response to clipboard!"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
d && /* @__PURE__ */ t("div", { className: "border-d-border border-l pl-1", children: /* @__PURE__ */ t(
|
|
133
|
+
N,
|
|
134
|
+
{
|
|
135
|
+
size: "icon",
|
|
136
|
+
variant: "ghost",
|
|
137
|
+
className: "h-6 w-6",
|
|
138
|
+
onClick: () => d(o.id, o.content),
|
|
139
|
+
title: "Save message",
|
|
140
|
+
children: /* @__PURE__ */ t(j, { className: "h-4 w-4" })
|
|
141
|
+
}
|
|
142
|
+
) })
|
|
143
|
+
] }),
|
|
144
|
+
onMessageSave: d
|
|
145
|
+
}),
|
|
146
|
+
[w, d]
|
|
147
|
+
);
|
|
148
|
+
return /* @__PURE__ */ v(F, { className: D, children: [
|
|
149
|
+
T && /* @__PURE__ */ t("div", { className: "flex flex-1 flex-col items-center justify-center p-8", children: f && h && /* @__PURE__ */ v(y, { children: [
|
|
150
|
+
/* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
|
|
151
|
+
/* @__PURE__ */ t(
|
|
152
|
+
Q,
|
|
109
153
|
{
|
|
110
|
-
|
|
111
|
-
|
|
154
|
+
label: "",
|
|
155
|
+
append: f,
|
|
156
|
+
suggestions: h
|
|
112
157
|
}
|
|
113
158
|
)
|
|
114
|
-
}),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return /* @__PURE__ */ C(S, { className: w, children: [
|
|
118
|
-
A && d && f ? /* @__PURE__ */ t(
|
|
119
|
-
E,
|
|
120
|
-
{
|
|
121
|
-
label: "Try these prompts ✨",
|
|
122
|
-
append: d,
|
|
123
|
-
suggestions: f
|
|
124
|
-
}
|
|
125
|
-
) : null,
|
|
126
|
-
e.length > 0 ? /* @__PURE__ */ t(K, { messages: e, children: /* @__PURE__ */ t(
|
|
127
|
-
U,
|
|
159
|
+
] }) }),
|
|
160
|
+
e.length > 0 ? /* @__PURE__ */ t(Z, { messages: e, children: /* @__PURE__ */ t(
|
|
161
|
+
K,
|
|
128
162
|
{
|
|
129
163
|
messages: e,
|
|
130
|
-
isTyping:
|
|
131
|
-
messageOptions:
|
|
164
|
+
isTyping: I,
|
|
165
|
+
messageOptions: E,
|
|
166
|
+
onEdit: B,
|
|
167
|
+
onMessageSave: d
|
|
132
168
|
}
|
|
133
169
|
) }) : null,
|
|
170
|
+
T && !f && !h && /* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
|
|
134
171
|
/* @__PURE__ */ t(
|
|
135
|
-
|
|
172
|
+
_,
|
|
136
173
|
{
|
|
137
174
|
className: "flex-shrink-0",
|
|
138
|
-
isPending:
|
|
139
|
-
handleSubmit:
|
|
140
|
-
children: ({ files:
|
|
141
|
-
|
|
175
|
+
isPending: u || I,
|
|
176
|
+
handleSubmit: i,
|
|
177
|
+
children: ({ files: o, setFiles: l }) => /* @__PURE__ */ t(
|
|
178
|
+
J,
|
|
142
179
|
{
|
|
143
|
-
value:
|
|
144
|
-
onChange:
|
|
145
|
-
allowAttachments:
|
|
146
|
-
files:
|
|
180
|
+
value: m,
|
|
181
|
+
onChange: c,
|
|
182
|
+
allowAttachments: g,
|
|
183
|
+
files: o,
|
|
147
184
|
setFiles: l,
|
|
148
|
-
stop:
|
|
149
|
-
isGenerating:
|
|
150
|
-
transcribeAudio:
|
|
185
|
+
stop: U,
|
|
186
|
+
isGenerating: u,
|
|
187
|
+
transcribeAudio: L
|
|
151
188
|
}
|
|
152
189
|
)
|
|
153
190
|
}
|
|
154
191
|
)
|
|
155
192
|
] });
|
|
156
193
|
}
|
|
157
|
-
|
|
158
|
-
function
|
|
194
|
+
Y.displayName = "Chat";
|
|
195
|
+
function Z({
|
|
159
196
|
messages: e,
|
|
160
197
|
children: n
|
|
161
198
|
}) {
|
|
162
199
|
const {
|
|
163
200
|
containerRef: i,
|
|
164
|
-
scrollToBottom:
|
|
165
|
-
handleScroll:
|
|
166
|
-
shouldAutoScroll:
|
|
167
|
-
handleTouchStart:
|
|
168
|
-
} =
|
|
169
|
-
return /* @__PURE__ */
|
|
201
|
+
scrollToBottom: m,
|
|
202
|
+
handleScroll: c,
|
|
203
|
+
shouldAutoScroll: s,
|
|
204
|
+
handleTouchStart: u
|
|
205
|
+
} = H([e]);
|
|
206
|
+
return /* @__PURE__ */ v(
|
|
170
207
|
"div",
|
|
171
208
|
{
|
|
172
209
|
className: "relative flex-1 overflow-y-auto pb-4",
|
|
173
210
|
ref: i,
|
|
174
|
-
onScroll:
|
|
175
|
-
onTouchStart:
|
|
211
|
+
onScroll: c,
|
|
212
|
+
onTouchStart: u,
|
|
176
213
|
children: [
|
|
177
214
|
/* @__PURE__ */ t("div", { className: "max-w-full", children: n }),
|
|
178
|
-
!
|
|
179
|
-
|
|
215
|
+
!s && /* @__PURE__ */ t("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 flex items-end justify-end", children: /* @__PURE__ */ t("div", { className: "sticky bottom-0 left-0 flex w-full justify-end", children: /* @__PURE__ */ t(
|
|
216
|
+
N,
|
|
180
217
|
{
|
|
181
|
-
onClick:
|
|
218
|
+
onClick: m,
|
|
182
219
|
className: "animate-in fade-in-0 slide-in-from-bottom-1 pointer-events-auto h-8 w-8 rounded-full ease-in-out",
|
|
183
220
|
size: "icon",
|
|
184
221
|
variant: "ghost",
|
|
185
|
-
children: /* @__PURE__ */ t(
|
|
222
|
+
children: /* @__PURE__ */ t(X, { className: "h-4 w-4" })
|
|
186
223
|
}
|
|
187
224
|
) }) })
|
|
188
225
|
]
|
|
189
226
|
}
|
|
190
227
|
);
|
|
191
228
|
}
|
|
192
|
-
const
|
|
229
|
+
const F = A(({ className: e, ...n }, i) => /* @__PURE__ */ t(
|
|
193
230
|
"div",
|
|
194
231
|
{
|
|
195
232
|
ref: i,
|
|
196
|
-
className:
|
|
233
|
+
className: q("flex h-full max-h-full w-full flex-col", e),
|
|
197
234
|
...n
|
|
198
235
|
}
|
|
199
236
|
));
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
({ children: e, handleSubmit: n, className: i },
|
|
203
|
-
const [
|
|
204
|
-
return /* @__PURE__ */ t("form", { ref:
|
|
205
|
-
if (!
|
|
237
|
+
F.displayName = "ChatContainer";
|
|
238
|
+
const _ = A(
|
|
239
|
+
({ children: e, handleSubmit: n, className: i }, m) => {
|
|
240
|
+
const [c, s] = O(null);
|
|
241
|
+
return /* @__PURE__ */ t("form", { ref: m, onSubmit: (f) => {
|
|
242
|
+
if (!c) {
|
|
206
243
|
n(f);
|
|
207
244
|
return;
|
|
208
245
|
}
|
|
209
|
-
const
|
|
210
|
-
n(f, { experimental_attachments:
|
|
211
|
-
}, className: i, children: e({ files:
|
|
246
|
+
const h = $(c);
|
|
247
|
+
n(f, { experimental_attachments: h }), s(null);
|
|
248
|
+
}, className: i, children: e({ files: c, setFiles: s }) });
|
|
212
249
|
}
|
|
213
250
|
);
|
|
214
|
-
|
|
215
|
-
function
|
|
251
|
+
_.displayName = "ChatForm";
|
|
252
|
+
function $(e) {
|
|
216
253
|
if (typeof window > "u")
|
|
217
254
|
return {};
|
|
218
255
|
const n = new DataTransfer();
|
|
@@ -221,8 +258,8 @@ function Q(e) {
|
|
|
221
258
|
return n.files;
|
|
222
259
|
}
|
|
223
260
|
export {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
261
|
+
Y as Chat,
|
|
262
|
+
F as ChatContainer,
|
|
263
|
+
_ as ChatForm,
|
|
264
|
+
Z as ChatMessages
|
|
228
265
|
};
|
|
@@ -127,7 +127,7 @@ function ie({
|
|
|
127
127
|
onPaste: K,
|
|
128
128
|
onKeyDown: U,
|
|
129
129
|
className: C(
|
|
130
|
-
"border-d-input bg-d-
|
|
130
|
+
"border-d-input bg-d-input ring-offset-d-background placeholder:text-d-muted-foreground focus-visible:border-d-primary z-10 w-full grow resize-none rounded-xl border p-3 pr-24 text-sm transition-[border] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
131
131
|
z && "pb-16",
|
|
132
132
|
n
|
|
133
133
|
),
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { ChatMessage as
|
|
4
|
-
import { TypingIndicator as
|
|
5
|
-
function
|
|
6
|
-
messages:
|
|
2
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { ChatMessage as s } from "./chat-message.js";
|
|
4
|
+
import { TypingIndicator as m } from "./typing-indicator.js";
|
|
5
|
+
function x({
|
|
6
|
+
messages: n,
|
|
7
7
|
showTimeStamps: e = !0,
|
|
8
|
-
isTyping:
|
|
9
|
-
messageOptions:
|
|
8
|
+
isTyping: a = !1,
|
|
9
|
+
messageOptions: i,
|
|
10
|
+
onEdit: t,
|
|
11
|
+
onMessageSave: c
|
|
10
12
|
}) {
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
13
|
+
return /* @__PURE__ */ l("div", { className: "space-y-4 overflow-visible", children: [
|
|
14
|
+
n.map((o, f) => {
|
|
15
|
+
const p = typeof i == "function" ? i(o) : i;
|
|
16
|
+
return /* @__PURE__ */ r(
|
|
17
|
+
s,
|
|
16
18
|
{
|
|
17
19
|
showTimeStamp: e,
|
|
18
|
-
...
|
|
19
|
-
...
|
|
20
|
+
...o,
|
|
21
|
+
...p,
|
|
22
|
+
onEdit: t ? (d) => t(o.id, d) : void 0,
|
|
23
|
+
onMessageSave: c
|
|
20
24
|
},
|
|
21
|
-
|
|
25
|
+
f
|
|
22
26
|
);
|
|
23
27
|
}),
|
|
24
|
-
|
|
28
|
+
a && /* @__PURE__ */ r(m, {})
|
|
25
29
|
] });
|
|
26
30
|
}
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
x as MessageList
|
|
29
33
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -436,7 +436,7 @@ export declare function ChartTooltipContent({ active, payload, className, indica
|
|
|
436
436
|
labelKey?: string;
|
|
437
437
|
} & React_2.HTMLAttributes<HTMLDivElement>): JSX.Element | null;
|
|
438
438
|
|
|
439
|
-
export declare function Chat({ messages, handleSubmit, input, handleInputChange, stop, isGenerating, append, suggestions, className, onRateResponse, setMessages, transcribeAudio, }: ChatProps): JSX.Element;
|
|
439
|
+
export declare function Chat({ messages, welcomeTitle, handleSubmit, input, handleInputChange, stop, isGenerating, append, suggestions, className, onRateResponse, setMessages, transcribeAudio, allowAttachments, onEdit, onMessageSave, }: ChatProps): JSX.Element;
|
|
440
440
|
|
|
441
441
|
export declare namespace Chat {
|
|
442
442
|
var displayName: string;
|
|
@@ -471,6 +471,8 @@ export declare interface ChatMessageProps extends Message {
|
|
|
471
471
|
showTimeStamp?: boolean;
|
|
472
472
|
animation?: Animation_2;
|
|
473
473
|
actions?: default_3.ReactNode;
|
|
474
|
+
onEdit?: (newContent: string) => void;
|
|
475
|
+
onMessageSave?: (messageId: string, content: string) => void;
|
|
474
476
|
}
|
|
475
477
|
|
|
476
478
|
export declare function ChatMessages({ messages, children, }: React.PropsWithChildren<{
|
|
@@ -494,6 +496,10 @@ declare interface ChatPropsBase {
|
|
|
494
496
|
onRateResponse?: (messageId: string, rating: "thumbs-up" | "thumbs-down") => void;
|
|
495
497
|
setMessages?: (messages: any[]) => void;
|
|
496
498
|
transcribeAudio?: (blob: Blob) => Promise<string>;
|
|
499
|
+
allowAttachments?: boolean;
|
|
500
|
+
onEdit?: (messageId: string, newContent: string) => void;
|
|
501
|
+
onMessageSave?: (messageId: string, content: string) => void;
|
|
502
|
+
welcomeTitle?: string;
|
|
497
503
|
}
|
|
498
504
|
|
|
499
505
|
declare interface ChatPropsWithoutSuggestions extends ChatPropsBase {
|
|
@@ -1173,13 +1179,15 @@ declare interface MessageInputWithoutAttachmentProps extends MessageInputBasePro
|
|
|
1173
1179
|
allowAttachments?: false;
|
|
1174
1180
|
}
|
|
1175
1181
|
|
|
1176
|
-
export declare function MessageList({ messages, showTimeStamps, isTyping, messageOptions, }: MessageListProps): JSX.Element;
|
|
1182
|
+
export declare function MessageList({ messages, showTimeStamps, isTyping, messageOptions, onEdit, onMessageSave, }: MessageListProps): JSX.Element;
|
|
1177
1183
|
|
|
1178
1184
|
declare interface MessageListProps {
|
|
1179
1185
|
messages: Message[];
|
|
1180
1186
|
showTimeStamps?: boolean;
|
|
1181
1187
|
isTyping?: boolean;
|
|
1182
1188
|
messageOptions?: AdditionalMessageOptions | ((message: Message) => AdditionalMessageOptions);
|
|
1189
|
+
onEdit?: (messageId: string, newContent: string) => void;
|
|
1190
|
+
onMessageSave?: (messageId: string, content: string) => void;
|
|
1183
1191
|
}
|
|
1184
1192
|
|
|
1185
1193
|
declare type MessagePart = TextPart | ReasoningPart | ToolInvocationPart | SourcePart;
|
|
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
|
|
|
3
3
|
import { ok as u } from "../../devlop/lib/default.js";
|
|
4
4
|
import { svg as m, html as C } from "../../property-information/index.js";
|
|
5
5
|
import { stringify as N } from "../../space-separated-tokens/index.js";
|
|
6
|
-
import S from "../../../_virtual/
|
|
6
|
+
import S from "../../../_virtual/index3.js";
|
|
7
7
|
import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
|
|
8
8
|
import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
|
|
9
9
|
import { VFileMessage as h } from "../../vfile-message/lib/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { bail as P } from "../../bail/index.js";
|
|
3
|
-
import y from "../../../_virtual/
|
|
3
|
+
import y from "../../../_virtual/index4.js";
|
|
4
4
|
import z from "../../is-plain-obj/index.js";
|
|
5
5
|
import { CallableInstance as C } from "./callable-instance.js";
|
|
6
6
|
import { trough as A } from "../../trough/lib/index.js";
|