@opentiny/tiny-robot 0.4.2-alpha.1 → 0.4.2-alpha.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/{content-nav → anchor}/index.js +263 -263
- package/dist/attachments/index.js +309 -252
- package/dist/feedback/index.js +2 -2
- package/dist/index.d.ts +108 -109
- package/dist/index.js +53 -53
- package/dist/index2.js +111 -103
- package/dist/index6.js +1 -2
- package/dist/sender/index.js +1446 -1328
- package/dist/style.css +1 -1
- package/dist/welcome/index.js +9 -9
- package/package.json +19 -13
package/dist/index2.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { IconSend as
|
|
4
|
-
import { TinyTooltip as
|
|
5
|
-
const
|
|
1
|
+
import { inject as O, isVNode as R, h as V, defineComponent as y, computed as d, openBlock as a, createBlock as f, unref as s, withCtx as x, createElementVNode as v, normalizeClass as b, renderSlot as T, resolveDynamicComponent as $, normalizeStyle as B, createElementBlock as p, createVNode as m, toDisplayString as w, createCommentVNode as S, Transition as A } from "vue";
|
|
2
|
+
import { _ as k } from "./_plugin-vue_export-helper.js";
|
|
3
|
+
import { IconSend as E, IconStop as F, IconClear as W } from "@opentiny/tiny-robot-svgs";
|
|
4
|
+
import { TinyTooltip as P } from "@opentiny/vue";
|
|
5
|
+
const j = Symbol("sender-context");
|
|
6
6
|
function g() {
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
7
|
+
const t = O(j);
|
|
8
|
+
if (!t)
|
|
9
9
|
throw new Error("useSenderContext must be used within Sender component");
|
|
10
|
-
return
|
|
10
|
+
return t;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const I = "tr-sender-tooltip-inner";
|
|
13
|
+
function D(t) {
|
|
14
|
+
return t ? typeof t == "string" ? t.split(/\s+/).includes(I) : Array.isArray(t) ? t.some(D) : typeof t == "object" ? !!t[I] : !1 : !1;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
function N(t) {
|
|
17
|
+
var e;
|
|
18
|
+
return R(t) && D((e = t.props) == null ? void 0 : e.class) ? t : V("div", { class: I }, t);
|
|
19
|
+
}
|
|
20
|
+
function L(t) {
|
|
21
|
+
if (t)
|
|
22
|
+
return typeof t == "string" ? () => N(t) : () => N(t());
|
|
23
|
+
}
|
|
24
|
+
const K = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
17
25
|
__name: "index",
|
|
18
26
|
props: {
|
|
19
27
|
icon: {},
|
|
@@ -23,177 +31,177 @@ const L = ["disabled"], V = ["disabled"], W = /* @__PURE__ */ h({
|
|
|
23
31
|
tooltipPlacement: { default: "top" },
|
|
24
32
|
size: {}
|
|
25
33
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
28
|
-
return (
|
|
34
|
+
setup(t) {
|
|
35
|
+
const e = t, i = d(() => L(e.tooltip)), r = d(() => e.size ? { fontSize: typeof e.size == "number" ? `${e.size}px` : e.size } : {});
|
|
36
|
+
return (c, l) => e.tooltip ? (a(), f(s(P), {
|
|
29
37
|
key: 0,
|
|
30
|
-
"render-content":
|
|
31
|
-
placement:
|
|
38
|
+
"render-content": i.value,
|
|
39
|
+
placement: e.tooltipPlacement,
|
|
32
40
|
effect: "light",
|
|
33
41
|
"visible-arrow": !1,
|
|
34
42
|
"popper-class": "tr-action-button-tooltip-popper"
|
|
35
43
|
}, {
|
|
36
44
|
default: x(() => [
|
|
37
|
-
|
|
38
|
-
class:
|
|
39
|
-
disabled:
|
|
40
|
-
onFocusCapture:
|
|
45
|
+
v("button", {
|
|
46
|
+
class: b(["tr-action-button", { active: e.active }]),
|
|
47
|
+
disabled: e.disabled,
|
|
48
|
+
onFocusCapture: l[0] || (l[0] = (u) => u.stopPropagation())
|
|
41
49
|
}, [
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
style:
|
|
50
|
+
T(c.$slots, "icon", {}, () => [
|
|
51
|
+
(a(), f($(e.icon), {
|
|
52
|
+
style: B(r.value)
|
|
45
53
|
}, null, 8, ["style"]))
|
|
46
54
|
], !0)
|
|
47
|
-
], 42,
|
|
55
|
+
], 42, K)
|
|
48
56
|
]),
|
|
49
57
|
_: 3
|
|
50
|
-
}, 8, ["render-content", "placement"])) : (
|
|
58
|
+
}, 8, ["render-content", "placement"])) : (a(), p("button", {
|
|
51
59
|
key: 1,
|
|
52
|
-
class:
|
|
53
|
-
disabled:
|
|
60
|
+
class: b(["tr-action-button", { active: e.active }]),
|
|
61
|
+
disabled: e.disabled
|
|
54
62
|
}, [
|
|
55
|
-
|
|
56
|
-
(
|
|
57
|
-
style:
|
|
63
|
+
T(c.$slots, "icon", {}, () => [
|
|
64
|
+
(a(), f($(e.icon), {
|
|
65
|
+
style: B(r.value)
|
|
58
66
|
}, null, 8, ["style"]))
|
|
59
67
|
], !0)
|
|
60
|
-
], 10,
|
|
68
|
+
], 10, X));
|
|
61
69
|
}
|
|
62
|
-
}),
|
|
70
|
+
}), q = /* @__PURE__ */ k(Y, [["__scopeId", "data-v-d6737627"]]), G = {
|
|
63
71
|
key: 0,
|
|
64
72
|
class: "tr-sender-submit-button__cancel-text"
|
|
65
|
-
},
|
|
73
|
+
}, H = /* @__PURE__ */ y({
|
|
66
74
|
__name: "index",
|
|
67
|
-
setup(
|
|
68
|
-
const { canSubmit:
|
|
69
|
-
var
|
|
70
|
-
return (
|
|
71
|
-
}),
|
|
72
|
-
var
|
|
73
|
-
return
|
|
75
|
+
setup(t) {
|
|
76
|
+
const { canSubmit: e, loading: i, defaultActions: r, submit: c, cancel: l, stopText: u } = g(), _ = d(() => {
|
|
77
|
+
var n, o;
|
|
78
|
+
return (o = (n = r.value) == null ? void 0 : n.submit) != null && o.disabled ? !0 : !e.value && !i.value;
|
|
79
|
+
}), h = d(() => {
|
|
80
|
+
var n, o;
|
|
81
|
+
return L((o = (n = r.value) == null ? void 0 : n.submit) == null ? void 0 : o.tooltip);
|
|
74
82
|
}), z = d(() => {
|
|
75
|
-
var
|
|
76
|
-
return ((
|
|
83
|
+
var n, o;
|
|
84
|
+
return ((o = (n = r.value) == null ? void 0 : n.submit) == null ? void 0 : o.tooltipPlacement) ?? "top";
|
|
77
85
|
}), C = () => {
|
|
78
|
-
_.value || (
|
|
86
|
+
_.value || (i.value ? l() : c());
|
|
79
87
|
};
|
|
80
|
-
return (
|
|
88
|
+
return (n, o) => h.value && !s(i) ? (a(), f(s(P), {
|
|
81
89
|
key: 0,
|
|
82
|
-
"render-content":
|
|
90
|
+
"render-content": h.value,
|
|
83
91
|
placement: z.value,
|
|
84
92
|
effect: "light",
|
|
85
93
|
"visible-arrow": !1,
|
|
86
94
|
"popper-class": "tr-submit-button-tooltip-popper"
|
|
87
95
|
}, {
|
|
88
96
|
default: x(() => [
|
|
89
|
-
|
|
90
|
-
class:
|
|
97
|
+
v("div", {
|
|
98
|
+
class: b([
|
|
91
99
|
"tr-sender-submit-button",
|
|
92
100
|
{
|
|
93
101
|
"is-disabled": _.value,
|
|
94
|
-
"is-loading":
|
|
102
|
+
"is-loading": s(i)
|
|
95
103
|
}
|
|
96
104
|
]),
|
|
97
105
|
onClick: C
|
|
98
106
|
}, [
|
|
99
|
-
m(
|
|
107
|
+
m(s(E), { class: "tr-sender-submit-button__icon" })
|
|
100
108
|
], 2)
|
|
101
109
|
]),
|
|
102
110
|
_: 1
|
|
103
|
-
}, 8, ["render-content", "placement"])) : (
|
|
111
|
+
}, 8, ["render-content", "placement"])) : (a(), p("div", {
|
|
104
112
|
key: 1,
|
|
105
|
-
class:
|
|
113
|
+
class: b([
|
|
106
114
|
"tr-sender-submit-button",
|
|
107
115
|
{
|
|
108
116
|
"is-disabled": _.value,
|
|
109
|
-
"is-loading":
|
|
117
|
+
"is-loading": s(i)
|
|
110
118
|
}
|
|
111
119
|
]),
|
|
112
120
|
onClick: C
|
|
113
121
|
}, [
|
|
114
|
-
|
|
122
|
+
s(i) ? (a(), p("div", {
|
|
115
123
|
key: 1,
|
|
116
|
-
class:
|
|
124
|
+
class: b(["tr-sender-submit-button__cancel", { "icon-only": !s(u) }])
|
|
117
125
|
}, [
|
|
118
|
-
m(
|
|
119
|
-
|
|
120
|
-
], 2)) : (
|
|
126
|
+
m(s(F), { class: "tr-sender-submit-button__cancel-icon" }),
|
|
127
|
+
s(u) ? (a(), p("span", G, w(s(u)), 1)) : S("", !0)
|
|
128
|
+
], 2)) : (a(), f(s(E), {
|
|
121
129
|
key: 0,
|
|
122
130
|
class: "tr-sender-submit-button__icon"
|
|
123
131
|
}))
|
|
124
132
|
], 2));
|
|
125
133
|
}
|
|
126
|
-
}),
|
|
134
|
+
}), J = /* @__PURE__ */ k(H, [["__scopeId", "data-v-a58e69fe"]]), M = /* @__PURE__ */ y({
|
|
127
135
|
__name: "index",
|
|
128
|
-
setup(
|
|
129
|
-
const { hasContent:
|
|
130
|
-
var
|
|
131
|
-
return ((
|
|
136
|
+
setup(t) {
|
|
137
|
+
const { hasContent: e, clearable: i, clear: r, loading: c, defaultActions: l } = g(), u = d(() => {
|
|
138
|
+
var n, o;
|
|
139
|
+
return ((o = (n = l.value) == null ? void 0 : n.clear) == null ? void 0 : o.disabled) !== void 0 ? l.value.clear.disabled : !1;
|
|
132
140
|
}), _ = d(() => {
|
|
133
|
-
var
|
|
134
|
-
return
|
|
135
|
-
}),
|
|
136
|
-
var
|
|
137
|
-
return ((
|
|
138
|
-
}), z = d(() =>
|
|
139
|
-
u.value ||
|
|
141
|
+
var n, o;
|
|
142
|
+
return (o = (n = l.value) == null ? void 0 : n.clear) == null ? void 0 : o.tooltip;
|
|
143
|
+
}), h = d(() => {
|
|
144
|
+
var n, o;
|
|
145
|
+
return ((o = (n = l.value) == null ? void 0 : n.clear) == null ? void 0 : o.tooltipPlacement) ?? "top";
|
|
146
|
+
}), z = d(() => i.value && e.value && !c.value && !u.value), C = () => {
|
|
147
|
+
u.value || r();
|
|
140
148
|
};
|
|
141
|
-
return (
|
|
149
|
+
return (n, o) => z.value ? (a(), f(q, {
|
|
142
150
|
key: 0,
|
|
143
|
-
icon:
|
|
151
|
+
icon: s(W),
|
|
144
152
|
disabled: u.value,
|
|
145
153
|
tooltip: _.value,
|
|
146
|
-
"tooltip-placement":
|
|
154
|
+
"tooltip-placement": h.value,
|
|
147
155
|
onClick: C
|
|
148
|
-
}, null, 8, ["icon", "disabled", "tooltip", "tooltip-placement"])) :
|
|
156
|
+
}, null, 8, ["icon", "disabled", "tooltip", "tooltip-placement"])) : S("", !0);
|
|
149
157
|
}
|
|
150
|
-
}),
|
|
158
|
+
}), Q = {
|
|
151
159
|
key: 0,
|
|
152
160
|
class: "tr-sender-word-counter"
|
|
153
|
-
},
|
|
161
|
+
}, U = /* @__PURE__ */ y({
|
|
154
162
|
__name: "index",
|
|
155
|
-
setup(
|
|
156
|
-
const { characterCount:
|
|
157
|
-
return (u, _) =>
|
|
158
|
-
|
|
159
|
-
class:
|
|
160
|
-
}, w(
|
|
161
|
-
|
|
162
|
-
])) :
|
|
163
|
+
setup(t) {
|
|
164
|
+
const { characterCount: e, maxLength: i, isOverLimit: r, showWordLimit: c } = g(), l = d(() => c.value && i.value !== void 0);
|
|
165
|
+
return (u, _) => l.value ? (a(), p("span", Q, [
|
|
166
|
+
v("span", {
|
|
167
|
+
class: b({ "is-over-limit": s(r) })
|
|
168
|
+
}, w(s(e)), 3),
|
|
169
|
+
v("span", null, "/" + w(s(i)), 1)
|
|
170
|
+
])) : S("", !0);
|
|
163
171
|
}
|
|
164
|
-
}),
|
|
172
|
+
}), rt = /* @__PURE__ */ k(U, [["__scopeId", "data-v-206396cd"]]), Z = { class: "tr-default-action-buttons" }, tt = {
|
|
165
173
|
key: 0,
|
|
166
174
|
class: "tr-action-buttons-group"
|
|
167
|
-
},
|
|
175
|
+
}, et = { class: "tr-submit-wrapper" }, nt = /* @__PURE__ */ y({
|
|
168
176
|
__name: "index",
|
|
169
|
-
setup(
|
|
170
|
-
const { hasContent:
|
|
171
|
-
return (
|
|
172
|
-
m(
|
|
177
|
+
setup(t) {
|
|
178
|
+
const { hasContent: e, loading: i } = g();
|
|
179
|
+
return (r, c) => (a(), p("div", Z, [
|
|
180
|
+
m(A, { name: "tr-slide-right" }, {
|
|
173
181
|
default: x(() => [
|
|
174
|
-
|
|
175
|
-
m(
|
|
182
|
+
s(e) || s(i) ? (a(), p("div", tt, [
|
|
183
|
+
m(A, { name: "tr-slide-right" }, {
|
|
176
184
|
default: x(() => [
|
|
177
|
-
m(
|
|
185
|
+
m(M)
|
|
178
186
|
]),
|
|
179
187
|
_: 1
|
|
180
188
|
}),
|
|
181
|
-
|
|
182
|
-
m(
|
|
189
|
+
v("div", et, [
|
|
190
|
+
m(J)
|
|
183
191
|
])
|
|
184
|
-
])) :
|
|
192
|
+
])) : S("", !0)
|
|
185
193
|
]),
|
|
186
194
|
_: 1
|
|
187
195
|
})
|
|
188
196
|
]));
|
|
189
197
|
}
|
|
190
|
-
}),
|
|
198
|
+
}), lt = /* @__PURE__ */ k(nt, [["__scopeId", "data-v-209924d7"]]);
|
|
191
199
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
q as A,
|
|
201
|
+
lt as D,
|
|
202
|
+
J as S,
|
|
203
|
+
rt as W,
|
|
204
|
+
M as _,
|
|
205
|
+
j as a,
|
|
198
206
|
g as u
|
|
199
207
|
};
|
package/dist/index6.js
CHANGED
|
@@ -842,7 +842,6 @@ const jt = /* @__PURE__ */ S({
|
|
|
842
842
|
return l;
|
|
843
843
|
}, m = y(() => o.messages.length === 0 ? [] : typeof o.groupStrategy == "function" ? o.groupStrategy(o.messages, o.dividerRole) : o.groupStrategy === "consecutive" ? u(o.messages) : b(o.messages, o.dividerRole));
|
|
844
844
|
return e({
|
|
845
|
-
rootEl: s,
|
|
846
845
|
scrollToBottom: a
|
|
847
846
|
}), (p, f) => (g(), C("div", {
|
|
848
847
|
class: "tr-bubble-list",
|
|
@@ -885,7 +884,7 @@ const jt = /* @__PURE__ */ S({
|
|
|
885
884
|
}), 128))
|
|
886
885
|
], 512));
|
|
887
886
|
}
|
|
888
|
-
}), V = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-
|
|
887
|
+
}), V = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-e217fbb7"]]), X = /* @__PURE__ */ S({
|
|
889
888
|
__name: "BubbleProvider",
|
|
890
889
|
props: {
|
|
891
890
|
boxRendererMatches: {},
|