@gram-ai/elements 1.18.1 → 1.18.2
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/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/buttonVariants.d.ts +1 -1
- package/dist/contexts/ElementsProvider.d.ts +6 -1
- package/dist/elements.cjs +50 -50
- package/dist/elements.js +19589 -19539
- package/dist/hooks/useAuth.d.ts +16 -0
- package/dist/hooks/useMCPTools.d.ts +3 -4
- package/dist/hooks/useSession.d.ts +1 -1
- package/dist/index-Bj7jPiuy.cjs +16 -0
- package/dist/{index-1qi_Rje5.js → index-CJRypLIa.js} +210 -210
- package/dist/index.d.ts +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +1 -1
- package/dist/types/index.d.ts +40 -32
- package/package.json +1 -1
- package/dist/index-DY3aJC4I.cjs +0 -16
|
@@ -2,186 +2,59 @@ import { jsxs as fe, jsx as te } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext as Ce, useContext as We, forwardRef as ze, createElement as se, useRef as be, useState as _e, useMemo as Ue, useEffect as Be } from "react";
|
|
3
3
|
import { useAssistantState as $e } from "@assistant-ui/react";
|
|
4
4
|
import { parse as De, View as Je, Warn as qe } from "vega";
|
|
5
|
-
|
|
6
|
-
void 0
|
|
7
|
-
), or = Ce(null), Ae = () => {
|
|
8
|
-
const e = We(Ye);
|
|
9
|
-
if (!e)
|
|
10
|
-
throw new Error("useElements must be used within a ElementsProvider");
|
|
11
|
-
return e;
|
|
12
|
-
}, Xe = {
|
|
13
|
-
compact: {
|
|
14
|
-
// Padding - small increments (1, 1.5, 2, 2.5, 3)
|
|
15
|
-
"p-xs": "p-1",
|
|
16
|
-
"p-sm": "p-1.5",
|
|
17
|
-
"p-md": "p-2",
|
|
18
|
-
"p-lg": "p-2.5",
|
|
19
|
-
"p-xl": "p-3",
|
|
20
|
-
"px-xs": "px-1",
|
|
21
|
-
"px-sm": "px-1.5",
|
|
22
|
-
"px-md": "px-2",
|
|
23
|
-
"px-lg": "px-2.5",
|
|
24
|
-
"px-xl": "px-3",
|
|
25
|
-
"py-xs": "py-1",
|
|
26
|
-
"py-sm": "py-1.5",
|
|
27
|
-
"py-md": "py-2",
|
|
28
|
-
"py-lg": "py-2.5",
|
|
29
|
-
"py-xl": "py-3",
|
|
30
|
-
// Gaps - small increments
|
|
31
|
-
"gap-sm": "gap-1",
|
|
32
|
-
"gap-md": "gap-1.5",
|
|
33
|
-
"gap-lg": "gap-2",
|
|
34
|
-
"gap-xl": "gap-2.5",
|
|
35
|
-
// Heights
|
|
36
|
-
"h-header": "h-10",
|
|
37
|
-
"h-input": "min-h-10",
|
|
38
|
-
// Text
|
|
39
|
-
"text-base": "text-sm",
|
|
40
|
-
"text-title": "text-xl",
|
|
41
|
-
"text-subtitle": "text-sm"
|
|
42
|
-
},
|
|
43
|
-
normal: {
|
|
44
|
-
// Padding - medium increments (1, 2, 3, 4, 5, 6)
|
|
45
|
-
"p-xs": "p-1",
|
|
46
|
-
"p-sm": "p-2",
|
|
47
|
-
"p-md": "p-3",
|
|
48
|
-
"p-lg": "p-4",
|
|
49
|
-
"p-xl": "p-6",
|
|
50
|
-
"px-xs": "px-1",
|
|
51
|
-
"px-sm": "px-2",
|
|
52
|
-
"px-md": "px-3",
|
|
53
|
-
"px-lg": "px-4",
|
|
54
|
-
"px-xl": "px-6",
|
|
55
|
-
"py-xs": "py-1",
|
|
56
|
-
"py-sm": "py-2",
|
|
57
|
-
"py-md": "py-3",
|
|
58
|
-
"py-lg": "py-4",
|
|
59
|
-
"py-xl": "py-6",
|
|
60
|
-
// Gaps - medium increments
|
|
61
|
-
"gap-sm": "gap-1.5",
|
|
62
|
-
"gap-md": "gap-2",
|
|
63
|
-
"gap-lg": "gap-3",
|
|
64
|
-
"gap-xl": "gap-4",
|
|
65
|
-
// Heights
|
|
66
|
-
"h-header": "h-12",
|
|
67
|
-
"h-input": "min-h-12",
|
|
68
|
-
// Text
|
|
69
|
-
"text-base": "text-base",
|
|
70
|
-
"text-title": "text-2xl",
|
|
71
|
-
"text-subtitle": "text-base"
|
|
72
|
-
},
|
|
73
|
-
spacious: {
|
|
74
|
-
// Padding - large increments (2, 3, 4, 6, 8, 10)
|
|
75
|
-
"p-xs": "p-2",
|
|
76
|
-
"p-sm": "p-3",
|
|
77
|
-
"p-md": "p-4",
|
|
78
|
-
"p-lg": "p-6",
|
|
79
|
-
"p-xl": "p-10",
|
|
80
|
-
"px-xs": "px-2",
|
|
81
|
-
"px-sm": "px-3",
|
|
82
|
-
"px-md": "px-4",
|
|
83
|
-
"px-lg": "px-6",
|
|
84
|
-
"px-xl": "px-10",
|
|
85
|
-
"py-xs": "py-2",
|
|
86
|
-
"py-sm": "py-3",
|
|
87
|
-
"py-md": "py-4",
|
|
88
|
-
"py-lg": "py-6",
|
|
89
|
-
"py-xl": "py-10",
|
|
90
|
-
// Gaps - large increments
|
|
91
|
-
"gap-sm": "gap-2",
|
|
92
|
-
"gap-md": "gap-3",
|
|
93
|
-
"gap-lg": "gap-4",
|
|
94
|
-
"gap-xl": "gap-6",
|
|
95
|
-
// Heights
|
|
96
|
-
"h-header": "h-14",
|
|
97
|
-
"h-input": "min-h-16",
|
|
98
|
-
// Text
|
|
99
|
-
"text-base": "text-lg",
|
|
100
|
-
"text-title": "text-3xl",
|
|
101
|
-
"text-subtitle": "text-lg"
|
|
102
|
-
}
|
|
103
|
-
}, Ze = () => {
|
|
104
|
-
const { config: e } = Ae(), r = e.theme?.density ?? "normal";
|
|
105
|
-
return (o) => Xe[r][o];
|
|
106
|
-
}, He = {
|
|
107
|
-
sharp: {
|
|
108
|
-
sm: "rounded-sm",
|
|
109
|
-
md: "rounded",
|
|
110
|
-
lg: "rounded-md",
|
|
111
|
-
xl: "rounded-lg",
|
|
112
|
-
full: "rounded-lg"
|
|
113
|
-
},
|
|
114
|
-
soft: {
|
|
115
|
-
sm: "rounded",
|
|
116
|
-
md: "rounded-lg",
|
|
117
|
-
lg: "rounded-xl",
|
|
118
|
-
xl: "rounded-2xl",
|
|
119
|
-
full: "rounded-full"
|
|
120
|
-
},
|
|
121
|
-
round: {
|
|
122
|
-
sm: "rounded-lg",
|
|
123
|
-
md: "rounded-xl",
|
|
124
|
-
lg: "rounded-2xl",
|
|
125
|
-
xl: "rounded-3xl",
|
|
126
|
-
full: "rounded-full"
|
|
127
|
-
}
|
|
128
|
-
}, Ke = () => {
|
|
129
|
-
const { config: e } = Ae(), r = e.theme?.radius ?? "soft";
|
|
130
|
-
return (o) => He[r][o];
|
|
131
|
-
};
|
|
132
|
-
function Se(e) {
|
|
5
|
+
function Ae(e) {
|
|
133
6
|
var r, o, t = "";
|
|
134
7
|
if (typeof e == "string" || typeof e == "number") t += e;
|
|
135
8
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
136
9
|
var a = e.length;
|
|
137
|
-
for (r = 0; r < a; r++) e[r] && (o =
|
|
10
|
+
for (r = 0; r < a; r++) e[r] && (o = Ae(e[r])) && (t && (t += " "), t += o);
|
|
138
11
|
} else for (o in e) e[o] && (t && (t += " "), t += o);
|
|
139
12
|
return t;
|
|
140
13
|
}
|
|
141
|
-
function
|
|
142
|
-
for (var e, r, o = 0, t = "", a = arguments.length; o < a; o++) (e = arguments[o]) && (r =
|
|
14
|
+
function Ye() {
|
|
15
|
+
for (var e, r, o = 0, t = "", a = arguments.length; o < a; o++) (e = arguments[o]) && (r = Ae(e)) && (t && (t += " "), t += r);
|
|
143
16
|
return t;
|
|
144
17
|
}
|
|
145
|
-
const
|
|
18
|
+
const Xe = (e, r) => {
|
|
146
19
|
const o = new Array(e.length + r.length);
|
|
147
20
|
for (let t = 0; t < e.length; t++)
|
|
148
21
|
o[t] = e[t];
|
|
149
22
|
for (let t = 0; t < r.length; t++)
|
|
150
23
|
o[e.length + t] = r[t];
|
|
151
24
|
return o;
|
|
152
|
-
},
|
|
25
|
+
}, Ze = (e, r) => ({
|
|
153
26
|
classGroupId: e,
|
|
154
27
|
validator: r
|
|
155
|
-
}),
|
|
28
|
+
}), Se = (e = /* @__PURE__ */ new Map(), r = null, o) => ({
|
|
156
29
|
nextPart: e,
|
|
157
30
|
validators: r,
|
|
158
31
|
classGroupId: o
|
|
159
|
-
}), H = "-", he = [],
|
|
160
|
-
const r =
|
|
32
|
+
}), H = "-", he = [], He = "arbitrary..", Ke = (e) => {
|
|
33
|
+
const r = et(e), {
|
|
161
34
|
conflictingClassGroups: o,
|
|
162
35
|
conflictingClassGroupModifiers: t
|
|
163
36
|
} = e;
|
|
164
37
|
return {
|
|
165
38
|
getClassGroupId: (i) => {
|
|
166
39
|
if (i.startsWith("[") && i.endsWith("]"))
|
|
167
|
-
return
|
|
40
|
+
return Qe(i);
|
|
168
41
|
const u = i.split(H), c = u[0] === "" && u.length > 1 ? 1 : 0;
|
|
169
|
-
return
|
|
42
|
+
return Re(u, c, r);
|
|
170
43
|
},
|
|
171
44
|
getConflictingClassGroupIds: (i, u) => {
|
|
172
45
|
if (u) {
|
|
173
46
|
const c = t[i], g = o[i];
|
|
174
|
-
return c ? g ?
|
|
47
|
+
return c ? g ? Xe(g, c) : c : g || he;
|
|
175
48
|
}
|
|
176
49
|
return o[i] || he;
|
|
177
50
|
}
|
|
178
51
|
};
|
|
179
|
-
},
|
|
52
|
+
}, Re = (e, r, o) => {
|
|
180
53
|
if (e.length - r === 0)
|
|
181
54
|
return o.classGroupId;
|
|
182
55
|
const a = e[r], l = o.nextPart.get(a);
|
|
183
56
|
if (l) {
|
|
184
|
-
const g =
|
|
57
|
+
const g = Re(e, r + 1, l);
|
|
185
58
|
if (g) return g;
|
|
186
59
|
}
|
|
187
60
|
const i = o.validators;
|
|
@@ -193,17 +66,17 @@ const et = (e, r) => {
|
|
|
193
66
|
if (f.validator(u))
|
|
194
67
|
return f.classGroupId;
|
|
195
68
|
}
|
|
196
|
-
},
|
|
69
|
+
}, Qe = (e) => e.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
197
70
|
const r = e.slice(1, -1), o = r.indexOf(":"), t = r.slice(0, o);
|
|
198
|
-
return t ?
|
|
199
|
-
})(),
|
|
71
|
+
return t ? He + t : void 0;
|
|
72
|
+
})(), et = (e) => {
|
|
200
73
|
const {
|
|
201
74
|
theme: r,
|
|
202
75
|
classGroups: o
|
|
203
76
|
} = e;
|
|
204
|
-
return
|
|
205
|
-
},
|
|
206
|
-
const o =
|
|
77
|
+
return tt(o, r);
|
|
78
|
+
}, tt = (e, r) => {
|
|
79
|
+
const o = Se();
|
|
207
80
|
for (const t in e) {
|
|
208
81
|
const a = e[t];
|
|
209
82
|
ae(a, o, t, r);
|
|
@@ -213,43 +86,43 @@ const et = (e, r) => {
|
|
|
213
86
|
const a = e.length;
|
|
214
87
|
for (let l = 0; l < a; l++) {
|
|
215
88
|
const i = e[l];
|
|
216
|
-
|
|
89
|
+
rt(i, r, o, t);
|
|
217
90
|
}
|
|
218
|
-
},
|
|
91
|
+
}, rt = (e, r, o, t) => {
|
|
219
92
|
if (typeof e == "string") {
|
|
220
|
-
|
|
93
|
+
ot(e, r, o);
|
|
221
94
|
return;
|
|
222
95
|
}
|
|
223
96
|
if (typeof e == "function") {
|
|
224
|
-
|
|
97
|
+
st(e, r, o, t);
|
|
225
98
|
return;
|
|
226
99
|
}
|
|
227
|
-
|
|
228
|
-
},
|
|
229
|
-
const t = e === "" ? r :
|
|
100
|
+
nt(e, r, o, t);
|
|
101
|
+
}, ot = (e, r, o) => {
|
|
102
|
+
const t = e === "" ? r : Ie(r, e);
|
|
230
103
|
t.classGroupId = o;
|
|
231
|
-
},
|
|
232
|
-
if (
|
|
104
|
+
}, st = (e, r, o, t) => {
|
|
105
|
+
if (at(e)) {
|
|
233
106
|
ae(e(t), r, o, t);
|
|
234
107
|
return;
|
|
235
108
|
}
|
|
236
|
-
r.validators === null && (r.validators = []), r.validators.push(
|
|
237
|
-
},
|
|
109
|
+
r.validators === null && (r.validators = []), r.validators.push(Ze(o, e));
|
|
110
|
+
}, nt = (e, r, o, t) => {
|
|
238
111
|
const a = Object.entries(e), l = a.length;
|
|
239
112
|
for (let i = 0; i < l; i++) {
|
|
240
113
|
const [u, c] = a[i];
|
|
241
|
-
ae(c,
|
|
114
|
+
ae(c, Ie(r, u), o, t);
|
|
242
115
|
}
|
|
243
|
-
},
|
|
116
|
+
}, Ie = (e, r) => {
|
|
244
117
|
let o = e;
|
|
245
118
|
const t = r.split(H), a = t.length;
|
|
246
119
|
for (let l = 0; l < a; l++) {
|
|
247
120
|
const i = t[l];
|
|
248
121
|
let u = o.nextPart.get(i);
|
|
249
|
-
u || (u =
|
|
122
|
+
u || (u = Se(), o.nextPart.set(i, u)), o = u;
|
|
250
123
|
}
|
|
251
124
|
return o;
|
|
252
|
-
},
|
|
125
|
+
}, at = (e) => "isThemeGetter" in e && e.isThemeGetter === !0, it = (e) => {
|
|
253
126
|
if (e < 1)
|
|
254
127
|
return {
|
|
255
128
|
get: () => {
|
|
@@ -273,13 +146,13 @@ const et = (e, r) => {
|
|
|
273
146
|
l in o ? o[l] = i : a(l, i);
|
|
274
147
|
}
|
|
275
148
|
};
|
|
276
|
-
}, ne = "!", xe = ":",
|
|
149
|
+
}, ne = "!", xe = ":", lt = [], ye = (e, r, o, t, a) => ({
|
|
277
150
|
modifiers: e,
|
|
278
151
|
hasImportantModifier: r,
|
|
279
152
|
baseClassName: o,
|
|
280
153
|
maybePostfixModifierPosition: t,
|
|
281
154
|
isExternal: a
|
|
282
|
-
}),
|
|
155
|
+
}), ct = (e) => {
|
|
283
156
|
const {
|
|
284
157
|
prefix: r,
|
|
285
158
|
experimentalParseClassName: o
|
|
@@ -316,7 +189,7 @@ const et = (e, r) => {
|
|
|
316
189
|
};
|
|
317
190
|
if (r) {
|
|
318
191
|
const a = r + xe, l = t;
|
|
319
|
-
t = (i) => i.startsWith(a) ? l(i.slice(a.length)) : ye(
|
|
192
|
+
t = (i) => i.startsWith(a) ? l(i.slice(a.length)) : ye(lt, !1, i, void 0, !0);
|
|
320
193
|
}
|
|
321
194
|
if (o) {
|
|
322
195
|
const a = t;
|
|
@@ -326,7 +199,7 @@ const et = (e, r) => {
|
|
|
326
199
|
});
|
|
327
200
|
}
|
|
328
201
|
return t;
|
|
329
|
-
},
|
|
202
|
+
}, dt = (e) => {
|
|
330
203
|
const r = /* @__PURE__ */ new Map();
|
|
331
204
|
return e.orderSensitiveModifiers.forEach((o, t) => {
|
|
332
205
|
r.set(o, 1e6 + t);
|
|
@@ -339,18 +212,18 @@ const et = (e, r) => {
|
|
|
339
212
|
}
|
|
340
213
|
return a.length > 0 && (a.sort(), t.push(...a)), t;
|
|
341
214
|
};
|
|
342
|
-
},
|
|
343
|
-
cache:
|
|
344
|
-
parseClassName:
|
|
345
|
-
sortModifiers:
|
|
346
|
-
...
|
|
347
|
-
}),
|
|
215
|
+
}, pt = (e) => ({
|
|
216
|
+
cache: it(e.cacheSize),
|
|
217
|
+
parseClassName: ct(e),
|
|
218
|
+
sortModifiers: dt(e),
|
|
219
|
+
...Ke(e)
|
|
220
|
+
}), mt = /\s+/, ut = (e, r) => {
|
|
348
221
|
const {
|
|
349
222
|
parseClassName: o,
|
|
350
223
|
getClassGroupId: t,
|
|
351
224
|
getConflictingClassGroupIds: a,
|
|
352
225
|
sortModifiers: l
|
|
353
|
-
} = r, i = [], u = e.trim().split(
|
|
226
|
+
} = r, i = [], u = e.trim().split(mt);
|
|
354
227
|
let c = "";
|
|
355
228
|
for (let g = u.length - 1; g >= 0; g -= 1) {
|
|
356
229
|
const f = u[g], {
|
|
@@ -388,46 +261,46 @@ const et = (e, r) => {
|
|
|
388
261
|
c = f + (c.length > 0 ? " " + c : c);
|
|
389
262
|
}
|
|
390
263
|
return c;
|
|
391
|
-
},
|
|
264
|
+
}, gt = (...e) => {
|
|
392
265
|
let r = 0, o, t, a = "";
|
|
393
266
|
for (; r < e.length; )
|
|
394
|
-
(o = e[r++]) && (t =
|
|
267
|
+
(o = e[r++]) && (t = Ne(o)) && (a && (a += " "), a += t);
|
|
395
268
|
return a;
|
|
396
|
-
},
|
|
269
|
+
}, Ne = (e) => {
|
|
397
270
|
if (typeof e == "string")
|
|
398
271
|
return e;
|
|
399
272
|
let r, o = "";
|
|
400
273
|
for (let t = 0; t < e.length; t++)
|
|
401
|
-
e[t] && (r =
|
|
274
|
+
e[t] && (r = Ne(e[t])) && (o && (o += " "), o += r);
|
|
402
275
|
return o;
|
|
403
|
-
},
|
|
276
|
+
}, ft = (e, ...r) => {
|
|
404
277
|
let o, t, a, l;
|
|
405
278
|
const i = (c) => {
|
|
406
279
|
const g = r.reduce((f, x) => x(f), e());
|
|
407
|
-
return o =
|
|
280
|
+
return o = pt(g), t = o.cache.get, a = o.cache.set, l = u, u(c);
|
|
408
281
|
}, u = (c) => {
|
|
409
282
|
const g = t(c);
|
|
410
283
|
if (g)
|
|
411
284
|
return g;
|
|
412
|
-
const f =
|
|
285
|
+
const f = ut(c, o);
|
|
413
286
|
return a(c, f), f;
|
|
414
287
|
};
|
|
415
|
-
return l = i, (...c) => l(
|
|
416
|
-
},
|
|
417
|
-
const r = (o) => o[e] ||
|
|
288
|
+
return l = i, (...c) => l(gt(...c));
|
|
289
|
+
}, bt = [], b = (e) => {
|
|
290
|
+
const r = (o) => o[e] || bt;
|
|
418
291
|
return r.isThemeGetter = !0, r;
|
|
419
|
-
},
|
|
292
|
+
}, Ee = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, Te = /^\((?:(\w[\w-]*):)?(.+)\)$/i, ht = /^\d+\/\d+$/, xt = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, yt = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, wt = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, kt = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, vt = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, L = (e) => ht.test(e), m = (e) => !!e && !Number.isNaN(Number(e)), I = (e) => !!e && Number.isInteger(Number(e)), re = (e) => e.endsWith("%") && m(e.slice(0, -1)), R = (e) => xt.test(e), Ct = () => !0, zt = (e) => (
|
|
420
293
|
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
421
294
|
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
422
295
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
423
|
-
|
|
424
|
-
),
|
|
425
|
-
const t =
|
|
296
|
+
yt.test(e) && !wt.test(e)
|
|
297
|
+
), Me = () => !1, At = (e) => kt.test(e), St = (e) => vt.test(e), Rt = (e) => !s(e) && !n(e), It = (e) => V(e, Ge, Me), s = (e) => Ee.test(e), O = (e) => V(e, je, zt), oe = (e) => V(e, Ot, m), we = (e) => V(e, Oe, Me), Nt = (e) => V(e, Pe, St), X = (e) => V(e, Le, At), n = (e) => Te.test(e), U = (e) => F(e, je), Et = (e) => F(e, Pt), ke = (e) => F(e, Oe), Tt = (e) => F(e, Ge), Mt = (e) => F(e, Pe), Z = (e) => F(e, Le, !0), V = (e, r, o) => {
|
|
298
|
+
const t = Ee.exec(e);
|
|
426
299
|
return t ? t[1] ? r(t[1]) : o(t[2]) : !1;
|
|
427
300
|
}, F = (e, r, o = !1) => {
|
|
428
|
-
const t =
|
|
301
|
+
const t = Te.exec(e);
|
|
429
302
|
return t ? t[1] ? r(t[1]) : o : !1;
|
|
430
|
-
},
|
|
303
|
+
}, Oe = (e) => e === "position" || e === "percentage", Pe = (e) => e === "image" || e === "url", Ge = (e) => e === "length" || e === "size" || e === "bg-size", je = (e) => e === "length", Ot = (e) => e === "number", Pt = (e) => e === "family-name", Le = (e) => e === "shadow", Gt = () => {
|
|
431
304
|
const e = b("color"), r = b("font"), o = b("text"), t = b("font-weight"), a = b("tracking"), l = b("leading"), i = b("breakpoint"), u = b("container"), c = b("spacing"), g = b("radius"), f = b("shadow"), x = b("inset-shadow"), y = b("text-shadow"), z = b("drop-shadow"), N = b("blur"), C = b("perspective"), k = b("aspect"), E = b("ease"), B = b("animate"), W = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], P = () => [
|
|
432
305
|
"center",
|
|
433
306
|
"top",
|
|
@@ -452,7 +325,7 @@ const et = (e, r) => {
|
|
|
452
325
|
position: [n, s]
|
|
453
326
|
}], pe = () => ["no-repeat", {
|
|
454
327
|
repeat: ["", "x", "y", "space", "round"]
|
|
455
|
-
}], me = () => ["auto", "cover", "contain",
|
|
328
|
+
}], me = () => ["auto", "cover", "contain", Tt, It, {
|
|
456
329
|
size: [n, s]
|
|
457
330
|
}], Q = () => [re, U, O], w = () => [
|
|
458
331
|
// Deprecated since Tailwind CSS v4.0.0
|
|
@@ -477,11 +350,11 @@ const et = (e, r) => {
|
|
|
477
350
|
aspect: ["video"],
|
|
478
351
|
blur: [R],
|
|
479
352
|
breakpoint: [R],
|
|
480
|
-
color: [
|
|
353
|
+
color: [Ct],
|
|
481
354
|
container: [R],
|
|
482
355
|
"drop-shadow": [R],
|
|
483
356
|
ease: ["in", "out", "in-out"],
|
|
484
|
-
font: [
|
|
357
|
+
font: [Rt],
|
|
485
358
|
"font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
|
|
486
359
|
"inset-shadow": [R],
|
|
487
360
|
leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
|
|
@@ -1193,7 +1066,7 @@ const et = (e, r) => {
|
|
|
1193
1066
|
* @see https://tailwindcss.com/docs/font-family
|
|
1194
1067
|
*/
|
|
1195
1068
|
"font-family": [{
|
|
1196
|
-
font: [
|
|
1069
|
+
font: [Et, s, r]
|
|
1197
1070
|
}],
|
|
1198
1071
|
/**
|
|
1199
1072
|
* Font Variant Numeric
|
|
@@ -1448,7 +1321,7 @@ const et = (e, r) => {
|
|
|
1448
1321
|
}, I, n, s],
|
|
1449
1322
|
radial: ["", n, s],
|
|
1450
1323
|
conic: [I, n, s]
|
|
1451
|
-
},
|
|
1324
|
+
}, Mt, Nt]
|
|
1452
1325
|
}],
|
|
1453
1326
|
/**
|
|
1454
1327
|
* Background Color
|
|
@@ -2897,17 +2770,144 @@ const et = (e, r) => {
|
|
|
2897
2770
|
},
|
|
2898
2771
|
orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
|
|
2899
2772
|
};
|
|
2900
|
-
},
|
|
2901
|
-
function
|
|
2902
|
-
return
|
|
2773
|
+
}, jt = /* @__PURE__ */ ft(Gt);
|
|
2774
|
+
function Lt(...e) {
|
|
2775
|
+
return jt(Ye(e));
|
|
2903
2776
|
}
|
|
2904
|
-
function
|
|
2777
|
+
function or(e) {
|
|
2905
2778
|
throw new Error(`Unexpected value: ${e}`);
|
|
2906
2779
|
}
|
|
2907
|
-
function
|
|
2780
|
+
function sr(e, r) {
|
|
2908
2781
|
if (!e)
|
|
2909
2782
|
throw new Error(r);
|
|
2910
2783
|
}
|
|
2784
|
+
const Vt = Ce(
|
|
2785
|
+
void 0
|
|
2786
|
+
), nr = Ce(null), Ve = () => {
|
|
2787
|
+
const e = We(Vt);
|
|
2788
|
+
if (!e)
|
|
2789
|
+
throw new Error("useElements must be used within a ElementsProvider");
|
|
2790
|
+
return e;
|
|
2791
|
+
}, Ft = {
|
|
2792
|
+
compact: {
|
|
2793
|
+
// Padding - small increments (1, 1.5, 2, 2.5, 3)
|
|
2794
|
+
"p-xs": "p-1",
|
|
2795
|
+
"p-sm": "p-1.5",
|
|
2796
|
+
"p-md": "p-2",
|
|
2797
|
+
"p-lg": "p-2.5",
|
|
2798
|
+
"p-xl": "p-3",
|
|
2799
|
+
"px-xs": "px-1",
|
|
2800
|
+
"px-sm": "px-1.5",
|
|
2801
|
+
"px-md": "px-2",
|
|
2802
|
+
"px-lg": "px-2.5",
|
|
2803
|
+
"px-xl": "px-3",
|
|
2804
|
+
"py-xs": "py-1",
|
|
2805
|
+
"py-sm": "py-1.5",
|
|
2806
|
+
"py-md": "py-2",
|
|
2807
|
+
"py-lg": "py-2.5",
|
|
2808
|
+
"py-xl": "py-3",
|
|
2809
|
+
// Gaps - small increments
|
|
2810
|
+
"gap-sm": "gap-1",
|
|
2811
|
+
"gap-md": "gap-1.5",
|
|
2812
|
+
"gap-lg": "gap-2",
|
|
2813
|
+
"gap-xl": "gap-2.5",
|
|
2814
|
+
// Heights
|
|
2815
|
+
"h-header": "h-10",
|
|
2816
|
+
"h-input": "min-h-10",
|
|
2817
|
+
// Text
|
|
2818
|
+
"text-base": "text-sm",
|
|
2819
|
+
"text-title": "text-xl",
|
|
2820
|
+
"text-subtitle": "text-sm"
|
|
2821
|
+
},
|
|
2822
|
+
normal: {
|
|
2823
|
+
// Padding - medium increments (1, 2, 3, 4, 5, 6)
|
|
2824
|
+
"p-xs": "p-1",
|
|
2825
|
+
"p-sm": "p-2",
|
|
2826
|
+
"p-md": "p-3",
|
|
2827
|
+
"p-lg": "p-4",
|
|
2828
|
+
"p-xl": "p-6",
|
|
2829
|
+
"px-xs": "px-1",
|
|
2830
|
+
"px-sm": "px-2",
|
|
2831
|
+
"px-md": "px-3",
|
|
2832
|
+
"px-lg": "px-4",
|
|
2833
|
+
"px-xl": "px-6",
|
|
2834
|
+
"py-xs": "py-1",
|
|
2835
|
+
"py-sm": "py-2",
|
|
2836
|
+
"py-md": "py-3",
|
|
2837
|
+
"py-lg": "py-4",
|
|
2838
|
+
"py-xl": "py-6",
|
|
2839
|
+
// Gaps - medium increments
|
|
2840
|
+
"gap-sm": "gap-1.5",
|
|
2841
|
+
"gap-md": "gap-2",
|
|
2842
|
+
"gap-lg": "gap-3",
|
|
2843
|
+
"gap-xl": "gap-4",
|
|
2844
|
+
// Heights
|
|
2845
|
+
"h-header": "h-12",
|
|
2846
|
+
"h-input": "min-h-12",
|
|
2847
|
+
// Text
|
|
2848
|
+
"text-base": "text-base",
|
|
2849
|
+
"text-title": "text-2xl",
|
|
2850
|
+
"text-subtitle": "text-base"
|
|
2851
|
+
},
|
|
2852
|
+
spacious: {
|
|
2853
|
+
// Padding - large increments (2, 3, 4, 6, 8, 10)
|
|
2854
|
+
"p-xs": "p-2",
|
|
2855
|
+
"p-sm": "p-3",
|
|
2856
|
+
"p-md": "p-4",
|
|
2857
|
+
"p-lg": "p-6",
|
|
2858
|
+
"p-xl": "p-10",
|
|
2859
|
+
"px-xs": "px-2",
|
|
2860
|
+
"px-sm": "px-3",
|
|
2861
|
+
"px-md": "px-4",
|
|
2862
|
+
"px-lg": "px-6",
|
|
2863
|
+
"px-xl": "px-10",
|
|
2864
|
+
"py-xs": "py-2",
|
|
2865
|
+
"py-sm": "py-3",
|
|
2866
|
+
"py-md": "py-4",
|
|
2867
|
+
"py-lg": "py-6",
|
|
2868
|
+
"py-xl": "py-10",
|
|
2869
|
+
// Gaps - large increments
|
|
2870
|
+
"gap-sm": "gap-2",
|
|
2871
|
+
"gap-md": "gap-3",
|
|
2872
|
+
"gap-lg": "gap-4",
|
|
2873
|
+
"gap-xl": "gap-6",
|
|
2874
|
+
// Heights
|
|
2875
|
+
"h-header": "h-14",
|
|
2876
|
+
"h-input": "min-h-16",
|
|
2877
|
+
// Text
|
|
2878
|
+
"text-base": "text-lg",
|
|
2879
|
+
"text-title": "text-3xl",
|
|
2880
|
+
"text-subtitle": "text-lg"
|
|
2881
|
+
}
|
|
2882
|
+
}, Wt = () => {
|
|
2883
|
+
const { config: e } = Ve(), r = e.theme?.density ?? "normal";
|
|
2884
|
+
return (o) => Ft[r][o];
|
|
2885
|
+
}, _t = {
|
|
2886
|
+
sharp: {
|
|
2887
|
+
sm: "rounded-sm",
|
|
2888
|
+
md: "rounded",
|
|
2889
|
+
lg: "rounded-md",
|
|
2890
|
+
xl: "rounded-lg",
|
|
2891
|
+
full: "rounded-lg"
|
|
2892
|
+
},
|
|
2893
|
+
soft: {
|
|
2894
|
+
sm: "rounded",
|
|
2895
|
+
md: "rounded-lg",
|
|
2896
|
+
lg: "rounded-xl",
|
|
2897
|
+
xl: "rounded-2xl",
|
|
2898
|
+
full: "rounded-full"
|
|
2899
|
+
},
|
|
2900
|
+
round: {
|
|
2901
|
+
sm: "rounded-lg",
|
|
2902
|
+
md: "rounded-xl",
|
|
2903
|
+
lg: "rounded-2xl",
|
|
2904
|
+
xl: "rounded-3xl",
|
|
2905
|
+
full: "rounded-full"
|
|
2906
|
+
}
|
|
2907
|
+
}, Ut = () => {
|
|
2908
|
+
const { config: e } = Ve(), r = e.theme?.radius ?? "soft";
|
|
2909
|
+
return (o) => _t[r][o];
|
|
2910
|
+
};
|
|
2911
2911
|
const Bt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), $t = (e) => e.replace(
|
|
2912
2912
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2913
2913
|
(r, o, t) => t ? t.toUpperCase() : o.toLowerCase()
|
|
@@ -2979,7 +2979,7 @@ const Xt = [
|
|
|
2979
2979
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
2980
2980
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
2981
2981
|
], Zt = Yt("circle-alert", Xt), Ht = ({ code: e }) => {
|
|
2982
|
-
const r = $e(({ message: x }) => x), o = be(null), t = be(null), [a, l] = _e(null), i = r.status?.type === "complete", u =
|
|
2982
|
+
const r = $e(({ message: x }) => x), o = be(null), t = be(null), [a, l] = _e(null), i = r.status?.type === "complete", u = Ut(), c = Wt(), g = Ue(() => {
|
|
2983
2983
|
const x = e.trim();
|
|
2984
2984
|
if (!x) return null;
|
|
2985
2985
|
try {
|
|
@@ -3006,7 +3006,7 @@ const Xt = [
|
|
|
3006
3006
|
}), [f, g]), /* @__PURE__ */ fe(
|
|
3007
3007
|
"div",
|
|
3008
3008
|
{
|
|
3009
|
-
className:
|
|
3009
|
+
className: Lt(
|
|
3010
3010
|
// the after:hidden is to prevent assistant-ui from showing its default code block loading indicator
|
|
3011
3011
|
"relative flex min-h-[400px] w-fit max-w-full min-w-[400px] items-center justify-center border p-6 after:hidden",
|
|
3012
3012
|
u("lg"),
|
|
@@ -3044,16 +3044,16 @@ The Vega spec will be parsed with JSON.parse() - if it fails, the chart will err
|
|
|
3044
3044
|
Header: void 0
|
|
3045
3045
|
}, ar = [Kt];
|
|
3046
3046
|
export {
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3047
|
+
Vt as E,
|
|
3048
|
+
nr as T,
|
|
3049
|
+
sr as a,
|
|
3050
|
+
Lt as b,
|
|
3051
3051
|
Yt as c,
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3052
|
+
Ye as d,
|
|
3053
|
+
Wt as e,
|
|
3054
|
+
Ut as f,
|
|
3055
|
+
or as g,
|
|
3056
3056
|
Kt as h,
|
|
3057
3057
|
ar as r,
|
|
3058
|
-
|
|
3058
|
+
Ve as u
|
|
3059
3059
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { useElements as useGramElements } from './hooks/useElements';
|
|
|
3
3
|
export { Chat } from './components/Chat';
|
|
4
4
|
export { defineFrontendTool } from './lib/tools';
|
|
5
5
|
export type { FrontendTool } from './lib/tools';
|
|
6
|
-
export type {
|
|
6
|
+
export type { AttachmentsConfig, COLOR_SCHEMES, ColorScheme, ComponentOverrides, ComposerConfig, DENSITIES, Density, Dimension, Dimensions, ElementsConfig, GetSessionFn, ModalConfig, ModalTriggerPosition, Model, ModelConfig, RADII, Radius, SidecarConfig, Suggestion, ThemeConfig, ToolsConfig, Variant, VARIANTS, WelcomeConfig, } from './types';
|
|
7
7
|
export { MODELS } from './lib/models';
|
|
8
8
|
export type { Plugin } from './types/plugins';
|
package/dist/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Bj7jPiuy.cjs");exports.chart=e.chart;exports.recommended=e.recommended;
|
package/dist/plugins.js
CHANGED