@voltro/ui 0.53.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +335 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +548 -470
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,85 +1,159 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useComments as
|
|
5
|
-
//#region src/
|
|
6
|
-
var
|
|
1
|
+
import { Fragment as e, createContext as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
+
import { FORM_KEY_FIELD as c, FORM_REDIRECT_FIELD as l, FormBindingProvider as u, formActionPath as d, formSections as f, isRichTextDocument as p, isSafeHref as m, parseRichText as ee, serializeRichText as h, useAgentChat as g, useConnection as te, useDataCopilot as _, useDataTable as ne, useFormBinding as re, useFormFlash as ie, useFormSkeleton as ae, useQueryField as oe, useQueryFilters as se, useRecord as ce, useTableSkeleton as le, useWorkflowRunState as v } from "@voltro/client";
|
|
3
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
4
|
+
import { useComments as ue } from "@voltro/plugin-comments/web";
|
|
5
|
+
//#region src/richText.tsx
|
|
6
|
+
var de = (t, n) => {
|
|
7
|
+
let r = t.marks ?? [], i = t.text;
|
|
8
|
+
return r.includes("code") && (i = /* @__PURE__ */ b("code", { children: i }, n)), r.includes("italic") && (i = /* @__PURE__ */ b("em", { children: i }, n)), r.includes("strike") && (i = /* @__PURE__ */ b("s", { children: i }, n)), r.includes("bold") && (i = /* @__PURE__ */ b("strong", { children: i }, n)), /* @__PURE__ */ b(e, { children: i }, n);
|
|
9
|
+
}, S = (t) => t.map((t, n) => {
|
|
10
|
+
if (t.type === "link") {
|
|
11
|
+
let r = t.content.map((e) => e.text).join("");
|
|
12
|
+
return m(t.href) ? /* @__PURE__ */ b("a", {
|
|
13
|
+
href: t.href,
|
|
14
|
+
rel: "noopener noreferrer nofollow",
|
|
15
|
+
children: r
|
|
16
|
+
}, n) : /* @__PURE__ */ b(e, { children: r }, n);
|
|
17
|
+
}
|
|
18
|
+
return de(t, n);
|
|
19
|
+
}), fe = (e, t) => {
|
|
20
|
+
switch (e.type) {
|
|
21
|
+
case "heading": {
|
|
22
|
+
let n = [
|
|
23
|
+
"h1",
|
|
24
|
+
"h2",
|
|
25
|
+
"h3"
|
|
26
|
+
][e.level - 1] ?? "h3";
|
|
27
|
+
return /* @__PURE__ */ b(n, { children: S(e.content) }, t);
|
|
28
|
+
}
|
|
29
|
+
case "blockquote": return /* @__PURE__ */ b("blockquote", { children: S(e.content) }, t);
|
|
30
|
+
case "bulletList": return /* @__PURE__ */ b("ul", { children: e.content.map((e, t) => /* @__PURE__ */ b("li", { children: S(e.content) }, t)) }, t);
|
|
31
|
+
case "orderedList": return /* @__PURE__ */ b("ol", { children: e.content.map((e, t) => /* @__PURE__ */ b("li", { children: S(e.content) }, t)) }, t);
|
|
32
|
+
case "codeBlock": return /* @__PURE__ */ b("pre", { children: /* @__PURE__ */ b("code", { children: e.text }) }, t);
|
|
33
|
+
default: return /* @__PURE__ */ b("p", { children: S(e.content) }, t);
|
|
34
|
+
}
|
|
35
|
+
}, pe = (e) => p(e.doc) ? /* @__PURE__ */ b(y, { children: e.doc.content.map((e, t) => fe(e, t)) }) : null, C = (e) => {
|
|
36
|
+
let t = i(), [n, a] = s(() => h(e.value)), c = o(e.value);
|
|
37
|
+
r(() => {
|
|
38
|
+
e.value !== c.current && JSON.stringify(e.value) !== JSON.stringify(c.current) && (c.current = e.value, a(h(e.value)));
|
|
39
|
+
}, [e.value]);
|
|
40
|
+
let l = [e.description === void 0 ? "" : `${t}-desc`, e.error === void 0 ? "" : `${t}-error`].filter(Boolean).join(" ");
|
|
41
|
+
return /* @__PURE__ */ x("div", {
|
|
42
|
+
"data-voltro-field": !0,
|
|
43
|
+
"data-voltro-rich-text": !0,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ x("label", {
|
|
46
|
+
htmlFor: t,
|
|
47
|
+
children: [e.label, e.required ? /* @__PURE__ */ b("span", {
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
children: " *"
|
|
50
|
+
}) : null]
|
|
51
|
+
}),
|
|
52
|
+
e.description === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
53
|
+
id: `${t}-desc`,
|
|
54
|
+
"data-voltro-field-hint": !0,
|
|
55
|
+
children: e.description
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ b("textarea", {
|
|
58
|
+
id: t,
|
|
59
|
+
name: e.name,
|
|
60
|
+
value: n,
|
|
61
|
+
onChange: (t) => {
|
|
62
|
+
a(t.target.value);
|
|
63
|
+
let n = ee(t.target.value);
|
|
64
|
+
c.current = n, e.onChange(n);
|
|
65
|
+
},
|
|
66
|
+
onBlur: e.onBlur,
|
|
67
|
+
disabled: e.disabled,
|
|
68
|
+
required: e.required,
|
|
69
|
+
"aria-required": e.required ? !0 : void 0,
|
|
70
|
+
"aria-invalid": e.error !== void 0,
|
|
71
|
+
"aria-describedby": l === "" ? void 0 : l
|
|
72
|
+
}),
|
|
73
|
+
e.error === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
74
|
+
id: `${t}-error`,
|
|
75
|
+
role: "alert",
|
|
76
|
+
children: e.error
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}, w = (e) => e == null ? "" : String(e), T = ({ required: e }) => e ? /* @__PURE__ */ b("span", {
|
|
7
81
|
"aria-hidden": "true",
|
|
8
82
|
children: " *"
|
|
9
|
-
}) : null,
|
|
83
|
+
}) : null, E = (e) => /* @__PURE__ */ x("div", {
|
|
10
84
|
"data-voltro-field": !0,
|
|
11
85
|
children: [
|
|
12
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ x("label", {
|
|
13
87
|
htmlFor: e.id,
|
|
14
|
-
children: [e.label, /* @__PURE__ */
|
|
88
|
+
children: [e.label, /* @__PURE__ */ b(T, { required: e.required })]
|
|
15
89
|
}),
|
|
16
|
-
e.description === void 0 ? null : /* @__PURE__ */
|
|
90
|
+
e.description === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
17
91
|
id: `${e.id}-desc`,
|
|
18
92
|
"data-voltro-field-hint": !0,
|
|
19
93
|
children: e.description
|
|
20
94
|
}),
|
|
21
95
|
e.children,
|
|
22
|
-
e.error === void 0 ? null : /* @__PURE__ */
|
|
96
|
+
e.error === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
23
97
|
id: `${e.id}-error`,
|
|
24
98
|
role: "alert",
|
|
25
99
|
children: e.error
|
|
26
100
|
})
|
|
27
101
|
]
|
|
28
|
-
}),
|
|
102
|
+
}), D = (e, t, n) => {
|
|
29
103
|
let r = [t === void 0 ? "" : `${e}-desc`, n === void 0 ? "" : `${e}-error`].filter(Boolean);
|
|
30
104
|
return r.length > 0 ? r.join(" ") : void 0;
|
|
31
|
-
},
|
|
32
|
-
let
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
id:
|
|
35
|
-
label:
|
|
36
|
-
required:
|
|
37
|
-
description:
|
|
38
|
-
error:
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
id:
|
|
105
|
+
}, O = (e) => e ? !0 : void 0, k = (e, t) => (n) => {
|
|
106
|
+
let r = i();
|
|
107
|
+
return /* @__PURE__ */ b(E, {
|
|
108
|
+
id: r,
|
|
109
|
+
label: n.label,
|
|
110
|
+
required: n.required,
|
|
111
|
+
description: n.description,
|
|
112
|
+
error: n.error,
|
|
113
|
+
children: /* @__PURE__ */ b("input", {
|
|
114
|
+
id: r,
|
|
41
115
|
type: e,
|
|
42
|
-
name:
|
|
43
|
-
value:
|
|
44
|
-
onChange: (e) =>
|
|
45
|
-
onBlur:
|
|
46
|
-
disabled:
|
|
47
|
-
required:
|
|
48
|
-
"aria-required":
|
|
49
|
-
"aria-invalid":
|
|
50
|
-
"aria-describedby":
|
|
116
|
+
name: n.name,
|
|
117
|
+
value: w(n.value),
|
|
118
|
+
onChange: (e) => n.onChange(t(e.target.value)),
|
|
119
|
+
onBlur: n.onBlur,
|
|
120
|
+
disabled: n.disabled,
|
|
121
|
+
required: n.required,
|
|
122
|
+
"aria-required": O(n.required),
|
|
123
|
+
"aria-invalid": n.error !== void 0,
|
|
124
|
+
"aria-describedby": D(r, n.description, n.error)
|
|
51
125
|
})
|
|
52
126
|
});
|
|
53
|
-
},
|
|
54
|
-
let t =
|
|
55
|
-
return /* @__PURE__ */
|
|
127
|
+
}, me = (e) => {
|
|
128
|
+
let t = i();
|
|
129
|
+
return /* @__PURE__ */ b(E, {
|
|
56
130
|
id: t,
|
|
57
131
|
label: e.label,
|
|
58
132
|
required: e.required,
|
|
59
133
|
description: e.description,
|
|
60
134
|
error: e.error,
|
|
61
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ b("textarea", {
|
|
62
136
|
id: t,
|
|
63
137
|
name: e.name,
|
|
64
|
-
value:
|
|
138
|
+
value: w(e.value),
|
|
65
139
|
onChange: (t) => e.onChange(t.target.value),
|
|
66
140
|
disabled: e.disabled,
|
|
67
141
|
onBlur: e.onBlur,
|
|
68
142
|
required: e.required,
|
|
69
|
-
"aria-required":
|
|
143
|
+
"aria-required": O(e.required),
|
|
70
144
|
"aria-invalid": e.error !== void 0,
|
|
71
|
-
"aria-describedby":
|
|
145
|
+
"aria-describedby": D(t, e.description, e.error)
|
|
72
146
|
})
|
|
73
147
|
});
|
|
74
|
-
},
|
|
75
|
-
let t =
|
|
76
|
-
return /* @__PURE__ */
|
|
148
|
+
}, A = (e) => {
|
|
149
|
+
let t = i();
|
|
150
|
+
return /* @__PURE__ */ b(E, {
|
|
77
151
|
id: t,
|
|
78
152
|
label: e.label,
|
|
79
153
|
required: e.required,
|
|
80
154
|
description: e.description,
|
|
81
155
|
error: e.error,
|
|
82
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ b("input", {
|
|
83
157
|
id: t,
|
|
84
158
|
type: "checkbox",
|
|
85
159
|
name: e.name,
|
|
@@ -87,115 +161,115 @@ var y = (e) => e == null ? "" : String(e), b = ({ required: e }) => e ? /* @__PU
|
|
|
87
161
|
onChange: (t) => e.onChange(t.target.checked),
|
|
88
162
|
disabled: e.disabled,
|
|
89
163
|
onBlur: e.onBlur,
|
|
90
|
-
"aria-required":
|
|
164
|
+
"aria-required": O(e.required),
|
|
91
165
|
"aria-invalid": e.error !== void 0,
|
|
92
|
-
"aria-describedby":
|
|
166
|
+
"aria-describedby": D(t, e.description, e.error)
|
|
93
167
|
})
|
|
94
168
|
});
|
|
95
|
-
},
|
|
96
|
-
let t =
|
|
97
|
-
return /* @__PURE__ */
|
|
169
|
+
}, he = (e) => {
|
|
170
|
+
let t = i();
|
|
171
|
+
return /* @__PURE__ */ b(E, {
|
|
98
172
|
id: t,
|
|
99
173
|
label: e.label,
|
|
100
174
|
required: e.required,
|
|
101
175
|
description: e.description,
|
|
102
176
|
error: e.error,
|
|
103
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ x("select", {
|
|
104
178
|
id: t,
|
|
105
179
|
name: e.name,
|
|
106
|
-
value:
|
|
180
|
+
value: w(e.value),
|
|
107
181
|
onChange: (t) => e.onChange(t.target.value),
|
|
108
182
|
disabled: e.disabled,
|
|
109
183
|
onBlur: e.onBlur,
|
|
110
184
|
required: e.required,
|
|
111
|
-
"aria-required":
|
|
185
|
+
"aria-required": O(e.required),
|
|
112
186
|
"aria-invalid": e.error !== void 0,
|
|
113
|
-
"aria-describedby":
|
|
114
|
-
children: [/* @__PURE__ */
|
|
187
|
+
"aria-describedby": D(t, e.description, e.error),
|
|
188
|
+
children: [/* @__PURE__ */ b("option", {
|
|
115
189
|
value: "",
|
|
116
190
|
children: "—"
|
|
117
|
-
}), (e.options ?? []).map((e) => /* @__PURE__ */
|
|
191
|
+
}), (e.options ?? []).map((e) => /* @__PURE__ */ b("option", {
|
|
118
192
|
value: e.value,
|
|
119
193
|
children: e.label
|
|
120
194
|
}, e.value))]
|
|
121
195
|
})
|
|
122
196
|
});
|
|
123
|
-
},
|
|
124
|
-
let t =
|
|
125
|
-
return /* @__PURE__ */
|
|
197
|
+
}, ge = (e) => {
|
|
198
|
+
let t = i();
|
|
199
|
+
return /* @__PURE__ */ x("fieldset", {
|
|
126
200
|
"data-voltro-field": !0,
|
|
127
201
|
"aria-invalid": e.error !== void 0,
|
|
128
|
-
"aria-required":
|
|
129
|
-
"aria-describedby":
|
|
202
|
+
"aria-required": O(e.required),
|
|
203
|
+
"aria-describedby": D(t, e.description, e.error),
|
|
130
204
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
e.description === void 0 ? null : /* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ x("legend", { children: [e.label, /* @__PURE__ */ b(T, { required: e.required })] }),
|
|
206
|
+
e.description === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
133
207
|
id: `${t}-desc`,
|
|
134
208
|
"data-voltro-field-hint": !0,
|
|
135
209
|
children: e.description
|
|
136
210
|
}),
|
|
137
211
|
(e.options ?? []).map((n) => {
|
|
138
212
|
let r = `${t}-${n.value}`;
|
|
139
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ x("span", { children: [/* @__PURE__ */ b("input", {
|
|
140
214
|
id: r,
|
|
141
215
|
type: "radio",
|
|
142
216
|
name: e.name,
|
|
143
217
|
value: n.value,
|
|
144
|
-
checked:
|
|
218
|
+
checked: w(e.value) === n.value,
|
|
145
219
|
onChange: () => e.onChange(n.value),
|
|
146
220
|
disabled: e.disabled,
|
|
147
221
|
onBlur: e.onBlur
|
|
148
|
-
}), /* @__PURE__ */
|
|
222
|
+
}), /* @__PURE__ */ b("label", {
|
|
149
223
|
htmlFor: r,
|
|
150
224
|
children: n.label
|
|
151
225
|
})] }, n.value);
|
|
152
226
|
}),
|
|
153
|
-
e.error === void 0 ? null : /* @__PURE__ */
|
|
227
|
+
e.error === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
154
228
|
id: `${t}-error`,
|
|
155
229
|
role: "alert",
|
|
156
230
|
children: e.error
|
|
157
231
|
})
|
|
158
232
|
]
|
|
159
233
|
});
|
|
160
|
-
},
|
|
161
|
-
let t =
|
|
162
|
-
return /* @__PURE__ */
|
|
234
|
+
}, _e = (e) => {
|
|
235
|
+
let t = i(), n = Array.isArray(e.value) ? e.value.map(String) : [];
|
|
236
|
+
return /* @__PURE__ */ b(E, {
|
|
163
237
|
id: t,
|
|
164
238
|
label: e.label,
|
|
165
239
|
required: e.required,
|
|
166
240
|
description: e.description,
|
|
167
241
|
error: e.error,
|
|
168
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ b("select", {
|
|
169
243
|
id: t,
|
|
170
244
|
name: e.name,
|
|
171
245
|
multiple: !0,
|
|
172
|
-
value:
|
|
246
|
+
value: n,
|
|
173
247
|
onChange: (t) => e.onChange(Array.from(t.target.selectedOptions, (e) => e.value)),
|
|
174
248
|
disabled: e.disabled,
|
|
175
249
|
onBlur: e.onBlur,
|
|
176
|
-
"aria-required":
|
|
250
|
+
"aria-required": O(e.required),
|
|
177
251
|
"aria-invalid": e.error !== void 0,
|
|
178
|
-
"aria-describedby":
|
|
179
|
-
children: (e.options ?? []).map((e) => /* @__PURE__ */
|
|
252
|
+
"aria-describedby": D(t, e.description, e.error),
|
|
253
|
+
children: (e.options ?? []).map((e) => /* @__PURE__ */ b("option", {
|
|
180
254
|
value: e.value,
|
|
181
255
|
children: e.label
|
|
182
256
|
}, e.value))
|
|
183
257
|
})
|
|
184
258
|
});
|
|
185
|
-
},
|
|
259
|
+
}, ve = (e) => /* @__PURE__ */ b("input", {
|
|
186
260
|
type: "hidden",
|
|
187
261
|
name: e.name,
|
|
188
|
-
value:
|
|
262
|
+
value: w(e.value),
|
|
189
263
|
readOnly: !0
|
|
190
|
-
}),
|
|
191
|
-
let t =
|
|
192
|
-
return /* @__PURE__ */
|
|
264
|
+
}), ye = (e) => {
|
|
265
|
+
let t = i();
|
|
266
|
+
return /* @__PURE__ */ b(E, {
|
|
193
267
|
id: t,
|
|
194
268
|
label: e.label,
|
|
195
269
|
required: e.required,
|
|
196
270
|
description: e.description,
|
|
197
271
|
error: e.error,
|
|
198
|
-
children: /* @__PURE__ */
|
|
272
|
+
children: /* @__PURE__ */ b("input", {
|
|
199
273
|
id: t,
|
|
200
274
|
type: "file",
|
|
201
275
|
name: e.name,
|
|
@@ -203,50 +277,51 @@ var y = (e) => e == null ? "" : String(e), b = ({ required: e }) => e ? /* @__PU
|
|
|
203
277
|
disabled: e.disabled,
|
|
204
278
|
onBlur: e.onBlur,
|
|
205
279
|
required: e.required,
|
|
206
|
-
"aria-required":
|
|
280
|
+
"aria-required": O(e.required),
|
|
207
281
|
"aria-invalid": e.error !== void 0,
|
|
208
|
-
"aria-describedby":
|
|
282
|
+
"aria-describedby": D(t, e.description, e.error)
|
|
209
283
|
})
|
|
210
284
|
});
|
|
211
|
-
},
|
|
285
|
+
}, j = (e) => /* @__PURE__ */ x("div", {
|
|
212
286
|
"data-voltro-field": !0,
|
|
213
287
|
"data-voltro-custom": !0,
|
|
214
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ x("label", { children: [e.label, /* @__PURE__ */ b(T, { required: e.required })] }), /* @__PURE__ */ b("p", {
|
|
215
289
|
role: "note",
|
|
216
290
|
children: `No default widget for "${e.name}" — provide a render-prop via <Field>.`
|
|
217
291
|
})]
|
|
218
|
-
}),
|
|
219
|
-
text:
|
|
220
|
-
number:
|
|
221
|
-
date:
|
|
222
|
-
datetime:
|
|
223
|
-
daterange:
|
|
224
|
-
file:
|
|
225
|
-
"async-select":
|
|
226
|
-
textarea:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
292
|
+
}), M = {
|
|
293
|
+
text: k("text", (e) => e),
|
|
294
|
+
number: k("number", (e) => e === "" ? void 0 : Number(e)),
|
|
295
|
+
date: k("date", (e) => e),
|
|
296
|
+
datetime: k("datetime-local", (e) => e),
|
|
297
|
+
daterange: k("text", (e) => e),
|
|
298
|
+
file: ye,
|
|
299
|
+
"async-select": k("text", (e) => e),
|
|
300
|
+
textarea: me,
|
|
301
|
+
"rich-text": C,
|
|
302
|
+
checkbox: A,
|
|
303
|
+
switch: A,
|
|
304
|
+
select: he,
|
|
305
|
+
radio: ge,
|
|
306
|
+
"multi-select": _e,
|
|
307
|
+
hidden: ve,
|
|
308
|
+
array: j,
|
|
309
|
+
reference: j,
|
|
310
|
+
custom: j
|
|
311
|
+
}, N = t({}), be = (e) => {
|
|
312
|
+
let t = n(N), r = a(() => ({
|
|
313
|
+
...t,
|
|
239
314
|
...e.widgets
|
|
240
|
-
}), [
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
-
value:
|
|
315
|
+
}), [t, e.widgets]);
|
|
316
|
+
return /* @__PURE__ */ b(N.Provider, {
|
|
317
|
+
value: r,
|
|
243
318
|
children: e.children
|
|
244
319
|
});
|
|
245
|
-
},
|
|
246
|
-
let e =
|
|
320
|
+
}, P = (e) => n(N)[e] ?? M[e] ?? M.custom, F = t(null), xe = () => {
|
|
321
|
+
let e = n(F);
|
|
247
322
|
if (e === null) throw Error("<Field> must be rendered inside <AutoForm>");
|
|
248
323
|
return e;
|
|
249
|
-
},
|
|
324
|
+
}, Se = (e, t) => {
|
|
250
325
|
let n = e.field(t.name);
|
|
251
326
|
return {
|
|
252
327
|
name: t.name,
|
|
@@ -261,14 +336,14 @@ var y = (e) => e == null ? "" : String(e), b = ({ required: e }) => e ? /* @__PU
|
|
|
261
336
|
...n.description === void 0 ? {} : { description: n.description },
|
|
262
337
|
...t.reference === void 0 ? {} : { reference: t.reference }
|
|
263
338
|
};
|
|
264
|
-
},
|
|
265
|
-
let n =
|
|
339
|
+
}, I = ({ name: e, children: t }) => {
|
|
340
|
+
let n = xe(), r = n.fields.find((t) => t.name === e), i = P(r?.widget ?? "custom");
|
|
266
341
|
if (r === void 0) return null;
|
|
267
|
-
let a =
|
|
268
|
-
return t ? t(a) : /* @__PURE__ */
|
|
342
|
+
let a = Se(n, r);
|
|
343
|
+
return t ? t(a) : /* @__PURE__ */ b(i, { ...a });
|
|
269
344
|
};
|
|
270
|
-
function
|
|
271
|
-
let t = e.formKey ?? e.mutation, n =
|
|
345
|
+
function Ce(e) {
|
|
346
|
+
let t = e.formKey ?? e.mutation, n = ie(t), r = re(e.api, e.mutation, {
|
|
272
347
|
...e.schema ? { schema: e.schema } : {},
|
|
273
348
|
...e.defaults ? { defaults: e.defaults } : {},
|
|
274
349
|
...n === void 0 ? {} : { flash: n }
|
|
@@ -277,48 +352,51 @@ function he(e) {
|
|
|
277
352
|
t !== void 0 && e.onSuccess && e.onSuccess(t);
|
|
278
353
|
});
|
|
279
354
|
};
|
|
280
|
-
return /* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
children: /* @__PURE__ */
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
e.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
children
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
355
|
+
return /* @__PURE__ */ b(u, {
|
|
356
|
+
binding: r,
|
|
357
|
+
children: /* @__PURE__ */ b(F.Provider, {
|
|
358
|
+
value: r,
|
|
359
|
+
children: /* @__PURE__ */ x("form", {
|
|
360
|
+
...e.action === !1 ? {} : {
|
|
361
|
+
action: d(e.mutation),
|
|
362
|
+
method: "post"
|
|
363
|
+
},
|
|
364
|
+
onSubmit: i,
|
|
365
|
+
noValidate: !0,
|
|
366
|
+
"data-voltro-autoform": e.mutation,
|
|
367
|
+
children: [
|
|
368
|
+
e.action === !1 ? null : /* @__PURE__ */ b("input", {
|
|
369
|
+
type: "hidden",
|
|
370
|
+
name: c,
|
|
371
|
+
value: t
|
|
372
|
+
}),
|
|
373
|
+
e.action === !1 || e.redirectTo === void 0 ? null : /* @__PURE__ */ b("input", {
|
|
374
|
+
type: "hidden",
|
|
375
|
+
name: l,
|
|
376
|
+
value: e.redirectTo
|
|
377
|
+
}),
|
|
378
|
+
e.children ? e.children(r) : f(r.fields).map((e, t) => e.name === void 0 ? e.fields.map((e) => /* @__PURE__ */ b(I, { name: e.name }, e.name)) : /* @__PURE__ */ x("fieldset", {
|
|
379
|
+
"data-voltro-section": e.name,
|
|
380
|
+
children: [/* @__PURE__ */ b("legend", { children: e.label ?? e.name }), e.fields.map((e) => /* @__PURE__ */ b(I, { name: e.name }, e.name))]
|
|
381
|
+
}, e.name)),
|
|
382
|
+
r.formError === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
383
|
+
role: "alert",
|
|
384
|
+
"data-voltro-form-error": "",
|
|
385
|
+
children: r.formError
|
|
386
|
+
}),
|
|
387
|
+
/* @__PURE__ */ b("button", {
|
|
388
|
+
type: "submit",
|
|
389
|
+
disabled: r.pending,
|
|
390
|
+
children: e.submitLabel ?? "Submit"
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
})
|
|
316
394
|
})
|
|
317
395
|
});
|
|
318
396
|
}
|
|
319
397
|
//#endregion
|
|
320
398
|
//#region src/strings.tsx
|
|
321
|
-
var
|
|
399
|
+
var L = {
|
|
322
400
|
filters: {
|
|
323
401
|
clear: "Clear",
|
|
324
402
|
filtersLabel: "Filters",
|
|
@@ -395,7 +473,7 @@ var M = {
|
|
|
395
473
|
howToGetToken: "How do I get a token?",
|
|
396
474
|
loading: "Loading…"
|
|
397
475
|
}
|
|
398
|
-
},
|
|
476
|
+
}, R = t(L), we = (e, t) => ({
|
|
399
477
|
filters: {
|
|
400
478
|
...e.filters,
|
|
401
479
|
...t.filters
|
|
@@ -441,138 +519,138 @@ var M = {
|
|
|
441
519
|
...t.connectAccount
|
|
442
520
|
}
|
|
443
521
|
});
|
|
444
|
-
function
|
|
445
|
-
let
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
value:
|
|
522
|
+
function Te(e) {
|
|
523
|
+
let t = n(R), r = a(() => we(t, e.strings), [t, e.strings]);
|
|
524
|
+
return /* @__PURE__ */ b(R.Provider, {
|
|
525
|
+
value: r,
|
|
448
526
|
children: e.children
|
|
449
527
|
});
|
|
450
528
|
}
|
|
451
|
-
var
|
|
452
|
-
let t =
|
|
529
|
+
var z = () => n(R), Ee = (e) => {
|
|
530
|
+
let t = oe(e.api, e.source, {
|
|
453
531
|
skipUntilTerm: !0,
|
|
454
532
|
...e.labelField === void 0 ? {} : { labelField: e.labelField },
|
|
455
533
|
...e.valueField === void 0 ? {} : { valueField: e.valueField },
|
|
456
534
|
...e.input === void 0 ? {} : { input: e.input },
|
|
457
535
|
...e.debounceMs === void 0 ? {} : { debounceMs: e.debounceMs }
|
|
458
|
-
}),
|
|
459
|
-
return /* @__PURE__ */
|
|
536
|
+
}), n = z().asyncSelect, r = i(), a = e.value === void 0 || e.value === null ? "" : String(e.value), o = a !== "" && t.options.some((e) => e.value === a), s = `${r}-error`;
|
|
537
|
+
return /* @__PURE__ */ x("div", {
|
|
460
538
|
"data-voltro-field": !0,
|
|
461
539
|
"data-voltro-async-select": !0,
|
|
462
540
|
children: [
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
htmlFor:
|
|
541
|
+
/* @__PURE__ */ x("label", {
|
|
542
|
+
htmlFor: r,
|
|
465
543
|
children: [e.label, e.required ? " *" : ""]
|
|
466
544
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ b("input", {
|
|
468
546
|
type: "search",
|
|
469
|
-
"aria-label":
|
|
470
|
-
placeholder:
|
|
547
|
+
"aria-label": n.searchLabel(e.label),
|
|
548
|
+
placeholder: n.searchPlaceholder,
|
|
471
549
|
onChange: (e) => t.search(e.target.value),
|
|
472
550
|
disabled: e.disabled
|
|
473
551
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
id:
|
|
552
|
+
/* @__PURE__ */ x("select", {
|
|
553
|
+
id: r,
|
|
476
554
|
name: e.name,
|
|
477
555
|
value: a,
|
|
478
556
|
onChange: (t) => e.onChange(t.target.value),
|
|
479
557
|
disabled: e.disabled,
|
|
480
558
|
required: e.required,
|
|
481
559
|
"aria-invalid": e.error !== void 0,
|
|
482
|
-
"aria-describedby": e.error === void 0 ? void 0 :
|
|
560
|
+
"aria-describedby": e.error === void 0 ? void 0 : s,
|
|
483
561
|
"aria-busy": t.loading,
|
|
484
562
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ b("option", {
|
|
486
564
|
value: "",
|
|
487
|
-
children: t.loading ?
|
|
565
|
+
children: t.loading ? n.loading : n.empty
|
|
488
566
|
}),
|
|
489
|
-
a !== "" && !
|
|
567
|
+
a !== "" && !o ? /* @__PURE__ */ b("option", {
|
|
490
568
|
value: a,
|
|
491
569
|
children: a
|
|
492
570
|
}) : null,
|
|
493
|
-
t.options.map((e) => /* @__PURE__ */
|
|
571
|
+
t.options.map((e) => /* @__PURE__ */ b("option", {
|
|
494
572
|
value: e.value,
|
|
495
573
|
children: e.label
|
|
496
574
|
}, e.value))
|
|
497
575
|
]
|
|
498
576
|
}),
|
|
499
|
-
e.error === void 0 ? null : /* @__PURE__ */
|
|
500
|
-
id:
|
|
577
|
+
e.error === void 0 ? null : /* @__PURE__ */ b("p", {
|
|
578
|
+
id: s,
|
|
501
579
|
role: "alert",
|
|
502
580
|
children: e.error
|
|
503
581
|
})
|
|
504
582
|
]
|
|
505
583
|
});
|
|
506
|
-
},
|
|
507
|
-
function
|
|
508
|
-
let { api: t, query: n, emptyText: r, loadingText: i, loadMoreText:
|
|
509
|
-
return
|
|
584
|
+
}, De = (e) => e == null ? "" : typeof e == "boolean" ? e ? "✓" : "✗" : String(e), Oe = (e, t) => e ? t === "asc" ? "ascending" : "descending" : "none";
|
|
585
|
+
function ke(e) {
|
|
586
|
+
let { api: t, query: n, emptyText: r, loadingText: i, loadMoreText: a, renderCell: o, rowActions: s, rowKey: c, ...l } = e, u = z().dataTable, d = ne(t, n, l);
|
|
587
|
+
return d.loading ? /* @__PURE__ */ b("p", {
|
|
510
588
|
"data-voltro-datatable-loading": !0,
|
|
511
589
|
"aria-busy": "true",
|
|
512
590
|
children: i ?? "Loading…"
|
|
513
|
-
}) :
|
|
591
|
+
}) : d.rows.length === 0 ? /* @__PURE__ */ b("p", {
|
|
514
592
|
"data-voltro-datatable-empty": !0,
|
|
515
593
|
children: r ?? "No rows."
|
|
516
|
-
}) : /* @__PURE__ */
|
|
594
|
+
}) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("table", {
|
|
517
595
|
"data-voltro-datatable": n,
|
|
518
|
-
children: [/* @__PURE__ */
|
|
519
|
-
let t =
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
"aria-sort":
|
|
596
|
+
children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ x("tr", { children: [d.columns.map((e) => {
|
|
597
|
+
let t = d.sort?.column === e.name, n = d.sort?.direction ?? "asc";
|
|
598
|
+
return /* @__PURE__ */ b("th", {
|
|
599
|
+
"aria-sort": Oe(t, n),
|
|
522
600
|
scope: "col",
|
|
523
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ x("button", {
|
|
524
602
|
type: "button",
|
|
525
|
-
onClick: () =>
|
|
603
|
+
onClick: () => d.toggleSort(e.name),
|
|
526
604
|
children: [e.label, t ? n === "asc" ? " ▲" : " ▼" : ""]
|
|
527
605
|
})
|
|
528
606
|
}, e.name);
|
|
529
|
-
}),
|
|
607
|
+
}), s ? /* @__PURE__ */ b("th", {
|
|
530
608
|
scope: "col",
|
|
531
|
-
children:
|
|
532
|
-
}) : null] }) }), /* @__PURE__ */
|
|
609
|
+
children: u.actions
|
|
610
|
+
}) : null] }) }), /* @__PURE__ */ b("tbody", { children: d.rows.map((e, t) => /* @__PURE__ */ x("tr", { children: [d.columns.map((t) => /* @__PURE__ */ b("td", {
|
|
533
611
|
"data-column": t.name,
|
|
534
|
-
children:
|
|
535
|
-
}, t.name)),
|
|
536
|
-
}),
|
|
612
|
+
children: o ? o(e, t) : De(e[t.name])
|
|
613
|
+
}, t.name)), s ? /* @__PURE__ */ b("td", { children: s(e) }) : null] }, c ? c(e) : String(e.id ?? t))) })]
|
|
614
|
+
}), d.hasMore ? /* @__PURE__ */ b("button", {
|
|
537
615
|
type: "button",
|
|
538
616
|
"data-voltro-datatable-more": !0,
|
|
539
|
-
onClick: () =>
|
|
540
|
-
children:
|
|
617
|
+
onClick: () => d.loadMore(),
|
|
618
|
+
children: a ?? "Load more"
|
|
541
619
|
}) : null] });
|
|
542
620
|
}
|
|
543
621
|
//#endregion
|
|
544
622
|
//#region src/workflow.tsx
|
|
545
|
-
var
|
|
546
|
-
function
|
|
547
|
-
let { api: t, runId: n, loadingText: r, emptyText: i } = e, a =
|
|
548
|
-
return
|
|
623
|
+
var Ae = (e) => e === "succeeded" ? "✓" : e === "failed" ? "✗" : "…";
|
|
624
|
+
function je(e) {
|
|
625
|
+
let { api: t, runId: n, loadingText: r, emptyText: i } = e, a = z().workflow, o = v(t, n);
|
|
626
|
+
return o.loading ? /* @__PURE__ */ b("p", {
|
|
549
627
|
"data-voltro-workflow-loading": !0,
|
|
550
628
|
"aria-busy": "true",
|
|
551
629
|
children: r ?? a.loading
|
|
552
|
-
}) :
|
|
630
|
+
}) : o.steps.length === 0 ? /* @__PURE__ */ b("p", {
|
|
553
631
|
"data-voltro-workflow-empty": !0,
|
|
554
632
|
children: i ?? a.empty
|
|
555
|
-
}) : /* @__PURE__ */
|
|
633
|
+
}) : /* @__PURE__ */ b("ol", {
|
|
556
634
|
"data-voltro-workflow-progress": n,
|
|
557
|
-
"aria-busy":
|
|
558
|
-
children:
|
|
559
|
-
let t =
|
|
560
|
-
return /* @__PURE__ */
|
|
635
|
+
"aria-busy": o.status === "running" ? "true" : void 0,
|
|
636
|
+
children: o.steps.map((e) => {
|
|
637
|
+
let t = o.currentStep?.id === e.id;
|
|
638
|
+
return /* @__PURE__ */ x("li", {
|
|
561
639
|
"data-step": e.stepName,
|
|
562
640
|
"data-status": e.status,
|
|
563
641
|
"aria-current": t ? "step" : void 0,
|
|
564
642
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ b("span", {
|
|
566
644
|
"aria-hidden": "true",
|
|
567
|
-
children:
|
|
645
|
+
children: Ae(e.status)
|
|
568
646
|
}),
|
|
569
647
|
" ",
|
|
570
648
|
e.stepName,
|
|
571
|
-
e.attempt > 1 ? /* @__PURE__ */
|
|
649
|
+
e.attempt > 1 ? /* @__PURE__ */ x("span", {
|
|
572
650
|
"data-attempts": !0,
|
|
573
651
|
children: [" · ", a.attempt(e.attempt)]
|
|
574
652
|
}) : null,
|
|
575
|
-
e.durationMs === null ? null : /* @__PURE__ */
|
|
653
|
+
e.durationMs === null ? null : /* @__PURE__ */ x("span", {
|
|
576
654
|
"data-duration": !0,
|
|
577
655
|
children: [
|
|
578
656
|
" · ",
|
|
@@ -580,7 +658,7 @@ function xe(e) {
|
|
|
580
658
|
"ms"
|
|
581
659
|
]
|
|
582
660
|
}),
|
|
583
|
-
e.status === "failed" && e.errorMessage ? /* @__PURE__ */
|
|
661
|
+
e.status === "failed" && e.errorMessage ? /* @__PURE__ */ x("span", {
|
|
584
662
|
"data-step-error": !0,
|
|
585
663
|
children: [" · ", e.errorMessage]
|
|
586
664
|
}) : null
|
|
@@ -589,105 +667,105 @@ function xe(e) {
|
|
|
589
667
|
})
|
|
590
668
|
});
|
|
591
669
|
}
|
|
592
|
-
function
|
|
593
|
-
let { api: t, runId: n } = e, r =
|
|
594
|
-
if (i.loading || i.status === void 0) return /* @__PURE__ */
|
|
670
|
+
function Me(e) {
|
|
671
|
+
let { api: t, runId: n } = e, r = z().workflow, i = v(t, n);
|
|
672
|
+
if (i.loading || i.status === void 0) return /* @__PURE__ */ b("span", {
|
|
595
673
|
"data-voltro-workflow-badge": !0,
|
|
596
674
|
"data-status": "loading",
|
|
597
675
|
children: "…"
|
|
598
676
|
});
|
|
599
677
|
let a = i.status === "suspended" && i.waitingFor ? `${r.status.suspended} · ${i.waitingFor.name}` : r.status[i.status];
|
|
600
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ x("span", {
|
|
601
679
|
"data-voltro-workflow-badge": !0,
|
|
602
680
|
"data-status": i.status,
|
|
603
681
|
role: "status",
|
|
604
|
-
children: [a, i.error ? /* @__PURE__ */
|
|
682
|
+
children: [a, i.error ? /* @__PURE__ */ x("span", {
|
|
605
683
|
"data-error-detail": !0,
|
|
606
684
|
children: [i.error.step ? ` · ${i.error.step}` : "", i.traceId ? ` · voltro logs --trace ${i.traceId}` : ""]
|
|
607
685
|
}) : null]
|
|
608
686
|
});
|
|
609
687
|
}
|
|
610
|
-
function
|
|
611
|
-
let { when: t, onApprove: n, onReject: r, approveLabel: i, rejectLabel: a, pending:
|
|
612
|
-
return t ? /* @__PURE__ */
|
|
688
|
+
function Ne(e) {
|
|
689
|
+
let { when: t, onApprove: n, onReject: r, approveLabel: i, rejectLabel: a, pending: o } = e;
|
|
690
|
+
return t ? /* @__PURE__ */ x("div", {
|
|
613
691
|
"data-voltro-approval-controls": !0,
|
|
614
692
|
role: "group",
|
|
615
693
|
"aria-label": "Approval",
|
|
616
|
-
children: [/* @__PURE__ */
|
|
694
|
+
children: [/* @__PURE__ */ b("button", {
|
|
617
695
|
type: "button",
|
|
618
696
|
"data-approve": !0,
|
|
619
697
|
onClick: n,
|
|
620
|
-
disabled:
|
|
698
|
+
disabled: o,
|
|
621
699
|
children: i ?? "Approve"
|
|
622
|
-
}), /* @__PURE__ */
|
|
700
|
+
}), /* @__PURE__ */ b("button", {
|
|
623
701
|
type: "button",
|
|
624
702
|
"data-reject": !0,
|
|
625
703
|
onClick: r,
|
|
626
|
-
disabled:
|
|
704
|
+
disabled: o,
|
|
627
705
|
children: a ?? "Reject"
|
|
628
706
|
})]
|
|
629
707
|
}) : null;
|
|
630
708
|
}
|
|
631
709
|
//#endregion
|
|
632
710
|
//#region src/presence.tsx
|
|
633
|
-
var
|
|
711
|
+
var B = (e, t) => {
|
|
634
712
|
let n = e.meta?.[t];
|
|
635
713
|
return typeof n == "string" ? n : void 0;
|
|
636
|
-
},
|
|
714
|
+
}, V = (e) => B(e, "name") ?? B(e, "displayName") ?? e.key, H = (e) => {
|
|
637
715
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
638
716
|
return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
639
717
|
};
|
|
640
|
-
function
|
|
641
|
-
let { members: t, max: n = 5, nameOf: r =
|
|
642
|
-
return /* @__PURE__ */
|
|
718
|
+
function Pe(e) {
|
|
719
|
+
let { members: t, max: n = 5, nameOf: r = V, renderAvatar: i } = e, a = z().presence, o = t.slice(0, n), s = t.length - o.length;
|
|
720
|
+
return /* @__PURE__ */ x("div", {
|
|
643
721
|
"data-voltro-presence-avatars": !0,
|
|
644
722
|
role: "group",
|
|
645
723
|
"aria-label": a.onlineCount(t.length),
|
|
646
|
-
children: [
|
|
724
|
+
children: [o.map((e) => {
|
|
647
725
|
let t = r(e);
|
|
648
|
-
return i ? /* @__PURE__ */
|
|
726
|
+
return i ? /* @__PURE__ */ b("span", { children: i(e, t) }, e.key) : /* @__PURE__ */ b("span", {
|
|
649
727
|
"data-avatar": !0,
|
|
650
728
|
title: t,
|
|
651
729
|
"aria-label": t,
|
|
652
|
-
children:
|
|
730
|
+
children: H(t)
|
|
653
731
|
}, e.key);
|
|
654
|
-
}),
|
|
732
|
+
}), s > 0 ? /* @__PURE__ */ x("span", {
|
|
655
733
|
"data-avatar-overflow": !0,
|
|
656
|
-
"aria-label": a.moreOverflow(
|
|
657
|
-
children: ["+",
|
|
734
|
+
"aria-label": a.moreOverflow(s),
|
|
735
|
+
children: ["+", s]
|
|
658
736
|
}) : null]
|
|
659
737
|
});
|
|
660
738
|
}
|
|
661
|
-
var
|
|
662
|
-
function
|
|
663
|
-
let { members: t, selfKey: n, field: r, verb: i = "editing", nameOf: a =
|
|
664
|
-
return
|
|
739
|
+
var U = (e, t, n = L.presence) => e.length === 0 ? "" : e.length === 1 ? n.editingOne(e[0], t) : e.length === 2 ? n.editingTwo(e[0], e[1], t) : n.editingMany(e[0], e.length - 1, t);
|
|
740
|
+
function Fe(e) {
|
|
741
|
+
let { members: t, selfKey: n, field: r, verb: i = "editing", nameOf: a = V } = e, o = z().presence, s = t.filter((e) => !(n !== void 0 && e.key === n || r !== void 0 && B(e, "field") !== r));
|
|
742
|
+
return s.length === 0 ? null : /* @__PURE__ */ b("span", {
|
|
665
743
|
"data-voltro-editing-indicator": !0,
|
|
666
744
|
"data-field": r,
|
|
667
745
|
role: "status",
|
|
668
|
-
children:
|
|
746
|
+
children: U(s.map(a), i, o)
|
|
669
747
|
});
|
|
670
748
|
}
|
|
671
749
|
//#endregion
|
|
672
750
|
//#region src/agentChat.tsx
|
|
673
|
-
var
|
|
674
|
-
function
|
|
675
|
-
let t =
|
|
676
|
-
return /* @__PURE__ */
|
|
751
|
+
var W = (e) => typeof e.text == "string" ? e.text : "";
|
|
752
|
+
function Ie({ text: e }) {
|
|
753
|
+
let t = z().agentChat;
|
|
754
|
+
return /* @__PURE__ */ x("details", {
|
|
677
755
|
"data-part": "reasoning",
|
|
678
|
-
children: [/* @__PURE__ */
|
|
756
|
+
children: [/* @__PURE__ */ b("summary", { children: t.reasoning }), /* @__PURE__ */ b("span", { children: e })]
|
|
679
757
|
});
|
|
680
758
|
}
|
|
681
|
-
function
|
|
759
|
+
function G({ part: e }) {
|
|
682
760
|
switch (e.type) {
|
|
683
|
-
case "text": return /* @__PURE__ */
|
|
761
|
+
case "text": return /* @__PURE__ */ b("span", {
|
|
684
762
|
"data-part": "text",
|
|
685
|
-
children:
|
|
763
|
+
children: W(e)
|
|
686
764
|
});
|
|
687
|
-
case "reasoning": return /* @__PURE__ */
|
|
765
|
+
case "reasoning": return /* @__PURE__ */ b(Ie, { text: W(e) });
|
|
688
766
|
case "tool": {
|
|
689
767
|
let t = e;
|
|
690
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ x("span", {
|
|
691
769
|
"data-part": "tool",
|
|
692
770
|
"data-tool": t.toolName,
|
|
693
771
|
"data-state": t.state,
|
|
@@ -696,192 +774,192 @@ function H({ part: e }) {
|
|
|
696
774
|
}
|
|
697
775
|
case "source": {
|
|
698
776
|
let t = e;
|
|
699
|
-
return t.url ? /* @__PURE__ */
|
|
777
|
+
return t.url ? /* @__PURE__ */ b("a", {
|
|
700
778
|
"data-part": "source",
|
|
701
779
|
href: t.url,
|
|
702
780
|
rel: "noreferrer",
|
|
703
781
|
children: t.title ?? t.url
|
|
704
|
-
}) : /* @__PURE__ */
|
|
782
|
+
}) : /* @__PURE__ */ b("span", {
|
|
705
783
|
"data-part": "source",
|
|
706
784
|
children: t.title ?? t.id ?? "source"
|
|
707
785
|
});
|
|
708
786
|
}
|
|
709
787
|
case "file": {
|
|
710
788
|
let t = e;
|
|
711
|
-
return t.mediaType.startsWith("image/") ? /* @__PURE__ */
|
|
789
|
+
return t.mediaType.startsWith("image/") ? /* @__PURE__ */ b("img", {
|
|
712
790
|
"data-part": "file",
|
|
713
791
|
alt: "",
|
|
714
792
|
src: `data:${t.mediaType};base64,${t.data}`
|
|
715
|
-
}) : /* @__PURE__ */
|
|
793
|
+
}) : /* @__PURE__ */ x("span", {
|
|
716
794
|
"data-part": "file",
|
|
717
795
|
"data-media": t.mediaType,
|
|
718
796
|
children: ["📎 ", t.mediaType]
|
|
719
797
|
});
|
|
720
798
|
}
|
|
721
|
-
default: return /* @__PURE__ */
|
|
799
|
+
default: return /* @__PURE__ */ b("span", {
|
|
722
800
|
"data-part": e.type,
|
|
723
801
|
children: JSON.stringify(e)
|
|
724
802
|
});
|
|
725
803
|
}
|
|
726
804
|
}
|
|
727
|
-
function
|
|
805
|
+
function K({ message: e }) {
|
|
728
806
|
let t = e.parts ?? [];
|
|
729
|
-
return /* @__PURE__ */
|
|
807
|
+
return /* @__PURE__ */ x("div", {
|
|
730
808
|
"data-voltro-agent-message": !0,
|
|
731
809
|
"data-role": e.role,
|
|
732
810
|
"data-streaming": e.streaming ? "true" : void 0,
|
|
733
811
|
"aria-busy": e.streaming ? "true" : void 0,
|
|
734
|
-
children: [t.length > 0 ? t.map((e, t) => /* @__PURE__ */
|
|
812
|
+
children: [t.length > 0 ? t.map((e, t) => /* @__PURE__ */ b(G, { part: e }, t)) : /* @__PURE__ */ b("span", {
|
|
735
813
|
"data-part": "text",
|
|
736
814
|
children: e.content
|
|
737
|
-
}), e.streaming ? /* @__PURE__ */
|
|
815
|
+
}), e.streaming ? /* @__PURE__ */ b("span", {
|
|
738
816
|
"data-cursor": !0,
|
|
739
817
|
"aria-hidden": "true",
|
|
740
818
|
children: "▍"
|
|
741
819
|
}) : null]
|
|
742
820
|
});
|
|
743
821
|
}
|
|
744
|
-
function
|
|
745
|
-
let { api: t, agent: n, threadId: r, placeholder:
|
|
746
|
-
let e =
|
|
747
|
-
e.length === 0 ||
|
|
822
|
+
function q(e) {
|
|
823
|
+
let { api: t, agent: n, threadId: r, placeholder: i, sendLabel: a, emptyText: o } = e, c = z().agentChat, l = g(t, n, { threadId: r }), [u, d] = s(""), f = () => {
|
|
824
|
+
let e = u.trim();
|
|
825
|
+
e.length === 0 || l.sending || (d(""), l.send(e));
|
|
748
826
|
};
|
|
749
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ x("div", {
|
|
750
828
|
"data-voltro-agent-chat": n,
|
|
751
|
-
children: [/* @__PURE__ */
|
|
829
|
+
children: [/* @__PURE__ */ b("div", {
|
|
752
830
|
"data-messages": !0,
|
|
753
831
|
role: "log",
|
|
754
832
|
"aria-live": "polite",
|
|
755
|
-
"aria-busy":
|
|
756
|
-
children:
|
|
833
|
+
"aria-busy": l.streaming ? "true" : void 0,
|
|
834
|
+
children: l.messages.length === 0 && !l.loading ? /* @__PURE__ */ b("p", {
|
|
757
835
|
"data-empty": !0,
|
|
758
|
-
children:
|
|
759
|
-
}) :
|
|
760
|
-
}), /* @__PURE__ */
|
|
836
|
+
children: o ?? "No messages yet."
|
|
837
|
+
}) : l.messages.map((e) => /* @__PURE__ */ b(K, { message: e }, e.id))
|
|
838
|
+
}), /* @__PURE__ */ x("form", {
|
|
761
839
|
"data-composer": !0,
|
|
762
840
|
onSubmit: (e) => {
|
|
763
|
-
e.preventDefault(),
|
|
841
|
+
e.preventDefault(), f();
|
|
764
842
|
},
|
|
765
|
-
children: [/* @__PURE__ */
|
|
766
|
-
value:
|
|
767
|
-
onChange: (e) =>
|
|
768
|
-
placeholder:
|
|
769
|
-
"aria-label":
|
|
770
|
-
disabled:
|
|
771
|
-
}), /* @__PURE__ */
|
|
843
|
+
children: [/* @__PURE__ */ b("input", {
|
|
844
|
+
value: u,
|
|
845
|
+
onChange: (e) => d(e.target.value),
|
|
846
|
+
placeholder: i ?? c.messagePlaceholder,
|
|
847
|
+
"aria-label": c.messageLabel,
|
|
848
|
+
disabled: l.sending
|
|
849
|
+
}), /* @__PURE__ */ b("button", {
|
|
772
850
|
type: "submit",
|
|
773
|
-
disabled:
|
|
774
|
-
children:
|
|
851
|
+
disabled: l.sending || u.trim().length === 0,
|
|
852
|
+
children: a ?? c.send
|
|
775
853
|
})]
|
|
776
854
|
})]
|
|
777
855
|
});
|
|
778
856
|
}
|
|
779
|
-
function
|
|
780
|
-
let t =
|
|
857
|
+
function Le(e) {
|
|
858
|
+
let t = g(e.api, e.agent, { threadId: e.threadId });
|
|
781
859
|
return e.children(t);
|
|
782
860
|
}
|
|
783
861
|
//#endregion
|
|
784
862
|
//#region src/appAgent.tsx
|
|
785
|
-
function
|
|
786
|
-
let { tools: t, showTools: n, ...r } = e, i =
|
|
787
|
-
return /* @__PURE__ */
|
|
863
|
+
function Re(e) {
|
|
864
|
+
let { tools: t, showTools: n, ...r } = e, i = z().appAgent, a = (n ?? (t !== void 0 && t.length > 0)) && t && t.length > 0;
|
|
865
|
+
return /* @__PURE__ */ x("div", {
|
|
788
866
|
"data-voltro-app-agent": r.agent,
|
|
789
|
-
children: [a ? /* @__PURE__ */
|
|
867
|
+
children: [a ? /* @__PURE__ */ x("details", {
|
|
790
868
|
"data-agent-tools": !0,
|
|
791
|
-
children: [/* @__PURE__ */
|
|
869
|
+
children: [/* @__PURE__ */ b("summary", { children: i.toolsSummary(t.length) }), /* @__PURE__ */ b("ul", { children: t.map((e) => /* @__PURE__ */ x("li", {
|
|
792
870
|
"data-tool": e.name,
|
|
793
871
|
"data-write": e.write ? "true" : void 0,
|
|
794
872
|
children: [
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
e.confirm ? /* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ b("code", { children: e.name }),
|
|
874
|
+
e.confirm ? /* @__PURE__ */ x("span", {
|
|
797
875
|
"data-confirm": !0,
|
|
798
876
|
children: [" · ", i.needsConfirm]
|
|
799
877
|
}) : null,
|
|
800
|
-
e.description ? /* @__PURE__ */
|
|
878
|
+
e.description ? /* @__PURE__ */ x("span", {
|
|
801
879
|
"data-desc": !0,
|
|
802
880
|
children: [" — ", e.description]
|
|
803
881
|
}) : null
|
|
804
882
|
]
|
|
805
883
|
}, e.name)) })]
|
|
806
|
-
}) : null, /* @__PURE__ */
|
|
884
|
+
}) : null, /* @__PURE__ */ b(q, { ...r })]
|
|
807
885
|
});
|
|
808
886
|
}
|
|
809
887
|
//#endregion
|
|
810
888
|
//#region src/dataCopilot.tsx
|
|
811
|
-
var
|
|
889
|
+
var ze = (e) => e == null ? "" : typeof e == "boolean" ? e ? "✓" : "✗" : typeof e == "object" ? JSON.stringify(e) : String(e), Be = (e) => {
|
|
812
890
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
813
891
|
for (let r of e) for (let e of Object.keys(r)) t.has(e) || (t.add(e), n.push(e));
|
|
814
892
|
return n;
|
|
815
893
|
};
|
|
816
|
-
function
|
|
894
|
+
function J(e) {
|
|
817
895
|
let { answer: t, emptyText: n } = e;
|
|
818
896
|
if (t === void 0) return null;
|
|
819
|
-
if (!t.ok) return /* @__PURE__ */
|
|
897
|
+
if (!t.ok) return /* @__PURE__ */ b("p", {
|
|
820
898
|
"data-voltro-data-copilot-refused": !0,
|
|
821
899
|
role: "status",
|
|
822
900
|
children: t.reason
|
|
823
901
|
});
|
|
824
|
-
if (t.rows.length === 0) return /* @__PURE__ */
|
|
902
|
+
if (t.rows.length === 0) return /* @__PURE__ */ b("p", {
|
|
825
903
|
"data-voltro-data-copilot-empty": !0,
|
|
826
904
|
children: n ?? "No rows."
|
|
827
905
|
});
|
|
828
|
-
let r =
|
|
829
|
-
return /* @__PURE__ */
|
|
906
|
+
let r = Be(t.rows);
|
|
907
|
+
return /* @__PURE__ */ x("table", {
|
|
830
908
|
"data-voltro-data-copilot-results": !0,
|
|
831
|
-
children: [/* @__PURE__ */
|
|
909
|
+
children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: r.map((e) => /* @__PURE__ */ b("th", {
|
|
832
910
|
scope: "col",
|
|
833
911
|
children: e
|
|
834
|
-
}, e)) }) }), /* @__PURE__ */
|
|
912
|
+
}, e)) }) }), /* @__PURE__ */ b("tbody", { children: t.rows.map((e, t) => /* @__PURE__ */ b("tr", { children: r.map((t) => /* @__PURE__ */ b("td", {
|
|
835
913
|
"data-column": t,
|
|
836
|
-
children:
|
|
914
|
+
children: ze(e[t])
|
|
837
915
|
}, t)) }, String(e.id ?? t))) })]
|
|
838
916
|
});
|
|
839
917
|
}
|
|
840
|
-
function
|
|
841
|
-
let { api: t, action: n, placeholder: r, askLabel:
|
|
842
|
-
let e =
|
|
843
|
-
e.length === 0 ||
|
|
918
|
+
function Ve(e) {
|
|
919
|
+
let { api: t, action: n, placeholder: r, askLabel: i, emptyText: a } = e, o = _(t, n), [c, l] = s(""), u = () => {
|
|
920
|
+
let e = c.trim();
|
|
921
|
+
e.length === 0 || o.pending || o.ask(e);
|
|
844
922
|
};
|
|
845
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ x("div", {
|
|
846
924
|
"data-voltro-data-copilot": n,
|
|
847
|
-
children: [/* @__PURE__ */
|
|
925
|
+
children: [/* @__PURE__ */ x("form", {
|
|
848
926
|
"data-composer": !0,
|
|
849
927
|
onSubmit: (e) => {
|
|
850
|
-
e.preventDefault(),
|
|
928
|
+
e.preventDefault(), u();
|
|
851
929
|
},
|
|
852
|
-
children: [/* @__PURE__ */
|
|
853
|
-
value:
|
|
854
|
-
onChange: (e) =>
|
|
930
|
+
children: [/* @__PURE__ */ b("input", {
|
|
931
|
+
value: c,
|
|
932
|
+
onChange: (e) => l(e.target.value),
|
|
855
933
|
placeholder: r ?? "Ask about your data…",
|
|
856
934
|
"aria-label": "Ask about your data",
|
|
857
|
-
disabled:
|
|
858
|
-
}), /* @__PURE__ */
|
|
935
|
+
disabled: o.pending
|
|
936
|
+
}), /* @__PURE__ */ b("button", {
|
|
859
937
|
type: "submit",
|
|
860
|
-
disabled:
|
|
861
|
-
children:
|
|
938
|
+
disabled: o.pending || c.trim().length === 0,
|
|
939
|
+
children: i ?? "Ask"
|
|
862
940
|
})]
|
|
863
|
-
}), /* @__PURE__ */
|
|
941
|
+
}), /* @__PURE__ */ b("div", {
|
|
864
942
|
"data-answer": !0,
|
|
865
943
|
"aria-live": "polite",
|
|
866
|
-
"aria-busy":
|
|
867
|
-
children:
|
|
868
|
-
answer:
|
|
869
|
-
...
|
|
870
|
-
}) : /* @__PURE__ */
|
|
944
|
+
"aria-busy": o.pending ? "true" : void 0,
|
|
945
|
+
children: o.error === void 0 ? /* @__PURE__ */ b(J, {
|
|
946
|
+
answer: o.answer,
|
|
947
|
+
...a === void 0 ? {} : { emptyText: a }
|
|
948
|
+
}) : /* @__PURE__ */ b("p", {
|
|
871
949
|
"data-voltro-data-copilot-error": !0,
|
|
872
950
|
role: "alert",
|
|
873
|
-
children:
|
|
951
|
+
children: o.error instanceof Error ? o.error.message : String(o.error)
|
|
874
952
|
})
|
|
875
953
|
})]
|
|
876
954
|
});
|
|
877
955
|
}
|
|
878
|
-
function
|
|
879
|
-
let t =
|
|
956
|
+
function He(e) {
|
|
957
|
+
let t = _(e.api, e.action);
|
|
880
958
|
return e.children(t);
|
|
881
959
|
}
|
|
882
960
|
//#endregion
|
|
883
961
|
//#region src/skeleton.tsx
|
|
884
|
-
var
|
|
962
|
+
var Y = ({ w: e }) => /* @__PURE__ */ b("span", {
|
|
885
963
|
"data-skeleton-bar": !0,
|
|
886
964
|
style: {
|
|
887
965
|
display: "inline-block",
|
|
@@ -891,75 +969,75 @@ var K = ({ w: e }) => /* @__PURE__ */ o("span", {
|
|
|
891
969
|
},
|
|
892
970
|
"aria-hidden": "true"
|
|
893
971
|
});
|
|
894
|
-
function
|
|
895
|
-
let t =
|
|
972
|
+
function Ue(e) {
|
|
973
|
+
let t = ae(e.api, e.mutation), n = t.length > 0 ? t.length : e.fallbackFields ?? 3, r = t.length > 0 ? f(t) : [{
|
|
896
974
|
name: void 0,
|
|
897
975
|
label: void 0,
|
|
898
976
|
fields: Array.from({ length: n }, (e, t) => ({ name: `f${t}` }))
|
|
899
977
|
}];
|
|
900
|
-
return /* @__PURE__ */
|
|
978
|
+
return /* @__PURE__ */ b("div", {
|
|
901
979
|
"data-voltro-form-skeleton": e.mutation,
|
|
902
980
|
"aria-busy": "true",
|
|
903
981
|
"aria-hidden": "true",
|
|
904
|
-
children: r.map((e, t) => /* @__PURE__ */
|
|
982
|
+
children: r.map((e, t) => /* @__PURE__ */ x("div", {
|
|
905
983
|
...e.name === void 0 ? {} : { "data-skeleton-section": e.name },
|
|
906
|
-
children: [e.name !== void 0 && /* @__PURE__ */
|
|
984
|
+
children: [e.name !== void 0 && /* @__PURE__ */ b("div", {
|
|
907
985
|
"data-skeleton-section-title": !0,
|
|
908
|
-
children: /* @__PURE__ */
|
|
909
|
-
}), e.fields.map((e) => /* @__PURE__ */
|
|
986
|
+
children: /* @__PURE__ */ b(Y, { w: "40%" })
|
|
987
|
+
}), e.fields.map((e) => /* @__PURE__ */ x("div", {
|
|
910
988
|
"data-skeleton-field": !0,
|
|
911
|
-
children: [/* @__PURE__ */
|
|
989
|
+
children: [/* @__PURE__ */ b(Y, { w: "30%" }), /* @__PURE__ */ b(Y, {})]
|
|
912
990
|
}, e.name))]
|
|
913
991
|
}, e.name ?? `_${t}`))
|
|
914
992
|
});
|
|
915
993
|
}
|
|
916
|
-
function
|
|
917
|
-
let t =
|
|
918
|
-
return /* @__PURE__ */
|
|
994
|
+
function We(e) {
|
|
995
|
+
let t = le(e.api, e.query), n = t.length > 0 ? t.length : e.fallbackColumns ?? 4, r = t.length > 0 ? t.map((e) => e.name) : Array.from({ length: n }, (e, t) => `c${t}`), i = e.rows ?? 5;
|
|
996
|
+
return /* @__PURE__ */ x("table", {
|
|
919
997
|
"data-voltro-table-skeleton": e.query,
|
|
920
998
|
"aria-busy": "true",
|
|
921
999
|
"aria-hidden": "true",
|
|
922
|
-
children: [/* @__PURE__ */
|
|
1000
|
+
children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: r.map((e) => /* @__PURE__ */ b("th", {
|
|
923
1001
|
scope: "col",
|
|
924
|
-
children: /* @__PURE__ */
|
|
925
|
-
}, e)) }) }), /* @__PURE__ */
|
|
1002
|
+
children: /* @__PURE__ */ b(Y, { w: "60%" })
|
|
1003
|
+
}, e)) }) }), /* @__PURE__ */ b("tbody", { children: Array.from({ length: i }, (e, t) => /* @__PURE__ */ b("tr", {
|
|
926
1004
|
"data-skeleton-row": !0,
|
|
927
|
-
children: r.map((e) => /* @__PURE__ */
|
|
1005
|
+
children: r.map((e) => /* @__PURE__ */ b("td", { children: /* @__PURE__ */ b(Y, {}) }, e))
|
|
928
1006
|
}, t)) })]
|
|
929
1007
|
});
|
|
930
1008
|
}
|
|
931
1009
|
//#endregion
|
|
932
1010
|
//#region src/filters.tsx
|
|
933
|
-
var
|
|
934
|
-
function
|
|
935
|
-
let { filter: t, value: n, onChange: r } = e, i =
|
|
1011
|
+
var X = (e) => e == null ? "" : String(e);
|
|
1012
|
+
function Ge(e) {
|
|
1013
|
+
let { filter: t, value: n, onChange: r } = e, i = z().filters, a = {
|
|
936
1014
|
"data-filter": t.name,
|
|
937
1015
|
"aria-label": t.label
|
|
938
1016
|
};
|
|
939
1017
|
switch (t.kind) {
|
|
940
|
-
case "select": return /* @__PURE__ */
|
|
1018
|
+
case "select": return /* @__PURE__ */ x("select", {
|
|
941
1019
|
...a,
|
|
942
|
-
value:
|
|
1020
|
+
value: X(n),
|
|
943
1021
|
onChange: (e) => r(e.target.value || void 0),
|
|
944
|
-
children: [/* @__PURE__ */
|
|
1022
|
+
children: [/* @__PURE__ */ b("option", {
|
|
945
1023
|
value: "",
|
|
946
1024
|
children: i.anyOption(t.label)
|
|
947
|
-
}), (t.options ?? []).map((e) => /* @__PURE__ */
|
|
1025
|
+
}), (t.options ?? []).map((e) => /* @__PURE__ */ b("option", {
|
|
948
1026
|
value: e.value,
|
|
949
1027
|
children: e.label
|
|
950
1028
|
}, e.value))]
|
|
951
1029
|
});
|
|
952
|
-
case "multi-select": return /* @__PURE__ */
|
|
1030
|
+
case "multi-select": return /* @__PURE__ */ b("select", {
|
|
953
1031
|
...a,
|
|
954
1032
|
multiple: !0,
|
|
955
1033
|
value: Array.isArray(n) ? n : [],
|
|
956
1034
|
onChange: (e) => r(Array.from(e.target.selectedOptions, (e) => e.value)),
|
|
957
|
-
children: (t.options ?? []).map((e) => /* @__PURE__ */
|
|
1035
|
+
children: (t.options ?? []).map((e) => /* @__PURE__ */ b("option", {
|
|
958
1036
|
value: e.value,
|
|
959
1037
|
children: e.label
|
|
960
1038
|
}, e.value))
|
|
961
1039
|
});
|
|
962
|
-
case "boolean": return /* @__PURE__ */
|
|
1040
|
+
case "boolean": return /* @__PURE__ */ b("input", {
|
|
963
1041
|
...a,
|
|
964
1042
|
type: "checkbox",
|
|
965
1043
|
checked: n === !0,
|
|
@@ -968,21 +1046,21 @@ function Fe(e) {
|
|
|
968
1046
|
case "number-range":
|
|
969
1047
|
case "date-range": {
|
|
970
1048
|
let e = t.kind === "number-range" ? "number" : "date", i = n ?? {};
|
|
971
|
-
return /* @__PURE__ */
|
|
1049
|
+
return /* @__PURE__ */ x("span", {
|
|
972
1050
|
"data-filter": t.name,
|
|
973
1051
|
"data-range": t.kind,
|
|
974
|
-
children: [/* @__PURE__ */
|
|
1052
|
+
children: [/* @__PURE__ */ b("input", {
|
|
975
1053
|
"aria-label": `${t.label} from`,
|
|
976
1054
|
type: e,
|
|
977
|
-
value:
|
|
1055
|
+
value: X(i.gte),
|
|
978
1056
|
onChange: (e) => r({
|
|
979
1057
|
...i,
|
|
980
1058
|
gte: e.target.value || void 0
|
|
981
1059
|
})
|
|
982
|
-
}), /* @__PURE__ */
|
|
1060
|
+
}), /* @__PURE__ */ b("input", {
|
|
983
1061
|
"aria-label": `${t.label} to`,
|
|
984
1062
|
type: e,
|
|
985
|
-
value:
|
|
1063
|
+
value: X(i.lte),
|
|
986
1064
|
onChange: (e) => r({
|
|
987
1065
|
...i,
|
|
988
1066
|
lte: e.target.value || void 0
|
|
@@ -990,38 +1068,38 @@ function Fe(e) {
|
|
|
990
1068
|
})]
|
|
991
1069
|
});
|
|
992
1070
|
}
|
|
993
|
-
default: return /* @__PURE__ */
|
|
1071
|
+
default: return /* @__PURE__ */ b("input", {
|
|
994
1072
|
...a,
|
|
995
1073
|
type: "text",
|
|
996
|
-
value:
|
|
1074
|
+
value: X(n),
|
|
997
1075
|
onChange: (e) => r(e.target.value || void 0)
|
|
998
1076
|
});
|
|
999
1077
|
}
|
|
1000
1078
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let t =
|
|
1003
|
-
return /* @__PURE__ */
|
|
1079
|
+
function Ke(e) {
|
|
1080
|
+
let t = se(e.api, e.query, e.initial ? { initial: e.initial } : {}), n = z().filters;
|
|
1081
|
+
return /* @__PURE__ */ x("div", {
|
|
1004
1082
|
"data-voltro-query-filters": e.query,
|
|
1005
|
-
children: [/* @__PURE__ */
|
|
1083
|
+
children: [/* @__PURE__ */ x("div", {
|
|
1006
1084
|
"data-filter-controls": !0,
|
|
1007
1085
|
role: "group",
|
|
1008
1086
|
"aria-label": n.filtersLabel,
|
|
1009
1087
|
children: [
|
|
1010
|
-
t.filters.map((e) => /* @__PURE__ */
|
|
1088
|
+
t.filters.map((e) => /* @__PURE__ */ x("label", {
|
|
1011
1089
|
"data-filter-label": !0,
|
|
1012
|
-
children: [/* @__PURE__ */
|
|
1090
|
+
children: [/* @__PURE__ */ b("span", { children: e.label }), /* @__PURE__ */ b(Ge, {
|
|
1013
1091
|
filter: e,
|
|
1014
1092
|
value: t.values[e.name],
|
|
1015
1093
|
onChange: (n) => t.setFilter(e.name, n)
|
|
1016
1094
|
})]
|
|
1017
1095
|
}, e.name)),
|
|
1018
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ b("button", {
|
|
1019
1097
|
type: "button",
|
|
1020
1098
|
"data-filter-clear": !0,
|
|
1021
1099
|
onClick: () => t.clear(),
|
|
1022
1100
|
children: n.clear
|
|
1023
1101
|
}),
|
|
1024
|
-
e.showCount ?? !0 ? /* @__PURE__ */
|
|
1102
|
+
e.showCount ?? !0 ? /* @__PURE__ */ b("span", {
|
|
1025
1103
|
"data-filter-count": !0,
|
|
1026
1104
|
children: n.resultCount(t.count ?? "…")
|
|
1027
1105
|
}) : null
|
|
@@ -1031,46 +1109,46 @@ function J(e) {
|
|
|
1031
1109
|
}
|
|
1032
1110
|
//#endregion
|
|
1033
1111
|
//#region src/recordView.tsx
|
|
1034
|
-
var
|
|
1035
|
-
function
|
|
1036
|
-
let n =
|
|
1037
|
-
if (t.length === 0) return /* @__PURE__ */
|
|
1112
|
+
var Z = (e) => e.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/^./, (e) => e.toUpperCase()), Q = (e) => Array.isArray(e) && e.every((e) => typeof e == "object" && !!e), qe = (e) => e == null ? "—" : typeof e == "boolean" ? e ? "✓" : "✗" : String(e);
|
|
1113
|
+
function Je({ name: e, items: t }) {
|
|
1114
|
+
let n = z().recordView;
|
|
1115
|
+
if (t.length === 0) return /* @__PURE__ */ b("p", {
|
|
1038
1116
|
"data-relation": e,
|
|
1039
1117
|
"data-empty": !0,
|
|
1040
|
-
children: n.emptyRelation(
|
|
1118
|
+
children: n.emptyRelation(Z(e).toLowerCase())
|
|
1041
1119
|
});
|
|
1042
1120
|
let r = Object.keys(t[0]);
|
|
1043
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ x("table", {
|
|
1044
1122
|
"data-relation": e,
|
|
1045
|
-
children: [/* @__PURE__ */
|
|
1123
|
+
children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: r.map((e) => /* @__PURE__ */ b("th", {
|
|
1046
1124
|
scope: "col",
|
|
1047
|
-
children:
|
|
1048
|
-
}, e)) }) }), /* @__PURE__ */
|
|
1125
|
+
children: Z(e)
|
|
1126
|
+
}, e)) }) }), /* @__PURE__ */ b("tbody", { children: t.map((e, t) => /* @__PURE__ */ b("tr", { children: r.map((t) => /* @__PURE__ */ b("td", { children: qe(e[t]) }, t)) }, String(e.id ?? t))) })]
|
|
1049
1127
|
});
|
|
1050
1128
|
}
|
|
1051
|
-
function
|
|
1052
|
-
let { api: t, query: n, input: r, fields: i, renderField: a, renderRelation:
|
|
1053
|
-
if (
|
|
1129
|
+
function Ye(e) {
|
|
1130
|
+
let { api: t, query: n, input: r, fields: i, renderField: a, renderRelation: o, loadingText: s, emptyText: c } = e, { record: l, loading: u } = ce(t, n, r ?? {});
|
|
1131
|
+
if (u) return /* @__PURE__ */ b("p", {
|
|
1054
1132
|
"data-voltro-record-loading": !0,
|
|
1055
1133
|
"aria-busy": "true",
|
|
1056
|
-
children:
|
|
1134
|
+
children: s ?? "Loading…"
|
|
1057
1135
|
});
|
|
1058
|
-
if (
|
|
1136
|
+
if (l == null) return /* @__PURE__ */ b("p", {
|
|
1059
1137
|
"data-voltro-record-empty": !0,
|
|
1060
|
-
children:
|
|
1138
|
+
children: c ?? "Not found."
|
|
1061
1139
|
});
|
|
1062
|
-
let
|
|
1063
|
-
return /* @__PURE__ */
|
|
1140
|
+
let d = Object.entries(l), f = d.filter(([e, t]) => !Q(t) && (i === void 0 || i.includes(e))), p = d.filter(([, e]) => Q(e)), m = i === void 0 ? f : i.map((e) => [e, l[e]]).filter(([, e]) => !Q(e));
|
|
1141
|
+
return /* @__PURE__ */ x("div", {
|
|
1064
1142
|
"data-voltro-record-view": n,
|
|
1065
|
-
children: [/* @__PURE__ */
|
|
1143
|
+
children: [/* @__PURE__ */ b("dl", {
|
|
1066
1144
|
"data-record-fields": !0,
|
|
1067
|
-
children:
|
|
1145
|
+
children: m.map(([e, t]) => /* @__PURE__ */ x("div", {
|
|
1068
1146
|
"data-field": e,
|
|
1069
|
-
children: [/* @__PURE__ */
|
|
1147
|
+
children: [/* @__PURE__ */ b("dt", { children: Z(e) }), /* @__PURE__ */ b("dd", { children: a ? a(e, t, l) : qe(t) })]
|
|
1070
1148
|
}, e))
|
|
1071
|
-
}),
|
|
1149
|
+
}), p.map(([e, t]) => /* @__PURE__ */ x("section", {
|
|
1072
1150
|
"data-record-relation": e,
|
|
1073
|
-
children: [/* @__PURE__ */
|
|
1151
|
+
children: [/* @__PURE__ */ b("h3", { children: Z(e) }), o ? o(e, t, l) : /* @__PURE__ */ b(Je, {
|
|
1074
1152
|
name: e,
|
|
1075
1153
|
items: t
|
|
1076
1154
|
})]
|
|
@@ -1079,7 +1157,7 @@ function Le(e) {
|
|
|
1079
1157
|
}
|
|
1080
1158
|
//#endregion
|
|
1081
1159
|
//#region src/connectAccount.tsx
|
|
1082
|
-
var
|
|
1160
|
+
var Xe = (e, t) => {
|
|
1083
1161
|
switch (e.status) {
|
|
1084
1162
|
case "connected": return e.accountLabel === null ? t.connected : t.connectedAs(e.accountLabel);
|
|
1085
1163
|
case "expired": return t.expired;
|
|
@@ -1087,127 +1165,127 @@ var Re = (e, t) => {
|
|
|
1087
1165
|
case "error": return t.errored;
|
|
1088
1166
|
default: return t.notConnected;
|
|
1089
1167
|
}
|
|
1090
|
-
},
|
|
1091
|
-
let r =
|
|
1092
|
-
return /* @__PURE__ */
|
|
1168
|
+
}, Ze = ({ api: e, connectionId: t, ...n }) => {
|
|
1169
|
+
let r = te(e, t);
|
|
1170
|
+
return /* @__PURE__ */ b(Qe, {
|
|
1093
1171
|
connection: r,
|
|
1094
1172
|
loading: r.loading,
|
|
1095
1173
|
...n
|
|
1096
1174
|
});
|
|
1097
|
-
},
|
|
1098
|
-
let
|
|
1175
|
+
}, Qe = ({ connection: e, instructionsUrl: t, loading: n = !1, children: r, className: i }) => {
|
|
1176
|
+
let a = z().connectAccount, [o, c] = s("");
|
|
1099
1177
|
if (r !== void 0) return r(e);
|
|
1100
|
-
if (n) return /* @__PURE__ */
|
|
1101
|
-
className:
|
|
1178
|
+
if (n) return /* @__PURE__ */ b("div", {
|
|
1179
|
+
className: i,
|
|
1102
1180
|
"data-voltro-connect": e.connectionId,
|
|
1103
|
-
children:
|
|
1181
|
+
children: a.loading
|
|
1104
1182
|
});
|
|
1105
|
-
let
|
|
1106
|
-
t.preventDefault(),
|
|
1183
|
+
let l = async (t) => {
|
|
1184
|
+
t.preventDefault(), o.trim() !== "" && (await e.submitToken(o), c(""));
|
|
1107
1185
|
};
|
|
1108
|
-
return /* @__PURE__ */
|
|
1109
|
-
className:
|
|
1186
|
+
return /* @__PURE__ */ x("div", {
|
|
1187
|
+
className: i,
|
|
1110
1188
|
"data-voltro-connect": e.connectionId,
|
|
1111
1189
|
"data-status": e.status,
|
|
1112
|
-
children: [/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1190
|
+
children: [/* @__PURE__ */ x("div", { children: [
|
|
1191
|
+
/* @__PURE__ */ b("strong", { children: e.label }),
|
|
1114
1192
|
" — ",
|
|
1115
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ b("span", {
|
|
1116
1194
|
role: e.needsAttention ? "alert" : void 0,
|
|
1117
|
-
children:
|
|
1195
|
+
children: Xe(e, a)
|
|
1118
1196
|
})
|
|
1119
|
-
] }), e.connected || e.needsAttention ? /* @__PURE__ */
|
|
1197
|
+
] }), e.connected || e.needsAttention ? /* @__PURE__ */ x(y, { children: [e.needsAttention && e.kind === "oauth2" && /* @__PURE__ */ b("button", {
|
|
1120
1198
|
type: "button",
|
|
1121
1199
|
disabled: e.pending,
|
|
1122
1200
|
onClick: () => {
|
|
1123
1201
|
e.connect();
|
|
1124
1202
|
},
|
|
1125
|
-
children:
|
|
1126
|
-
}), /* @__PURE__ */
|
|
1203
|
+
children: a.reconnect
|
|
1204
|
+
}), /* @__PURE__ */ b("button", {
|
|
1127
1205
|
type: "button",
|
|
1128
1206
|
disabled: e.pending,
|
|
1129
1207
|
onClick: () => {
|
|
1130
1208
|
e.disconnect();
|
|
1131
1209
|
},
|
|
1132
|
-
children:
|
|
1133
|
-
})] }) : e.kind === "oauth2" ? /* @__PURE__ */
|
|
1210
|
+
children: a.disconnect
|
|
1211
|
+
})] }) : e.kind === "oauth2" ? /* @__PURE__ */ b("button", {
|
|
1134
1212
|
type: "button",
|
|
1135
1213
|
disabled: e.pending,
|
|
1136
1214
|
onClick: () => {
|
|
1137
1215
|
e.connect();
|
|
1138
1216
|
},
|
|
1139
|
-
children:
|
|
1140
|
-
}) : /* @__PURE__ */
|
|
1217
|
+
children: a.connect(e.label)
|
|
1218
|
+
}) : /* @__PURE__ */ x("form", {
|
|
1141
1219
|
onSubmit: (e) => {
|
|
1142
|
-
|
|
1220
|
+
l(e);
|
|
1143
1221
|
},
|
|
1144
1222
|
children: [
|
|
1145
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ b("label", {
|
|
1146
1224
|
htmlFor: `voltro-connect-${e.connectionId}`,
|
|
1147
|
-
children:
|
|
1225
|
+
children: a.tokenLabel(e.label)
|
|
1148
1226
|
}),
|
|
1149
|
-
/* @__PURE__ */
|
|
1227
|
+
/* @__PURE__ */ b("input", {
|
|
1150
1228
|
id: `voltro-connect-${e.connectionId}`,
|
|
1151
1229
|
type: "password",
|
|
1152
1230
|
autoComplete: "off",
|
|
1153
|
-
value:
|
|
1154
|
-
placeholder:
|
|
1231
|
+
value: o,
|
|
1232
|
+
placeholder: a.tokenPlaceholder,
|
|
1155
1233
|
onChange: (e) => {
|
|
1156
|
-
|
|
1234
|
+
c(e.target.value);
|
|
1157
1235
|
}
|
|
1158
1236
|
}),
|
|
1159
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ b("button", {
|
|
1160
1238
|
type: "submit",
|
|
1161
|
-
disabled: e.pending ||
|
|
1162
|
-
children:
|
|
1239
|
+
disabled: e.pending || o.trim() === "",
|
|
1240
|
+
children: a.save
|
|
1163
1241
|
}),
|
|
1164
|
-
t !== void 0 && /* @__PURE__ */
|
|
1242
|
+
t !== void 0 && /* @__PURE__ */ b("a", {
|
|
1165
1243
|
href: t,
|
|
1166
1244
|
target: "_blank",
|
|
1167
1245
|
rel: "noreferrer noopener",
|
|
1168
|
-
children:
|
|
1246
|
+
children: a.howToGetToken
|
|
1169
1247
|
})
|
|
1170
1248
|
]
|
|
1171
1249
|
})]
|
|
1172
1250
|
});
|
|
1173
1251
|
}, $ = (e) => [...e.matchAll(/@([\w.-]+)/g)].map((e) => e[1]);
|
|
1174
|
-
function
|
|
1175
|
-
let
|
|
1176
|
-
return /* @__PURE__ */
|
|
1252
|
+
function $e({ comment: e, onReact: t, onRemove: n, onEdit: r }) {
|
|
1253
|
+
let i = z().comments, [a, o] = s(!1), [c, l] = s(e.body);
|
|
1254
|
+
return /* @__PURE__ */ x("li", {
|
|
1177
1255
|
"data-comment": e.id,
|
|
1178
1256
|
"data-author": e.authorSubjectId,
|
|
1179
1257
|
children: [
|
|
1180
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ b("span", {
|
|
1181
1259
|
"data-comment-author": !0,
|
|
1182
1260
|
children: e.authorSubjectId
|
|
1183
1261
|
}),
|
|
1184
|
-
|
|
1262
|
+
a ? /* @__PURE__ */ x("form", {
|
|
1185
1263
|
"data-comment-edit": !0,
|
|
1186
1264
|
onSubmit: (e) => {
|
|
1187
|
-
e.preventDefault(), r(
|
|
1265
|
+
e.preventDefault(), r(c), o(!1);
|
|
1188
1266
|
},
|
|
1189
|
-
children: [/* @__PURE__ */
|
|
1190
|
-
value:
|
|
1191
|
-
onChange: (e) =>
|
|
1192
|
-
"aria-label":
|
|
1193
|
-
}), /* @__PURE__ */
|
|
1267
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1268
|
+
value: c,
|
|
1269
|
+
onChange: (e) => l(e.target.value),
|
|
1270
|
+
"aria-label": i.editLabel
|
|
1271
|
+
}), /* @__PURE__ */ b("button", {
|
|
1194
1272
|
type: "submit",
|
|
1195
|
-
children:
|
|
1273
|
+
children: i.save
|
|
1196
1274
|
})]
|
|
1197
|
-
}) : /* @__PURE__ */
|
|
1275
|
+
}) : /* @__PURE__ */ x("p", {
|
|
1198
1276
|
"data-comment-body": !0,
|
|
1199
|
-
children: [e.body, e.editedAt ? /* @__PURE__ */
|
|
1277
|
+
children: [e.body, e.editedAt ? /* @__PURE__ */ x("em", {
|
|
1200
1278
|
"data-comment-edited": !0,
|
|
1201
1279
|
children: [
|
|
1202
1280
|
" (",
|
|
1203
|
-
|
|
1281
|
+
i.edited,
|
|
1204
1282
|
")"
|
|
1205
1283
|
]
|
|
1206
1284
|
}) : null]
|
|
1207
1285
|
}),
|
|
1208
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ x("span", {
|
|
1209
1287
|
"data-comment-reactions": !0,
|
|
1210
|
-
children: [e.reactions.map((e) => /* @__PURE__ */
|
|
1288
|
+
children: [e.reactions.map((e) => /* @__PURE__ */ x("button", {
|
|
1211
1289
|
type: "button",
|
|
1212
1290
|
"data-reaction": e.emoji,
|
|
1213
1291
|
"data-mine": e.mine || void 0,
|
|
@@ -1217,49 +1295,49 @@ function Be({ comment: e, onReact: t, onRemove: n, onEdit: r }) {
|
|
|
1217
1295
|
" ",
|
|
1218
1296
|
e.count
|
|
1219
1297
|
]
|
|
1220
|
-
}, e.emoji)), /* @__PURE__ */
|
|
1298
|
+
}, e.emoji)), /* @__PURE__ */ b("button", {
|
|
1221
1299
|
type: "button",
|
|
1222
1300
|
"data-reaction-add": !0,
|
|
1223
1301
|
onClick: () => t("👍"),
|
|
1224
|
-
"aria-label":
|
|
1302
|
+
"aria-label": i.react,
|
|
1225
1303
|
children: "+👍"
|
|
1226
1304
|
})]
|
|
1227
1305
|
}),
|
|
1228
|
-
/* @__PURE__ */
|
|
1306
|
+
/* @__PURE__ */ x("span", {
|
|
1229
1307
|
"data-comment-actions": !0,
|
|
1230
|
-
children: [/* @__PURE__ */
|
|
1308
|
+
children: [/* @__PURE__ */ b("button", {
|
|
1231
1309
|
type: "button",
|
|
1232
|
-
onClick: () =>
|
|
1233
|
-
children:
|
|
1234
|
-
}), /* @__PURE__ */
|
|
1310
|
+
onClick: () => o((e) => !e),
|
|
1311
|
+
children: i.edit
|
|
1312
|
+
}), /* @__PURE__ */ b("button", {
|
|
1235
1313
|
type: "button",
|
|
1236
1314
|
onClick: n,
|
|
1237
|
-
children:
|
|
1315
|
+
children: i.remove
|
|
1238
1316
|
})]
|
|
1239
1317
|
})
|
|
1240
1318
|
]
|
|
1241
1319
|
});
|
|
1242
1320
|
}
|
|
1243
|
-
function
|
|
1244
|
-
let n =
|
|
1245
|
-
return /* @__PURE__ */
|
|
1321
|
+
function et({ thread: e, api: t }) {
|
|
1322
|
+
let n = z().comments, [r, i] = s("");
|
|
1323
|
+
return /* @__PURE__ */ x("section", {
|
|
1246
1324
|
"data-thread": e.id,
|
|
1247
1325
|
"data-status": e.status,
|
|
1248
1326
|
children: [
|
|
1249
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ x("header", {
|
|
1250
1328
|
"data-thread-header": !0,
|
|
1251
1329
|
children: [
|
|
1252
|
-
e.unreadCount > 0 ? /* @__PURE__ */
|
|
1330
|
+
e.unreadCount > 0 ? /* @__PURE__ */ b("span", {
|
|
1253
1331
|
"data-thread-unread": !0,
|
|
1254
1332
|
children: e.unreadCount
|
|
1255
1333
|
}) : null,
|
|
1256
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ b("button", {
|
|
1257
1335
|
type: "button",
|
|
1258
1336
|
"data-thread-resolve": !0,
|
|
1259
1337
|
onClick: () => void t.resolve(e.id, e.status !== "resolved"),
|
|
1260
1338
|
children: e.status === "resolved" ? n.reopen : n.resolve
|
|
1261
1339
|
}),
|
|
1262
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ b("button", {
|
|
1263
1341
|
type: "button",
|
|
1264
1342
|
"data-thread-markread": !0,
|
|
1265
1343
|
onClick: () => void t.markRead(e.id),
|
|
@@ -1267,29 +1345,29 @@ function Ve({ thread: e, api: t }) {
|
|
|
1267
1345
|
})
|
|
1268
1346
|
]
|
|
1269
1347
|
}),
|
|
1270
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ b("ul", {
|
|
1271
1349
|
"data-thread-comments": !0,
|
|
1272
|
-
children: e.comments.map((e) => /* @__PURE__ */
|
|
1350
|
+
children: e.comments.map((e) => /* @__PURE__ */ b($e, {
|
|
1273
1351
|
comment: e,
|
|
1274
1352
|
onReact: (n) => void t.react(e.id, n),
|
|
1275
1353
|
onRemove: () => void t.remove(e.id),
|
|
1276
1354
|
onEdit: (n) => void t.edit(e.id, n)
|
|
1277
1355
|
}, e.id))
|
|
1278
1356
|
}),
|
|
1279
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ x("form", {
|
|
1280
1358
|
"data-thread-reply": !0,
|
|
1281
1359
|
onSubmit: (n) => {
|
|
1282
1360
|
n.preventDefault(), r.trim() !== "" && (t.create(r, {
|
|
1283
1361
|
threadId: e.id,
|
|
1284
1362
|
mentions: $(r)
|
|
1285
|
-
}),
|
|
1363
|
+
}), i(""));
|
|
1286
1364
|
},
|
|
1287
|
-
children: [/* @__PURE__ */
|
|
1365
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1288
1366
|
value: r,
|
|
1289
|
-
onChange: (e) =>
|
|
1367
|
+
onChange: (e) => i(e.target.value),
|
|
1290
1368
|
placeholder: n.replyPlaceholder,
|
|
1291
1369
|
"aria-label": n.replyLabel
|
|
1292
|
-
}), /* @__PURE__ */
|
|
1370
|
+
}), /* @__PURE__ */ b("button", {
|
|
1293
1371
|
type: "submit",
|
|
1294
1372
|
children: n.reply
|
|
1295
1373
|
})]
|
|
@@ -1297,25 +1375,25 @@ function Ve({ thread: e, api: t }) {
|
|
|
1297
1375
|
]
|
|
1298
1376
|
});
|
|
1299
1377
|
}
|
|
1300
|
-
function
|
|
1301
|
-
let n =
|
|
1302
|
-
return /* @__PURE__ */
|
|
1378
|
+
function tt({ anchor: e, api: t = "app" }) {
|
|
1379
|
+
let n = z().comments, r = ue(e, t), [i, a] = s("");
|
|
1380
|
+
return /* @__PURE__ */ x("div", {
|
|
1303
1381
|
"data-comments": !0,
|
|
1304
1382
|
"data-anchor": e,
|
|
1305
|
-
children: [r.threads.map((e) => /* @__PURE__ */
|
|
1383
|
+
children: [r.threads.map((e) => /* @__PURE__ */ b(et, {
|
|
1306
1384
|
thread: e,
|
|
1307
1385
|
api: r
|
|
1308
|
-
}, e.id)), /* @__PURE__ */
|
|
1386
|
+
}, e.id)), /* @__PURE__ */ x("form", {
|
|
1309
1387
|
"data-comments-new": !0,
|
|
1310
1388
|
onSubmit: (e) => {
|
|
1311
|
-
e.preventDefault(),
|
|
1389
|
+
e.preventDefault(), i.trim() !== "" && (r.create(i, { mentions: $(i) }), a(""));
|
|
1312
1390
|
},
|
|
1313
|
-
children: [/* @__PURE__ */
|
|
1314
|
-
value:
|
|
1315
|
-
onChange: (e) =>
|
|
1391
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1392
|
+
value: i,
|
|
1393
|
+
onChange: (e) => a(e.target.value),
|
|
1316
1394
|
placeholder: n.newPlaceholder,
|
|
1317
1395
|
"aria-label": n.newLabel
|
|
1318
|
-
}), /* @__PURE__ */
|
|
1396
|
+
}), /* @__PURE__ */ b("button", {
|
|
1319
1397
|
type: "submit",
|
|
1320
1398
|
children: n.comment
|
|
1321
1399
|
})]
|
|
@@ -1323,4 +1401,4 @@ function He({ anchor: e, api: t = "app" }) {
|
|
|
1323
1401
|
});
|
|
1324
1402
|
}
|
|
1325
1403
|
//#endregion
|
|
1326
|
-
export {
|
|
1404
|
+
export { q as AgentChat, K as AgentMessageView, G as AgentPartView, Le as AgentStream, Re as AppAgent, Ne as ApprovalControls, Ee as AsyncSelect, Ce as AutoForm, tt as CommentsThread, Qe as ConnectAccount, Ze as ConnectAccountFor, Ve as DataCopilot, J as DataCopilotAnswer, He as DataCopilotStream, ke as DataTable, Fe as EditingIndicator, I as Field, Ue as FormSkeleton, Pe as PresenceAvatars, Ke as QueryFilters, Ye as RecordView, pe as RichTextView, C as RichTextWidget, We as TableSkeleton, Te as UiStringsProvider, be as WidgetRegistryProvider, je as WorkflowProgress, Me as WorkflowStatusBadge, L as defaultUiStrings, M as defaultWidgets, H as initials, U as summarizeEditors, z as useUiStrings, P as useWidget };
|