@matechat/core 1.1.0 → 1.2.0-alpha.0
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/Bubble/index.js +36 -36
- package/Header/index.js +6 -6
- package/Input/index.css +1 -1
- package/Input/index.js +94 -93
- package/Introduction/index.js +19 -19
- package/Layout/index.js +6 -6
- package/List/index.js +8 -8
- package/Locale/index.js +75 -0
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +63 -57
- package/Mention/index.js +13 -13
- package/Prompt/index.js +4 -4
- package/mate-chat.js +4 -0
- package/package.json +2 -1
package/List/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import {
|
|
2
|
+
import { computed as E, ref as L, onMounted as p, defineComponent as w, createElementBlock as u, openBlock as f, unref as c, normalizeClass as g, Fragment as b, renderList as z, renderSlot as h, createTextVNode as C, toDisplayString as T } from "vue";
|
|
3
3
|
var v = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(v || {}), k = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(k || {});
|
|
4
4
|
const A = {
|
|
5
5
|
direction: {
|
|
@@ -37,7 +37,7 @@ const A = {
|
|
|
37
37
|
}
|
|
38
38
|
}, B = 50, H = ["TEXTAREA", "INPUT"], I = "ArrowUp", _ = "ArrowDown", N = "Enter";
|
|
39
39
|
function M(e, o) {
|
|
40
|
-
const n =
|
|
40
|
+
const n = L(e.enableShortKey ? 0 : -1), i = (t) => {
|
|
41
41
|
if (!t.disabled) {
|
|
42
42
|
if (e.selectable)
|
|
43
43
|
for (let l = 0; l < e.data.length; l++)
|
|
@@ -52,7 +52,7 @@ function M(e, o) {
|
|
|
52
52
|
}, m = (t) => {
|
|
53
53
|
t.code === I && (n.value = n.value === 0 ? e.data.length - 1 : n.value - 1), t.code === _ && (n.value = n.value === e.data.length - 1 ? 0 : n.value + 1), t.code === N && (e.selectable && (e.data[n.value].active = !0), o("select", { ...e.data[n.value] }));
|
|
54
54
|
};
|
|
55
|
-
return
|
|
55
|
+
return p(() => {
|
|
56
56
|
let t;
|
|
57
57
|
if (e.inputEl) {
|
|
58
58
|
const l = e.inputEl.$el ?? e.inputEl;
|
|
@@ -63,7 +63,7 @@ function M(e, o) {
|
|
|
63
63
|
}), { preSelectIndex: n, onItemClick: i, onListScroll: s };
|
|
64
64
|
}
|
|
65
65
|
function D(e) {
|
|
66
|
-
return { listClasses:
|
|
66
|
+
return { listClasses: E(() => ({
|
|
67
67
|
"mc-list": !0,
|
|
68
68
|
"mc-list-horizontal": e.direction === v.Horizontal,
|
|
69
69
|
"mc-list-nowrap": e.direction === v.Horizontal && !e.autoWrap
|
|
@@ -75,7 +75,7 @@ const K = ["onClick"], U = /* @__PURE__ */ w({
|
|
|
75
75
|
emits: ["select", "loadMore"],
|
|
76
76
|
setup(e, { emit: o }) {
|
|
77
77
|
const n = e, i = o, { listClasses: s } = D(n), { preSelectIndex: m, onItemClick: t, onListScroll: l } = M(n, i);
|
|
78
|
-
return (r, d) => (
|
|
78
|
+
return (r, d) => (f(), u(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
class: g(c(s)),
|
|
@@ -83,17 +83,17 @@ const K = ["onClick"], U = /* @__PURE__ */ w({
|
|
|
83
83
|
(...a) => c(l) && c(l)(...a))
|
|
84
84
|
},
|
|
85
85
|
[
|
|
86
|
-
(
|
|
86
|
+
(f(!0), u(
|
|
87
87
|
b,
|
|
88
88
|
null,
|
|
89
|
-
z(r.data, (a, y) => (
|
|
89
|
+
z(r.data, (a, y) => (f(), u(
|
|
90
90
|
b,
|
|
91
91
|
{ key: y },
|
|
92
92
|
[
|
|
93
93
|
r.variant === c(k).None ? h(r.$slots, "item", {
|
|
94
94
|
key: 0,
|
|
95
95
|
item: a
|
|
96
|
-
}, void 0, !0) : (
|
|
96
|
+
}, void 0, !0) : (f(), u("div", {
|
|
97
97
|
key: 1,
|
|
98
98
|
class: g([
|
|
99
99
|
"mc-list-item",
|
package/Locale/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var h = (t, e, s) => e in t ? f(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var o = (t, e, s) => h(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { ref as p, reactive as u } from "vue";
|
|
5
|
+
function g(t) {
|
|
6
|
+
return new y(t);
|
|
7
|
+
}
|
|
8
|
+
let y = class {
|
|
9
|
+
constructor(e) {
|
|
10
|
+
o(this, "locale", p("zh-cn"));
|
|
11
|
+
o(this, "messages", u({}));
|
|
12
|
+
/** 切换语言 */
|
|
13
|
+
o(this, "use", (e) => {
|
|
14
|
+
this.locale.value = e;
|
|
15
|
+
});
|
|
16
|
+
/** 翻译函数 */
|
|
17
|
+
o(this, "t", (e, s = {}) => {
|
|
18
|
+
const r = this.messages[this.locale.value];
|
|
19
|
+
return M(e, s, r);
|
|
20
|
+
});
|
|
21
|
+
/** 覆盖、合并国际化翻译 */
|
|
22
|
+
o(this, "mergeLocaleMessages", (e, s) => this.messages[e] ? (this.messages[e] = a(this.messages[e], s), a(this.messages[e], s)) : (this.messages[e] = s, this.messages));
|
|
23
|
+
this.locale.value = e.locale, this.messages = u(e.messages);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function M(t, e, s) {
|
|
27
|
+
const r = t.split(".");
|
|
28
|
+
let n = s || {};
|
|
29
|
+
return r.forEach((c) => {
|
|
30
|
+
n = n[c] ?? t;
|
|
31
|
+
}), typeof n == "function" ? n(e) : n.replace(/{(\w+)}/g, (c, l) => e[l] ?? `{${l}}`);
|
|
32
|
+
}
|
|
33
|
+
function a(t, e) {
|
|
34
|
+
const s = { ...t };
|
|
35
|
+
for (const r in e)
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
37
|
+
const n = e[r], c = t[r];
|
|
38
|
+
typeof n == "object" && n !== null ? typeof c == "object" && c !== null ? s[r] = a(c, n) : s[r] = { ...n } : s[r] = n;
|
|
39
|
+
}
|
|
40
|
+
return s;
|
|
41
|
+
}
|
|
42
|
+
const m = {
|
|
43
|
+
Input: {
|
|
44
|
+
send: "Send",
|
|
45
|
+
pauseAnswer: "Stop",
|
|
46
|
+
pleaseEnter: "Please enter your question...",
|
|
47
|
+
pleaseEnterPlaceholder: "Please enter your question and press {enterKey} to send, {shiftEnterKey} to wrap."
|
|
48
|
+
}
|
|
49
|
+
}, d = {
|
|
50
|
+
Input: {
|
|
51
|
+
send: "发送",
|
|
52
|
+
pauseAnswer: "停止回答",
|
|
53
|
+
pleaseEnter: "请输入您的问题...",
|
|
54
|
+
pleaseEnterPlaceholder: "请输入您的问题,并按{enterKey}发送,按{shiftEnterKey}换行"
|
|
55
|
+
}
|
|
56
|
+
}, I = {
|
|
57
|
+
"en-us": m,
|
|
58
|
+
"zh-cn": d
|
|
59
|
+
}, i = g({
|
|
60
|
+
locale: "zh-cn",
|
|
61
|
+
messages: I
|
|
62
|
+
});
|
|
63
|
+
function v() {
|
|
64
|
+
return i;
|
|
65
|
+
}
|
|
66
|
+
const b = {
|
|
67
|
+
install: (t) => {
|
|
68
|
+
t.config.globalProperties.McI18n = i;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
b as McLocale,
|
|
73
|
+
i as default,
|
|
74
|
+
v as useMcI18n
|
|
75
|
+
};
|
package/MarkdownCard/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-code-block-light[data-v-
|
|
1
|
+
.mc-code-block-light[data-v-de46b77a] pre code.hljs{display:block;overflow-x:auto;padding:1em}.mc-code-block-light[data-v-de46b77a] code.hljs{padding:3px 5px}.mc-code-block-light[data-v-de46b77a] .hljs{background:#fefefe;color:#545454}.mc-code-block-light[data-v-de46b77a] .hljs-comment,.mc-code-block-light[data-v-de46b77a] .hljs-quote{color:#696969}.mc-code-block-light[data-v-de46b77a] .hljs-variable,.mc-code-block-light[data-v-de46b77a] .hljs-template-variable,.mc-code-block-light[data-v-de46b77a] .hljs-tag,.mc-code-block-light[data-v-de46b77a] .hljs-name,.mc-code-block-light[data-v-de46b77a] .hljs-selector-id,.mc-code-block-light[data-v-de46b77a] .hljs-selector-class,.mc-code-block-light[data-v-de46b77a] .hljs-regexp,.mc-code-block-light[data-v-de46b77a] .hljs-deletion{color:#d91e18}.mc-code-block-light[data-v-de46b77a] .hljs-number,.mc-code-block-light[data-v-de46b77a] .hljs-built_in,.mc-code-block-light[data-v-de46b77a] .hljs-literal,.mc-code-block-light[data-v-de46b77a] .hljs-type,.mc-code-block-light[data-v-de46b77a] .hljs-params,.mc-code-block-light[data-v-de46b77a] .hljs-meta,.mc-code-block-light[data-v-de46b77a] .hljs-link,.mc-code-block-light[data-v-de46b77a] .hljs-attribute{color:#aa5d00}.mc-code-block-light[data-v-de46b77a] .hljs-string,.mc-code-block-light[data-v-de46b77a] .hljs-symbol,.mc-code-block-light[data-v-de46b77a] .hljs-bullet,.mc-code-block-light[data-v-de46b77a] .hljs-addition{color:green}.mc-code-block-light[data-v-de46b77a] .hljs-title,.mc-code-block-light[data-v-de46b77a] .hljs-section{color:#007faa}.mc-code-block-light[data-v-de46b77a] .hljs-keyword,.mc-code-block-light[data-v-de46b77a] .hljs-selector-tag{color:#7928a1}.mc-code-block-light[data-v-de46b77a] .hljs-emphasis{font-style:italic}.mc-code-block-light[data-v-de46b77a] .hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.mc-code-block-light[data-v-de46b77a] .hljs-addition,.mc-code-block-light[data-v-de46b77a] .hljs-attribute,.mc-code-block-light[data-v-de46b77a] .hljs-built_in,.mc-code-block-light[data-v-de46b77a] .hljs-bullet,.mc-code-block-light[data-v-de46b77a] .hljs-comment,.mc-code-block-light[data-v-de46b77a] .hljs-link,.mc-code-block-light[data-v-de46b77a] .hljs-literal,.mc-code-block-light[data-v-de46b77a] .hljs-meta,.mc-code-block-light[data-v-de46b77a] .hljs-number,.mc-code-block-light[data-v-de46b77a] .hljs-params,.mc-code-block-light[data-v-de46b77a] .hljs-string,.mc-code-block-light[data-v-de46b77a] .hljs-symbol,.mc-code-block-light[data-v-de46b77a] .hljs-type,.mc-code-block-light[data-v-de46b77a] .hljs-quote{color:highlight}.mc-code-block-light[data-v-de46b77a] .hljs-keyword,.mc-code-block-light[data-v-de46b77a] .hljs-selector-tag{font-weight:700}}.mc-code-block-dark[data-v-de46b77a] pre code.hljs{display:block;overflow-x:auto;padding:1em}.mc-code-block-dark[data-v-de46b77a] code.hljs{padding:3px 5px}.mc-code-block-dark[data-v-de46b77a] .hljs{background:#2b2b2b;color:#f8f8f2}.mc-code-block-dark[data-v-de46b77a] .hljs-comment,.mc-code-block-dark[data-v-de46b77a] .hljs-quote{color:#d4d0ab}.mc-code-block-dark[data-v-de46b77a] .hljs-variable,.mc-code-block-dark[data-v-de46b77a] .hljs-template-variable,.mc-code-block-dark[data-v-de46b77a] .hljs-tag,.mc-code-block-dark[data-v-de46b77a] .hljs-name,.mc-code-block-dark[data-v-de46b77a] .hljs-selector-id,.mc-code-block-dark[data-v-de46b77a] .hljs-selector-class,.mc-code-block-dark[data-v-de46b77a] .hljs-regexp,.mc-code-block-dark[data-v-de46b77a] .hljs-deletion{color:#ffa07a}.mc-code-block-dark[data-v-de46b77a] .hljs-number,.mc-code-block-dark[data-v-de46b77a] .hljs-built_in,.mc-code-block-dark[data-v-de46b77a] .hljs-literal,.mc-code-block-dark[data-v-de46b77a] .hljs-type,.mc-code-block-dark[data-v-de46b77a] .hljs-params,.mc-code-block-dark[data-v-de46b77a] .hljs-meta,.mc-code-block-dark[data-v-de46b77a] .hljs-link{color:#f5ab35}.mc-code-block-dark[data-v-de46b77a] .hljs-attribute{color:gold}.mc-code-block-dark[data-v-de46b77a] .hljs-string,.mc-code-block-dark[data-v-de46b77a] .hljs-symbol,.mc-code-block-dark[data-v-de46b77a] .hljs-bullet,.mc-code-block-dark[data-v-de46b77a] .hljs-addition{color:#abe338}.mc-code-block-dark[data-v-de46b77a] .hljs-title,.mc-code-block-dark[data-v-de46b77a] .hljs-section{color:#00e0e0}.mc-code-block-dark[data-v-de46b77a] .hljs-keyword,.mc-code-block-dark[data-v-de46b77a] .hljs-selector-tag{color:#dcc6e0}.mc-code-block-dark[data-v-de46b77a] .hljs-emphasis{font-style:italic}.mc-code-block-dark[data-v-de46b77a] .hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.mc-code-block-dark[data-v-de46b77a] .hljs-addition,.mc-code-block-dark[data-v-de46b77a] .hljs-attribute,.mc-code-block-dark[data-v-de46b77a] .hljs-built_in,.mc-code-block-dark[data-v-de46b77a] .hljs-bullet,.mc-code-block-dark[data-v-de46b77a] .hljs-comment,.mc-code-block-dark[data-v-de46b77a] .hljs-link,.mc-code-block-dark[data-v-de46b77a] .hljs-literal,.mc-code-block-dark[data-v-de46b77a] .hljs-meta,.mc-code-block-dark[data-v-de46b77a] .hljs-number,.mc-code-block-dark[data-v-de46b77a] .hljs-params,.mc-code-block-dark[data-v-de46b77a] .hljs-string,.mc-code-block-dark[data-v-de46b77a] .hljs-symbol,.mc-code-block-dark[data-v-de46b77a] .hljs-type,.mc-code-block-dark[data-v-de46b77a] .hljs-quote{color:highlight}.mc-code-block-dark[data-v-de46b77a] .hljs-keyword,.mc-code-block-dark[data-v-de46b77a] .hljs-selector-tag{font-weight:700}}.v-enter-active[data-v-de46b77a],.v-leave-active[data-v-de46b77a]{transition:opacity .5s ease}.v-enter-from[data-v-de46b77a],.v-leave-to[data-v-de46b77a]{opacity:0}.mc-code-block[data-v-de46b77a]{margin:1rem 0;overflow:hidden;border-radius:14px}.mc-code-block pre[data-v-de46b77a]{margin:0}.mc-code-block .mc-action-btn[data-v-de46b77a]{width:24px;height:24px}.mc-code-block .mc-code-block-header[data-v-de46b77a]{display:flex;justify-content:space-between;align-items:center;padding:.5rem 1rem}.mc-code-block .mc-code-block-header .mc-code-lang[data-v-de46b77a]{font-size:var(--devui-font-size, 12px)}.mc-code-block .mc-code-block-actions[data-v-de46b77a]{display:flex;align-items:center}.mc-code-block .mc-code-block-actions .mc-copy-btn[data-v-de46b77a],.mc-code-block .mc-code-block-actions .mc-toggle-btn[data-v-de46b77a]{cursor:pointer;border-radius:4px;font-size:18px;padding:4px}.mc-code-block-light[data-v-de46b77a]{border:1px solid #d7d8da;background-color:#f5f5f5}.mc-code-block-light code.hljs[data-v-de46b77a]{padding:1em}.mc-code-block-light .mc-code-lang[data-v-de46b77a],.mc-code-block-light .mc-code-block-actions .mc-copy-btn[data-v-de46b77a],.mc-code-block-light .mc-code-block-actions .mc-toggle-btn[data-v-de46b77a]{color:#252b3a}.mc-code-block-light .mc-code-block-actions .mc-copy-btn[data-v-de46b77a]:hover,.mc-code-block-light .mc-code-block-actions .mc-toggle-btn[data-v-de46b77a]:hover{background-color:#ebebeb}.mc-code-block-dark[data-v-de46b77a]{border:1px solid #4e5057;background-color:#34363a}.mc-code-block-dark code.hljs[data-v-de46b77a]{padding:1em}.mc-code-block-dark .mc-code-lang[data-v-de46b77a],.mc-code-block-dark .mc-code-block-actions .mc-copy-btn[data-v-de46b77a],.mc-code-block-dark .mc-code-block-actions .mc-toggle-btn[data-v-de46b77a]{color:#ced1db}.mc-code-block-dark .mc-code-block-actions .mc-copy-btn[data-v-de46b77a]:hover,.mc-code-block-dark .mc-code-block-actions .mc-toggle-btn[data-v-de46b77a]:hover{background-color:#393a3e}.mc-code-block-dark .mc-code-block-actions .mc-copy-btn img[data-v-de46b77a],.mc-code-block-dark .mc-code-block-actions .mc-toggle-btn img[data-v-de46b77a]{filter:brightness(1.5)}.collapse-transition-enter-from[data-v-de46b77a],.collapse-transition-leave-to[data-v-de46b77a]{opacity:0}.collapse-transition-enter-to[data-v-de46b77a],.collapse-transition-leave-from[data-v-de46b77a]{opacity:1}.collapse-transition-enter-active[data-v-de46b77a],.collapse-transition-leave-active[data-v-de46b77a]{transition:max-height .3s cubic-bezier(.5,.05,.5,.95),opacity .3s cubic-bezier(.5,.05,.5,.95)}.mc-markdown-render[data-v-a398f75b]{overflow-x:auto}.mc-markdown-render.mc-markdown-render-dark[data-v-a398f75b]{color:#ced1db}.mc-markdown-render.mc-markdown-render-light[data-v-a398f75b]{color:#252b3a}
|
package/MarkdownCard/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import "./index.css";
|
|
|
2
2
|
var E = Object.defineProperty;
|
|
3
3
|
var W = (n, t, s) => t in n ? E(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s;
|
|
4
4
|
var T = (n, t, s) => W(n, typeof t != "symbol" ? t + "" : t, s);
|
|
5
|
-
import { defineComponent as
|
|
5
|
+
import { defineComponent as f, ref as j, computed as w, createElementBlock as I, openBlock as M, normalizeClass as p, renderSlot as x, createVNode as z, createElementVNode as h, toDisplayString as _, unref as k, Transition as Y, withCtx as Q, createCommentVNode as O, useSlots as G, h as m, watch as H, Fragment as Z, createBlock as P, resolveDynamicComponent as X } from "vue";
|
|
6
6
|
import R from "markdown-it";
|
|
7
7
|
import y from "highlight.js";
|
|
8
8
|
import { debounce as F } from "lodash-es";
|
|
9
9
|
import { getDefaultWhiteList as V, getDefaultCSSWhiteList as K, filterXSS as J } from "xss";
|
|
10
10
|
const $ = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e全部收起%3c/title%3e%3cg%20id='全部收起'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M4.715694,14.4114091%20C4.910563,14.5464051%205.179987,14.5271201%205.353553,14.3535531%20L5.353553,14.3535531%20L7.99999988,11.7070001%20L10.646447,14.3535531%20L10.715694,14.4114091%20C10.910563,14.5464051%2011.179987,14.5271201%2011.353553,14.3535531%20C11.548816,14.1582911%2011.548816,13.8417091%2011.353553,13.6464471%20L11.353553,13.6464471%20L8.353553,10.6464471%20L8.284306,10.5885911%20C8.089437,10.4535951%207.820013,10.4728801%207.646447,10.6464471%20L7.646447,10.6464471%20L4.646447,13.6464471%20L4.588591,13.7156941%20C4.453595,13.9105631%204.47288,14.1799871%204.646447,14.3535531%20L4.646447,14.3535531%20L4.715694,14.4114091%20Z%20M14.5,7.50000012%20C14.776142,7.50000012%2015,7.72385812%2015,8.00000012%20C15,8.27614212%2014.776142,8.50000012%2014.5,8.50000012%20L1.5,8.50000012%20C1.223858,8.50000012%201,8.27614212%201,8.00000012%20C1,7.72385812%201.223858,7.50000012%201.5,7.50000012%20L14.5,7.50000012%20Z%20M8.284306,5.41140912%20L8.353553,5.35355312%20L11.353553,2.35355312%20C11.548816,2.15829112%2011.548816,1.84170912%2011.353553,1.64644712%20C11.179987,1.47288012%2010.910563,1.45359512%2010.715694,1.58859112%20L10.646447,1.64644712%20L7.99999988,4.29300012%20L5.353553,1.64644712%20C5.179987,1.47288012%204.910563,1.45359512%204.715694,1.58859112%20L4.646447,1.64644712%20C4.47288,1.82001312%204.453595,2.08943712%204.588591,2.28430612%20L4.646447,2.35355312%20L7.646447,5.35355312%20C7.820013,5.52712012%208.089437,5.54640512%208.284306,5.41140912%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", q = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aXRsZT4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFQSS1zdGFydGVyLeWbvuagh+WFpeW6kyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU5Mi4wMDAwMDAsIC0yMDQuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSLmlrnmoLzlpIfku70tMTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDU2MC4wMDAwMDAsIDE4MC4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDx0ZXh0IGlkPSLlm77moIciIGZvbnQtZmFtaWx5PSJQaW5nRmFuZ1NDLVJlZ3VsYXIsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0ibm9ybWFsIiBsaW5lLXNwYWNpbmc9IjE2IiBmaWxsPSIjNzE3NTdGIj4KICAgICAgICAgICAgICAgICAgICA8dHNwYW4geD0iMjcuMTM2IiB5PSI2MSI+5aSN5Yi2PC90c3Bhbj4KICAgICAgICAgICAgICAgIDwvdGV4dD4KICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8cGF0aCBkPSJNNjA0LjUsMjA2IEM2MDUuMjc5Njk2LDIwNiA2MDUuOTIwNDQ5LDIwNi41OTQ4ODggNjA1Ljk5MzEzMywyMDcuMzU1NTQgTDYwNiwyMDcuNSBMNjA2LDIxNC41IEM2MDYsMjE1LjI3OTY5NiA2MDUuNDA1MTEyLDIxNS45MjA0NDkgNjA0LjY0NDQ2LDIxNS45OTMxMzMgTDYwNC41LDIxNiBMNjA0LDIxNiBMNjA0LDIxNi41IEM2MDQsMjE3LjI3OTY5NiA2MDMuNDA1MTEyLDIxNy45MjA0NDkgNjAyLjY0NDQ2LDIxNy45OTMxMzMgTDYwMi41LDIxOCBMNTk1LjUsMjE4IEM1OTQuNjcxNTczLDIxOCA1OTQsMjE3LjMyODQyNyA1OTQsMjE2LjUgTDU5NCwyMTYuNSBMNTk0LDIwOS41IEM1OTQsMjA4LjY3MTU3MyA1OTQuNjcxNTczLDIwOCA1OTUuNSwyMDggTDU5NS41LDIwOCBMNTk2LDIwOCBMNTk2LDIwNy41IEM1OTYsMjA2LjcyMDMwNCA1OTYuNTk0ODg4LDIwNi4wNzk1NTEgNTk3LjM1NTU0LDIwNi4wMDY4NjcgTDU5Ny41LDIwNiBMNjA0LjUsMjA2IFogTTYwMi41LDIwOSBMNTk1LjUsMjA5IEM1OTUuMjIzODU4LDIwOSA1OTUsMjA5LjIyMzg1OCA1OTUsMjA5LjUgTDU5NSwyMDkuNSBMNTk1LDIxNi41IEM1OTUsMjE2Ljc3NjE0MiA1OTUuMjIzODU4LDIxNyA1OTUuNSwyMTcgTDU5NS41LDIxNyBMNjAyLjUsMjE3IEM2MDIuNzc2MTQyLDIxNyA2MDMsMjE2Ljc3NjE0MiA2MDMsMjE2LjUgTDYwMywyMTYuNSBMNjAzLDIwOS41IEM2MDMsMjA5LjIyMzg1OCA2MDIuNzc2MTQyLDIwOSA2MDIuNSwyMDkgTDYwMi41LDIwOSBaIE02MDQuNSwyMDcgTDU5Ny41LDIwNyBDNTk3LjI1NDU0LDIwNyA1OTcuMDUwMzkyLDIwNy4xNzY4NzUgNTk3LjAwODA1NiwyMDcuNDEwMTI0IEw1OTcsMjA3LjUgTDU5NywyMDggTDYwMi41LDIwOCBDNjAzLjI3OTY5NiwyMDggNjAzLjkyMDQ0OSwyMDguNTk0ODg4IDYwMy45OTMxMzMsMjA5LjM1NTU0IEw2MDQsMjA5LjUgTDYwNCwyMTUgTDYwNC41LDIxNSBDNjA0Ljc0NTQ2LDIxNSA2MDQuOTQ5NjA4LDIxNC44MjMxMjUgNjA0Ljk5MTk0NCwyMTQuNTg5ODc2IEw2MDUsMjE0LjUgTDYwNSwyMDcuNSBDNjA1LDIwNy4yNTQ1NCA2MDQuODIzMTI1LDIwNy4wNTAzOTIgNjA0LjU4OTg3NiwyMDcuMDA4MDU2IEw2MDQuNSwyMDcgWiIgaWQ9IuW9oueKtue7k+WQiCIgZmlsbD0iIzcxNzU3RiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=", ee = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3estatus/whiteBG/correct%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpolygon%20id='path-1'%20points='6.53553391%209.77817459%2012.1923882%204.12132034%2013.6066017%205.53553391%206.53553391%2012.6066017%203%209.07106781%204.41421356%207.65685425%206.53553391%209.77817459'%3e%3c/polygon%3e%3c/defs%3e%3cg%20id='status/whiteBG/correct'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cmask%20id='mask-2'%20fill='white'%3e%3cuse%20xlink:href='%23path-1'%3e%3c/use%3e%3c/mask%3e%3cuse%20id='Mask'%20fill='%233DCCA6'%20xlink:href='%23path-1'%3e%3c/use%3e%3c/g%3e%3c/svg%3e";
|
|
11
|
-
class
|
|
11
|
+
class b {
|
|
12
12
|
constructor() {
|
|
13
13
|
T(this, "xssWhiteList", V());
|
|
14
14
|
T(this, "cssWhiteList", K());
|
|
@@ -56,7 +56,7 @@ const te = {
|
|
|
56
56
|
}, ne = {
|
|
57
57
|
key: 1,
|
|
58
58
|
src: ee
|
|
59
|
-
}, ce = { key: 0 }, ae = { key: 0 }, re = ["innerHTML"], le = /* @__PURE__ */
|
|
59
|
+
}, ce = { key: 0 }, ae = { key: 0 }, re = ["innerHTML"], le = /* @__PURE__ */ f({
|
|
60
60
|
__name: "CodeBlock",
|
|
61
61
|
props: {
|
|
62
62
|
code: {
|
|
@@ -77,7 +77,7 @@ const te = {
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
setup(n) {
|
|
80
|
-
const t = n, s = new
|
|
80
|
+
const t = n, s = new b(), a = j(!0), i = j(!1), u = w(() => {
|
|
81
81
|
if (t.language && y.getLanguage(t.language))
|
|
82
82
|
try {
|
|
83
83
|
return y.highlight(t.code, { language: t.language }).value;
|
|
@@ -86,9 +86,15 @@ const te = {
|
|
|
86
86
|
return s.filterHtml(t.code);
|
|
87
87
|
}), C = () => {
|
|
88
88
|
a.value = !a.value;
|
|
89
|
-
},
|
|
89
|
+
}, N = F((e) => {
|
|
90
90
|
const g = e.target;
|
|
91
|
-
navigator.clipboard
|
|
91
|
+
if (navigator.clipboard)
|
|
92
|
+
navigator.clipboard.writeText(t.code);
|
|
93
|
+
else {
|
|
94
|
+
const l = document.createElement("textarea");
|
|
95
|
+
l.style.position = "fixed", l.style.top = "-9999px", l.style.left = "-9999px", l.style.zIndex = "-1", l.value = t.code, document.body.appendChild(l), l.select(), document.execCommand("copy"), document.body.removeChild(l);
|
|
96
|
+
}
|
|
97
|
+
g.classList.remove("icon-copy-new"), i.value = !0, setTimeout(() => {
|
|
92
98
|
i.value = !1;
|
|
93
99
|
}, 1500);
|
|
94
100
|
}, 300), A = (e) => {
|
|
@@ -101,32 +107,32 @@ const te = {
|
|
|
101
107
|
e.style.maxHeight = "", e.style.overflow = e.dataset.oldOverflow;
|
|
102
108
|
}, D = (e) => {
|
|
103
109
|
e.dataset || (e.dataset = {}), e.dataset.oldOverflow = e.style.overflow, e.style.maxHeight = `${e.scrollHeight}px`, e.style.overflow = "hidden";
|
|
104
|
-
},
|
|
110
|
+
}, d = (e) => {
|
|
105
111
|
e.scrollHeight !== 0 && (e.style.maxHeight = 0);
|
|
106
112
|
}, c = (e) => {
|
|
107
113
|
e.style.maxHeight = "", e.style.overflow = e.dataset.oldOverflow;
|
|
108
|
-
},
|
|
109
|
-
return (e, g) => (
|
|
114
|
+
}, L = w(() => t.theme === "dark" ? "mc-code-block-dark" : "mc-code-block-light");
|
|
115
|
+
return (e, g) => (M(), I(
|
|
110
116
|
"div",
|
|
111
117
|
{
|
|
112
|
-
class:
|
|
118
|
+
class: p(["mc-code-block", L.value])
|
|
113
119
|
},
|
|
114
120
|
[
|
|
115
|
-
e.$slots.header ?
|
|
116
|
-
|
|
121
|
+
e.$slots.header ? x(e.$slots, "header", { key: 1 }, void 0, !0) : (M(), I("div", te, [
|
|
122
|
+
h(
|
|
117
123
|
"span",
|
|
118
124
|
se,
|
|
119
125
|
_(n.language),
|
|
120
126
|
1
|
|
121
127
|
/* TEXT */
|
|
122
128
|
),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
x(e.$slots, "actions", {}, () => [
|
|
130
|
+
h("div", ie, [
|
|
131
|
+
h("div", {
|
|
126
132
|
class: "mc-action-btn mc-toggle-btn",
|
|
127
133
|
onClick: C
|
|
128
134
|
}, g[1] || (g[1] = [
|
|
129
|
-
|
|
135
|
+
h(
|
|
130
136
|
"img",
|
|
131
137
|
{ src: $ },
|
|
132
138
|
null,
|
|
@@ -134,12 +140,12 @@ const te = {
|
|
|
134
140
|
/* HOISTED */
|
|
135
141
|
)
|
|
136
142
|
])),
|
|
137
|
-
|
|
143
|
+
h("div", {
|
|
138
144
|
class: "mc-action-btn mc-copy-btn",
|
|
139
145
|
onClick: g[0] || (g[0] = //@ts-ignore
|
|
140
|
-
(...
|
|
146
|
+
(...l) => k(N) && k(N)(...l))
|
|
141
147
|
}, [
|
|
142
|
-
i.value ? (
|
|
148
|
+
i.value ? (M(), I("img", ne)) : (M(), I("img", oe))
|
|
143
149
|
])
|
|
144
150
|
])
|
|
145
151
|
], !0)
|
|
@@ -150,15 +156,15 @@ const te = {
|
|
|
150
156
|
onEnter: r,
|
|
151
157
|
onAfterEnter: o,
|
|
152
158
|
onBeforeLeave: D,
|
|
153
|
-
onLeave:
|
|
159
|
+
onLeave: d,
|
|
154
160
|
onAfterLeave: c
|
|
155
161
|
}, {
|
|
156
162
|
default: Q(() => [
|
|
157
|
-
a.value ? (
|
|
158
|
-
e.$slots.content ?
|
|
159
|
-
|
|
160
|
-
class:
|
|
161
|
-
innerHTML:
|
|
163
|
+
a.value ? (M(), I("div", ce, [
|
|
164
|
+
e.$slots.content ? x(e.$slots, "content", { key: 1 }, void 0, !0) : (M(), I("pre", ae, [
|
|
165
|
+
h("code", {
|
|
166
|
+
class: p(`hljs language-${n.language}`),
|
|
167
|
+
innerHTML: u.value
|
|
162
168
|
}, null, 10, re)
|
|
163
169
|
]))
|
|
164
170
|
])) : O("v-if", !0)
|
|
@@ -171,12 +177,12 @@ const te = {
|
|
|
171
177
|
/* CLASS */
|
|
172
178
|
));
|
|
173
179
|
}
|
|
174
|
-
}),
|
|
180
|
+
}), S = (n, t) => {
|
|
175
181
|
const s = n.__vccOpts || n;
|
|
176
182
|
for (const [a, i] of t)
|
|
177
183
|
s[a] = i;
|
|
178
184
|
return s;
|
|
179
|
-
},
|
|
185
|
+
}, de = /* @__PURE__ */ S(le, [["__scopeId", "data-v-de46b77a"]]), ge = {
|
|
180
186
|
content: {
|
|
181
187
|
type: String,
|
|
182
188
|
default: ""
|
|
@@ -193,11 +199,11 @@ const te = {
|
|
|
193
199
|
type: String,
|
|
194
200
|
default: "light"
|
|
195
201
|
}
|
|
196
|
-
}, Me = /* @__PURE__ */
|
|
202
|
+
}, Me = /* @__PURE__ */ f({
|
|
197
203
|
__name: "mdCard",
|
|
198
|
-
props:
|
|
204
|
+
props: ge,
|
|
199
205
|
setup(n, { expose: t }) {
|
|
200
|
-
const s = new
|
|
206
|
+
const s = new b(), a = n, i = G(), u = R({
|
|
201
207
|
breaks: !0,
|
|
202
208
|
linkify: !0,
|
|
203
209
|
html: !0,
|
|
@@ -211,9 +217,9 @@ const te = {
|
|
|
211
217
|
},
|
|
212
218
|
...a.mdOptions
|
|
213
219
|
});
|
|
214
|
-
|
|
220
|
+
u.renderer.rules.fence = (r, o) => `<!----MC_MARKDOWN_CODE_BLOCK_${o}---->`;
|
|
215
221
|
const C = (r, o, D) => {
|
|
216
|
-
const
|
|
222
|
+
const d = {
|
|
217
223
|
actions: () => {
|
|
218
224
|
var c;
|
|
219
225
|
return (c = i.actions) == null ? void 0 : c.call(i, {
|
|
@@ -224,7 +230,7 @@ const te = {
|
|
|
224
230
|
});
|
|
225
231
|
}
|
|
226
232
|
};
|
|
227
|
-
return i.header && (
|
|
233
|
+
return i.header && (d.header = () => {
|
|
228
234
|
var c;
|
|
229
235
|
return (c = i.header) == null ? void 0 : c.call(i, {
|
|
230
236
|
codeBlockData: {
|
|
@@ -232,7 +238,7 @@ const te = {
|
|
|
232
238
|
language: r
|
|
233
239
|
}
|
|
234
240
|
});
|
|
235
|
-
}), i.content && (
|
|
241
|
+
}), i.content && (d.content = () => {
|
|
236
242
|
var c;
|
|
237
243
|
return (c = i.content) == null ? void 0 : c.call(i, {
|
|
238
244
|
codeBlockData: {
|
|
@@ -240,56 +246,56 @@ const te = {
|
|
|
240
246
|
language: r
|
|
241
247
|
}
|
|
242
248
|
});
|
|
243
|
-
}),
|
|
249
|
+
}), m(de, {
|
|
244
250
|
language: r,
|
|
245
251
|
code: o,
|
|
246
252
|
blockIndex: D,
|
|
247
253
|
theme: a.theme
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
const r =
|
|
254
|
+
}, d);
|
|
255
|
+
}, N = w(() => {
|
|
256
|
+
const r = u.parse(a.content, {}), o = u.render(a.content);
|
|
251
257
|
return {
|
|
252
258
|
name: "MarkdownRenderer",
|
|
253
259
|
render() {
|
|
254
260
|
const D = document.createElement("div");
|
|
255
261
|
D.innerHTML = o;
|
|
256
|
-
const
|
|
257
|
-
let c = 0,
|
|
262
|
+
const d = [];
|
|
263
|
+
let c = 0, L;
|
|
258
264
|
const e = /<!----MC_MARKDOWN_CODE_BLOCK_(\d+)---->/g;
|
|
259
265
|
let g = 0;
|
|
260
|
-
for (; (
|
|
261
|
-
|
|
266
|
+
for (; (L = e.exec(o)) !== null; ) {
|
|
267
|
+
L.index > c && d.push(m(
|
|
262
268
|
"div",
|
|
263
269
|
{
|
|
264
|
-
innerHTML: o.slice(c,
|
|
270
|
+
innerHTML: o.slice(c, L.index)
|
|
265
271
|
}
|
|
266
272
|
));
|
|
267
|
-
const
|
|
268
|
-
|
|
273
|
+
const l = r[parseInt(L[1])], B = l.info || "", U = l.content;
|
|
274
|
+
d.push(C(B, U, g)), g++, c = e.lastIndex;
|
|
269
275
|
}
|
|
270
|
-
return c < o.length &&
|
|
276
|
+
return c < o.length && d.push(m("div", {
|
|
271
277
|
innerHTML: o.slice(c)
|
|
272
|
-
})),
|
|
278
|
+
})), m("div", d);
|
|
273
279
|
}
|
|
274
280
|
};
|
|
275
281
|
});
|
|
276
282
|
H(() => a.customXssRules, (r) => {
|
|
277
283
|
s.setCustomXssRules(r);
|
|
278
284
|
});
|
|
279
|
-
const A =
|
|
285
|
+
const A = w(() => a.theme === "dark" ? "mc-markdown-render-dark" : "mc-markdown-render-light");
|
|
280
286
|
return t({
|
|
281
|
-
mdt:
|
|
282
|
-
}), (r, o) => (
|
|
287
|
+
mdt: u
|
|
288
|
+
}), (r, o) => (M(), I(
|
|
283
289
|
Z,
|
|
284
290
|
null,
|
|
285
291
|
[
|
|
286
|
-
|
|
292
|
+
h(
|
|
287
293
|
"div",
|
|
288
294
|
{
|
|
289
|
-
class:
|
|
295
|
+
class: p(["mc-markdown-render", A.value])
|
|
290
296
|
},
|
|
291
297
|
[
|
|
292
|
-
(
|
|
298
|
+
(M(), P(X(N.value)))
|
|
293
299
|
],
|
|
294
300
|
2
|
|
295
301
|
/* CLASS */
|
|
@@ -300,10 +306,10 @@ const te = {
|
|
|
300
306
|
/* STABLE_FRAGMENT */
|
|
301
307
|
));
|
|
302
308
|
}
|
|
303
|
-
}),
|
|
304
|
-
|
|
305
|
-
n.component("McMarkdownCard",
|
|
309
|
+
}), v = /* @__PURE__ */ S(Me, [["__scopeId", "data-v-a398f75b"]]);
|
|
310
|
+
v.install = (n) => {
|
|
311
|
+
n.component("McMarkdownCard", v);
|
|
306
312
|
};
|
|
307
313
|
export {
|
|
308
|
-
|
|
314
|
+
v as McMarkdownCard
|
|
309
315
|
};
|
package/Mention/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { ref as T, reactive as F, watch as K, nextTick as U, onMounted as G, onBeforeUnmount as J, defineComponent as Q,
|
|
2
|
+
import { ref as T, reactive as F, watch as K, nextTick as U, onMounted as G, onBeforeUnmount as J, defineComponent as Q, createElementBlock as O, openBlock as C, Fragment as X, createVNode as P, createBlock as Y, unref as A, withCtx as $, renderSlot as R, Teleport as Z, Transition as ee, createCommentVNode as te, normalizeStyle as ne, normalizeClass as oe } from "vue";
|
|
3
3
|
import { PopperTrigger as re } from "@matechat/core/PopperTrigger";
|
|
4
4
|
import { computePosition as ie, offset as le } from "@floating-ui/dom";
|
|
5
5
|
import { debounce as se, isObject as ae } from "lodash-es";
|
|
@@ -22,7 +22,7 @@ const ce = {
|
|
|
22
22
|
}, ue = ["update:modelValue", "searchChange", "toggleChange"], M = " ", de = "ArrowLeft", fe = "ArrowRight", me = "Escape";
|
|
23
23
|
function pe(r, l) {
|
|
24
24
|
const s = T(), t = T(), a = T(), c = F({ top: "0px", left: "0px", width: "" });
|
|
25
|
-
let o, i,
|
|
25
|
+
let o, i, g, w, h = "", y, d;
|
|
26
26
|
const E = async () => {
|
|
27
27
|
if (!t.value || !a.value)
|
|
28
28
|
return;
|
|
@@ -48,7 +48,7 @@ function pe(r, l) {
|
|
|
48
48
|
{ immediate: !0 }
|
|
49
49
|
);
|
|
50
50
|
const L = () => {
|
|
51
|
-
i = null,
|
|
51
|
+
i = null, g = -1, w = -1, h = "";
|
|
52
52
|
}, f = (e) => {
|
|
53
53
|
l("update:modelValue", e);
|
|
54
54
|
}, q = () => {
|
|
@@ -68,11 +68,11 @@ function pe(r, l) {
|
|
|
68
68
|
p = m.key, I = !!m.onlyInputStart;
|
|
69
69
|
else
|
|
70
70
|
continue;
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
71
|
+
const v = e.lastIndexOf(p, n), N = e.lastIndexOf(M, n), S = e.substring(v, n), j = S.charAt(S.length - 1);
|
|
72
|
+
if (v < 0 || v > 0 && I || v < N || j === M)
|
|
73
73
|
L();
|
|
74
74
|
else {
|
|
75
|
-
i = p,
|
|
75
|
+
i = p, g = v, w = n, h = S.slice(p.length);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -81,7 +81,7 @@ function pe(r, l) {
|
|
|
81
81
|
f(!1);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
l("searchChange", { value: h, trigger: i, triggerIndex:
|
|
84
|
+
l("searchChange", { value: h, trigger: i, triggerIndex: g, cursorIndex: w }), f(!0);
|
|
85
85
|
}, V = se(k, 300), b = (e) => {
|
|
86
86
|
(e.code === de || e.code === fe) && (y = setTimeout(() => {
|
|
87
87
|
k(), y && (y = void 0, clearTimeout(y));
|
|
@@ -104,13 +104,13 @@ function pe(r, l) {
|
|
|
104
104
|
f(!1), o == null || o.removeEventListener("input", V), o == null || o.removeEventListener("keydown", b), document.removeEventListener("click", B), typeof window < "u" && window.removeEventListener("scroll", x, !0), _();
|
|
105
105
|
}), { popperTriggerEl: s, overlayEl: a, overlayStyle: c };
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const ve = /* @__PURE__ */ Q({
|
|
108
108
|
__name: "Mention",
|
|
109
109
|
props: ce,
|
|
110
110
|
emits: ue,
|
|
111
111
|
setup(r, { emit: l }) {
|
|
112
112
|
const s = r, t = l, { popperTriggerEl: a, overlayEl: c, overlayStyle: o } = pe(s, t);
|
|
113
|
-
return (i,
|
|
113
|
+
return (i, g) => (C(), O(
|
|
114
114
|
X,
|
|
115
115
|
null,
|
|
116
116
|
[
|
|
@@ -139,7 +139,7 @@ const ge = /* @__PURE__ */ Q({
|
|
|
139
139
|
key: 0,
|
|
140
140
|
ref_key: "overlayEl",
|
|
141
141
|
ref: c,
|
|
142
|
-
class:
|
|
142
|
+
class: oe(["mc-mention", i.menuClass]),
|
|
143
143
|
style: ne(A(o))
|
|
144
144
|
},
|
|
145
145
|
[
|
|
@@ -147,7 +147,7 @@ const ge = /* @__PURE__ */ Q({
|
|
|
147
147
|
],
|
|
148
148
|
6
|
|
149
149
|
/* CLASS, STYLE */
|
|
150
|
-
)) :
|
|
150
|
+
)) : te("v-if", !0)
|
|
151
151
|
]),
|
|
152
152
|
_: 3
|
|
153
153
|
/* FORWARDED */
|
|
@@ -158,12 +158,12 @@ const ge = /* @__PURE__ */ Q({
|
|
|
158
158
|
/* STABLE_FRAGMENT */
|
|
159
159
|
));
|
|
160
160
|
}
|
|
161
|
-
}),
|
|
161
|
+
}), ge = (r, l) => {
|
|
162
162
|
const s = r.__vccOpts || r;
|
|
163
163
|
for (const [t, a] of l)
|
|
164
164
|
s[t] = a;
|
|
165
165
|
return s;
|
|
166
|
-
}, z = /* @__PURE__ */ ve
|
|
166
|
+
}, z = /* @__PURE__ */ ge(ve, [["__scopeId", "data-v-4ce5ce76"]]);
|
|
167
167
|
z.install = (r) => {
|
|
168
168
|
r.component("McMention", z);
|
|
169
169
|
};
|
package/Prompt/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { defineComponent as y,
|
|
3
|
-
import {
|
|
2
|
+
import { defineComponent as y, createElementBlock as s, openBlock as r, createElementVNode as P, createCommentVNode as c, normalizeClass as h, createBlock as g, unref as C, normalizeProps as b, mergeProps as I, toDisplayString as v, createVNode as u, withCtx as V } from "vue";
|
|
3
|
+
import { ListVariant as B, ListDirection as L, McList as M } from "@matechat/core/List";
|
|
4
4
|
import { Icon as N } from "vue-devui/icon";
|
|
5
5
|
import "vue-devui/icon/style.css";
|
|
6
6
|
const S = {
|
|
7
7
|
direction: {
|
|
8
8
|
type: String,
|
|
9
|
-
default:
|
|
9
|
+
default: L.Vertical
|
|
10
10
|
},
|
|
11
11
|
list: {
|
|
12
12
|
type: Array,
|
|
@@ -14,7 +14,7 @@ const S = {
|
|
|
14
14
|
},
|
|
15
15
|
variant: {
|
|
16
16
|
type: String,
|
|
17
|
-
default:
|
|
17
|
+
default: B.Filled
|
|
18
18
|
}
|
|
19
19
|
}, $ = {
|
|
20
20
|
prompt: {
|
package/mate-chat.js
CHANGED
|
@@ -4,6 +4,7 @@ import { McInput } from './Input';
|
|
|
4
4
|
import { McIntroduction } from './Introduction';
|
|
5
5
|
import { McLayoutAside, McLayoutContent, McLayoutHeader, McLayout, McLayoutSender } from './Layout';
|
|
6
6
|
import { McList } from './List';
|
|
7
|
+
import { useMcI18n, McLocale } from './Locale';
|
|
7
8
|
import { McMarkdownCard } from './MarkdownCard';
|
|
8
9
|
import { McMention } from './Mention';
|
|
9
10
|
import { McPrompt } from './Prompt';
|
|
@@ -15,6 +16,7 @@ const installs = [
|
|
|
15
16
|
McIntroduction,
|
|
16
17
|
McLayout,
|
|
17
18
|
McList,
|
|
19
|
+
McLocale,
|
|
18
20
|
McMarkdownCard,
|
|
19
21
|
McMention,
|
|
20
22
|
McPrompt
|
|
@@ -31,6 +33,8 @@ export {
|
|
|
31
33
|
McLayout,
|
|
32
34
|
McLayoutSender,
|
|
33
35
|
McList,
|
|
36
|
+
useMcI18n,
|
|
37
|
+
McLocale,
|
|
34
38
|
McMarkdownCard,
|
|
35
39
|
McMention,
|
|
36
40
|
McPrompt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matechat/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "前端智能化场景解决方案UI库,轻松构建你的AI应用。",
|
|
6
6
|
"keywords": [
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"module": "mate-chat.js",
|
|
20
20
|
"types": "index.d.ts",
|
|
21
|
+
"sideEffects": false,
|
|
21
22
|
"dependencies": {
|
|
22
23
|
"@floating-ui/dom": "^1.6.12",
|
|
23
24
|
"@vue/shared": "^3.5.13",
|