laif-ds 0.2.10 → 0.2.11
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/index5.js +5 -5
- package/dist/components/ui/message-input.js +65 -65
- 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/package.json +1 -1
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
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
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
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
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { useState as y, useEffect as S, useRef as
|
|
4
|
-
import { AnimatePresence as v, motion as
|
|
5
|
-
import { a as
|
|
6
|
-
import { cn as
|
|
3
|
+
import { useState as y, useEffect as S, useRef as W } from "react";
|
|
4
|
+
import { AnimatePresence as v, motion as x } from "framer-motion";
|
|
5
|
+
import { a as J } from "../../node_modules/remeda/dist/chunk-KI5X74E2.js";
|
|
6
|
+
import { cn as T } from "../../lib/utils.js";
|
|
7
7
|
import { useAudioRecording as Q } from "../../hooks/use-audio-recording.js";
|
|
8
8
|
import { useAutosizeTextArea as X } from "../../hooks/use-autosize-textarea.js";
|
|
9
9
|
import { AudioVisualizer as Y } from "./audio-visualizer.js";
|
|
10
10
|
import { Button as g } from "./button.js";
|
|
11
11
|
import { FilePreview as Z } from "./file-preview.js";
|
|
12
12
|
import { InterruptPrompt as _ } from "./interrupt-prompt.js";
|
|
13
|
-
import
|
|
13
|
+
import C from "../../node_modules/lucide-react/dist/esm/icons/paperclip.js";
|
|
14
14
|
import $ from "../../node_modules/lucide-react/dist/esm/icons/mic.js";
|
|
15
15
|
import G from "../../node_modules/lucide-react/dist/esm/icons/square.js";
|
|
16
16
|
import ee from "../../node_modules/lucide-react/dist/esm/icons/arrow-up.js";
|
|
@@ -18,25 +18,25 @@ import te from "../../node_modules/lucide-react/dist/esm/icons/info.js";
|
|
|
18
18
|
import re from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
19
19
|
function ie({
|
|
20
20
|
placeholder: i = "Ask AI...",
|
|
21
|
-
className:
|
|
21
|
+
className: a,
|
|
22
22
|
onKeyDown: d,
|
|
23
23
|
submitOnEnter: l = !0,
|
|
24
24
|
stop: s,
|
|
25
25
|
isGenerating: u,
|
|
26
26
|
enableInterrupt: A = !0,
|
|
27
|
-
transcribeAudio:
|
|
27
|
+
transcribeAudio: P,
|
|
28
28
|
...r
|
|
29
29
|
}) {
|
|
30
|
-
const [
|
|
31
|
-
isListening:
|
|
32
|
-
isSpeechSupported:
|
|
30
|
+
const [I, w] = y(!1), [N, f] = y(!1), {
|
|
31
|
+
isListening: R,
|
|
32
|
+
isSpeechSupported: F,
|
|
33
33
|
isRecording: D,
|
|
34
|
-
isTranscribing:
|
|
35
|
-
audioStream:
|
|
36
|
-
toggleListening:
|
|
34
|
+
isTranscribing: L,
|
|
35
|
+
audioStream: M,
|
|
36
|
+
toggleListening: O,
|
|
37
37
|
stopRecording: k
|
|
38
38
|
} = Q({
|
|
39
|
-
transcribeAudio:
|
|
39
|
+
transcribeAudio: P,
|
|
40
40
|
onTranscriptionComplete: (t) => {
|
|
41
41
|
r.onChange?.({ target: { value: t } });
|
|
42
42
|
}
|
|
@@ -45,32 +45,32 @@ function ie({
|
|
|
45
45
|
u || f(!1);
|
|
46
46
|
}, [u]);
|
|
47
47
|
const h = (t) => {
|
|
48
|
-
r.allowAttachments && r.setFiles((
|
|
48
|
+
r.allowAttachments && r.setFiles((n) => n === null ? t : t === null ? n : [...n, ...t]);
|
|
49
|
+
}, j = (t) => {
|
|
50
|
+
r.allowAttachments === !0 && (t.preventDefault(), w(!0));
|
|
49
51
|
}, q = (t) => {
|
|
50
|
-
r.allowAttachments === !0 && (t.preventDefault(),
|
|
52
|
+
r.allowAttachments === !0 && (t.preventDefault(), w(!1));
|
|
51
53
|
}, E = (t) => {
|
|
52
|
-
r.allowAttachments
|
|
53
|
-
}, H = (t) => {
|
|
54
|
-
if (x(!1), r.allowAttachments !== !0) return;
|
|
54
|
+
if (w(!1), r.allowAttachments !== !0) return;
|
|
55
55
|
t.preventDefault();
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
56
|
+
const n = t.dataTransfer;
|
|
57
|
+
n.files.length && h(Array.from(n.files));
|
|
58
|
+
}, H = (t) => {
|
|
59
|
+
const n = t.clipboardData?.items;
|
|
60
|
+
if (!n) return;
|
|
61
61
|
const c = t.clipboardData.getData("text");
|
|
62
62
|
if (c && c.length > 500 && r.allowAttachments) {
|
|
63
63
|
t.preventDefault();
|
|
64
|
-
const m = new Blob([c], { type: "text/plain" }),
|
|
64
|
+
const m = new Blob([c], { type: "text/plain" }), B = new File([m], "Pasted text", {
|
|
65
65
|
type: "text/plain",
|
|
66
66
|
lastModified: Date.now()
|
|
67
67
|
});
|
|
68
|
-
h([
|
|
68
|
+
h([B]);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const b = Array.from(
|
|
71
|
+
const b = Array.from(n).map((m) => m.getAsFile()).filter((m) => m !== null);
|
|
72
72
|
r.allowAttachments && b.length > 0 && h(b);
|
|
73
|
-
},
|
|
73
|
+
}, K = (t) => {
|
|
74
74
|
if (l && t.key === "Enter" && !t.shiftKey) {
|
|
75
75
|
if (t.preventDefault(), u && s && A) {
|
|
76
76
|
if (N)
|
|
@@ -83,11 +83,11 @@ function ie({
|
|
|
83
83
|
t.currentTarget.form?.requestSubmit();
|
|
84
84
|
}
|
|
85
85
|
d?.(t);
|
|
86
|
-
}, p =
|
|
86
|
+
}, p = W(
|
|
87
87
|
null
|
|
88
|
-
), [
|
|
88
|
+
), [U, V] = y(0);
|
|
89
89
|
S(() => {
|
|
90
|
-
p.current &&
|
|
90
|
+
p.current && V(p.current.offsetHeight);
|
|
91
91
|
}, [r.value]);
|
|
92
92
|
const z = r.allowAttachments && r.files && r.files.length > 0;
|
|
93
93
|
return X({
|
|
@@ -99,9 +99,9 @@ function ie({
|
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
101
|
className: "relative flex w-full",
|
|
102
|
-
onDragOver:
|
|
103
|
-
onDragLeave:
|
|
104
|
-
onDrop:
|
|
102
|
+
onDragOver: j,
|
|
103
|
+
onDragLeave: q,
|
|
104
|
+
onDrop: E,
|
|
105
105
|
children: [
|
|
106
106
|
A && /* @__PURE__ */ e(
|
|
107
107
|
_,
|
|
@@ -124,14 +124,14 @@ function ie({
|
|
|
124
124
|
"aria-label": "Write your prompt here",
|
|
125
125
|
placeholder: i,
|
|
126
126
|
ref: p,
|
|
127
|
-
onPaste:
|
|
128
|
-
onKeyDown:
|
|
129
|
-
className:
|
|
127
|
+
onPaste: H,
|
|
128
|
+
onKeyDown: K,
|
|
129
|
+
className: T(
|
|
130
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
|
+
a
|
|
133
133
|
),
|
|
134
|
-
...
|
|
134
|
+
...J(r, ["allowAttachments", "files", "setFiles"])
|
|
135
135
|
}
|
|
136
136
|
),
|
|
137
137
|
r.allowAttachments && /* @__PURE__ */ e("div", { className: "absolute inset-x-3 bottom-2 z-20 overflow-x-scroll py-3 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ e("div", { className: "flex space-x-3", children: /* @__PURE__ */ e(v, { mode: "popLayout", children: r.files?.map((t) => /* @__PURE__ */ e(
|
|
@@ -139,9 +139,9 @@ function ie({
|
|
|
139
139
|
{
|
|
140
140
|
file: t,
|
|
141
141
|
onRemove: () => {
|
|
142
|
-
r.setFiles((
|
|
143
|
-
if (!
|
|
144
|
-
const c = Array.from(
|
|
142
|
+
r.setFiles((n) => {
|
|
143
|
+
if (!n) return null;
|
|
144
|
+
const c = Array.from(n).filter(
|
|
145
145
|
(b) => b !== t
|
|
146
146
|
);
|
|
147
147
|
return c.length === 0 ? null : c;
|
|
@@ -161,21 +161,21 @@ function ie({
|
|
|
161
161
|
className: "h-8 w-8",
|
|
162
162
|
"aria-label": "Attach a file",
|
|
163
163
|
onClick: async () => {
|
|
164
|
-
const t = await
|
|
164
|
+
const t = await ae();
|
|
165
165
|
h(t);
|
|
166
166
|
},
|
|
167
|
-
children: /* @__PURE__ */ e(
|
|
167
|
+
children: /* @__PURE__ */ e(C, { className: "h-4 w-4" })
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
|
-
|
|
170
|
+
F && /* @__PURE__ */ e(
|
|
171
171
|
g,
|
|
172
172
|
{
|
|
173
173
|
type: "button",
|
|
174
174
|
variant: "outline",
|
|
175
|
-
className:
|
|
175
|
+
className: T("h-8 w-8", R && "text-d-primary"),
|
|
176
176
|
"aria-label": "Voice input",
|
|
177
177
|
size: "icon",
|
|
178
|
-
onClick:
|
|
178
|
+
onClick: O,
|
|
179
179
|
children: /* @__PURE__ */ e($, { className: "h-4 w-4" })
|
|
180
180
|
}
|
|
181
181
|
),
|
|
@@ -201,14 +201,14 @@ function ie({
|
|
|
201
201
|
}
|
|
202
202
|
)
|
|
203
203
|
] }),
|
|
204
|
-
r.allowAttachments && /* @__PURE__ */ e(
|
|
204
|
+
r.allowAttachments && /* @__PURE__ */ e(ne, { isDragging: I }),
|
|
205
205
|
/* @__PURE__ */ e(
|
|
206
206
|
se,
|
|
207
207
|
{
|
|
208
208
|
isRecording: D,
|
|
209
|
-
isTranscribing:
|
|
210
|
-
audioStream:
|
|
211
|
-
textAreaHeight:
|
|
209
|
+
isTranscribing: L,
|
|
210
|
+
audioStream: M,
|
|
211
|
+
textAreaHeight: U,
|
|
212
212
|
onStopRecording: k
|
|
213
213
|
}
|
|
214
214
|
)
|
|
@@ -217,9 +217,9 @@ function ie({
|
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
219
|
ie.displayName = "MessageInput";
|
|
220
|
-
function
|
|
220
|
+
function ne({ isDragging: i }) {
|
|
221
221
|
return /* @__PURE__ */ e(v, { children: i && /* @__PURE__ */ o(
|
|
222
|
-
|
|
222
|
+
x.div,
|
|
223
223
|
{
|
|
224
224
|
className: "border-d-border bg-d-background text-d-secondary-foreground pointer-events-none absolute inset-0 z-20 flex items-center justify-center space-x-2 rounded-xl border border-dashed text-sm",
|
|
225
225
|
initial: { opacity: 0 },
|
|
@@ -228,30 +228,30 @@ function ae({ isDragging: i }) {
|
|
|
228
228
|
transition: { duration: 0.2 },
|
|
229
229
|
"aria-hidden": !0,
|
|
230
230
|
children: [
|
|
231
|
-
/* @__PURE__ */ e(
|
|
231
|
+
/* @__PURE__ */ e(C, { className: "h-4 w-4" }),
|
|
232
232
|
/* @__PURE__ */ e("span", { children: "Drop your files here to attach them." })
|
|
233
233
|
]
|
|
234
234
|
}
|
|
235
235
|
) });
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function ae() {
|
|
238
238
|
if (typeof document > "u")
|
|
239
239
|
return Promise.resolve(null);
|
|
240
240
|
const i = document.createElement("input");
|
|
241
|
-
return i.type = "file", i.multiple = !0, i.accept = "*/*", i.click(), new Promise((
|
|
241
|
+
return i.type = "file", i.multiple = !0, i.accept = "*/*", i.click(), new Promise((a) => {
|
|
242
242
|
i.onchange = (d) => {
|
|
243
243
|
const l = d.currentTarget.files;
|
|
244
244
|
if (l) {
|
|
245
|
-
|
|
245
|
+
a(Array.from(l));
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
|
|
248
|
+
a(null);
|
|
249
249
|
};
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
function le() {
|
|
253
253
|
return /* @__PURE__ */ o(
|
|
254
|
-
|
|
254
|
+
x.div,
|
|
255
255
|
{
|
|
256
256
|
className: "bg-d-background/80 flex h-full w-full flex-col items-center justify-center rounded-xl backdrop-blur-sm",
|
|
257
257
|
initial: { opacity: 0 },
|
|
@@ -262,7 +262,7 @@ function le() {
|
|
|
262
262
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
263
263
|
/* @__PURE__ */ e(re, { className: "text-d-primary h-8 w-8 animate-spin" }),
|
|
264
264
|
/* @__PURE__ */ e(
|
|
265
|
-
|
|
265
|
+
x.div,
|
|
266
266
|
{
|
|
267
267
|
className: "bg-d-primary/20 absolute inset-0 h-8 w-8 animate-pulse rounded-full",
|
|
268
268
|
initial: { scale: 0.8, opacity: 0 },
|
|
@@ -281,9 +281,9 @@ function le() {
|
|
|
281
281
|
}
|
|
282
282
|
);
|
|
283
283
|
}
|
|
284
|
-
function oe({ isVisible: i, onStopRecording:
|
|
284
|
+
function oe({ isVisible: i, onStopRecording: a }) {
|
|
285
285
|
return /* @__PURE__ */ e(v, { children: i && /* @__PURE__ */ e(
|
|
286
|
-
|
|
286
|
+
x.div,
|
|
287
287
|
{
|
|
288
288
|
initial: { top: 0, filter: "blur(5px)" },
|
|
289
289
|
animate: {
|
|
@@ -296,7 +296,7 @@ function oe({ isVisible: i, onStopRecording: n }) {
|
|
|
296
296
|
},
|
|
297
297
|
exit: { top: 0, filter: "blur(5px)" },
|
|
298
298
|
className: "bg-d-background border-d-border text-d-secondary-foreground absolute left-1/2 flex -translate-x-1/2 cursor-pointer overflow-hidden rounded-full border py-1 text-center text-sm whitespace-nowrap",
|
|
299
|
-
onClick:
|
|
299
|
+
onClick: a,
|
|
300
300
|
children: /* @__PURE__ */ o("span", { className: "mx-2.5 flex items-center", children: [
|
|
301
301
|
/* @__PURE__ */ e(te, { className: "mr-2 h-3 w-3" }),
|
|
302
302
|
"Click to finish recording"
|
|
@@ -306,7 +306,7 @@ function oe({ isVisible: i, onStopRecording: n }) {
|
|
|
306
306
|
}
|
|
307
307
|
function se({
|
|
308
308
|
isRecording: i,
|
|
309
|
-
isTranscribing:
|
|
309
|
+
isTranscribing: a,
|
|
310
310
|
audioStream: d,
|
|
311
311
|
textAreaHeight: l,
|
|
312
312
|
onStopRecording: s
|
|
@@ -325,7 +325,7 @@ function se({
|
|
|
325
325
|
}
|
|
326
326
|
)
|
|
327
327
|
}
|
|
328
|
-
) :
|
|
328
|
+
) : a ? /* @__PURE__ */ e(
|
|
329
329
|
"div",
|
|
330
330
|
{
|
|
331
331
|
className: "absolute inset-[1px] z-50 overflow-hidden rounded-xl",
|
|
@@ -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";
|