@actioneer/ads 0.6.0 → 0.8.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/DESIGN.md +597 -0
- package/components/ai-elements/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +164 -105
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +1 -1
- package/components/ai-elements/index.d.ts +0 -5
- package/components/ai-elements/inline-citation.js +1 -1
- package/components/alert.d.ts +6 -6
- package/components/alert.js +89 -53
- package/components/answer-sources.d.ts +2 -6
- package/components/answer-sources.js +58 -60
- package/components/answer.d.ts +5 -0
- package/components/answer.js +311 -271
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +11 -11
- package/components/assistant-ui/badge.js +18 -18
- package/components/assistant-ui/composer-harness.js +15 -20
- package/components/assistant-ui/composer-trigger-popover.js +9 -9
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/image.js +61 -61
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/message-timing.js +1 -1
- package/components/assistant-ui/selection-toolbar.js +7 -7
- package/components/assistant-ui/thread-context.d.ts +3 -1
- package/components/assistant-ui/thread.js +50 -42
- package/components/avatar.js +42 -42
- package/components/badge.d.ts +5 -6
- package/components/badge.js +13 -76
- package/components/body-page-header.d.ts +15 -0
- package/components/body-page-header.js +24 -0
- package/components/brand-loader.d.ts +0 -3
- package/components/brand-loader.js +10 -32
- package/components/breadcrumbs.d.ts +0 -7
- package/components/breadcrumbs.js +54 -71
- package/components/button.d.ts +1 -1
- package/components/button.js +55 -49
- package/components/chart.js +298 -296
- package/components/chip.d.ts +13 -1
- package/components/chip.js +93 -80
- package/components/collection-header.d.ts +17 -0
- package/components/collection-header.js +31 -0
- package/components/connector-card.d.ts +6 -6
- package/components/connector-card.js +31 -32
- package/components/date-range-picker.d.ts +2 -1
- package/components/date-range-picker.js +158 -122
- package/components/divider.js +25 -25
- package/components/drawer.d.ts +6 -2
- package/components/drawer.js +61 -58
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +41 -36
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +501 -549
- package/components/infinite-canvas.js +24 -24
- package/components/input-field.d.ts +18 -3
- package/components/input-field.js +88 -72
- package/components/input.js +32 -29
- package/components/modal.d.ts +31 -3
- package/components/modal.js +244 -170
- package/components/number-field.js +45 -42
- package/components/page-body.d.ts +12 -0
- package/components/page-body.js +18 -0
- package/components/pagination.js +36 -36
- package/components/pixel-blast-svg.js +71 -73
- package/components/select.d.ts +21 -0
- package/components/select.js +189 -148
- package/components/setting-row.d.ts +6 -5
- package/components/setting-row.js +33 -32
- package/components/sidebar.d.ts +2 -0
- package/components/sidebar.js +151 -141
- package/components/skeleton.js +8 -7
- package/components/slider.js +1 -1
- package/components/surface-loader.d.ts +11 -0
- package/components/surface-loader.js +35 -0
- package/components/table.d.ts +16 -10
- package/components/table.js +427 -412
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +160 -295
- package/components/textarea.js +9 -9
- package/components/toast.d.ts +1 -1
- package/components/toast.js +181 -118
- package/components/tree.d.ts +5 -1
- package/components/tree.js +54 -49
- package/components/typography.d.ts +4 -4
- package/components/typography.js +13 -13
- package/components/ui/button.d.ts +1 -1
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +25 -25
- package/demo/components/add-to-artifact.js +6 -10
- package/lib/cn.js +11 -4
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +103 -102
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +132 -188
- package/manifest.json +1719 -2831
- package/package.json +2 -2
- package/styles.css +362 -233
- package/theme.css +312 -177
- package/components/agent-icon.d.ts +0 -76
- package/components/agent-icon.js +0 -265
- package/components/ai-elements/queue.d.ts +0 -60
- package/components/ai-elements/queue.js +0 -193
- package/components/ai-elements/speech-input.d.ts +0 -16
- package/components/ai-elements/speech-input.js +0 -151
- package/components/ai-elements/task-progress.d.ts +0 -41
- package/components/ai-elements/task-progress.js +0 -224
- package/components/ai-elements/task.d.ts +0 -39
- package/components/ai-elements/task.js +0 -105
- package/components/ai-elements/voice.d.ts +0 -90
- package/components/ai-elements/voice.js +0 -496
- package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
- package/components/assistant-ui/follow-up-suggestions.js +0 -72
- package/components/assistant-ui/suggestions.d.ts +0 -7
- package/components/assistant-ui/suggestions.js +0 -19
- package/components/assistant-ui/voice.d.ts +0 -18
- package/components/link.d.ts +0 -14
- package/components/link.js +0 -72
- package/components/navbar.d.ts +0 -15
- package/components/navbar.js +0 -68
- package/components/pixel-icon.d.ts +0 -37
- package/components/pixel-icon.js +0 -859
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as u, jsx as n, Fragment as E } from "react/jsx-runtime";
|
|
3
3
|
import { memo as D, useRef as F, useState as p, useEffect as b } from "react";
|
|
4
4
|
import { createPortal as O } from "react-dom";
|
|
5
5
|
import { cva as P } from "class-variance-authority";
|
|
@@ -24,10 +24,10 @@ const G = (e) => {
|
|
|
24
24
|
}
|
|
25
25
|
}, z = (e) => {
|
|
26
26
|
var r;
|
|
27
|
-
const [t,
|
|
27
|
+
const [t, a] = e.split(","), i = ((r = t == null ? void 0 : t.match(/data:([^;]+)/)) == null ? void 0 : r[1]) ?? "application/octet-stream";
|
|
28
28
|
if (!/;base64/i.test(t ?? ""))
|
|
29
|
-
return new Blob([decodeURIComponent(
|
|
30
|
-
const l = atob(
|
|
29
|
+
return new Blob([decodeURIComponent(a ?? "")], { type: i });
|
|
30
|
+
const l = atob(a ?? ""), o = new Uint8Array(l.length);
|
|
31
31
|
for (let s = 0; s < l.length; s++) o[s] = l.charCodeAt(s);
|
|
32
32
|
return new Blob([o], { type: i });
|
|
33
33
|
}, N = (e) => {
|
|
@@ -35,13 +35,13 @@ const G = (e) => {
|
|
|
35
35
|
return (t = e.match(/^data:([^;,]+)/)) == null ? void 0 : t[1];
|
|
36
36
|
}, K = (e) => {
|
|
37
37
|
if (typeof document > "u") return;
|
|
38
|
-
const t = G(N(e.image)),
|
|
39
|
-
r.href = o, r.download =
|
|
38
|
+
const t = G(N(e.image)), a = e.filename ?? `image.${t}`, l = e.image.startsWith("data:") ? URL.createObjectURL(z(e.image)) : null, o = l ?? e.image, r = document.createElement("a");
|
|
39
|
+
r.href = o, r.download = a, r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r), l && URL.revokeObjectURL(l);
|
|
40
40
|
}, M = async (e) => {
|
|
41
41
|
if (typeof navigator > "u" || !navigator.clipboard || typeof ClipboardItem > "u")
|
|
42
42
|
throw new Error("Clipboard API is not available in this environment.");
|
|
43
|
-
const t = e.image.startsWith("data:") ? z(e.image) : await fetch(e.image).then((i) => i.blob()),
|
|
44
|
-
await navigator.clipboard.write([new ClipboardItem({ [
|
|
43
|
+
const t = e.image.startsWith("data:") ? z(e.image) : await fetch(e.image).then((i) => i.blob()), a = N(e.image) ?? t.type ?? "image/png";
|
|
44
|
+
await navigator.clipboard.write([new ClipboardItem({ [a]: t })]);
|
|
45
45
|
}, T = P(
|
|
46
46
|
"aui-image-root relative overflow-hidden rounded-lg",
|
|
47
47
|
{
|
|
@@ -67,17 +67,17 @@ const G = (e) => {
|
|
|
67
67
|
function h({
|
|
68
68
|
className: e,
|
|
69
69
|
variant: t,
|
|
70
|
-
size:
|
|
70
|
+
size: a,
|
|
71
71
|
children: i,
|
|
72
72
|
...l
|
|
73
73
|
}) {
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ n(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
"data-slot": "image-root",
|
|
78
78
|
"data-variant": t,
|
|
79
|
-
"data-size":
|
|
80
|
-
className: d(T({ variant: t, size:
|
|
79
|
+
"data-size": a,
|
|
80
|
+
className: d(T({ variant: t, size: a, className: e })),
|
|
81
81
|
...l,
|
|
82
82
|
children: i
|
|
83
83
|
}
|
|
@@ -86,7 +86,7 @@ function h({
|
|
|
86
86
|
function C({
|
|
87
87
|
className: e,
|
|
88
88
|
containerClassName: t,
|
|
89
|
-
onLoad:
|
|
89
|
+
onLoad: a,
|
|
90
90
|
onError: i,
|
|
91
91
|
alt: l = "Image content",
|
|
92
92
|
src: o,
|
|
@@ -94,20 +94,20 @@ function C({
|
|
|
94
94
|
}) {
|
|
95
95
|
const s = F(null), [f, m] = p(void 0), [y, U] = p(void 0), x = f === o, I = y === o;
|
|
96
96
|
return b(() => {
|
|
97
|
-
var
|
|
98
|
-
typeof o == "string" && ((
|
|
99
|
-
}, [o]), /* @__PURE__ */
|
|
97
|
+
var g;
|
|
98
|
+
typeof o == "string" && ((g = s.current) != null && g.complete) && s.current.naturalWidth > 0 && m(o);
|
|
99
|
+
}, [o]), /* @__PURE__ */ u(
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
102
|
"data-slot": "image-preview",
|
|
103
103
|
className: d("relative min-h-32", t),
|
|
104
104
|
children: [
|
|
105
|
-
!x && !I && /* @__PURE__ */
|
|
105
|
+
!x && !I && /* @__PURE__ */ n(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
"data-slot": "image-preview-loading",
|
|
109
109
|
className: "bg-muted/50 absolute inset-0 flex items-center justify-center",
|
|
110
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ n(
|
|
111
111
|
w,
|
|
112
112
|
{
|
|
113
113
|
variant: "content",
|
|
@@ -118,14 +118,14 @@ function C({
|
|
|
118
118
|
)
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
I ? /* @__PURE__ */
|
|
121
|
+
I ? /* @__PURE__ */ n(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
124
|
"data-slot": "image-preview-error",
|
|
125
125
|
className: "bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ n(S, { className: "text-muted-foreground size-8" })
|
|
127
127
|
}
|
|
128
|
-
) : /* @__PURE__ */
|
|
128
|
+
) : /* @__PURE__ */ n(
|
|
129
129
|
"img",
|
|
130
130
|
{
|
|
131
131
|
ref: s,
|
|
@@ -136,11 +136,11 @@ function C({
|
|
|
136
136
|
!x && "invisible",
|
|
137
137
|
e
|
|
138
138
|
),
|
|
139
|
-
onLoad: (
|
|
140
|
-
typeof o == "string" && m(o),
|
|
139
|
+
onLoad: (g) => {
|
|
140
|
+
typeof o == "string" && m(o), a == null || a(g);
|
|
141
141
|
},
|
|
142
|
-
onError: (
|
|
143
|
-
typeof o == "string" && U(o), i == null || i(
|
|
142
|
+
onError: (g) => {
|
|
143
|
+
typeof o == "string" && U(o), i == null || i(g);
|
|
144
144
|
},
|
|
145
145
|
...r
|
|
146
146
|
}
|
|
@@ -152,9 +152,9 @@ function C({
|
|
|
152
152
|
function v({
|
|
153
153
|
className: e,
|
|
154
154
|
children: t,
|
|
155
|
-
...
|
|
155
|
+
...a
|
|
156
156
|
}) {
|
|
157
|
-
return t ? /* @__PURE__ */
|
|
157
|
+
return t ? /* @__PURE__ */ n(
|
|
158
158
|
"span",
|
|
159
159
|
{
|
|
160
160
|
"data-slot": "image-filename",
|
|
@@ -162,12 +162,12 @@ function v({
|
|
|
162
162
|
"text-muted-foreground block truncate px-2 py-1.5 text-xs",
|
|
163
163
|
e
|
|
164
164
|
),
|
|
165
|
-
...
|
|
165
|
+
...a,
|
|
166
166
|
children: t
|
|
167
167
|
}
|
|
168
168
|
) : null;
|
|
169
169
|
}
|
|
170
|
-
function j({ src: e, alt: t = "Image preview", children:
|
|
170
|
+
function j({ src: e, alt: t = "Image preview", children: a }) {
|
|
171
171
|
const [i, l] = p(!1), [o, r] = p(!1);
|
|
172
172
|
b(() => {
|
|
173
173
|
l(!0);
|
|
@@ -185,8 +185,8 @@ function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
185
185
|
return document.body.style.overflow = "hidden", () => {
|
|
186
186
|
document.body.style.overflow = m;
|
|
187
187
|
};
|
|
188
|
-
}, [o]), /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
188
|
+
}, [o]), /* @__PURE__ */ u(E, { children: [
|
|
189
|
+
/* @__PURE__ */ n(
|
|
190
190
|
"div",
|
|
191
191
|
{
|
|
192
192
|
onClick: s,
|
|
@@ -195,21 +195,21 @@ function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
195
195
|
tabIndex: 0,
|
|
196
196
|
className: "aui-image-zoom-trigger cursor-zoom-in",
|
|
197
197
|
"aria-label": "Click to zoom image",
|
|
198
|
-
children:
|
|
198
|
+
children: a
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
201
|
i && o && O(
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ n(
|
|
203
203
|
"div",
|
|
204
204
|
{
|
|
205
205
|
"data-slot": "image-zoom-overlay",
|
|
206
206
|
role: "button",
|
|
207
207
|
tabIndex: 0,
|
|
208
|
-
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-
|
|
208
|
+
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-wg12/80 duration-200",
|
|
209
209
|
onClick: f,
|
|
210
210
|
onKeyDown: (m) => m.key === "Enter" && f(),
|
|
211
211
|
"aria-label": "Close zoomed image",
|
|
212
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ n(
|
|
213
213
|
"img",
|
|
214
214
|
{
|
|
215
215
|
"data-slot": "image-zoom-content",
|
|
@@ -228,7 +228,7 @@ function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
228
228
|
] });
|
|
229
229
|
}
|
|
230
230
|
function k({ className: e }) {
|
|
231
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ n(
|
|
232
232
|
"div",
|
|
233
233
|
{
|
|
234
234
|
"data-slot": "image-generating",
|
|
@@ -236,7 +236,7 @@ function k({ className: e }) {
|
|
|
236
236
|
"bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
237
237
|
e
|
|
238
238
|
),
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ n(
|
|
240
240
|
w,
|
|
241
241
|
{
|
|
242
242
|
variant: "surface",
|
|
@@ -252,7 +252,7 @@ function R({
|
|
|
252
252
|
className: e,
|
|
253
253
|
reason: t
|
|
254
254
|
}) {
|
|
255
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ u(
|
|
256
256
|
"div",
|
|
257
257
|
{
|
|
258
258
|
"data-slot": "image-content-filter-error",
|
|
@@ -261,9 +261,9 @@ function R({
|
|
|
261
261
|
e
|
|
262
262
|
),
|
|
263
263
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
t && /* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ n(B, { className: "text-muted-foreground size-8" }),
|
|
265
|
+
/* @__PURE__ */ n("p", { className: "text-sm font-medium", children: "Image could not be generated" }),
|
|
266
|
+
t && /* @__PURE__ */ n("p", { className: "text-muted-foreground text-xs", children: t })
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
);
|
|
@@ -271,17 +271,17 @@ function R({
|
|
|
271
271
|
function V({
|
|
272
272
|
onRegenerate: e
|
|
273
273
|
}) {
|
|
274
|
-
const [t,
|
|
275
|
-
return /* @__PURE__ */
|
|
274
|
+
const [t, a] = p(!1);
|
|
275
|
+
return /* @__PURE__ */ n(
|
|
276
276
|
"button",
|
|
277
277
|
{
|
|
278
278
|
type: "button",
|
|
279
279
|
onClick: async () => {
|
|
280
|
-
|
|
280
|
+
a(!0);
|
|
281
281
|
try {
|
|
282
282
|
await e();
|
|
283
283
|
} finally {
|
|
284
|
-
|
|
284
|
+
a(!1);
|
|
285
285
|
}
|
|
286
286
|
},
|
|
287
287
|
disabled: t,
|
|
@@ -289,18 +289,18 @@ function V({
|
|
|
289
289
|
"aria-label": "Regenerate image",
|
|
290
290
|
"aria-busy": t || void 0,
|
|
291
291
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded disabled:opacity-50",
|
|
292
|
-
children: t ? /* @__PURE__ */
|
|
292
|
+
children: t ? /* @__PURE__ */ n(w, { variant: "action", size: "sm", "aria-hidden": !0 }) : /* @__PURE__ */ n(W, { className: "size-4" })
|
|
293
293
|
}
|
|
294
294
|
);
|
|
295
295
|
}
|
|
296
|
-
function Z({ part: e, onRegenerate: t, className:
|
|
297
|
-
return /* @__PURE__ */
|
|
296
|
+
function Z({ part: e, onRegenerate: t, className: a }) {
|
|
297
|
+
return /* @__PURE__ */ u(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
300
|
"data-slot": "image-actions",
|
|
301
|
-
className: d("flex items-center gap-1 p-1",
|
|
301
|
+
className: d("flex items-center gap-1 p-1", a),
|
|
302
302
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ n(
|
|
304
304
|
"button",
|
|
305
305
|
{
|
|
306
306
|
type: "button",
|
|
@@ -308,10 +308,10 @@ function Z({ part: e, onRegenerate: t, className: n }) {
|
|
|
308
308
|
"data-slot": "image-download",
|
|
309
309
|
"aria-label": "Download image",
|
|
310
310
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
311
|
-
children: /* @__PURE__ */
|
|
311
|
+
children: /* @__PURE__ */ n(A, { className: "size-4" })
|
|
312
312
|
}
|
|
313
313
|
),
|
|
314
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ n(
|
|
315
315
|
"button",
|
|
316
316
|
{
|
|
317
317
|
type: "button",
|
|
@@ -322,22 +322,22 @@ function Z({ part: e, onRegenerate: t, className: n }) {
|
|
|
322
322
|
"data-slot": "image-copy",
|
|
323
323
|
"aria-label": "Copy image",
|
|
324
324
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
325
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ n(L, { className: "size-4" })
|
|
326
326
|
}
|
|
327
327
|
),
|
|
328
|
-
t && /* @__PURE__ */
|
|
328
|
+
t && /* @__PURE__ */ n(V, { onRegenerate: t })
|
|
329
329
|
]
|
|
330
330
|
}
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
333
|
const $ = (e) => {
|
|
334
|
-
const { image: t, filename:
|
|
335
|
-
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
334
|
+
const { image: t, filename: a, status: i } = e;
|
|
335
|
+
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */ u(h, { children: [
|
|
336
|
+
/* @__PURE__ */ n(k, {}),
|
|
337
|
+
/* @__PURE__ */ n(v, { children: a })
|
|
338
|
+
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */ n(h, { children: /* @__PURE__ */ n(R, { reason: "The provider blocked this image." }) }) : /* @__PURE__ */ u(h, { children: [
|
|
339
|
+
/* @__PURE__ */ n(j, { src: t, alt: a || "Image content", children: /* @__PURE__ */ n(C, { src: t, alt: a || "Image content" }) }),
|
|
340
|
+
/* @__PURE__ */ n(v, { children: a })
|
|
341
341
|
] });
|
|
342
342
|
}, c = D($);
|
|
343
343
|
c.displayName = "Image";
|
|
@@ -5,7 +5,6 @@ export * from './answer-tool-ui';
|
|
|
5
5
|
export * from './composer';
|
|
6
6
|
export * from './message';
|
|
7
7
|
export * from './action-bar';
|
|
8
|
-
export * from './branch-picker';
|
|
9
8
|
export * from './attachment';
|
|
10
9
|
export * from './composer-add-context';
|
|
11
10
|
export * from './composer-deep-research';
|
|
@@ -21,7 +20,5 @@ export * from './quote';
|
|
|
21
20
|
export * from './sources';
|
|
22
21
|
export * from './tool-fallback';
|
|
23
22
|
export * from './tool-group';
|
|
24
|
-
export * from './follow-up-suggestions';
|
|
25
23
|
export * from './selection-toolbar';
|
|
26
|
-
export * from './suggestions';
|
|
27
24
|
export * from './tooltip-icon-button';
|
|
@@ -25,7 +25,7 @@ const r = (s) => s === void 0 ? "—" : s < 1e3 ? `${Math.round(s)}ms` : `${(s /
|
|
|
25
25
|
side: o,
|
|
26
26
|
sideOffset: 8,
|
|
27
27
|
"data-slot": "message-timing-popover",
|
|
28
|
-
className: "bg-popover text-popover-foreground rounded-lg border px-3 py-2 shadow-
|
|
28
|
+
className: "bg-popover text-popover-foreground rounded-lg border px-3 py-2 shadow-300 [&_span>svg]:hidden!",
|
|
29
29
|
children: /* @__PURE__ */ n("div", { className: "grid min-w-35 gap-1.5 text-xs", children: [
|
|
30
30
|
e.firstTokenTime !== void 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4", children: [
|
|
31
31
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "First token" }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, jsx as t, Fragment as
|
|
2
|
+
import { jsxs as l, jsx as t, Fragment as p } from "react/jsx-runtime";
|
|
3
3
|
import { memo as f } from "react";
|
|
4
|
-
import { SelectionToolbarPrimitive as
|
|
4
|
+
import { SelectionToolbarPrimitive as m } from "@assistant-ui/react";
|
|
5
5
|
import { Quote as y, Copy as S } from "../../lib/icons.js";
|
|
6
6
|
import { cn as i } from "../../lib/cn.js";
|
|
7
7
|
function d({
|
|
@@ -9,11 +9,11 @@ function d({
|
|
|
9
9
|
...e
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ t(
|
|
12
|
-
|
|
12
|
+
m.Root,
|
|
13
13
|
{
|
|
14
14
|
"data-slot": "selection-toolbar",
|
|
15
15
|
className: i(
|
|
16
|
-
"bg-popover flex items-center gap-1 rounded-lg border px-1 py-1 shadow-
|
|
16
|
+
"bg-popover flex items-center gap-1 rounded-lg border px-1 py-1 shadow-300",
|
|
17
17
|
o
|
|
18
18
|
),
|
|
19
19
|
...e
|
|
@@ -26,7 +26,7 @@ function u({
|
|
|
26
26
|
...r
|
|
27
27
|
}) {
|
|
28
28
|
return /* @__PURE__ */ t(
|
|
29
|
-
|
|
29
|
+
m.Quote,
|
|
30
30
|
{
|
|
31
31
|
"data-slot": "selection-toolbar-quote",
|
|
32
32
|
className: i(
|
|
@@ -34,7 +34,7 @@ function u({
|
|
|
34
34
|
o
|
|
35
35
|
),
|
|
36
36
|
...r,
|
|
37
|
-
children: e ?? /* @__PURE__ */ l(
|
|
37
|
+
children: e ?? /* @__PURE__ */ l(p, { children: [
|
|
38
38
|
/* @__PURE__ */ t(y, { className: "size-3.5" }),
|
|
39
39
|
"Quote"
|
|
40
40
|
] })
|
|
@@ -63,7 +63,7 @@ function b({
|
|
|
63
63
|
), (s = window.getSelection()) == null || s.removeAllRanges(), r == null || r(x);
|
|
64
64
|
},
|
|
65
65
|
...g,
|
|
66
|
-
children: e ?? /* @__PURE__ */ l(
|
|
66
|
+
children: e ?? /* @__PURE__ */ l(p, { children: [
|
|
67
67
|
/* @__PURE__ */ t(S, { className: "size-3.5" }),
|
|
68
68
|
"Copy"
|
|
69
69
|
] })
|
|
@@ -13,7 +13,9 @@ export type ThreadComponents = {
|
|
|
13
13
|
/** Optional identity shown beside every assistant turn. */
|
|
14
14
|
AssistantAvatar?: ComponentType | undefined;
|
|
15
15
|
Welcome?: ComponentType | undefined;
|
|
16
|
-
/**
|
|
16
|
+
/** Replaces the complete new-chat viewport, including its Composer. */
|
|
17
|
+
EmptyState?: ComponentType | undefined;
|
|
18
|
+
/** Wraps the default Composer with an attached product-specific treatment. */
|
|
17
19
|
ComposerDock?: ComponentType<PropsWithChildren> | undefined;
|
|
18
20
|
/** Replaces the left-side composer controls (context, upload, harness). */
|
|
19
21
|
ComposerAccessories?: ComponentType | undefined;
|
|
@@ -1,80 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Composer as
|
|
4
|
-
import { ComposerPlaceholdersProvider as
|
|
2
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Composer as u } from "./composer.js";
|
|
4
|
+
import { ComposerPlaceholdersProvider as q } from "./composer.js";
|
|
5
5
|
import { RenderAnswerToolUI as p } from "./answer-tool-ui.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { isNewChatView as m, ThreadComponentsContext as f, EMPTY_COMPONENTS as w } from "./thread-context.js";
|
|
6
|
+
import { ThreadMessage as x } from "./message.js";
|
|
7
|
+
import { SelectionToolbar as g } from "./selection-toolbar.js";
|
|
8
|
+
import { Button as w } from "../ui/button.js";
|
|
9
|
+
import { isNewChatView as n, ThreadComponentsContext as f, EMPTY_COMPONENTS as b } from "./thread-context.js";
|
|
11
10
|
import { TooltipIconButton as v } from "./tooltip-icon-button.js";
|
|
12
11
|
import { cn as T } from "../../lib/cn.js";
|
|
13
|
-
import { useAuiState as
|
|
14
|
-
import { ArrowDown as
|
|
15
|
-
import { useContext as
|
|
16
|
-
const
|
|
17
|
-
components:
|
|
18
|
-
isAnswerToolEnabled:
|
|
12
|
+
import { useAuiState as N, ThreadPrimitive as o, AuiIf as h, SuggestionPrimitive as s } from "@assistant-ui/react";
|
|
13
|
+
import { ArrowDown as y } from "../../lib/icons.js";
|
|
14
|
+
import { useContext as S } from "react";
|
|
15
|
+
const H = ({
|
|
16
|
+
components: t = b,
|
|
17
|
+
isAnswerToolEnabled: l = !0,
|
|
19
18
|
composerPlacement: a = "adaptive"
|
|
20
19
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
/* @__PURE__ */
|
|
20
|
+
const i = N(n);
|
|
21
|
+
return /* @__PURE__ */ r(f.Provider, { value: t, children: [
|
|
22
|
+
l && /* @__PURE__ */ e(p, {}),
|
|
23
|
+
/* @__PURE__ */ e(C, { isEmpty: i, composerPlacement: a })
|
|
25
24
|
] });
|
|
26
|
-
},
|
|
27
|
-
const { Welcome: a =
|
|
25
|
+
}, C = ({ isEmpty: t, composerPlacement: l }) => {
|
|
26
|
+
const { Welcome: a = A, EmptyState: i, ComposerDock: d } = S(
|
|
28
27
|
f
|
|
29
|
-
),
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
28
|
+
), m = l === "bottom";
|
|
29
|
+
return /* @__PURE__ */ r(o.Root, { className: "aui-root aui-thread-root bg-background @container flex h-full flex-col", children: [
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
o.Viewport,
|
|
33
32
|
{
|
|
34
33
|
turnAnchor: "top",
|
|
35
34
|
"data-slot": "aui_thread-viewport",
|
|
36
35
|
className: "relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
36
|
+
children: t && i ? /* @__PURE__ */ e(i, {}) : /* @__PURE__ */ r("div", { className: "mx-auto flex w-full max-w-(--thread-max-width) flex-1 flex-col px-4 pt-4", children: [
|
|
37
|
+
/* @__PURE__ */ e(h, { condition: n, children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col items-center justify-end", children: /* @__PURE__ */ e(a, {}) }) }),
|
|
38
|
+
/* @__PURE__ */ e(
|
|
40
39
|
"div",
|
|
41
40
|
{
|
|
42
41
|
"data-slot": "aui_message-group",
|
|
43
42
|
className: "mb-14 flex flex-col gap-y-8 empty:hidden",
|
|
44
|
-
children: /* @__PURE__ */ o
|
|
43
|
+
children: /* @__PURE__ */ e(o.Messages, { children: () => /* @__PURE__ */ e(x, {}) })
|
|
45
44
|
}
|
|
46
45
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
|
+
o.ViewportFooter,
|
|
49
48
|
{
|
|
50
49
|
className: T(
|
|
51
50
|
"aui-thread-viewport-footer bg-background flex flex-col gap-4 overflow-visible pb-4 md:pb-6",
|
|
52
|
-
|
|
53
|
-
(!
|
|
51
|
+
t && !m && "flex-1",
|
|
52
|
+
(!t || m) && "sticky bottom-0 mt-auto rounded-t-(--composer-radius)"
|
|
54
53
|
),
|
|
55
54
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */ o(d, { condition: (s) => m(s) && s.composer.isEmpty, children: /* @__PURE__ */ o(b, {}) })
|
|
55
|
+
/* @__PURE__ */ e(P, {}),
|
|
56
|
+
d ? /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(u, {}) }) : /* @__PURE__ */ e(u, {}),
|
|
57
|
+
/* @__PURE__ */ e(h, { condition: (c) => n(c) && c.composer.isEmpty, children: /* @__PURE__ */ e(I, {}) })
|
|
60
58
|
]
|
|
61
59
|
}
|
|
62
60
|
)
|
|
63
61
|
] })
|
|
64
62
|
}
|
|
65
63
|
),
|
|
66
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ e(g, {})
|
|
67
65
|
] });
|
|
68
|
-
},
|
|
66
|
+
}, P = () => /* @__PURE__ */ e(o.ScrollToBottom, { asChild: !0, children: /* @__PURE__ */ e(
|
|
69
67
|
v,
|
|
70
68
|
{
|
|
71
69
|
tooltip: "Scroll to bottom",
|
|
72
70
|
variant: "outline",
|
|
73
71
|
className: "aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible",
|
|
74
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ e(y, {})
|
|
75
73
|
}
|
|
76
|
-
) }),
|
|
74
|
+
) }), A = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-root mb-6 flex flex-col items-center px-4 text-center", children: /* @__PURE__ */ e("h1", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-xl font-medium duration-200", children: "How can I help you today?" }) }), I = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestions flex w-full flex-wrap items-center justify-center gap-2 px-4", children: /* @__PURE__ */ e(o.Suggestions, { children: () => /* @__PURE__ */ e(j, {}) }) }), j = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestion-display fade-in slide-in-from-bottom-2 animate-in fill-mode-both duration-200", children: /* @__PURE__ */ e(s.Trigger, { send: !0, asChild: !0, children: /* @__PURE__ */ r(
|
|
75
|
+
w,
|
|
76
|
+
{
|
|
77
|
+
variant: "ghost",
|
|
78
|
+
className: "aui-thread-welcome-suggestion text-foreground hover:bg-muted border-border/60 h-auto gap-1.5 rounded-full border px-3.5 py-1.5 text-xs font-normal whitespace-nowrap transition-colors",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ e(s.Title, { className: "aui-thread-welcome-suggestion-text-1" }),
|
|
81
|
+
/* @__PURE__ */ e(s.Description, { className: "aui-thread-welcome-suggestion-text-2 empty:hidden" })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
) }) });
|
|
77
85
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
q as ComposerPlaceholdersProvider,
|
|
87
|
+
H as Thread
|
|
80
88
|
};
|