markdown-flow-ui 0.2.5 → 0.2.7-dev.1

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