@matechat/core 1.11.0 → 1.12.0-alpha
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/Attachment/Attachment.vue.d.ts +8 -8
- package/Attachment/attachment-types.d.ts +3 -35
- package/Attachment/index.css +1 -1
- package/Attachment/index.js +43 -45
- package/Bubble/index.css +1 -1
- package/Bubble/index.js +322 -186
- package/Bubble/useBubbleFoundation.d.ts +9 -0
- package/FileList/index.js +1 -1
- package/Header/index.css +1 -1
- package/Header/index.js +12 -11
- package/Input/components/EditableBlock.vue.d.ts +2 -2
- package/Input/index.css +1 -1
- package/Input/index.js +699 -108
- package/Introduction/index.css +1 -1
- package/Introduction/index.js +138 -38
- package/Layout/index.js +7 -6
- package/List/index.css +1 -1
- package/List/index.js +54 -51
- package/Locale/index.js +85 -35
- package/MarkdownCard/MDCardParser.d.ts +0 -10
- package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +735 -200
- package/MarkdownCard/mdCard.types.d.ts +2 -29
- package/MarkdownCard/mdCard.vue.d.ts +2 -2
- package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
- package/Mention/Mention.vue.d.ts +12 -3
- package/Mention/index.css +1 -1
- package/Mention/index.js +365 -110
- package/Mention/mention-types.d.ts +6 -4
- package/Mention/use-mention.d.ts +7 -0
- package/Prompt/index.js +1 -1
- package/README.md +8 -12
- package/Toolbar/index.css +1 -1
- package/Toolbar/index.d.ts +2 -1
- package/Toolbar/index.js +189 -198
- package/Toolbar/toolbar.types.d.ts +2 -26
- package/index.d.ts +18 -6
- package/mate-chat.js +17 -2
- package/package.json +1 -4
- package/Attachment/uploader.d.ts +0 -11
- package/MarkdownCard/MDCardService.d.ts +0 -14
- package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
- package/MarkdownCard/MermaidService.d.ts +0 -22
- package/Mention/const.d.ts +0 -4
package/Bubble/index.js
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "./index.css";
|
|
2
|
+
var N = Object.defineProperty;
|
|
3
|
+
var F = (s, e, t) => e in s ? N(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
4
|
+
var $ = (s, e, t) => F(s, typeof e != "symbol" ? e + "" : e, t);
|
|
5
|
+
import { openBlock as l, createElementBlock as u, createElementVNode as p, defineComponent as S, normalizeStyle as f, ref as C, watch as R, createCommentVNode as g, normalizeClass as y, toDisplayString as Z, createVNode as M, reactive as E, nextTick as T, onBeforeUnmount as I, computed as _, useSlots as D, unref as h, renderSlot as L, normalizeProps as z, guardReactiveProps as U, createTextVNode as H } from "vue";
|
|
6
|
+
const P = (s, e) => {
|
|
7
|
+
const t = s.__vccOpts || s;
|
|
8
|
+
for (const [n, o] of e)
|
|
9
|
+
t[n] = o;
|
|
10
|
+
return t;
|
|
11
|
+
}, O = {}, j = { class: "mc-bubble-loading" };
|
|
12
|
+
function G(s, e) {
|
|
13
|
+
return l(), u("div", j, e[0] || (e[0] = [
|
|
14
|
+
p(
|
|
15
|
+
"div",
|
|
16
|
+
{ class: "loading-dot dot-start" },
|
|
17
|
+
null,
|
|
18
|
+
-1
|
|
19
|
+
/* HOISTED */
|
|
20
|
+
),
|
|
21
|
+
p(
|
|
22
|
+
"div",
|
|
23
|
+
{ class: "loading-dot dot-middle" },
|
|
24
|
+
null,
|
|
25
|
+
-1
|
|
26
|
+
/* HOISTED */
|
|
27
|
+
),
|
|
28
|
+
p(
|
|
29
|
+
"div",
|
|
30
|
+
{ class: "loading-dot dot-end" },
|
|
31
|
+
null,
|
|
32
|
+
-1
|
|
33
|
+
/* HOISTED */
|
|
34
|
+
)
|
|
35
|
+
]));
|
|
36
|
+
}
|
|
37
|
+
const W = /* @__PURE__ */ P(O, [["render", G], ["__scopeId", "data-v-395fc568"]]), q = 36, J = 36, K = {
|
|
38
|
+
content: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ""
|
|
41
|
+
},
|
|
42
|
+
loading: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
align: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "left"
|
|
49
|
+
},
|
|
50
|
+
avatarPosition: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "side"
|
|
53
|
+
},
|
|
54
|
+
variant: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "filled"
|
|
57
|
+
},
|
|
58
|
+
avatarConfig: {
|
|
59
|
+
type: Object
|
|
60
|
+
}
|
|
61
|
+
}, Q = {
|
|
3
62
|
name: {
|
|
4
63
|
type: String,
|
|
5
64
|
default: ""
|
|
@@ -23,7 +82,7 @@ const T = {
|
|
|
23
82
|
type: String,
|
|
24
83
|
default: ""
|
|
25
84
|
}
|
|
26
|
-
},
|
|
85
|
+
}, X = /* @__PURE__ */ S({
|
|
27
86
|
__name: "AvatarBodyIcon",
|
|
28
87
|
props: {
|
|
29
88
|
width: {
|
|
@@ -35,21 +94,21 @@ const T = {
|
|
|
35
94
|
default: 16
|
|
36
95
|
}
|
|
37
96
|
},
|
|
38
|
-
setup(
|
|
39
|
-
return (
|
|
97
|
+
setup(s) {
|
|
98
|
+
return (e, t) => (l(), u(
|
|
40
99
|
"svg",
|
|
41
100
|
{
|
|
42
|
-
style:
|
|
43
|
-
width: `${
|
|
44
|
-
height: `${
|
|
101
|
+
style: f({
|
|
102
|
+
width: `${s.width}px`,
|
|
103
|
+
height: `${s.height}px`,
|
|
45
104
|
verticalAlign: "middle"
|
|
46
105
|
}),
|
|
47
106
|
viewBox: "0 0 30 30",
|
|
48
107
|
version: "1.1",
|
|
49
108
|
xmlns: "http://www.w3.org/2000/svg"
|
|
50
109
|
},
|
|
51
|
-
|
|
52
|
-
|
|
110
|
+
t[0] || (t[0] = [
|
|
111
|
+
p(
|
|
53
112
|
"g",
|
|
54
113
|
{
|
|
55
114
|
stroke: "none",
|
|
@@ -58,14 +117,14 @@ const T = {
|
|
|
58
117
|
"fill-rule": "evenodd"
|
|
59
118
|
},
|
|
60
119
|
[
|
|
61
|
-
|
|
120
|
+
p("circle", {
|
|
62
121
|
id: "Oval",
|
|
63
122
|
fill: "#CACFD8",
|
|
64
123
|
cx: "15",
|
|
65
124
|
cy: "15",
|
|
66
125
|
r: "15"
|
|
67
126
|
}),
|
|
68
|
-
|
|
127
|
+
p("path", {
|
|
69
128
|
d: "M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866, 11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068, 7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068, 16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296, 16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",
|
|
70
129
|
fill: "#FFFFFF"
|
|
71
130
|
})
|
|
@@ -78,7 +137,7 @@ const T = {
|
|
|
78
137
|
/* STYLE */
|
|
79
138
|
));
|
|
80
139
|
}
|
|
81
|
-
}),
|
|
140
|
+
}), Y = /* @__PURE__ */ S({
|
|
82
141
|
__name: "AvatarNoBodyIcon",
|
|
83
142
|
props: {
|
|
84
143
|
width: {
|
|
@@ -90,21 +149,21 @@ const T = {
|
|
|
90
149
|
default: 16
|
|
91
150
|
}
|
|
92
151
|
},
|
|
93
|
-
setup(
|
|
94
|
-
return (
|
|
152
|
+
setup(s) {
|
|
153
|
+
return (e, t) => (l(), u(
|
|
95
154
|
"svg",
|
|
96
155
|
{
|
|
97
|
-
style:
|
|
98
|
-
width: `${
|
|
99
|
-
height: `${
|
|
156
|
+
style: f({
|
|
157
|
+
width: `${s.width}px`,
|
|
158
|
+
height: `${s.height}px`,
|
|
100
159
|
verticalAlign: "middle"
|
|
101
160
|
}),
|
|
102
161
|
viewBox: "0 0 30 30",
|
|
103
162
|
version: "1.1",
|
|
104
163
|
xmlns: "http://www.w3.org/2000/svg"
|
|
105
164
|
},
|
|
106
|
-
|
|
107
|
-
|
|
165
|
+
t[0] || (t[0] = [
|
|
166
|
+
p(
|
|
108
167
|
"g",
|
|
109
168
|
{
|
|
110
169
|
stroke: "none",
|
|
@@ -113,7 +172,7 @@ const T = {
|
|
|
113
172
|
"fill-rule": "evenodd"
|
|
114
173
|
},
|
|
115
174
|
[
|
|
116
|
-
|
|
175
|
+
p("path", {
|
|
117
176
|
d: `M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81, 19.2474562 L18.06,19.2474562 L18.06,17.7474562
|
|
118
177
|
L20.81,17.7474562 L20.81, 14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06, 19.2474562
|
|
119
178
|
L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053, 14.9974562 10.4297866,12.9827376 10.4297866,10.4974562
|
|
@@ -123,7 +182,7 @@ const T = {
|
|
|
123
182
|
17.9612467,15.983021 19.2414296, 16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z`,
|
|
124
183
|
fill: "#959EB2"
|
|
125
184
|
}),
|
|
126
|
-
|
|
185
|
+
p("path", {
|
|
127
186
|
d: `M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,
|
|
128
187
|
16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,
|
|
129
188
|
15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,
|
|
@@ -210,239 +269,316 @@ const T = {
|
|
|
210
269
|
/* STYLE */
|
|
211
270
|
));
|
|
212
271
|
}
|
|
213
|
-
}),
|
|
272
|
+
}), V = { class: "mc-bubble-avatar-wrapper" }, x = ["src"], e1 = /* @__PURE__ */ S({
|
|
214
273
|
__name: "Avatar",
|
|
215
|
-
props:
|
|
216
|
-
setup(
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
|
|
274
|
+
props: Q,
|
|
275
|
+
setup(s) {
|
|
276
|
+
const e = s, t = C(!1), n = C(!0), o = C(1), r = C(12), i = C(), b = (a) => {
|
|
277
|
+
if (e.gender) {
|
|
278
|
+
e.gender.toLowerCase() === "male" ? o.value = 1 : e.gender.toLowerCase() === "female" && (o.value = 0);
|
|
220
279
|
return;
|
|
221
280
|
}
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
if (
|
|
226
|
-
|
|
227
|
-
else if (/^[\u4e00-\u9fa5]/.test(
|
|
228
|
-
|
|
229
|
-
else if (/^[A-Za-z]/.test(
|
|
230
|
-
if (/[_ -]/.test(
|
|
231
|
-
const
|
|
232
|
-
|
|
281
|
+
const c = a.charCodeAt(0);
|
|
282
|
+
o.value = c % 2;
|
|
283
|
+
}, w = (a, c) => {
|
|
284
|
+
if (a.length < 2)
|
|
285
|
+
i.value = a;
|
|
286
|
+
else if (/^[\u4e00-\u9fa5]/.test(a))
|
|
287
|
+
i.value = a.substr(a.length - 2, 2);
|
|
288
|
+
else if (/^[A-Za-z]/.test(a))
|
|
289
|
+
if (/[_ -]/.test(a)) {
|
|
290
|
+
const v = a.split(/_|-|\s+/)[0], A = a.split(/_|-|\s+/)[1];
|
|
291
|
+
i.value = v.substr(0, 1).toUpperCase() + A.substr(0, 1).toUpperCase();
|
|
233
292
|
} else
|
|
234
|
-
|
|
293
|
+
i.value = a.substr(0, 2).toUpperCase();
|
|
235
294
|
else
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
const
|
|
240
|
-
|
|
295
|
+
i.value = a.substr(0, 2);
|
|
296
|
+
c < 30 && (i.value = a.substr(0, 1).toUpperCase()), b(a.substr(0, 1));
|
|
297
|
+
}, m = (a) => {
|
|
298
|
+
const c = a, v = Math.min(e.width, e.height);
|
|
299
|
+
c ? (n.value = !1, w(c, v)) : c === "" ? (n.value = !1, i.value = "") : n.value = !0, r.value = v / 4 + 3;
|
|
241
300
|
};
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
}), (
|
|
245
|
-
var
|
|
246
|
-
return
|
|
247
|
-
|
|
301
|
+
return m(e.name), R([() => e.name, () => e.width, () => e.height, () => e.gender], () => {
|
|
302
|
+
m(e.name);
|
|
303
|
+
}), (a, c) => {
|
|
304
|
+
var v, A;
|
|
305
|
+
return l(), u("span", V, [
|
|
306
|
+
a.imgSrc && !t.value ? (l(), u("img", {
|
|
248
307
|
key: 0,
|
|
249
|
-
src:
|
|
308
|
+
src: a.imgSrc,
|
|
250
309
|
alt: "",
|
|
251
|
-
onError:
|
|
252
|
-
style:
|
|
253
|
-
height: `${
|
|
254
|
-
width: `${
|
|
255
|
-
borderRadius:
|
|
310
|
+
onError: c[0] || (c[0] = () => t.value = !0),
|
|
311
|
+
style: f({
|
|
312
|
+
height: `${a.height}px`,
|
|
313
|
+
width: `${a.width}px`,
|
|
314
|
+
borderRadius: a.isRound ? "100%" : "0"
|
|
256
315
|
})
|
|
257
|
-
}, null, 44,
|
|
258
|
-
!
|
|
316
|
+
}, null, 44, x)) : g("v-if", !0),
|
|
317
|
+
!a.imgSrc && !n.value && ((v = i.value) == null ? void 0 : v.length) !== 0 ? (l(), u(
|
|
259
318
|
"span",
|
|
260
319
|
{
|
|
261
320
|
key: 1,
|
|
262
|
-
class:
|
|
263
|
-
style:
|
|
264
|
-
height: `${
|
|
265
|
-
width: `${
|
|
266
|
-
lineHeight: `${
|
|
267
|
-
fontSize: `${
|
|
268
|
-
borderRadius:
|
|
321
|
+
class: y(["mc-bubble-avatar-style", `mc-bubble-avatar-background-${o.value}`]),
|
|
322
|
+
style: f({
|
|
323
|
+
height: `${a.height}px`,
|
|
324
|
+
width: `${a.width}px`,
|
|
325
|
+
lineHeight: `${a.height}px`,
|
|
326
|
+
fontSize: `${r.value}px`,
|
|
327
|
+
borderRadius: a.isRound ? "100%" : "0"
|
|
269
328
|
})
|
|
270
329
|
},
|
|
271
|
-
|
|
330
|
+
Z(i.value),
|
|
272
331
|
7
|
|
273
332
|
/* TEXT, CLASS, STYLE */
|
|
274
|
-
)) :
|
|
275
|
-
!
|
|
333
|
+
)) : g("v-if", !0),
|
|
334
|
+
!a.imgSrc && !n.value && ((A = i.value) == null ? void 0 : A.length) === 0 ? (l(), u(
|
|
276
335
|
"span",
|
|
277
336
|
{
|
|
278
337
|
key: 2,
|
|
279
338
|
class: "mc-bubble-avatar-style",
|
|
280
|
-
style:
|
|
339
|
+
style: f({ borderRadius: a.isRound ? "100%" : "0" })
|
|
281
340
|
},
|
|
282
341
|
[
|
|
283
|
-
|
|
284
|
-
width:
|
|
285
|
-
height:
|
|
342
|
+
M(X, {
|
|
343
|
+
width: a.width,
|
|
344
|
+
height: a.height
|
|
286
345
|
}, null, 8, ["width", "height"])
|
|
287
346
|
],
|
|
288
347
|
4
|
|
289
348
|
/* STYLE */
|
|
290
|
-
)) :
|
|
291
|
-
!
|
|
349
|
+
)) : g("v-if", !0),
|
|
350
|
+
!a.imgSrc && n.value || a.imgSrc && t.value ? (l(), u(
|
|
292
351
|
"span",
|
|
293
352
|
{
|
|
294
353
|
key: 3,
|
|
295
354
|
class: "mc-bubble-avatar-style",
|
|
296
|
-
style:
|
|
355
|
+
style: f({ borderRadius: a.isRound ? "100%" : "0" })
|
|
297
356
|
},
|
|
298
357
|
[
|
|
299
|
-
|
|
300
|
-
width:
|
|
301
|
-
height:
|
|
358
|
+
M(Y, {
|
|
359
|
+
width: a.width,
|
|
360
|
+
height: a.height
|
|
302
361
|
}, null, 8, ["width", "height"])
|
|
303
362
|
],
|
|
304
363
|
4
|
|
305
364
|
/* STYLE */
|
|
306
|
-
)) :
|
|
365
|
+
)) : g("v-if", !0)
|
|
307
366
|
]);
|
|
308
367
|
};
|
|
309
368
|
}
|
|
310
|
-
})
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
369
|
+
});
|
|
370
|
+
function t1() {
|
|
371
|
+
const s = E({});
|
|
372
|
+
return {
|
|
373
|
+
getCache: (e) => s[e],
|
|
374
|
+
getCaches: () => ({ ...s }),
|
|
375
|
+
setCache: (e, t) => {
|
|
376
|
+
s[e] = t;
|
|
377
|
+
},
|
|
378
|
+
nextTick: T
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function a1({
|
|
382
|
+
adapter: s,
|
|
383
|
+
foundationClass: e
|
|
384
|
+
}) {
|
|
385
|
+
const t = C(null), n = () => (t.value || (t.value = new e(s), typeof t.value.init == "function" && t.value.init()), t.value), o = () => {
|
|
386
|
+
t.value && (typeof t.value.destroy == "function" && t.value.destroy(), t.value = null);
|
|
387
|
+
};
|
|
388
|
+
return I(() => {
|
|
389
|
+
o();
|
|
390
|
+
}), {
|
|
391
|
+
foundation: n(),
|
|
392
|
+
destroyFoundation: o
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
const s1 = "name", r1 = "imgSrc", d = () => {
|
|
396
|
+
};
|
|
397
|
+
class k {
|
|
398
|
+
constructor(e) {
|
|
399
|
+
$(this, "_adapter");
|
|
400
|
+
this._adapter = { ...k.defaultAdapter, ...e };
|
|
401
|
+
}
|
|
402
|
+
static get cssClasses() {
|
|
403
|
+
return {};
|
|
404
|
+
}
|
|
405
|
+
static get strings() {
|
|
406
|
+
return {};
|
|
407
|
+
}
|
|
408
|
+
static get numbers() {
|
|
409
|
+
return {};
|
|
410
|
+
}
|
|
411
|
+
static get defaultAdapter() {
|
|
412
|
+
return {
|
|
413
|
+
getProp: d,
|
|
414
|
+
getProps: d,
|
|
415
|
+
getState: d,
|
|
416
|
+
getStates: d,
|
|
417
|
+
setState: d,
|
|
418
|
+
getContext: d,
|
|
419
|
+
getContexts: d,
|
|
420
|
+
getCache: d,
|
|
421
|
+
setCache: d,
|
|
422
|
+
getCaches: d,
|
|
423
|
+
stopPropagation: d
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
getProp(e) {
|
|
427
|
+
return this._adapter.getProp(e);
|
|
428
|
+
}
|
|
429
|
+
getProps() {
|
|
430
|
+
return this._adapter.getProps();
|
|
431
|
+
}
|
|
432
|
+
getState(e) {
|
|
433
|
+
return this._adapter.getState(e);
|
|
434
|
+
}
|
|
435
|
+
getStates() {
|
|
436
|
+
return this._adapter.getStates();
|
|
437
|
+
}
|
|
438
|
+
setState(e, t) {
|
|
439
|
+
return this._adapter.setState({ ...e }, t);
|
|
440
|
+
}
|
|
441
|
+
/* istanbul ignore next */
|
|
442
|
+
getCaches() {
|
|
443
|
+
return this._adapter.getCaches();
|
|
444
|
+
}
|
|
445
|
+
getCache(e) {
|
|
446
|
+
return this._adapter.getCache(e);
|
|
447
|
+
}
|
|
448
|
+
setCache(e, t) {
|
|
449
|
+
return e && this._adapter.setCache(e, t);
|
|
450
|
+
}
|
|
451
|
+
nextTick(e) {
|
|
452
|
+
return this._adapter.nextTick(e);
|
|
453
|
+
}
|
|
454
|
+
_isInProps(e) {
|
|
455
|
+
const t = this.getProps();
|
|
456
|
+
return e in t;
|
|
457
|
+
}
|
|
458
|
+
init(e) {
|
|
459
|
+
}
|
|
460
|
+
destroy() {
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
class n1 extends k {
|
|
464
|
+
constructor(e) {
|
|
465
|
+
super({ ...e });
|
|
466
|
+
}
|
|
467
|
+
getBubbleClasses() {
|
|
468
|
+
const { align: e, loading: t, isEmptyAvatar: n, avatarPosition: o } = this.getProps();
|
|
469
|
+
return [
|
|
470
|
+
`mc-bubble-avatar-${o}`,
|
|
471
|
+
`mc-bubble-${e}`,
|
|
472
|
+
t ? "mc-bubble-loading" : "",
|
|
473
|
+
n ? "mc-bubble-avatar-empty" : ""
|
|
474
|
+
].filter(Boolean).join(" ");
|
|
475
|
+
}
|
|
476
|
+
getIsEmptyAvatar(e) {
|
|
477
|
+
if (e) {
|
|
478
|
+
const t = Object.keys(e), n = t.some(
|
|
479
|
+
(o) => o === s1 || o === r1
|
|
480
|
+
);
|
|
481
|
+
return t.length < 1 || !n;
|
|
482
|
+
} else
|
|
483
|
+
return !0;
|
|
333
484
|
}
|
|
334
|
-
}, H = 36, O = 36, j = "name", G = "imgSrc", k = (i, a) => {
|
|
335
|
-
const s = i.__vccOpts || i;
|
|
336
|
-
for (const [n, g] of a)
|
|
337
|
-
s[n] = g;
|
|
338
|
-
return s;
|
|
339
|
-
}, W = {}, q = { class: "mc-bubble-loading" };
|
|
340
|
-
function J(i, a) {
|
|
341
|
-
return r(), l("div", q, a[0] || (a[0] = [
|
|
342
|
-
v(
|
|
343
|
-
"div",
|
|
344
|
-
{ class: "loading-dot dot-start" },
|
|
345
|
-
null,
|
|
346
|
-
-1
|
|
347
|
-
/* HOISTED */
|
|
348
|
-
),
|
|
349
|
-
v(
|
|
350
|
-
"div",
|
|
351
|
-
{ class: "loading-dot dot-middle" },
|
|
352
|
-
null,
|
|
353
|
-
-1
|
|
354
|
-
/* HOISTED */
|
|
355
|
-
),
|
|
356
|
-
v(
|
|
357
|
-
"div",
|
|
358
|
-
{ class: "loading-dot dot-end" },
|
|
359
|
-
null,
|
|
360
|
-
-1
|
|
361
|
-
/* HOISTED */
|
|
362
|
-
)
|
|
363
|
-
]));
|
|
364
485
|
}
|
|
365
|
-
|
|
486
|
+
function o1({ props: s }) {
|
|
487
|
+
const t = {
|
|
488
|
+
...t1(),
|
|
489
|
+
getProps: () => s,
|
|
490
|
+
getProp: (i) => s[i],
|
|
491
|
+
getStates: () => ({}),
|
|
492
|
+
getState: (i) => {
|
|
493
|
+
},
|
|
494
|
+
setState: (i, b) => {
|
|
495
|
+
}
|
|
496
|
+
}, { foundation: n } = a1({
|
|
497
|
+
adapter: t,
|
|
498
|
+
foundationClass: n1
|
|
499
|
+
}), o = _(() => n.getBubbleClasses()), r = _(() => n.getIsEmptyAvatar(s.avatarConfig));
|
|
500
|
+
return {
|
|
501
|
+
foundation: n,
|
|
502
|
+
bubbleClasses: o,
|
|
503
|
+
isEmptyAvatar: r
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
const i1 = {
|
|
507
|
+
key: 0,
|
|
508
|
+
class: "mc-bubble-avatar"
|
|
509
|
+
}, l1 = {
|
|
366
510
|
key: 0,
|
|
367
511
|
class: "mc-bubble-avatar-name"
|
|
368
|
-
},
|
|
512
|
+
}, u1 = {
|
|
369
513
|
key: 1,
|
|
370
514
|
class: "loading-container"
|
|
371
|
-
},
|
|
515
|
+
}, d1 = /* @__PURE__ */ S({
|
|
372
516
|
__name: "Bubble",
|
|
373
|
-
props:
|
|
374
|
-
setup(
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
]), g = $(() => {
|
|
380
|
-
if (s.avatarConfig) {
|
|
381
|
-
const t = Object.keys(s.avatarConfig), o = t.some((C) => C === j || C === G);
|
|
382
|
-
return t.length < 1 || !o;
|
|
383
|
-
} else
|
|
384
|
-
return !0;
|
|
385
|
-
});
|
|
386
|
-
return (t, o) => {
|
|
387
|
-
var C, L, f;
|
|
388
|
-
return r(), l(
|
|
517
|
+
props: K,
|
|
518
|
+
setup(s) {
|
|
519
|
+
const e = D(), t = s, { bubbleClasses: n, isEmptyAvatar: o } = o1({ props: t });
|
|
520
|
+
return (r, i) => {
|
|
521
|
+
var b, w, m;
|
|
522
|
+
return l(), u(
|
|
389
523
|
"div",
|
|
390
524
|
{
|
|
391
|
-
class:
|
|
525
|
+
class: y(["mc-bubble", h(n)])
|
|
392
526
|
},
|
|
393
527
|
[
|
|
394
|
-
|
|
528
|
+
h(e).avatar ? (l(), u("div", i1, [
|
|
529
|
+
L(r.$slots, "avatar", {}, void 0, !0)
|
|
530
|
+
])) : r.avatarConfig ? (l(), u(
|
|
395
531
|
"div",
|
|
396
532
|
{
|
|
397
|
-
key:
|
|
398
|
-
class:
|
|
533
|
+
key: 1,
|
|
534
|
+
class: y(["mc-bubble-avatar", { "empty-avatar": h(o) }])
|
|
399
535
|
},
|
|
400
536
|
[
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
width: ((
|
|
406
|
-
height: ((
|
|
407
|
-
} :
|
|
537
|
+
M(
|
|
538
|
+
e1,
|
|
539
|
+
z(U(
|
|
540
|
+
h(o) ? {
|
|
541
|
+
width: ((b = r.avatarConfig) == null ? void 0 : b.width) || h(q),
|
|
542
|
+
height: ((w = r.avatarConfig) == null ? void 0 : w.height) || h(J)
|
|
543
|
+
} : r.avatarConfig
|
|
408
544
|
)),
|
|
409
545
|
null,
|
|
410
546
|
16
|
|
411
547
|
/* FULL_PROPS */
|
|
412
548
|
),
|
|
413
|
-
|
|
549
|
+
r.avatarPosition === "top" ? (l(), u(
|
|
414
550
|
"span",
|
|
415
|
-
|
|
416
|
-
|
|
551
|
+
l1,
|
|
552
|
+
Z((m = r.avatarConfig) == null ? void 0 : m.displayName),
|
|
417
553
|
1
|
|
418
554
|
/* TEXT */
|
|
419
|
-
)) :
|
|
555
|
+
)) : g("v-if", !0)
|
|
420
556
|
],
|
|
421
557
|
2
|
|
422
558
|
/* CLASS */
|
|
423
|
-
)) :
|
|
424
|
-
|
|
559
|
+
)) : g("v-if", !0),
|
|
560
|
+
p(
|
|
425
561
|
"div",
|
|
426
562
|
{
|
|
427
|
-
class:
|
|
563
|
+
class: y(["mc-bubble-content-container", { "with-avatar": r.avatarConfig }])
|
|
428
564
|
},
|
|
429
565
|
[
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
566
|
+
r.loading ? g("v-if", !0) : L(r.$slots, "top", { key: 0 }, void 0, !0),
|
|
567
|
+
r.loading ? (l(), u("div", u1, [
|
|
568
|
+
L(r.$slots, "loadingTpl", {}, () => [
|
|
569
|
+
M(W)
|
|
434
570
|
], !0)
|
|
435
|
-
])) :
|
|
436
|
-
(
|
|
571
|
+
])) : g("v-if", !0),
|
|
572
|
+
(h(e).default || r.content) && !r.loading ? (l(), u(
|
|
437
573
|
"div",
|
|
438
574
|
{
|
|
439
575
|
key: 2,
|
|
440
|
-
class:
|
|
576
|
+
class: y(["mc-bubble-content", [r.variant]])
|
|
441
577
|
},
|
|
442
578
|
[
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
579
|
+
L(r.$slots, "default", {}, () => [
|
|
580
|
+
H(
|
|
581
|
+
Z(r.content),
|
|
446
582
|
1
|
|
447
583
|
/* TEXT */
|
|
448
584
|
)
|
|
@@ -450,8 +586,8 @@ const K = /* @__PURE__ */ k(W, [["render", J], ["__scopeId", "data-v-395fc568"]]
|
|
|
450
586
|
],
|
|
451
587
|
2
|
|
452
588
|
/* CLASS */
|
|
453
|
-
)) :
|
|
454
|
-
|
|
589
|
+
)) : g("v-if", !0),
|
|
590
|
+
r.loading ? g("v-if", !0) : L(r.$slots, "bottom", { key: 3 }, void 0, !0)
|
|
455
591
|
],
|
|
456
592
|
2
|
|
457
593
|
/* CLASS */
|
|
@@ -462,10 +598,10 @@ const K = /* @__PURE__ */ k(W, [["render", J], ["__scopeId", "data-v-395fc568"]]
|
|
|
462
598
|
);
|
|
463
599
|
};
|
|
464
600
|
}
|
|
465
|
-
}),
|
|
466
|
-
|
|
467
|
-
|
|
601
|
+
}), B = /* @__PURE__ */ P(d1, [["__scopeId", "data-v-9c10edf4"]]);
|
|
602
|
+
B.install = (s) => {
|
|
603
|
+
s.component("McBubble", B);
|
|
468
604
|
};
|
|
469
605
|
export {
|
|
470
|
-
|
|
606
|
+
B as McBubble
|
|
471
607
|
};
|