@opentiny/tiny-robot 0.3.0-alpha.0 → 0.3.0-alpha.10
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 +472 -548
- package/dist/base-popper/index.js +4 -0
- package/dist/bubble/index.js +3 -4
- package/dist/close.js +1 -1
- package/dist/container/index.js +9 -9
- package/dist/drag-overlay/index.js +57 -0
- package/dist/dropdown-menu/index.js +84 -63
- package/dist/feedback/index.js +39 -38
- package/dist/flow-layout-buttons/index.js +29 -26
- package/dist/history/index.js +36 -37
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +950 -885
- package/dist/index.js +196 -74
- package/dist/index2.js +608 -574
- package/dist/index3.js +626 -3833
- package/dist/index4.js +136 -622
- package/dist/index5.js +251 -3173
- package/dist/index6.js +2072 -4539
- package/dist/index7.js +4749 -0
- package/dist/prompts/index.js +2 -3
- package/dist/question/index.js +83 -83
- package/dist/sender/index.js +1106 -1209
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +27 -27
- package/dist/suggestion-pills/index.js +140 -143
- package/dist/suggestion-popover/index.js +292 -146
- package/dist/tiny-robot-svgs.js +319 -271
- package/dist/useSlotRefs.js +36 -0
- package/package.json +3 -3
package/dist/history/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { I as le } from "../
|
|
4
|
-
import { T as
|
|
1
|
+
import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as U, watchEffect as Y, nextTick as Z, mergeModels as A, useCssVars as q, computed as h, useModel as G, createCommentVNode as E, Fragment as T, renderList as $, createBlock as N, withDirectives as ee, mergeProps as te, withCtx as R, withModifiers as H, vModelText as re } from "vue";
|
|
2
|
+
import { n as oe, P as se, t as ae, _ as ne, U as ie } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { I as le } from "../index6.js";
|
|
4
|
+
import { T as S } from "../index2.js";
|
|
5
5
|
import B from "../icon-button/index.js";
|
|
6
|
-
import { o as ce } from "../
|
|
7
|
-
import { _ as
|
|
8
|
-
const ue = /* @__PURE__ */
|
|
6
|
+
import { o as ce } from "../index3.js";
|
|
7
|
+
import { _ as P } from "../_plugin-vue_export-helper.js";
|
|
8
|
+
const ue = /* @__PURE__ */ V({
|
|
9
9
|
__name: "item-tag",
|
|
10
10
|
props: {
|
|
11
11
|
text: {},
|
|
@@ -16,12 +16,12 @@ const ue = /* @__PURE__ */ M({
|
|
|
16
16
|
const t = i;
|
|
17
17
|
return (a, _) => (n(), u("div", {
|
|
18
18
|
class: D(["tr-history__item-tag", t.type]),
|
|
19
|
-
style:
|
|
19
|
+
style: X(t.style)
|
|
20
20
|
}, [
|
|
21
21
|
p("span", null, k(t.text), 1)
|
|
22
22
|
], 6));
|
|
23
23
|
}
|
|
24
|
-
}), de = /* @__PURE__ */
|
|
24
|
+
}), de = /* @__PURE__ */ P(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, me = /* @__PURE__ */ V({
|
|
25
25
|
__name: "search-empty",
|
|
26
26
|
props: {
|
|
27
27
|
text: { default: "暂无内容" }
|
|
@@ -35,14 +35,14 @@ const ue = /* @__PURE__ */ M({
|
|
|
35
35
|
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}), ve = /* @__PURE__ */
|
|
39
|
-
const t =
|
|
38
|
+
}), ve = /* @__PURE__ */ P(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (i) => {
|
|
39
|
+
const t = U(), a = (l) => {
|
|
40
40
|
t.value = {
|
|
41
41
|
id: l.id,
|
|
42
42
|
title: l.title,
|
|
43
43
|
rawData: l
|
|
44
44
|
};
|
|
45
|
-
}, _ =
|
|
45
|
+
}, _ = U(null), v = (l) => {
|
|
46
46
|
l && Z(() => {
|
|
47
47
|
_.value = l, _.value.focus();
|
|
48
48
|
});
|
|
@@ -62,7 +62,7 @@ const ue = /* @__PURE__ */ M({
|
|
|
62
62
|
}, b = (l) => {
|
|
63
63
|
l.key === "Enter" ? y() : l.key === "Escape" && g();
|
|
64
64
|
};
|
|
65
|
-
return
|
|
65
|
+
return Y(() => {
|
|
66
66
|
_.value && (r == null || r(), r = ce(_, () => {
|
|
67
67
|
y();
|
|
68
68
|
}));
|
|
@@ -78,9 +78,9 @@ const ue = /* @__PURE__ */ M({
|
|
|
78
78
|
}, xe = { class: "tr-history__content" }, Ce = {
|
|
79
79
|
key: 0,
|
|
80
80
|
class: "tr-history__group-title"
|
|
81
|
-
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */
|
|
81
|
+
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */ V({
|
|
82
82
|
__name: "index",
|
|
83
|
-
props: /* @__PURE__ */
|
|
83
|
+
props: /* @__PURE__ */ A({
|
|
84
84
|
tabTitle: {},
|
|
85
85
|
data: {},
|
|
86
86
|
activeTab: {},
|
|
@@ -96,30 +96,30 @@ const ue = /* @__PURE__ */ M({
|
|
|
96
96
|
searchQuery: {},
|
|
97
97
|
searchQueryModifiers: {}
|
|
98
98
|
}),
|
|
99
|
-
emits: /* @__PURE__ */
|
|
99
|
+
emits: /* @__PURE__ */ A(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
|
|
100
100
|
setup(i, { emit: t }) {
|
|
101
101
|
q((c) => ({
|
|
102
102
|
d4b77bae: b.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
103
103
|
"659130e6": b.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
104
104
|
}));
|
|
105
|
-
const a = i, _ =
|
|
105
|
+
const a = i, _ = G(i, "activeTab"), v = G(i, "searchQuery"), r = t, y = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || y.value[0].id), b = h(() => y.value.length > 1), l = (c) => {
|
|
106
106
|
var s;
|
|
107
107
|
const o = typeof ((s = c[0]) == null ? void 0 : s.group);
|
|
108
108
|
return o === "string" || o === "symbol";
|
|
109
|
-
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"),
|
|
109
|
+
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), M = h(() => {
|
|
110
110
|
const c = I.value;
|
|
111
111
|
return l(c) ? c : [{ group: w, items: c }];
|
|
112
|
-
}), x = h(() => a.searchBar ?
|
|
112
|
+
}), x = h(() => a.searchBar ? M.value.map((o) => ({
|
|
113
113
|
...o,
|
|
114
114
|
items: o.items.filter((s) => a.searchFn(v.value || "", s))
|
|
115
|
-
})).filter((o) => o.items.length > 0) :
|
|
115
|
+
})).filter((o) => o.items.length > 0) : M.value), L = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), z = (c) => {
|
|
116
116
|
var o;
|
|
117
117
|
c.id !== ((o = C.value) == null ? void 0 : o.id) && r("item-click", c);
|
|
118
118
|
}, W = () => {
|
|
119
119
|
r("close");
|
|
120
|
-
},
|
|
120
|
+
}, F = (c) => {
|
|
121
121
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit:
|
|
122
|
+
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: O } = ye(r);
|
|
123
123
|
return (c, o) => (n(), u("div", fe, [
|
|
124
124
|
p("div", ke, [
|
|
125
125
|
(n(!0), u(T, null, $(y.value, (s) => (n(), u("div", {
|
|
@@ -154,36 +154,35 @@ const ue = /* @__PURE__ */ M({
|
|
|
154
154
|
}, [
|
|
155
155
|
((Q = e(C)) == null ? void 0 : Q.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
156
|
p("span", Ie, k(d.title), 1),
|
|
157
|
-
d.tag ? (n(),
|
|
157
|
+
d.tag ? (n(), N(e(de), te({
|
|
158
158
|
key: 0,
|
|
159
|
-
class: "tr-history__item-tag"
|
|
160
|
-
|
|
161
|
-
}, d.tag), null, 16)) : E("", !0),
|
|
159
|
+
class: "tr-history__item-tag"
|
|
160
|
+
}, { ref_for: !0 }, d.tag), null, 16)) : E("", !0),
|
|
162
161
|
p("div", we, [
|
|
163
|
-
m(e(
|
|
162
|
+
m(e(S), {
|
|
164
163
|
content: "编辑",
|
|
165
164
|
effect: "dark",
|
|
166
165
|
placement: "top",
|
|
167
166
|
"open-delay": 500
|
|
168
167
|
}, {
|
|
169
|
-
default:
|
|
168
|
+
default: R(() => [
|
|
170
169
|
m(e(B), {
|
|
171
170
|
icon: e(ae),
|
|
172
|
-
onClick:
|
|
171
|
+
onClick: H((f) => e(j)(d), ["stop"])
|
|
173
172
|
}, null, 8, ["icon", "onClick"])
|
|
174
173
|
]),
|
|
175
174
|
_: 2
|
|
176
175
|
}, 1024),
|
|
177
|
-
m(e(
|
|
176
|
+
m(e(S), {
|
|
178
177
|
content: "删除",
|
|
179
178
|
effect: "dark",
|
|
180
179
|
placement: "top",
|
|
181
180
|
"open-delay": 500
|
|
182
181
|
}, {
|
|
183
|
-
default:
|
|
182
|
+
default: R(() => [
|
|
184
183
|
m(e(B), {
|
|
185
184
|
icon: e(ne),
|
|
186
|
-
onClick:
|
|
185
|
+
onClick: H((f) => F(d), ["stop"])
|
|
187
186
|
}, null, 8, ["icon", "onClick"])
|
|
188
187
|
]),
|
|
189
188
|
_: 2
|
|
@@ -194,7 +193,7 @@ const ue = /* @__PURE__ */ M({
|
|
|
194
193
|
"onUpdate:modelValue": o[1] || (o[1] = (f) => e(C).title = f),
|
|
195
194
|
class: "tr-history__item-edit",
|
|
196
195
|
ref_for: !0,
|
|
197
|
-
ref: e(
|
|
196
|
+
ref: e(J),
|
|
198
197
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
199
198
|
(...f) => e(O) && e(O)(...f))
|
|
200
199
|
}, null, 544)), [
|
|
@@ -202,7 +201,7 @@ const ue = /* @__PURE__ */ M({
|
|
|
202
201
|
])
|
|
203
202
|
], 10, Te);
|
|
204
203
|
}), 128))
|
|
205
|
-
]))), 128)) : (n(),
|
|
204
|
+
]))), 128)) : (n(), N(e(ve), {
|
|
206
205
|
key: 1,
|
|
207
206
|
text: v.value ? "暂无搜索结果" : "暂无内容"
|
|
208
207
|
}, null, 8, ["text"]))
|
|
@@ -216,13 +215,13 @@ const ue = /* @__PURE__ */ M({
|
|
|
216
215
|
])
|
|
217
216
|
]));
|
|
218
217
|
}
|
|
219
|
-
}), K = /* @__PURE__ */
|
|
218
|
+
}), K = /* @__PURE__ */ P($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
220
219
|
i.component("TrHistory", K);
|
|
221
|
-
},
|
|
220
|
+
}, Ae = {
|
|
222
221
|
...K,
|
|
223
222
|
install: Be,
|
|
224
223
|
name: "TrHistory"
|
|
225
224
|
};
|
|
226
225
|
export {
|
|
227
|
-
|
|
226
|
+
Ae as default
|
|
228
227
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { t as
|
|
1
|
+
import { defineComponent as r, computed as a, createElementBlock as u, openBlock as l, normalizeStyle as c, normalizeClass as p, createBlock as m, resolveDynamicComponent as d } from "vue";
|
|
2
|
+
import { t as i } from "../utils.js";
|
|
3
3
|
import { _ as f } from "../_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ r({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
icon: {},
|
|
@@ -9,24 +9,23 @@ const v = /* @__PURE__ */ p({
|
|
|
9
9
|
svgSize: { default: "16px" },
|
|
10
10
|
rounded: { type: Boolean }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const o = t, a = n(() => c(o.size)), r = n(() => c(o.svgSize));
|
|
18
|
-
return (i, z) => (s(), u("button", {
|
|
19
|
-
class: m(["tr-icon-button", { rounded: o.rounded }])
|
|
12
|
+
setup(o) {
|
|
13
|
+
const e = o, s = a(() => i(e.size)), n = a(() => i(e.svgSize));
|
|
14
|
+
return (z, h) => (l(), u("button", {
|
|
15
|
+
class: p(["tr-icon-button", { rounded: e.rounded }]),
|
|
16
|
+
style: c({ width: s.value, height: s.value })
|
|
20
17
|
}, [
|
|
21
|
-
(
|
|
22
|
-
|
|
18
|
+
(l(), m(d(e.icon), {
|
|
19
|
+
style: c({ width: n.value, height: n.value, fontSize: n.value })
|
|
20
|
+
}, null, 8, ["style"]))
|
|
21
|
+
], 6));
|
|
23
22
|
}
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
23
|
+
}), t = /* @__PURE__ */ f(_, [["__scopeId", "data-v-159698f7"]]);
|
|
24
|
+
t.name = "TrIconButton";
|
|
25
|
+
const v = function(o) {
|
|
26
|
+
o.component(t.name, t);
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
t.install = v;
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
t as default
|
|
32
31
|
};
|