@opentiny/tiny-robot 0.4.0-beta.0 → 0.4.1-alpha.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/README.md +192 -1
- package/README.zh-CN.md +192 -0
- package/dist/action-group/index.js +3 -3
- package/dist/anchor/index.js +856 -0
- package/dist/attachments/index.js +326 -269
- package/dist/container/index.js +13 -13
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +18 -18
- package/dist/feedback/index.js +2 -2
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +454 -188
- package/dist/index.js +121 -117
- package/dist/index2.js +152 -126
- package/dist/index3.js +1 -1
- package/dist/index4.js +91 -85
- package/dist/index5.js +81 -81
- package/dist/index6.js +487 -455
- package/dist/index7.js +30 -30
- package/dist/index8.js +8 -8
- package/dist/mcp-server-picker/index.js +178 -177
- package/dist/sender/index.js +1579 -1448
- package/dist/sender-actions/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +13 -13
- package/dist/suggestion-popover/index.js +122 -125
- package/dist/useSlotRefs.js +1 -1
- package/dist/utils.js +1 -1
- package/dist/welcome/index.js +9 -9
- package/package.json +52 -15
- package/dist/no-data.js +0 -4
package/dist/index2.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { IconSend as
|
|
4
|
-
import { TinyTooltip as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { inject as R, isVNode as V, h as F, defineComponent as y, computed as l, openBlock as i, createBlock as f, unref as o, withCtx as S, createElementVNode as k, normalizeStyle as I, normalizeClass as v, renderSlot as B, resolveDynamicComponent as P, createElementBlock as b, createVNode as x, toDisplayString as T, createCommentVNode as h, useSlots as W, Transition as $ } from "vue";
|
|
2
|
+
import { _ as w } from "./_plugin-vue_export-helper.js";
|
|
3
|
+
import { IconSend as N, IconStop as j, IconClose as U } from "@opentiny/tiny-robot-svgs";
|
|
4
|
+
import { TinyTooltip as D } from "@opentiny/vue";
|
|
5
|
+
import { t as G } from "./utils.js";
|
|
6
|
+
const K = Symbol("sender-context");
|
|
7
|
+
function C() {
|
|
8
|
+
const t = R(K);
|
|
9
|
+
if (!t)
|
|
9
10
|
throw new Error("useSenderContext must be used within Sender component");
|
|
10
|
-
return
|
|
11
|
+
return t;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const A = "tr-sender-tooltip-inner";
|
|
14
|
+
function E(t) {
|
|
15
|
+
return t ? typeof t == "string" ? t.split(/\s+/).includes(A) : Array.isArray(t) ? t.some(E) : typeof t == "object" ? !!t[A] : !1 : !1;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
function z(t) {
|
|
18
|
+
var e;
|
|
19
|
+
return V(t) && E((e = t.props) == null ? void 0 : e.class) ? t : F("div", { class: A }, t);
|
|
20
|
+
}
|
|
21
|
+
function O(t) {
|
|
22
|
+
if (t)
|
|
23
|
+
return typeof t == "string" ? () => z(t) : () => z(t());
|
|
24
|
+
}
|
|
25
|
+
const M = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
17
26
|
__name: "index",
|
|
18
27
|
props: {
|
|
19
28
|
icon: {},
|
|
@@ -23,177 +32,194 @@ const L = ["disabled"], V = ["disabled"], W = /* @__PURE__ */ h({
|
|
|
23
32
|
tooltipPlacement: { default: "top" },
|
|
24
33
|
size: {}
|
|
25
34
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
28
|
-
|
|
35
|
+
setup(t) {
|
|
36
|
+
const e = t, n = {
|
|
37
|
+
normal: "32px",
|
|
38
|
+
small: "28px"
|
|
39
|
+
}, a = l(() => O(e.tooltip)), d = (s) => s === "small" ? {
|
|
40
|
+
"--tr-action-button-size": n.small
|
|
41
|
+
} : s === "normal" ? {
|
|
42
|
+
"--tr-action-button-size": n.normal
|
|
43
|
+
} : {
|
|
44
|
+
"--tr-action-button-size": G(s)
|
|
45
|
+
}, c = l(() => e.size ? d(e.size) : {});
|
|
46
|
+
return (s, u) => e.tooltip ? (i(), f(o(D), {
|
|
29
47
|
key: 0,
|
|
30
|
-
"render-content":
|
|
31
|
-
placement:
|
|
48
|
+
"render-content": a.value,
|
|
49
|
+
placement: e.tooltipPlacement,
|
|
32
50
|
effect: "light",
|
|
33
51
|
"visible-arrow": !1,
|
|
34
52
|
"popper-class": "tr-action-button-tooltip-popper"
|
|
35
53
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
|
|
38
|
-
class: v(["tr-action-button", { active:
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
default: S(() => [
|
|
55
|
+
k("button", {
|
|
56
|
+
class: v(["tr-action-button", { active: e.active }]),
|
|
57
|
+
style: I(c.value),
|
|
58
|
+
disabled: e.disabled,
|
|
59
|
+
onFocusCapture: u[0] || (u[0] = (r) => r.stopPropagation())
|
|
41
60
|
}, [
|
|
42
|
-
B(
|
|
43
|
-
(i(),
|
|
44
|
-
style: E(l.value)
|
|
45
|
-
}, null, 8, ["style"]))
|
|
61
|
+
B(s.$slots, "icon", {}, () => [
|
|
62
|
+
(i(), f(P(e.icon)))
|
|
46
63
|
], !0)
|
|
47
|
-
],
|
|
64
|
+
], 46, M)
|
|
48
65
|
]),
|
|
49
66
|
_: 3
|
|
50
|
-
}, 8, ["render-content", "placement"])) : (i(),
|
|
67
|
+
}, 8, ["render-content", "placement"])) : (i(), b("button", {
|
|
51
68
|
key: 1,
|
|
52
|
-
class: v(["tr-action-button", { active:
|
|
53
|
-
|
|
69
|
+
class: v(["tr-action-button", { active: e.active }]),
|
|
70
|
+
style: I(c.value),
|
|
71
|
+
disabled: e.disabled
|
|
54
72
|
}, [
|
|
55
|
-
B(
|
|
56
|
-
(i(),
|
|
57
|
-
style: E(l.value)
|
|
58
|
-
}, null, 8, ["style"]))
|
|
73
|
+
B(s.$slots, "icon", {}, () => [
|
|
74
|
+
(i(), f(P(e.icon)))
|
|
59
75
|
], !0)
|
|
60
|
-
],
|
|
76
|
+
], 14, X));
|
|
61
77
|
}
|
|
62
|
-
}),
|
|
78
|
+
}), Z = /* @__PURE__ */ w(Y, [["__scopeId", "data-v-875619e6"]]), q = {
|
|
63
79
|
key: 0,
|
|
64
80
|
class: "tr-sender-submit-button__cancel-text"
|
|
65
|
-
},
|
|
81
|
+
}, H = /* @__PURE__ */ y({
|
|
66
82
|
__name: "index",
|
|
67
|
-
setup(
|
|
68
|
-
const { canSubmit:
|
|
69
|
-
var
|
|
70
|
-
return (
|
|
71
|
-
}),
|
|
72
|
-
var
|
|
73
|
-
return
|
|
74
|
-
}),
|
|
75
|
-
var
|
|
76
|
-
return ((
|
|
77
|
-
}),
|
|
78
|
-
|
|
83
|
+
setup(t) {
|
|
84
|
+
const { canSubmit: e, loading: n, defaultActions: a, submit: d, cancel: c, stopText: s } = C(), u = l(() => {
|
|
85
|
+
var _, m;
|
|
86
|
+
return (m = (_ = a.value) == null ? void 0 : _.submit) != null && m.disabled ? !0 : !e.value && !n.value;
|
|
87
|
+
}), r = l(() => {
|
|
88
|
+
var _, m;
|
|
89
|
+
return O((m = (_ = a.value) == null ? void 0 : _.submit) == null ? void 0 : m.tooltip);
|
|
90
|
+
}), p = l(() => {
|
|
91
|
+
var _, m;
|
|
92
|
+
return ((m = (_ = a.value) == null ? void 0 : _.submit) == null ? void 0 : m.tooltipPlacement) ?? "top";
|
|
93
|
+
}), g = () => {
|
|
94
|
+
u.value || (n.value ? c() : d());
|
|
79
95
|
};
|
|
80
|
-
return (
|
|
96
|
+
return (_, m) => r.value && !o(n) ? (i(), f(o(D), {
|
|
81
97
|
key: 0,
|
|
82
|
-
"render-content":
|
|
83
|
-
placement:
|
|
98
|
+
"render-content": r.value,
|
|
99
|
+
placement: p.value,
|
|
84
100
|
effect: "light",
|
|
85
101
|
"visible-arrow": !1,
|
|
86
102
|
"popper-class": "tr-submit-button-tooltip-popper"
|
|
87
103
|
}, {
|
|
88
|
-
default:
|
|
89
|
-
|
|
104
|
+
default: S(() => [
|
|
105
|
+
k("div", {
|
|
90
106
|
class: v([
|
|
91
107
|
"tr-sender-submit-button",
|
|
92
108
|
{
|
|
93
|
-
"is-disabled":
|
|
94
|
-
"is-loading": o(
|
|
109
|
+
"is-disabled": u.value,
|
|
110
|
+
"is-loading": o(n)
|
|
95
111
|
}
|
|
96
112
|
]),
|
|
97
|
-
onClick:
|
|
113
|
+
onClick: g
|
|
98
114
|
}, [
|
|
99
|
-
|
|
115
|
+
x(o(N), { class: "tr-sender-submit-button__icon" })
|
|
100
116
|
], 2)
|
|
101
117
|
]),
|
|
102
118
|
_: 1
|
|
103
|
-
}, 8, ["render-content", "placement"])) : (i(),
|
|
119
|
+
}, 8, ["render-content", "placement"])) : (i(), b("div", {
|
|
104
120
|
key: 1,
|
|
105
121
|
class: v([
|
|
106
122
|
"tr-sender-submit-button",
|
|
107
123
|
{
|
|
108
|
-
"is-disabled":
|
|
109
|
-
"is-loading": o(
|
|
124
|
+
"is-disabled": u.value,
|
|
125
|
+
"is-loading": o(n)
|
|
110
126
|
}
|
|
111
127
|
]),
|
|
112
|
-
onClick:
|
|
128
|
+
onClick: g
|
|
113
129
|
}, [
|
|
114
|
-
o(
|
|
130
|
+
o(n) ? (i(), b("div", {
|
|
115
131
|
key: 1,
|
|
116
|
-
class: v(["tr-sender-submit-button__cancel", { "icon-only": !o(
|
|
132
|
+
class: v(["tr-sender-submit-button__cancel", { "icon-only": !o(s) }])
|
|
117
133
|
}, [
|
|
118
|
-
|
|
119
|
-
o(
|
|
120
|
-
], 2)) : (i(),
|
|
134
|
+
x(o(j), { class: "tr-sender-submit-button__cancel-icon" }),
|
|
135
|
+
o(s) ? (i(), b("span", q, T(o(s)), 1)) : h("", !0)
|
|
136
|
+
], 2)) : (i(), f(o(N), {
|
|
121
137
|
key: 0,
|
|
122
138
|
class: "tr-sender-submit-button__icon"
|
|
123
139
|
}))
|
|
124
140
|
], 2));
|
|
125
141
|
}
|
|
126
|
-
}),
|
|
142
|
+
}), J = /* @__PURE__ */ w(H, [["__scopeId", "data-v-a58e69fe"]]), L = () => {
|
|
143
|
+
const { hasContent: t, clearable: e, loading: n, defaultActions: a } = C(), d = l(() => {
|
|
144
|
+
var r, p;
|
|
145
|
+
return ((p = (r = a.value) == null ? void 0 : r.clear) == null ? void 0 : p.disabled) !== void 0 ? a.value.clear.disabled : !1;
|
|
146
|
+
}), c = l(() => {
|
|
147
|
+
var r, p;
|
|
148
|
+
return (p = (r = a.value) == null ? void 0 : r.clear) == null ? void 0 : p.tooltip;
|
|
149
|
+
}), s = l(() => {
|
|
150
|
+
var r, p;
|
|
151
|
+
return ((p = (r = a.value) == null ? void 0 : r.clear) == null ? void 0 : p.tooltipPlacement) ?? "top";
|
|
152
|
+
}), u = l(() => e.value && t.value && !n.value && !d.value);
|
|
153
|
+
return {
|
|
154
|
+
isDisabled: d,
|
|
155
|
+
tooltip: c,
|
|
156
|
+
tooltipPlacement: s,
|
|
157
|
+
show: u
|
|
158
|
+
};
|
|
159
|
+
}, Q = /* @__PURE__ */ y({
|
|
127
160
|
__name: "index",
|
|
128
|
-
setup(
|
|
129
|
-
const {
|
|
130
|
-
|
|
131
|
-
return ((n = (e = c.value) == null ? void 0 : e.clear) == null ? void 0 : n.disabled) !== void 0 ? c.value.clear.disabled : !1;
|
|
132
|
-
}), _ = d(() => {
|
|
133
|
-
var e, n;
|
|
134
|
-
return $((n = (e = c.value) == null ? void 0 : e.clear) == null ? void 0 : n.tooltip);
|
|
135
|
-
}), y = d(() => {
|
|
136
|
-
var e, n;
|
|
137
|
-
return ((n = (e = c.value) == null ? void 0 : e.clear) == null ? void 0 : n.tooltipPlacement) ?? "top";
|
|
138
|
-
}), z = d(() => s.value && t.value && !r.value && !u.value), C = () => {
|
|
139
|
-
u.value || l();
|
|
161
|
+
setup(t) {
|
|
162
|
+
const { clear: e } = C(), { isDisabled: n, tooltip: a, tooltipPlacement: d, show: c } = L(), s = () => {
|
|
163
|
+
n.value || e();
|
|
140
164
|
};
|
|
141
|
-
return (
|
|
165
|
+
return (u, r) => o(c) ? (i(), f(Z, {
|
|
142
166
|
key: 0,
|
|
143
|
-
icon: o(
|
|
144
|
-
disabled:
|
|
145
|
-
tooltip:
|
|
146
|
-
"tooltip-placement":
|
|
147
|
-
onClick:
|
|
148
|
-
}, null, 8, ["icon", "disabled", "tooltip", "tooltip-placement"])) :
|
|
167
|
+
icon: o(U),
|
|
168
|
+
disabled: o(n),
|
|
169
|
+
tooltip: o(a),
|
|
170
|
+
"tooltip-placement": o(d),
|
|
171
|
+
onClick: s
|
|
172
|
+
}, null, 8, ["icon", "disabled", "tooltip", "tooltip-placement"])) : h("", !0);
|
|
149
173
|
}
|
|
150
|
-
}),
|
|
174
|
+
}), tt = {
|
|
151
175
|
key: 0,
|
|
152
176
|
class: "tr-sender-word-counter"
|
|
153
|
-
},
|
|
177
|
+
}, et = /* @__PURE__ */ y({
|
|
154
178
|
__name: "index",
|
|
155
|
-
setup(
|
|
156
|
-
const { characterCount:
|
|
157
|
-
return (
|
|
158
|
-
|
|
159
|
-
class: v({ "is-over-limit": o(
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
])) :
|
|
179
|
+
setup(t) {
|
|
180
|
+
const { characterCount: e, maxLength: n, isOverLimit: a, showWordLimit: d } = C(), c = l(() => d.value && n.value !== void 0);
|
|
181
|
+
return (s, u) => c.value ? (i(), b("span", tt, [
|
|
182
|
+
k("span", {
|
|
183
|
+
class: v({ "is-over-limit": o(a) })
|
|
184
|
+
}, T(o(e)), 3),
|
|
185
|
+
k("span", null, "/" + T(o(n)), 1)
|
|
186
|
+
])) : h("", !0);
|
|
163
187
|
}
|
|
164
|
-
}),
|
|
188
|
+
}), ut = /* @__PURE__ */ w(et, [["__scopeId", "data-v-206396cd"]]), ot = {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "tr-default-action-buttons"
|
|
191
|
+
}, nt = {
|
|
165
192
|
key: 0,
|
|
166
193
|
class: "tr-action-buttons-group"
|
|
167
|
-
},
|
|
194
|
+
}, st = /* @__PURE__ */ y({
|
|
168
195
|
__name: "index",
|
|
169
|
-
setup(
|
|
170
|
-
const { hasContent:
|
|
171
|
-
return (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
196
|
+
setup(t) {
|
|
197
|
+
const e = W(), { hasContent: n, loading: a } = C(), { show: d } = L(), c = l(() => !!e.prepend), s = l(() => n.value || a.value), u = l(() => c.value || d.value), r = l(() => c.value || s.value);
|
|
198
|
+
return (p, g) => (i(), f($, { name: "tr-slide-right" }, {
|
|
199
|
+
default: S(() => [
|
|
200
|
+
r.value ? (i(), b("div", ot, [
|
|
201
|
+
u.value ? (i(), b("div", nt, [
|
|
202
|
+
B(p.$slots, "prepend", {}, void 0, !0),
|
|
203
|
+
x($, { name: "tr-slide-right" }, {
|
|
204
|
+
default: S(() => [
|
|
205
|
+
x(Q)
|
|
178
206
|
]),
|
|
179
207
|
_: 1
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
})
|
|
188
|
-
]));
|
|
208
|
+
})
|
|
209
|
+
])) : h("", !0),
|
|
210
|
+
s.value ? (i(), f(J, { key: 1 })) : h("", !0)
|
|
211
|
+
])) : h("", !0)
|
|
212
|
+
]),
|
|
213
|
+
_: 3
|
|
214
|
+
}));
|
|
189
215
|
}
|
|
190
|
-
}),
|
|
216
|
+
}), dt = /* @__PURE__ */ w(st, [["__scopeId", "data-v-e9441989"]]);
|
|
191
217
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
218
|
+
Z as A,
|
|
219
|
+
dt as D,
|
|
220
|
+
K as S,
|
|
221
|
+
ut as W,
|
|
222
|
+
Q as _,
|
|
223
|
+
J as a,
|
|
224
|
+
C as u
|
|
199
225
|
};
|
package/dist/index3.js
CHANGED
|
@@ -4,7 +4,7 @@ var C = (i, o, e) => D(i, typeof o != "symbol" ? o + "" : o, e);
|
|
|
4
4
|
import { defineComponent as B, toRefs as H, computed as R, watch as F, openBlock as S, createBlock as x, unref as p, ref as V, reactive as A, onUnmounted as P, createElementBlock as j, Fragment as U, normalizeClass as W, createSlots as L, withCtx as y, renderSlot as z, resolveDynamicComponent as M, createCommentVNode as N } from "vue";
|
|
5
5
|
import { e as O } from "./index4.js";
|
|
6
6
|
import { u as I, A as b } from "./index2.js";
|
|
7
|
-
import {
|
|
7
|
+
import { IconImageUpload as T, IconVoice as _, IconRecordingWave as q } from "@opentiny/tiny-robot-svgs";
|
|
8
8
|
import { _ as G } from "./_plugin-vue_export-helper.js";
|
|
9
9
|
const te = /* @__PURE__ */ B({
|
|
10
10
|
__name: "index",
|