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