@matechat/core 1.11.1 → 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 +276 -146
- package/Bubble/useBubbleFoundation.d.ts +9 -0
- package/FileList/index.js +1 -1
- package/Header/index.css +1 -1
- package/Header/index.js +11 -11
- package/Input/components/EditableBlock.vue.d.ts +2 -2
- package/Input/index.css +1 -1
- package/Input/index.js +82 -57
- package/Introduction/index.css +1 -1
- package/Introduction/index.js +129 -39
- package/Layout/index.js +6 -6
- package/List/index.js +5 -5
- 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 +542 -361
- 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 +364 -110
- package/Mention/mention-types.d.ts +6 -4
- package/Mention/use-mention.d.ts +7 -0
- package/Prompt/index.js +1 -1
- 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 +2 -2
- package/mate-chat.js +2 -1
- package/package.json +1 -1
- 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,28 +1,31 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
|
|
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(
|
|
12
15
|
"div",
|
|
13
16
|
{ class: "loading-dot dot-start" },
|
|
14
17
|
null,
|
|
15
18
|
-1
|
|
16
19
|
/* HOISTED */
|
|
17
20
|
),
|
|
18
|
-
|
|
21
|
+
p(
|
|
19
22
|
"div",
|
|
20
23
|
{ class: "loading-dot dot-middle" },
|
|
21
24
|
null,
|
|
22
25
|
-1
|
|
23
26
|
/* HOISTED */
|
|
24
27
|
),
|
|
25
|
-
|
|
28
|
+
p(
|
|
26
29
|
"div",
|
|
27
30
|
{ class: "loading-dot dot-end" },
|
|
28
31
|
null,
|
|
@@ -31,7 +34,7 @@ function D(i, a) {
|
|
|
31
34
|
)
|
|
32
35
|
]));
|
|
33
36
|
}
|
|
34
|
-
const
|
|
37
|
+
const W = /* @__PURE__ */ P(O, [["render", G], ["__scopeId", "data-v-395fc568"]]), q = 36, J = 36, K = {
|
|
35
38
|
content: {
|
|
36
39
|
type: String,
|
|
37
40
|
default: ""
|
|
@@ -55,7 +58,7 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
55
58
|
avatarConfig: {
|
|
56
59
|
type: Object
|
|
57
60
|
}
|
|
58
|
-
},
|
|
61
|
+
}, Q = {
|
|
59
62
|
name: {
|
|
60
63
|
type: String,
|
|
61
64
|
default: ""
|
|
@@ -79,7 +82,7 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
79
82
|
type: String,
|
|
80
83
|
default: ""
|
|
81
84
|
}
|
|
82
|
-
},
|
|
85
|
+
}, X = /* @__PURE__ */ S({
|
|
83
86
|
__name: "AvatarBodyIcon",
|
|
84
87
|
props: {
|
|
85
88
|
width: {
|
|
@@ -91,21 +94,21 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
91
94
|
default: 16
|
|
92
95
|
}
|
|
93
96
|
},
|
|
94
|
-
setup(
|
|
95
|
-
return (
|
|
97
|
+
setup(s) {
|
|
98
|
+
return (e, t) => (l(), u(
|
|
96
99
|
"svg",
|
|
97
100
|
{
|
|
98
|
-
style:
|
|
99
|
-
width: `${
|
|
100
|
-
height: `${
|
|
101
|
+
style: f({
|
|
102
|
+
width: `${s.width}px`,
|
|
103
|
+
height: `${s.height}px`,
|
|
101
104
|
verticalAlign: "middle"
|
|
102
105
|
}),
|
|
103
106
|
viewBox: "0 0 30 30",
|
|
104
107
|
version: "1.1",
|
|
105
108
|
xmlns: "http://www.w3.org/2000/svg"
|
|
106
109
|
},
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
t[0] || (t[0] = [
|
|
111
|
+
p(
|
|
109
112
|
"g",
|
|
110
113
|
{
|
|
111
114
|
stroke: "none",
|
|
@@ -114,14 +117,14 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
114
117
|
"fill-rule": "evenodd"
|
|
115
118
|
},
|
|
116
119
|
[
|
|
117
|
-
|
|
120
|
+
p("circle", {
|
|
118
121
|
id: "Oval",
|
|
119
122
|
fill: "#CACFD8",
|
|
120
123
|
cx: "15",
|
|
121
124
|
cy: "15",
|
|
122
125
|
r: "15"
|
|
123
126
|
}),
|
|
124
|
-
|
|
127
|
+
p("path", {
|
|
125
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",
|
|
126
129
|
fill: "#FFFFFF"
|
|
127
130
|
})
|
|
@@ -134,7 +137,7 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
134
137
|
/* STYLE */
|
|
135
138
|
));
|
|
136
139
|
}
|
|
137
|
-
}),
|
|
140
|
+
}), Y = /* @__PURE__ */ S({
|
|
138
141
|
__name: "AvatarNoBodyIcon",
|
|
139
142
|
props: {
|
|
140
143
|
width: {
|
|
@@ -146,21 +149,21 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
146
149
|
default: 16
|
|
147
150
|
}
|
|
148
151
|
},
|
|
149
|
-
setup(
|
|
150
|
-
return (
|
|
152
|
+
setup(s) {
|
|
153
|
+
return (e, t) => (l(), u(
|
|
151
154
|
"svg",
|
|
152
155
|
{
|
|
153
|
-
style:
|
|
154
|
-
width: `${
|
|
155
|
-
height: `${
|
|
156
|
+
style: f({
|
|
157
|
+
width: `${s.width}px`,
|
|
158
|
+
height: `${s.height}px`,
|
|
156
159
|
verticalAlign: "middle"
|
|
157
160
|
}),
|
|
158
161
|
viewBox: "0 0 30 30",
|
|
159
162
|
version: "1.1",
|
|
160
163
|
xmlns: "http://www.w3.org/2000/svg"
|
|
161
164
|
},
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
t[0] || (t[0] = [
|
|
166
|
+
p(
|
|
164
167
|
"g",
|
|
165
168
|
{
|
|
166
169
|
stroke: "none",
|
|
@@ -169,7 +172,7 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
169
172
|
"fill-rule": "evenodd"
|
|
170
173
|
},
|
|
171
174
|
[
|
|
172
|
-
|
|
175
|
+
p("path", {
|
|
173
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
|
|
174
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
|
|
175
178
|
L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053, 14.9974562 10.4297866,12.9827376 10.4297866,10.4974562
|
|
@@ -179,7 +182,7 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
179
182
|
17.9612467,15.983021 19.2414296, 16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z`,
|
|
180
183
|
fill: "#959EB2"
|
|
181
184
|
}),
|
|
182
|
-
|
|
185
|
+
p("path", {
|
|
183
186
|
d: `M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,
|
|
184
187
|
16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,
|
|
185
188
|
15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,
|
|
@@ -266,189 +269,316 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
266
269
|
/* STYLE */
|
|
267
270
|
));
|
|
268
271
|
}
|
|
269
|
-
}),
|
|
272
|
+
}), V = { class: "mc-bubble-avatar-wrapper" }, x = ["src"], e1 = /* @__PURE__ */ S({
|
|
270
273
|
__name: "Avatar",
|
|
271
|
-
props:
|
|
272
|
-
setup(
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
275
|
-
|
|
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);
|
|
276
279
|
return;
|
|
277
280
|
}
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
if (
|
|
282
|
-
|
|
283
|
-
else if (/^[\u4e00-\u9fa5]/.test(
|
|
284
|
-
|
|
285
|
-
else if (/^[A-Za-z]/.test(
|
|
286
|
-
if (/[_ -]/.test(
|
|
287
|
-
const
|
|
288
|
-
|
|
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();
|
|
289
292
|
} else
|
|
290
|
-
|
|
293
|
+
i.value = a.substr(0, 2).toUpperCase();
|
|
291
294
|
else
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
const
|
|
296
|
-
|
|
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;
|
|
297
300
|
};
|
|
298
|
-
return
|
|
299
|
-
|
|
300
|
-
}), (
|
|
301
|
-
var
|
|
302
|
-
return
|
|
303
|
-
|
|
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", {
|
|
304
307
|
key: 0,
|
|
305
|
-
src:
|
|
308
|
+
src: a.imgSrc,
|
|
306
309
|
alt: "",
|
|
307
|
-
onError:
|
|
308
|
-
style:
|
|
309
|
-
height: `${
|
|
310
|
-
width: `${
|
|
311
|
-
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"
|
|
312
315
|
})
|
|
313
|
-
}, null, 44,
|
|
314
|
-
!
|
|
316
|
+
}, null, 44, x)) : g("v-if", !0),
|
|
317
|
+
!a.imgSrc && !n.value && ((v = i.value) == null ? void 0 : v.length) !== 0 ? (l(), u(
|
|
315
318
|
"span",
|
|
316
319
|
{
|
|
317
320
|
key: 1,
|
|
318
|
-
class:
|
|
319
|
-
style:
|
|
320
|
-
height: `${
|
|
321
|
-
width: `${
|
|
322
|
-
lineHeight: `${
|
|
323
|
-
fontSize: `${
|
|
324
|
-
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"
|
|
325
328
|
})
|
|
326
329
|
},
|
|
327
|
-
|
|
330
|
+
Z(i.value),
|
|
328
331
|
7
|
|
329
332
|
/* TEXT, CLASS, STYLE */
|
|
330
|
-
)) :
|
|
331
|
-
!
|
|
333
|
+
)) : g("v-if", !0),
|
|
334
|
+
!a.imgSrc && !n.value && ((A = i.value) == null ? void 0 : A.length) === 0 ? (l(), u(
|
|
332
335
|
"span",
|
|
333
336
|
{
|
|
334
337
|
key: 2,
|
|
335
338
|
class: "mc-bubble-avatar-style",
|
|
336
|
-
style:
|
|
339
|
+
style: f({ borderRadius: a.isRound ? "100%" : "0" })
|
|
337
340
|
},
|
|
338
341
|
[
|
|
339
|
-
M(
|
|
340
|
-
width:
|
|
341
|
-
height:
|
|
342
|
+
M(X, {
|
|
343
|
+
width: a.width,
|
|
344
|
+
height: a.height
|
|
342
345
|
}, null, 8, ["width", "height"])
|
|
343
346
|
],
|
|
344
347
|
4
|
|
345
348
|
/* STYLE */
|
|
346
|
-
)) :
|
|
347
|
-
!
|
|
349
|
+
)) : g("v-if", !0),
|
|
350
|
+
!a.imgSrc && n.value || a.imgSrc && t.value ? (l(), u(
|
|
348
351
|
"span",
|
|
349
352
|
{
|
|
350
353
|
key: 3,
|
|
351
354
|
class: "mc-bubble-avatar-style",
|
|
352
|
-
style:
|
|
355
|
+
style: f({ borderRadius: a.isRound ? "100%" : "0" })
|
|
353
356
|
},
|
|
354
357
|
[
|
|
355
|
-
M(
|
|
356
|
-
width:
|
|
357
|
-
height:
|
|
358
|
+
M(Y, {
|
|
359
|
+
width: a.width,
|
|
360
|
+
height: a.height
|
|
358
361
|
}, null, 8, ["width", "height"])
|
|
359
362
|
],
|
|
360
363
|
4
|
|
361
364
|
/* STYLE */
|
|
362
|
-
)) :
|
|
365
|
+
)) : g("v-if", !0)
|
|
363
366
|
]);
|
|
364
367
|
};
|
|
365
368
|
}
|
|
366
|
-
})
|
|
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;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
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 = {
|
|
367
507
|
key: 0,
|
|
368
508
|
class: "mc-bubble-avatar"
|
|
369
|
-
},
|
|
509
|
+
}, l1 = {
|
|
370
510
|
key: 0,
|
|
371
511
|
class: "mc-bubble-avatar-name"
|
|
372
|
-
},
|
|
512
|
+
}, u1 = {
|
|
373
513
|
key: 1,
|
|
374
514
|
class: "loading-container"
|
|
375
|
-
},
|
|
515
|
+
}, d1 = /* @__PURE__ */ S({
|
|
376
516
|
__name: "Bubble",
|
|
377
|
-
props:
|
|
378
|
-
setup(
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
]), c = $(() => {
|
|
384
|
-
if (s.avatarConfig) {
|
|
385
|
-
const t = Object.keys(s.avatarConfig), l = t.some((g) => g === U || g === H);
|
|
386
|
-
return t.length < 1 || !l;
|
|
387
|
-
}
|
|
388
|
-
return !0;
|
|
389
|
-
});
|
|
390
|
-
return (t, l) => {
|
|
391
|
-
var g, m, b;
|
|
392
|
-
return r(), o(
|
|
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(
|
|
393
523
|
"div",
|
|
394
524
|
{
|
|
395
|
-
class:
|
|
525
|
+
class: y(["mc-bubble", h(n)])
|
|
396
526
|
},
|
|
397
527
|
[
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
])) :
|
|
528
|
+
h(e).avatar ? (l(), u("div", i1, [
|
|
529
|
+
L(r.$slots, "avatar", {}, void 0, !0)
|
|
530
|
+
])) : r.avatarConfig ? (l(), u(
|
|
401
531
|
"div",
|
|
402
532
|
{
|
|
403
533
|
key: 1,
|
|
404
|
-
class:
|
|
534
|
+
class: y(["mc-bubble-avatar", { "empty-avatar": h(o) }])
|
|
405
535
|
},
|
|
406
536
|
[
|
|
407
537
|
M(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
width: ((
|
|
412
|
-
height: ((
|
|
413
|
-
} :
|
|
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
|
|
414
544
|
)),
|
|
415
545
|
null,
|
|
416
546
|
16
|
|
417
547
|
/* FULL_PROPS */
|
|
418
548
|
),
|
|
419
|
-
|
|
549
|
+
r.avatarPosition === "top" ? (l(), u(
|
|
420
550
|
"span",
|
|
421
|
-
|
|
422
|
-
|
|
551
|
+
l1,
|
|
552
|
+
Z((m = r.avatarConfig) == null ? void 0 : m.displayName),
|
|
423
553
|
1
|
|
424
554
|
/* TEXT */
|
|
425
|
-
)) :
|
|
555
|
+
)) : g("v-if", !0)
|
|
426
556
|
],
|
|
427
557
|
2
|
|
428
558
|
/* CLASS */
|
|
429
|
-
)) :
|
|
430
|
-
|
|
559
|
+
)) : g("v-if", !0),
|
|
560
|
+
p(
|
|
431
561
|
"div",
|
|
432
562
|
{
|
|
433
|
-
class:
|
|
563
|
+
class: y(["mc-bubble-content-container", { "with-avatar": r.avatarConfig }])
|
|
434
564
|
},
|
|
435
565
|
[
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
M(
|
|
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)
|
|
440
570
|
], !0)
|
|
441
|
-
])) :
|
|
442
|
-
(
|
|
571
|
+
])) : g("v-if", !0),
|
|
572
|
+
(h(e).default || r.content) && !r.loading ? (l(), u(
|
|
443
573
|
"div",
|
|
444
574
|
{
|
|
445
575
|
key: 2,
|
|
446
|
-
class:
|
|
576
|
+
class: y(["mc-bubble-content", [r.variant]])
|
|
447
577
|
},
|
|
448
578
|
[
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
579
|
+
L(r.$slots, "default", {}, () => [
|
|
580
|
+
H(
|
|
581
|
+
Z(r.content),
|
|
452
582
|
1
|
|
453
583
|
/* TEXT */
|
|
454
584
|
)
|
|
@@ -456,8 +586,8 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
456
586
|
],
|
|
457
587
|
2
|
|
458
588
|
/* CLASS */
|
|
459
|
-
)) :
|
|
460
|
-
|
|
589
|
+
)) : g("v-if", !0),
|
|
590
|
+
r.loading ? g("v-if", !0) : L(r.$slots, "bottom", { key: 3 }, void 0, !0)
|
|
461
591
|
],
|
|
462
592
|
2
|
|
463
593
|
/* CLASS */
|
|
@@ -468,10 +598,10 @@ const I = /* @__PURE__ */ k(F, [["render", D], ["__scopeId", "data-v-395fc568"]]
|
|
|
468
598
|
);
|
|
469
599
|
};
|
|
470
600
|
}
|
|
471
|
-
}),
|
|
472
|
-
|
|
473
|
-
|
|
601
|
+
}), B = /* @__PURE__ */ P(d1, [["__scopeId", "data-v-9c10edf4"]]);
|
|
602
|
+
B.install = (s) => {
|
|
603
|
+
s.component("McBubble", B);
|
|
474
604
|
};
|
|
475
605
|
export {
|
|
476
|
-
|
|
606
|
+
B as McBubble
|
|
477
607
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BubbleFoundation } from '@matechat/common/Bubble/foundation';
|
|
2
|
+
export interface UseBubbleFoundationOptions {
|
|
3
|
+
props: any;
|
|
4
|
+
}
|
|
5
|
+
export declare function useBubbleFoundation({ props }: UseBubbleFoundationOptions): {
|
|
6
|
+
foundation: BubbleFoundation;
|
|
7
|
+
bubbleClasses: import("vue").ComputedRef<string>;
|
|
8
|
+
isEmptyAvatar: import("vue").ComputedRef<boolean>;
|
|
9
|
+
};
|
package/FileList/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { defineComponent as c,
|
|
2
|
+
import { defineComponent as c, openBlock as o, createElementBlock as a, normalizeClass as h, createElementVNode as t, createStaticVNode as f, toDisplayString as k, createCommentVNode as C, ref as $, Fragment as x, renderList as J, createBlock as U, resolveDynamicComponent as Q, unref as m, Teleport as X, createVNode as Y, Transition as t2, withCtx as e2, withModifiers as i2 } from "vue";
|
|
3
3
|
import { useMcI18n as l2 } from "@matechat/core/Locale";
|
|
4
4
|
const r2 = {
|
|
5
5
|
// 文件列表数据
|
package/Header/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-header[data-v-
|
|
1
|
+
.mc-header[data-v-a864dc89]{display:flex;justify-content:space-between;align-items:center}.mc-header .mc-header-logo-container[data-v-a864dc89]{display:flex;align-items:center;gap:4px}.mc-header .mc-header-logo-container.clickable[data-v-a864dc89]{cursor:pointer}.mc-header .mc-header-logo-container .mc-header-title[data-v-a864dc89]{letter-spacing:1px;font-weight:500;font-size:20px}
|