@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.
Files changed (45) hide show
  1. package/Attachment/Attachment.vue.d.ts +8 -8
  2. package/Attachment/attachment-types.d.ts +3 -35
  3. package/Attachment/index.css +1 -1
  4. package/Attachment/index.js +43 -45
  5. package/Bubble/index.css +1 -1
  6. package/Bubble/index.js +322 -186
  7. package/Bubble/useBubbleFoundation.d.ts +9 -0
  8. package/FileList/index.js +1 -1
  9. package/Header/index.css +1 -1
  10. package/Header/index.js +12 -11
  11. package/Input/components/EditableBlock.vue.d.ts +2 -2
  12. package/Input/index.css +1 -1
  13. package/Input/index.js +699 -108
  14. package/Introduction/index.css +1 -1
  15. package/Introduction/index.js +138 -38
  16. package/Layout/index.js +7 -6
  17. package/List/index.css +1 -1
  18. package/List/index.js +54 -51
  19. package/Locale/index.js +85 -35
  20. package/MarkdownCard/MDCardParser.d.ts +0 -10
  21. package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
  22. package/MarkdownCard/index.css +1 -1
  23. package/MarkdownCard/index.js +735 -200
  24. package/MarkdownCard/mdCard.types.d.ts +2 -29
  25. package/MarkdownCard/mdCard.vue.d.ts +2 -2
  26. package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
  27. package/Mention/Mention.vue.d.ts +12 -3
  28. package/Mention/index.css +1 -1
  29. package/Mention/index.js +365 -110
  30. package/Mention/mention-types.d.ts +6 -4
  31. package/Mention/use-mention.d.ts +7 -0
  32. package/Prompt/index.js +1 -1
  33. package/README.md +8 -12
  34. package/Toolbar/index.css +1 -1
  35. package/Toolbar/index.d.ts +2 -1
  36. package/Toolbar/index.js +189 -198
  37. package/Toolbar/toolbar.types.d.ts +2 -26
  38. package/index.d.ts +18 -6
  39. package/mate-chat.js +17 -2
  40. package/package.json +1 -4
  41. package/Attachment/uploader.d.ts +0 -11
  42. package/MarkdownCard/MDCardService.d.ts +0 -14
  43. package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
  44. package/MarkdownCard/MermaidService.d.ts +0 -22
  45. package/Mention/const.d.ts +0 -4
@@ -1 +1 @@
1
- .mc-introduction[data-v-fff875ce]{display:flex;gap:12px;flex-direction:column;color:var(--devui-text, #252b3a)}.mc-introduction .mc-introduction-logo-container[data-v-fff875ce]{display:flex;align-items:center;gap:8px}.mc-introduction .mc-introduction-logo-container .mc-introduction-title[data-v-fff875ce]{font-weight:700;font-size:32px;letter-spacing:1px}.mc-introduction .mc-introduction-sub-title[data-v-fff875ce]{font-weight:500;font-size:18px}.mc-introduction .mc-introduction-description[data-v-fff875ce]{font-size:var(--devui-font-size-sm, 12px)}.mc-introduction .mc-introduction-description>div[data-v-fff875ce]{line-height:1.5}.mc-introduction.filled[data-v-fff875ce]{background-color:var(--devui-global-bg, #f6f6f8);border-radius:8px;padding:8px 12px}.mc-introduction.center[data-v-fff875ce]{align-items:center}.mc-introduction.center .mc-introduction-description[data-v-fff875ce]{text-align:center}.mc-introduction.left[data-v-fff875ce]{align-items:flex-start}.mc-introduction.left .mc-introduction-description[data-v-fff875ce]{text-align:left}.mc-introduction.right[data-v-fff875ce]{align-items:flex-end}.mc-introduction.right .mc-introduction-description[data-v-fff875ce]{text-align:right}
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}
@@ -1,9 +1,104 @@
1
- import { defineComponent as u, createElementBlock as e, openBlock as o, normalizeClass as p, createElementVNode as d, createCommentVNode as l, renderSlot as g, toDisplayString as c, Fragment as m, renderList as f } from "vue";
2
- const v = {
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
- }, y = { class: "mc-introduction-logo-container" }, _ = ["src", "alt"], k = { class: "mc-introduction-title" }, h = {
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
- }, I = {
125
+ }, L = {
31
126
  key: 1,
32
127
  class: "mc-introduction-description"
33
- }, S = /* @__PURE__ */ u({
128
+ }, V = /* @__PURE__ */ S({
34
129
  __name: "Introduction",
35
- props: v,
36
- setup(n) {
37
- return (t, i) => (o(), e(
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: p(["mc-introduction", [t.align, t.background]])
139
+ class: C(["mc-introduction", u(s).getIntroductionClasses()])
41
140
  },
42
141
  [
43
- d("div", y, [
44
- t.logoImg ? (o(), e("img", {
142
+ p("div", N, [
143
+ o.logoImg ? (a(), i("img", {
45
144
  key: 0,
46
- src: t.logoImg,
47
- alt: t.title
48
- }, null, 8, _)) : l("v-if", !0),
49
- d(
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
- k,
52
- c(t.title),
151
+ B,
152
+ d(o.title),
53
153
  1
54
154
  /* TEXT */
55
155
  )
56
156
  ]),
57
- t.subTitle ? (o(), e(
157
+ o.subTitle ? (a(), i(
58
158
  "div",
59
- h,
60
- c(t.subTitle),
159
+ H,
160
+ d(o.subTitle),
61
161
  1
62
162
  /* TEXT */
63
- )) : l("v-if", !0),
64
- t.description.length ? (o(), e("div", I, [
65
- (o(!0), e(
66
- m,
163
+ )) : c("v-if", !0),
164
+ o.description.length ? (a(), i("div", L, [
165
+ (a(!0), i(
166
+ b,
67
167
  null,
68
- f(t.description, (r, s) => (o(), e(
168
+ v(o.description, (f, _) => (a(), i(
69
169
  "div",
70
- { key: s },
71
- c(r),
170
+ { key: _ },
171
+ d(f),
72
172
  1
73
173
  /* TEXT */
74
174
  ))),
75
175
  128
76
176
  /* KEYED_FRAGMENT */
77
177
  ))
78
- ])) : l("v-if", !0),
79
- g(t.$slots, "default", {}, void 0, !0)
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
- }), b = (n, t) => {
86
- const i = n.__vccOpts || n;
87
- for (const [r, s] of t)
88
- i[r] = s;
89
- return i;
90
- }, a = /* @__PURE__ */ b(S, [["__scopeId", "data-v-fff875ce"]]);
91
- a.install = (n) => {
92
- n.component("McIntroduction", a);
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
- a as McIntroduction
195
+ h as McIntroduction
96
196
  };
package/Layout/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { createElementBlock as n, openBlock as c, renderSlot as o } from "vue";
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 c(), n("div", f, [
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 c(), n("div", $, [
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 c(), n("div", L, [
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 c(), n("div", I, [
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 c(), n("div", A, [
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, 12px);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}
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 { 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";
2
- 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 || {});
3
- const A = {
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
- }, B = 50, H = ["TEXTAREA", "INPUT"], I = "ArrowUp", _ = "ArrowDown", N = "Enter";
38
- function M(e, o) {
39
- const n = L(e.enableShortKey ? 0 : -1), i = (t) => {
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 l = 0; l < e.data.length; l++)
43
- e.data[l].active = e.data[l].value === t.value;
44
- o("select", { ...t });
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
- }, s = (t) => {
47
- if (!e.enableLazyLoad || e.direction !== v.Vertical)
48
+ }, y = (t) => {
49
+ if (!e.enableLazyLoad || e.direction !== m.Vertical)
48
50
  return;
49
- const l = t.target, r = l.scrollHeight, d = l.clientHeight, a = l.scrollTop;
50
- r - d - a < B && o("loadMore", t);
51
- }, m = (t) => {
52
- 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] }));
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 l = e.inputEl.$el ?? e.inputEl;
58
- H.includes(l.tagName) ? t = l : t = l.querySelector("textarea") || l.querySelector("input") || document;
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
- t = document;
61
- e.enableShortKey && t.addEventListener("keydown", m);
62
- }), { preSelectIndex: n, onItemClick: i, onListScroll: s };
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 D(e) {
67
+ function K(e) {
65
68
  return { listClasses: E(() => ({
66
69
  "mc-list": !0,
67
- "mc-list-horizontal": e.direction === v.Horizontal,
68
- "mc-list-nowrap": e.direction === v.Horizontal && !e.autoWrap
70
+ "mc-list-horizontal": e.direction === m.Horizontal,
71
+ "mc-list-nowrap": e.direction === m.Horizontal && !e.autoWrap
69
72
  })) };
70
73
  }
71
- const K = ["onClick"], U = /* @__PURE__ */ w({
74
+ const U = ["onClick"], $ = /* @__PURE__ */ z({
72
75
  __name: "List",
73
- props: A,
76
+ props: B,
74
77
  emits: ["select", "loadMore"],
75
- setup(e, { emit: o }) {
76
- const n = e, i = o, { listClasses: s } = D(n), { preSelectIndex: m, onItemClick: t, onListScroll: l } = M(n, i);
77
- return (r, d) => (f(), u(
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(s)),
83
+ class: g(c(i)),
81
84
  onScroll: d[0] || (d[0] = //@ts-ignore
82
- (...a) => c(l) && c(l)(...a))
85
+ (...a) => c(t) && c(t)(...a))
83
86
  },
84
87
  [
85
- (f(!0), u(
88
+ (f(!0), v(
86
89
  b,
87
90
  null,
88
- z(r.data, (a, y) => (f(), u(
91
+ C(n.data, (a, u) => (f(), v(
89
92
  b,
90
- { key: y },
93
+ { key: u },
91
94
  [
92
- r.variant === c(k).None ? h(r.$slots, "item", {
95
+ n.variant === c(k).None ? h(n.$slots, "item", {
93
96
  key: 0,
94
97
  item: a
95
- }, void 0, !0) : (f(), u("div", {
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": y === c(m)
105
+ "mc-list-item-pre-selection": u === c(y)
103
106
  },
104
- r.variant
107
+ n.variant
105
108
  ]),
106
- onClick: () => c(t)(a)
109
+ onClick: () => c(s)(a)
107
110
  }, [
108
- h(r.$slots, "item", { item: a }, () => [
109
- C(
110
- T(a.label),
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, K))
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
- }), $ = (e, o) => {
129
- const n = e.__vccOpts || e;
130
- for (const [i, s] of o)
131
- n[i] = s;
132
- return n;
133
- }, S = /* @__PURE__ */ $(U, [["__scopeId", "data-v-1a543233"]]);
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
- v as ListDirection,
141
+ m as ListDirection,
139
142
  k as ListVariant,
140
143
  S as McList,
141
- A as listProps
144
+ B as listProps
142
145
  };
package/Locale/index.js CHANGED
@@ -1,64 +1,114 @@
1
- import { ref as u, reactive as l } from "vue";
2
- function h(n) {
3
- return new f(n);
1
+ import { ref as c, reactive as i } from "vue";
2
+ function u(s) {
3
+ return new p(s);
4
4
  }
5
- let f = class {
6
- constructor(r) {
7
- this.locale = u("zh-cn"), this.messages = l({}), this.use = (e) => {
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, s = {}) => {
9
+ }, this.t = (e, o = {}) => {
10
10
  const t = this.messages[this.locale.value];
11
- return p(e, s, t);
12
- }, this.mergeLocaleMessages = (e, s) => this.messages[e] ? (this.messages[e] = o(this.messages[e], s), o(this.messages[e], s)) : (this.messages[e] = s, this.messages), this.locale.value = r.locale, this.messages = l(r.messages);
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 p(n, r, e) {
16
- const s = n.split(".");
15
+ function g(s, n, e) {
16
+ const o = s.split(".");
17
17
  let t = e || {};
18
- return s.forEach((c) => {
19
- t = t[c] ?? n;
20
- }), typeof t == "function" ? t(r) : t.replace(/{(\w+)}/g, (c, a) => r[a] ?? `{${a}}`);
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 o(n, r) {
23
- const e = { ...n };
24
- for (const s in r)
25
- if (Object.prototype.hasOwnProperty.call(r, s)) {
26
- const t = r[s], c = n[s];
27
- typeof t == "object" && t !== null ? typeof c == "object" && c !== null ? e[s] = o(c, t) : e[s] = { ...t } : e[s] = t;
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 g = {
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
- }, y = {
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
- }, M = {
46
- "en-us": g,
47
- "zh-cn": y
48
- }, i = h({
95
+ }, h = {
96
+ "en-us": w,
97
+ "zh-cn": f
98
+ }, d = u({
49
99
  locale: "zh-cn",
50
- messages: M
100
+ messages: h
51
101
  });
52
- function I() {
53
- return i;
102
+ function v() {
103
+ return d;
54
104
  }
55
- const E = {
56
- install: (n) => {
57
- n.config.globalProperties.McI18n = i;
105
+ const M = {
106
+ install: (s) => {
107
+ s.config.globalProperties.McI18n = d;
58
108
  }
59
109
  };
60
110
  export {
61
- E as McLocale,
62
- i as default,
63
- I as useMcI18n
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;