@actioneer/ads 0.5.6 → 0.5.8
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/bin/ads-init.mjs +6 -0
- package/components/accordion.js +50 -48
- package/components/agent-icon.d.ts +12 -0
- package/components/agent-icon.js +135 -121
- package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
- package/components/ai-elements/chain-of-thought-icon.js +341 -201
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +108 -108
- package/components/ai-elements/chart.js +16 -14
- package/components/ai-elements/inline-citation.js +41 -41
- package/components/ai-elements/message.js +4 -4
- package/components/ai-elements/queue.js +7 -7
- package/components/ai-elements/research-activity.js +114 -114
- package/components/ai-elements/shimmer.d.ts +2 -2
- package/components/ai-elements/speech-input.js +28 -28
- package/components/ai-elements/task-progress.js +26 -16
- package/components/ai-elements/task.js +17 -17
- package/components/ai-elements/tool.js +6 -6
- package/components/ai-elements/transcript.js +6 -5
- package/components/ai-elements/voice.js +1 -1
- package/components/alert.js +10 -10
- package/components/answer-sources.d.ts +42 -0
- package/components/answer-sources.js +111 -0
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +131 -103
- package/components/assistant-ui/badge.d.ts +1 -1
- package/components/assistant-ui/badge.js +17 -17
- package/components/assistant-ui/chain-of-thought.d.ts +1 -1
- package/components/assistant-ui/composer-add-context.js +9 -9
- package/components/assistant-ui/composer-deep-research.js +5 -5
- package/components/assistant-ui/composer-harness.js +12 -9
- package/components/assistant-ui/composer-trigger-popover.js +45 -34
- package/components/assistant-ui/composer.js +59 -59
- package/components/assistant-ui/error.js +14 -14
- package/components/assistant-ui/file.d.ts +1 -1
- package/components/assistant-ui/image.d.ts +1 -1
- package/components/assistant-ui/image.js +113 -103
- package/components/assistant-ui/markdown-text.js +18 -18
- package/components/assistant-ui/message.js +46 -45
- package/components/assistant-ui/quote.js +1 -1
- package/components/assistant-ui/reasoning.d.ts +1 -1
- package/components/assistant-ui/reasoning.js +66 -77
- package/components/assistant-ui/suggestions.js +4 -4
- package/components/assistant-ui/thread-context.d.ts +2 -0
- package/components/assistant-ui/thread.js +41 -40
- package/components/assistant-ui/tool-fallback.js +60 -63
- package/components/assistant-ui/tool-group.d.ts +1 -1
- package/components/assistant-ui/tool-group.js +36 -42
- package/components/audio-waveform.js +25 -24
- package/components/autocomplete.d.ts +1 -0
- package/components/autocomplete.js +45 -43
- package/components/avatar.js +30 -30
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.js +2 -2
- package/components/button.d.ts +2 -2
- package/components/button.js +22 -20
- package/components/card.js +8 -8
- package/components/carousel.js +105 -104
- package/components/chart.js +9 -7
- package/components/checkbox.js +74 -38
- package/components/chip.d.ts +1 -1
- package/components/code-block.js +3 -3
- package/components/collapsible.js +67 -23
- package/components/connector-card.js +6 -6
- package/components/drawer.d.ts +15 -10
- package/components/drawer.js +78 -77
- package/components/dropdown.d.ts +3 -1
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +4 -4
- package/components/empty-state.js +7 -7
- package/components/field.d.ts +4 -0
- package/components/field.js +45 -34
- package/components/file-dropzone.js +12 -12
- package/components/index.d.ts +4 -0
- package/components/index.js +584 -553
- package/components/infinite-canvas.js +1 -1
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.js +105 -73
- package/components/navbar.d.ts +1 -1
- package/components/navbar.js +1 -1
- package/components/number-field.js +38 -29
- package/components/page-header.js +12 -12
- package/components/pagination.js +19 -19
- package/components/panel.js +2 -2
- package/components/pixel-blast-svg.js +3 -3
- package/components/pixel-icon.d.ts +3 -1
- package/components/pixel-icon.js +294 -215
- package/components/popover.d.ts +1 -1
- package/components/popover.js +66 -64
- package/components/progress-circle.js +36 -32
- package/components/progress.js +28 -24
- package/components/radio.js +59 -49
- package/components/resizable-panel.js +1 -1
- package/components/reveal.d.ts +2 -2
- package/components/ripple.d.ts +3 -3
- package/components/scroll-area.js +17 -16
- package/components/segmented.d.ts +4 -1
- package/components/segmented.js +26 -25
- package/components/select.d.ts +2 -0
- package/components/select.js +61 -57
- package/components/setting-row.js +45 -42
- package/components/sidebar.d.ts +2 -2
- package/components/sidebar.js +131 -127
- package/components/skeleton.js +5 -5
- package/components/spinner.d.ts +13 -4
- package/components/spinner.js +42 -42
- package/components/stepper.js +21 -21
- package/components/switch.js +52 -32
- package/components/table.d.ts +24 -7
- package/components/table.js +457 -220
- package/components/tabs.js +149 -137
- package/components/textarea.js +1 -2
- package/components/toast.js +66 -66
- package/components/tooltip.js +2 -2
- package/components/tree.js +62 -51
- package/components/typography.d.ts +2 -1
- package/components/typography.js +33 -32
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +19 -19
- package/components/ui/collapsible.d.ts +1 -5
- package/components/ui/dialog.d.ts +3 -3
- package/components/ui/dialog.js +95 -58
- package/components/ui/tooltip.d.ts +2 -2
- package/components/ui/tooltip.js +67 -33
- package/components/viz-charts.js +95 -95
- package/demo/components/add-to-artifact.js +341 -0
- package/demo/lib/artifact-library.js +134 -0
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
- package/fonts.css +11 -11
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +107 -104
- package/lib/motion.d.ts +42 -39
- package/lib/motion.js +112 -52
- package/lib/spinner-mark.d.ts +9 -0
- package/lib/spinner-mark.js +98 -0
- package/llms.txt +69 -26
- package/manifest.json +344 -42
- package/package.json +1 -1
- package/styles.css +175 -161
- package/theme.css +104 -128
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { cva as
|
|
6
|
-
import {
|
|
7
|
-
import { cn as
|
|
8
|
-
|
|
2
|
+
import { jsxs as g, jsx as a, Fragment as E } from "react/jsx-runtime";
|
|
3
|
+
import { memo as D, useRef as F, useState as p, useEffect as b } from "react";
|
|
4
|
+
import { createPortal as O } from "react-dom";
|
|
5
|
+
import { cva as P } from "class-variance-authority";
|
|
6
|
+
import { ImageOff as S, Download as A, Copy as L, WarningCircle as B, Refresh as W } from "../../lib/icons.js";
|
|
7
|
+
import { cn as d } from "../../lib/cn.js";
|
|
8
|
+
import { Spinner as w } from "../spinner.js";
|
|
9
|
+
const G = (e) => {
|
|
9
10
|
switch (e) {
|
|
10
11
|
case "image/png":
|
|
11
12
|
return "png";
|
|
@@ -21,27 +22,27 @@ const K = (e) => {
|
|
|
21
22
|
default:
|
|
22
23
|
return "png";
|
|
23
24
|
}
|
|
24
|
-
},
|
|
25
|
+
}, z = (e) => {
|
|
25
26
|
var r;
|
|
26
27
|
const [t, n] = e.split(","), i = ((r = t == null ? void 0 : t.match(/data:([^;]+)/)) == null ? void 0 : r[1]) ?? "application/octet-stream";
|
|
27
28
|
if (!/;base64/i.test(t ?? ""))
|
|
28
29
|
return new Blob([decodeURIComponent(n ?? "")], { type: i });
|
|
29
|
-
const
|
|
30
|
-
for (let
|
|
30
|
+
const l = atob(n ?? ""), o = new Uint8Array(l.length);
|
|
31
|
+
for (let s = 0; s < l.length; s++) o[s] = l.charCodeAt(s);
|
|
31
32
|
return new Blob([o], { type: i });
|
|
32
33
|
}, N = (e) => {
|
|
33
34
|
var t;
|
|
34
35
|
return (t = e.match(/^data:([^;,]+)/)) == null ? void 0 : t[1];
|
|
35
|
-
},
|
|
36
|
+
}, K = (e) => {
|
|
36
37
|
if (typeof document > "u") return;
|
|
37
|
-
const t =
|
|
38
|
-
r.href = o, r.download = n, r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r),
|
|
39
|
-
},
|
|
38
|
+
const t = G(N(e.image)), n = 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 = n, r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r), l && URL.revokeObjectURL(l);
|
|
40
|
+
}, M = async (e) => {
|
|
40
41
|
if (typeof navigator > "u" || !navigator.clipboard || typeof ClipboardItem > "u")
|
|
41
42
|
throw new Error("Clipboard API is not available in this environment.");
|
|
42
|
-
const t = e.image.startsWith("data:") ?
|
|
43
|
+
const t = e.image.startsWith("data:") ? z(e.image) : await fetch(e.image).then((i) => i.blob()), n = N(e.image) ?? t.type ?? "image/png";
|
|
43
44
|
await navigator.clipboard.write([new ClipboardItem({ [n]: t })]);
|
|
44
|
-
},
|
|
45
|
+
}, T = P(
|
|
45
46
|
"aui-image-root relative overflow-hidden rounded-lg",
|
|
46
47
|
{
|
|
47
48
|
variants: {
|
|
@@ -68,7 +69,7 @@ function h({
|
|
|
68
69
|
variant: t,
|
|
69
70
|
size: n,
|
|
70
71
|
children: i,
|
|
71
|
-
...
|
|
72
|
+
...l
|
|
72
73
|
}) {
|
|
73
74
|
return /* @__PURE__ */ a(
|
|
74
75
|
"div",
|
|
@@ -76,62 +77,70 @@ function h({
|
|
|
76
77
|
"data-slot": "image-root",
|
|
77
78
|
"data-variant": t,
|
|
78
79
|
"data-size": n,
|
|
79
|
-
className:
|
|
80
|
-
...
|
|
80
|
+
className: d(T({ variant: t, size: n, className: e })),
|
|
81
|
+
...l,
|
|
81
82
|
children: i
|
|
82
83
|
}
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function C({
|
|
86
87
|
className: e,
|
|
87
88
|
containerClassName: t,
|
|
88
89
|
onLoad: n,
|
|
89
90
|
onError: i,
|
|
90
|
-
alt:
|
|
91
|
+
alt: l = "Image content",
|
|
91
92
|
src: o,
|
|
92
93
|
...r
|
|
93
94
|
}) {
|
|
94
|
-
const
|
|
95
|
+
const s = F(null), [f, m] = p(void 0), [y, U] = p(void 0), x = f === o, I = y === o;
|
|
95
96
|
return b(() => {
|
|
96
|
-
var
|
|
97
|
-
typeof o == "string" && ((
|
|
98
|
-
}, [o]), /* @__PURE__ */
|
|
97
|
+
var u;
|
|
98
|
+
typeof o == "string" && ((u = s.current) != null && u.complete) && s.current.naturalWidth > 0 && m(o);
|
|
99
|
+
}, [o]), /* @__PURE__ */ g(
|
|
99
100
|
"div",
|
|
100
101
|
{
|
|
101
102
|
"data-slot": "image-preview",
|
|
102
|
-
className:
|
|
103
|
+
className: d("relative min-h-32", t),
|
|
103
104
|
children: [
|
|
104
|
-
!
|
|
105
|
+
!x && !I && /* @__PURE__ */ a(
|
|
105
106
|
"div",
|
|
106
107
|
{
|
|
107
108
|
"data-slot": "image-preview-loading",
|
|
108
109
|
className: "bg-muted/50 absolute inset-0 flex items-center justify-center",
|
|
109
|
-
children: /* @__PURE__ */ a(
|
|
110
|
+
children: /* @__PURE__ */ a(
|
|
111
|
+
w,
|
|
112
|
+
{
|
|
113
|
+
variant: "content",
|
|
114
|
+
size: "md",
|
|
115
|
+
color: "muted",
|
|
116
|
+
label: "Loading image"
|
|
117
|
+
}
|
|
118
|
+
)
|
|
110
119
|
}
|
|
111
120
|
),
|
|
112
|
-
|
|
121
|
+
I ? /* @__PURE__ */ a(
|
|
113
122
|
"div",
|
|
114
123
|
{
|
|
115
124
|
"data-slot": "image-preview-error",
|
|
116
125
|
className: "bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
117
|
-
children: /* @__PURE__ */ a(
|
|
126
|
+
children: /* @__PURE__ */ a(S, { className: "text-muted-foreground size-8" })
|
|
118
127
|
}
|
|
119
128
|
) : /* @__PURE__ */ a(
|
|
120
129
|
"img",
|
|
121
130
|
{
|
|
122
|
-
ref:
|
|
131
|
+
ref: s,
|
|
123
132
|
src: o,
|
|
124
|
-
alt:
|
|
125
|
-
className:
|
|
133
|
+
alt: l,
|
|
134
|
+
className: d(
|
|
126
135
|
"block h-auto w-full object-contain",
|
|
127
|
-
!
|
|
136
|
+
!x && "invisible",
|
|
128
137
|
e
|
|
129
138
|
),
|
|
130
|
-
onLoad: (
|
|
131
|
-
typeof o == "string" &&
|
|
139
|
+
onLoad: (u) => {
|
|
140
|
+
typeof o == "string" && m(o), n == null || n(u);
|
|
132
141
|
},
|
|
133
|
-
onError: (
|
|
134
|
-
typeof o == "string" &&
|
|
142
|
+
onError: (u) => {
|
|
143
|
+
typeof o == "string" && U(o), i == null || i(u);
|
|
135
144
|
},
|
|
136
145
|
...r
|
|
137
146
|
}
|
|
@@ -149,7 +158,7 @@ function v({
|
|
|
149
158
|
"span",
|
|
150
159
|
{
|
|
151
160
|
"data-slot": "image-filename",
|
|
152
|
-
className:
|
|
161
|
+
className: d(
|
|
153
162
|
"text-muted-foreground block truncate px-2 py-1.5 text-xs",
|
|
154
163
|
e
|
|
155
164
|
),
|
|
@@ -158,30 +167,30 @@ function v({
|
|
|
158
167
|
}
|
|
159
168
|
) : null;
|
|
160
169
|
}
|
|
161
|
-
function
|
|
162
|
-
const [i,
|
|
170
|
+
function j({ src: e, alt: t = "Image preview", children: n }) {
|
|
171
|
+
const [i, l] = p(!1), [o, r] = p(!1);
|
|
163
172
|
b(() => {
|
|
164
|
-
|
|
173
|
+
l(!0);
|
|
165
174
|
}, []);
|
|
166
|
-
const
|
|
175
|
+
const s = () => r(!0), f = () => r(!1);
|
|
167
176
|
return b(() => {
|
|
168
177
|
if (!o) return;
|
|
169
|
-
const
|
|
178
|
+
const m = (y) => {
|
|
170
179
|
y.key === "Escape" && r(!1);
|
|
171
180
|
};
|
|
172
|
-
return document.addEventListener("keydown",
|
|
181
|
+
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
173
182
|
}, [o]), b(() => {
|
|
174
183
|
if (!o) return;
|
|
175
|
-
const
|
|
184
|
+
const m = document.body.style.overflow;
|
|
176
185
|
return document.body.style.overflow = "hidden", () => {
|
|
177
|
-
document.body.style.overflow =
|
|
186
|
+
document.body.style.overflow = m;
|
|
178
187
|
};
|
|
179
|
-
}, [o]), /* @__PURE__ */
|
|
188
|
+
}, [o]), /* @__PURE__ */ g(E, { children: [
|
|
180
189
|
/* @__PURE__ */ a(
|
|
181
190
|
"div",
|
|
182
191
|
{
|
|
183
|
-
onClick:
|
|
184
|
-
onKeyDown: (
|
|
192
|
+
onClick: s,
|
|
193
|
+
onKeyDown: (m) => m.key === "Enter" && s(),
|
|
185
194
|
role: "button",
|
|
186
195
|
tabIndex: 0,
|
|
187
196
|
className: "aui-image-zoom-trigger cursor-zoom-in",
|
|
@@ -189,16 +198,16 @@ function C({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
189
198
|
children: n
|
|
190
199
|
}
|
|
191
200
|
),
|
|
192
|
-
i && o &&
|
|
201
|
+
i && o && O(
|
|
193
202
|
/* @__PURE__ */ a(
|
|
194
203
|
"div",
|
|
195
204
|
{
|
|
196
205
|
"data-slot": "image-zoom-overlay",
|
|
197
206
|
role: "button",
|
|
198
207
|
tabIndex: 0,
|
|
199
|
-
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-black/80 duration-
|
|
208
|
+
className: "aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-black/80 duration-200",
|
|
200
209
|
onClick: f,
|
|
201
|
-
onKeyDown: (
|
|
210
|
+
onKeyDown: (m) => m.key === "Enter" && f(),
|
|
202
211
|
"aria-label": "Close zoomed image",
|
|
203
212
|
children: /* @__PURE__ */ a(
|
|
204
213
|
"img",
|
|
@@ -206,9 +215,9 @@ function C({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
206
215
|
"data-slot": "image-zoom-content",
|
|
207
216
|
src: e,
|
|
208
217
|
alt: t,
|
|
209
|
-
className: "aui-image-zoom-content fade-in zoom-in-95 animate-in max-h-[90vh] max-w-[90vw] cursor-zoom-out object-contain duration-
|
|
210
|
-
onClick: (
|
|
211
|
-
|
|
218
|
+
className: "aui-image-zoom-content fade-in zoom-in-95 animate-in max-h-[90vh] max-w-[90vw] cursor-zoom-out object-contain duration-200",
|
|
219
|
+
onClick: (m) => {
|
|
220
|
+
m.stopPropagation(), f();
|
|
212
221
|
}
|
|
213
222
|
}
|
|
214
223
|
)
|
|
@@ -218,43 +227,48 @@ function C({ src: e, alt: t = "Image preview", children: n }) {
|
|
|
218
227
|
)
|
|
219
228
|
] });
|
|
220
229
|
}
|
|
221
|
-
function
|
|
222
|
-
return /* @__PURE__ */
|
|
230
|
+
function k({ className: e }) {
|
|
231
|
+
return /* @__PURE__ */ a(
|
|
223
232
|
"div",
|
|
224
233
|
{
|
|
225
234
|
"data-slot": "image-generating",
|
|
226
|
-
className:
|
|
235
|
+
className: d(
|
|
227
236
|
"bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
228
237
|
e
|
|
229
238
|
),
|
|
230
|
-
children:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
239
|
+
children: /* @__PURE__ */ a(
|
|
240
|
+
w,
|
|
241
|
+
{
|
|
242
|
+
variant: "surface",
|
|
243
|
+
size: "lg",
|
|
244
|
+
color: "muted",
|
|
245
|
+
label: "Generating image"
|
|
246
|
+
}
|
|
247
|
+
)
|
|
234
248
|
}
|
|
235
249
|
);
|
|
236
250
|
}
|
|
237
|
-
function
|
|
251
|
+
function R({
|
|
238
252
|
className: e,
|
|
239
253
|
reason: t
|
|
240
254
|
}) {
|
|
241
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ g(
|
|
242
256
|
"div",
|
|
243
257
|
{
|
|
244
258
|
"data-slot": "image-content-filter-error",
|
|
245
|
-
className:
|
|
259
|
+
className: d(
|
|
246
260
|
"bg-muted/50 flex min-h-32 flex-col items-center justify-center gap-2 p-4 text-center",
|
|
247
261
|
e
|
|
248
262
|
),
|
|
249
263
|
children: [
|
|
250
|
-
/* @__PURE__ */ a(
|
|
264
|
+
/* @__PURE__ */ a(B, { className: "text-muted-foreground size-8" }),
|
|
251
265
|
/* @__PURE__ */ a("p", { className: "text-sm font-medium", children: "Image could not be generated" }),
|
|
252
266
|
t && /* @__PURE__ */ a("p", { className: "text-muted-foreground text-xs", children: t })
|
|
253
267
|
]
|
|
254
268
|
}
|
|
255
269
|
);
|
|
256
270
|
}
|
|
257
|
-
function
|
|
271
|
+
function V({
|
|
258
272
|
onRegenerate: e
|
|
259
273
|
}) {
|
|
260
274
|
const [t, n] = p(!1);
|
|
@@ -273,32 +287,28 @@ function Z({
|
|
|
273
287
|
disabled: t,
|
|
274
288
|
"data-slot": "image-regenerate",
|
|
275
289
|
"aria-label": "Regenerate image",
|
|
290
|
+
"aria-busy": t || void 0,
|
|
276
291
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded disabled:opacity-50",
|
|
277
|
-
children: /* @__PURE__ */ a(
|
|
278
|
-
G,
|
|
279
|
-
{
|
|
280
|
-
className: c("size-4", t && "animate-spin")
|
|
281
|
-
}
|
|
282
|
-
)
|
|
292
|
+
children: t ? /* @__PURE__ */ a(w, { variant: "action", size: "sm", "aria-hidden": !0 }) : /* @__PURE__ */ a(W, { className: "size-4" })
|
|
283
293
|
}
|
|
284
294
|
);
|
|
285
295
|
}
|
|
286
|
-
function
|
|
287
|
-
return /* @__PURE__ */
|
|
296
|
+
function Z({ part: e, onRegenerate: t, className: n }) {
|
|
297
|
+
return /* @__PURE__ */ g(
|
|
288
298
|
"div",
|
|
289
299
|
{
|
|
290
300
|
"data-slot": "image-actions",
|
|
291
|
-
className:
|
|
301
|
+
className: d("flex items-center gap-1 p-1", n),
|
|
292
302
|
children: [
|
|
293
303
|
/* @__PURE__ */ a(
|
|
294
304
|
"button",
|
|
295
305
|
{
|
|
296
306
|
type: "button",
|
|
297
|
-
onClick: () =>
|
|
307
|
+
onClick: () => K(e),
|
|
298
308
|
"data-slot": "image-download",
|
|
299
309
|
"aria-label": "Download image",
|
|
300
310
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
301
|
-
children: /* @__PURE__ */ a(
|
|
311
|
+
children: /* @__PURE__ */ a(A, { className: "size-4" })
|
|
302
312
|
}
|
|
303
313
|
),
|
|
304
314
|
/* @__PURE__ */ a(
|
|
@@ -306,46 +316,46 @@ function $({ part: e, onRegenerate: t, className: n }) {
|
|
|
306
316
|
{
|
|
307
317
|
type: "button",
|
|
308
318
|
onClick: () => {
|
|
309
|
-
|
|
319
|
+
M(e).catch(() => {
|
|
310
320
|
});
|
|
311
321
|
},
|
|
312
322
|
"data-slot": "image-copy",
|
|
313
323
|
"aria-label": "Copy image",
|
|
314
324
|
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
315
|
-
children: /* @__PURE__ */ a(
|
|
325
|
+
children: /* @__PURE__ */ a(L, { className: "size-4" })
|
|
316
326
|
}
|
|
317
327
|
),
|
|
318
|
-
t && /* @__PURE__ */ a(
|
|
328
|
+
t && /* @__PURE__ */ a(V, { onRegenerate: t })
|
|
319
329
|
]
|
|
320
330
|
}
|
|
321
331
|
);
|
|
322
332
|
}
|
|
323
|
-
const
|
|
333
|
+
const $ = (e) => {
|
|
324
334
|
const { image: t, filename: n, status: i } = e;
|
|
325
|
-
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */ a(
|
|
335
|
+
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */ g(h, { children: [
|
|
336
|
+
/* @__PURE__ */ a(k, {}),
|
|
327
337
|
/* @__PURE__ */ a(v, { children: n })
|
|
328
|
-
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(
|
|
329
|
-
/* @__PURE__ */ a(
|
|
338
|
+
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(R, { reason: "The provider blocked this image." }) }) : /* @__PURE__ */ g(h, { children: [
|
|
339
|
+
/* @__PURE__ */ a(j, { src: t, alt: n || "Image content", children: /* @__PURE__ */ a(C, { src: t, alt: n || "Image content" }) }),
|
|
330
340
|
/* @__PURE__ */ a(v, { children: n })
|
|
331
341
|
] });
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
342
|
+
}, c = D($);
|
|
343
|
+
c.displayName = "Image";
|
|
344
|
+
c.Root = h;
|
|
345
|
+
c.Preview = C;
|
|
346
|
+
c.Filename = v;
|
|
347
|
+
c.Zoom = j;
|
|
348
|
+
c.Actions = Z;
|
|
349
|
+
c.Generating = k;
|
|
350
|
+
c.ContentFilterError = R;
|
|
341
351
|
export {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
352
|
+
c as Image,
|
|
353
|
+
Z as ImageActions,
|
|
354
|
+
R as ImageContentFilterError,
|
|
345
355
|
v as ImageFilename,
|
|
346
|
-
|
|
347
|
-
|
|
356
|
+
k as ImageGenerating,
|
|
357
|
+
C as ImagePreview,
|
|
348
358
|
h as ImageRoot,
|
|
349
|
-
|
|
350
|
-
|
|
359
|
+
j as ImageZoom,
|
|
360
|
+
T as imageVariants
|
|
351
361
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as o, jsxs as
|
|
2
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import "@assistant-ui/react-markdown/styles/dot.css";
|
|
4
|
-
import { unstable_memoizeMarkdownComponents as i, useIsMarkdownCodeBlock as
|
|
4
|
+
import { unstable_memoizeMarkdownComponents as i, useIsMarkdownCodeBlock as n, MarkdownTextPrimitive as l } from "@assistant-ui/react-markdown";
|
|
5
5
|
import u from "remark-gfm";
|
|
6
|
-
import { memo as c, useState as
|
|
7
|
-
import { Copy as
|
|
6
|
+
import { memo as c, useState as p } from "react";
|
|
7
|
+
import { Copy as b, Check as f } from "../../lib/icons.js";
|
|
8
8
|
import { TooltipIconButton as x } from "./tooltip-icon-button.js";
|
|
9
9
|
import { cn as r } from "../../lib/cn.js";
|
|
10
10
|
const h = () => /* @__PURE__ */ o(
|
|
11
|
-
|
|
11
|
+
l,
|
|
12
12
|
{
|
|
13
13
|
remarkPlugins: [u],
|
|
14
14
|
className: "aui-md",
|
|
@@ -17,21 +17,21 @@ const h = () => /* @__PURE__ */ o(
|
|
|
17
17
|
}
|
|
18
18
|
), q = c(h), g = ({ language: t, code: e }) => {
|
|
19
19
|
const { isCopied: a, copyToClipboard: m } = N();
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ s("div", { className: "aui-code-header-root border-border/50 bg-muted/50 mt-3 flex items-center justify-between rounded-t-xl border border-b-0 px-3.5 py-1.5 text-xs", children: [
|
|
21
21
|
/* @__PURE__ */ o("span", { className: "aui-code-header-language text-muted-foreground font-medium lowercase", children: t }),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ s(x, { tooltip: "Copy", onClick: () => {
|
|
23
23
|
!e || a || m(e);
|
|
24
24
|
}, children: [
|
|
25
|
-
!a && /* @__PURE__ */ o(
|
|
26
|
-
a && /* @__PURE__ */ o(f, { className: "animate-in zoom-in-95 fade-in duration-
|
|
25
|
+
!a && /* @__PURE__ */ o(b, { className: "animate-in zoom-in-95 fade-in duration-150 ease-out motion-reduce:animate-none" }),
|
|
26
|
+
a && /* @__PURE__ */ o(f, { className: "animate-in zoom-in-95 fade-in duration-200 ease-out motion-reduce:animate-none" })
|
|
27
27
|
] })
|
|
28
28
|
] });
|
|
29
29
|
}, N = ({
|
|
30
30
|
copiedDuration: t = 3e3
|
|
31
31
|
} = {}) => {
|
|
32
|
-
const [e, a] =
|
|
33
|
-
return { isCopied: e, copyToClipboard: (
|
|
34
|
-
!
|
|
32
|
+
const [e, a] = p(!1);
|
|
33
|
+
return { isCopied: e, copyToClipboard: (d) => {
|
|
34
|
+
!d || typeof navigator > "u" || !navigator.clipboard || navigator.clipboard.writeText(d).then(
|
|
35
35
|
() => {
|
|
36
36
|
a(!0), setTimeout(() => a(!1), t);
|
|
37
37
|
},
|
|
@@ -44,7 +44,7 @@ const h = () => /* @__PURE__ */ o(
|
|
|
44
44
|
"h1",
|
|
45
45
|
{
|
|
46
46
|
className: r(
|
|
47
|
-
"aui-md-h1 mt-5 mb-2 scroll-m-20 text-lg font-
|
|
47
|
+
"aui-md-h1 mt-5 mb-2 scroll-m-20 text-lg font-medium first:mt-0 last:mb-0",
|
|
48
48
|
t
|
|
49
49
|
),
|
|
50
50
|
...e
|
|
@@ -54,7 +54,7 @@ const h = () => /* @__PURE__ */ o(
|
|
|
54
54
|
"h2",
|
|
55
55
|
{
|
|
56
56
|
className: r(
|
|
57
|
-
"aui-md-h2 mt-5 mb-2 scroll-m-20 text-lg font-
|
|
57
|
+
"aui-md-h2 mt-5 mb-2 scroll-m-20 text-lg font-medium first:mt-0 last:mb-0",
|
|
58
58
|
t
|
|
59
59
|
),
|
|
60
60
|
...e
|
|
@@ -64,7 +64,7 @@ const h = () => /* @__PURE__ */ o(
|
|
|
64
64
|
"h3",
|
|
65
65
|
{
|
|
66
66
|
className: r(
|
|
67
|
-
"aui-md-h3 mt-4 mb-1.5 scroll-m-20 text-base font-
|
|
67
|
+
"aui-md-h3 mt-4 mb-1.5 scroll-m-20 text-base font-medium first:mt-0 last:mb-0",
|
|
68
68
|
t
|
|
69
69
|
),
|
|
70
70
|
...e
|
|
@@ -84,7 +84,7 @@ const h = () => /* @__PURE__ */ o(
|
|
|
84
84
|
"h5",
|
|
85
85
|
{
|
|
86
86
|
className: r(
|
|
87
|
-
"aui-md-h5 mt-3 mb-1 text-xs font-
|
|
87
|
+
"aui-md-h5 mt-3 mb-1 text-xs font-medium first:mt-0 last:mb-0",
|
|
88
88
|
t
|
|
89
89
|
),
|
|
90
90
|
...e
|
|
@@ -201,7 +201,7 @@ const h = () => /* @__PURE__ */ o(
|
|
|
201
201
|
strong: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
202
202
|
"strong",
|
|
203
203
|
{
|
|
204
|
-
className: r("aui-md-strong font-
|
|
204
|
+
className: r("aui-md-strong font-medium", t),
|
|
205
205
|
...e
|
|
206
206
|
}
|
|
207
207
|
),
|
|
@@ -223,7 +223,7 @@ const h = () => /* @__PURE__ */ o(
|
|
|
223
223
|
}
|
|
224
224
|
),
|
|
225
225
|
code: function({ className: e, ...a }) {
|
|
226
|
-
const m =
|
|
226
|
+
const m = n();
|
|
227
227
|
return /* @__PURE__ */ o(
|
|
228
228
|
"code",
|
|
229
229
|
{
|