markdown-flow-ui 0.1.115-beta.0 → 0.1.115
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.
- package/dist/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.es.js +187 -206
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.js +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +76 -91
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
- package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,89 +1,89 @@
|
|
|
1
1
|
import { j as t } from "../../_virtual/jsx-runtime.es.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { sanitizeInvalidTagName as
|
|
7
|
-
import { stripSvgTextLineBreaks as
|
|
4
|
+
import X, { useMemo as h, useRef as E, useEffect as F } from "react";
|
|
5
|
+
import se from "../../_virtual/index.es.js";
|
|
6
|
+
import { sanitizeInvalidTagName as oe } from "./utils/sanitize-invalid-tag-name.es.js";
|
|
7
|
+
import { stripSvgTextLineBreaks as ae } from "./utils/strip-svg-text-line-breaks.es.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { preserveCustomVariableProperties as
|
|
15
|
-
import { subsetLanguages as
|
|
16
|
-
import {
|
|
17
|
-
import { normalizeInlineHtml as
|
|
18
|
-
import
|
|
19
|
-
import { splitContentSegments as
|
|
20
|
-
import { getInteractionDefaultValues as
|
|
21
|
-
import { Markdown as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
const
|
|
29
|
-
const o =
|
|
30
|
-
return
|
|
10
|
+
import ie from "./CodeBlock.es.js";
|
|
11
|
+
import le from "./plugins/CustomVariable.es.js";
|
|
12
|
+
import W from "./plugins/MermaidChart.es.js";
|
|
13
|
+
import ce from "./useTypewriterStateMachine.es.js";
|
|
14
|
+
import { preserveCustomVariableProperties as me, restoreCustomVariableProperties as de } from "./utils/custom-variable-props.es.js";
|
|
15
|
+
import { subsetLanguages as ue, highlightLanguages as pe } from "./utils/highlight-languages.es.js";
|
|
16
|
+
import { parseMarkdownSegments as J, mermaidBlockIsComplete as he } from "./utils/mermaid-parse.es.js";
|
|
17
|
+
import { normalizeInlineHtml as Q } from "./utils/normalize-inline-html.es.js";
|
|
18
|
+
import fe from "./IframeSandbox.es.js";
|
|
19
|
+
import { splitContentSegments as xe } from "./utils/split-content.es.js";
|
|
20
|
+
import { getInteractionDefaultValues as ve } from "../../lib/interaction-defaults.es.js";
|
|
21
|
+
import { Markdown as ge } from "../../markdown-flow-ui/node_modules/.pnpm/react-markdown@10.1.0_@types_react@19.2.2_react@19.0.1/node_modules/react-markdown/lib/index.es.js";
|
|
22
|
+
import be from "../../markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.es.js";
|
|
23
|
+
import ye from "../../markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.es.js";
|
|
24
|
+
import Ne from "../../markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.es.js";
|
|
25
|
+
import je from "../../markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.es.js";
|
|
26
|
+
import ke from "../../markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.es.js";
|
|
27
|
+
import we from "../../markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.es.js";
|
|
28
|
+
const Se = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)\b/i, Y = ({ svg: r }) => {
|
|
29
|
+
const o = E(null);
|
|
30
|
+
return F(() => {
|
|
31
31
|
const a = o.current;
|
|
32
32
|
if (!a) return;
|
|
33
|
-
const i = a.shadowRoot ?? a.attachShadow({ mode: "open" }),
|
|
34
|
-
let l = i.getElementById(
|
|
35
|
-
l || (l = document.createElement("style"), l.id =
|
|
33
|
+
const i = a.shadowRoot ?? a.attachShadow({ mode: "open" }), y = "content-render-svg-style";
|
|
34
|
+
let l = i.getElementById(y);
|
|
35
|
+
l || (l = document.createElement("style"), l.id = y, l.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
39
|
`, i.appendChild(l)), Array.from(i.childNodes).filter(
|
|
40
40
|
(n) => n !== l
|
|
41
41
|
).forEach((n) => i.removeChild(n));
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
let
|
|
42
|
+
const T = document.createElement("template"), z = ae(r);
|
|
43
|
+
T.innerHTML = z, i.append(T.content.cloneNode(!0));
|
|
44
|
+
let N = !1, C = !1;
|
|
45
45
|
i.querySelectorAll("svg").forEach((n) => {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
const [, ,
|
|
46
|
+
const L = n.getAttribute("viewBox");
|
|
47
|
+
if (!L) return;
|
|
48
|
+
const k = L.trim().split(/[\s,]+/).map((c) => Number(c));
|
|
49
|
+
if (k.length !== 4 || k.some(Number.isNaN)) return;
|
|
50
|
+
const [, , f, p] = k, x = n.getAttribute("width"), v = n.getAttribute("height"), B = (c) => {
|
|
51
51
|
if (!c) return !1;
|
|
52
52
|
const m = c.trim().toLowerCase();
|
|
53
53
|
return m === "auto" || m.endsWith("%");
|
|
54
|
-
},
|
|
54
|
+
}, A = (c) => {
|
|
55
55
|
if (!c) return null;
|
|
56
56
|
const m = c.trim().toLowerCase();
|
|
57
57
|
if (m === "auto" || m.endsWith("%"))
|
|
58
58
|
return null;
|
|
59
|
-
const
|
|
60
|
-
return Number.isNaN(
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
|
|
59
|
+
const S = Number.parseFloat(m);
|
|
60
|
+
return Number.isNaN(S) ? null : S;
|
|
61
|
+
}, M = B(x), I = B(v), w = !x || x === "0", g = !v || v === "0", V = A(x), H = A(v);
|
|
62
|
+
if (M || I || w && g || V === f && H === p) {
|
|
63
|
+
N = !0, n.classList.add("content-render-svg-el--responsive"), n.classList.remove("content-render-svg-el--fixed"), n.style.width = "100%", n.style.height = "auto", !n.style.aspectRatio && p > 0 && (n.style.aspectRatio = `${f} / ${p}`);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
C = !0, n.classList.add("content-render-svg-el--fixed"), n.classList.remove("content-render-svg-el--responsive"), w && f > 0 && n.setAttribute("width", `${f}`), g && p > 0 && n.setAttribute("height", `${p}`);
|
|
67
67
|
});
|
|
68
|
-
const
|
|
69
|
-
a.classList.toggle("content-render-svg--responsive",
|
|
68
|
+
const j = N && !C;
|
|
69
|
+
a.classList.toggle("content-render-svg--responsive", j), a.classList.toggle("content-render-svg--fixed", !j);
|
|
70
70
|
}, [r]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: o }) });
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[
|
|
77
|
-
|
|
78
|
-
],
|
|
79
|
-
|
|
71
|
+
}, Re = [je, ke, se, we], Te = [
|
|
72
|
+
me,
|
|
73
|
+
be,
|
|
74
|
+
oe,
|
|
75
|
+
de,
|
|
76
|
+
[ye, { languages: pe, subset: ue }],
|
|
77
|
+
Ne
|
|
78
|
+
], Z = ({ content: r, components: o }) => /* @__PURE__ */ t.jsx("div", { className: "markdown-renderer", children: /* @__PURE__ */ t.jsx(
|
|
79
|
+
ge,
|
|
80
80
|
{
|
|
81
|
-
remarkPlugins:
|
|
82
|
-
rehypePlugins:
|
|
81
|
+
remarkPlugins: Re,
|
|
82
|
+
rehypePlugins: Te,
|
|
83
83
|
components: o,
|
|
84
84
|
children: r
|
|
85
85
|
}
|
|
86
|
-
) }),
|
|
86
|
+
) }), Ce = (r) => {
|
|
87
87
|
if (r.length <= 1) return r;
|
|
88
88
|
const o = [];
|
|
89
89
|
return r.forEach((a) => {
|
|
@@ -101,195 +101,176 @@ const Le = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
|
|
|
101
101
|
}
|
|
102
102
|
o.push({ type: "markdown", value: a.value });
|
|
103
103
|
}), o;
|
|
104
|
-
},
|
|
104
|
+
}, rt = ({
|
|
105
105
|
content: r,
|
|
106
106
|
customRenderBar: o,
|
|
107
107
|
onSend: a,
|
|
108
108
|
typingSpeed: i = 30,
|
|
109
|
-
enableTypewriter:
|
|
109
|
+
enableTypewriter: y = !1,
|
|
110
110
|
userInput: l,
|
|
111
|
-
interactionDefaultValueOptions:
|
|
112
|
-
defaultButtonText:
|
|
113
|
-
defaultInputText:
|
|
114
|
-
defaultSelectedValues:
|
|
115
|
-
readonly:
|
|
116
|
-
onTypeFinished:
|
|
111
|
+
interactionDefaultValueOptions: $,
|
|
112
|
+
defaultButtonText: T,
|
|
113
|
+
defaultInputText: z,
|
|
114
|
+
defaultSelectedValues: N,
|
|
115
|
+
readonly: C = !1,
|
|
116
|
+
onTypeFinished: j,
|
|
117
117
|
confirmButtonText: n,
|
|
118
|
-
copyButtonText:
|
|
119
|
-
copiedButtonText:
|
|
120
|
-
sandboxLoadingText:
|
|
118
|
+
copyButtonText: L,
|
|
119
|
+
copiedButtonText: k,
|
|
120
|
+
sandboxLoadingText: f,
|
|
121
121
|
sandboxStyleLoadingText: p,
|
|
122
|
-
sandboxScriptLoadingText:
|
|
123
|
-
disableSandboxLoadingOverlay:
|
|
124
|
-
sandboxFullscreenButtonText:
|
|
125
|
-
sandboxMode:
|
|
126
|
-
onClickCustomButtonAfterContent:
|
|
127
|
-
beforeSend:
|
|
122
|
+
sandboxScriptLoadingText: x,
|
|
123
|
+
disableSandboxLoadingOverlay: v = !1,
|
|
124
|
+
sandboxFullscreenButtonText: B,
|
|
125
|
+
sandboxMode: A = "content",
|
|
126
|
+
onClickCustomButtonAfterContent: M,
|
|
127
|
+
beforeSend: I
|
|
128
128
|
// tooltipMinLength,
|
|
129
129
|
}) => {
|
|
130
|
-
const
|
|
131
|
-
() =>
|
|
130
|
+
const w = h(
|
|
131
|
+
() => Q(r),
|
|
132
132
|
[r]
|
|
133
|
-
),
|
|
134
|
-
() =>
|
|
133
|
+
), g = h(
|
|
134
|
+
() => ve(
|
|
135
135
|
r,
|
|
136
136
|
l,
|
|
137
|
-
|
|
137
|
+
$
|
|
138
138
|
),
|
|
139
|
-
[r,
|
|
140
|
-
),
|
|
139
|
+
[r, $, l]
|
|
140
|
+
), V = T?.trim() || g.buttonText, H = z?.trim() || g.inputText, G = h(
|
|
141
141
|
() => l ? l.split(",").map((e) => e.trim()).filter(Boolean) : void 0,
|
|
142
142
|
[l]
|
|
143
|
-
),
|
|
144
|
-
(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
copyButtonText: S,
|
|
205
|
-
copiedButtonText: f
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
}),
|
|
209
|
-
[
|
|
210
|
-
z,
|
|
211
|
-
n,
|
|
212
|
-
r,
|
|
213
|
-
f,
|
|
214
|
-
S,
|
|
215
|
-
$,
|
|
216
|
-
a,
|
|
217
|
-
k,
|
|
218
|
-
M,
|
|
219
|
-
I,
|
|
220
|
-
m
|
|
221
|
-
]
|
|
222
|
-
), { displayContent: U, isComplete: q } = de({
|
|
143
|
+
), U = N?.length ? N : g.selectedValues || G, c = {
|
|
144
|
+
"custom-button-after-content": ({
|
|
145
|
+
children: e
|
|
146
|
+
}) => /* @__PURE__ */ t.jsx(
|
|
147
|
+
"button",
|
|
148
|
+
{
|
|
149
|
+
className: "content-render-custom-button-after-content",
|
|
150
|
+
onClick: M,
|
|
151
|
+
children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
"custom-variable": (e) => /* @__PURE__ */ t.jsx(
|
|
155
|
+
le,
|
|
156
|
+
{
|
|
157
|
+
...e,
|
|
158
|
+
readonly: C,
|
|
159
|
+
defaultButtonText: V,
|
|
160
|
+
defaultInputText: H,
|
|
161
|
+
defaultSelectedValues: U,
|
|
162
|
+
onSend: a,
|
|
163
|
+
beforeSend: I,
|
|
164
|
+
confirmButtonText: n
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
code: (e) => {
|
|
168
|
+
const { className: s, children: d, ..._ } = e;
|
|
169
|
+
if (/language-(\w+)/.exec(s || "")?.[1] === "mermaid") {
|
|
170
|
+
const b = d?.toString().replace(/\n$/, "") || "", ne = he(r, b);
|
|
171
|
+
return /* @__PURE__ */ t.jsx(W, { chart: b, frozen: ne });
|
|
172
|
+
}
|
|
173
|
+
return /* @__PURE__ */ t.jsx("code", { className: s, ..._, children: d });
|
|
174
|
+
},
|
|
175
|
+
table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
|
|
176
|
+
th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
|
|
177
|
+
td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
|
|
178
|
+
tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
|
|
179
|
+
li: ({ node: e, ...s }) => {
|
|
180
|
+
const d = e?.properties?.className;
|
|
181
|
+
return typeof d == "string" && d.includes("task-list-item") || Array.isArray(d) && d.includes("task-list-item") ? /* @__PURE__ */ t.jsx("li", { className: "content-render-task-list-item", ...s }) : /* @__PURE__ */ t.jsx("li", { ...s });
|
|
182
|
+
},
|
|
183
|
+
ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
|
|
184
|
+
ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
|
|
185
|
+
input: ({ ...e }) => e.type === "checkbox" ? /* @__PURE__ */ t.jsx(
|
|
186
|
+
"input",
|
|
187
|
+
{
|
|
188
|
+
type: "checkbox",
|
|
189
|
+
className: "content-render-checkbox",
|
|
190
|
+
disabled: !0,
|
|
191
|
+
...e
|
|
192
|
+
}
|
|
193
|
+
) : /* @__PURE__ */ t.jsx("input", { ...e }),
|
|
194
|
+
a: ({ children: e, ...s }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...s, children: e }),
|
|
195
|
+
pre: (e) => /* @__PURE__ */ t.jsx(
|
|
196
|
+
ie,
|
|
197
|
+
{
|
|
198
|
+
...e,
|
|
199
|
+
copyButtonText: L,
|
|
200
|
+
copiedButtonText: k
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
}, { displayContent: m, isComplete: S } = ce({
|
|
223
204
|
// processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
|
|
224
205
|
// content: processMarkdownText(content),
|
|
225
|
-
content:
|
|
206
|
+
content: w,
|
|
226
207
|
typingSpeed: i,
|
|
227
|
-
disabled: !
|
|
228
|
-
}),
|
|
229
|
-
() =>
|
|
208
|
+
disabled: !y
|
|
209
|
+
}), q = y ? m : w, K = h(
|
|
210
|
+
() => Se.test(r),
|
|
230
211
|
[r]
|
|
231
|
-
),
|
|
232
|
-
() =>
|
|
233
|
-
[r,
|
|
234
|
-
),
|
|
212
|
+
), D = h(
|
|
213
|
+
() => K ? xe(r, !0) : [],
|
|
214
|
+
[r, K]
|
|
215
|
+
), R = D.some(
|
|
235
216
|
(e) => e.type === "sandbox"
|
|
236
|
-
),
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
242
|
-
),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}, [
|
|
246
|
-
|
|
247
|
-
}, [
|
|
248
|
-
const
|
|
249
|
-
const d =
|
|
250
|
-
return
|
|
251
|
-
const
|
|
217
|
+
), ee = h(
|
|
218
|
+
() => Ce(D),
|
|
219
|
+
[D]
|
|
220
|
+
), te = h(
|
|
221
|
+
() => J(q),
|
|
222
|
+
[q]
|
|
223
|
+
), P = E(!1);
|
|
224
|
+
F(() => {
|
|
225
|
+
R || S && !P.current && (P.current = !0, j?.());
|
|
226
|
+
}, [R, S, j]), F(() => {
|
|
227
|
+
R || (P.current = !1);
|
|
228
|
+
}, [R, r]);
|
|
229
|
+
const re = (e, s) => {
|
|
230
|
+
const d = Q(e);
|
|
231
|
+
return J(d).map((u, O) => {
|
|
232
|
+
const b = `${s}-${u.type}-${O}`;
|
|
252
233
|
return u.type === "text" ? /* @__PURE__ */ t.jsx(
|
|
253
|
-
|
|
234
|
+
Z,
|
|
254
235
|
{
|
|
255
|
-
components:
|
|
236
|
+
components: c,
|
|
256
237
|
content: u.value
|
|
257
238
|
},
|
|
258
|
-
|
|
259
|
-
) : u.type === "mermaid" ? /* @__PURE__ */ t.jsx(
|
|
239
|
+
b
|
|
240
|
+
) : u.type === "mermaid" ? /* @__PURE__ */ t.jsx(W, { chart: u.value, frozen: !u.complete }, b) : u.type === "svg" ? /* @__PURE__ */ t.jsx(Y, { svg: u.value }, b) : null;
|
|
260
241
|
});
|
|
261
242
|
};
|
|
262
|
-
return
|
|
243
|
+
return R ? /* @__PURE__ */ t.jsx("div", { className: "content-render markdown-body", children: ee.map(
|
|
263
244
|
(e, s) => e.type === "sandbox" ? /* @__PURE__ */ t.jsx(
|
|
264
|
-
|
|
245
|
+
fe,
|
|
265
246
|
{
|
|
266
247
|
hideFullScreen: !0,
|
|
267
248
|
type: "sandbox",
|
|
268
249
|
content: e.value,
|
|
269
250
|
className: "content-render-iframe",
|
|
270
|
-
loadingText:
|
|
251
|
+
loadingText: f,
|
|
271
252
|
styleLoadingText: p,
|
|
272
|
-
scriptLoadingText:
|
|
273
|
-
disableLoadingOverlay:
|
|
274
|
-
fullScreenButtonText:
|
|
275
|
-
mode:
|
|
253
|
+
scriptLoadingText: x,
|
|
254
|
+
disableLoadingOverlay: v,
|
|
255
|
+
fullScreenButtonText: B,
|
|
256
|
+
mode: A
|
|
276
257
|
},
|
|
277
258
|
`sandbox-${s}`
|
|
278
|
-
) : /* @__PURE__ */ t.jsx(
|
|
259
|
+
) : /* @__PURE__ */ t.jsx(X.Fragment, { children: re(e.value, `md-${s}`) }, `md-${s}`)
|
|
279
260
|
) }) : /* @__PURE__ */ t.jsxs("div", { className: "content-render markdown-body", children: [
|
|
280
|
-
|
|
261
|
+
te.map((e, s) => {
|
|
281
262
|
if (e.type === "text")
|
|
282
263
|
return /* @__PURE__ */ t.jsx(
|
|
283
|
-
|
|
264
|
+
Z,
|
|
284
265
|
{
|
|
285
|
-
components:
|
|
266
|
+
components: c,
|
|
286
267
|
content: e.value
|
|
287
268
|
},
|
|
288
269
|
s
|
|
289
270
|
);
|
|
290
271
|
if (e.type === "mermaid")
|
|
291
272
|
return /* @__PURE__ */ t.jsx(
|
|
292
|
-
|
|
273
|
+
W,
|
|
293
274
|
{
|
|
294
275
|
chart: e.value,
|
|
295
276
|
frozen: !e.complete
|
|
@@ -297,17 +278,17 @@ const Le = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
|
|
|
297
278
|
s
|
|
298
279
|
);
|
|
299
280
|
if (e.type === "svg")
|
|
300
|
-
return /* @__PURE__ */ t.jsx(
|
|
281
|
+
return /* @__PURE__ */ t.jsx(Y, { svg: e.value }, s);
|
|
301
282
|
}),
|
|
302
|
-
o && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children:
|
|
283
|
+
o && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: X.createElement(o, {
|
|
303
284
|
content: r,
|
|
304
|
-
displayContent:
|
|
285
|
+
displayContent: m,
|
|
305
286
|
onSend: a
|
|
306
287
|
}) })
|
|
307
288
|
] });
|
|
308
289
|
};
|
|
309
290
|
export {
|
|
310
|
-
|
|
311
|
-
|
|
291
|
+
Z as MarkdownRenderer,
|
|
292
|
+
rt as default
|
|
312
293
|
};
|
|
313
294
|
//# sourceMappingURL=ContentRender.es.js.map
|