@actioneer/ads 0.5.7 → 0.5.9
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.d.ts +1 -0
- package/components/avatar.js +27 -26
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.d.ts +2 -0
- package/components/breadcrumbs.js +52 -50
- 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.d.ts +6 -0
- package/components/chart.js +743 -672
- 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 +18 -11
- package/components/drawer.js +81 -78
- 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.d.ts +5 -1
- package/components/modal.js +121 -76
- 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 +4 -0
- package/components/pixel-icon.js +210 -164
- 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 +1 -0
- package/components/segmented.js +39 -36
- package/components/select.d.ts +7 -0
- package/components/select.js +186 -137
- 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 +16 -0
- package/components/table.js +393 -260
- 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 +363 -0
- package/demo/lib/artifact-library.js +142 -0
- package/demo/lib/artifact-pin-guard.js +12 -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 +24 -0
- package/lib/icons.js +114 -108
- 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 +53 -19
- package/manifest.json +258 -36
- 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
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as e, jsx as t, Fragment as p } from "react/jsx-runtime";
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import { cn as _ } from "../../lib/cn.js";
|
|
5
|
+
import "../../lib/interactive.js";
|
|
6
|
+
import "../../components/ui/tooltip.js";
|
|
7
|
+
import { Button as s } from "../../components/button.js";
|
|
8
|
+
import "../../components/spinner.js";
|
|
9
|
+
import "../../components/reveal.js";
|
|
10
|
+
import { Field as C } from "../../components/field.js";
|
|
11
|
+
import "../../components/typography.js";
|
|
12
|
+
import "../../components/link.js";
|
|
13
|
+
import "../../components/divider.js";
|
|
14
|
+
import "../../components/kbd.js";
|
|
15
|
+
import "../../components/code-block.js";
|
|
16
|
+
import "../../components/setting-row.js";
|
|
17
|
+
import "../../components/file-dropzone.js";
|
|
18
|
+
import "../../components/scroll-area.js";
|
|
19
|
+
import "../../components/stepper.js";
|
|
20
|
+
import "../../components/resizable-panel.js";
|
|
21
|
+
import { LayoutGrid as H, Plus as S, WarningCircle as K, CheckCircle as U, ExternalLink as V } from "../../lib/icons.js";
|
|
22
|
+
import "react-dom";
|
|
23
|
+
import "motion/react";
|
|
24
|
+
import "../../components/ripple.js";
|
|
25
|
+
import { Input as I } from "../../components/input.js";
|
|
26
|
+
import "../../components/input-field.js";
|
|
27
|
+
import "../../components/textarea.js";
|
|
28
|
+
import "../../components/checkbox.js";
|
|
29
|
+
import "../../components/radio.js";
|
|
30
|
+
import "../../components/switch.js";
|
|
31
|
+
import "../../components/number-field.js";
|
|
32
|
+
import { Select as W } from "../../components/select.js";
|
|
33
|
+
import "../../components/autocomplete.js";
|
|
34
|
+
import "../../components/slider.js";
|
|
35
|
+
import "../../components/segmented.js";
|
|
36
|
+
import { Modal as q, ModalHeader as J, ModalTitle as Q, ModalBody as x, ModalFooter as g } from "../../components/modal.js";
|
|
37
|
+
import "../../components/drawer.js";
|
|
38
|
+
import "../../components/popover.js";
|
|
39
|
+
import "../../components/dropdown.js";
|
|
40
|
+
import { useToast as X } from "../../components/toast.js";
|
|
41
|
+
import "../../components/answer.js";
|
|
42
|
+
import "../../components/answer-sources.js";
|
|
43
|
+
import "../../components/card.js";
|
|
44
|
+
import "../../components/carousel.js";
|
|
45
|
+
import "../../components/chart.js";
|
|
46
|
+
import "../../components/connector-card.js";
|
|
47
|
+
import "../../components/infinite-canvas.js";
|
|
48
|
+
import "../../components/table.js";
|
|
49
|
+
import "../../components/tabs.js";
|
|
50
|
+
import "../../components/tree.js";
|
|
51
|
+
import "../../components/accordion.js";
|
|
52
|
+
import "../../components/avatar.js";
|
|
53
|
+
import "../../components/badge.js";
|
|
54
|
+
import "../../components/chip.js";
|
|
55
|
+
import "../../components/timeline.js";
|
|
56
|
+
import "../../components/alert.js";
|
|
57
|
+
import "../../components/pixel-blast-svg.js";
|
|
58
|
+
import "../../components/pixel-icon.js";
|
|
59
|
+
import "../../components/agent-icon.js";
|
|
60
|
+
import "../../components/brand-texture.js";
|
|
61
|
+
import { Progress as Y } from "../../components/progress.js";
|
|
62
|
+
import "../../components/progress-circle.js";
|
|
63
|
+
import "../../components/skeleton.js";
|
|
64
|
+
import "../../components/empty-state.js";
|
|
65
|
+
import "../../components/page-header.js";
|
|
66
|
+
import "../../components/navbar.js";
|
|
67
|
+
import "../../components/breadcrumbs.js";
|
|
68
|
+
import "../../components/pagination.js";
|
|
69
|
+
import "../../components/sidebar.js";
|
|
70
|
+
import "../../components/panel.js";
|
|
71
|
+
import "../../components/collapsible.js";
|
|
72
|
+
import "../../components/selection-action-bar.js";
|
|
73
|
+
import "../../components/ai-elements/agent-trace.js";
|
|
74
|
+
import "../../components/ai-elements/chain-of-thought.js";
|
|
75
|
+
import "../../components/ai-elements/chain-of-thought-icon.js";
|
|
76
|
+
import "../../components/ai-elements/chart.js";
|
|
77
|
+
import "../../components/ai-elements/inline-citation.js";
|
|
78
|
+
import "../../components/ai-elements/message.js";
|
|
79
|
+
import "../../components/ai-elements/research-activity.js";
|
|
80
|
+
import "../../components/ai-elements/shimmer.js";
|
|
81
|
+
import "../../components/ai-elements/task.js";
|
|
82
|
+
import "../../components/ai-elements/task-progress.js";
|
|
83
|
+
import "../../components/ai-elements/tool.js";
|
|
84
|
+
import "../../components/ai-elements/voice.js";
|
|
85
|
+
import "@assistant-ui/react";
|
|
86
|
+
import "../../components/assistant-ui/composer.js";
|
|
87
|
+
import "../../components/assistant-ui/answer-tool-ui.js";
|
|
88
|
+
import "../../components/assistant-ui/follow-up-suggestions.js";
|
|
89
|
+
import "../../components/assistant-ui/message.js";
|
|
90
|
+
import "../../components/assistant-ui/selection-toolbar.js";
|
|
91
|
+
import "../../components/ui/button.js";
|
|
92
|
+
import "../../components/assistant-ui/thread-context.js";
|
|
93
|
+
import "../../components/assistant-ui/tooltip-icon-button.js";
|
|
94
|
+
import { suggestedSectionForKind as M, ARTIFACT_DESTINATIONS as Z, findDuplicateArtifactBlock as tt, saveArtifactBlock as et } from "../lib/artifact-library.js";
|
|
95
|
+
import { validateArtifactPinBlock as it, PIN_GUARD_MESSAGE as b } from "../lib/artifact-pin-guard.js";
|
|
96
|
+
import "../../components/assistant-ui/composer-add-context.js";
|
|
97
|
+
import "zustand/shallow";
|
|
98
|
+
import "../../components/ui/dialog.js";
|
|
99
|
+
import "radix-ui";
|
|
100
|
+
import "../../components/assistant-ui/composer-deep-research.js";
|
|
101
|
+
import "../../components/assistant-ui/composer-trigger-popover.js";
|
|
102
|
+
import "../../components/assistant-ui/directive-text.js";
|
|
103
|
+
import "../../components/assistant-ui/file.js";
|
|
104
|
+
import "../../components/assistant-ui/image.js";
|
|
105
|
+
import "../../components/assistant-ui/markdown-text.js";
|
|
106
|
+
import "../../components/assistant-ui/quote.js";
|
|
107
|
+
import "../../components/assistant-ui/sources.js";
|
|
108
|
+
import "../../components/assistant-ui/tool-fallback.js";
|
|
109
|
+
import "../../components/assistant-ui/tool-group.js";
|
|
110
|
+
function ii({
|
|
111
|
+
block: i,
|
|
112
|
+
trigger: v = "button",
|
|
113
|
+
className: A,
|
|
114
|
+
open: O,
|
|
115
|
+
onOpenChange: E
|
|
116
|
+
}) {
|
|
117
|
+
const { toast: N } = X(), l = Z[0], r = m.useMemo(
|
|
118
|
+
() => it(i),
|
|
119
|
+
[i]
|
|
120
|
+
), [j, B] = m.useState(!1), u = O ?? j, c = E ?? B, [y, w] = m.useState(i.title), [f, z] = m.useState(
|
|
121
|
+
M(i.kind)
|
|
122
|
+
), [d, a] = m.useState("idle"), h = m.useRef(null), o = l.sections.find(
|
|
123
|
+
(n) => n.id === f
|
|
124
|
+
);
|
|
125
|
+
m.useEffect(
|
|
126
|
+
() => () => {
|
|
127
|
+
h.current !== null && window.clearTimeout(h.current);
|
|
128
|
+
},
|
|
129
|
+
[]
|
|
130
|
+
), m.useEffect(() => {
|
|
131
|
+
if (!u) {
|
|
132
|
+
a("idle");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
w(i.title), z(M(i.kind)), a("idle");
|
|
136
|
+
}, [i.kind, i.title, u]);
|
|
137
|
+
const k = () => {
|
|
138
|
+
if (!r.ok) {
|
|
139
|
+
a("blocked"), N.danger("Cannot pin this answer", {
|
|
140
|
+
description: r.message ?? b
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
c(!0);
|
|
145
|
+
}, T = () => {
|
|
146
|
+
if (!r.ok) {
|
|
147
|
+
a("blocked");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const n = y.trim() || i.title, L = f, P = (o == null ? void 0 : o.label) ?? "Section";
|
|
151
|
+
a("saving"), h.current = window.setTimeout(() => {
|
|
152
|
+
et({ ...i, title: n }, L), h.current = null, a("success"), N.success("Added to Artifact", {
|
|
153
|
+
description: `${l.label} · ${P}`
|
|
154
|
+
});
|
|
155
|
+
}, 900);
|
|
156
|
+
}, F = () => {
|
|
157
|
+
if (!(d !== "idle" || !r.ok)) {
|
|
158
|
+
if (tt(i, f)) {
|
|
159
|
+
a("duplicate");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
T();
|
|
163
|
+
}
|
|
164
|
+
}, R = () => {
|
|
165
|
+
d !== "duplicate" || !r.ok || T();
|
|
166
|
+
}, $ = () => {
|
|
167
|
+
c(!1), window.location.hash = `/demo/artifacts-v2/${l.id}`;
|
|
168
|
+
}, D = (n) => {
|
|
169
|
+
!n && d === "saving" || c(n);
|
|
170
|
+
}, G = v === "none" ? null : v === "menu-item" ? /* @__PURE__ */ e(
|
|
171
|
+
"button",
|
|
172
|
+
{
|
|
173
|
+
type: "button",
|
|
174
|
+
disabled: !r.ok,
|
|
175
|
+
onClick: k,
|
|
176
|
+
className: _(
|
|
177
|
+
"flex w-full cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",
|
|
178
|
+
!r.ok && "cursor-not-allowed opacity-50",
|
|
179
|
+
A
|
|
180
|
+
),
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ t(H, { className: "size-4" }),
|
|
183
|
+
"Add to Artifact"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
) : v === "icon" ? /* @__PURE__ */ t(
|
|
187
|
+
s,
|
|
188
|
+
{
|
|
189
|
+
type: "button",
|
|
190
|
+
variant: "ghost",
|
|
191
|
+
size: "icon-xs",
|
|
192
|
+
"aria-label": `Add ${i.title} to Artifact`,
|
|
193
|
+
title: r.ok ? "Add to Artifact" : r.message ?? b,
|
|
194
|
+
disabled: !r.ok,
|
|
195
|
+
onClick: k,
|
|
196
|
+
className: A,
|
|
197
|
+
children: /* @__PURE__ */ t(S, {})
|
|
198
|
+
}
|
|
199
|
+
) : /* @__PURE__ */ t(
|
|
200
|
+
s,
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
variant: "outline",
|
|
204
|
+
size: "xs",
|
|
205
|
+
startContent: /* @__PURE__ */ t(S, {}),
|
|
206
|
+
disabled: !r.ok,
|
|
207
|
+
title: r.ok ? void 0 : r.message ?? b,
|
|
208
|
+
onClick: k,
|
|
209
|
+
className: A,
|
|
210
|
+
children: "Add to Artifact"
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
214
|
+
G,
|
|
215
|
+
d === "blocked" && !u ? /* @__PURE__ */ t("p", { className: "mt-2 text-xs text-danger", role: "alert", children: r.message ?? b }) : null,
|
|
216
|
+
/* @__PURE__ */ e(q, { open: u, onOpenChange: D, size: "sm", children: [
|
|
217
|
+
/* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(Q, { children: "Add to Artifact" }) }),
|
|
218
|
+
d === "idle" ? /* @__PURE__ */ e(p, { children: [
|
|
219
|
+
/* @__PURE__ */ e(x, { className: "space-y-4", children: [
|
|
220
|
+
/* @__PURE__ */ t(C, { label: "Artifact", children: /* @__PURE__ */ t(I, { value: l.label, readOnly: !0 }) }),
|
|
221
|
+
/* @__PURE__ */ t(C, { label: "Section", children: /* @__PURE__ */ t(
|
|
222
|
+
W,
|
|
223
|
+
{
|
|
224
|
+
items: l.sections.map((n) => ({
|
|
225
|
+
label: n.label,
|
|
226
|
+
value: n.id
|
|
227
|
+
})),
|
|
228
|
+
value: f,
|
|
229
|
+
onChange: z
|
|
230
|
+
}
|
|
231
|
+
) }),
|
|
232
|
+
/* @__PURE__ */ t(C, { label: "Title", children: /* @__PURE__ */ t(
|
|
233
|
+
I,
|
|
234
|
+
{
|
|
235
|
+
value: y,
|
|
236
|
+
onChange: (n) => w(n.target.value)
|
|
237
|
+
}
|
|
238
|
+
) }),
|
|
239
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-secondary", children: i.kind === "markdown" ? "The answer will be saved as editable Markdown." : `This will remain a native ${i.kind} card.` })
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ e(g, { children: [
|
|
242
|
+
/* @__PURE__ */ t(
|
|
243
|
+
s,
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
variant: "ghost",
|
|
247
|
+
size: "sm",
|
|
248
|
+
onClick: () => c(!1),
|
|
249
|
+
children: "Cancel"
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ t(s, { type: "button", size: "sm", onClick: F, children: "Add" })
|
|
253
|
+
] })
|
|
254
|
+
] }) : d === "duplicate" ? /* @__PURE__ */ e(p, { children: [
|
|
255
|
+
/* @__PURE__ */ t(x, { children: /* @__PURE__ */ e(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
className: "flex min-h-56 flex-col items-center justify-center text-center",
|
|
259
|
+
role: "alert",
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ t("div", { className: "mb-5 grid size-14 place-items-center rounded-full bg-warning/10 text-warning", children: /* @__PURE__ */ t(K, { className: "size-7", weight: "fill" }) }),
|
|
262
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-semibold", children: "Already in this section" }),
|
|
263
|
+
/* @__PURE__ */ e("p", { className: "mt-1 max-w-72 text-xs text-secondary", children: [
|
|
264
|
+
"This item has already been added to ",
|
|
265
|
+
(o == null ? void 0 : o.label) ?? "this section",
|
|
266
|
+
" in ",
|
|
267
|
+
l.label,
|
|
268
|
+
"."
|
|
269
|
+
] })
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
) }),
|
|
273
|
+
/* @__PURE__ */ e(g, { children: [
|
|
274
|
+
/* @__PURE__ */ t(
|
|
275
|
+
s,
|
|
276
|
+
{
|
|
277
|
+
type: "button",
|
|
278
|
+
variant: "ghost",
|
|
279
|
+
size: "sm",
|
|
280
|
+
onClick: () => a("idle"),
|
|
281
|
+
children: "Go back"
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ t(s, { type: "button", size: "sm", onClick: R, children: "Add another copy" })
|
|
285
|
+
] })
|
|
286
|
+
] }) : d === "saving" ? /* @__PURE__ */ e(p, { children: [
|
|
287
|
+
/* @__PURE__ */ t(x, { children: /* @__PURE__ */ e(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
className: "flex min-h-56 flex-col items-center justify-center text-center",
|
|
291
|
+
"aria-live": "polite",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold", children: [
|
|
294
|
+
"Adding to ",
|
|
295
|
+
l.label
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-xs text-secondary", children: [
|
|
298
|
+
"Saving in ",
|
|
299
|
+
(o == null ? void 0 : o.label) ?? "Section"
|
|
300
|
+
] }),
|
|
301
|
+
/* @__PURE__ */ t(
|
|
302
|
+
Y,
|
|
303
|
+
{
|
|
304
|
+
isIndeterminate: !0,
|
|
305
|
+
size: "sm",
|
|
306
|
+
label: "Adding to Artifact",
|
|
307
|
+
className: "mt-6 max-w-64"
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
) }),
|
|
313
|
+
/* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(s, { type: "button", size: "sm", isLoading: !0, disabled: !0, children: "Adding" }) })
|
|
314
|
+
] }) : /* @__PURE__ */ e(p, { children: [
|
|
315
|
+
/* @__PURE__ */ t(x, { children: /* @__PURE__ */ e(
|
|
316
|
+
"div",
|
|
317
|
+
{
|
|
318
|
+
className: "flex min-h-56 flex-col items-center justify-center text-center",
|
|
319
|
+
role: "status",
|
|
320
|
+
"aria-live": "polite",
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ t("div", { className: "mb-5 grid size-14 place-items-center rounded-full bg-success/10 text-success", children: /* @__PURE__ */ t(U, { className: "size-7", weight: "fill" }) }),
|
|
323
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold", children: [
|
|
324
|
+
"Added to ",
|
|
325
|
+
l.label
|
|
326
|
+
] }),
|
|
327
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-xs text-secondary", children: [
|
|
328
|
+
(o == null ? void 0 : o.label) ?? "Section",
|
|
329
|
+
" · ",
|
|
330
|
+
y.trim() || i.title
|
|
331
|
+
] })
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
) }),
|
|
335
|
+
/* @__PURE__ */ e(g, { children: [
|
|
336
|
+
/* @__PURE__ */ t(
|
|
337
|
+
s,
|
|
338
|
+
{
|
|
339
|
+
type: "button",
|
|
340
|
+
variant: "ghost",
|
|
341
|
+
size: "sm",
|
|
342
|
+
onClick: () => c(!1),
|
|
343
|
+
children: "Done"
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
/* @__PURE__ */ t(
|
|
347
|
+
s,
|
|
348
|
+
{
|
|
349
|
+
type: "button",
|
|
350
|
+
size: "sm",
|
|
351
|
+
startContent: /* @__PURE__ */ t(V, {}),
|
|
352
|
+
onClick: $,
|
|
353
|
+
children: "Open artifact"
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
] })
|
|
357
|
+
] })
|
|
358
|
+
] })
|
|
359
|
+
] });
|
|
360
|
+
}
|
|
361
|
+
export {
|
|
362
|
+
ii as AddToArtifact
|
|
363
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const g = "ads:artifact-blocks-changed", m = "ads-demo.artifacts-v2.saved-blocks.v1", w = [
|
|
3
|
+
{
|
|
4
|
+
id: "revenue-performance",
|
|
5
|
+
label: "Revenue performance",
|
|
6
|
+
sections: [
|
|
7
|
+
{ id: "section-metrics", label: "Executive metrics" },
|
|
8
|
+
{ id: "section-story", label: "Revenue story" },
|
|
9
|
+
{ id: "section-table", label: "Regional performance" }
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
function A(t) {
|
|
14
|
+
return t === "metric" ? "section-metrics" : t === "table" ? "section-table" : "section-story";
|
|
15
|
+
}
|
|
16
|
+
function h() {
|
|
17
|
+
if (typeof window > "u") return [];
|
|
18
|
+
try {
|
|
19
|
+
const t = window.localStorage.getItem(m);
|
|
20
|
+
return t ? JSON.parse(t) : [];
|
|
21
|
+
} catch {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function S(t, r) {
|
|
26
|
+
const e = {
|
|
27
|
+
...t,
|
|
28
|
+
id: `saved-${t.kind}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
29
|
+
artifactId: "revenue-performance",
|
|
30
|
+
sectionId: r,
|
|
31
|
+
addedBy: "Himanshu Verma",
|
|
32
|
+
addedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
33
|
+
}, n = [...h(), e];
|
|
34
|
+
return window.localStorage.setItem(m, JSON.stringify(n)), window.dispatchEvent(
|
|
35
|
+
new CustomEvent(g, { detail: e })
|
|
36
|
+
), e;
|
|
37
|
+
}
|
|
38
|
+
function p(t) {
|
|
39
|
+
const r = {
|
|
40
|
+
kind: t.kind,
|
|
41
|
+
source: t.source,
|
|
42
|
+
markdown: t.markdown,
|
|
43
|
+
value: t.value,
|
|
44
|
+
change: t.change,
|
|
45
|
+
chart: t.chart,
|
|
46
|
+
table: t.table,
|
|
47
|
+
tableOrigin: t.tableOrigin,
|
|
48
|
+
connectorIds: t.connectorIds,
|
|
49
|
+
semanticTableId: t.semanticTableId,
|
|
50
|
+
semanticTableName: t.semanticTableName,
|
|
51
|
+
sql: t.sql,
|
|
52
|
+
answerLabel: t.answerLabel,
|
|
53
|
+
sqlQueryCount: t.sqlQueryCount
|
|
54
|
+
}, e = Object.values(r).some(
|
|
55
|
+
(n) => n !== void 0 && n !== ""
|
|
56
|
+
);
|
|
57
|
+
return JSON.stringify(
|
|
58
|
+
e ? r : { ...r, title: t.title.trim() }
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function b(t, r) {
|
|
62
|
+
const e = p(t);
|
|
63
|
+
return h().find(
|
|
64
|
+
(n) => n.artifactId === "revenue-performance" && n.sectionId === r && p(n) === e
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function a(t) {
|
|
68
|
+
return t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/^./, (r) => r.toUpperCase());
|
|
69
|
+
}
|
|
70
|
+
function f(t) {
|
|
71
|
+
return !!t && typeof t == "object" && !Array.isArray(t);
|
|
72
|
+
}
|
|
73
|
+
function u(t) {
|
|
74
|
+
return t == null ? "—" : Array.isArray(t) ? t.map(u).join(" · ") : f(t) ? Object.entries(t).map(([r, e]) => `${a(r)}: ${u(e)}`).join("; ") : String(t).replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
|
|
75
|
+
}
|
|
76
|
+
function l(t, r, e) {
|
|
77
|
+
const n = Array.from(
|
|
78
|
+
new Set(e.flatMap((o) => Object.keys(o)))
|
|
79
|
+
);
|
|
80
|
+
n.length && (t.push(`## ${a(r)}`), t.push(`| ${n.map(a).join(" | ")} |`), t.push(`| ${n.map(() => "---").join(" | ")} |`), e.forEach((o) => {
|
|
81
|
+
t.push(`| ${n.map((i) => u(o[i])).join(" | ")} |`);
|
|
82
|
+
}), t.push(""));
|
|
83
|
+
}
|
|
84
|
+
function y(t) {
|
|
85
|
+
const r = [t.headline, t.title, t.label].find(
|
|
86
|
+
(o) => typeof o == "string" && o.length > 0
|
|
87
|
+
), e = r ? [`# ${r}`, ""] : [], n = /* @__PURE__ */ new Set([
|
|
88
|
+
"headline",
|
|
89
|
+
"title",
|
|
90
|
+
"label",
|
|
91
|
+
"kind",
|
|
92
|
+
"tone",
|
|
93
|
+
"chart",
|
|
94
|
+
"sources",
|
|
95
|
+
"followUps"
|
|
96
|
+
]);
|
|
97
|
+
return Object.entries(t).forEach(([o, i]) => {
|
|
98
|
+
if (!(n.has(o) || i == null)) {
|
|
99
|
+
if (typeof i == "string") {
|
|
100
|
+
e.push(i, "");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (Array.isArray(i)) {
|
|
104
|
+
const c = i.filter(f);
|
|
105
|
+
if (c.length === i.length && c.length > 0) {
|
|
106
|
+
l(e, o, c);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const d = i.filter(
|
|
110
|
+
(s) => typeof s == "string" || typeof s == "number"
|
|
111
|
+
);
|
|
112
|
+
d.length && (e.push(`## ${a(o)}`), d.forEach((s) => e.push(`- ${String(s)}`)), e.push(""));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (f(i)) {
|
|
116
|
+
l(e, o, [i]);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
(typeof i == "number" || typeof i == "boolean") && e.push(`**${a(o)}:** ${String(i)}`, "");
|
|
120
|
+
}
|
|
121
|
+
}), e.join(`
|
|
122
|
+
`).trim();
|
|
123
|
+
}
|
|
124
|
+
function T(t) {
|
|
125
|
+
return t.map((e) => {
|
|
126
|
+
if (!e || typeof e != "object") return "";
|
|
127
|
+
const n = e;
|
|
128
|
+
return n.type === "text" && typeof n.text == "string" ? n.text : n.type === "tool-call" && n.args && typeof n.args == "object" ? y(n.args) : "";
|
|
129
|
+
}).filter(Boolean).join(`
|
|
130
|
+
|
|
131
|
+
`).trim() || "Saved answer";
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
g as ARTIFACT_BLOCKS_CHANGED,
|
|
135
|
+
m as ARTIFACT_BLOCKS_STORAGE_KEY,
|
|
136
|
+
w as ARTIFACT_DESTINATIONS,
|
|
137
|
+
T as assistantPartsToMarkdown,
|
|
138
|
+
b as findDuplicateArtifactBlock,
|
|
139
|
+
h as readSavedArtifactBlocks,
|
|
140
|
+
S as saveArtifactBlock,
|
|
141
|
+
A as suggestedSectionForKind
|
|
142
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const o = "This answer combines multiple data sources and cannot be pinned as one Board table.";
|
|
3
|
+
function r(e) {
|
|
4
|
+
if (e.kind !== "table")
|
|
5
|
+
return { ok: !0 };
|
|
6
|
+
const n = e.connectorIds ?? [], t = e.sqlQueryCount ?? 1;
|
|
7
|
+
return n.length !== 1 || t !== 1 ? { ok: !1, message: o } : { ok: !0 };
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
o as PIN_GUARD_MESSAGE,
|
|
11
|
+
r as validateArtifactPinBlock
|
|
12
|
+
};
|
|
Binary file
|
|
Binary file
|
package/fonts.css
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/* @actioneer/ads — generated by scripts/build-lib-styles.mjs. Do not edit. */
|
|
2
|
-
/* Aribau Grotesk — ADS
|
|
3
|
-
TWO
|
|
4
|
-
`font-
|
|
5
|
-
`font-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`font-synthesis-weight: none` (
|
|
2
|
+
/* Aribau Grotesk — ADS UI typeface.
|
|
3
|
+
TWO physical faces, both served compressed (woff2):
|
|
4
|
+
• Regular → `font-normal` (weight 100–499)
|
|
5
|
+
• Medium → `font-medium` (weight 500)
|
|
6
|
+
There is NO semibold or bold face. The broad face range keeps legacy
|
|
7
|
+
consumers on the real Medium file, while ADS source uses only 400 and 500.
|
|
8
|
+
`font-synthesis-weight: none` (index.css) blocks faux bolding. */
|
|
9
9
|
@font-face {
|
|
10
10
|
font-family: "Aribau Grotesk";
|
|
11
|
-
src: url("./fonts/aribau-grotesk-
|
|
12
|
-
font-weight: 100
|
|
11
|
+
src: url("./fonts/aribau-grotesk-regular.woff2") format("woff2");
|
|
12
|
+
font-weight: 100 499;
|
|
13
13
|
font-style: normal;
|
|
14
14
|
font-display: swap;
|
|
15
15
|
}
|
|
16
16
|
@font-face {
|
|
17
17
|
font-family: "Aribau Grotesk";
|
|
18
|
-
src: url("./fonts/aribau-grotesk-
|
|
19
|
-
font-weight:
|
|
18
|
+
src: url("./fonts/aribau-grotesk-medium.woff2") format("woff2");
|
|
19
|
+
font-weight: 500 900;
|
|
20
20
|
font-style: normal;
|
|
21
21
|
font-display: swap;
|
|
22
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as l from "react";
|
|
3
3
|
import { useMotionValue as m, useMotionValueEvent as p, animate as f } from "motion/react";
|
|
4
|
-
import {
|
|
4
|
+
import { springEffect as g } from "../../lib/motion.js";
|
|
5
5
|
const h = {
|
|
6
6
|
idle: { speed: 8, scale: 0.2, amplitude: 1.2, frequency: 0.4, brightness: 1 },
|
|
7
7
|
connecting: { speed: 30, scale: 0.3, amplitude: 0.5, frequency: 1, brightness: 2 },
|
|
@@ -14,20 +14,21 @@ const h = {
|
|
|
14
14
|
function d(n) {
|
|
15
15
|
return Math.min(1, Math.max(0, n));
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const [r, t] =
|
|
17
|
+
function o(n) {
|
|
18
|
+
const [r, t] = l.useState(n), e = m(n), a = l.useRef(null);
|
|
19
19
|
p(e, "change", t);
|
|
20
|
-
const u =
|
|
21
|
-
(s,
|
|
20
|
+
const u = l.useCallback(
|
|
21
|
+
(s, c) => {
|
|
22
22
|
var i;
|
|
23
|
-
(i = a.current) == null || i.stop(), a.current = f(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
(i = a.current) == null || i.stop(), a.current = f(
|
|
24
|
+
e,
|
|
25
|
+
s,
|
|
26
|
+
c ? { duration: 0 } : g
|
|
27
|
+
);
|
|
27
28
|
},
|
|
28
29
|
[e]
|
|
29
30
|
);
|
|
30
|
-
return
|
|
31
|
+
return l.useEffect(() => () => {
|
|
31
32
|
var s;
|
|
32
33
|
return (s = a.current) == null ? void 0 : s.stop();
|
|
33
34
|
}, []), { value: r, animateTo: u };
|
|
@@ -37,16 +38,16 @@ function y({
|
|
|
37
38
|
volume: r = 0,
|
|
38
39
|
reduced: t = !1
|
|
39
40
|
}) {
|
|
40
|
-
const e = h[n], a =
|
|
41
|
-
|
|
42
|
-
a.animateTo(e.scale, t), u.animateTo(e.amplitude, t), s.animateTo(e.frequency, t),
|
|
41
|
+
const e = h[n], a = o(e.scale), u = o(e.amplitude), s = o(e.frequency), c = o(e.brightness);
|
|
42
|
+
l.useEffect(() => {
|
|
43
|
+
a.animateTo(e.scale, t), u.animateTo(e.amplitude, t), s.animateTo(e.frequency, t), c.animateTo(e.brightness, t);
|
|
43
44
|
}, [
|
|
44
45
|
e,
|
|
45
46
|
t,
|
|
46
47
|
a.animateTo,
|
|
47
48
|
u.animateTo,
|
|
48
49
|
s.animateTo,
|
|
49
|
-
|
|
50
|
+
c.animateTo
|
|
50
51
|
]);
|
|
51
52
|
const i = !t && (n === "listening" || n === "speaking") ? d(r) : 0;
|
|
52
53
|
return {
|
|
@@ -54,7 +55,7 @@ function y({
|
|
|
54
55
|
scale: a.value + i * 0.18,
|
|
55
56
|
amplitude: u.value + i * 0.35,
|
|
56
57
|
frequency: s.value,
|
|
57
|
-
brightness:
|
|
58
|
+
brightness: c.value + i * 0.4
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
export {
|