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