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