@matechat/core 1.12.1-alpha.0 → 1.12.2-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.
@@ -1,8 +1,8 @@
1
1
  import "./index.css";
2
2
  var we = Object.defineProperty;
3
3
  var ve = (o, t, s) => t in o ? we(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
4
- var N = (o, t, s) => ve(o, typeof t != "symbol" ? t + "" : t, s);
5
- import { defineComponent as de, ref as D, computed as Q, watch as E, nextTick as W, onMounted as ge, openBlock as M, createElementBlock as I, normalizeClass as O, createElementVNode as C, toDisplayString as J, renderSlot as q, unref as T, createCommentVNode as z, createVNode as Ie, Transition as Le, withCtx as Ne, withDirectives as Te, vShow as De, isVNode as ue, h as y, reactive as xe, onBeforeUnmount as Ae, useSlots as ke, Fragment as j, createBlock as Se, resolveDynamicComponent as be } from "vue";
4
+ var I = (o, t, s) => ve(o, typeof t != "symbol" ? t + "" : t, s);
5
+ import { defineComponent as de, ref as D, computed as Q, watch as E, nextTick as W, onMounted as ge, openBlock as M, createElementBlock as L, normalizeClass as O, createElementVNode as C, toDisplayString as J, renderSlot as q, unref as T, createCommentVNode as z, createVNode as Le, Transition as Ne, withCtx as Ie, withDirectives as Te, vShow as De, isVNode as ue, h as y, reactive as xe, onBeforeUnmount as Ae, useSlots as ke, Fragment as j, createBlock as Se, resolveDynamicComponent as be } from "vue";
6
6
  import A from "highlight.js";
7
7
  import je from "markdown-it";
8
8
  import { debounce as Oe } from "lodash-es";
@@ -11,17 +11,13 @@ import { useMcI18n as pe } from "@matechat/core/Locale";
11
11
  const Ue = "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%3eenlarge%3c/title%3e%3cg%20id='enlarge'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.16666667,1%20C10.572409,1%2013.3333333,3.76092429%2013.3333333,7.16666667%20C13.3333333,8.68984984%2012.781084,10.0840543%2011.8658888,11.1599767%20L14.4225201,13.7154466%20C14.6177822,13.9107088%2014.6177822,14.2272912%2014.4225201,14.4225534%20C14.2489537,14.5961197%2013.9795293,14.6154049%2013.7846612,14.4804088%20L13.7154133,14.4225534%20L11.158968,11.8667467%20C10.083183,12.7814291%208.68937384,13.3333333%207.16666667,13.3333333%20C3.76092429,13.3333333%201,10.572409%201,7.16666667%20C1,3.76092429%203.76092429,1%207.16666667,1%20Z%20M7.16666667,2%20C4.31320904,2%202,4.31320904%202,7.16666667%20C2,10.0201243%204.31320904,12.3333333%207.16666667,12.3333333%20C10.0201243,12.3333333%2012.3333333,10.0201243%2012.3333333,7.16666667%20C12.3333333,4.31320904%2010.0201243,2%207.16666667,2%20Z%20M7.16666667,4.66666667%20C7.41212656,4.66666667%207.61627504,4.84354183%207.658611,5.07679103%20L7.66666667,5.16666667%20L7.666,6.668%20L9.16601582,6.66666666%20C9.44215796,6.66630764%209.66630679,6.88987368%209.66666668,7.16601582%20C9.66698576,7.4114755%209.49037648,7.61585405%209.25718258,7.65849359%20L9.16731751,7.66666666%20L7.666,7.668%20L7.66666667,9.16666667%20C7.66666667,9.44280904%207.44280904,9.66666667%207.16666667,9.66666667%20C6.92120678,9.66666667%206.7170583,9.48979151%206.67472234,9.2565423%20L6.66666667,9.16666667%20L6.666,7.669%20L5.17251751,7.67186668%20C4.89637537,7.6722257%204.67222654,7.44865965%204.67186666,7.17251751%20C4.67154758,6.92705783%204.84815685,6.72267929%205.08135075,6.68003974%20L5.17121582,6.67186709%20L6.666,6.669%20L6.66666667,5.16666667%20C6.66666667,4.89052429%206.89052429,4.66666667%207.16666667,4.66666667%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", ze = "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%3ezoom-out%3c/title%3e%3cg%20id='zoom-out'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.16666667,1%20C10.572409,1%2013.3333333,3.76092429%2013.3333333,7.16666667%20C13.3333333,8.68984984%2012.781084,10.0840543%2011.8658888,11.1599767%20L14.4225201,13.7154466%20C14.6177822,13.9107088%2014.6177822,14.2272912%2014.4225201,14.4225534%20C14.2489537,14.5961197%2013.9795293,14.6154049%2013.7846612,14.4804088%20L13.7154133,14.4225534%20L11.158968,11.8667467%20C10.083183,12.7814291%208.68937384,13.3333333%207.16666667,13.3333333%20C3.76092429,13.3333333%201,10.572409%201,7.16666667%20C1,3.76092429%203.76092429,1%207.16666667,1%20Z%20M7.16666667,2%20C4.31320904,2%202,4.31320904%202,7.16666667%20C2,10.0201243%204.31320904,12.3333333%207.16666667,12.3333333%20C10.0201243,12.3333333%2012.3333333,10.0201243%2012.3333333,7.16666667%20C12.3333333,4.31320904%2010.0201243,2%207.16666667,2%20Z%20M9.16601582,6.66666666%20C9.44215796,6.66630764%209.66630679,6.88987368%209.66666668,7.16601582%20C9.66698576,7.4114755%209.49037648,7.61585405%209.25718258,7.65849359%20L9.16731751,7.66666666%20L5.17251751,7.67186668%20C4.89637537,7.6722257%204.67222654,7.44865965%204.67186666,7.17251751%20C4.67154758,6.92705783%204.84815685,6.72267929%205.08135075,6.68003974%20L5.17121582,6.67186709%20L9.16601582,6.66666666%20Z'%20id='形状结合'%20fill='%2371757F'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", We = "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%3ei下载%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='i下载'%3e%3cpath%20d='M14.5,14%20C14.7761424,14%2015,14.2238576%2015,14.5%20C15,14.7761424%2014.7761424,15%2014.5,15%20L1.5,15%20C1.22385763,15%201,14.7761424%201,14.5%20C1,14.2238576%201.22385763,14%201.5,14%20L14.5,14%20Z%20M8,1%20C8.24545989,1%208.44960837,1.17687516%208.49194433,1.41012437%20L8.5,1.5%20L8.5,10.793%20L11.6464466,7.64644661%20C11.820013,7.47288026%2012.0894374,7.45359511%2012.2843055,7.58859116%20L12.3535534,7.64644661%20C12.5271197,7.82001296%2012.5464049,8.08943736%2012.4114088,8.2843055%20L12.3535534,8.35355339%20L8.35355339,12.3535534%20L8.34128643,12.3654113%20C8.32881868,12.3770608%208.31575424,12.3880797%208.30214392,12.3984173%20L8.35355339,12.3535534%20C8.32671912,12.3803877%208.29759357,12.4035342%208.26680652,12.422993%20C8.25568247,12.4299807%208.24404667,12.4367067%208.23212724,12.4429657%20C8.21827569,12.4502504%208.20453886,12.4566485%208.1905951,12.4623894%20C8.17802507,12.4675915%208.16473685,12.4724419%208.15119917,12.4767316%20C8.13583471,12.481552%208.12047425,12.4856039%208.10498705,12.4889143%20C8.09430622,12.4912471%208.08325248,12.4932298%208.07207924,12.494843%20C8.05487076,12.4972949%208.03773477,12.498877%208.02056948,12.4995793%20C8.01375728,12.4998604%208.00689494,12.5%208,12.5%20L7.98043349,12.4996194%20C7.96293275,12.4989382%207.94546098,12.4973429%207.92809589,12.4948333%20L8,12.5%20C7.96390296,12.5%207.92869933,12.4961748%207.89477235,12.4889078%20C7.87952575,12.4856039%207.86416529,12.481552%207.84898836,12.4767587%20C7.83526315,12.4724419%207.82197493,12.4675915%207.80896344,12.4622078%20C7.79546114,12.4566485%207.78172431,12.4502504%207.76824181,12.443195%20C7.75595333,12.4367067%207.74431753,12.4299807%207.73298968,12.422812%20C7.72729809,12.4192668%207.72146362,12.4154054%207.7156945,12.4114088%20L7.69785608,12.3984173%20C7.68424576,12.3880797%207.67118132,12.3770608%207.65871357,12.3654113%20L7.64644661,12.3535534%20L3.64644661,8.35355339%20C3.45118446,8.15829124%203.45118446,7.84170876%203.64644661,7.64644661%20C3.82001296,7.47288026%204.08943736,7.45359511%204.2843055,7.58859116%20L4.35355339,7.64644661%20L7.5,10.793%20L7.5,1.5%20C7.5,1.22385763%207.72385763,1%208,1%20Z'%20id='形状结合'%20fill='%2371757F'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Pe = "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", He = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZnVuY3Rpb24gaWNvbi9jb3B5PC90aXRsZT4KICAgIDxnIGlkPSLpobXpnaItMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFQSS1zdGFydGVyLeWbvuagh+WFpeW6kyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU5Mi4wMDAwMDAsIC0yMDQuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSLm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016'%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";
12
12
  class he {
13
13
  constructor() {
14
- N(this, "xssWhiteList", Ee());
15
- N(this, "cssWhiteList", _e());
14
+ I(this, "xssWhiteList", Ee());
15
+ I(this, "cssWhiteList", _e());
16
16
  this.setDefaultXss();
17
17
  }
18
18
  setDefaultXss() {
19
19
  this.xssWhiteList.input = ["type", "checked", "disabled", "class"], this.xssWhiteList.label = ["for"], this.xssWhiteList.ul = ["class"], this.xssWhiteList.div = ["class", "key"], this.xssWhiteList.a = ["href", "class", "target", "name"], this.xssWhiteList.ol = ["start"], this.xssWhiteList.p = ["class"], this.xssWhiteList.span = ["style", "class", "title", "id"], this.xssWhiteList.svg = ["style", "class", "width", "height", "viewbox", "preserveaspectratio", "id", "fill", "stroke"], this.xssWhiteList.path = ["style", "class", "d", "id", "fill", "stroke"], this.xssWhiteList.th = ["style"], this.xssWhiteList.td = ["style"];
20
20
  }
21
- onIgnoreTagAttr(t, s, a, n) {
22
- if (!n && (s === "id" || t === "span" && s === "style"))
23
- return s + "=" + a;
24
- }
25
21
  getXssWhiteList() {
26
22
  return this.xssWhiteList;
27
23
  }
@@ -42,7 +38,6 @@ class he {
42
38
  filterHtml(t) {
43
39
  return Be(t, {
44
40
  whiteList: this.xssWhiteList,
45
- onIgnoreTagAttr: this.onIgnoreTagAttr,
46
41
  css: {
47
42
  whiteList: Object.assign({}, this.cssWhiteList, {
48
43
  top: !0,
@@ -120,7 +115,7 @@ const Ye = {
120
115
  var e;
121
116
  const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
122
117
  i && n && n.zoomOut(i);
123
- }, L = () => {
118
+ }, N = () => {
124
119
  var e;
125
120
  const i = (e = f.value) == null ? void 0 : e.querySelector(".mc-mermaid-content");
126
121
  i && n && n.download(i);
@@ -184,7 +179,7 @@ const Ye = {
184
179
  }
185
180
  ), ge(() => {
186
181
  g.value && _();
187
- }), (i, e) => (M(), I(
182
+ }), (i, e) => (M(), L(
188
183
  "div",
189
184
  {
190
185
  class: O(["mc-code-block", V.value]),
@@ -192,7 +187,7 @@ const Ye = {
192
187
  ref: f
193
188
  },
194
189
  [
195
- i.$slots.header ? q(i.$slots, "header", { key: 1 }, void 0, !0) : (M(), I("div", Ye, [
190
+ i.$slots.header ? q(i.$slots, "header", { key: 1 }, void 0, !0) : (M(), L("div", Ye, [
196
191
  C(
197
192
  "span",
198
193
  Qe,
@@ -202,7 +197,7 @@ const Ye = {
202
197
  ),
203
198
  q(i.$slots, "actions", {}, () => [
204
199
  C("div", Fe, [
205
- g.value ? (M(), I("div", Ge, [
200
+ g.value ? (M(), L("div", Ge, [
206
201
  C(
207
202
  "ul",
208
203
  {
@@ -234,7 +229,7 @@ const Ye = {
234
229
  /* CLASS */
235
230
  )
236
231
  ])) : z("v-if", !0),
237
- g.value && r.value ? (M(), I("div", {
232
+ g.value && r.value ? (M(), L("div", {
238
233
  key: 1,
239
234
  class: "mc-action-btn mc-toggle-btn",
240
235
  title: T(s)("Md.zoomIn"),
@@ -248,7 +243,7 @@ const Ye = {
248
243
  /* HOISTED */
249
244
  )
250
245
  ]), 8, $e)) : z("v-if", !0),
251
- g.value && r.value ? (M(), I("div", {
246
+ g.value && r.value ? (M(), L("div", {
252
247
  key: 2,
253
248
  class: "mc-action-btn mc-toggle-btn",
254
249
  title: T(s)("Md.zoomOut"),
@@ -262,11 +257,11 @@ const Ye = {
262
257
  /* HOISTED */
263
258
  )
264
259
  ]), 8, Xe)) : z("v-if", !0),
265
- g.value && r.value ? (M(), I("div", {
260
+ g.value && r.value ? (M(), L("div", {
266
261
  key: 3,
267
262
  class: "mc-action-btn mc-toggle-btn",
268
263
  title: T(s)("Md.downLoad"),
269
- onClick: L
264
+ onClick: N
270
265
  }, e[5] || (e[5] = [
271
266
  C(
272
267
  "img",
@@ -295,12 +290,12 @@ const Ye = {
295
290
  onClick: e[2] || (e[2] = //@ts-ignore
296
291
  (...l) => T(P) && T(P)(...l))
297
292
  }, [
298
- d.value ? (M(), I("img", qe)) : (M(), I("img", Je))
293
+ d.value ? (M(), L("img", qe)) : (M(), L("img", Je))
299
294
  ], 8, Ve)
300
295
  ])
301
296
  ], !0)
302
297
  ])),
303
- Ie(Le, {
298
+ Le(Ne, {
304
299
  name: "collapse-transition",
305
300
  onBeforeEnter: $,
306
301
  onEnter: X,
@@ -310,12 +305,12 @@ const Ye = {
310
305
  onAfterLeave: K,
311
306
  persisted: ""
312
307
  }, {
313
- default: Ne(() => [
308
+ default: Ie(() => [
314
309
  Te(C(
315
310
  "div",
316
311
  null,
317
312
  [
318
- g.value && r.value && !i.$slots.content ? (M(), I("div", et)) : i.$slots.content ? q(i.$slots, "content", { key: 2 }, void 0, !0) : (M(), I("pre", tt, [
313
+ g.value && r.value && !i.$slots.content ? (M(), L("div", et)) : i.$slots.content ? q(i.$slots, "content", { key: 2 }, void 0, !0) : (M(), L("pre", tt, [
319
314
  C("code", {
320
315
  class: O(`hljs language-${o.language}`),
321
316
  innerHTML: m.value
@@ -540,7 +535,7 @@ const v = () => {
540
535
  };
541
536
  class te {
542
537
  constructor(t) {
543
- N(this, "_adapter");
538
+ I(this, "_adapter");
544
539
  this._adapter = { ...te.defaultAdapter, ...t };
545
540
  }
546
541
  static get cssClasses() {
@@ -607,12 +602,12 @@ class te {
607
602
  class gt extends te {
608
603
  constructor(s) {
609
604
  super({ ...s });
610
- N(this, "isToken", (s) => "type" in s && "content" in s);
611
- N(this, "typewriterEnd", () => {
605
+ I(this, "isToken", (s) => "type" in s && "content" in s);
606
+ I(this, "typewriterEnd", () => {
612
607
  var s, a;
613
608
  this.setState({ isTyping: !1 }), (a = (s = this._adapter).typingEnd) == null || a.call(s);
614
609
  });
615
- N(this, "getThinkContent", (s, a) => {
610
+ I(this, "getThinkContent", (s, a) => {
616
611
  var c;
617
612
  const n = (a == null ? void 0 : a.customClass) || "mc-think-block";
618
613
  return ((c = s == null ? void 0 : s.replace("<think>", `<div class="${n}">`)) == null ? void 0 : c.replace("</think>", `
@@ -621,18 +616,18 @@ class gt extends te {
621
616
 
622
617
  `)) || "";
623
618
  });
624
- N(this, "parseTypingContent", (s) => {
619
+ I(this, "parseTypingContent", (s) => {
625
620
  const { typingOptions: a } = this.getProps(), { typingIndex: n } = this.getStates();
626
621
  s = s.slice(0, n) || "";
627
622
  const c = { ...G, ...a };
628
623
  return c.style === "cursor" ? s += '<span class="mc-typewriter mc-typewriter-cursor">|</span>' : (c.style === "color" || c.style === "gradient") && (s = s.slice(0, -5) + `<span class="mc-typewriter mc-typewriter-${c.style}">${s.slice(-5)}</span>`), s || "";
629
624
  });
630
- N(this, "parseContent", () => {
625
+ I(this, "parseContent", () => {
631
626
  const { content: s, thinkOptions: a, enableThink: n } = this.getProps(), { typing: c, isTyping: d } = this.getStates();
632
627
  let r = s || "";
633
628
  c && d && (r = this.parseTypingContent(s)), n && (r = this.getThinkContent(s, a)), r = this._adapter.parseContent(r);
634
629
  });
635
- N(this, "typewriterStart", () => {
630
+ I(this, "typewriterStart", () => {
636
631
  var r, g;
637
632
  const { typingOptions: s } = this.getProps(), { timer: a } = this.getStates();
638
633
  a && clearTimeout(a), this.setState({ isTyping: !0 }), (g = (r = this._adapter).typingStart) == null || g.call(r);
@@ -645,12 +640,12 @@ class gt extends te {
645
640
  this.typewriterEnd(), this.parseContent();
646
641
  return;
647
642
  }
648
- let L = setTimeout(
643
+ let N = setTimeout(
649
644
  c,
650
645
  typeof n.interval == "number" ? n.interval : 50
651
646
  );
652
647
  this.setState({
653
- timer: L
648
+ timer: N
654
649
  });
655
650
  };
656
651
  let d = setTimeout(c);
@@ -711,7 +706,7 @@ const pt = /* @__PURE__ */ de({
711
706
  }), { foundation: m } = ut({
712
707
  props: n,
713
708
  emit: c
714
- }), f = D(0), x = D(!1), k = D(), L = () => {
709
+ }), f = D(0), x = D(!1), k = D(), N = () => {
715
710
  let e = n.content || "";
716
711
  if (n.typing && x.value) {
717
712
  e = n.content.slice(0, f.value) || "";
@@ -791,7 +786,7 @@ const pt = /* @__PURE__ */ de({
791
786
  return [n.enableThink, (e = n.thinkOptions) == null ? void 0 : e.customClass, n.theme];
792
787
  },
793
788
  () => {
794
- L();
789
+ N();
795
790
  }
796
791
  );
797
792
  const R = (e, l, u) => {
@@ -826,8 +821,8 @@ const pt = /* @__PURE__ */ de({
826
821
  clearTimeout(r), x.value = !0, c("typingStart");
827
822
  const e = { ...G, ...n == null ? void 0 : n.typingOptions }, l = () => {
828
823
  let u = e.step;
829
- if (Array.isArray(e.step) && (u = e.step[0] + Math.floor(Math.random() * (e.step[1] - e.step[0]))), f.value += u, L(), c("typing"), f.value >= n.content.length) {
830
- V(), L();
824
+ if (Array.isArray(e.step) && (u = e.step[0] + Math.floor(Math.random() * (e.step[1] - e.step[0]))), f.value += u, N(), c("typing"), f.value >= n.content.length) {
825
+ V(), N();
831
826
  return;
832
827
  }
833
828
  r = setTimeout(l, e.interval);
@@ -838,7 +833,7 @@ const pt = /* @__PURE__ */ de({
838
833
  () => n.content,
839
834
  (e, l) => {
840
835
  if (!n.typing) {
841
- f.value = (e == null ? void 0 : e.length) || 0, L();
836
+ f.value = (e == null ? void 0 : e.length) || 0, N();
842
837
  return;
843
838
  }
844
839
  e.indexOf(l) === -1 && (f.value = 0), W(() => K());
@@ -851,20 +846,20 @@ const pt = /* @__PURE__ */ de({
851
846
  E(
852
847
  () => n.customXssRules,
853
848
  (e) => {
854
- a.setCustomXssRules(e), L();
849
+ a.setCustomXssRules(e), N();
855
850
  },
856
851
  { deep: !1, immediate: !0 }
857
852
  ), E(
858
853
  () => n.mdPlugins,
859
854
  (e) => {
860
- a.setMdPlugins(e, g), L();
855
+ a.setMdPlugins(e, g), N();
861
856
  },
862
857
  { immediate: !0, deep: !1 }
863
858
  );
864
859
  const i = Q(() => n.theme === "dark" ? "mc-markdown-render-dark" : "mc-markdown-render-light");
865
860
  return ge(() => {
866
861
  c("afterMdtInit", g);
867
- }), t({ mdt: g }), (e, l) => (M(), I(
862
+ }), t({ mdt: g }), (e, l) => (M(), L(
868
863
  j,
869
864
  null,
870
865
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matechat/core",
3
- "version": "1.12.1-alpha.0",
3
+ "version": "1.12.2-alpha.0",
4
4
  "license": "MIT",
5
5
  "description": "前端智能化场景解决方案UI库,轻松构建你的AI应用。",
6
6
  "keywords": [