@matechat/core 1.7.0-alpha.1 → 1.7.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.
@@ -61,7 +61,7 @@ const Se = {
61
61
  }, Ze = {
62
62
  key: 1,
63
63
  src: ke
64
- }, Qe = { key: 0 }, Pe = {
64
+ }, Pe = { key: 0 }, Qe = {
65
65
  key: 0,
66
66
  class: "mc-mermaid-content"
67
67
  }, Ge = { key: 1 }, He = ["innerHTML"], Fe = /* @__PURE__ */ oe({
@@ -153,13 +153,13 @@ const Se = {
153
153
  requestAnimationFrame(() => {
154
154
  t.dataset.oldOverflow = t.style.overflow, t.dataset.height ? t.style.maxHeight = t.dataset.height : t.scrollHeight !== 0 ? t.style.maxHeight = `${t.scrollHeight}px` : t.style.maxHeight = 0, t.style.overflow = "hidden";
155
155
  });
156
- }, Q = (t) => {
156
+ }, P = (t) => {
157
157
  t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
158
158
  }, B = (t) => {
159
159
  t.dataset || (t.dataset = {}), t.dataset.oldOverflow = t.style.overflow, t.style.maxHeight = `${t.scrollHeight}px`, t.style.overflow = "hidden";
160
160
  }, k = (t) => {
161
161
  t.scrollHeight !== 0 && (t.style.maxHeight = 0);
162
- }, P = (t) => {
162
+ }, Q = (t) => {
163
163
  t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
164
164
  }, G = z(() => s.theme === "dark" ? "mc-code-block-dark" : "mc-code-block-light");
165
165
  return j(() => [s.code, s.theme, s.enableMermaid], () => {
@@ -281,14 +281,14 @@ const Se = {
281
281
  name: "collapse-transition",
282
282
  onBeforeEnter: Y,
283
283
  onEnter: Z,
284
- onAfterEnter: Q,
284
+ onAfterEnter: P,
285
285
  onBeforeLeave: B,
286
286
  onLeave: k,
287
- onAfterLeave: P
287
+ onAfterLeave: Q
288
288
  }, {
289
289
  default: fe(() => [
290
- u.value ? (N(), I("div", Qe, [
291
- a.value && r.value && !t.$slots.content ? (N(), I("div", Pe)) : t.$slots.content ? F(t.$slots, "content", { key: 2 }, void 0, !0) : (N(), I("pre", Ge, [
290
+ u.value ? (N(), I("div", Pe, [
291
+ a.value && r.value && !t.$slots.content ? (N(), I("div", Qe)) : t.$slots.content ? F(t.$slots, "content", { key: 2 }, void 0, !0) : (N(), I("pre", Ge, [
292
292
  M("code", {
293
293
  class: A(`hljs language-${i.language}`),
294
294
  innerHTML: y.value
@@ -452,6 +452,8 @@ const Se = {
452
452
  }), o.children;
453
453
  }, R = (i) => {
454
454
  if (!i || !i.trim()) return [];
455
+ if (typeof window > "u" || typeof DOMParser > "u")
456
+ return [i];
455
457
  const o = new DOMParser().parseFromString(`<body>${i}</body>`, "text/html"), d = [];
456
458
  return o.body.childNodes.forEach((n, u) => {
457
459
  const g = ge(n);
@@ -524,7 +526,7 @@ const Se = {
524
526
  const m = a.renderer.render([e.openNode], a.options, {}), p = R(m);
525
527
  return w(U, p);
526
528
  }
527
- return E(e) ? Y(e) : Q(e);
529
+ return E(e) ? Y(e) : P(e);
528
530
  }, E = (e) => "type" in e && "content" in e, Y = (e) => {
529
531
  if (e.type === "text")
530
532
  return e.content;
@@ -545,7 +547,7 @@ const Se = {
545
547
  }, Z = (e) => {
546
548
  const c = a.renderer.render([e], a.options, {}), h = R(c);
547
549
  return w(U, h);
548
- }, Q = (e) => {
550
+ }, P = (e) => {
549
551
  var p, f, K, V, J, q, ee, te, se;
550
552
  let c = "div";
551
553
  (p = e.openNode) != null && p.tag && W((f = e.openNode) == null ? void 0 : f.tag) && (c = (K = e.openNode) == null ? void 0 : K.tag);
@@ -562,7 +564,7 @@ const Se = {
562
564
  }, B = (e) => {
563
565
  var m;
564
566
  const c = ((m = e.info) == null ? void 0 : m.replace(/<span\b[^>]*>/i, "").replace("</span>", "")) || "", h = e.content;
565
- return P(c, h, e.tokenIndex);
567
+ return Q(c, h, e.tokenIndex);
566
568
  }, k = (e) => e.reduce((c, [h, m]) => (c[h] = m, c), {});
567
569
  j(
568
570
  () => {
@@ -573,7 +575,7 @@ const Se = {
573
575
  C();
574
576
  }
575
577
  );
576
- const P = (e, c, h) => {
578
+ const Q = (e, c, h) => {
577
579
  const m = {
578
580
  actions: g.actions ? () => {
579
581
  var p;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matechat/core",
3
- "version": "1.7.0-alpha.1",
3
+ "version": "1.7.0",
4
4
  "license": "MIT",
5
5
  "description": "前端智能化场景解决方案UI库,轻松构建你的AI应用。",
6
6
  "keywords": [