@actioneer/ads 0.1.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/LICENSE +21 -0
- package/bin/ads-init.mjs +314 -0
- package/components/accordion.d.ts +13 -0
- package/components/accordion.js +91 -0
- package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
- package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
- package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
- package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
- package/components/agents-ui/react-shader-toy.d.ts +87 -0
- package/components/agents-ui/react-shader-toy.js +531 -0
- package/components/ai-elements/chain-of-thought.d.ts +30 -0
- package/components/ai-elements/chain-of-thought.js +182 -0
- package/components/ai-elements/index.d.ts +11 -0
- package/components/ai-elements/inline-citation.d.ts +44 -0
- package/components/ai-elements/inline-citation.js +314 -0
- package/components/ai-elements/message.d.ts +96 -0
- package/components/ai-elements/message.js +308 -0
- package/components/ai-elements/queue.d.ts +60 -0
- package/components/ai-elements/queue.js +193 -0
- package/components/ai-elements/reasoning.d.ts +26 -0
- package/components/ai-elements/reasoning.js +131 -0
- package/components/ai-elements/shimmer.d.ts +25 -0
- package/components/ai-elements/shimmer.js +44 -0
- package/components/ai-elements/speech-input.d.ts +16 -0
- package/components/ai-elements/speech-input.js +151 -0
- package/components/ai-elements/task-progress.d.ts +41 -0
- package/components/ai-elements/task-progress.js +211 -0
- package/components/ai-elements/task.d.ts +35 -0
- package/components/ai-elements/task.js +73 -0
- package/components/ai-elements/tool.d.ts +53 -0
- package/components/ai-elements/tool.js +116 -0
- package/components/ai-elements/voice.d.ts +74 -0
- package/components/ai-elements/voice.js +875 -0
- package/components/alert.d.ts +21 -0
- package/components/alert.js +76 -0
- package/components/answer.d.ts +984 -0
- package/components/answer.js +543 -0
- package/components/assistant-ui/action-bar.d.ts +3 -0
- package/components/assistant-ui/action-bar.js +57 -0
- package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
- package/components/assistant-ui/answer-tool-ui.js +42 -0
- package/components/assistant-ui/attachment.d.ts +50 -0
- package/components/assistant-ui/attachment.js +353 -0
- package/components/assistant-ui/badge.d.ts +11 -0
- package/components/assistant-ui/badge.js +54 -0
- package/components/assistant-ui/branch-picker.d.ts +3 -0
- package/components/assistant-ui/branch-picker.js +36 -0
- package/components/assistant-ui/chain-of-thought.d.ts +46 -0
- package/components/assistant-ui/composer-add-context.d.ts +50 -0
- package/components/assistant-ui/composer-add-context.js +209 -0
- package/components/assistant-ui/composer-deep-research.d.ts +16 -0
- package/components/assistant-ui/composer-deep-research.js +38 -0
- package/components/assistant-ui/composer-harness.d.ts +18 -0
- package/components/assistant-ui/composer-harness.js +186 -0
- package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
- package/components/assistant-ui/composer-trigger-popover.js +147 -0
- package/components/assistant-ui/composer.d.ts +8 -0
- package/components/assistant-ui/composer.js +276 -0
- package/components/assistant-ui/directive-text.d.ts +16 -0
- package/components/assistant-ui/directive-text.js +40 -0
- package/components/assistant-ui/error.d.ts +6 -0
- package/components/assistant-ui/error.js +39 -0
- package/components/assistant-ui/file.d.ts +37 -0
- package/components/assistant-ui/file.js +159 -0
- package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
- package/components/assistant-ui/follow-up-suggestions.js +44 -0
- package/components/assistant-ui/image.d.ts +46 -0
- package/components/assistant-ui/image.js +351 -0
- package/components/assistant-ui/index.d.ts +28 -0
- package/components/assistant-ui/markdown-text.d.ts +1 -0
- package/components/assistant-ui/markdown-text.js +242 -0
- package/components/assistant-ui/message-timing.d.ts +25 -0
- package/components/assistant-ui/message-timing.js +56 -0
- package/components/assistant-ui/message.d.ts +4 -0
- package/components/assistant-ui/message.js +159 -0
- package/components/assistant-ui/primitives.d.ts +2 -0
- package/components/assistant-ui/quote.d.ts +37 -0
- package/components/assistant-ui/quote.js +150 -0
- package/components/assistant-ui/reasoning.d.ts +44 -0
- package/components/assistant-ui/reasoning.js +261 -0
- package/components/assistant-ui/selection-toolbar.d.ts +29 -0
- package/components/assistant-ui/selection-toolbar.js +91 -0
- package/components/assistant-ui/smart-message-text.d.ts +15 -0
- package/components/assistant-ui/smart-message-text.js +29 -0
- package/components/assistant-ui/sources.d.ts +17 -0
- package/components/assistant-ui/sources.js +121 -0
- package/components/assistant-ui/suggestions.d.ts +7 -0
- package/components/assistant-ui/suggestions.js +19 -0
- package/components/assistant-ui/thread-context.d.ts +37 -0
- package/components/assistant-ui/thread-context.js +8 -0
- package/components/assistant-ui/thread.d.ts +5 -0
- package/components/assistant-ui/thread.js +77 -0
- package/components/assistant-ui/tool-fallback.d.ts +36 -0
- package/components/assistant-ui/tool-fallback.js +428 -0
- package/components/assistant-ui/tool-group.d.ts +33 -0
- package/components/assistant-ui/tool-group.js +173 -0
- package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
- package/components/assistant-ui/tooltip-icon-button.js +31 -0
- package/components/assistant-ui/voice.d.ts +18 -0
- package/components/autocomplete.d.ts +18 -0
- package/components/autocomplete.js +162 -0
- package/components/avatar.d.ts +26 -0
- package/components/avatar.js +92 -0
- package/components/badge.d.ts +10 -0
- package/components/badge.js +83 -0
- package/components/brand-loader.d.ts +16 -0
- package/components/brand-loader.js +64 -0
- package/components/breadcrumbs.d.ts +8 -0
- package/components/breadcrumbs.js +58 -0
- package/components/button.d.ts +13 -0
- package/components/button.js +100 -0
- package/components/card.d.ts +19 -0
- package/components/card.js +82 -0
- package/components/carousel.d.ts +31 -0
- package/components/carousel.js +351 -0
- package/components/chart.d.ts +165 -0
- package/components/chart.js +841 -0
- package/components/checkbox.d.ts +13 -0
- package/components/checkbox.js +84 -0
- package/components/chip.d.ts +13 -0
- package/components/chip.js +112 -0
- package/components/collapsible.d.ts +5 -0
- package/components/collapsible.js +31 -0
- package/components/connector-card.d.ts +62 -0
- package/components/connector-card.js +154 -0
- package/components/divider.d.ts +23 -0
- package/components/divider.js +69 -0
- package/components/drawer.d.ts +45 -0
- package/components/drawer.js +234 -0
- package/components/dropdown.d.ts +33 -0
- package/components/dropdown.js +198 -0
- package/components/empty-state.d.ts +8 -0
- package/components/empty-state.js +30 -0
- package/components/field.d.ts +20 -0
- package/components/field.js +74 -0
- package/components/index.d.ts +56 -0
- package/components/index.js +444 -0
- package/components/input-field.d.ts +22 -0
- package/components/input-field.js +91 -0
- package/components/input.d.ts +8 -0
- package/components/input.js +61 -0
- package/components/kbd.d.ts +6 -0
- package/components/kbd.js +26 -0
- package/components/link.d.ts +14 -0
- package/components/link.js +72 -0
- package/components/modal.d.ts +18 -0
- package/components/modal.js +156 -0
- package/components/navbar.d.ts +15 -0
- package/components/navbar.js +68 -0
- package/components/number-field.d.ts +11 -0
- package/components/number-field.js +89 -0
- package/components/pagination.d.ts +28 -0
- package/components/pagination.js +179 -0
- package/components/panel.d.ts +14 -0
- package/components/panel.js +71 -0
- package/components/pixel-blast-svg.d.ts +22 -0
- package/components/pixel-blast-svg.js +154 -0
- package/components/popover.d.ts +20 -0
- package/components/popover.js +101 -0
- package/components/progress-circle.d.ts +11 -0
- package/components/progress-circle.js +75 -0
- package/components/progress.d.ts +22 -0
- package/components/progress.js +66 -0
- package/components/radio.d.ts +16 -0
- package/components/radio.js +101 -0
- package/components/segmented.d.ts +16 -0
- package/components/segmented.js +103 -0
- package/components/select.d.ts +28 -0
- package/components/select.js +180 -0
- package/components/selection-action-bar.d.ts +11 -0
- package/components/selection-action-bar.js +59 -0
- package/components/sidebar.d.ts +118 -0
- package/components/sidebar.js +375 -0
- package/components/skeleton.d.ts +6 -0
- package/components/skeleton.js +26 -0
- package/components/slider.d.ts +11 -0
- package/components/slider.js +62 -0
- package/components/spinner.d.ts +11 -0
- package/components/spinner.js +62 -0
- package/components/switch.d.ts +7 -0
- package/components/switch.js +61 -0
- package/components/table.d.ts +59 -0
- package/components/table.js +254 -0
- package/components/tabs.d.ts +29 -0
- package/components/tabs.js +371 -0
- package/components/textarea.d.ts +5 -0
- package/components/textarea.js +24 -0
- package/components/timeline.d.ts +7 -0
- package/components/timeline.js +47 -0
- package/components/toast.d.ts +74 -0
- package/components/toast.js +211 -0
- package/components/tooltip.d.ts +11 -0
- package/components/tooltip.js +143 -0
- package/components/tree.d.ts +42 -0
- package/components/tree.js +86 -0
- package/components/typography.d.ts +33 -0
- package/components/typography.js +65 -0
- package/components/ui/avatar.d.ts +11 -0
- package/components/ui/avatar.js +56 -0
- package/components/ui/button.d.ts +10 -0
- package/components/ui/button.js +57 -0
- package/components/ui/collapsible.d.ts +5 -0
- package/components/ui/collapsible.js +35 -0
- package/components/ui/dialog.d.ts +17 -0
- package/components/ui/dialog.js +93 -0
- package/components/ui/tabs.d.ts +22 -0
- package/components/ui/tooltip.d.ts +7 -0
- package/components/ui/tooltip.js +56 -0
- package/fonts/aribau-grotesk-400.otf +0 -0
- package/fonts/aribau-grotesk-700.otf +0 -0
- package/fonts.css +21 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
- package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
- package/lib/cn.d.ts +3 -0
- package/lib/cn.js +9 -0
- package/lib/icons.d.ts +378 -0
- package/lib/icons.js +119 -0
- package/lib/interactive.d.ts +24 -0
- package/lib/interactive.js +36 -0
- package/lib/motion.d.ts +58 -0
- package/lib/motion.js +70 -0
- package/lib/router.d.ts +3 -0
- package/lib/utils.d.ts +6 -0
- package/llms.txt +537 -0
- package/manifest.json +5085 -0
- package/package.json +60 -0
- package/styles.css +653 -0
- package/theme.css +273 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as u, jsx as a, Fragment as U } from "react/jsx-runtime";
|
|
3
|
+
import { memo as E, useRef as D, useState as p, useEffect as b } from "react";
|
|
4
|
+
import { createPortal as F } from "react-dom";
|
|
5
|
+
import { cva as O } from "class-variance-authority";
|
|
6
|
+
import { Image as P, ImageOff as A, Download as L, Copy as S, Loader as B, WarningCircle as W, Refresh as G } from "../../lib/icons.js";
|
|
7
|
+
import { cn as c } from "../../lib/cn.js";
|
|
8
|
+
const K = (e) => {
|
|
9
|
+
switch (e) {
|
|
10
|
+
case "image/png":
|
|
11
|
+
return "png";
|
|
12
|
+
case "image/jpeg":
|
|
13
|
+
case "image/jpg":
|
|
14
|
+
return "jpg";
|
|
15
|
+
case "image/webp":
|
|
16
|
+
return "webp";
|
|
17
|
+
case "image/gif":
|
|
18
|
+
return "gif";
|
|
19
|
+
case "image/svg+xml":
|
|
20
|
+
return "svg";
|
|
21
|
+
default:
|
|
22
|
+
return "png";
|
|
23
|
+
}
|
|
24
|
+
}, I = (e) => {
|
|
25
|
+
var r;
|
|
26
|
+
const [t, n] = e.split(","), i = ((r = t == null ? void 0 : t.match(/data:([^;]+)/)) == null ? void 0 : r[1]) ?? "application/octet-stream";
|
|
27
|
+
if (!/;base64/i.test(t ?? ""))
|
|
28
|
+
return new Blob([decodeURIComponent(n ?? "")], { type: i });
|
|
29
|
+
const s = atob(n ?? ""), o = new Uint8Array(s.length);
|
|
30
|
+
for (let m = 0; m < s.length; m++) o[m] = s.charCodeAt(m);
|
|
31
|
+
return new Blob([o], { type: i });
|
|
32
|
+
}, N = (e) => {
|
|
33
|
+
var t;
|
|
34
|
+
return (t = e.match(/^data:([^;,]+)/)) == null ? void 0 : t[1];
|
|
35
|
+
}, M = (e) => {
|
|
36
|
+
if (typeof document > "u") return;
|
|
37
|
+
const t = K(N(e.image)), n = e.filename ?? `image.${t}`, s = e.image.startsWith("data:") ? URL.createObjectURL(I(e.image)) : null, o = s ?? e.image, r = document.createElement("a");
|
|
38
|
+
r.href = o, r.download = n, r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r), s && URL.revokeObjectURL(s);
|
|
39
|
+
}, T = async (e) => {
|
|
40
|
+
if (typeof navigator > "u" || !navigator.clipboard || typeof ClipboardItem > "u")
|
|
41
|
+
throw new Error("Clipboard API is not available in this environment.");
|
|
42
|
+
const t = e.image.startsWith("data:") ? I(e.image) : await fetch(e.image).then((i) => i.blob()), n = N(e.image) ?? t.type ?? "image/png";
|
|
43
|
+
await navigator.clipboard.write([new ClipboardItem({ [n]: t })]);
|
|
44
|
+
}, V = O(
|
|
45
|
+
"aui-image-root relative overflow-hidden rounded-lg",
|
|
46
|
+
{
|
|
47
|
+
variants: {
|
|
48
|
+
variant: {
|
|
49
|
+
outline: "border-border border",
|
|
50
|
+
ghost: "",
|
|
51
|
+
muted: "bg-muted/50"
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
sm: "max-w-64",
|
|
55
|
+
default: "max-w-96",
|
|
56
|
+
lg: "max-w-[512px]",
|
|
57
|
+
full: "w-full"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
defaultVariants: {
|
|
61
|
+
variant: "outline",
|
|
62
|
+
size: "default"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
function h({
|
|
67
|
+
className: e,
|
|
68
|
+
variant: t,
|
|
69
|
+
size: n,
|
|
70
|
+
children: i,
|
|
71
|
+
...s
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ a(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "image-root",
|
|
77
|
+
"data-variant": t,
|
|
78
|
+
"data-size": n,
|
|
79
|
+
className: c(V({ variant: t, size: n, className: e })),
|
|
80
|
+
...s,
|
|
81
|
+
children: i
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function z({
|
|
86
|
+
className: e,
|
|
87
|
+
containerClassName: t,
|
|
88
|
+
onLoad: n,
|
|
89
|
+
onError: i,
|
|
90
|
+
alt: s = "Image content",
|
|
91
|
+
src: o,
|
|
92
|
+
...r
|
|
93
|
+
}) {
|
|
94
|
+
const m = D(null), [f, l] = p(void 0), [y, R] = p(void 0), w = f === o, x = y === o;
|
|
95
|
+
return b(() => {
|
|
96
|
+
var g;
|
|
97
|
+
typeof o == "string" && ((g = m.current) != null && g.complete) && m.current.naturalWidth > 0 && l(o);
|
|
98
|
+
}, [o]), /* @__PURE__ */ u(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "image-preview",
|
|
102
|
+
className: c("relative min-h-32", t),
|
|
103
|
+
children: [
|
|
104
|
+
!w && !x && /* @__PURE__ */ a(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
"data-slot": "image-preview-loading",
|
|
108
|
+
className: "bg-muted/50 absolute inset-0 flex items-center justify-center",
|
|
109
|
+
children: /* @__PURE__ */ a(P, { className: "text-muted-foreground size-8 animate-pulse" })
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
x ? /* @__PURE__ */ a(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
"data-slot": "image-preview-error",
|
|
116
|
+
className: "bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
117
|
+
children: /* @__PURE__ */ a(A, { className: "text-muted-foreground size-8" })
|
|
118
|
+
}
|
|
119
|
+
) : /* @__PURE__ */ a(
|
|
120
|
+
"img",
|
|
121
|
+
{
|
|
122
|
+
ref: m,
|
|
123
|
+
src: o,
|
|
124
|
+
alt: s,
|
|
125
|
+
className: c(
|
|
126
|
+
"block h-auto w-full object-contain",
|
|
127
|
+
!w && "invisible",
|
|
128
|
+
e
|
|
129
|
+
),
|
|
130
|
+
onLoad: (g) => {
|
|
131
|
+
typeof o == "string" && l(o), n == null || n(g);
|
|
132
|
+
},
|
|
133
|
+
onError: (g) => {
|
|
134
|
+
typeof o == "string" && R(o), i == null || i(g);
|
|
135
|
+
},
|
|
136
|
+
...r
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function v({
|
|
144
|
+
className: e,
|
|
145
|
+
children: t,
|
|
146
|
+
...n
|
|
147
|
+
}) {
|
|
148
|
+
return t ? /* @__PURE__ */ a(
|
|
149
|
+
"span",
|
|
150
|
+
{
|
|
151
|
+
"data-slot": "image-filename",
|
|
152
|
+
className: c(
|
|
153
|
+
"text-muted-foreground block truncate px-2 py-1.5 text-xs",
|
|
154
|
+
e
|
|
155
|
+
),
|
|
156
|
+
...n,
|
|
157
|
+
children: t
|
|
158
|
+
}
|
|
159
|
+
) : null;
|
|
160
|
+
}
|
|
161
|
+
function C({ src: e, alt: t = "Image preview", children: n }) {
|
|
162
|
+
const [i, s] = p(!1), [o, r] = p(!1);
|
|
163
|
+
b(() => {
|
|
164
|
+
s(!0);
|
|
165
|
+
}, []);
|
|
166
|
+
const m = () => r(!0), f = () => r(!1);
|
|
167
|
+
return b(() => {
|
|
168
|
+
if (!o) return;
|
|
169
|
+
const l = (y) => {
|
|
170
|
+
y.key === "Escape" && r(!1);
|
|
171
|
+
};
|
|
172
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
173
|
+
}, [o]), b(() => {
|
|
174
|
+
if (!o) return;
|
|
175
|
+
const l = document.body.style.overflow;
|
|
176
|
+
return document.body.style.overflow = "hidden", () => {
|
|
177
|
+
document.body.style.overflow = l;
|
|
178
|
+
};
|
|
179
|
+
}, [o]), /* @__PURE__ */ u(U, { children: [
|
|
180
|
+
/* @__PURE__ */ a(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
onClick: m,
|
|
184
|
+
onKeyDown: (l) => l.key === "Enter" && m(),
|
|
185
|
+
role: "button",
|
|
186
|
+
tabIndex: 0,
|
|
187
|
+
className: "aui-image-zoom-trigger cursor-zoom-in",
|
|
188
|
+
"aria-label": "Click to zoom image",
|
|
189
|
+
children: n
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
i && o && F(
|
|
193
|
+
/* @__PURE__ */ a(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
"data-slot": "image-zoom-overlay",
|
|
197
|
+
role: "button",
|
|
198
|
+
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-(--duration-normal)",
|
|
200
|
+
onClick: f,
|
|
201
|
+
onKeyDown: (l) => l.key === "Enter" && f(),
|
|
202
|
+
"aria-label": "Close zoomed image",
|
|
203
|
+
children: /* @__PURE__ */ a(
|
|
204
|
+
"img",
|
|
205
|
+
{
|
|
206
|
+
"data-slot": "image-zoom-content",
|
|
207
|
+
src: e,
|
|
208
|
+
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-(--duration-normal)",
|
|
210
|
+
onClick: (l) => {
|
|
211
|
+
l.stopPropagation(), f();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
document.body
|
|
218
|
+
)
|
|
219
|
+
] });
|
|
220
|
+
}
|
|
221
|
+
function j({ className: e }) {
|
|
222
|
+
return /* @__PURE__ */ u(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
"data-slot": "image-generating",
|
|
226
|
+
className: c(
|
|
227
|
+
"bg-muted/50 flex min-h-32 items-center justify-center p-4",
|
|
228
|
+
e
|
|
229
|
+
),
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ a(B, { className: "text-muted-foreground size-8 animate-spin" }),
|
|
232
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Generating image…" })
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
function k({
|
|
238
|
+
className: e,
|
|
239
|
+
reason: t
|
|
240
|
+
}) {
|
|
241
|
+
return /* @__PURE__ */ u(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
"data-slot": "image-content-filter-error",
|
|
245
|
+
className: c(
|
|
246
|
+
"bg-muted/50 flex min-h-32 flex-col items-center justify-center gap-2 p-4 text-center",
|
|
247
|
+
e
|
|
248
|
+
),
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ a(W, { className: "text-muted-foreground size-8" }),
|
|
251
|
+
/* @__PURE__ */ a("p", { className: "text-sm font-medium", children: "Image could not be generated" }),
|
|
252
|
+
t && /* @__PURE__ */ a("p", { className: "text-muted-foreground text-xs", children: t })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
function Z({
|
|
258
|
+
onRegenerate: e
|
|
259
|
+
}) {
|
|
260
|
+
const [t, n] = p(!1);
|
|
261
|
+
return /* @__PURE__ */ a(
|
|
262
|
+
"button",
|
|
263
|
+
{
|
|
264
|
+
type: "button",
|
|
265
|
+
onClick: async () => {
|
|
266
|
+
n(!0);
|
|
267
|
+
try {
|
|
268
|
+
await e();
|
|
269
|
+
} finally {
|
|
270
|
+
n(!1);
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
disabled: t,
|
|
274
|
+
"data-slot": "image-regenerate",
|
|
275
|
+
"aria-label": "Regenerate image",
|
|
276
|
+
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
|
+
)
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
function $({ part: e, onRegenerate: t, className: n }) {
|
|
287
|
+
return /* @__PURE__ */ u(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
"data-slot": "image-actions",
|
|
291
|
+
className: c("flex items-center gap-1 p-1", n),
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ a(
|
|
294
|
+
"button",
|
|
295
|
+
{
|
|
296
|
+
type: "button",
|
|
297
|
+
onClick: () => M(e),
|
|
298
|
+
"data-slot": "image-download",
|
|
299
|
+
"aria-label": "Download image",
|
|
300
|
+
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
301
|
+
children: /* @__PURE__ */ a(L, { className: "size-4" })
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ a(
|
|
305
|
+
"button",
|
|
306
|
+
{
|
|
307
|
+
type: "button",
|
|
308
|
+
onClick: () => {
|
|
309
|
+
T(e).catch(() => {
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
"data-slot": "image-copy",
|
|
313
|
+
"aria-label": "Copy image",
|
|
314
|
+
className: "hover:bg-muted inline-flex size-7 items-center justify-center rounded",
|
|
315
|
+
children: /* @__PURE__ */ a(S, { className: "size-4" })
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
t && /* @__PURE__ */ a(Z, { onRegenerate: t })
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
const q = (e) => {
|
|
324
|
+
const { image: t, filename: n, status: i } = e;
|
|
325
|
+
return (i == null ? void 0 : i.type) === "running" ? /* @__PURE__ */ u(h, { children: [
|
|
326
|
+
/* @__PURE__ */ a(j, {}),
|
|
327
|
+
/* @__PURE__ */ a(v, { children: n })
|
|
328
|
+
] }) : (i == null ? void 0 : i.type) === "incomplete" && i.reason === "content-filter" ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(k, { reason: "The provider blocked this image." }) }) : /* @__PURE__ */ u(h, { children: [
|
|
329
|
+
/* @__PURE__ */ a(C, { src: t, alt: n || "Image content", children: /* @__PURE__ */ a(z, { src: t, alt: n || "Image content" }) }),
|
|
330
|
+
/* @__PURE__ */ a(v, { children: n })
|
|
331
|
+
] });
|
|
332
|
+
}, d = E(q);
|
|
333
|
+
d.displayName = "Image";
|
|
334
|
+
d.Root = h;
|
|
335
|
+
d.Preview = z;
|
|
336
|
+
d.Filename = v;
|
|
337
|
+
d.Zoom = C;
|
|
338
|
+
d.Actions = $;
|
|
339
|
+
d.Generating = j;
|
|
340
|
+
d.ContentFilterError = k;
|
|
341
|
+
export {
|
|
342
|
+
d as Image,
|
|
343
|
+
$ as ImageActions,
|
|
344
|
+
k as ImageContentFilterError,
|
|
345
|
+
v as ImageFilename,
|
|
346
|
+
j as ImageGenerating,
|
|
347
|
+
z as ImagePreview,
|
|
348
|
+
h as ImageRoot,
|
|
349
|
+
C as ImageZoom,
|
|
350
|
+
V as imageVariants
|
|
351
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './primitives';
|
|
2
|
+
export * from './thread';
|
|
3
|
+
export * from './thread-context';
|
|
4
|
+
export * from './answer-tool-ui';
|
|
5
|
+
export * from './composer';
|
|
6
|
+
export * from './message';
|
|
7
|
+
export * from './action-bar';
|
|
8
|
+
export * from './branch-picker';
|
|
9
|
+
export * from './attachment';
|
|
10
|
+
export * from './composer-add-context';
|
|
11
|
+
export * from './composer-deep-research';
|
|
12
|
+
export * from './composer-harness';
|
|
13
|
+
export * from './composer-trigger-popover';
|
|
14
|
+
export * from './directive-text';
|
|
15
|
+
export * from './error';
|
|
16
|
+
export * from './file';
|
|
17
|
+
export * from './image';
|
|
18
|
+
export * from './markdown-text';
|
|
19
|
+
export * from './message-timing';
|
|
20
|
+
export * from './quote';
|
|
21
|
+
export * from './smart-message-text';
|
|
22
|
+
export * from './sources';
|
|
23
|
+
export * from './tool-fallback';
|
|
24
|
+
export * from './tool-group';
|
|
25
|
+
export * from './follow-up-suggestions';
|
|
26
|
+
export * from './selection-toolbar';
|
|
27
|
+
export * from './suggestions';
|
|
28
|
+
export * from './tooltip-icon-button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MarkdownText: import('react').MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import "@assistant-ui/react-markdown/styles/dot.css";
|
|
4
|
+
import { unstable_memoizeMarkdownComponents as i, useIsMarkdownCodeBlock as l, MarkdownTextPrimitive as n } from "@assistant-ui/react-markdown";
|
|
5
|
+
import u from "remark-gfm";
|
|
6
|
+
import { memo as c, useState as b } from "react";
|
|
7
|
+
import { Copy as p, Check as f } from "../../lib/icons.js";
|
|
8
|
+
import { TooltipIconButton as x } from "./tooltip-icon-button.js";
|
|
9
|
+
import { cn as r } from "../../lib/cn.js";
|
|
10
|
+
const h = () => /* @__PURE__ */ o(
|
|
11
|
+
n,
|
|
12
|
+
{
|
|
13
|
+
remarkPlugins: [u],
|
|
14
|
+
className: "aui-md",
|
|
15
|
+
components: y,
|
|
16
|
+
defer: !0
|
|
17
|
+
}
|
|
18
|
+
), q = c(h), g = ({ language: t, code: e }) => {
|
|
19
|
+
const { isCopied: a, copyToClipboard: m } = N();
|
|
20
|
+
return /* @__PURE__ */ d("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
|
+
/* @__PURE__ */ o("span", { className: "aui-code-header-language text-muted-foreground font-medium lowercase", children: t }),
|
|
22
|
+
/* @__PURE__ */ d(x, { tooltip: "Copy", onClick: () => {
|
|
23
|
+
!e || a || m(e);
|
|
24
|
+
}, children: [
|
|
25
|
+
!a && /* @__PURE__ */ o(p, { className: "animate-in zoom-in-95 fade-in duration-(--duration-fast) ease-out motion-reduce:animate-none" }),
|
|
26
|
+
a && /* @__PURE__ */ o(f, { className: "animate-in zoom-in-95 fade-in duration-(--duration-normal) ease-out motion-reduce:animate-none" })
|
|
27
|
+
] })
|
|
28
|
+
] });
|
|
29
|
+
}, N = ({
|
|
30
|
+
copiedDuration: t = 3e3
|
|
31
|
+
} = {}) => {
|
|
32
|
+
const [e, a] = b(!1);
|
|
33
|
+
return { isCopied: e, copyToClipboard: (s) => {
|
|
34
|
+
!s || typeof navigator > "u" || !navigator.clipboard || navigator.clipboard.writeText(s).then(
|
|
35
|
+
() => {
|
|
36
|
+
a(!0), setTimeout(() => a(!1), t);
|
|
37
|
+
},
|
|
38
|
+
() => {
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
} };
|
|
42
|
+
}, y = i({
|
|
43
|
+
h1: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
44
|
+
"h1",
|
|
45
|
+
{
|
|
46
|
+
className: r(
|
|
47
|
+
"aui-md-h1 mt-5 mb-2 scroll-m-20 text-lg font-semibold first:mt-0 last:mb-0",
|
|
48
|
+
t
|
|
49
|
+
),
|
|
50
|
+
...e
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
h2: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
54
|
+
"h2",
|
|
55
|
+
{
|
|
56
|
+
className: r(
|
|
57
|
+
"aui-md-h2 mt-5 mb-2 scroll-m-20 text-lg font-semibold first:mt-0 last:mb-0",
|
|
58
|
+
t
|
|
59
|
+
),
|
|
60
|
+
...e
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
h3: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
64
|
+
"h3",
|
|
65
|
+
{
|
|
66
|
+
className: r(
|
|
67
|
+
"aui-md-h3 mt-4 mb-1.5 scroll-m-20 text-base font-semibold first:mt-0 last:mb-0",
|
|
68
|
+
t
|
|
69
|
+
),
|
|
70
|
+
...e
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
h4: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
74
|
+
"h4",
|
|
75
|
+
{
|
|
76
|
+
className: r(
|
|
77
|
+
"aui-md-h4 mt-3.5 mb-1 scroll-m-20 text-base font-medium first:mt-0 last:mb-0",
|
|
78
|
+
t
|
|
79
|
+
),
|
|
80
|
+
...e
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
h5: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
84
|
+
"h5",
|
|
85
|
+
{
|
|
86
|
+
className: r(
|
|
87
|
+
"aui-md-h5 mt-3 mb-1 text-xs font-semibold first:mt-0 last:mb-0",
|
|
88
|
+
t
|
|
89
|
+
),
|
|
90
|
+
...e
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
h6: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
94
|
+
"h6",
|
|
95
|
+
{
|
|
96
|
+
className: r(
|
|
97
|
+
"aui-md-h6 mt-3 mb-1 text-xs font-medium first:mt-0 last:mb-0",
|
|
98
|
+
t
|
|
99
|
+
),
|
|
100
|
+
...e
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
p: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
104
|
+
"p",
|
|
105
|
+
{
|
|
106
|
+
className: r(
|
|
107
|
+
"aui-md-p my-3 leading-relaxed first:mt-0 last:mb-0",
|
|
108
|
+
t
|
|
109
|
+
),
|
|
110
|
+
...e
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
a: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
114
|
+
"a",
|
|
115
|
+
{
|
|
116
|
+
className: r(
|
|
117
|
+
"aui-md-a text-primary hover:text-primary/80 underline underline-offset-2",
|
|
118
|
+
t
|
|
119
|
+
),
|
|
120
|
+
...e
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
blockquote: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
124
|
+
"blockquote",
|
|
125
|
+
{
|
|
126
|
+
className: r(
|
|
127
|
+
"aui-md-blockquote border-muted-foreground/30 text-muted-foreground my-3 border-s-2 ps-4",
|
|
128
|
+
t
|
|
129
|
+
),
|
|
130
|
+
...e
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
ul: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
134
|
+
"ul",
|
|
135
|
+
{
|
|
136
|
+
className: r(
|
|
137
|
+
"aui-md-ul marker:text-muted-foreground my-3 ms-5 list-disc [&>li]:mt-1",
|
|
138
|
+
t
|
|
139
|
+
),
|
|
140
|
+
...e
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
ol: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
144
|
+
"ol",
|
|
145
|
+
{
|
|
146
|
+
className: r(
|
|
147
|
+
"aui-md-ol marker:text-muted-foreground my-3 ms-5 list-decimal [&>li]:mt-1",
|
|
148
|
+
t
|
|
149
|
+
),
|
|
150
|
+
...e
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
hr: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
154
|
+
"hr",
|
|
155
|
+
{
|
|
156
|
+
className: r("aui-md-hr border-muted-foreground/20 my-3", t),
|
|
157
|
+
...e
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
table: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
161
|
+
"table",
|
|
162
|
+
{
|
|
163
|
+
className: r(
|
|
164
|
+
"aui-md-table my-3 w-full border-separate border-spacing-0 overflow-y-auto",
|
|
165
|
+
t
|
|
166
|
+
),
|
|
167
|
+
...e
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
th: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
171
|
+
"th",
|
|
172
|
+
{
|
|
173
|
+
className: r(
|
|
174
|
+
"aui-md-th bg-muted px-3 py-1.5 text-start font-medium first:rounded-ss-lg last:rounded-se-lg [[align=center]]:text-center [[align=right]]:text-right",
|
|
175
|
+
t
|
|
176
|
+
),
|
|
177
|
+
...e
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
td: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
181
|
+
"td",
|
|
182
|
+
{
|
|
183
|
+
className: r(
|
|
184
|
+
"aui-md-td border-muted-foreground/20 border-s border-b px-3 py-1.5 text-start last:border-e [[align=center]]:text-center [[align=right]]:text-right",
|
|
185
|
+
t
|
|
186
|
+
),
|
|
187
|
+
...e
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
tr: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
191
|
+
"tr",
|
|
192
|
+
{
|
|
193
|
+
className: r(
|
|
194
|
+
"aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-es-lg [&:last-child>td:last-child]:rounded-ee-lg",
|
|
195
|
+
t
|
|
196
|
+
),
|
|
197
|
+
...e
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
li: ({ className: t, ...e }) => /* @__PURE__ */ o("li", { className: r("aui-md-li leading-relaxed", t), ...e }),
|
|
201
|
+
strong: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
202
|
+
"strong",
|
|
203
|
+
{
|
|
204
|
+
className: r("aui-md-strong font-semibold", t),
|
|
205
|
+
...e
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
sup: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
209
|
+
"sup",
|
|
210
|
+
{
|
|
211
|
+
className: r("aui-md-sup [&>a]:text-xs [&>a]:no-underline", t),
|
|
212
|
+
...e
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
pre: ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
216
|
+
"pre",
|
|
217
|
+
{
|
|
218
|
+
className: r(
|
|
219
|
+
"aui-md-pre border-border/50 bg-muted/30 overflow-x-auto rounded-t-none rounded-b-xl border border-t-0 p-3.5 text-[13px] leading-relaxed",
|
|
220
|
+
t
|
|
221
|
+
),
|
|
222
|
+
...e
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
code: function({ className: e, ...a }) {
|
|
226
|
+
const m = l();
|
|
227
|
+
return /* @__PURE__ */ o(
|
|
228
|
+
"code",
|
|
229
|
+
{
|
|
230
|
+
className: r(
|
|
231
|
+
!m && "aui-md-inline-code bg-muted rounded-md px-1.5 py-0.5 font-mono text-[0.85em]",
|
|
232
|
+
e
|
|
233
|
+
),
|
|
234
|
+
...a
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
CodeHeader: g
|
|
239
|
+
});
|
|
240
|
+
export {
|
|
241
|
+
q as MarkdownText
|
|
242
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Shows streaming stats (TTFT, total time, tok/s, chunks) as a badge with a
|
|
4
|
+
* hover/focus tooltip. Renders nothing until the stream completes.
|
|
5
|
+
*
|
|
6
|
+
* Place it inside `ActionBarPrimitive.Root` in your `thread.tsx` so it
|
|
7
|
+
* inherits the action bar's autohide behaviour:
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { MessageTiming } from "@/components/assistant-ui/message-timing";
|
|
11
|
+
*
|
|
12
|
+
* <ActionBarPrimitive.Root >
|
|
13
|
+
* <ActionBarPrimitive.Copy />
|
|
14
|
+
* <ActionBarPrimitive.Reload />
|
|
15
|
+
* <MessageTiming /> // <-- add this
|
|
16
|
+
* </ActionBarPrimitive.Root>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param side - Side of the tooltip relative to the badge trigger.
|
|
20
|
+
* @default "right"
|
|
21
|
+
*/
|
|
22
|
+
export declare const MessageTiming: FC<{
|
|
23
|
+
className?: string;
|
|
24
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
25
|
+
}>;
|