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