@actioneer/ads 0.5.7 → 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 +133 -120
- package/components/ai-elements/chain-of-thought.d.ts +1 -1
- 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.js +1 -1
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +103 -75
- 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 +11 -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.js +22 -22
- 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 +24 -24
- 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 +2 -0
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +1 -1
- 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 +3 -0
- package/components/index.js +584 -558
- 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.js +0 -1
- 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.js +26 -26
- package/components/select.d.ts +2 -0
- package/components/select.js +61 -57
- package/components/setting-row.js +45 -42
- 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 +41 -39
- package/components/table.d.ts +9 -0
- package/components/table.js +370 -247
- package/components/tabs.js +149 -137
- 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 +4 -0
- package/lib/icons.js +103 -102
- 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 +52 -18
- package/manifest.json +240 -31
- package/package.json +1 -1
- package/styles.css +143 -124
- package/theme.css +90 -93
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -22,10 +22,10 @@ function ue({
|
|
|
22
22
|
}
|
|
23
23
|
const w = "flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-xs text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted [&_svg]:size-4 [&_svg]:shrink-0 [&_img]:size-4 [&_img]:shrink-0 [&_img]:rounded-xs", _ = (o) => o.map((t) => t.label).slice(1).join(" · "), te = (o) => o.startsWith("mem.") || o.startsWith("skill.");
|
|
24
24
|
function fe() {
|
|
25
|
-
const o = E(S), t = E(T), a = V(), B = X((e) => e.attachments), [c,
|
|
25
|
+
const o = E(S), t = E(T), a = V(), B = X((e) => e.attachments), [c, g] = y(!1), [u, h] = y([]), b = A(null), k = A(null), [d, O] = y(null);
|
|
26
26
|
if (U(() => {
|
|
27
27
|
if (!c) return;
|
|
28
|
-
const e =
|
|
28
|
+
const e = b.current;
|
|
29
29
|
if (!e) return;
|
|
30
30
|
const r = () => {
|
|
31
31
|
const s = e.getBoundingClientRect();
|
|
@@ -41,9 +41,9 @@ function fe() {
|
|
|
41
41
|
const e = (s) => {
|
|
42
42
|
var f, x;
|
|
43
43
|
const i = s.target;
|
|
44
|
-
(f = k.current) != null && f.contains(i) || (x =
|
|
44
|
+
(f = k.current) != null && f.contains(i) || (x = b.current) != null && x.contains(i) || g(!1);
|
|
45
45
|
}, r = (s) => {
|
|
46
|
-
s.key === "Escape" && (s.preventDefault(), h((i) => i.length ? i.slice(0, -1) : (
|
|
46
|
+
s.key === "Escape" && (s.preventDefault(), h((i) => i.length ? i.slice(0, -1) : (g(!1), i)));
|
|
47
47
|
};
|
|
48
48
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", r), () => {
|
|
49
49
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", r);
|
|
@@ -61,13 +61,13 @@ function fe() {
|
|
|
61
61
|
/* @__PURE__ */ n(
|
|
62
62
|
G,
|
|
63
63
|
{
|
|
64
|
-
ref:
|
|
64
|
+
ref: b,
|
|
65
65
|
tooltip: "Add context",
|
|
66
66
|
side: "top",
|
|
67
67
|
"aria-label": "Add context",
|
|
68
68
|
"aria-expanded": c,
|
|
69
69
|
type: "button",
|
|
70
|
-
onClick: () =>
|
|
70
|
+
onClick: () => g((e) => !e),
|
|
71
71
|
className: "aui-composer-add-context hover:bg-muted-foreground/15 size-7 rounded-full p-1",
|
|
72
72
|
children: /* @__PURE__ */ n(J, { className: "size-4.5 stroke-[1.5px]" })
|
|
73
73
|
}
|
|
@@ -98,12 +98,12 @@ function fe() {
|
|
|
98
98
|
type: "button",
|
|
99
99
|
"aria-label": "Back",
|
|
100
100
|
onClick: () => h((e) => e.slice(0, -1)),
|
|
101
|
-
className: "flex size-6 shrink-0 items-center justify-center rounded-
|
|
101
|
+
className: "flex size-6 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring [&_svg]:size-4",
|
|
102
102
|
children: /* @__PURE__ */ n(Q, {})
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs font-
|
|
106
|
-
] }) : /* @__PURE__ */ n("div", { className: "px-2 py-1 text-xs font-
|
|
105
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground", children: u.map((e) => e.label).join(" · ") })
|
|
106
|
+
] }) : /* @__PURE__ */ n("div", { className: "px-2 py-1 text-xs font-medium text-muted-foreground", children: "Agent's context" }),
|
|
107
107
|
(l == null ? void 0 : l.addable) && (() => {
|
|
108
108
|
const e = _(u), r = v.has(e);
|
|
109
109
|
return /* @__PURE__ */ m(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as u, useContext as
|
|
4
|
-
import { Telescope as
|
|
3
|
+
import { createContext as u, useContext as c } from "react";
|
|
4
|
+
import { Telescope as a } from "../../lib/icons.js";
|
|
5
5
|
import { cn as n } from "../../lib/cn.js";
|
|
6
6
|
const t = u(null);
|
|
7
7
|
function p({
|
|
@@ -11,7 +11,7 @@ function p({
|
|
|
11
11
|
return /* @__PURE__ */ r(t.Provider, { value: o, children: e });
|
|
12
12
|
}
|
|
13
13
|
function x() {
|
|
14
|
-
const o =
|
|
14
|
+
const o = c(t);
|
|
15
15
|
if (!o) return null;
|
|
16
16
|
const { enabled: e, setEnabled: i } = o;
|
|
17
17
|
return (
|
|
@@ -30,14 +30,14 @@ function x() {
|
|
|
30
30
|
e ? "bg-info-50 text-info-700 hover:bg-info-100" : "text-muted-foreground hover:bg-muted-foreground/15 hover:text-foreground"
|
|
31
31
|
),
|
|
32
32
|
children: [
|
|
33
|
-
/* @__PURE__ */ r(
|
|
33
|
+
/* @__PURE__ */ r(a, { className: "size-4 shrink-0" }),
|
|
34
34
|
"Deep research",
|
|
35
35
|
/* @__PURE__ */ r(
|
|
36
36
|
"span",
|
|
37
37
|
{
|
|
38
38
|
"aria-hidden": !0,
|
|
39
39
|
className: n(
|
|
40
|
-
"size-1.5 shrink-0 rounded-dot transition-colors duration-
|
|
40
|
+
"size-1.5 shrink-0 rounded-dot transition-colors duration-150 ease-out motion-reduce:transition-none",
|
|
41
41
|
e ? "bg-info-600" : "bg-muted-foreground/40"
|
|
42
42
|
)
|
|
43
43
|
}
|
|
@@ -7,7 +7,7 @@ import { useComposerRuntime as d, useComposer as u } from "@assistant-ui/react";
|
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
9
|
import "../../lib/interactive.js";
|
|
10
|
-
import "
|
|
10
|
+
import "../ui/tooltip.js";
|
|
11
11
|
import "../button.js";
|
|
12
12
|
import "../spinner.js";
|
|
13
13
|
import "../reveal.js";
|
|
@@ -23,7 +23,7 @@ import "../scroll-area.js";
|
|
|
23
23
|
import "../stepper.js";
|
|
24
24
|
import "../resizable-panel.js";
|
|
25
25
|
import "react";
|
|
26
|
-
import { Bolt as a, ChevronDown as
|
|
26
|
+
import { Bolt as a, ChevronDown as h, CheckList as f, Sparkles as g } from "../../lib/icons.js";
|
|
27
27
|
import "react-dom";
|
|
28
28
|
import "motion/react";
|
|
29
29
|
import "../ripple.js";
|
|
@@ -97,6 +97,8 @@ import "./thread-context.js";
|
|
|
97
97
|
import "./tooltip-icon-button.js";
|
|
98
98
|
import "./composer-add-context.js";
|
|
99
99
|
import "zustand/shallow";
|
|
100
|
+
import "../ui/dialog.js";
|
|
101
|
+
import "radix-ui";
|
|
100
102
|
import "./composer-deep-research.js";
|
|
101
103
|
import "./composer-trigger-popover.js";
|
|
102
104
|
import "./directive-text.js";
|
|
@@ -117,7 +119,7 @@ const m = "application/x-actioneer-harness", S = [
|
|
|
117
119
|
{
|
|
118
120
|
id: "metric",
|
|
119
121
|
label: "Metric analysis",
|
|
120
|
-
icon: /* @__PURE__ */ e(
|
|
122
|
+
icon: /* @__PURE__ */ e(f, {}),
|
|
121
123
|
instructions: "Define the metric, grain, population, and time window before calculating. Call out comparisons, denominator changes, and any data-quality caveats."
|
|
122
124
|
},
|
|
123
125
|
{
|
|
@@ -127,7 +129,7 @@ const m = "application/x-actioneer-harness", S = [
|
|
|
127
129
|
instructions: "Write a concise executive brief: lead with the decision or insight, use only decision-relevant evidence, and end with the recommended next action."
|
|
128
130
|
}
|
|
129
131
|
];
|
|
130
|
-
function
|
|
132
|
+
function Ai() {
|
|
131
133
|
const r = d(), t = u((i) => i.attachments), o = new Set(
|
|
132
134
|
t.filter((i) => i.contentType === m).map((i) => i.name)
|
|
133
135
|
), s = (i) => {
|
|
@@ -146,10 +148,10 @@ function wi() {
|
|
|
146
148
|
/* @__PURE__ */ e(a, { className: "size-4 shrink-0" }),
|
|
147
149
|
"Add harness",
|
|
148
150
|
/* @__PURE__ */ e(
|
|
149
|
-
|
|
151
|
+
h,
|
|
150
152
|
{
|
|
151
153
|
"aria-hidden": !0,
|
|
152
|
-
className: "size-3.5 shrink-0 opacity-60 transition-transform duration-
|
|
154
|
+
className: "size-3.5 shrink-0 opacity-60 transition-transform duration-150 ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none"
|
|
153
155
|
}
|
|
154
156
|
)
|
|
155
157
|
]
|
|
@@ -170,7 +172,7 @@ function wi() {
|
|
|
170
172
|
] })
|
|
171
173
|
] });
|
|
172
174
|
}
|
|
173
|
-
class
|
|
175
|
+
class Ci {
|
|
174
176
|
constructor() {
|
|
175
177
|
p(this, "accept", m);
|
|
176
178
|
}
|
|
@@ -203,7 +205,7 @@ ${o}
|
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
export {
|
|
206
|
-
|
|
208
|
+
Ai as ComposerHarness,
|
|
207
209
|
m as HARNESS_MIME,
|
|
208
|
-
|
|
210
|
+
Ci as HarnessAttachmentAdapter
|
|
209
211
|
};
|
|
@@ -3,22 +3,23 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
|
3
3
|
import { memo as h, useRef as b } from "react";
|
|
4
4
|
import { ComposerPrimitive as n, unstable_defaultDirectiveFormatter as u, unstable_useTriggerPopoverScopeContext as N } from "@assistant-ui/react";
|
|
5
5
|
import { Sparkles as y, ChevronRight as P, ChevronLeft as T } from "../../lib/icons.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { Spinner as C } from "../spinner.js";
|
|
7
|
+
import { cn as I } from "../../lib/cn.js";
|
|
8
|
+
function x(o, r, i) {
|
|
9
|
+
return o && (r != null && r[o]) ? r[o] : i;
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
+
const _ = ({
|
|
11
12
|
iconMap: o,
|
|
12
13
|
fallbackIcon: r,
|
|
13
|
-
emptyLabel:
|
|
14
|
-
}) => /* @__PURE__ */ e(n.Unstable_TriggerPopoverCategories, { children: (
|
|
14
|
+
emptyLabel: i
|
|
15
|
+
}) => /* @__PURE__ */ e(n.Unstable_TriggerPopoverCategories, { children: (c) => /* @__PURE__ */ s(
|
|
15
16
|
"div",
|
|
16
17
|
{
|
|
17
18
|
"data-slot": "composer-trigger-popover-categories",
|
|
18
19
|
className: "flex flex-col py-1",
|
|
19
20
|
children: [
|
|
20
|
-
|
|
21
|
-
const
|
|
21
|
+
c.map((a) => {
|
|
22
|
+
const l = x(a.id, o, r);
|
|
22
23
|
return /* @__PURE__ */ s(
|
|
23
24
|
n.Unstable_TriggerPopoverCategoryItem,
|
|
24
25
|
{
|
|
@@ -26,7 +27,7 @@ const I = ({
|
|
|
26
27
|
className: "hover:bg-accent focus:bg-accent data-[highlighted]:bg-accent flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-sm transition-colors outline-none",
|
|
27
28
|
children: [
|
|
28
29
|
/* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
+
/* @__PURE__ */ e(l, { className: "text-muted-foreground size-4" }),
|
|
30
31
|
a.label
|
|
31
32
|
] }),
|
|
32
33
|
/* @__PURE__ */ e(P, { className: "text-muted-foreground size-4" })
|
|
@@ -35,17 +36,17 @@ const I = ({
|
|
|
35
36
|
a.id
|
|
36
37
|
);
|
|
37
38
|
}),
|
|
38
|
-
|
|
39
|
+
c.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted-foreground px-3 py-2 text-sm", children: i })
|
|
39
40
|
]
|
|
40
41
|
}
|
|
41
|
-
) }),
|
|
42
|
+
) }), U = ({
|
|
42
43
|
iconMap: o,
|
|
43
44
|
fallbackIcon: r,
|
|
44
|
-
backLabel:
|
|
45
|
-
emptyLabel:
|
|
45
|
+
backLabel: i,
|
|
46
|
+
emptyLabel: c,
|
|
46
47
|
loadingLabel: a
|
|
47
48
|
}) => {
|
|
48
|
-
const { isLoading:
|
|
49
|
+
const { isLoading: l } = N();
|
|
49
50
|
return /* @__PURE__ */ e(n.Unstable_TriggerPopoverItems, { children: (g) => /* @__PURE__ */ s(
|
|
50
51
|
"div",
|
|
51
52
|
{
|
|
@@ -54,17 +55,17 @@ const I = ({
|
|
|
54
55
|
children: [
|
|
55
56
|
/* @__PURE__ */ s(n.Unstable_TriggerPopoverBack, { className: "text-muted-foreground hover:bg-accent flex cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs tracking-wide uppercase transition-colors", children: [
|
|
56
57
|
/* @__PURE__ */ e(T, { className: "size-3.5" }),
|
|
57
|
-
|
|
58
|
+
i
|
|
58
59
|
] }),
|
|
59
60
|
/* @__PURE__ */ s("div", { className: "py-1", children: [
|
|
60
|
-
g.map((t,
|
|
61
|
+
g.map((t, m) => {
|
|
61
62
|
var d;
|
|
62
63
|
const p = typeof ((d = t.metadata) == null ? void 0 : d.icon) == "string" ? t.metadata.icon : void 0, v = x(p, o, r);
|
|
63
64
|
return /* @__PURE__ */ s(
|
|
64
65
|
n.Unstable_TriggerPopoverItem,
|
|
65
66
|
{
|
|
66
67
|
item: t,
|
|
67
|
-
index:
|
|
68
|
+
index: m,
|
|
68
69
|
className: "hover:bg-accent focus:bg-accent data-[highlighted]:bg-accent flex w-full cursor-pointer flex-col items-start gap-0.5 px-3 py-2 text-start transition-colors outline-none",
|
|
69
70
|
children: [
|
|
70
71
|
/* @__PURE__ */ s("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
@@ -77,7 +78,17 @@ const I = ({
|
|
|
77
78
|
t.id
|
|
78
79
|
);
|
|
79
80
|
}),
|
|
80
|
-
g.length === 0 && /* @__PURE__ */
|
|
81
|
+
g.length === 0 && /* @__PURE__ */ s(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
role: l ? "status" : void 0,
|
|
85
|
+
className: "text-muted-foreground flex items-center gap-2 px-3 py-2 text-sm",
|
|
86
|
+
children: [
|
|
87
|
+
l && /* @__PURE__ */ e(C, { variant: "content", size: "xs", "aria-hidden": !0 }),
|
|
88
|
+
l ? a : c
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
81
92
|
] })
|
|
82
93
|
]
|
|
83
94
|
}
|
|
@@ -85,19 +96,19 @@ const I = ({
|
|
|
85
96
|
}, f = ({
|
|
86
97
|
iconMap: o,
|
|
87
98
|
fallbackIcon: r = y,
|
|
88
|
-
backLabel:
|
|
89
|
-
emptyCategoriesLabel:
|
|
99
|
+
backLabel: i = "Back",
|
|
100
|
+
emptyCategoriesLabel: c = "No items available",
|
|
90
101
|
emptyItemsLabel: a = "No matching items",
|
|
91
|
-
loadingLabel:
|
|
102
|
+
loadingLabel: l = "Loading…",
|
|
92
103
|
className: g,
|
|
93
104
|
directive: t,
|
|
94
|
-
action:
|
|
105
|
+
action: m,
|
|
95
106
|
...p
|
|
96
107
|
}) => (b(!1), /* @__PURE__ */ s(
|
|
97
108
|
n.Unstable_TriggerPopover,
|
|
98
109
|
{
|
|
99
110
|
"data-slot": "composer-trigger-popover",
|
|
100
|
-
className:
|
|
111
|
+
className: I(
|
|
101
112
|
"aui-composer-trigger-popover bg-popover text-popover-foreground absolute start-0 bottom-full z-50 mb-2 w-64 overflow-hidden rounded-xl border shadow-lg",
|
|
102
113
|
g
|
|
103
114
|
),
|
|
@@ -109,39 +120,39 @@ const I = ({
|
|
|
109
120
|
formatter: t.formatter ?? u,
|
|
110
121
|
onInserted: t.onInserted
|
|
111
122
|
}
|
|
112
|
-
) :
|
|
123
|
+
) : m ? /* @__PURE__ */ e(
|
|
113
124
|
n.Unstable_TriggerPopover.Action,
|
|
114
125
|
{
|
|
115
|
-
formatter:
|
|
116
|
-
onExecute:
|
|
117
|
-
removeOnExecute:
|
|
126
|
+
formatter: m.formatter ?? u,
|
|
127
|
+
onExecute: m.onExecute,
|
|
128
|
+
removeOnExecute: m.removeOnExecute
|
|
118
129
|
}
|
|
119
130
|
) : null,
|
|
120
131
|
/* @__PURE__ */ e(
|
|
121
|
-
|
|
132
|
+
_,
|
|
122
133
|
{
|
|
123
134
|
iconMap: o,
|
|
124
135
|
fallbackIcon: r,
|
|
125
|
-
emptyLabel:
|
|
136
|
+
emptyLabel: c
|
|
126
137
|
}
|
|
127
138
|
),
|
|
128
139
|
/* @__PURE__ */ e(
|
|
129
|
-
|
|
140
|
+
U,
|
|
130
141
|
{
|
|
131
142
|
iconMap: o,
|
|
132
143
|
fallbackIcon: r,
|
|
133
|
-
backLabel:
|
|
144
|
+
backLabel: i,
|
|
134
145
|
emptyLabel: a,
|
|
135
|
-
loadingLabel:
|
|
146
|
+
loadingLabel: l
|
|
136
147
|
}
|
|
137
148
|
)
|
|
138
149
|
]
|
|
139
150
|
}
|
|
140
151
|
));
|
|
141
152
|
f.displayName = "ComposerTriggerPopover";
|
|
142
|
-
const
|
|
153
|
+
const S = h(
|
|
143
154
|
f
|
|
144
155
|
);
|
|
145
156
|
export {
|
|
146
|
-
|
|
157
|
+
S as ComposerTriggerPopover
|
|
147
158
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as f, Fragment as
|
|
2
|
+
import { jsx as e, jsxs as f, Fragment as L } from "react/jsx-runtime";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { ComposerAttachments as
|
|
4
|
+
import { useContext as D } from "react";
|
|
5
|
+
import { ComposerAttachments as I, ComposerAddImage as k } from "./attachment.js";
|
|
6
6
|
import { ComposerAddContext as F } from "./composer-add-context.js";
|
|
7
7
|
import { ComposerHarness as B } from "./composer-harness.js";
|
|
8
8
|
import { ComposerQuotePreview as H } from "./quote.js";
|
|
@@ -24,27 +24,27 @@ function J(i, t, p, b, T) {
|
|
|
24
24
|
} };
|
|
25
25
|
let w = 0, v, o;
|
|
26
26
|
return {
|
|
27
|
-
promise: new Promise((
|
|
28
|
-
o =
|
|
27
|
+
promise: new Promise((u) => {
|
|
28
|
+
o = u;
|
|
29
29
|
let y = performance.now(), h = null;
|
|
30
|
-
const
|
|
30
|
+
const r = (c) => {
|
|
31
31
|
if (b()) {
|
|
32
|
-
|
|
32
|
+
u();
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (T()) {
|
|
36
|
-
h === null && (h = c), v = window.setTimeout(() =>
|
|
36
|
+
h === null && (h = c), v = window.setTimeout(() => r(performance.now()), 100);
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
h !== null && (y += c - h, h = null);
|
|
40
|
-
const a = Math.min(1, (c - y) / t),
|
|
41
|
-
if (p(i.slice(0,
|
|
42
|
-
|
|
40
|
+
const a = Math.min(1, (c - y) / t), d = a >= 1 ? i.length : Math.floor(a * i.length);
|
|
41
|
+
if (p(i.slice(0, d)), a >= 1) {
|
|
42
|
+
u();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
w = requestAnimationFrame(
|
|
45
|
+
w = requestAnimationFrame(r);
|
|
46
46
|
};
|
|
47
|
-
w = requestAnimationFrame(
|
|
47
|
+
w = requestAnimationFrame(r);
|
|
48
48
|
}),
|
|
49
49
|
cancel: () => {
|
|
50
50
|
cancelAnimationFrame(w), v !== void 0 && window.clearTimeout(v), o();
|
|
@@ -52,46 +52,46 @@ function J(i, t, p, b, T) {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
const W = () => {
|
|
55
|
-
const { setText: i } = q(), t = l.useContext(
|
|
55
|
+
const { setText: i } = q(), t = l.useContext(M), [p, b] = l.useState(
|
|
56
56
|
(t == null ? void 0 : t[0]) ?? "Send a message…"
|
|
57
|
-
), [T, w] = l.useState(!1), v = l.useRef(null), [o, z] = l.useState(null),
|
|
58
|
-
v.current =
|
|
57
|
+
), [T, w] = l.useState(!1), v = l.useRef(null), [o, z] = l.useState(null), u = l.useRef(!1), y = l.useCallback((r) => {
|
|
58
|
+
v.current = r, z(r);
|
|
59
59
|
}, []);
|
|
60
60
|
l.useEffect(() => {
|
|
61
61
|
if (!o) return;
|
|
62
|
-
let
|
|
63
|
-
const c = (
|
|
64
|
-
|
|
62
|
+
let r = 0;
|
|
63
|
+
const c = (n) => {
|
|
64
|
+
u.current = n || document.activeElement === o, w(n);
|
|
65
65
|
}, a = () => {
|
|
66
|
-
const
|
|
67
|
-
c(
|
|
68
|
-
},
|
|
69
|
-
window.clearTimeout(
|
|
66
|
+
const n = o.value.length > 0;
|
|
67
|
+
c(n);
|
|
68
|
+
}, d = () => {
|
|
69
|
+
window.clearTimeout(r), r = window.setTimeout(a, 0);
|
|
70
70
|
}, g = () => {
|
|
71
|
-
|
|
72
|
-
}, E = (
|
|
73
|
-
i(
|
|
71
|
+
u.current = o.value.length > 0 || document.activeElement === o;
|
|
72
|
+
}, E = (n, m) => {
|
|
73
|
+
i(n), o.value = n, o.dispatchEvent(new Event("input", { bubbles: !0 })), c(n.length > 0), window.setTimeout(() => {
|
|
74
74
|
document.activeElement === o && o.setSelectionRange(m, m);
|
|
75
75
|
}, 0);
|
|
76
|
-
}, P = (
|
|
76
|
+
}, P = (n) => {
|
|
77
77
|
const m = o.selectionStart ?? 0, A = o.selectionEnd ?? m;
|
|
78
|
-
return m === A ||
|
|
78
|
+
return m === A || n.inputType !== "deleteContentBackward" && n.inputType !== "deleteContentForward" && n.inputType !== "deleteByCut" ? !1 : (n.preventDefault(), E(
|
|
79
79
|
o.value.slice(0, m) + o.value.slice(A),
|
|
80
80
|
m
|
|
81
81
|
), !0);
|
|
82
|
-
}, C = (
|
|
83
|
-
if (!
|
|
84
|
-
if (typeof
|
|
82
|
+
}, C = (n) => {
|
|
83
|
+
if (!n.isComposing && !P(n)) {
|
|
84
|
+
if (typeof n.data == "string" && n.data.length > 0) {
|
|
85
85
|
c(!0);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
d();
|
|
89
89
|
}
|
|
90
|
-
}, x = (
|
|
91
|
-
(
|
|
90
|
+
}, x = (n) => {
|
|
91
|
+
(n.metaKey || n.ctrlKey) && !n.altKey && n.key.toLowerCase() === "a" && (n.preventDefault(), o.select());
|
|
92
92
|
};
|
|
93
93
|
return a(), o.addEventListener("beforeinput", C), o.addEventListener("input", a), o.addEventListener("focus", g), o.addEventListener("blur", g), o.addEventListener("keydown", x), () => {
|
|
94
|
-
window.clearTimeout(
|
|
94
|
+
window.clearTimeout(r), o.removeEventListener("beforeinput", C), o.removeEventListener("input", a), o.removeEventListener("focus", g), o.removeEventListener("blur", g), o.removeEventListener("keydown", x);
|
|
95
95
|
};
|
|
96
96
|
}, [o, i]), l.useEffect(() => {
|
|
97
97
|
var C;
|
|
@@ -103,31 +103,31 @@ const W = () => {
|
|
|
103
103
|
b(t[0]);
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
let
|
|
107
|
-
const g = (x) => new Promise((
|
|
108
|
-
a = window.setTimeout(
|
|
109
|
-
}), E = () =>
|
|
106
|
+
let r = !1, c = 0, a, d;
|
|
107
|
+
const g = (x) => new Promise((n) => {
|
|
108
|
+
a = window.setTimeout(n, x);
|
|
109
|
+
}), E = () => r;
|
|
110
110
|
return (async () => {
|
|
111
|
-
for (; !
|
|
112
|
-
for (;
|
|
113
|
-
if (
|
|
111
|
+
for (; !r; ) {
|
|
112
|
+
for (; u.current && !r; ) await g(100);
|
|
113
|
+
if (r) return;
|
|
114
114
|
const x = t[c];
|
|
115
115
|
b("");
|
|
116
|
-
const { promise:
|
|
116
|
+
const { promise: n, cancel: m } = J(
|
|
117
117
|
x,
|
|
118
118
|
G(x),
|
|
119
119
|
b,
|
|
120
120
|
E,
|
|
121
|
-
() =>
|
|
121
|
+
() => u.current
|
|
122
122
|
);
|
|
123
|
-
if (
|
|
124
|
-
if (!
|
|
125
|
-
if (await g(X),
|
|
123
|
+
if (d = m, await n, d = void 0, r) return;
|
|
124
|
+
if (!u.current) {
|
|
125
|
+
if (await g(X), r) return;
|
|
126
126
|
c = (c + 1) % t.length;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
})(), () => {
|
|
130
|
-
|
|
130
|
+
r = !0, d == null || d(), a && window.clearTimeout(a);
|
|
131
131
|
};
|
|
132
132
|
}, [t]);
|
|
133
133
|
const h = !!(t != null && t.length) && !T;
|
|
@@ -153,16 +153,16 @@ const W = () => {
|
|
|
153
153
|
}
|
|
154
154
|
)
|
|
155
155
|
] });
|
|
156
|
-
},
|
|
156
|
+
}, M = l.createContext(
|
|
157
157
|
void 0
|
|
158
158
|
);
|
|
159
|
-
function
|
|
159
|
+
function de({
|
|
160
160
|
prompts: i,
|
|
161
161
|
children: t
|
|
162
162
|
}) {
|
|
163
|
-
return /* @__PURE__ */ e(
|
|
163
|
+
return /* @__PURE__ */ e(M.Provider, { value: i, children: t });
|
|
164
164
|
}
|
|
165
|
-
const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root animate-in fade-in slide-in-from-bottom-2 fill-mode-both relative flex w-full flex-col duration-
|
|
165
|
+
const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root animate-in fade-in slide-in-from-bottom-2 fill-mode-both relative flex w-full flex-col duration-200 delay-[420ms]", children: /* @__PURE__ */ e(s.Unstable_TriggerPopoverRoot, { children: /* @__PURE__ */ e(s.AttachmentDropzone, { asChild: !0, children: /* @__PURE__ */ f(
|
|
166
166
|
"div",
|
|
167
167
|
{
|
|
168
168
|
"data-slot": "aui_composer-shell",
|
|
@@ -170,16 +170,16 @@ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root anima
|
|
|
170
170
|
var p;
|
|
171
171
|
i.target.closest("button, a, input, textarea, [role='button']") || (p = i.currentTarget.querySelector("textarea")) == null || p.focus();
|
|
172
172
|
},
|
|
173
|
-
className: "border-border/60 data-[dragging=true]:border-ring focus-within:border-border
|
|
173
|
+
className: "border-border/60 data-[dragging=true]:border-ring focus-within:border-border relative flex w-full flex-col gap-2 rounded-(--composer-radius) border bg-(--composer-bg) p-(--composer-padding) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)] transition-[border-color,box-shadow] focus-within:shadow-[0_6px_24px_-8px_rgba(0,0,0,0.12),0_1px_2px_rgba(0,0,0,0.05)] data-[dragging=true]:border-dashed data-[dragging=true]:bg-[color-mix(in_oklab,var(--color-accent)_50%,var(--color-background))]",
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ e(H, { className: "mx-0 mt-0" }),
|
|
176
|
-
/* @__PURE__ */ e(
|
|
176
|
+
/* @__PURE__ */ e(I, {}),
|
|
177
177
|
/* @__PURE__ */ e(W, {}),
|
|
178
178
|
/* @__PURE__ */ e(Z, {})
|
|
179
179
|
]
|
|
180
180
|
}
|
|
181
181
|
) }) }) }), Z = () => {
|
|
182
|
-
const { ComposerAccessories: i = $ } =
|
|
182
|
+
const { ComposerAccessories: i = $ } = D(K);
|
|
183
183
|
return /* @__PURE__ */ f("div", { className: "aui-composer-action-wrapper relative flex items-center justify-between", children: [
|
|
184
184
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ e(i, {}) }),
|
|
185
185
|
/* @__PURE__ */ f("div", { className: "flex items-center gap-1.5", children: [
|
|
@@ -237,16 +237,16 @@ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root anima
|
|
|
237
237
|
) }) })
|
|
238
238
|
] })
|
|
239
239
|
] });
|
|
240
|
-
}, $ = () => /* @__PURE__ */ f(
|
|
240
|
+
}, $ = () => /* @__PURE__ */ f(L, { children: [
|
|
241
241
|
/* @__PURE__ */ e(F, {}),
|
|
242
|
-
/* @__PURE__ */ e(
|
|
242
|
+
/* @__PURE__ */ e(k, {}),
|
|
243
243
|
/* @__PURE__ */ e(B, {})
|
|
244
244
|
] }), pe = () => /* @__PURE__ */ e(
|
|
245
245
|
j.Root,
|
|
246
246
|
{
|
|
247
247
|
"data-slot": "aui_edit-composer-wrapper",
|
|
248
248
|
className: "flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
|
|
249
|
-
children: /* @__PURE__ */ f(s.Root, { className: "aui-edit-composer-root border-border/60
|
|
249
|
+
children: /* @__PURE__ */ f(s.Root, { className: "aui-edit-composer-root border-border/60 ms-auto flex w-full max-w-[85%] flex-col rounded-(--composer-radius) border bg-(--composer-bg) shadow-[0_4px_16px_-8px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.04)]", children: [
|
|
250
250
|
/* @__PURE__ */ e(
|
|
251
251
|
s.Input,
|
|
252
252
|
{
|
|
@@ -271,6 +271,6 @@ const me = () => /* @__PURE__ */ e(s.Root, { className: "aui-composer-root anima
|
|
|
271
271
|
);
|
|
272
272
|
export {
|
|
273
273
|
me as Composer,
|
|
274
|
-
|
|
274
|
+
de as ComposerPlaceholdersProvider,
|
|
275
275
|
pe as EditComposer
|
|
276
276
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { ErrorPrimitive as
|
|
3
|
+
import { ErrorPrimitive as t, MessagePrimitive as a } from "@assistant-ui/react";
|
|
4
4
|
import { cn as s } from "../../lib/cn.js";
|
|
5
|
-
function
|
|
5
|
+
function i({
|
|
6
6
|
className: e,
|
|
7
|
-
...
|
|
7
|
+
...o
|
|
8
8
|
}) {
|
|
9
9
|
return /* @__PURE__ */ r(
|
|
10
|
-
|
|
10
|
+
t.Root,
|
|
11
11
|
{
|
|
12
12
|
"data-slot": "error-root",
|
|
13
13
|
className: s(
|
|
14
|
-
"aui-message-error-root
|
|
14
|
+
"aui-message-error-root mt-2 rounded-md border border-danger-100 bg-danger-50 p-3 text-xs text-danger-700",
|
|
15
15
|
e
|
|
16
16
|
),
|
|
17
|
-
...
|
|
17
|
+
...o
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function n({
|
|
22
22
|
className: e,
|
|
23
|
-
...
|
|
23
|
+
...o
|
|
24
24
|
}) {
|
|
25
25
|
return /* @__PURE__ */ r(
|
|
26
|
-
|
|
26
|
+
t.Message,
|
|
27
27
|
{
|
|
28
28
|
"data-slot": "error-text",
|
|
29
29
|
className: s("aui-message-error-message line-clamp-2", e),
|
|
30
|
-
...
|
|
30
|
+
...o
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const g = () => /* @__PURE__ */ r(a.Error, { children: /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(n, {}) }) });
|
|
35
35
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
i as ErrorRoot,
|
|
37
|
+
n as ErrorText,
|
|
38
|
+
g as MessageError
|
|
39
39
|
};
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { FileMessagePartComponent } from '@assistant-ui/react';
|
|
4
4
|
declare const fileVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "outline" | "muted" | "ghost" | null | undefined;
|
|
6
6
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
declare function getMimeTypeIcon(mimeType: string): FC<{
|
|
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { ImageMessagePart, ImageMessagePartComponent } from '@assistant-ui/react';
|
|
4
4
|
declare const imageVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "outline" | "muted" | "ghost" | null | undefined;
|
|
6
6
|
size?: "default" | "sm" | "lg" | "full" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
export type ImageRootProps = React.ComponentProps<"div"> & VariantProps<typeof imageVariants>;
|