@actioneer/ads 0.5.8 → 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.
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as t, Fragment as p } from "react/jsx-runtime";
2
+ import { jsxs as e, jsx as t, Fragment as p } from "react/jsx-runtime";
3
3
  import * as m from "react";
4
- import { cn as D } from "../../lib/cn.js";
4
+ import { cn as _ } from "../../lib/cn.js";
5
5
  import "../../lib/interactive.js";
6
6
  import "../../components/ui/tooltip.js";
7
- import { Button as n } from "../../components/button.js";
7
+ import { Button as s } from "../../components/button.js";
8
8
  import "../../components/spinner.js";
9
9
  import "../../components/reveal.js";
10
- import { Field as A } from "../../components/field.js";
10
+ import { Field as C } from "../../components/field.js";
11
11
  import "../../components/typography.js";
12
12
  import "../../components/link.js";
13
13
  import "../../components/divider.js";
@@ -18,11 +18,11 @@ import "../../components/file-dropzone.js";
18
18
  import "../../components/scroll-area.js";
19
19
  import "../../components/stepper.js";
20
20
  import "../../components/resizable-panel.js";
21
- import { LayoutGrid as G, Plus as w, WarningCircle as P, CheckCircle as H, ExternalLink as K } from "../../lib/icons.js";
21
+ import { LayoutGrid as H, Plus as S, WarningCircle as K, CheckCircle as U, ExternalLink as V } from "../../lib/icons.js";
22
22
  import "react-dom";
23
23
  import "motion/react";
24
24
  import "../../components/ripple.js";
25
- import { Input as z } from "../../components/input.js";
25
+ import { Input as I } from "../../components/input.js";
26
26
  import "../../components/input-field.js";
27
27
  import "../../components/textarea.js";
28
28
  import "../../components/checkbox.js";
@@ -33,11 +33,11 @@ import { Select as W } from "../../components/select.js";
33
33
  import "../../components/autocomplete.js";
34
34
  import "../../components/slider.js";
35
35
  import "../../components/segmented.js";
36
- import { Modal as _, ModalHeader as q, ModalTitle as J, ModalBody as h, ModalFooter as f } from "../../components/modal.js";
36
+ import { Modal as q, ModalHeader as J, ModalTitle as Q, ModalBody as x, ModalFooter as g } from "../../components/modal.js";
37
37
  import "../../components/drawer.js";
38
38
  import "../../components/popover.js";
39
39
  import "../../components/dropdown.js";
40
- import { useToast as Q } from "../../components/toast.js";
40
+ import { useToast as X } from "../../components/toast.js";
41
41
  import "../../components/answer.js";
42
42
  import "../../components/answer-sources.js";
43
43
  import "../../components/card.js";
@@ -58,7 +58,7 @@ import "../../components/pixel-blast-svg.js";
58
58
  import "../../components/pixel-icon.js";
59
59
  import "../../components/agent-icon.js";
60
60
  import "../../components/brand-texture.js";
61
- import { Progress as U } from "../../components/progress.js";
61
+ import { Progress as Y } from "../../components/progress.js";
62
62
  import "../../components/progress-circle.js";
63
63
  import "../../components/skeleton.js";
64
64
  import "../../components/empty-state.js";
@@ -91,7 +91,8 @@ import "../../components/assistant-ui/selection-toolbar.js";
91
91
  import "../../components/ui/button.js";
92
92
  import "../../components/assistant-ui/thread-context.js";
93
93
  import "../../components/assistant-ui/tooltip-icon-button.js";
94
- import { suggestedSectionForKind as T, ARTIFACT_DESTINATIONS as V, findDuplicateArtifactBlock as X, saveArtifactBlock as Y } from "../lib/artifact-library.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";
95
96
  import "../../components/assistant-ui/composer-add-context.js";
96
97
  import "zustand/shallow";
97
98
  import "../../components/ui/dialog.js";
@@ -106,141 +107,162 @@ import "../../components/assistant-ui/quote.js";
106
107
  import "../../components/assistant-ui/sources.js";
107
108
  import "../../components/assistant-ui/tool-fallback.js";
108
109
  import "../../components/assistant-ui/tool-group.js";
109
- function Xi({
110
- block: e,
111
- trigger: x = "button",
112
- className: g,
113
- open: S,
114
- onOpenChange: k
110
+ function ii({
111
+ block: i,
112
+ trigger: v = "button",
113
+ className: A,
114
+ open: O,
115
+ onOpenChange: E
115
116
  }) {
116
- const { toast: I } = Q(), l = V[0], [M, O] = m.useState(!1), v = S ?? M, s = k ?? O, [b, y] = m.useState(e.title), [d, C] = m.useState(
117
- T(e.kind)
118
- ), [a, c] = m.useState("idle"), u = m.useRef(null), r = l.sections.find(
119
- (o) => o.id === d
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
120
124
  );
121
125
  m.useEffect(
122
126
  () => () => {
123
- u.current !== null && window.clearTimeout(u.current);
127
+ h.current !== null && window.clearTimeout(h.current);
124
128
  },
125
129
  []
126
130
  ), m.useEffect(() => {
127
- if (!v) {
128
- c("idle");
131
+ if (!u) {
132
+ a("idle");
129
133
  return;
130
134
  }
131
- y(e.title), C(T(e.kind)), c("idle");
132
- }, [e.kind, e.title, v]);
133
- const N = () => {
134
- const o = b.trim() || e.title, L = d, R = (r == null ? void 0 : r.label) ?? "Section";
135
- c("saving"), u.current = window.setTimeout(() => {
136
- Y({ ...e, title: o }, L), u.current = null, c("success"), I.success("Added to Artifact", {
137
- description: `${l.label} · ${R}`
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}`
138
154
  });
139
155
  }, 900);
140
- }, j = () => {
141
- if (a === "idle") {
142
- if (X(e, d)) {
143
- c("duplicate");
156
+ }, F = () => {
157
+ if (!(d !== "idle" || !r.ok)) {
158
+ if (tt(i, f)) {
159
+ a("duplicate");
144
160
  return;
145
161
  }
146
- N();
162
+ T();
147
163
  }
148
- }, F = () => {
149
- a === "duplicate" && N();
164
+ }, R = () => {
165
+ d !== "duplicate" || !r.ok || T();
150
166
  }, $ = () => {
151
- s(!1), window.location.hash = `/demo/artifacts-v2/${l.id}`;
152
- }, B = (o) => {
153
- !o && a === "saving" || s(o);
154
- }, E = x === "none" ? null : x === "menu-item" ? /* @__PURE__ */ i(
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(
155
171
  "button",
156
172
  {
157
173
  type: "button",
158
- onClick: () => s(!0),
159
- className: D(
174
+ disabled: !r.ok,
175
+ onClick: k,
176
+ className: _(
160
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",
161
- g
178
+ !r.ok && "cursor-not-allowed opacity-50",
179
+ A
162
180
  ),
163
181
  children: [
164
- /* @__PURE__ */ t(G, { className: "size-4" }),
182
+ /* @__PURE__ */ t(H, { className: "size-4" }),
165
183
  "Add to Artifact"
166
184
  ]
167
185
  }
168
- ) : x === "icon" ? /* @__PURE__ */ t(
169
- n,
186
+ ) : v === "icon" ? /* @__PURE__ */ t(
187
+ s,
170
188
  {
171
189
  type: "button",
172
190
  variant: "ghost",
173
191
  size: "icon-xs",
174
- "aria-label": `Add ${e.title} to Artifact`,
175
- title: "Add to Artifact",
176
- onClick: () => s(!0),
177
- className: g,
178
- children: /* @__PURE__ */ t(w, {})
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, {})
179
198
  }
180
199
  ) : /* @__PURE__ */ t(
181
- n,
200
+ s,
182
201
  {
183
202
  type: "button",
184
203
  variant: "outline",
185
204
  size: "xs",
186
- startContent: /* @__PURE__ */ t(w, {}),
187
- onClick: () => s(!0),
188
- className: g,
205
+ startContent: /* @__PURE__ */ t(S, {}),
206
+ disabled: !r.ok,
207
+ title: r.ok ? void 0 : r.message ?? b,
208
+ onClick: k,
209
+ className: A,
189
210
  children: "Add to Artifact"
190
211
  }
191
212
  );
192
- return /* @__PURE__ */ i(p, { children: [
193
- E,
194
- /* @__PURE__ */ i(_, { open: v, onOpenChange: B, size: "sm", children: [
195
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(J, { children: "Add to Artifact" }) }),
196
- a === "idle" ? /* @__PURE__ */ i(p, { children: [
197
- /* @__PURE__ */ i(h, { className: "space-y-4", children: [
198
- /* @__PURE__ */ t(A, { label: "Artifact", children: /* @__PURE__ */ t(z, { value: l.label, readOnly: !0 }) }),
199
- /* @__PURE__ */ t(A, { label: "Section", children: /* @__PURE__ */ t(
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(
200
222
  W,
201
223
  {
202
- items: l.sections.map((o) => ({
203
- label: o.label,
204
- value: o.id
224
+ items: l.sections.map((n) => ({
225
+ label: n.label,
226
+ value: n.id
205
227
  })),
206
- value: d,
207
- onChange: C
228
+ value: f,
229
+ onChange: z
208
230
  }
209
231
  ) }),
210
- /* @__PURE__ */ t(A, { label: "Title", children: /* @__PURE__ */ t(
211
- z,
232
+ /* @__PURE__ */ t(C, { label: "Title", children: /* @__PURE__ */ t(
233
+ I,
212
234
  {
213
- value: b,
214
- onChange: (o) => y(o.target.value)
235
+ value: y,
236
+ onChange: (n) => w(n.target.value)
215
237
  }
216
238
  ) }),
217
- /* @__PURE__ */ t("p", { className: "text-xs text-secondary", children: e.kind === "markdown" ? "The answer will be saved as editable Markdown." : `This will remain a native ${e.kind} card.` })
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.` })
218
240
  ] }),
219
- /* @__PURE__ */ i(f, { children: [
241
+ /* @__PURE__ */ e(g, { children: [
220
242
  /* @__PURE__ */ t(
221
- n,
243
+ s,
222
244
  {
223
245
  type: "button",
224
246
  variant: "ghost",
225
247
  size: "sm",
226
- onClick: () => s(!1),
248
+ onClick: () => c(!1),
227
249
  children: "Cancel"
228
250
  }
229
251
  ),
230
- /* @__PURE__ */ t(n, { type: "button", size: "sm", onClick: j, children: "Add" })
252
+ /* @__PURE__ */ t(s, { type: "button", size: "sm", onClick: F, children: "Add" })
231
253
  ] })
232
- ] }) : a === "duplicate" ? /* @__PURE__ */ i(p, { children: [
233
- /* @__PURE__ */ t(h, { children: /* @__PURE__ */ i(
254
+ ] }) : d === "duplicate" ? /* @__PURE__ */ e(p, { children: [
255
+ /* @__PURE__ */ t(x, { children: /* @__PURE__ */ e(
234
256
  "div",
235
257
  {
236
258
  className: "flex min-h-56 flex-col items-center justify-center text-center",
237
259
  role: "alert",
238
260
  children: [
239
- /* @__PURE__ */ t("div", { className: "mb-5 grid size-14 place-items-center rounded-full bg-warning/10 text-warning", children: /* @__PURE__ */ t(P, { className: "size-7", weight: "fill" }) }),
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" }) }),
240
262
  /* @__PURE__ */ t("p", { className: "text-sm font-semibold", children: "Already in this section" }),
241
- /* @__PURE__ */ i("p", { className: "mt-1 max-w-72 text-xs text-secondary", children: [
263
+ /* @__PURE__ */ e("p", { className: "mt-1 max-w-72 text-xs text-secondary", children: [
242
264
  "This item has already been added to ",
243
- (r == null ? void 0 : r.label) ?? "this section",
265
+ (o == null ? void 0 : o.label) ?? "this section",
244
266
  " in ",
245
267
  l.label,
246
268
  "."
@@ -248,36 +270,36 @@ function Xi({
248
270
  ]
249
271
  }
250
272
  ) }),
251
- /* @__PURE__ */ i(f, { children: [
273
+ /* @__PURE__ */ e(g, { children: [
252
274
  /* @__PURE__ */ t(
253
- n,
275
+ s,
254
276
  {
255
277
  type: "button",
256
278
  variant: "ghost",
257
279
  size: "sm",
258
- onClick: () => c("idle"),
280
+ onClick: () => a("idle"),
259
281
  children: "Go back"
260
282
  }
261
283
  ),
262
- /* @__PURE__ */ t(n, { type: "button", size: "sm", onClick: F, children: "Add another copy" })
284
+ /* @__PURE__ */ t(s, { type: "button", size: "sm", onClick: R, children: "Add another copy" })
263
285
  ] })
264
- ] }) : a === "saving" ? /* @__PURE__ */ i(p, { children: [
265
- /* @__PURE__ */ t(h, { children: /* @__PURE__ */ i(
286
+ ] }) : d === "saving" ? /* @__PURE__ */ e(p, { children: [
287
+ /* @__PURE__ */ t(x, { children: /* @__PURE__ */ e(
266
288
  "div",
267
289
  {
268
290
  className: "flex min-h-56 flex-col items-center justify-center text-center",
269
291
  "aria-live": "polite",
270
292
  children: [
271
- /* @__PURE__ */ i("p", { className: "text-sm font-semibold", children: [
293
+ /* @__PURE__ */ e("p", { className: "text-sm font-semibold", children: [
272
294
  "Adding to ",
273
295
  l.label
274
296
  ] }),
275
- /* @__PURE__ */ i("p", { className: "mt-1 text-xs text-secondary", children: [
297
+ /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-secondary", children: [
276
298
  "Saving in ",
277
- (r == null ? void 0 : r.label) ?? "Section"
299
+ (o == null ? void 0 : o.label) ?? "Section"
278
300
  ] }),
279
301
  /* @__PURE__ */ t(
280
- U,
302
+ Y,
281
303
  {
282
304
  isIndeterminate: !0,
283
305
  size: "sm",
@@ -288,45 +310,45 @@ function Xi({
288
310
  ]
289
311
  }
290
312
  ) }),
291
- /* @__PURE__ */ t(f, { children: /* @__PURE__ */ t(n, { type: "button", size: "sm", isLoading: !0, disabled: !0, children: "Adding" }) })
292
- ] }) : /* @__PURE__ */ i(p, { children: [
293
- /* @__PURE__ */ t(h, { children: /* @__PURE__ */ i(
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(
294
316
  "div",
295
317
  {
296
318
  className: "flex min-h-56 flex-col items-center justify-center text-center",
297
319
  role: "status",
298
320
  "aria-live": "polite",
299
321
  children: [
300
- /* @__PURE__ */ t("div", { className: "mb-5 grid size-14 place-items-center rounded-full bg-success/10 text-success", children: /* @__PURE__ */ t(H, { className: "size-7", weight: "fill" }) }),
301
- /* @__PURE__ */ i("p", { className: "text-sm font-semibold", 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: [
302
324
  "Added to ",
303
325
  l.label
304
326
  ] }),
305
- /* @__PURE__ */ i("p", { className: "mt-1 text-xs text-secondary", children: [
306
- (r == null ? void 0 : r.label) ?? "Section",
327
+ /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-secondary", children: [
328
+ (o == null ? void 0 : o.label) ?? "Section",
307
329
  " · ",
308
- b.trim() || e.title
330
+ y.trim() || i.title
309
331
  ] })
310
332
  ]
311
333
  }
312
334
  ) }),
313
- /* @__PURE__ */ i(f, { children: [
335
+ /* @__PURE__ */ e(g, { children: [
314
336
  /* @__PURE__ */ t(
315
- n,
337
+ s,
316
338
  {
317
339
  type: "button",
318
340
  variant: "ghost",
319
341
  size: "sm",
320
- onClick: () => s(!1),
342
+ onClick: () => c(!1),
321
343
  children: "Done"
322
344
  }
323
345
  ),
324
346
  /* @__PURE__ */ t(
325
- n,
347
+ s,
326
348
  {
327
349
  type: "button",
328
350
  size: "sm",
329
- startContent: /* @__PURE__ */ t(K, {}),
351
+ startContent: /* @__PURE__ */ t(V, {}),
330
352
  onClick: $,
331
353
  children: "Open artifact"
332
354
  }
@@ -337,5 +359,5 @@ function Xi({
337
359
  ] });
338
360
  }
339
361
  export {
340
- Xi as AddToArtifact
362
+ ii as AddToArtifact
341
363
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- const g = "ads:artifact-blocks-changed", w = [
2
+ const g = "ads:artifact-blocks-changed", m = "ads-demo.artifacts-v2.saved-blocks.v1", w = [
3
3
  {
4
4
  id: "revenue-performance",
5
5
  label: "Revenue performance",
@@ -9,8 +9,8 @@ const g = "ads:artifact-blocks-changed", w = [
9
9
  { id: "section-table", label: "Regional performance" }
10
10
  ]
11
11
  }
12
- ], m = "ads-demo.artifacts-v2.saved-blocks.v1";
13
- function S(t) {
12
+ ];
13
+ function A(t) {
14
14
  return t === "metric" ? "section-metrics" : t === "table" ? "section-table" : "section-story";
15
15
  }
16
16
  function h() {
@@ -22,7 +22,7 @@ function h() {
22
22
  return [];
23
23
  }
24
24
  }
25
- function A(t, r) {
25
+ function S(t, r) {
26
26
  const e = {
27
27
  ...t,
28
28
  id: `saved-${t.kind}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
@@ -43,7 +43,14 @@ function p(t) {
43
43
  value: t.value,
44
44
  change: t.change,
45
45
  chart: t.chart,
46
- table: t.table
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
47
54
  }, e = Object.values(r).some(
48
55
  (n) => n !== void 0 && n !== ""
49
56
  );
@@ -57,26 +64,26 @@ function b(t, r) {
57
64
  (n) => n.artifactId === "revenue-performance" && n.sectionId === r && p(n) === e
58
65
  );
59
66
  }
60
- function c(t) {
67
+ function a(t) {
61
68
  return t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/^./, (r) => r.toUpperCase());
62
69
  }
63
70
  function f(t) {
64
71
  return !!t && typeof t == "object" && !Array.isArray(t);
65
72
  }
66
73
  function u(t) {
67
- return t == null ? "—" : Array.isArray(t) ? t.map(u).join(" · ") : f(t) ? Object.entries(t).map(([r, e]) => `${c(r)}: ${u(e)}`).join("; ") : String(t).replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
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, " ");
68
75
  }
69
76
  function l(t, r, e) {
70
77
  const n = Array.from(
71
- new Set(e.flatMap((i) => Object.keys(i)))
78
+ new Set(e.flatMap((o) => Object.keys(o)))
72
79
  );
73
- n.length && (t.push(`## ${c(r)}`), t.push(`| ${n.map(c).join(" | ")} |`), t.push(`| ${n.map(() => "---").join(" | ")} |`), e.forEach((i) => {
74
- t.push(`| ${n.map((o) => u(i[o])).join(" | ")} |`);
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(" | ")} |`);
75
82
  }), t.push(""));
76
83
  }
77
84
  function y(t) {
78
85
  const r = [t.headline, t.title, t.label].find(
79
- (i) => typeof i == "string" && i.length > 0
86
+ (o) => typeof o == "string" && o.length > 0
80
87
  ), e = r ? [`# ${r}`, ""] : [], n = /* @__PURE__ */ new Set([
81
88
  "headline",
82
89
  "title",
@@ -87,34 +94,34 @@ function y(t) {
87
94
  "sources",
88
95
  "followUps"
89
96
  ]);
90
- return Object.entries(t).forEach(([i, o]) => {
91
- if (!(n.has(i) || o == null)) {
92
- if (typeof o == "string") {
93
- e.push(o, "");
97
+ return Object.entries(t).forEach(([o, i]) => {
98
+ if (!(n.has(o) || i == null)) {
99
+ if (typeof i == "string") {
100
+ e.push(i, "");
94
101
  return;
95
102
  }
96
- if (Array.isArray(o)) {
97
- const s = o.filter(f);
98
- if (s.length === o.length && s.length > 0) {
99
- l(e, i, s);
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);
100
107
  return;
101
108
  }
102
- const d = o.filter(
103
- (a) => typeof a == "string" || typeof a == "number"
109
+ const d = i.filter(
110
+ (s) => typeof s == "string" || typeof s == "number"
104
111
  );
105
- d.length && (e.push(`## ${c(i)}`), d.forEach((a) => e.push(`- ${String(a)}`)), e.push(""));
112
+ d.length && (e.push(`## ${a(o)}`), d.forEach((s) => e.push(`- ${String(s)}`)), e.push(""));
106
113
  return;
107
114
  }
108
- if (f(o)) {
109
- l(e, i, [o]);
115
+ if (f(i)) {
116
+ l(e, o, [i]);
110
117
  return;
111
118
  }
112
- (typeof o == "number" || typeof o == "boolean") && e.push(`**${c(i)}:** ${String(o)}`, "");
119
+ (typeof i == "number" || typeof i == "boolean") && e.push(`**${a(o)}:** ${String(i)}`, "");
113
120
  }
114
121
  }), e.join(`
115
122
  `).trim();
116
123
  }
117
- function $(t) {
124
+ function T(t) {
118
125
  return t.map((e) => {
119
126
  if (!e || typeof e != "object") return "";
120
127
  const n = e;
@@ -125,10 +132,11 @@ function $(t) {
125
132
  }
126
133
  export {
127
134
  g as ARTIFACT_BLOCKS_CHANGED,
135
+ m as ARTIFACT_BLOCKS_STORAGE_KEY,
128
136
  w as ARTIFACT_DESTINATIONS,
129
- $ as assistantPartsToMarkdown,
137
+ T as assistantPartsToMarkdown,
130
138
  b as findDuplicateArtifactBlock,
131
139
  h as readSavedArtifactBlocks,
132
- A as saveArtifactBlock,
133
- S as suggestedSectionForKind
140
+ S as saveArtifactBlock,
141
+ A as suggestedSectionForKind
134
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
+ };
package/lib/icons.d.ts CHANGED
@@ -145,6 +145,22 @@ export declare const TextFont: React.ForwardRefExoticComponent<Omit<import('@pho
145
145
  /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
146
146
  strokeWidth?: number;
147
147
  } & React.RefAttributes<SVGSVGElement>>;
148
+ export declare const TextBold: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
149
+ /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
150
+ strokeWidth?: number;
151
+ } & React.RefAttributes<SVGSVGElement>>;
152
+ export declare const TextItalicStyle: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
153
+ /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
154
+ strokeWidth?: number;
155
+ } & React.RefAttributes<SVGSVGElement>>;
156
+ export declare const TextStrike: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
157
+ /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
158
+ strokeWidth?: number;
159
+ } & React.RefAttributes<SVGSVGElement>>;
160
+ export declare const TextUnderlineStyle: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
161
+ /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
162
+ strokeWidth?: number;
163
+ } & React.RefAttributes<SVGSVGElement>>;
148
164
  export declare const ToggleOn: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
149
165
  /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
150
166
  strokeWidth?: number;
@@ -233,6 +249,10 @@ export declare const Warning: React.ForwardRefExoticComponent<Omit<import('@phos
233
249
  /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
234
250
  strokeWidth?: number;
235
251
  } & React.RefAttributes<SVGSVGElement>>;
252
+ export declare const Bell: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
253
+ /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
254
+ strokeWidth?: number;
255
+ } & React.RefAttributes<SVGSVGElement>>;
236
256
  export declare const WarningCircle: React.ForwardRefExoticComponent<Omit<import('@phosphor-icons/react').IconProps, "ref"> & {
237
257
  /** Legacy Hugeicons prop — `>= 2` maps to weight="bold", else ignored. */
238
258
  strokeWidth?: number;