@opentiny/tiny-robot 0.3.0-alpha.16 → 0.3.0-alpha.17
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 +44 -41
- package/dist/attachments/index.js +526 -0
- package/dist/base-popper/index.js +4 -0
- package/dist/bubble/index.js +1506 -1546
- package/dist/close.js +1 -1
- package/dist/container/index.js +30 -30
- package/dist/drag-overlay/index.js +57 -0
- package/dist/dropdown-menu/index.js +151 -64
- package/dist/feedback/index.js +52 -52
- package/dist/flow-layout-buttons/index.js +17 -14
- package/dist/history/index.js +49 -49
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +1179 -912
- package/dist/index.js +206 -77
- package/dist/index2.js +610 -530
- package/dist/index3.js +692 -297
- package/dist/index4.js +146 -622
- package/dist/index5.js +227 -2067
- package/dist/index6.js +2255 -4652
- package/dist/index7.js +6654 -0
- package/dist/mcp-server-picker/index.js +29978 -0
- package/dist/question/index.js +35 -35
- package/dist/sender/index.js +1118 -1206
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +61 -61
- package/dist/suggestion-pills/index.js +131 -155
- package/dist/suggestion-popover/index.js +250 -219
- package/dist/tiny-robot-svgs.js +679 -180
- package/dist/useSlotRefs.js +36 -0
- package/dist/utils.js +8 -13
- package/package.json +10 -3
package/dist/question/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as m, computed as H, watch as D, defineComponent as j, onMounted as Z, onBeforeUnmount as ne, createElementBlock as d, openBlock as i, normalizeClass as
|
|
2
|
-
import {
|
|
1
|
+
import { ref as m, computed as H, watch as D, defineComponent as j, onMounted as Z, onBeforeUnmount as ne, createElementBlock as d, openBlock as i, normalizeClass as V, createElementVNode as t, withDirectives as le, Fragment as R, renderList as A, createVNode as T, unref as q, toDisplayString as S, vShow as ie, nextTick as ae, createCommentVNode as U, withModifiers as ce, normalizeStyle as ue, renderSlot as B, createTextVNode as ee, createBlock as K, withCtx as N } from "vue";
|
|
2
|
+
import { y as X, d as te, s as se, g as de, a as re } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { i as me } from "../close.js";
|
|
4
|
-
import { B as ve } from "../
|
|
4
|
+
import { B as ve } from "../index5.js";
|
|
5
5
|
function he(v = m([])) {
|
|
6
6
|
const w = m(""), y = m(!1), a = m(!1), r = m("light"), k = H(() => {
|
|
7
7
|
if (!w.value && v.value.length > 0)
|
|
@@ -70,31 +70,31 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
70
70
|
if (h.length === 0) return 0;
|
|
71
71
|
const E = e.clientWidth, W = 8, g = document.createElement("div");
|
|
72
72
|
g.className = "tr-common-questions_item", g.style.visibility = "hidden", g.style.position = "absolute", e.appendChild(g);
|
|
73
|
-
let
|
|
74
|
-
const
|
|
75
|
-
for (let
|
|
76
|
-
g.innerHTML = `<span class="icon-placeholder"></span>${h[
|
|
73
|
+
let O = 0;
|
|
74
|
+
const L = Math.min(3, h.length);
|
|
75
|
+
for (let z = 0; z < L; z++) {
|
|
76
|
+
g.innerHTML = `<span class="icon-placeholder"></span>${h[z].text}`;
|
|
77
77
|
const G = g.offsetWidth + W + 24;
|
|
78
|
-
|
|
78
|
+
O += G;
|
|
79
79
|
}
|
|
80
|
-
const M =
|
|
80
|
+
const M = O / L;
|
|
81
81
|
return e.removeChild(g), {
|
|
82
82
|
maxItemsCount: Math.max(1, Math.floor((E - $) / M))
|
|
83
83
|
};
|
|
84
84
|
}, l = (e, h, $, E = 40) => {
|
|
85
|
-
const g = [],
|
|
86
|
-
let
|
|
85
|
+
const g = [], O = [];
|
|
86
|
+
let L = 0;
|
|
87
87
|
if (h.length === 0)
|
|
88
|
-
return { visible: g, hidden:
|
|
88
|
+
return { visible: g, hidden: O };
|
|
89
89
|
const M = document.createElement("div");
|
|
90
90
|
M.className = "tr-common-questions_item", M.style.visibility = "hidden", M.style.position = "absolute", e.appendChild(M);
|
|
91
|
-
for (let
|
|
92
|
-
const I = h[
|
|
91
|
+
for (let z = 0; z < h.length; z++) {
|
|
92
|
+
const I = h[z];
|
|
93
93
|
M.innerHTML = `<span class="icon-placeholder"></span>${I.text}`;
|
|
94
94
|
const J = M.offsetWidth + 8 + 24, oe = $ - E;
|
|
95
|
-
|
|
95
|
+
L + J <= oe ? (L += J, g.push(I)) : O.push(I);
|
|
96
96
|
}
|
|
97
|
-
return e.removeChild(M), { visible: g, hidden:
|
|
97
|
+
return e.removeChild(M), { visible: g, hidden: O };
|
|
98
98
|
};
|
|
99
99
|
D(
|
|
100
100
|
() => y.isExpanded,
|
|
@@ -114,7 +114,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
114
114
|
const { visible: W, hidden: g } = l(e, y.questions, h, $);
|
|
115
115
|
_.value = W, c.value = g, c.value.length > 0 && _.value.push(c.value[0]), x.value = c.value.length > 0, y.isExpanded || (p.value = !1);
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, P = () => {
|
|
118
118
|
f.value && (clearTimeout(f.value), f.value = null), k.value = !0, a("hover-change", !0);
|
|
119
119
|
}, Y = () => {
|
|
120
120
|
f.value = setTimeout(() => {
|
|
@@ -138,10 +138,10 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
138
138
|
}), ne(() => {
|
|
139
139
|
window.removeEventListener("resize", C), f.value && (window.clearTimeout(f.value), f.value = null);
|
|
140
140
|
}), (e, h) => (i(), d("div", {
|
|
141
|
-
class:
|
|
141
|
+
class: V(["tr-common-questions", { expanded: p.value }]),
|
|
142
142
|
ref_key: "commonQuestionsRef",
|
|
143
143
|
ref: r,
|
|
144
|
-
onMouseenter:
|
|
144
|
+
onMouseenter: P,
|
|
145
145
|
onMouseleave: Y
|
|
146
146
|
}, [
|
|
147
147
|
t("div", pe, [
|
|
@@ -154,7 +154,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
154
154
|
(i(!0), d(R, null, A($, (W, g) => (i(), d("div", {
|
|
155
155
|
key: `hidden-${W.id}-${g}`,
|
|
156
156
|
class: "tr-common-questions_item",
|
|
157
|
-
onClick: (
|
|
157
|
+
onClick: (O) => n(W)
|
|
158
158
|
}, [
|
|
159
159
|
t("div", ke, [
|
|
160
160
|
T(q(X))
|
|
@@ -169,7 +169,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
169
169
|
t("div", Ce, [
|
|
170
170
|
(i(!0), d(R, null, A(_.value, ($, E) => (i(), d("div", {
|
|
171
171
|
key: `visible-${$.id}-${E}`,
|
|
172
|
-
class:
|
|
172
|
+
class: V(["tr-common-questions_item", { "last-item": !p.value && E === _.value.length - 1 && o.value }]),
|
|
173
173
|
onClick: (W) => n($)
|
|
174
174
|
}, [
|
|
175
175
|
t("div", $e, [
|
|
@@ -187,10 +187,10 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
187
187
|
}, We = ["onClick"], Me = { class: "category-icon" }, Te = { class: "tr-question-content" }, Be = {
|
|
188
188
|
key: 0,
|
|
189
189
|
class: "tr-question-loading"
|
|
190
|
-
}, Se = { key: 1 },
|
|
190
|
+
}, Se = { key: 1 }, Oe = ["onClick"], ze = {
|
|
191
191
|
key: 2,
|
|
192
192
|
class: "tr-question-empty"
|
|
193
|
-
},
|
|
193
|
+
}, Le = /* @__PURE__ */ j({
|
|
194
194
|
__name: "HotQuestions",
|
|
195
195
|
props: {
|
|
196
196
|
visible: {
|
|
@@ -274,7 +274,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
274
274
|
v.categories.length > 0 ? (i(), d("div", Qe, [
|
|
275
275
|
(i(!0), d(R, null, A(v.categories, (s) => (i(), d("div", {
|
|
276
276
|
key: s.id,
|
|
277
|
-
class:
|
|
277
|
+
class: V(["tr-question-categories-item", { active: k.value === s.id }]),
|
|
278
278
|
onClick: (l) => _(s.id)
|
|
279
279
|
}, [
|
|
280
280
|
B(o.$slots, "category-label", { category: s }, () => [
|
|
@@ -303,8 +303,8 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
303
303
|
t("span", null, S(l + 1) + ".", 1),
|
|
304
304
|
ee(" " + S(s.text), 1)
|
|
305
305
|
])
|
|
306
|
-
], 8,
|
|
307
|
-
])) : (i(), d("div",
|
|
306
|
+
], 8, Oe))), 128))
|
|
307
|
+
])) : (i(), d("div", ze, [
|
|
308
308
|
B(o.$slots, "empty-state", {}, () => [
|
|
309
309
|
u[3] || (u[3] = t("p", null, "暂无相关问题", -1))
|
|
310
310
|
])
|
|
@@ -313,7 +313,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
313
313
|
], 36)
|
|
314
314
|
], 32)) : U("", !0);
|
|
315
315
|
}
|
|
316
|
-
}), Re = ["data-theme"], Ae = { class: "tr-question__header" }, He = { class: "category-icon" },
|
|
316
|
+
}), Re = ["data-theme"], Ae = { class: "tr-question__header" }, He = { class: "category-icon" }, F = /* @__PURE__ */ j({
|
|
317
317
|
__name: "index",
|
|
318
318
|
props: {
|
|
319
319
|
categories: { default: () => [] },
|
|
@@ -337,7 +337,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
337
337
|
);
|
|
338
338
|
const Q = (n) => {
|
|
339
339
|
u(), k("question-click", n);
|
|
340
|
-
},
|
|
340
|
+
}, P = (n) => {
|
|
341
341
|
_.value = n;
|
|
342
342
|
}, Y = (n) => {
|
|
343
343
|
n && (f(n.id), k("select-category", n));
|
|
@@ -351,7 +351,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
351
351
|
setActiveCategory: f,
|
|
352
352
|
refreshData: l
|
|
353
353
|
}), (n, C) => (i(), d("div", {
|
|
354
|
-
class:
|
|
354
|
+
class: V(["tr-question-container", [`theme-${n.theme}`]]),
|
|
355
355
|
"data-theme": n.theme
|
|
356
356
|
}, [
|
|
357
357
|
t("div", Ae, [
|
|
@@ -366,7 +366,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
366
366
|
questions: n.commonQuestions,
|
|
367
367
|
isExpanded: p.value,
|
|
368
368
|
onQuestionClick: Q,
|
|
369
|
-
onHoverChange:
|
|
369
|
+
onHoverChange: P
|
|
370
370
|
}, null, 8, ["questions", "isExpanded"]),
|
|
371
371
|
_.value ? (i(), d("div", {
|
|
372
372
|
key: 0,
|
|
@@ -376,7 +376,7 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
376
376
|
p.value ? (i(), K(q(re), { key: 1 })) : (i(), K(q(de), { key: 0 }))
|
|
377
377
|
])) : U("", !0)
|
|
378
378
|
]),
|
|
379
|
-
T(
|
|
379
|
+
T(Le, {
|
|
380
380
|
visible: q(c),
|
|
381
381
|
categories: x.value,
|
|
382
382
|
"modal-width": n.modalWidth,
|
|
@@ -419,11 +419,11 @@ const pe = { class: "tr-common-questions_content" }, fe = { class: "tr-common-qu
|
|
|
419
419
|
], 10, Re));
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
|
-
|
|
422
|
+
F.name = "TrQuestion";
|
|
423
423
|
const De = function(v) {
|
|
424
|
-
v.component(
|
|
424
|
+
v.component(F.name, F);
|
|
425
425
|
};
|
|
426
|
-
|
|
426
|
+
F.install = De;
|
|
427
427
|
export {
|
|
428
|
-
|
|
428
|
+
F as default
|
|
429
429
|
};
|