laif-ds 0.2.1 → 0.2.2

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.
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
- var t = e();
5
- const a = /* @__PURE__ */ r(t);
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
+ var r = t();
5
+ const m = /* @__PURE__ */ e(r);
6
6
  export {
7
- a as default
7
+ m as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as r } from "../node_modules/extend/index.js";
4
- var t = r();
5
- const x = /* @__PURE__ */ e(t);
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
+ var t = e();
5
+ const a = /* @__PURE__ */ r(t);
6
6
  export {
7
- x as default
7
+ a as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
- var r = t();
5
- const m = /* @__PURE__ */ e(r);
3
+ import { __require as r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
6
6
  export {
7
- m as default
7
+ x as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = {};
2
+ var e = { exports: {} };
3
3
  export {
4
- e as __exports
4
+ e as __module
5
5
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ var e = {};
3
3
  export {
4
- e as __module
4
+ e as __exports
5
5
  };
@@ -1,21 +1,21 @@
1
1
  "use client";
2
- import { jsxs as o, jsx as e, Fragment as C } from "react/jsx-runtime";
3
- import { useMemo as I, useState as B, useRef as M, useEffect as F, Suspense as w } from "react";
4
- import { cva as W } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { motion as $ } from "framer-motion";
2
+ import { jsxs as n, jsx as e, Fragment as T } from "react/jsx-runtime";
3
+ import { useMemo as P, useState as N, useRef as V, useEffect as j, Suspense as D } from "react";
4
+ import { cva as X } from "../../node_modules/class-variance-authority/dist/index.js";
5
+ import { motion as J } from "framer-motion";
6
6
  import { cn as l } from "../../lib/utils.js";
7
- import { Collapsible as j, CollapsibleTrigger as L, CollapsibleContent as P } from "./collapsible.js";
8
- import { FilePreview as V } from "./file-preview.js";
9
- import { MarkdownRenderer as k } from "./markdown-renderer.js";
10
- import E from "../../node_modules/lucide-react/dist/esm/icons/x.js";
11
- import S from "../../node_modules/lucide-react/dist/esm/icons/check.js";
12
- import U from "../../node_modules/lucide-react/dist/esm/icons/pen.js";
13
- import X from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
14
- import z from "../../node_modules/lucide-react/dist/esm/icons/ban.js";
15
- import J from "../../node_modules/lucide-react/dist/esm/icons/code-xml.js";
16
- import _ from "../../node_modules/lucide-react/dist/esm/icons/terminal.js";
17
- import q from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
18
- const R = W(
7
+ import { Collapsible as _, CollapsibleTrigger as q, CollapsibleContent as G } from "./collapsible.js";
8
+ import { FilePreview as H } from "./file-preview.js";
9
+ import { MarkdownRenderer as M } from "./markdown-renderer.js";
10
+ import O from "../../node_modules/lucide-react/dist/esm/icons/x.js";
11
+ import R from "../../node_modules/lucide-react/dist/esm/icons/check.js";
12
+ import K from "../../node_modules/lucide-react/dist/esm/icons/pen.js";
13
+ import Q from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
14
+ import W from "../../node_modules/lucide-react/dist/esm/icons/ban.js";
15
+ import Y from "../../node_modules/lucide-react/dist/esm/icons/code-xml.js";
16
+ import Z from "../../node_modules/lucide-react/dist/esm/icons/terminal.js";
17
+ import A from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
18
+ const z = X(
19
19
  "group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",
20
20
  {
21
21
  variants: {
@@ -53,388 +53,385 @@ const R = W(
53
53
  }
54
54
  ]
55
55
  }
56
- ), fe = ({
57
- role: i,
58
- content: n,
59
- createdAt: a,
60
- showTimeStamp: f = !1,
61
- animation: m = "scale",
62
- actions: b,
63
- onEdit: T,
64
- experimental_attachments: O,
65
- toolInvocations: h,
66
- parts: N
56
+ ), xe = ({
57
+ role: s,
58
+ content: t,
59
+ createdAt: o,
60
+ showTimeStamp: g = !1,
61
+ animation: u = "scale",
62
+ actions: p,
63
+ onEdit: v,
64
+ experimental_attachments: B,
65
+ toolInvocations: y,
66
+ parts: w
67
67
  }) => {
68
- const D = I(() => O?.map((r) => {
69
- const s = G(r.url);
70
- return new File([s], r.name ?? "Unknown");
71
- }), [O]), d = i === "user", x = !d && T, [t, u] = B(!1), c = M(null);
72
- F(() => {
73
- if (t && c.current) {
74
- c.current.focus();
75
- const r = document.createRange(), s = window.getSelection();
76
- r.selectNodeContents(c.current), r.collapse(!1), s?.removeAllRanges(), s?.addRange(r);
77
- }
78
- }, [t]);
79
- const p = () => {
80
- const r = c.current?.textContent || "";
81
- r.trim() && r !== n && T?.(r.trim()), u(!1);
82
- }, g = () => {
83
- u(!1);
84
- }, v = (r) => {
85
- r.key === "Enter" && !r.shiftKey ? (r.preventDefault(), p()) : r.key === "Escape" && (r.preventDefault(), g());
86
- }, y = a?.toLocaleTimeString("en-US", {
68
+ const I = P(() => B?.map((r) => {
69
+ const m = ee(r.url);
70
+ return new File([m], r.name ?? "Unknown");
71
+ }), [B]), i = s === "user", C = !i && v, [a, k] = N(!1), [c, f] = N(t), [b, F] = N(t), d = V(null);
72
+ j(() => {
73
+ a || (F(t), f(t));
74
+ }, [t, a]), j(() => {
75
+ a && d.current && (d.current.focus(), d.current.setSelectionRange(
76
+ d.current.value.length,
77
+ d.current.value.length
78
+ ));
79
+ }, [a]);
80
+ const S = () => {
81
+ f(b), k(!0);
82
+ }, h = () => {
83
+ const r = c.trim();
84
+ r && r !== t && (F(r), v && v(r)), k(!1);
85
+ }, x = () => {
86
+ f(b), k(!1);
87
+ }, E = (r) => {
88
+ r.key === "Enter" && !r.shiftKey ? (r.preventDefault(), h()) : r.key === "Escape" && (r.preventDefault(), x());
89
+ }, U = o?.toLocaleTimeString("en-US", {
87
90
  hour: "2-digit",
88
91
  minute: "2-digit"
89
92
  });
90
- return d ? /* @__PURE__ */ o(
93
+ return i ? /* @__PURE__ */ n(
91
94
  "div",
92
95
  {
93
- className: l("flex flex-col", d ? "items-end" : "items-start"),
96
+ className: l("flex flex-col", i ? "items-end" : "items-start"),
94
97
  children: [
95
- D ? /* @__PURE__ */ e("div", { className: "mb-1 flex flex-wrap gap-2", children: D.map((r, s) => /* @__PURE__ */ e(V, { file: r }, s)) }) : null,
96
- /* @__PURE__ */ o(
98
+ I ? /* @__PURE__ */ e("div", { className: "mb-1 flex flex-wrap gap-2", children: I.map((r, m) => /* @__PURE__ */ e(H, { file: r }, m)) }) : null,
99
+ /* @__PURE__ */ n(
97
100
  "div",
98
101
  {
99
102
  className: l(
100
- R({ isUser: d, animation: m }),
103
+ z({ isUser: i, animation: u }),
101
104
  "group relative",
102
- t && "border-d-primary border"
105
+ a && "border-d-primary border"
103
106
  ),
104
107
  children: [
105
- /* @__PURE__ */ e(
106
- "div",
108
+ a ? /* @__PURE__ */ e(
109
+ "textarea",
110
+ {
111
+ ref: d,
112
+ value: c,
113
+ onChange: (r) => f(r.target.value),
114
+ onKeyDown: E,
115
+ className: "w-full resize-none border-none bg-transparent p-0 focus:outline-none",
116
+ rows: Math.max(2, c.split(`
117
+ `).length)
118
+ }
119
+ ) : /* @__PURE__ */ e("div", { className: "pointer-events-none", children: /* @__PURE__ */ e(
120
+ D,
107
121
  {
108
- ref: c,
109
- contentEditable: t,
110
- onKeyDown: t ? v : void 0,
111
- className: l(
112
- "focus:outline-none",
113
- !t && "pointer-events-none"
114
- ),
115
- suppressContentEditableWarning: !0,
116
- children: /* @__PURE__ */ e(
117
- w,
118
- {
119
- fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
120
- children: /* @__PURE__ */ e(k, { children: n })
121
- }
122
- )
122
+ fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
123
+ children: /* @__PURE__ */ e(M, { children: b })
123
124
  }
124
- ),
125
- x && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: t ? /* @__PURE__ */ o(C, { children: [
125
+ ) }),
126
+ C && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: a ? /* @__PURE__ */ n(T, { children: [
126
127
  /* @__PURE__ */ e(
127
128
  "button",
128
129
  {
129
- onClick: g,
130
+ onClick: x,
130
131
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
131
132
  title: "Cancel",
132
- children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
133
+ children: /* @__PURE__ */ e(O, { className: "h-3 w-3" })
133
134
  }
134
135
  ),
135
136
  /* @__PURE__ */ e(
136
137
  "button",
137
138
  {
138
- onClick: p,
139
+ onClick: h,
139
140
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
140
141
  title: "Save",
141
- children: /* @__PURE__ */ e(S, { className: "h-3 w-3" })
142
+ children: /* @__PURE__ */ e(R, { className: "h-3 w-3" })
142
143
  }
143
144
  )
144
145
  ] }) : /* @__PURE__ */ e(
145
146
  "button",
146
147
  {
147
- onClick: () => u(!0),
148
+ onClick: S,
148
149
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 opacity-0 transition-opacity group-hover:opacity-100",
149
150
  title: "Edit message",
150
- children: /* @__PURE__ */ e(U, { className: "h-3 w-3" })
151
+ children: /* @__PURE__ */ e(K, { className: "h-3 w-3" })
151
152
  }
152
153
  ) })
153
154
  ]
154
155
  }
155
156
  ),
156
- f && a ? /* @__PURE__ */ e(
157
+ g && o ? /* @__PURE__ */ e(
157
158
  "time",
158
159
  {
159
- dateTime: a.toISOString(),
160
+ dateTime: o.toISOString(),
160
161
  className: l(
161
162
  "mt-1 block px-1 text-xs opacity-50",
162
- m !== "none" && "animate-in fade-in-0 duration-500"
163
+ u !== "none" && "animate-in fade-in-0 duration-500"
163
164
  ),
164
- children: y
165
+ children: U
165
166
  }
166
167
  ) : null
167
168
  ]
168
169
  }
169
- ) : N && N.length > 0 ? N.map((r, s) => r.type === "text" ? /* @__PURE__ */ o(
170
+ ) : w && w.length > 0 ? w.map((r, m) => r.type === "text" ? /* @__PURE__ */ n(
170
171
  "div",
171
172
  {
172
173
  className: l(
173
174
  "flex flex-col",
174
- d ? "items-end" : "items-start"
175
+ i ? "items-end" : "items-start"
175
176
  ),
176
177
  children: [
177
- /* @__PURE__ */ o(
178
+ /* @__PURE__ */ n(
178
179
  "div",
179
180
  {
180
181
  className: l(
181
- R({ isUser: d, animation: m }),
182
+ z({ isUser: i, animation: u }),
182
183
  "group relative",
183
- t && "border-d-primary border"
184
+ a && "border-d-primary border"
184
185
  ),
185
186
  children: [
186
- /* @__PURE__ */ e(
187
- "div",
187
+ a ? /* @__PURE__ */ e(
188
+ "textarea",
189
+ {
190
+ ref: d,
191
+ value: c,
192
+ onChange: ($) => f($.target.value),
193
+ onKeyDown: E,
194
+ className: "w-full resize-none border-none bg-transparent p-0 focus:outline-none",
195
+ rows: Math.max(2, c.split(`
196
+ `).length)
197
+ }
198
+ ) : /* @__PURE__ */ e("div", { className: "pointer-events-none", children: /* @__PURE__ */ e(
199
+ D,
188
200
  {
189
- ref: c,
190
- contentEditable: t,
191
- onKeyDown: t ? v : void 0,
192
- className: l(
193
- "focus:outline-none",
194
- !t && "pointer-events-none"
195
- ),
196
- suppressContentEditableWarning: !0,
197
- children: /* @__PURE__ */ e(
198
- w,
199
- {
200
- fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
201
- children: /* @__PURE__ */ e(k, { children: r.text })
202
- }
203
- )
201
+ fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
202
+ children: /* @__PURE__ */ e(M, { children: r.text })
204
203
  }
205
- ),
206
- x && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: t ? /* @__PURE__ */ o(C, { children: [
204
+ ) }),
205
+ C && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: a ? /* @__PURE__ */ n(T, { children: [
207
206
  /* @__PURE__ */ e(
208
207
  "button",
209
208
  {
210
- onClick: g,
209
+ onClick: x,
211
210
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
212
211
  title: "Cancel",
213
- children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
212
+ children: /* @__PURE__ */ e(O, { className: "h-3 w-3" })
214
213
  }
215
214
  ),
216
215
  /* @__PURE__ */ e(
217
216
  "button",
218
217
  {
219
- onClick: p,
218
+ onClick: h,
220
219
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
221
220
  title: "Save",
222
- children: /* @__PURE__ */ e(S, { className: "h-3 w-3" })
221
+ children: /* @__PURE__ */ e(R, { className: "h-3 w-3" })
223
222
  }
224
223
  )
225
224
  ] }) : /* @__PURE__ */ e(
226
225
  "button",
227
226
  {
228
- onClick: () => u(!0),
227
+ onClick: S,
229
228
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 opacity-0 transition-opacity group-hover:opacity-100",
230
229
  title: "Edit message",
231
- children: /* @__PURE__ */ e(U, { className: "h-3 w-3" })
230
+ children: /* @__PURE__ */ e(K, { className: "h-3 w-3" })
232
231
  }
233
232
  ) }),
234
- b && !t ? /* @__PURE__ */ e("div", { className: "bg-d-background text-d-foreground border-d-border absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: b }) : null
233
+ p && !a ? /* @__PURE__ */ e("div", { className: "bg-d-background text-d-foreground border-d-border absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: p }) : null
235
234
  ]
236
235
  }
237
236
  ),
238
- f && a ? /* @__PURE__ */ e(
237
+ g && o ? /* @__PURE__ */ e(
239
238
  "time",
240
239
  {
241
- dateTime: a.toISOString(),
240
+ dateTime: o.toISOString(),
242
241
  className: l(
243
242
  "mt-1 block px-1 text-xs opacity-50",
244
- m !== "none" && "animate-in fade-in-0 duration-500"
243
+ u !== "none" && "animate-in fade-in-0 duration-500"
245
244
  ),
246
- children: y
245
+ children: U
247
246
  }
248
247
  ) : null
249
248
  ]
250
249
  },
251
- `text-${s}`
252
- ) : r.type === "reasoning" ? /* @__PURE__ */ e(H, { part: r }, `reasoning-${s}`) : r.type === "tool-invocation" ? /* @__PURE__ */ e(
253
- K,
250
+ `text-${m}`
251
+ ) : r.type === "reasoning" ? /* @__PURE__ */ e(re, { part: r }, `reasoning-${m}`) : r.type === "tool-invocation" ? /* @__PURE__ */ e(
252
+ L,
254
253
  {
255
254
  toolInvocations: [r.toolInvocation]
256
255
  },
257
- `tool-${s}`
258
- ) : null) : h && h.length > 0 ? /* @__PURE__ */ e(K, { toolInvocations: h }) : /* @__PURE__ */ o("div", { className: l("flex flex-col", d ? "items-end" : "items-start"), children: [
259
- /* @__PURE__ */ o(
256
+ `tool-${m}`
257
+ ) : null) : y && y.length > 0 ? /* @__PURE__ */ e(L, { toolInvocations: y }) : /* @__PURE__ */ n("div", { className: l("flex flex-col", i ? "items-end" : "items-start"), children: [
258
+ /* @__PURE__ */ n(
260
259
  "div",
261
260
  {
262
261
  className: l(
263
- R({ isUser: d, animation: m }),
262
+ z({ isUser: i, animation: u }),
264
263
  "group relative",
265
- t && "border-d-primary border"
264
+ a && "border-d-primary border"
266
265
  ),
267
266
  children: [
268
- /* @__PURE__ */ e(
269
- "div",
267
+ a ? /* @__PURE__ */ e(
268
+ "textarea",
270
269
  {
271
- ref: c,
272
- contentEditable: t,
273
- onKeyDown: t ? v : void 0,
274
- className: l(
275
- "focus:outline-none",
276
- !t && "pointer-events-none"
277
- ),
278
- suppressContentEditableWarning: !0,
279
- children: /* @__PURE__ */ e(
280
- w,
281
- {
282
- fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
283
- children: /* @__PURE__ */ e(k, { children: n })
284
- }
285
- )
270
+ ref: d,
271
+ value: c,
272
+ onChange: (r) => f(r.target.value),
273
+ onKeyDown: E,
274
+ className: "w-full resize-none border-none bg-transparent p-0 focus:outline-none",
275
+ rows: Math.max(2, c.split(`
276
+ `).length)
286
277
  }
287
- ),
288
- x && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: t ? /* @__PURE__ */ o(C, { children: [
278
+ ) : /* @__PURE__ */ e("div", { className: "pointer-events-none", children: /* @__PURE__ */ e(
279
+ D,
280
+ {
281
+ fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
282
+ children: /* @__PURE__ */ e(M, { children: b })
283
+ }
284
+ ) }),
285
+ C && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: a ? /* @__PURE__ */ n(T, { children: [
289
286
  /* @__PURE__ */ e(
290
287
  "button",
291
288
  {
292
- onClick: g,
289
+ onClick: x,
293
290
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
294
291
  title: "Cancel",
295
- children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
292
+ children: /* @__PURE__ */ e(O, { className: "h-3 w-3" })
296
293
  }
297
294
  ),
298
295
  /* @__PURE__ */ e(
299
296
  "button",
300
297
  {
301
- onClick: p,
298
+ onClick: h,
302
299
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
303
300
  title: "Save",
304
- children: /* @__PURE__ */ e(S, { className: "h-3 w-3" })
301
+ children: /* @__PURE__ */ e(R, { className: "h-3 w-3" })
305
302
  }
306
303
  )
307
304
  ] }) : /* @__PURE__ */ e(
308
305
  "button",
309
306
  {
310
- onClick: () => u(!0),
307
+ onClick: S,
311
308
  className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 opacity-0 transition-opacity group-hover:opacity-100",
312
309
  title: "Edit message",
313
- children: /* @__PURE__ */ e(U, { className: "h-3 w-3" })
310
+ children: /* @__PURE__ */ e(K, { className: "h-3 w-3" })
314
311
  }
315
312
  ) }),
316
- b && !t ? /* @__PURE__ */ e("div", { className: "bg-d-background text-foreground absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: b }) : null
313
+ p && !a ? /* @__PURE__ */ e("div", { className: "bg-d-background text-foreground absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: p }) : null
317
314
  ]
318
315
  }
319
316
  ),
320
- f && a ? /* @__PURE__ */ e(
317
+ g && o ? /* @__PURE__ */ e(
321
318
  "time",
322
319
  {
323
- dateTime: a.toISOString(),
320
+ dateTime: o.toISOString(),
324
321
  className: l(
325
322
  "mt-1 block px-1 text-xs opacity-50",
326
- m !== "none" && "animate-in fade-in-0 duration-500"
323
+ u !== "none" && "animate-in fade-in-0 duration-500"
327
324
  ),
328
- children: y
325
+ children: U
329
326
  }
330
327
  ) : null
331
328
  ] });
332
329
  };
333
- function G(i) {
334
- const n = i.split(",")[1], a = Buffer.from(n, "base64");
335
- return new Uint8Array(a);
330
+ function ee(s) {
331
+ const t = s.split(",")[1], o = Buffer.from(t, "base64");
332
+ return new Uint8Array(o);
336
333
  }
337
- const H = ({ part: i }) => {
338
- const [n, a] = B(!1);
339
- return /* @__PURE__ */ e("div", { className: "mb-2 flex flex-col items-start sm:max-w-[70%]", children: /* @__PURE__ */ o(
340
- j,
334
+ const re = ({ part: s }) => {
335
+ const [t, o] = N(!1);
336
+ return /* @__PURE__ */ e("div", { className: "mb-2 flex flex-col items-start sm:max-w-[70%]", children: /* @__PURE__ */ n(
337
+ _,
341
338
  {
342
- open: n,
343
- onOpenChange: a,
339
+ open: t,
340
+ onOpenChange: o,
344
341
  className: "group bg-d-secondary/50 border-d-border w-full overflow-hidden rounded-lg",
345
342
  children: [
346
- /* @__PURE__ */ e("div", { className: "flex items-center p-2", children: /* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "text-d-secondary-foreground hover:text-d-foreground flex items-center gap-2 text-sm", children: [
347
- /* @__PURE__ */ e(X, { className: "h-4 w-4 transition-transform group-data-[state=open]:rotate-90" }),
343
+ /* @__PURE__ */ e("div", { className: "flex items-center p-2", children: /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ n("button", { className: "text-d-secondary-foreground hover:text-d-foreground flex items-center gap-2 text-sm", children: [
344
+ /* @__PURE__ */ e(Q, { className: "h-4 w-4 transition-transform group-data-[state=open]:rotate-90" }),
348
345
  /* @__PURE__ */ e("span", { children: "Thinking" })
349
346
  ] }) }) }),
350
- /* @__PURE__ */ e(P, { forceMount: !0, children: /* @__PURE__ */ e(
351
- $.div,
347
+ /* @__PURE__ */ e(G, { forceMount: !0, children: /* @__PURE__ */ e(
348
+ J.div,
352
349
  {
353
350
  initial: !1,
354
- animate: n ? "open" : "closed",
351
+ animate: t ? "open" : "closed",
355
352
  variants: {
356
353
  open: { height: "auto", opacity: 1 },
357
354
  closed: { height: 0, opacity: 0 }
358
355
  },
359
356
  transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] },
360
357
  className: "border-d-border border-t",
361
- children: /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "text-xs whitespace-pre-wrap", children: i.reasoning }) })
358
+ children: /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "text-xs whitespace-pre-wrap", children: s.reasoning }) })
362
359
  }
363
360
  ) })
364
361
  ]
365
362
  }
366
363
  ) });
367
364
  };
368
- function K({
369
- toolInvocations: i
365
+ function L({
366
+ toolInvocations: s
370
367
  }) {
371
- return i?.length ? /* @__PURE__ */ e("div", { className: "flex flex-col items-start gap-2", children: i.map((n, a) => {
372
- if (n.state === "result" && n.result.__cancelled === !0)
373
- return /* @__PURE__ */ o(
368
+ return s?.length ? /* @__PURE__ */ e("div", { className: "flex flex-col items-start gap-2", children: s.map((t, o) => {
369
+ if (t.state === "result" && t.result.__cancelled === !0)
370
+ return /* @__PURE__ */ n(
374
371
  "div",
375
372
  {
376
373
  className: "bg-d-secondary/50 text-d-secondary-foreground border-d-border flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",
377
374
  children: [
378
- /* @__PURE__ */ e(z, { className: "h-4 w-4" }),
379
- /* @__PURE__ */ o("span", { children: [
375
+ /* @__PURE__ */ e(W, { className: "h-4 w-4" }),
376
+ /* @__PURE__ */ n("span", { children: [
380
377
  "Cancelled",
381
378
  " ",
382
- /* @__PURE__ */ o("span", { className: "font-mono", children: [
379
+ /* @__PURE__ */ n("span", { className: "font-mono", children: [
383
380
  "`",
384
- n.toolName,
381
+ t.toolName,
385
382
  "`"
386
383
  ] })
387
384
  ] })
388
385
  ]
389
386
  },
390
- a
387
+ o
391
388
  );
392
- switch (n.state) {
389
+ switch (t.state) {
393
390
  case "partial-call":
394
391
  case "call":
395
- return /* @__PURE__ */ o(
392
+ return /* @__PURE__ */ n(
396
393
  "div",
397
394
  {
398
395
  className: "bg-d-secondary/50 text-d-secondary-foreground border-d-border flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",
399
396
  children: [
400
- /* @__PURE__ */ e(_, { className: "h-4 w-4" }),
401
- /* @__PURE__ */ o("span", { children: [
397
+ /* @__PURE__ */ e(Z, { className: "h-4 w-4" }),
398
+ /* @__PURE__ */ n("span", { children: [
402
399
  "Calling",
403
400
  " ",
404
- /* @__PURE__ */ o("span", { className: "font-mono", children: [
401
+ /* @__PURE__ */ n("span", { className: "font-mono", children: [
405
402
  "`",
406
- n.toolName,
403
+ t.toolName,
407
404
  "`"
408
405
  ] }),
409
406
  "..."
410
407
  ] }),
411
- /* @__PURE__ */ e(q, { className: "h-3 w-3 animate-spin" })
408
+ /* @__PURE__ */ e(A, { className: "h-3 w-3 animate-spin" })
412
409
  ]
413
410
  },
414
- a
411
+ o
415
412
  );
416
413
  case "result":
417
- return /* @__PURE__ */ o(
414
+ return /* @__PURE__ */ n(
418
415
  "div",
419
416
  {
420
417
  className: "bg-d-secondary/50 border-d-border flex flex-col gap-1.5 rounded-lg border px-3 py-2 text-sm",
421
418
  children: [
422
- /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground flex items-center gap-2", children: [
423
- /* @__PURE__ */ e(J, { className: "h-4 w-4" }),
424
- /* @__PURE__ */ o("span", { children: [
419
+ /* @__PURE__ */ n("div", { className: "text-d-secondary-foreground flex items-center gap-2", children: [
420
+ /* @__PURE__ */ e(Y, { className: "h-4 w-4" }),
421
+ /* @__PURE__ */ n("span", { children: [
425
422
  "Result from",
426
423
  " ",
427
- /* @__PURE__ */ o("span", { className: "font-mono", children: [
424
+ /* @__PURE__ */ n("span", { className: "font-mono", children: [
428
425
  "`",
429
- n.toolName,
426
+ t.toolName,
430
427
  "`"
431
428
  ] })
432
429
  ] })
433
430
  ] }),
434
- /* @__PURE__ */ e("pre", { className: "text-d-foreground overflow-x-auto whitespace-pre-wrap", children: JSON.stringify(n.result, null, 2) })
431
+ /* @__PURE__ */ e("pre", { className: "text-d-foreground overflow-x-auto whitespace-pre-wrap", children: JSON.stringify(t.result, null, 2) })
435
432
  ]
436
433
  },
437
- a
434
+ o
438
435
  );
439
436
  default:
440
437
  return null;
@@ -442,5 +439,5 @@ function K({
442
439
  }) }) : null;
443
440
  }
444
441
  export {
445
- fe as ChatMessage
442
+ xe as ChatMessage
446
443
  };
@@ -1,33 +1,33 @@
1
1
  "use client";
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({
2
+ import { jsxs as a, jsx as r } from "react/jsx-runtime";
3
+ import { ChatMessage as l } from "./chat-message.js";
4
+ import { TypingIndicator as u } from "./typing-indicator.js";
5
+ function h({
6
6
  messages: n,
7
- showTimeStamps: e = !0,
8
- isTyping: a = !1,
9
- messageOptions: i,
7
+ showTimeStamps: c = !0,
8
+ isTyping: d = !1,
9
+ messageOptions: o,
10
10
  onEdit: t,
11
- onMessageSave: c
11
+ onMessageSave: e
12
12
  }) {
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;
13
+ return /* @__PURE__ */ a("div", { className: "space-y-4 overflow-visible", children: [
14
+ n.map((i) => {
15
+ const f = typeof o == "function" ? o(i) : o;
16
16
  return /* @__PURE__ */ r(
17
- s,
17
+ l,
18
18
  {
19
- showTimeStamp: e,
20
- ...o,
21
- ...p,
22
- onEdit: t ? (d) => t(o.id, d) : void 0,
23
- onMessageSave: c
19
+ showTimeStamp: c,
20
+ ...i,
21
+ ...f,
22
+ onEdit: t ? (p) => t(i.id, p) : void 0,
23
+ onMessageSave: e
24
24
  },
25
- f
25
+ i.id
26
26
  );
27
27
  }),
28
- a && /* @__PURE__ */ r(m, {})
28
+ d && /* @__PURE__ */ r(u, {})
29
29
  ] });
30
30
  }
31
31
  export {
32
- x as MessageList
32
+ h as MessageList
33
33
  };
package/dist/index.d.ts CHANGED
@@ -471,6 +471,7 @@ export declare interface ChatMessageProps extends Message {
471
471
  showTimeStamp?: boolean;
472
472
  animation?: Animation_2;
473
473
  actions?: default_3.ReactNode;
474
+ editable?: boolean;
474
475
  onEdit?: (newContent: string) => void;
475
476
  onMessageSave?: (messageId: string, content: string) => void;
476
477
  }
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../_virtual/index5.js";
2
+ import e from "../../_virtual/index3.js";
3
3
  export {
4
4
  e as EventEmitter,
5
5
  e as default
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __module as x } from "../../_virtual/index7.js";
2
+ import { __module as x } from "../../_virtual/index6.js";
3
3
  var w;
4
4
  function O() {
5
5
  return w ? x.exports : (w = 1, function(d) {
@@ -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/index3.js";
6
+ import S from "../../../_virtual/index4.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,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../../../_virtual/index5.js";
2
+ import e from "../../../../_virtual/index3.js";
3
3
  var r = new e(), n = "recharts.syncEvent.tooltip";
4
4
  export {
5
5
  n as TOOLTIP_SYNC_EVENT,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __exports as r } from "../../../_virtual/index6.js";
2
+ import { __exports as r } from "../../../_virtual/index7.js";
3
3
  import { __require as c } from "../../inline-style-parser/index.js";
4
4
  var f;
5
5
  function j() {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { bail as P } from "../../bail/index.js";
3
- import y from "../../../_virtual/index4.js";
3
+ import y from "../../../_virtual/index5.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";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "laif-ds",
3
3
  "private": false,
4
- "version": "0.2.1",
4
+ "version": "0.2.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",