markdown-flow-ui 0.2.7-dev.2 → 0.2.7-dev.3

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,256 +1,292 @@
1
- import { j as t } from "../../_virtual/jsx-runtime.es.js";
1
+ import { j as r } from "../../_virtual/jsx-runtime.es.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import ce, { useState as be, useRef as W, useEffect as A, useMemo as h } from "react";
5
- import Te from "../../_virtual/index.es.js";
6
- import { sanitizeInvalidTagName as we } from "./utils/sanitize-invalid-tag-name.es.js";
7
- import { stripSvgTextLineBreaks as ke } from "./utils/strip-svg-text-line-breaks.es.js";
4
+ import le, { useState as we, useRef as R, useEffect as V, useMemo as h } from "react";
5
+ import Se from "../../_virtual/index.es.js";
6
+ import { sanitizeInvalidTagName as ke } from "./utils/sanitize-invalid-tag-name.es.js";
7
+ import { stripSvgTextLineBreaks as Be } from "./utils/strip-svg-text-line-breaks.es.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  import je from "./CodeBlock.es.js";
11
- import Ne from "./plugins/CustomVariable.es.js";
12
- import J from "./plugins/MermaidChart.es.js";
13
- import { preserveCustomVariableProperties as Be, restoreCustomVariableProperties as Ce } from "./utils/custom-variable-props.es.js";
14
- import { subsetLanguages as Se, highlightLanguages as Re } from "./utils/highlight-languages.es.js";
15
- import { mermaidBlockIsComplete as Le, parseMarkdownSegments as le } from "./utils/mermaid-parse.es.js";
11
+ import Ce from "./plugins/CustomVariable.es.js";
12
+ import Q from "./plugins/MermaidChart.es.js";
13
+ import { preserveCustomVariableProperties as Ne, restoreCustomVariableProperties as Re } from "./utils/custom-variable-props.es.js";
14
+ import { subsetLanguages as Le, highlightLanguages as Ae } from "./utils/highlight-languages.es.js";
15
+ import { mermaidBlockIsComplete as $e, parseMarkdownSegments as ue } from "./utils/mermaid-parse.es.js";
16
16
  import { normalizeInlineHtml as de } from "./utils/normalize-inline-html.es.js";
17
- import Ae from "./IframeSandbox.es.js";
18
- import { splitContentSegments as $e } from "./utils/split-content.es.js";
19
- import { getInteractionDefaultValues as ze } from "../../lib/interaction-defaults.es.js";
20
- import { getContentRenderLocaleTexts as Me } from "./contentRenderI18n.es.js";
21
- import { Markdown as Fe } from "../../node_modules/react-markdown/lib/index.es.js";
22
- import Ie from "../../node_modules/rehype-raw/lib/index.es.js";
23
- import Ve from "../../node_modules/rehype-highlight/lib/index.es.js";
24
- import He from "../../node_modules/rehype-katex/lib/index.es.js";
25
- import De from "../../node_modules/remark-gfm/lib/index.es.js";
26
- import Pe from "../../node_modules/remark-math/lib/index.es.js";
27
- import We from "../../node_modules/remark-breaks/lib/index.es.js";
28
- const _e = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)\b/i, me = ({ svg: r }) => {
29
- const i = W(null);
30
- return A(() => {
31
- const s = i.current;
17
+ import Ve from "./IframeSandbox.es.js";
18
+ import { splitContentSegments as ze } from "./utils/split-content.es.js";
19
+ import { getInteractionDefaultValues as Me } from "../../lib/interaction-defaults.es.js";
20
+ import { getContentRenderLocaleTexts as De } from "./contentRenderI18n.es.js";
21
+ import { Markdown as Ie } from "../../node_modules/react-markdown/lib/index.es.js";
22
+ import Fe from "../../node_modules/rehype-raw/lib/index.es.js";
23
+ import He from "../../node_modules/rehype-highlight/lib/index.es.js";
24
+ import Pe from "../../node_modules/rehype-katex/lib/index.es.js";
25
+ import We from "../../node_modules/remark-gfm/lib/index.es.js";
26
+ import _e from "../../node_modules/remark-math/lib/index.es.js";
27
+ import Ee from "../../node_modules/remark-breaks/lib/index.es.js";
28
+ const qe = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)\b/i, me = ({ svg: t }) => {
29
+ const n = R(null);
30
+ return V(() => {
31
+ const s = n.current;
32
32
  if (!s) return;
33
- const a = s.shadowRoot ?? s.attachShadow({ mode: "open" }), T = "content-render-svg-style";
34
- let f = a.getElementById(T);
35
- f || (f = document.createElement("style"), f.id = T, f.textContent = `
33
+ const i = s.shadowRoot ?? s.attachShadow({ mode: "open" }), w = "content-render-svg-style";
34
+ let x = i.getElementById(w);
35
+ x || (x = document.createElement("style"), x.id = w, x.textContent = `
36
36
  svg { height: auto; display: inline-block; }
37
37
  svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
38
38
  svg.content-render-svg-el--fixed { max-width: none; }
39
- `, a.appendChild(f)), Array.from(a.childNodes).filter(
40
- (o) => o !== f
41
- ).forEach((o) => a.removeChild(o));
42
- const S = document.createElement("template"), $ = ke(r);
43
- S.innerHTML = $, a.append(S.content.cloneNode(!0));
44
- let x = !1, R = !1;
45
- a.querySelectorAll("svg").forEach((o) => {
46
- const L = o.getAttribute("viewBox");
47
- if (!L) return;
48
- const w = L.trim().split(/[\s,]+/).map((m) => Number(m));
49
- if (w.length !== 4 || w.some(Number.isNaN)) return;
50
- const [, , k, y] = w, j = o.getAttribute("width"), N = o.getAttribute("height"), M = (m) => {
39
+ `, i.appendChild(x)), Array.from(i.childNodes).filter(
40
+ (a) => a !== x
41
+ ).forEach((a) => i.removeChild(a));
42
+ const L = document.createElement("template"), z = Be(t);
43
+ L.innerHTML = z, i.append(L.content.cloneNode(!0));
44
+ let v = !1, A = !1;
45
+ i.querySelectorAll("svg").forEach((a) => {
46
+ const $ = a.getAttribute("viewBox");
47
+ if (!$) return;
48
+ const S = $.trim().split(/[\s,]+/).map((m) => Number(m));
49
+ if (S.length !== 4 || S.some(Number.isNaN)) return;
50
+ const [, , k, b] = S, B = a.getAttribute("width"), j = a.getAttribute("height"), D = (m) => {
51
51
  if (!m) return !1;
52
- const p = m.trim().toLowerCase();
53
- return p === "auto" || p.endsWith("%");
54
- }, F = (m) => {
52
+ const f = m.trim().toLowerCase();
53
+ return f === "auto" || f.endsWith("%");
54
+ }, I = (m) => {
55
55
  if (!m) return null;
56
- const p = m.trim().toLowerCase();
57
- if (p === "auto" || p.endsWith("%"))
56
+ const f = m.trim().toLowerCase();
57
+ if (f === "auto" || f.endsWith("%"))
58
58
  return null;
59
- const P = Number.parseFloat(p);
60
- return Number.isNaN(P) ? null : P;
61
- }, _ = M(j), E = M(N), I = !j || j === "0", V = !N || N === "0", H = F(j), D = F(N);
62
- if (_ || E || I && V || H === k && D === y) {
63
- x = !0, o.classList.add("content-render-svg-el--responsive"), o.classList.remove("content-render-svg-el--fixed"), o.style.width = "100%", o.style.height = "auto", !o.style.aspectRatio && y > 0 && (o.style.aspectRatio = `${k} / ${y}`);
59
+ const _ = Number.parseFloat(f);
60
+ return Number.isNaN(_) ? null : _;
61
+ }, E = D(B), q = D(j), F = !B || B === "0", H = !j || j === "0", P = I(B), W = I(j);
62
+ if (E || q || F && H || P === k && W === b) {
63
+ v = !0, a.classList.add("content-render-svg-el--responsive"), a.classList.remove("content-render-svg-el--fixed"), a.style.width = "100%", a.style.height = "auto", !a.style.aspectRatio && b > 0 && (a.style.aspectRatio = `${k} / ${b}`);
64
64
  return;
65
65
  }
66
- R = !0, o.classList.add("content-render-svg-el--fixed"), o.classList.remove("content-render-svg-el--responsive"), I && k > 0 && o.setAttribute("width", `${k}`), V && y > 0 && o.setAttribute("height", `${y}`);
66
+ A = !0, a.classList.add("content-render-svg-el--fixed"), a.classList.remove("content-render-svg-el--responsive"), F && k > 0 && a.setAttribute("width", `${k}`), H && b > 0 && a.setAttribute("height", `${b}`);
67
67
  });
68
- const z = x && !R;
69
- s.classList.toggle("content-render-svg--responsive", z), s.classList.toggle("content-render-svg--fixed", !z);
70
- }, [r]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: i }) });
71
- }, Ee = [
72
- De,
73
- Pe,
74
- Te,
75
- We
76
- ], Ge = [
77
- Be,
78
- Ie,
79
- we,
80
- Ce,
81
- [Ve, { languages: Re, subset: Se }],
82
- He
83
- ], ue = ({ content: r, components: i }) => /* @__PURE__ */ t.jsx("div", { className: "markdown-renderer", children: /* @__PURE__ */ t.jsx(
68
+ const M = v && !A;
69
+ s.classList.toggle("content-render-svg--responsive", M), s.classList.toggle("content-render-svg--fixed", !M);
70
+ }, [t]), /* @__PURE__ */ r.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ r.jsx("div", { className: "content-render-svg", ref: n }) });
71
+ }, Ge = [
72
+ We,
73
+ _e,
74
+ Se,
75
+ Ee
76
+ ], Ue = [
77
+ Ne,
84
78
  Fe,
79
+ ke,
80
+ Re,
81
+ [He, { languages: Ae, subset: Le }],
82
+ Pe
83
+ ], pe = ({ content: t, components: n }) => /* @__PURE__ */ r.jsx("div", { className: "markdown-renderer", children: /* @__PURE__ */ r.jsx(
84
+ Ie,
85
85
  {
86
- remarkPlugins: Ee,
87
- rehypePlugins: Ge,
88
- components: i,
89
- children: r
86
+ remarkPlugins: Ge,
87
+ rehypePlugins: Ue,
88
+ components: n,
89
+ children: t
90
90
  }
91
- ) }), Ue = (r) => {
92
- if (r.length <= 1) return r;
93
- const i = [];
94
- return r.forEach((s) => {
91
+ ) }), Ke = (t) => {
92
+ if (t.length <= 1) return t;
93
+ const n = [];
94
+ return t.forEach((s) => {
95
95
  if (s.type === "sandbox") {
96
- i.push(s);
96
+ n.push(s);
97
97
  return;
98
98
  }
99
- const a = i[i.length - 1];
100
- if (a && a.type !== "sandbox") {
101
- i[i.length - 1] = {
99
+ const i = n[n.length - 1];
100
+ if (i && i.type !== "sandbox") {
101
+ n[n.length - 1] = {
102
102
  type: "markdown",
103
- value: `${a.value}${s.value}`
103
+ value: `${i.value}${s.value}`
104
104
  };
105
105
  return;
106
106
  }
107
- i.push({ type: "markdown", value: s.value });
108
- }), i;
109
- }, qe = (r, i) => {
110
- const s = Math.max(1, i), a = Array.from(r);
107
+ n.push({ type: "markdown", value: s.value });
108
+ }), n;
109
+ }, Oe = (t, n) => {
110
+ const s = Math.max(1, n), i = Array.from(t);
111
111
  return {
112
- chunk: a.slice(0, s).join(""),
113
- rest: a.slice(s).join("")
112
+ chunk: i.slice(0, s).join(""),
113
+ rest: i.slice(s).join("")
114
114
  };
115
- }, Tt = ({
116
- content: r,
117
- contentType: i,
115
+ }, Xe = (t, n) => t === n ? !0 : !t || !n || t.length !== n.length ? !1 : t.every((s, i) => s === n[i]), Je = (t) => {
116
+ const n = R(t);
117
+ return Xe(n.current, t) || (n.current = t), n.current;
118
+ }, Bt = ({
119
+ content: t,
120
+ contentType: n,
118
121
  locale: s,
119
- customRenderBar: a,
120
- onSend: T,
121
- typingSpeed: f = 40,
122
- enableTypewriter: Q = !1,
123
- onTypeFinished: S,
124
- onTypewriterStateChange: $,
125
- userInput: x,
126
- interactionDefaultValueOptions: R,
127
- defaultButtonText: z,
128
- defaultInputText: o,
129
- defaultSelectedValues: L,
130
- readonly: w = !1,
122
+ customRenderBar: i,
123
+ onSend: w,
124
+ typingSpeed: x = 40,
125
+ enableTypewriter: Y = !1,
126
+ onTypeFinished: L,
127
+ onTypewriterStateChange: z,
128
+ userInput: v,
129
+ interactionDefaultValueOptions: A,
130
+ defaultButtonText: M,
131
+ defaultInputText: a,
132
+ defaultSelectedValues: $,
133
+ readonly: S = !1,
131
134
  confirmButtonText: k,
132
- copyButtonText: y,
133
- copiedButtonText: j,
134
- sandboxLoadingText: N,
135
- sandboxStyleLoadingText: M,
136
- sandboxScriptLoadingText: F,
137
- disableSandboxLoadingOverlay: _ = !1,
138
- sandboxFullscreenButtonText: E,
139
- sandboxExitFullscreenButtonText: I,
140
- sandboxMode: V = "content",
141
- onClickCustomButtonAfterContent: H,
142
- beforeSend: D
135
+ copyButtonText: b,
136
+ copiedButtonText: B,
137
+ sandboxLoadingText: j,
138
+ sandboxStyleLoadingText: D,
139
+ sandboxScriptLoadingText: I,
140
+ disableSandboxLoadingOverlay: E = !1,
141
+ sandboxFullscreenButtonText: q,
142
+ sandboxExitFullscreenButtonText: F,
143
+ sandboxMode: H = "content",
144
+ onClickCustomButtonAfterContent: P,
145
+ beforeSend: W
143
146
  // tooltipMinLength,
144
147
  }) => {
145
- const B = Me(s), G = k || B.confirmButtonText, m = y || B.copyButtonText, p = j || B.copiedButtonText, P = E || B.sandboxFullscreenButtonText, pe = I || B.sandboxExitFullscreenButtonText, l = !!Q && (!i || i === "text"), Y = 2, Z = Math.max(0, f), [g, U] = be(
146
- () => l ? "" : r
147
- ), b = W(""), ee = W(l), q = W(!1);
148
- A(() => {
149
- const e = ee.current;
150
- if (ee.current = l, q.current = !1, !l) {
151
- b.current = "", U(r);
148
+ const C = De(s), G = k || C.confirmButtonText, m = b || C.copyButtonText, f = B || C.copiedButtonText, _ = q || C.sandboxFullscreenButtonText, fe = F || C.sandboxExitFullscreenButtonText, l = !!Y && (!n || n === "text"), Z = 2, ee = Math.max(0, x), [y, U] = we(
149
+ () => l ? "" : t
150
+ ), T = R(""), te = R(l), K = R(!1);
151
+ V(() => {
152
+ const e = te.current;
153
+ if (te.current = l, K.current = !1, !l) {
154
+ T.current = "", U(t);
152
155
  return;
153
156
  }
154
- U((n) => {
155
- const c = !e, v = r.startsWith(n);
156
- if (!c && !v)
157
- return b.current = "", r;
158
- const d = c || !v ? "" : n;
159
- return b.current = r.slice(d.length), d;
157
+ U((o) => {
158
+ const c = !e, g = t.startsWith(o);
159
+ if (!c && !g)
160
+ return T.current = "", t;
161
+ const d = c || !g ? "" : o;
162
+ return T.current = t.slice(d.length), d;
160
163
  });
161
- }, [r, l]), A(() => {
162
- l && (q.current || b.current || g !== r || (q.current = !0, S?.()));
163
- }, [r, g, l, S]), A(() => {
164
- if (!l || !b.current)
164
+ }, [t, l]), V(() => {
165
+ l && (K.current || T.current || y !== t || (K.current = !0, L?.()));
166
+ }, [t, y, l, L]), V(() => {
167
+ if (!l || !T.current)
165
168
  return;
166
169
  const e = window.setTimeout(() => {
167
- U((n) => {
168
- const { chunk: c, rest: v } = qe(
169
- b.current,
170
- Y
170
+ U((o) => {
171
+ const { chunk: c, rest: g } = Oe(
172
+ T.current,
173
+ Z
171
174
  );
172
- return c ? (b.current = v, `${n}${c}`) : n;
175
+ return c ? (T.current = g, `${o}${c}`) : o;
173
176
  });
174
- }, Z);
177
+ }, ee);
175
178
  return () => window.clearTimeout(e);
176
179
  }, [
177
- r,
178
- g,
180
+ t,
181
+ y,
179
182
  l,
180
- Y,
181
- Z
183
+ Z,
184
+ ee
182
185
  ]);
183
- const te = h(
186
+ const re = h(
184
187
  () => ({
185
188
  isTypewriterEnabled: l,
186
- isTyping: l && g !== r,
187
- isComplete: g === r,
188
- renderedLength: g.length,
189
- totalLength: r.length
189
+ isTyping: l && y !== t,
190
+ isComplete: y === t,
191
+ renderedLength: y.length,
192
+ totalLength: t.length
190
193
  }),
191
- [r, g, l]
194
+ [t, y, l]
192
195
  );
193
- A(() => {
194
- $?.(te);
195
- }, [$, te]);
196
- const u = l ? g : r, K = h(
197
- () => de(u),
198
- [u]
199
- ), O = h(
200
- () => ze(
201
- u,
202
- x,
203
- R
196
+ V(() => {
197
+ z?.(re);
198
+ }, [z, re]);
199
+ const p = l ? y : t, O = h(
200
+ () => de(p),
201
+ [p]
202
+ ), X = h(
203
+ () => Me(
204
+ p,
205
+ v,
206
+ A
204
207
  ),
205
- [R, u, x]
206
- ), re = z?.trim() || O.buttonText, ne = o?.trim() || O.inputText, he = h(
207
- () => x ? x.split(",").map((e) => e.trim()).filter(Boolean) : void 0,
208
- [x]
209
- ), oe = L?.length ? L : O.selectedValues || he, se = h(
208
+ [A, p, v]
209
+ ), ne = M?.trim() || X.buttonText, oe = a?.trim() || X.inputText, he = h(
210
+ () => v ? v.split(",").map((e) => e.trim()).filter(Boolean) : void 0,
211
+ [v]
212
+ ), xe = $?.length ? $ : X.selectedValues || he, se = Je(
213
+ xe
214
+ ), u = R({
215
+ beforeSend: W,
216
+ locale: s,
217
+ onClickCustomButtonAfterContent: P,
218
+ onSend: w,
219
+ readonly: S,
220
+ renderContent: p,
221
+ resolvedConfirmButtonText: G,
222
+ resolvedCopiedButtonText: f,
223
+ resolvedCopyButtonText: m,
224
+ resolvedDefaultButtonText: ne,
225
+ resolvedDefaultInputText: oe,
226
+ resolvedDefaultSelectedValues: se
227
+ });
228
+ u.current = {
229
+ beforeSend: W,
230
+ locale: s,
231
+ onClickCustomButtonAfterContent: P,
232
+ onSend: w,
233
+ readonly: S,
234
+ renderContent: p,
235
+ resolvedConfirmButtonText: G,
236
+ resolvedCopiedButtonText: f,
237
+ resolvedCopyButtonText: m,
238
+ resolvedDefaultButtonText: ne,
239
+ resolvedDefaultInputText: oe,
240
+ resolvedDefaultSelectedValues: se
241
+ };
242
+ const ae = h(
210
243
  () => ({
211
244
  "custom-button-after-content": ({
212
245
  children: e
213
- }) => /* @__PURE__ */ t.jsx(
246
+ }) => /* @__PURE__ */ r.jsx(
214
247
  "button",
215
248
  {
216
249
  className: "content-render-custom-button-after-content",
217
- onClick: H,
218
- children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
250
+ onClick: u.current.onClickCustomButtonAfterContent,
251
+ children: /* @__PURE__ */ r.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
219
252
  }
220
253
  ),
221
- "custom-variable": (e) => /* @__PURE__ */ t.jsx(
222
- Ne,
254
+ "custom-variable": (e) => /* @__PURE__ */ r.jsx(
255
+ Ce,
223
256
  {
224
257
  ...e,
225
- readonly: w,
226
- defaultButtonText: re,
227
- defaultInputText: ne,
228
- defaultSelectedValues: oe,
229
- onSend: T,
230
- beforeSend: D,
231
- locale: s,
232
- confirmButtonText: G
258
+ readonly: u.current.readonly,
259
+ defaultButtonText: u.current.resolvedDefaultButtonText,
260
+ defaultInputText: u.current.resolvedDefaultInputText,
261
+ defaultSelectedValues: u.current.resolvedDefaultSelectedValues,
262
+ onSend: u.current.onSend,
263
+ beforeSend: u.current.beforeSend,
264
+ locale: u.current.locale,
265
+ confirmButtonText: u.current.resolvedConfirmButtonText
233
266
  }
234
267
  ),
235
268
  code: (e) => {
236
- const { className: n, children: c, ...v } = e;
237
- if (/language-(\w+)/.exec(n || "")?.[1] === "mermaid") {
238
- const C = c?.toString().replace(/\n$/, "") || "", ye = Le(u, C);
239
- return /* @__PURE__ */ t.jsx(J, { chart: C, frozen: ye });
269
+ const { className: o, children: c, ...g } = e;
270
+ if (/language-(\w+)/.exec(o || "")?.[1] === "mermaid") {
271
+ const N = c?.toString().replace(/\n$/, "") || "", Te = $e(
272
+ u.current.renderContent,
273
+ N
274
+ );
275
+ return /* @__PURE__ */ r.jsx(Q, { chart: N, frozen: Te });
240
276
  }
241
- return /* @__PURE__ */ t.jsx("code", { className: n, ...v, children: c });
277
+ return /* @__PURE__ */ r.jsx("code", { className: o, ...g, children: c });
242
278
  },
243
- table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
244
- th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
245
- td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
246
- tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
247
- li: ({ node: e, ...n }) => {
279
+ table: ({ ...e }) => /* @__PURE__ */ r.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ r.jsx("table", { className: "content-render-table", ...e }) }),
280
+ th: ({ ...e }) => /* @__PURE__ */ r.jsx("th", { className: "content-render-th", ...e }),
281
+ td: ({ ...e }) => /* @__PURE__ */ r.jsx("td", { className: "content-render-td", ...e }),
282
+ tr: ({ ...e }) => /* @__PURE__ */ r.jsx("tr", { className: "content-render-tr", ...e }),
283
+ li: ({ node: e, ...o }) => {
248
284
  const c = e?.properties?.className;
249
- return typeof c == "string" && c.includes("task-list-item") || Array.isArray(c) && c.includes("task-list-item") ? /* @__PURE__ */ t.jsx("li", { className: "content-render-task-list-item", ...n }) : /* @__PURE__ */ t.jsx("li", { ...n });
285
+ return typeof c == "string" && c.includes("task-list-item") || Array.isArray(c) && c.includes("task-list-item") ? /* @__PURE__ */ r.jsx("li", { className: "content-render-task-list-item", ...o }) : /* @__PURE__ */ r.jsx("li", { ...o });
250
286
  },
251
- ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
252
- ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
253
- input: ({ ...e }) => e.type === "checkbox" ? /* @__PURE__ */ t.jsx(
287
+ ol: ({ ...e }) => /* @__PURE__ */ r.jsx("ol", { className: "content-render-ol", ...e }),
288
+ ul: ({ ...e }) => /* @__PURE__ */ r.jsx("ul", { className: "content-render-ul", ...e }),
289
+ input: ({ ...e }) => e.type === "checkbox" ? /* @__PURE__ */ r.jsx(
254
290
  "input",
255
291
  {
256
292
  type: "checkbox",
@@ -258,110 +294,97 @@ const _e = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
258
294
  disabled: !0,
259
295
  ...e
260
296
  }
261
- ) : /* @__PURE__ */ t.jsx("input", { ...e }),
262
- a: ({ children: e, ...n }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
263
- pre: (e) => /* @__PURE__ */ t.jsx(
297
+ ) : /* @__PURE__ */ r.jsx("input", { ...e }),
298
+ a: ({ children: e, ...o }) => /* @__PURE__ */ r.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...o, children: e }),
299
+ pre: (e) => /* @__PURE__ */ r.jsx(
264
300
  je,
265
301
  {
266
302
  ...e,
267
- copyButtonText: m,
268
- copiedButtonText: p
303
+ copyButtonText: u.current.resolvedCopyButtonText,
304
+ copiedButtonText: u.current.resolvedCopiedButtonText
269
305
  }
270
306
  )
271
307
  }),
272
- [
273
- D,
274
- s,
275
- H,
276
- T,
277
- w,
278
- u,
279
- G,
280
- p,
281
- m,
282
- re,
283
- ne,
284
- oe
285
- ]
308
+ []
286
309
  ), ie = h(
287
- () => _e.test(u),
288
- [u]
289
- ), X = h(
290
- () => ie ? $e(u, !0) : [],
291
- [u, ie]
292
- ), fe = X.some(
310
+ () => qe.test(p),
311
+ [p]
312
+ ), J = h(
313
+ () => ie ? ze(p, !0) : [],
314
+ [p, ie]
315
+ ), ve = J.some(
293
316
  (e) => e.type === "sandbox"
294
- ), xe = h(
295
- () => Ue(X),
296
- [X]
317
+ ), ye = h(
318
+ () => Ke(J),
319
+ [J]
297
320
  ), ge = h(
298
- () => le(K),
299
- [K]
300
- ), ve = (e, n) => {
321
+ () => ue(O),
322
+ [O]
323
+ ), be = (e, o) => {
301
324
  const c = de(e);
302
- return le(c).map((d, ae) => {
303
- const C = `${n}-${d.type}-${ae}`;
304
- return d.type === "text" ? /* @__PURE__ */ t.jsx(
305
- ue,
325
+ return ue(c).map((d, ce) => {
326
+ const N = `${o}-${d.type}-${ce}`;
327
+ return d.type === "text" ? /* @__PURE__ */ r.jsx(
328
+ pe,
306
329
  {
307
- components: se,
330
+ components: ae,
308
331
  content: d.value
309
332
  },
310
- C
311
- ) : d.type === "mermaid" ? /* @__PURE__ */ t.jsx(J, { chart: d.value, frozen: !d.complete }, C) : d.type === "svg" ? /* @__PURE__ */ t.jsx(me, { svg: d.value }, C) : null;
333
+ N
334
+ ) : d.type === "mermaid" ? /* @__PURE__ */ r.jsx(Q, { chart: d.value, frozen: !d.complete }, N) : d.type === "svg" ? /* @__PURE__ */ r.jsx(me, { svg: d.value }, N) : null;
312
335
  });
313
336
  };
314
- return fe ? /* @__PURE__ */ t.jsx("div", { className: "content-render markdown-body", children: xe.map(
315
- (e, n) => e.type === "sandbox" ? /* @__PURE__ */ t.jsx(
316
- Ae,
337
+ return ve ? /* @__PURE__ */ r.jsx("div", { className: "content-render markdown-body", children: ye.map(
338
+ (e, o) => e.type === "sandbox" ? /* @__PURE__ */ r.jsx(
339
+ Ve,
317
340
  {
318
341
  hideFullScreen: !0,
319
342
  type: "sandbox",
320
343
  content: e.value,
321
344
  className: "content-render-iframe",
322
345
  locale: s,
323
- loadingText: N,
324
- styleLoadingText: M,
325
- scriptLoadingText: F,
326
- disableLoadingOverlay: _,
327
- fullScreenButtonText: P,
328
- exitFullScreenButtonText: pe,
329
- mode: V
346
+ loadingText: j,
347
+ styleLoadingText: D,
348
+ scriptLoadingText: I,
349
+ disableLoadingOverlay: E,
350
+ fullScreenButtonText: _,
351
+ exitFullScreenButtonText: fe,
352
+ mode: H
330
353
  },
331
- `sandbox-${n}`
332
- ) : /* @__PURE__ */ t.jsx(ce.Fragment, { children: ve(e.value, `md-${n}`) }, `md-${n}`)
333
- ) }) : /* @__PURE__ */ t.jsxs("div", { className: "content-render markdown-body", children: [
334
- ge.map((e, n) => {
354
+ `sandbox-${o}`
355
+ ) : /* @__PURE__ */ r.jsx(le.Fragment, { children: be(e.value, `md-${o}`) }, `md-${o}`)
356
+ ) }) : /* @__PURE__ */ r.jsxs("div", { className: "content-render markdown-body", children: [
357
+ ge.map((e, o) => {
335
358
  if (e.type === "text")
336
- return /* @__PURE__ */ t.jsx(
337
- ue,
359
+ return /* @__PURE__ */ r.jsx(
360
+ pe,
338
361
  {
339
- components: se,
362
+ components: ae,
340
363
  content: e.value
341
364
  },
342
- n
365
+ o
343
366
  );
344
367
  if (e.type === "mermaid")
345
- return /* @__PURE__ */ t.jsx(
346
- J,
368
+ return /* @__PURE__ */ r.jsx(
369
+ Q,
347
370
  {
348
371
  chart: e.value,
349
372
  frozen: !e.complete
350
373
  },
351
- n
374
+ o
352
375
  );
353
376
  if (e.type === "svg")
354
- return /* @__PURE__ */ t.jsx(me, { svg: e.value }, n);
377
+ return /* @__PURE__ */ r.jsx(me, { svg: e.value }, o);
355
378
  }),
356
- a && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: ce.createElement(a, {
357
- content: r,
358
- displayContent: K,
359
- onSend: T
379
+ i && /* @__PURE__ */ r.jsx("div", { className: "content-render-custom-bar", children: le.createElement(i, {
380
+ content: t,
381
+ displayContent: O,
382
+ onSend: w
360
383
  }) })
361
384
  ] });
362
385
  };
363
386
  export {
364
- ue as MarkdownRenderer,
365
- Tt as default
387
+ pe as MarkdownRenderer,
388
+ Bt as default
366
389
  };
367
390
  //# sourceMappingURL=ContentRender.es.js.map