@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/Introduction/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-introduction[data-v-
|
|
1
|
+
.mc-introduction[data-v-fd242abc]{display:flex;gap:12px;flex-direction:column;color:var(--devui-text, #252b3a)}.mc-introduction .mc-introduction-logo-container[data-v-fd242abc]{display:flex;align-items:center;gap:8px}.mc-introduction .mc-introduction-logo-container .mc-introduction-title[data-v-fd242abc]{font-weight:700;font-size:32px;letter-spacing:1px}.mc-introduction .mc-introduction-sub-title[data-v-fd242abc]{font-weight:500;font-size:18px}.mc-introduction .mc-introduction-description[data-v-fd242abc]{font-size:var(--devui-font-size, 12px)}.mc-introduction .mc-introduction-description>div[data-v-fd242abc]{line-height:1.5}.mc-introduction.filled[data-v-fd242abc]{background-color:var(--devui-global-bg, #f6f6f8);border-radius:8px;padding:8px 12px}.mc-introduction.center[data-v-fd242abc]{align-items:center}.mc-introduction.center .mc-introduction-description[data-v-fd242abc]{text-align:center}.mc-introduction.left[data-v-fd242abc]{align-items:flex-start}.mc-introduction.left .mc-introduction-description[data-v-fd242abc]{text-align:left}.mc-introduction.right[data-v-fd242abc]{align-items:flex-end}.mc-introduction.right .mc-introduction-description[data-v-fd242abc]{text-align:right}
|
package/Introduction/index.js
CHANGED
|
@@ -1,9 +1,104 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "./index.css";
|
|
2
|
+
var m = Object.defineProperty;
|
|
3
|
+
var y = (r, t, e) => t in r ? m(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
4
|
+
var l = (r, t, e) => y(r, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as S, openBlock as a, createElementBlock as i, normalizeClass as C, unref as u, createElementVNode as p, normalizeStyle as P, createCommentVNode as c, toDisplayString as d, Fragment as b, renderList as v, renderSlot as k } from "vue";
|
|
6
|
+
const n = () => {
|
|
7
|
+
};
|
|
8
|
+
class g {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
l(this, "_adapter");
|
|
11
|
+
this._adapter = { ...g.defaultAdapter, ...t };
|
|
12
|
+
}
|
|
13
|
+
static get cssClasses() {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
static get strings() {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
static get numbers() {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
static get defaultAdapter() {
|
|
23
|
+
return {
|
|
24
|
+
getProp: n,
|
|
25
|
+
getProps: n,
|
|
26
|
+
getState: n,
|
|
27
|
+
getStates: n,
|
|
28
|
+
setState: n,
|
|
29
|
+
getContext: n,
|
|
30
|
+
getContexts: n,
|
|
31
|
+
getCache: n,
|
|
32
|
+
setCache: n,
|
|
33
|
+
getCaches: n,
|
|
34
|
+
stopPropagation: n
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
getProp(t) {
|
|
38
|
+
return this._adapter.getProp(t);
|
|
39
|
+
}
|
|
40
|
+
getProps() {
|
|
41
|
+
return this._adapter.getProps();
|
|
42
|
+
}
|
|
43
|
+
getState(t) {
|
|
44
|
+
return this._adapter.getState(t);
|
|
45
|
+
}
|
|
46
|
+
getStates() {
|
|
47
|
+
return this._adapter.getStates();
|
|
48
|
+
}
|
|
49
|
+
setState(t, e) {
|
|
50
|
+
return this._adapter.setState({ ...t }, e);
|
|
51
|
+
}
|
|
52
|
+
/* istanbul ignore next */
|
|
53
|
+
getCaches() {
|
|
54
|
+
return this._adapter.getCaches();
|
|
55
|
+
}
|
|
56
|
+
getCache(t) {
|
|
57
|
+
return this._adapter.getCache(t);
|
|
58
|
+
}
|
|
59
|
+
setCache(t, e) {
|
|
60
|
+
return t && this._adapter.setCache(t, e);
|
|
61
|
+
}
|
|
62
|
+
nextTick(t) {
|
|
63
|
+
return this._adapter.nextTick(t);
|
|
64
|
+
}
|
|
65
|
+
_isInProps(t) {
|
|
66
|
+
const e = this.getProps();
|
|
67
|
+
return t in e;
|
|
68
|
+
}
|
|
69
|
+
init(t) {
|
|
70
|
+
}
|
|
71
|
+
destroy() {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
class I extends g {
|
|
75
|
+
constructor(t) {
|
|
76
|
+
super({ ...t });
|
|
77
|
+
}
|
|
78
|
+
getIntroductionClasses() {
|
|
79
|
+
const t = this._adapter.getProp("align"), e = this._adapter.getProp(
|
|
80
|
+
"background"
|
|
81
|
+
);
|
|
82
|
+
return [t, e].filter(Boolean).join(" ");
|
|
83
|
+
}
|
|
84
|
+
getLogoStyle() {
|
|
85
|
+
const t = this._adapter.getProp("logoWidth"), e = this._adapter.getProp("logoHeight"), s = {};
|
|
86
|
+
return t && (s.width = typeof t == "number" ? `${t}px` : t), e && (s.height = typeof e == "number" ? `${e}px` : e), s;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const T = {
|
|
3
90
|
logoImg: {
|
|
4
91
|
type: String,
|
|
5
92
|
default: ""
|
|
6
93
|
},
|
|
94
|
+
logoWidth: {
|
|
95
|
+
type: [String, Number],
|
|
96
|
+
default: ""
|
|
97
|
+
},
|
|
98
|
+
logoHeight: {
|
|
99
|
+
type: [String, Number],
|
|
100
|
+
default: ""
|
|
101
|
+
},
|
|
7
102
|
title: {
|
|
8
103
|
type: String,
|
|
9
104
|
default: ""
|
|
@@ -24,73 +119,78 @@ const v = {
|
|
|
24
119
|
type: String,
|
|
25
120
|
default: "center"
|
|
26
121
|
}
|
|
27
|
-
},
|
|
122
|
+
}, N = { class: "mc-introduction-logo-container" }, A = ["src", "alt"], B = { class: "mc-introduction-title" }, H = {
|
|
28
123
|
key: 0,
|
|
29
124
|
class: "mc-introduction-sub-title"
|
|
30
|
-
},
|
|
125
|
+
}, L = {
|
|
31
126
|
key: 1,
|
|
32
127
|
class: "mc-introduction-description"
|
|
33
|
-
},
|
|
128
|
+
}, V = /* @__PURE__ */ S({
|
|
34
129
|
__name: "Introduction",
|
|
35
|
-
props:
|
|
36
|
-
setup(
|
|
37
|
-
|
|
130
|
+
props: T,
|
|
131
|
+
setup(r) {
|
|
132
|
+
const t = r, e = {
|
|
133
|
+
getProp: (o) => t[o],
|
|
134
|
+
getProps: () => t
|
|
135
|
+
}, s = new I(e);
|
|
136
|
+
return (o, $) => (a(), i(
|
|
38
137
|
"div",
|
|
39
138
|
{
|
|
40
|
-
class:
|
|
139
|
+
class: C(["mc-introduction", u(s).getIntroductionClasses()])
|
|
41
140
|
},
|
|
42
141
|
[
|
|
43
|
-
|
|
44
|
-
|
|
142
|
+
p("div", N, [
|
|
143
|
+
o.logoImg ? (a(), i("img", {
|
|
45
144
|
key: 0,
|
|
46
|
-
src:
|
|
47
|
-
alt:
|
|
48
|
-
|
|
49
|
-
|
|
145
|
+
src: o.logoImg,
|
|
146
|
+
alt: o.title,
|
|
147
|
+
style: P(u(s).getLogoStyle())
|
|
148
|
+
}, null, 12, A)) : c("v-if", !0),
|
|
149
|
+
p(
|
|
50
150
|
"div",
|
|
51
|
-
|
|
52
|
-
|
|
151
|
+
B,
|
|
152
|
+
d(o.title),
|
|
53
153
|
1
|
|
54
154
|
/* TEXT */
|
|
55
155
|
)
|
|
56
156
|
]),
|
|
57
|
-
|
|
157
|
+
o.subTitle ? (a(), i(
|
|
58
158
|
"div",
|
|
59
|
-
|
|
60
|
-
|
|
159
|
+
H,
|
|
160
|
+
d(o.subTitle),
|
|
61
161
|
1
|
|
62
162
|
/* TEXT */
|
|
63
|
-
)) :
|
|
64
|
-
|
|
65
|
-
(
|
|
66
|
-
|
|
163
|
+
)) : c("v-if", !0),
|
|
164
|
+
o.description.length ? (a(), i("div", L, [
|
|
165
|
+
(a(!0), i(
|
|
166
|
+
b,
|
|
67
167
|
null,
|
|
68
|
-
|
|
168
|
+
v(o.description, (f, _) => (a(), i(
|
|
69
169
|
"div",
|
|
70
|
-
{ key:
|
|
71
|
-
|
|
170
|
+
{ key: _ },
|
|
171
|
+
d(f),
|
|
72
172
|
1
|
|
73
173
|
/* TEXT */
|
|
74
174
|
))),
|
|
75
175
|
128
|
|
76
176
|
/* KEYED_FRAGMENT */
|
|
77
177
|
))
|
|
78
|
-
])) :
|
|
79
|
-
|
|
178
|
+
])) : c("v-if", !0),
|
|
179
|
+
k(o.$slots, "default", {}, void 0, !0)
|
|
80
180
|
],
|
|
81
181
|
2
|
|
82
182
|
/* CLASS */
|
|
83
183
|
));
|
|
84
184
|
}
|
|
85
|
-
}),
|
|
86
|
-
const
|
|
87
|
-
for (const [
|
|
88
|
-
|
|
89
|
-
return
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
185
|
+
}), W = (r, t) => {
|
|
186
|
+
const e = r.__vccOpts || r;
|
|
187
|
+
for (const [s, o] of t)
|
|
188
|
+
e[s] = o;
|
|
189
|
+
return e;
|
|
190
|
+
}, h = /* @__PURE__ */ W(V, [["__scopeId", "data-v-fd242abc"]]);
|
|
191
|
+
h.install = (r) => {
|
|
192
|
+
r.component("McIntroduction", h);
|
|
93
193
|
};
|
|
94
194
|
export {
|
|
95
|
-
|
|
195
|
+
h as McIntroduction
|
|
96
196
|
};
|
package/Layout/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import { openBlock as n, createElementBlock as c, renderSlot as o } from "vue";
|
|
2
3
|
const s = (e, t) => {
|
|
3
4
|
const r = e.__vccOpts || e;
|
|
4
5
|
for (const [a, _] of t)
|
|
@@ -6,31 +7,31 @@ const s = (e, t) => {
|
|
|
6
7
|
return r;
|
|
7
8
|
}, u = {}, f = { class: "mc-layout-aside" };
|
|
8
9
|
function i(e, t) {
|
|
9
|
-
return
|
|
10
|
+
return n(), c("div", f, [
|
|
10
11
|
o(e.$slots, "default")
|
|
11
12
|
]);
|
|
12
13
|
}
|
|
13
14
|
const l = /* @__PURE__ */ s(u, [["render", i]]), m = {}, $ = { class: "mc-layout-content" };
|
|
14
15
|
function y(e, t) {
|
|
15
|
-
return
|
|
16
|
+
return n(), c("div", $, [
|
|
16
17
|
o(e.$slots, "default", {}, void 0, !0)
|
|
17
18
|
]);
|
|
18
19
|
}
|
|
19
20
|
const h = /* @__PURE__ */ s(m, [["render", y], ["__scopeId", "data-v-629ef113"]]), v = {}, L = { class: "mc-layout-header" };
|
|
20
21
|
function M(e, t) {
|
|
21
|
-
return
|
|
22
|
+
return n(), c("div", L, [
|
|
22
23
|
o(e.$slots, "default", {}, void 0, !0)
|
|
23
24
|
]);
|
|
24
25
|
}
|
|
25
26
|
const p = /* @__PURE__ */ s(v, [["render", M], ["__scopeId", "data-v-8201933b"]]), k = {}, I = { class: "mc-layout" };
|
|
26
27
|
function S(e, t) {
|
|
27
|
-
return
|
|
28
|
+
return n(), c("div", I, [
|
|
28
29
|
o(e.$slots, "default", {}, void 0, !0)
|
|
29
30
|
]);
|
|
30
31
|
}
|
|
31
32
|
const d = /* @__PURE__ */ s(k, [["render", S], ["__scopeId", "data-v-8f271543"]]), x = {}, A = { class: "mc-layout-sender" };
|
|
32
33
|
function B(e, t) {
|
|
33
|
-
return
|
|
34
|
+
return n(), c("div", A, [
|
|
34
35
|
o(e.$slots, "default")
|
|
35
36
|
]);
|
|
36
37
|
}
|
package/List/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-list[data-v-1a543233]{width:100%;max-height:300px;box-sizing:border-box;overflow:auto}.mc-list.mc-list-horizontal .mc-list-item[data-v-1a543233]{width:unset}.mc-list:not(.mc-list-horizontal) .mc-list-item[data-v-1a543233]:not(:first-child){margin-top:4px}.mc-list .mc-list-item[data-v-1a543233]{width:100%;line-height:20px;padding:8px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size,
|
|
1
|
+
.mc-list[data-v-1a543233]{width:100%;max-height:300px;box-sizing:border-box;overflow:auto}.mc-list.mc-list-horizontal .mc-list-item[data-v-1a543233]{width:unset}.mc-list:not(.mc-list-horizontal) .mc-list-item[data-v-1a543233]:not(:first-child){margin-top:4px}.mc-list .mc-list-item[data-v-1a543233]{width:100%;line-height:20px;padding:8px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);border-radius:var(--devui-border-radius, 2px);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.mc-list .mc-list-item.filled[data-v-1a543233]{background-color:var(--devui-gray-form-control-bg, #f5f5f5)}.mc-list .mc-list-item.bordered[data-v-1a543233]{border:1px solid var(--devui-dividing-line, #f2f2f3)}.mc-list .mc-list-item[data-v-1a543233]:hover,.mc-list .mc-list-item.mc-list-item-pre-selection[data-v-1a543233]{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-list .mc-list-item.mc-list-item-active[data-v-1a543233]{color:var(--devui-list-item-active-text, #252b3a);background-color:var(--devui-list-item-active-bg, #f2f5fc)}.mc-list .mc-list-item.mc-list-item-disabled[data-v-1a543233]{color:var(--devui-disabled-text, #cfd0d3);background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-list-horizontal[data-v-1a543233]{display:flex;flex-wrap:wrap;gap:12px}.mc-list-horizontal.mc-list-nowrap[data-v-1a543233]{flex-wrap:nowrap}.mc-list-horizontal.mc-list-nowrap .mc-list-item[data-v-1a543233]{flex:none}
|
package/List/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import { computed as E, ref as L, onMounted as p, onUnmounted as w, defineComponent as z, openBlock as f, createElementBlock as v, unref as c, normalizeClass as g, Fragment as b, renderList as C, renderSlot as h, createTextVNode as T, toDisplayString as A } from "vue";
|
|
3
|
+
var m = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(m || {}), k = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(k || {});
|
|
4
|
+
const B = {
|
|
4
5
|
direction: {
|
|
5
6
|
type: String,
|
|
6
7
|
default: "vertical"
|
|
@@ -34,85 +35,87 @@ const A = {
|
|
|
34
35
|
type: Boolean,
|
|
35
36
|
default: !0
|
|
36
37
|
}
|
|
37
|
-
},
|
|
38
|
-
function
|
|
39
|
-
|
|
38
|
+
}, H = 50, I = ["TEXTAREA", "INPUT"], _ = "ArrowUp", N = "ArrowDown", M = "Enter";
|
|
39
|
+
function D(e, r) {
|
|
40
|
+
let o;
|
|
41
|
+
const l = L(e.enableShortKey ? 0 : -1), i = (t) => {
|
|
40
42
|
if (!t.disabled) {
|
|
41
43
|
if (e.selectable)
|
|
42
|
-
for (let
|
|
43
|
-
e.data[
|
|
44
|
-
|
|
44
|
+
for (let n = 0; n < e.data.length; n++)
|
|
45
|
+
e.data[n].active = e.data[n].value === t.value;
|
|
46
|
+
r("select", { ...t });
|
|
45
47
|
}
|
|
46
|
-
},
|
|
47
|
-
if (!e.enableLazyLoad || e.direction !==
|
|
48
|
+
}, y = (t) => {
|
|
49
|
+
if (!e.enableLazyLoad || e.direction !== m.Vertical)
|
|
48
50
|
return;
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
t.code ===
|
|
51
|
+
const n = t.target, d = n.scrollHeight, a = n.clientHeight, u = n.scrollTop;
|
|
52
|
+
d - a - u < H && r("loadMore", t);
|
|
53
|
+
}, s = (t) => {
|
|
54
|
+
t.code === _ && (l.value = l.value === 0 ? e.data.length - 1 : l.value - 1), t.code === N && (l.value = l.value === e.data.length - 1 ? 0 : l.value + 1), t.code === M && e.selectable && i(e.data[l.value]);
|
|
53
55
|
};
|
|
54
56
|
return p(() => {
|
|
55
|
-
let t;
|
|
56
57
|
if (e.inputEl) {
|
|
57
|
-
const
|
|
58
|
-
|
|
58
|
+
const t = e.inputEl.$el ?? e.inputEl;
|
|
59
|
+
I.includes(t.tagName) ? o = t : o = t.querySelector("textarea") || t.querySelector("input") || document;
|
|
59
60
|
} else
|
|
60
|
-
|
|
61
|
-
e.enableShortKey &&
|
|
62
|
-
}),
|
|
61
|
+
o = document;
|
|
62
|
+
e.enableShortKey && o.addEventListener("keydown", s);
|
|
63
|
+
}), w(() => {
|
|
64
|
+
o.removeEventListener("keydown", s);
|
|
65
|
+
}), { preSelectIndex: l, onItemClick: i, onListScroll: y };
|
|
63
66
|
}
|
|
64
|
-
function
|
|
67
|
+
function K(e) {
|
|
65
68
|
return { listClasses: E(() => ({
|
|
66
69
|
"mc-list": !0,
|
|
67
|
-
"mc-list-horizontal": e.direction ===
|
|
68
|
-
"mc-list-nowrap": e.direction ===
|
|
70
|
+
"mc-list-horizontal": e.direction === m.Horizontal,
|
|
71
|
+
"mc-list-nowrap": e.direction === m.Horizontal && !e.autoWrap
|
|
69
72
|
})) };
|
|
70
73
|
}
|
|
71
|
-
const
|
|
74
|
+
const U = ["onClick"], $ = /* @__PURE__ */ z({
|
|
72
75
|
__name: "List",
|
|
73
|
-
props:
|
|
76
|
+
props: B,
|
|
74
77
|
emits: ["select", "loadMore"],
|
|
75
|
-
setup(e, { emit:
|
|
76
|
-
const
|
|
77
|
-
return (
|
|
78
|
+
setup(e, { emit: r }) {
|
|
79
|
+
const o = e, l = r, { listClasses: i } = K(o), { preSelectIndex: y, onItemClick: s, onListScroll: t } = D(o, l);
|
|
80
|
+
return (n, d) => (f(), v(
|
|
78
81
|
"div",
|
|
79
82
|
{
|
|
80
|
-
class: g(c(
|
|
83
|
+
class: g(c(i)),
|
|
81
84
|
onScroll: d[0] || (d[0] = //@ts-ignore
|
|
82
|
-
(...a) => c(
|
|
85
|
+
(...a) => c(t) && c(t)(...a))
|
|
83
86
|
},
|
|
84
87
|
[
|
|
85
|
-
(f(!0),
|
|
88
|
+
(f(!0), v(
|
|
86
89
|
b,
|
|
87
90
|
null,
|
|
88
|
-
|
|
91
|
+
C(n.data, (a, u) => (f(), v(
|
|
89
92
|
b,
|
|
90
|
-
{ key:
|
|
93
|
+
{ key: u },
|
|
91
94
|
[
|
|
92
|
-
|
|
95
|
+
n.variant === c(k).None ? h(n.$slots, "item", {
|
|
93
96
|
key: 0,
|
|
94
97
|
item: a
|
|
95
|
-
}, void 0, !0) : (f(),
|
|
98
|
+
}, void 0, !0) : (f(), v("div", {
|
|
96
99
|
key: 1,
|
|
97
100
|
class: g([
|
|
98
101
|
"mc-list-item",
|
|
99
102
|
{
|
|
100
103
|
"mc-list-item-disabled": a.disabled,
|
|
101
104
|
"mc-list-item-active": a.active,
|
|
102
|
-
"mc-list-item-pre-selection":
|
|
105
|
+
"mc-list-item-pre-selection": u === c(y)
|
|
103
106
|
},
|
|
104
|
-
|
|
107
|
+
n.variant
|
|
105
108
|
]),
|
|
106
|
-
onClick: () => c(
|
|
109
|
+
onClick: () => c(s)(a)
|
|
107
110
|
}, [
|
|
108
|
-
h(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
h(n.$slots, "item", { item: a }, () => [
|
|
112
|
+
T(
|
|
113
|
+
A(a.label),
|
|
111
114
|
1
|
|
112
115
|
/* TEXT */
|
|
113
116
|
)
|
|
114
117
|
], !0)
|
|
115
|
-
], 10,
|
|
118
|
+
], 10, U))
|
|
116
119
|
],
|
|
117
120
|
64
|
|
118
121
|
/* STABLE_FRAGMENT */
|
|
@@ -125,18 +128,18 @@ const K = ["onClick"], U = /* @__PURE__ */ w({
|
|
|
125
128
|
/* CLASS, NEED_HYDRATION */
|
|
126
129
|
));
|
|
127
130
|
}
|
|
128
|
-
}),
|
|
129
|
-
const
|
|
130
|
-
for (const [
|
|
131
|
-
|
|
132
|
-
return
|
|
133
|
-
}, S = /* @__PURE__ */
|
|
131
|
+
}), q = (e, r) => {
|
|
132
|
+
const o = e.__vccOpts || e;
|
|
133
|
+
for (const [l, i] of r)
|
|
134
|
+
o[l] = i;
|
|
135
|
+
return o;
|
|
136
|
+
}, S = /* @__PURE__ */ q($, [["__scopeId", "data-v-1a543233"]]);
|
|
134
137
|
S.install = (e) => {
|
|
135
138
|
e.component("McList", S);
|
|
136
139
|
};
|
|
137
140
|
export {
|
|
138
|
-
|
|
141
|
+
m as ListDirection,
|
|
139
142
|
k as ListVariant,
|
|
140
143
|
S as McList,
|
|
141
|
-
|
|
144
|
+
B as listProps
|
|
142
145
|
};
|
package/Locale/index.js
CHANGED
|
@@ -1,64 +1,114 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
return new
|
|
1
|
+
import { ref as c, reactive as i } from "vue";
|
|
2
|
+
function u(s) {
|
|
3
|
+
return new p(s);
|
|
4
4
|
}
|
|
5
|
-
let
|
|
6
|
-
constructor(
|
|
7
|
-
this.locale =
|
|
5
|
+
let p = class {
|
|
6
|
+
constructor(n) {
|
|
7
|
+
this.locale = c("zh-cn"), this.messages = i({}), this.use = (e) => {
|
|
8
8
|
this.locale.value = e;
|
|
9
|
-
}, this.t = (e,
|
|
9
|
+
}, this.t = (e, o = {}) => {
|
|
10
10
|
const t = this.messages[this.locale.value];
|
|
11
|
-
return
|
|
12
|
-
}, this.mergeLocaleMessages = (e,
|
|
11
|
+
return g(e, o, t);
|
|
12
|
+
}, this.mergeLocaleMessages = (e, o) => this.messages[e] ? (this.messages[e] = l(this.messages[e], o), l(this.messages[e], o)) : (this.messages[e] = o, this.messages), this.locale.value = n.locale, this.messages = i(n.messages);
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
const
|
|
15
|
+
function g(s, n, e) {
|
|
16
|
+
const o = s.split(".");
|
|
17
17
|
let t = e || {};
|
|
18
|
-
return
|
|
19
|
-
t = t[
|
|
20
|
-
}), typeof t == "function" ? t(
|
|
18
|
+
return o.forEach((a) => {
|
|
19
|
+
t = t[a] ?? s;
|
|
20
|
+
}), typeof t == "function" ? t(n) : t.replace(/{(\w+)}/g, (a, r) => n[r] ?? `{${r}}`);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const e = { ...
|
|
24
|
-
for (const
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
26
|
-
const t =
|
|
27
|
-
typeof t == "object" && t !== null ? typeof
|
|
22
|
+
function l(s, n) {
|
|
23
|
+
const e = { ...s };
|
|
24
|
+
for (const o in n)
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(n, o)) {
|
|
26
|
+
const t = n[o], a = s[o];
|
|
27
|
+
typeof t == "object" && t !== null ? typeof a == "object" && a !== null ? e[o] = l(a, t) : e[o] = { ...t } : e[o] = t;
|
|
28
28
|
}
|
|
29
29
|
return e;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const w = {
|
|
32
32
|
Input: {
|
|
33
33
|
send: "Send",
|
|
34
34
|
pauseAnswer: "Stop",
|
|
35
35
|
pleaseEnter: "Please enter your question...",
|
|
36
36
|
pleaseEnterPlaceholder: "Please enter your question and press {enterKey} to send, {shiftEnterKey} to wrap."
|
|
37
|
+
},
|
|
38
|
+
Md: {
|
|
39
|
+
toggle: "Collapse/Expand",
|
|
40
|
+
copy: "Copy",
|
|
41
|
+
diagram: "Diagram",
|
|
42
|
+
code: "Code",
|
|
43
|
+
zoomIn: "Zoom In",
|
|
44
|
+
zoomOut: "Zoom Out",
|
|
45
|
+
downLoad: "Download"
|
|
46
|
+
},
|
|
47
|
+
Attachment: {
|
|
48
|
+
dragToUpload: "Drag to upload"
|
|
49
|
+
},
|
|
50
|
+
FileList: {
|
|
51
|
+
uploadFailed: "Upload failed",
|
|
52
|
+
downloadFailed: "Download failed",
|
|
53
|
+
retry: "Retry",
|
|
54
|
+
download: "Download",
|
|
55
|
+
preview: "Preview",
|
|
56
|
+
uploading: "Uploading...",
|
|
57
|
+
downloading: "Downloading...",
|
|
58
|
+
remove: "Remove",
|
|
59
|
+
unsupportedPreview: "Browser does not support previewing this file type: {fileName}",
|
|
60
|
+
tryDownload: "Please try downloading to view",
|
|
61
|
+
close: "Close"
|
|
37
62
|
}
|
|
38
|
-
},
|
|
63
|
+
}, f = {
|
|
39
64
|
Input: {
|
|
40
65
|
send: "发送",
|
|
41
66
|
pauseAnswer: "停止回答",
|
|
42
67
|
pleaseEnter: "请输入您的问题...",
|
|
43
68
|
pleaseEnterPlaceholder: "请输入您的问题,并按{enterKey}发送,按{shiftEnterKey}换行"
|
|
69
|
+
},
|
|
70
|
+
Md: {
|
|
71
|
+
toggle: "收起/展开",
|
|
72
|
+
copy: "复制",
|
|
73
|
+
diagram: "图形",
|
|
74
|
+
code: "代码",
|
|
75
|
+
zoomIn: "放大",
|
|
76
|
+
zoomOut: "缩小",
|
|
77
|
+
downLoad: "下载"
|
|
78
|
+
},
|
|
79
|
+
Attachment: {
|
|
80
|
+
dragToUpload: "拖拽到此处上传"
|
|
81
|
+
},
|
|
82
|
+
FileList: {
|
|
83
|
+
uploadFailed: "上传失败",
|
|
84
|
+
downloadFailed: "下载失败",
|
|
85
|
+
retry: "重试",
|
|
86
|
+
download: "下载",
|
|
87
|
+
preview: "预览",
|
|
88
|
+
uploading: "上传中...",
|
|
89
|
+
downloading: "下载中...",
|
|
90
|
+
remove: "删除",
|
|
91
|
+
unsupportedPreview: "浏览器不支持预览此文件类型:{fileName}",
|
|
92
|
+
tryDownload: "请尝试下载后查看",
|
|
93
|
+
close: "关闭"
|
|
44
94
|
}
|
|
45
|
-
},
|
|
46
|
-
"en-us":
|
|
47
|
-
"zh-cn":
|
|
48
|
-
},
|
|
95
|
+
}, h = {
|
|
96
|
+
"en-us": w,
|
|
97
|
+
"zh-cn": f
|
|
98
|
+
}, d = u({
|
|
49
99
|
locale: "zh-cn",
|
|
50
|
-
messages:
|
|
100
|
+
messages: h
|
|
51
101
|
});
|
|
52
|
-
function
|
|
53
|
-
return
|
|
102
|
+
function v() {
|
|
103
|
+
return d;
|
|
54
104
|
}
|
|
55
|
-
const
|
|
56
|
-
install: (
|
|
57
|
-
|
|
105
|
+
const M = {
|
|
106
|
+
install: (s) => {
|
|
107
|
+
s.config.globalProperties.McI18n = d;
|
|
58
108
|
}
|
|
59
109
|
};
|
|
60
110
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
111
|
+
M as McLocale,
|
|
112
|
+
d as default,
|
|
113
|
+
v as useMcI18n
|
|
64
114
|
};
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import type { Token } from 'markdown-it';
|
|
2
1
|
import { VNode } from 'vue';
|
|
3
|
-
export interface ASTNode {
|
|
4
|
-
nodeType: string;
|
|
5
|
-
openNode: Token | null;
|
|
6
|
-
closeNode: Token | null;
|
|
7
|
-
children: (ASTNode | Token)[];
|
|
8
|
-
vNodeKey: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const tokensToAst: (tokens: Token[]) => ASTNode[];
|
|
11
2
|
export declare const htmlToVNode: (htmlString: string) => (VNode | string)[];
|
|
12
|
-
export declare const isValidTagName: (tagName: string | undefined) => boolean;
|