@opentiny/tiny-robot 0.3.0-alpha.2 → 0.3.0-alpha.20
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 +46 -43
- package/dist/attachments/index.js +526 -0
- package/dist/base-popper/index.js +4 -0
- package/dist/bubble/index.js +1217 -1253
- package/dist/container/index.js +44 -40
- package/dist/drag-overlay/index.js +57 -0
- package/dist/dropdown-menu/index.js +151 -64
- package/dist/feedback/index.js +79 -80
- package/dist/flow-layout-buttons/index.js +28 -25
- package/dist/history/index.js +71 -72
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +1272 -884
- package/dist/index.js +212 -77
- package/dist/index2.js +501 -343
- package/dist/index3.js +152 -298
- package/dist/mcp-server-picker/index.js +734 -0
- package/dist/no-data.js +4 -0
- package/dist/prompts/index.js +36 -39
- package/dist/sender/index.js +1131 -1210
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +131 -155
- package/dist/suggestion-popover/index.js +253 -221
- package/dist/theme-provider/index.js +82 -0
- package/dist/useSlotRefs.js +36 -0
- package/dist/utils.js +8 -13
- package/package.json +4 -9
- package/dist/close.js +0 -29
- package/dist/index4.js +0 -637
- package/dist/index5.js +0 -2157
- package/dist/index6.js +0 -4752
- package/dist/question/index.js +0 -429
- package/dist/suggestion/index.js +0 -497
- package/dist/tiny-robot-svgs.js +0 -643
package/dist/feedback/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import $, { ActionGroupItem as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as V, ref as g, computed as P, onMounted as z, watch as O, createElementBlock as r, openBlock as t, createCommentVNode as k, Fragment as A, renderList as w, toDisplayString as y, createVNode as b, unref as l, nextTick as q, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as U, resolveDynamicComponent as x } from "vue";
|
|
2
|
+
import { IconArrowUp as T, IconArrowDown as N, IconDislike as j, IconLike as H, IconRefresh as J, IconCopy as K } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { TinyButton as G } from "@opentiny/vue";
|
|
4
|
+
import $, { ActionGroupItem as D } from "../action-group/index.js";
|
|
5
|
+
import Q from "../icon-button/index.js";
|
|
6
|
+
import { _ as X } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ V({
|
|
8
8
|
__name: "SourceList",
|
|
9
9
|
props: {
|
|
10
10
|
sources: {},
|
|
11
11
|
linesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const m =
|
|
13
|
+
setup(h) {
|
|
14
|
+
const m = h, e = g(!1), I = g([]), c = g(null), L = () => {
|
|
15
15
|
q(() => {
|
|
16
|
-
const u =
|
|
16
|
+
const u = I.value.slice(0, m.sources.length).map((s) => (s == null ? void 0 : s.offsetTop) || 0), n = Array.from(new Set(u));
|
|
17
17
|
if (n.length > m.linesLimit) {
|
|
18
|
-
const
|
|
19
|
-
c.value =
|
|
18
|
+
const s = n[m.linesLimit - 1], o = u.lastIndexOf(s);
|
|
19
|
+
c.value = o;
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
u && (
|
|
23
|
+
}, E = P(() => m.sources.length - (c.value || 0));
|
|
24
|
+
z(L), O(() => m.sources, L);
|
|
25
|
+
const p = (u, n) => {
|
|
26
|
+
u && (I.value[n] = u);
|
|
27
27
|
};
|
|
28
|
-
return (u, n) => (t(),
|
|
29
|
-
(t(!0),
|
|
30
|
-
!c.value || e.value ||
|
|
28
|
+
return (u, n) => (t(), r("div", W, [
|
|
29
|
+
(t(!0), r(A, null, w(m.sources, (s, o) => (t(), r(A, { key: o }, [
|
|
30
|
+
!c.value || e.value || o < c.value ? (t(), r("a", {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "pill",
|
|
33
|
-
href:
|
|
33
|
+
href: s.link,
|
|
34
34
|
target: "_blank",
|
|
35
35
|
ref_for: !0,
|
|
36
|
-
ref: (
|
|
37
|
-
}, y(
|
|
38
|
-
c.value && !e.value &&
|
|
36
|
+
ref: (a) => p(a, o)
|
|
37
|
+
}, y(s.label), 9, Y)) : k("", !0),
|
|
38
|
+
c.value && !e.value && o === c.value ? (t(), r("span", {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "pill",
|
|
41
|
-
onClick: n[0] || (n[0] = (
|
|
42
|
-
}, y(
|
|
41
|
+
onClick: n[0] || (n[0] = (a) => e.value = !0)
|
|
42
|
+
}, y(E.value) + "+ ", 1)) : k("", !0)
|
|
43
43
|
], 64))), 128)),
|
|
44
|
-
e.value ? (t(),
|
|
44
|
+
e.value ? (t(), r("span", {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "pill collapse-pill",
|
|
47
|
-
onClick: n[1] || (n[1] = (
|
|
47
|
+
onClick: n[1] || (n[1] = (s) => e.value = !1)
|
|
48
48
|
}, [
|
|
49
|
-
|
|
49
|
+
b(l(T))
|
|
50
50
|
])) : k("", !0)
|
|
51
51
|
]));
|
|
52
52
|
}
|
|
53
|
-
}), ee = /* @__PURE__ */
|
|
53
|
+
}), ee = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-c5fbb560"]]), te = { class: "tr-feedback" }, oe = { class: "tr-feedback__operations" }, se = { class: "tr-feedback__operations-left" }, ne = { key: 1 }, le = { class: "tr-feedback__operations-right" }, re = {
|
|
54
54
|
key: 0,
|
|
55
55
|
class: "tr-feedback__footer"
|
|
56
|
-
},
|
|
56
|
+
}, ae = { key: 0 }, ie = /* @__PURE__ */ V({
|
|
57
57
|
__name: "index",
|
|
58
58
|
props: {
|
|
59
59
|
operations: {},
|
|
@@ -64,27 +64,27 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
64
64
|
sourcesLinesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
65
65
|
},
|
|
66
66
|
emits: ["operation", "action"],
|
|
67
|
-
setup(
|
|
68
|
-
const e =
|
|
69
|
-
copy:
|
|
70
|
-
refresh:
|
|
71
|
-
like:
|
|
72
|
-
dislike:
|
|
67
|
+
setup(h, { emit: m }) {
|
|
68
|
+
const e = h, I = {
|
|
69
|
+
copy: K,
|
|
70
|
+
refresh: J,
|
|
71
|
+
like: H,
|
|
72
|
+
dislike: j
|
|
73
73
|
}, c = m, L = (n) => {
|
|
74
|
-
var
|
|
75
|
-
(
|
|
76
|
-
},
|
|
77
|
-
var
|
|
78
|
-
(
|
|
79
|
-
},
|
|
80
|
-
|
|
74
|
+
var s, o, a;
|
|
75
|
+
(a = (o = (s = e.operations) == null ? void 0 : s.find((v) => v.name === n)) == null ? void 0 : o.onClick) == null || a.call(o), c("operation", n);
|
|
76
|
+
}, E = (n) => {
|
|
77
|
+
var s, o, a;
|
|
78
|
+
(a = (o = (s = e.actions) == null ? void 0 : s.find((v) => v.name === n)) == null ? void 0 : o.onClick) == null || a.call(o), c("action", n);
|
|
79
|
+
}, p = g(!1), u = () => {
|
|
80
|
+
p.value = !p.value;
|
|
81
81
|
};
|
|
82
|
-
return (n,
|
|
83
|
-
var
|
|
84
|
-
return t(),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(
|
|
82
|
+
return (n, s) => {
|
|
83
|
+
var o, a, v, S, F, M, R, B;
|
|
84
|
+
return t(), r("div", te, [
|
|
85
|
+
d("div", oe, [
|
|
86
|
+
d("div", se, [
|
|
87
|
+
(o = e.operations) != null && o.length ? (t(), _(l($), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -92,34 +92,33 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
92
92
|
class: "tr-feedback__operations-left-action-group"
|
|
93
93
|
}, {
|
|
94
94
|
moreBtn: f(() => [
|
|
95
|
-
|
|
95
|
+
b(l(G), {
|
|
96
96
|
round: "",
|
|
97
97
|
size: "mini",
|
|
98
98
|
"reset-time": 0,
|
|
99
99
|
class: "tr-feedback__operations-more-btn"
|
|
100
100
|
}, {
|
|
101
101
|
default: f(() => [
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
s[0] || (s[0] = d("span", null, "更多", -1)),
|
|
103
|
+
b(l(N))
|
|
104
104
|
]),
|
|
105
|
-
_: 1
|
|
106
|
-
__: [0]
|
|
105
|
+
_: 1
|
|
107
106
|
})
|
|
108
107
|
]),
|
|
109
108
|
default: f(() => [
|
|
110
|
-
(t(!0),
|
|
109
|
+
(t(!0), r(A, null, w(e.operations, (i) => (t(), _(l(D), {
|
|
111
110
|
key: i.name,
|
|
112
111
|
name: i.name,
|
|
113
112
|
label: i.label
|
|
114
113
|
}, {
|
|
115
114
|
default: f(() => [
|
|
116
|
-
|
|
115
|
+
b(l(G), {
|
|
117
116
|
round: "",
|
|
118
117
|
"reset-time": 0,
|
|
119
118
|
size: "mini"
|
|
120
119
|
}, {
|
|
121
120
|
default: f(() => [
|
|
122
|
-
|
|
121
|
+
U(y(i.label), 1)
|
|
123
122
|
]),
|
|
124
123
|
_: 2
|
|
125
124
|
}, 1024)
|
|
@@ -128,33 +127,33 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
128
127
|
}, 1032, ["name", "label"]))), 128))
|
|
129
128
|
]),
|
|
130
129
|
_: 1
|
|
131
|
-
}, 8, ["max-num"])) : (
|
|
132
|
-
|
|
130
|
+
}, 8, ["max-num"])) : (a = e.sources) != null && a.length ? (t(), r("div", ne, [
|
|
131
|
+
d("span", {
|
|
133
132
|
class: "tr-feedback__source",
|
|
134
133
|
onClick: u
|
|
135
134
|
}, [
|
|
136
|
-
|
|
137
|
-
(t(),
|
|
135
|
+
d("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
|
|
136
|
+
(t(), _(x(p.value ? l(T) : l(N))))
|
|
138
137
|
])
|
|
139
138
|
])) : k("", !0)
|
|
140
139
|
]),
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
d("div", le, [
|
|
141
|
+
b(l($), {
|
|
143
142
|
"max-num": e.actionsLimit,
|
|
144
143
|
"show-tooltip": !0,
|
|
145
|
-
onItemClick:
|
|
144
|
+
onItemClick: E
|
|
146
145
|
}, {
|
|
147
146
|
default: f(() => [
|
|
148
|
-
(t(!0),
|
|
147
|
+
(t(!0), r(A, null, w(e.actions, (i) => (t(), _(l(D), {
|
|
149
148
|
key: i.name,
|
|
150
149
|
name: i.name,
|
|
151
150
|
label: i.label
|
|
152
151
|
}, {
|
|
153
152
|
default: f(() => [
|
|
154
|
-
typeof i.icon == "string" ? (t(),
|
|
153
|
+
typeof i.icon == "string" ? (t(), _(l(Q), {
|
|
155
154
|
key: 0,
|
|
156
|
-
icon:
|
|
157
|
-
}, null, 8, ["icon"])) : (t(),
|
|
155
|
+
icon: I[i.icon]
|
|
156
|
+
}, null, 8, ["icon"])) : (t(), _(x(i.icon), { key: 1 }))
|
|
158
157
|
]),
|
|
159
158
|
_: 2
|
|
160
159
|
}, 1032, ["name", "label"]))), 128))
|
|
@@ -163,17 +162,17 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
163
162
|
}, 8, ["max-num"])
|
|
164
163
|
])
|
|
165
164
|
]),
|
|
166
|
-
(
|
|
167
|
-
(
|
|
168
|
-
|
|
165
|
+
(S = e.operations) != null && S.length && ((F = e.sources) != null && F.length) || p.value && e.sources ? (t(), r("div", re, [
|
|
166
|
+
(M = e.operations) != null && M.length && ((R = e.sources) != null && R.length) ? (t(), r("div", ae, [
|
|
167
|
+
d("span", {
|
|
169
168
|
class: "tr-feedback__source",
|
|
170
169
|
onClick: u
|
|
171
170
|
}, [
|
|
172
|
-
|
|
173
|
-
(t(),
|
|
171
|
+
d("span", null, y((B = e.sources) == null ? void 0 : B.length) + "条来源", 1),
|
|
172
|
+
(t(), _(x(p.value ? l(T) : l(N))))
|
|
174
173
|
])
|
|
175
174
|
])) : k("", !0),
|
|
176
|
-
|
|
175
|
+
p.value && e.sources ? (t(), _(l(ee), {
|
|
177
176
|
key: 1,
|
|
178
177
|
sources: e.sources,
|
|
179
178
|
"lines-limit": e.sourcesLinesLimit
|
|
@@ -182,12 +181,12 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
182
181
|
]);
|
|
183
182
|
};
|
|
184
183
|
}
|
|
185
|
-
}),
|
|
186
|
-
|
|
187
|
-
const ce = function(
|
|
188
|
-
|
|
184
|
+
}), C = /* @__PURE__ */ X(ie, [["__scopeId", "data-v-affa572f"]]);
|
|
185
|
+
C.name = "TrFeedback";
|
|
186
|
+
const ce = function(h) {
|
|
187
|
+
h.component(C.name, C);
|
|
189
188
|
};
|
|
190
|
-
|
|
189
|
+
C.install = ce;
|
|
191
190
|
export {
|
|
192
|
-
|
|
191
|
+
C as default
|
|
193
192
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as I, Fragment as C, renderList as D, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as S, nextTick as H } from "vue";
|
|
2
|
+
import { IconArrowDown as X } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { e as j, o as J } from "../index2.js";
|
|
4
4
|
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const P = ["onClick"], Q = {
|
|
6
6
|
key: 0,
|
|
@@ -18,7 +18,7 @@ const P = ["onClick"], Q = {
|
|
|
18
18
|
selectedModifiers: {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
|
|
21
|
-
setup(d, { emit:
|
|
21
|
+
setup(d, { emit: A }) {
|
|
22
22
|
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
@@ -27,11 +27,11 @@ const P = ["onClick"], Q = {
|
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
|
-
const F =
|
|
30
|
+
const F = A, w = i(null), y = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), N = (t, o) => {
|
|
31
31
|
t && (M.value[o] = t);
|
|
32
32
|
}, L = () => {
|
|
33
33
|
s.value = null, m.value = !1, H(() => {
|
|
34
|
-
const t =
|
|
34
|
+
const t = w.value, o = y.value;
|
|
35
35
|
if (!t || !o)
|
|
36
36
|
return;
|
|
37
37
|
const e = M.value.slice(0, n.items.length).filter((r) => !!r).map((r) => r.offsetTop), f = Array.from(new Set(e));
|
|
@@ -43,7 +43,7 @@ const P = ["onClick"], Q = {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
g(() => n.items, L);
|
|
46
|
-
const { width: W } = j(
|
|
46
|
+
const { width: W } = j(w);
|
|
47
47
|
g(W, (t) => {
|
|
48
48
|
t > 0 && L();
|
|
49
49
|
});
|
|
@@ -54,41 +54,44 @@ const P = ["onClick"], Q = {
|
|
|
54
54
|
}, v = (t) => {
|
|
55
55
|
n.showMoreTrigger === "hover" && (c.value = t);
|
|
56
56
|
};
|
|
57
|
-
return J(
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
57
|
+
return J(
|
|
58
|
+
k,
|
|
59
|
+
() => {
|
|
60
|
+
c.value = !1;
|
|
61
|
+
},
|
|
62
|
+
{ ignore: [k, y] }
|
|
63
|
+
), (t, o) => (l(), a("div", {
|
|
61
64
|
class: "tr-flow-layout",
|
|
62
65
|
ref_key: "containerRef",
|
|
63
|
-
ref:
|
|
66
|
+
ref: w
|
|
64
67
|
}, [
|
|
65
|
-
(l(!0), a(
|
|
68
|
+
(l(!0), a(C, null, D(n.items, (e, f) => (l(), a(C, {
|
|
66
69
|
key: e.id
|
|
67
70
|
}, [
|
|
68
71
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
69
72
|
key: 0,
|
|
70
|
-
class:
|
|
73
|
+
class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
71
74
|
ref_for: !0,
|
|
72
75
|
ref: (r) => N(r, f),
|
|
73
76
|
onClick: (r) => R(e.id)
|
|
74
77
|
}, [
|
|
75
|
-
(l(),
|
|
78
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
76
79
|
e.label ? (l(), a("span", Q, S(e.label), 1)) : _("", !0)
|
|
77
80
|
], 10, P)) : _("", !0)
|
|
78
81
|
], 64))), 128)),
|
|
79
|
-
|
|
82
|
+
I("div", U, [
|
|
80
83
|
m.value ? _("", !0) : (l(), a("button", {
|
|
81
84
|
key: 0,
|
|
82
|
-
class:
|
|
85
|
+
class: x(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
83
86
|
ref_key: "moreButtonRef",
|
|
84
|
-
ref:
|
|
87
|
+
ref: y,
|
|
85
88
|
onClick: V,
|
|
86
89
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
87
90
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
88
91
|
}, [
|
|
89
|
-
(l(),
|
|
92
|
+
(l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
90
93
|
], 34)),
|
|
91
|
-
|
|
94
|
+
I("div", {
|
|
92
95
|
class: "tr-flow-layout__dropdown-container",
|
|
93
96
|
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
94
97
|
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
@@ -99,20 +102,20 @@ const P = ["onClick"], Q = {
|
|
|
99
102
|
ref_key: "dropDownRef",
|
|
100
103
|
ref: k
|
|
101
104
|
}, [
|
|
102
|
-
(l(!0), a(
|
|
103
|
-
class:
|
|
105
|
+
(l(!0), a(C, null, D(z.value, (e) => (l(), a("button", {
|
|
106
|
+
class: x(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
104
107
|
key: e.id,
|
|
105
108
|
onClick: (f) => R(e.id)
|
|
106
109
|
}, [
|
|
107
|
-
(l(),
|
|
108
|
-
|
|
110
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
111
|
+
I("span", Z, S(e.label), 1)
|
|
109
112
|
], 10, Y))), 128))
|
|
110
113
|
], 512)) : _("", !0)
|
|
111
114
|
], 32)
|
|
112
115
|
])
|
|
113
116
|
], 512));
|
|
114
117
|
}
|
|
115
|
-
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-
|
|
118
|
+
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-f82cf3dc"]]);
|
|
116
119
|
p.name = "TrFlowLayout";
|
|
117
120
|
const te = function(d) {
|
|
118
121
|
d.component(p.name, p);
|