@opentiny/tiny-robot 0.3.0-alpha.15 → 0.3.0-alpha.16
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/action-group/index.js +41 -44
- package/dist/bubble/index.js +1163 -1112
- package/dist/close.js +1 -1
- package/dist/container/index.js +30 -30
- package/dist/dropdown-menu/index.js +64 -151
- package/dist/feedback/index.js +52 -52
- package/dist/flow-layout-buttons/index.js +14 -17
- package/dist/history/index.js +49 -49
- package/dist/icon-button/index.js +19 -18
- package/dist/index.d.ts +915 -1123
- package/dist/index.js +77 -206
- package/dist/index2.js +530 -610
- package/dist/index3.js +297 -692
- package/dist/index4.js +622 -146
- package/dist/index5.js +2067 -227
- package/dist/index6.js +4653 -2256
- package/dist/question/index.js +35 -35
- package/dist/sender/index.js +1206 -1134
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +61 -61
- package/dist/suggestion-pills/index.js +155 -131
- package/dist/suggestion-popover/index.js +219 -250
- package/dist/tiny-robot-svgs.js +180 -679
- package/dist/utils.js +13 -8
- package/package.json +3 -10
- package/dist/attachments/index.js +0 -526
- package/dist/base-popper/index.js +0 -4
- package/dist/drag-overlay/index.js +0 -57
- package/dist/index7.js +0 -6654
- package/dist/mcp-server-picker/index.js +0 -29972
- package/dist/useSlotRefs.js +0 -36
|
@@ -1,177 +1,201 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as T, useSlots as H, computed as k, createElementBlock as f, openBlock as n, normalizeClass as A, renderSlot as $, createBlock as v, resolveDynamicComponent as N, createCommentVNode as b, toDisplayString as j, unref as h, mergeProps as D, createSlots as q, withCtx as B, createVNode as I, renderList as M, normalizeStyle as O, mergeModels as E, ref as P, useModel as J, watch as K, createElementVNode as R, Fragment as z, Transition as Q, nextTick as U } from "vue";
|
|
2
|
+
import { l as X } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { b as Y, w as Z, o as x } from "../index2.js";
|
|
4
|
+
import ee from "../dropdown-menu/index.js";
|
|
5
|
+
import te from "../suggestion-popover/index.js";
|
|
6
|
+
import { _ as V } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const oe = { key: 0 }, ne = /* @__PURE__ */ T({
|
|
7
8
|
__name: "PillButton",
|
|
8
9
|
props: {
|
|
9
10
|
item: {}
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
12
|
+
setup(u) {
|
|
13
|
+
const g = u, l = H(), e = k(() => {
|
|
13
14
|
var o;
|
|
14
|
-
return !!(
|
|
15
|
-
}),
|
|
15
|
+
return !!(l.icon || (o = g.item) != null && o.icon);
|
|
16
|
+
}), r = k(() => {
|
|
16
17
|
var o;
|
|
17
|
-
return !!(
|
|
18
|
-
}),
|
|
19
|
-
return (o,
|
|
20
|
-
class:
|
|
18
|
+
return !!(l.default || (o = g.item) != null && o.text);
|
|
19
|
+
}), m = k(() => e.value && !r.value);
|
|
20
|
+
return (o, c) => (n(), f("button", {
|
|
21
|
+
class: A(["tr-suggestion-pills__item", { "only-icon": m.value }])
|
|
21
22
|
}, [
|
|
22
|
-
|
|
23
|
-
var
|
|
23
|
+
$(o.$slots, "icon", {}, () => {
|
|
24
|
+
var i;
|
|
24
25
|
return [
|
|
25
|
-
(
|
|
26
|
+
(n(), v(N((i = o.item) == null ? void 0 : i.icon), { class: "tr-suggestion-pills__item_icon" }))
|
|
26
27
|
];
|
|
27
28
|
}, !0),
|
|
28
|
-
|
|
29
|
-
var
|
|
29
|
+
$(o.$slots, "default", {}, () => {
|
|
30
|
+
var i;
|
|
30
31
|
return [
|
|
31
|
-
(
|
|
32
|
+
(i = o.item) != null && i.text ? (n(), f("span", oe, j(o.item.text), 1)) : b("", !0)
|
|
32
33
|
];
|
|
33
34
|
}, !0)
|
|
34
35
|
], 2));
|
|
35
36
|
}
|
|
36
|
-
}),
|
|
37
|
+
}), d = /* @__PURE__ */ V(ne, [["__scopeId", "data-v-5c113fe1"]]), L = /* @__PURE__ */ T({
|
|
38
|
+
__name: "PillButtonWrapper",
|
|
39
|
+
props: {
|
|
40
|
+
item: {},
|
|
41
|
+
style: {}
|
|
42
|
+
},
|
|
43
|
+
emits: ["click"],
|
|
44
|
+
setup(u, { emit: g }) {
|
|
45
|
+
const l = g;
|
|
46
|
+
return (e, r) => {
|
|
47
|
+
var m, o, c, i, p, y;
|
|
48
|
+
return ((m = e.item.action) == null ? void 0 : m.type) === "popover" ? (n(), v(h(te), D({
|
|
49
|
+
key: 0,
|
|
50
|
+
style: e.style
|
|
51
|
+
}, e.item.action.props, {
|
|
52
|
+
onItemClick: (o = e.item.action.events) == null ? void 0 : o.itemClick,
|
|
53
|
+
onGroupClick: (c = e.item.action.events) == null ? void 0 : c.groupClick,
|
|
54
|
+
onClose: (i = e.item.action.events) == null ? void 0 : i.close
|
|
55
|
+
}), q({
|
|
56
|
+
default: B(() => [
|
|
57
|
+
I(d, {
|
|
58
|
+
item: e.item,
|
|
59
|
+
onClick: r[0] || (r[0] = (a) => l("click", a, e.item))
|
|
60
|
+
}, null, 8, ["item"])
|
|
61
|
+
]),
|
|
62
|
+
_: 2
|
|
63
|
+
}, [
|
|
64
|
+
M(e.item.action.slots, (a, C) => ({
|
|
65
|
+
name: C,
|
|
66
|
+
fn: B(() => [
|
|
67
|
+
(n(), v(N(a)))
|
|
68
|
+
])
|
|
69
|
+
}))
|
|
70
|
+
]), 1040, ["style", "onItemClick", "onGroupClick", "onClose"])) : ((p = e.item.action) == null ? void 0 : p.type) === "menu" ? (n(), v(h(ee), D({
|
|
71
|
+
key: 1,
|
|
72
|
+
style: e.style
|
|
73
|
+
}, e.item.action.props, {
|
|
74
|
+
onItemClick: (y = e.item.action.events) == null ? void 0 : y.itemClick
|
|
75
|
+
}), {
|
|
76
|
+
default: B(() => [
|
|
77
|
+
I(d, {
|
|
78
|
+
item: e.item,
|
|
79
|
+
onClick: r[1] || (r[1] = (a) => l("click", a, e.item))
|
|
80
|
+
}, null, 8, ["item"])
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
}, 16, ["style", "onItemClick"])) : (n(), v(d, {
|
|
84
|
+
key: 2,
|
|
85
|
+
item: e.item,
|
|
86
|
+
style: O(e.style),
|
|
87
|
+
onClick: r[2] || (r[2] = (a) => l("click", a, e.item))
|
|
88
|
+
}, null, 8, ["item", "style"]));
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}), le = { class: "tr-suggestion-pills__more-wrapper" }, ie = {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: "tr-suggestion-pills__more"
|
|
94
|
+
}, se = /* @__PURE__ */ T({
|
|
37
95
|
__name: "index",
|
|
38
|
-
props: /* @__PURE__ */
|
|
96
|
+
props: /* @__PURE__ */ E({
|
|
97
|
+
items: {},
|
|
39
98
|
showAll: { type: Boolean },
|
|
40
|
-
showAllButtonOn: { default: "hover" }
|
|
41
|
-
overflowMode: { default: "expand" },
|
|
42
|
-
autoScrollOn: {}
|
|
99
|
+
showAllButtonOn: { default: "hover" }
|
|
43
100
|
}, {
|
|
44
101
|
showAll: { type: Boolean, default: !1 },
|
|
45
102
|
showAllModifiers: {}
|
|
46
103
|
}),
|
|
47
|
-
emits: /* @__PURE__ */
|
|
48
|
-
setup(
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
$(() => {
|
|
57
|
-
const e = f.value;
|
|
58
|
-
if (!e)
|
|
104
|
+
emits: /* @__PURE__ */ E(["item-click", "click-outside"], ["update:showAll"]),
|
|
105
|
+
setup(u, { emit: g }) {
|
|
106
|
+
const l = u, e = g, r = P(null), m = P(null), { width: o } = Y(m), c = P(-1), i = k(() => c.value !== -1), p = J(u, "showAll"), y = k(() => {
|
|
107
|
+
var t;
|
|
108
|
+
return !i.value || !p.value ? ((t = l.items) == null ? void 0 : t.length) || 0 : c.value;
|
|
109
|
+
}), a = k(() => !i.value || !p.value ? [] : (l.items || []).slice(c.value)), C = () => {
|
|
110
|
+
U(() => {
|
|
111
|
+
const t = m.value;
|
|
112
|
+
if (!t)
|
|
59
113
|
return;
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
let l = 0;
|
|
63
|
-
for (let s = 0; s < t.length; s++)
|
|
64
|
-
if (l += t[s].offsetWidth, s > 0 && (l += n), l > e.clientWidth) {
|
|
65
|
-
g.value = s;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
114
|
+
const _ = Array.from(t.children);
|
|
115
|
+
c.value = _.findIndex((s) => s.offsetLeft + s.offsetWidth > t.clientWidth);
|
|
68
116
|
});
|
|
69
117
|
};
|
|
70
|
-
|
|
118
|
+
K(() => {
|
|
119
|
+
var t;
|
|
120
|
+
return [l.items, (t = l.items) == null ? void 0 : t.length];
|
|
121
|
+
}, C), Z(
|
|
71
122
|
o,
|
|
72
|
-
() => {
|
|
73
|
-
|
|
74
|
-
if (!f.value)
|
|
75
|
-
return;
|
|
76
|
-
const e = L(), t = parseFloat(getComputedStyle(f.value).rowGap) || 0;
|
|
77
|
-
C.value = e.reduce((n, l, s) => n + l.offsetWidth + (s > 0 ? t : 0), 0);
|
|
78
|
-
});
|
|
123
|
+
(t) => {
|
|
124
|
+
t > 0 && C();
|
|
79
125
|
},
|
|
80
|
-
{
|
|
81
|
-
)
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
fe(c, (e) => {
|
|
86
|
-
u.value && x("click-outside", e);
|
|
87
|
-
});
|
|
88
|
-
const ee = (e) => {
|
|
89
|
-
const t = f.value;
|
|
90
|
-
if (!t)
|
|
126
|
+
{ debounce: 100 }
|
|
127
|
+
);
|
|
128
|
+
const G = (t, _, s) => {
|
|
129
|
+
if (i.value && s >= c.value) {
|
|
130
|
+
t.stopPropagation(), W();
|
|
91
131
|
return;
|
|
92
|
-
const n = e.offsetLeft, l = n + e.offsetWidth, s = t.scrollLeft, F = t.clientWidth, te = n < s, oe = l > s + F;
|
|
93
|
-
te ? t.scrollTo({
|
|
94
|
-
left: n,
|
|
95
|
-
behavior: "smooth"
|
|
96
|
-
}) : oe && t.scrollTo({
|
|
97
|
-
left: l - F,
|
|
98
|
-
behavior: "smooth"
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
let y = null;
|
|
102
|
-
return R(
|
|
103
|
-
() => p.autoScrollOn,
|
|
104
|
-
(e) => {
|
|
105
|
-
y && (y(), y = null), e && (y = de(V, e, (t) => {
|
|
106
|
-
t.currentTarget && ee(t.currentTarget);
|
|
107
|
-
}));
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
immediate: !0
|
|
111
132
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
133
|
+
e("item-click", _);
|
|
134
|
+
}, W = () => {
|
|
135
|
+
p.value = !p.value;
|
|
136
|
+
};
|
|
137
|
+
return x(r, (t) => {
|
|
138
|
+
e("click-outside", t);
|
|
139
|
+
}), (t, _) => (n(), f("div", {
|
|
115
140
|
class: "tr-suggestion-pills__wrapper",
|
|
116
141
|
ref_key: "containerWrapperRef",
|
|
117
|
-
ref:
|
|
142
|
+
ref: r
|
|
118
143
|
}, [
|
|
119
|
-
|
|
120
|
-
class:
|
|
144
|
+
R("div", {
|
|
145
|
+
class: "tr-suggestion-pills__container",
|
|
121
146
|
ref_key: "containerRef",
|
|
122
|
-
ref:
|
|
147
|
+
ref: m
|
|
123
148
|
}, [
|
|
124
|
-
(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
(
|
|
141
|
-
key:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
], 512)) : M("", !0)
|
|
149
|
+
$(t.$slots, "default", {}, () => [
|
|
150
|
+
(n(!0), f(z, null, M(l.items, (s, w) => (n(), v(h(L), {
|
|
151
|
+
key: s.id,
|
|
152
|
+
item: s,
|
|
153
|
+
style: O({
|
|
154
|
+
visibility: w < y.value ? void 0 : "hidden",
|
|
155
|
+
pointerEvents: w < y.value ? void 0 : "none"
|
|
156
|
+
}),
|
|
157
|
+
onClick: (F) => G(F, s, w)
|
|
158
|
+
}, null, 8, ["item", "style", "onClick"]))), 128))
|
|
159
|
+
], !0)
|
|
160
|
+
], 512),
|
|
161
|
+
R("div", le, [
|
|
162
|
+
I(Q, { name: "tr-suggestion-pills__more" }, {
|
|
163
|
+
default: B(() => [
|
|
164
|
+
a.value.length ? (n(), f("div", ie, [
|
|
165
|
+
(n(!0), f(z, null, M(a.value, (s) => (n(), v(h(L), {
|
|
166
|
+
key: s.id,
|
|
167
|
+
item: s,
|
|
168
|
+
onClick: (w) => e("item-click", s)
|
|
169
|
+
}, null, 8, ["item", "onClick"]))), 128))
|
|
170
|
+
])) : b("", !0)
|
|
147
171
|
]),
|
|
148
172
|
_: 1
|
|
149
173
|
})
|
|
150
174
|
]),
|
|
151
|
-
|
|
175
|
+
i.value ? (n(), f("button", {
|
|
152
176
|
key: 0,
|
|
153
|
-
class:
|
|
154
|
-
onClick:
|
|
177
|
+
class: A(["tr-suggestion-pills__expand", { "show-on-hover": l.showAllButtonOn === "hover" }]),
|
|
178
|
+
onClick: W
|
|
155
179
|
}, [
|
|
156
|
-
|
|
157
|
-
class:
|
|
180
|
+
I(h(X), {
|
|
181
|
+
class: A(["tr-suggestion-pills__expand-icon", { rotate: p.value }])
|
|
158
182
|
}, null, 8, ["class"])
|
|
159
|
-
], 2)) :
|
|
183
|
+
], 2)) : b("", !0)
|
|
160
184
|
], 512));
|
|
161
185
|
}
|
|
162
|
-
}),
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
186
|
+
}), S = /* @__PURE__ */ V(se, [["__scopeId", "data-v-43d06a90"]]);
|
|
187
|
+
S.name = "TrSuggestionPills";
|
|
188
|
+
const re = function(u) {
|
|
189
|
+
u.component(S.name, S);
|
|
166
190
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
191
|
+
S.install = re;
|
|
192
|
+
d.name = "TrSuggestionPillButton";
|
|
193
|
+
const ae = function(u) {
|
|
194
|
+
u.component(d.name, d);
|
|
171
195
|
};
|
|
172
|
-
|
|
173
|
-
const
|
|
196
|
+
d.install = ae;
|
|
197
|
+
const ve = d;
|
|
174
198
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
199
|
+
ve as SuggestionPillButton,
|
|
200
|
+
S as default
|
|
177
201
|
};
|