markdown-flow-ui 0.1.80 → 0.1.81-beta.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.
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +1 -1
- package/dist/Documents/ai-shifu/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.js +1 -1
- package/dist/Documents/ai-shifu/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.js +1 -1
- package/dist/Documents/ai-shifu/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.js +1 -1
- package/dist/Documents/ai-shifu/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.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/ref.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-dom@19.0.1_react@19.0.1/node_modules/react-dom/cjs/react-dom-client.development.js +15111 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-dom@19.0.1_react@19.0.1/node_modules/react-dom/cjs/react-dom-client.development.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-dom@19.0.1_react@19.0.1/node_modules/react-dom/cjs/react-dom-client.production.js +9262 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-dom@19.0.1_react@19.0.1/node_modules/react-dom/cjs/react-dom-client.production.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-dom@19.0.1_react@19.0.1/node_modules/react-dom/client.js +24 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-dom@19.0.1_react@19.0.1/node_modules/react-dom/client.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/index.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/index.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.development.js +244 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.development.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.production.js +241 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.production.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/index.js +11 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/_virtual/client.js +6 -0
- package/dist/_virtual/client.js.map +1 -0
- package/dist/_virtual/client2.js +5 -0
- package/dist/_virtual/client2.js.map +1 -0
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index11.js +2 -3
- package/dist/_virtual/index11.js.map +1 -1
- package/dist/_virtual/index12.js +3 -2
- package/dist/_virtual/index12.js.map +1 -1
- package/dist/_virtual/index13.js +5 -0
- package/dist/_virtual/index13.js.map +1 -0
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +4 -2
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index4.js +5 -4
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/react-dom-client.development.js +5 -0
- package/dist/_virtual/react-dom-client.development.js.map +1 -0
- package/dist/_virtual/react-dom-client.production.js +5 -0
- package/dist/_virtual/react-dom-client.production.js.map +1 -0
- package/dist/_virtual/scheduler.development.js +5 -0
- package/dist/_virtual/scheduler.development.js.map +1 -0
- package/dist/_virtual/scheduler.production.js +5 -0
- package/dist/_virtual/scheduler.production.js.map +1 -0
- package/dist/components/ContentRender/ContentRender.js +169 -108
- package/dist/components/ContentRender/ContentRender.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.stories.d.ts +1 -0
- package/dist/components/ContentRender/IframeSandbox.d.ts +7 -0
- package/dist/components/ContentRender/IframeSandbox.js +60 -0
- package/dist/components/ContentRender/IframeSandbox.js.map +1 -0
- package/dist/components/ContentRender/SandboxApp.d.ts +6 -0
- package/dist/components/ContentRender/SandboxApp.js +21 -0
- package/dist/components/ContentRender/SandboxApp.js.map +1 -0
- package/dist/components/ContentRender/utils/normalize-inline-html.d.ts +1 -0
- package/dist/components/ContentRender/utils/normalize-inline-html.js +13 -0
- package/dist/components/ContentRender/utils/normalize-inline-html.js.map +1 -0
- package/dist/components/ui/inputGroup/textarea.js +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index10.js
CHANGED
package/dist/_virtual/index11.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index11.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index11.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index12.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index12.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index12.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index13.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as s } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
3
|
-
var e = s();
|
|
4
|
-
const t = /* @__PURE__ */ r(e);
|
|
1
|
+
var r = {};
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
r as __exports
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getAugmentedNamespace as e } from "./_commonjsHelpers.js";
|
|
2
|
+
import * as r from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unist-util-visit@5.0.0/node_modules/unist-util-visit/index.js";
|
|
3
|
+
const m = /* @__PURE__ */ e(r);
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
m as default
|
|
4
6
|
};
|
|
5
7
|
//# sourceMappingURL=index3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as s } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
3
|
+
var e = s();
|
|
4
|
+
const t = /* @__PURE__ */ r(e);
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
t as default
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=index4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index4.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/_virtual/index8.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-client.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom-client.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,114 +1,126 @@
|
|
|
1
1
|
import { j as t } from "../../_virtual/jsx-runtime.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import D, { useMemo as C, useRef as W, useEffect as R } from "react";
|
|
5
|
+
import I from "../../_virtual/index.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { preserveCustomVariableProperties as
|
|
13
|
-
import {
|
|
14
|
-
import { parseMarkdownSegments as
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
import F from "./CodeBlock.js";
|
|
9
|
+
import J from "./plugins/CustomVariable.js";
|
|
10
|
+
import z from "./plugins/MermaidChart.js";
|
|
11
|
+
import O from "./useTypewriterStateMachine.js";
|
|
12
|
+
import { preserveCustomVariableProperties as Q, restoreCustomVariableProperties as X } from "./utils/custom-variable-props.js";
|
|
13
|
+
import { highlightLanguages as M, subsetLanguages as P } from "./utils/highlight-languages.js";
|
|
14
|
+
import { parseMarkdownSegments as Y, mermaidBlockIsComplete as Z } from "./utils/mermaid-parse.js";
|
|
15
|
+
import { normalizeInlineHtml as $ } from "./utils/normalize-inline-html.js";
|
|
16
|
+
import ee from "./IframeSandbox.js";
|
|
17
|
+
import { Markdown as H } from "../../Documents/ai-shifu/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.js";
|
|
18
|
+
import L from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js";
|
|
19
|
+
import T from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.js";
|
|
20
|
+
import V from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.js";
|
|
21
|
+
import _ from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js";
|
|
22
|
+
import E from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.js";
|
|
23
|
+
import U from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";
|
|
24
|
+
const q = (r) => {
|
|
25
|
+
const m = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)[\s>]/i, a = r.search(m);
|
|
26
|
+
if (a === -1)
|
|
27
|
+
return [{ type: "markdown", value: r }];
|
|
28
|
+
const i = /<\/[a-z][^>]*>\s*\n(?=[^\s<])/gi;
|
|
29
|
+
let c = r.length, o;
|
|
30
|
+
for (; o = i.exec(r); )
|
|
31
|
+
if (!(o.index <= a)) {
|
|
32
|
+
c = o.index + o[0].length - 1;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
const d = [], u = r.slice(0, a), n = r.slice(a, c), l = r.slice(c);
|
|
36
|
+
return u.trim() && d.push({ type: "markdown", value: u }), d.push({ type: "sandbox", value: n }), l.trim() && d.push(...q(l)), d;
|
|
37
|
+
}, te = ({ svg: r }) => {
|
|
38
|
+
const m = W(null);
|
|
39
|
+
return R(() => {
|
|
40
|
+
const a = m.current;
|
|
41
|
+
if (!a) return;
|
|
42
|
+
const i = a.shadowRoot ?? a.attachShadow({ mode: "open" }), c = "content-render-svg-style";
|
|
43
|
+
let o = i.getElementById(c);
|
|
44
|
+
o || (o = document.createElement("style"), o.id = c, o.textContent = `
|
|
30
45
|
:host { display: block; width: 100%; max-width: 100%; text-align: center; }
|
|
31
46
|
svg { max-width: 100%; height: auto; display: inline-block; }
|
|
32
|
-
`,
|
|
33
|
-
(
|
|
34
|
-
).forEach((
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
const [, ,
|
|
42
|
-
if (!
|
|
43
|
-
|
|
47
|
+
`, i.appendChild(o)), Array.from(i.childNodes).filter(
|
|
48
|
+
(n) => n !== o
|
|
49
|
+
).forEach((n) => i.removeChild(n));
|
|
50
|
+
const u = document.createElement("template");
|
|
51
|
+
u.innerHTML = r, i.append(u.content.cloneNode(!0)), i.querySelectorAll("svg").forEach((n) => {
|
|
52
|
+
const l = n.getAttribute("viewBox");
|
|
53
|
+
if (!l) return;
|
|
54
|
+
const f = l.trim().split(/[\s,]+/).map((v) => Number(v));
|
|
55
|
+
if (f.length !== 4 || f.some(Number.isNaN)) return;
|
|
56
|
+
const [, , x, p] = f, y = n.getAttribute("width"), j = n.getAttribute("height"), k = !!y && y !== "0", b = !!j && j !== "0";
|
|
57
|
+
if (!k && !b) {
|
|
58
|
+
n.style.width = "100%", n.style.height = "auto", !n.style.aspectRatio && p > 0 && (n.style.aspectRatio = `${x} / ${p}`);
|
|
44
59
|
return;
|
|
45
60
|
}
|
|
46
|
-
!
|
|
61
|
+
!k && x > 0 && n.setAttribute("width", `${x}`), !b && p > 0 && n.setAttribute("height", `${p}`);
|
|
47
62
|
});
|
|
48
|
-
}, [
|
|
49
|
-
},
|
|
50
|
-
content:
|
|
51
|
-
customRenderBar:
|
|
52
|
-
onSend:
|
|
53
|
-
typingSpeed:
|
|
54
|
-
enableTypewriter:
|
|
55
|
-
defaultButtonText:
|
|
56
|
-
defaultInputText:
|
|
57
|
-
defaultSelectedValues:
|
|
58
|
-
readonly:
|
|
59
|
-
onTypeFinished:
|
|
60
|
-
confirmButtonText:
|
|
61
|
-
copyButtonText:
|
|
62
|
-
copiedButtonText:
|
|
63
|
-
onClickCustomButtonAfterContent:
|
|
64
|
-
beforeSend:
|
|
63
|
+
}, [r]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: m }) });
|
|
64
|
+
}, Se = ({
|
|
65
|
+
content: r,
|
|
66
|
+
customRenderBar: m,
|
|
67
|
+
onSend: a,
|
|
68
|
+
typingSpeed: i = 30,
|
|
69
|
+
enableTypewriter: c = !1,
|
|
70
|
+
defaultButtonText: o,
|
|
71
|
+
defaultInputText: d,
|
|
72
|
+
defaultSelectedValues: u,
|
|
73
|
+
readonly: n = !1,
|
|
74
|
+
onTypeFinished: l,
|
|
75
|
+
confirmButtonText: f,
|
|
76
|
+
copyButtonText: x,
|
|
77
|
+
copiedButtonText: p,
|
|
78
|
+
onClickCustomButtonAfterContent: y,
|
|
79
|
+
beforeSend: j
|
|
65
80
|
// tooltipMinLength,
|
|
66
81
|
}) => {
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
typingSpeed: o,
|
|
72
|
-
disabled: !b
|
|
73
|
-
}), w = {
|
|
82
|
+
const k = C(
|
|
83
|
+
() => $(r),
|
|
84
|
+
[r]
|
|
85
|
+
), b = {
|
|
74
86
|
"custom-button-after-content": ({
|
|
75
87
|
children: e
|
|
76
88
|
}) => /* @__PURE__ */ t.jsx(
|
|
77
89
|
"button",
|
|
78
90
|
{
|
|
79
91
|
className: "content-render-custom-button-after-content",
|
|
80
|
-
onClick:
|
|
92
|
+
onClick: y,
|
|
81
93
|
children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
|
|
82
94
|
}
|
|
83
95
|
),
|
|
84
96
|
"custom-variable": (e) => /* @__PURE__ */ t.jsx(
|
|
85
|
-
|
|
97
|
+
J,
|
|
86
98
|
{
|
|
87
99
|
...e,
|
|
88
|
-
readonly:
|
|
89
|
-
defaultButtonText:
|
|
90
|
-
defaultInputText:
|
|
91
|
-
defaultSelectedValues:
|
|
92
|
-
onSend:
|
|
93
|
-
beforeSend:
|
|
94
|
-
confirmButtonText:
|
|
100
|
+
readonly: n,
|
|
101
|
+
defaultButtonText: o,
|
|
102
|
+
defaultInputText: d,
|
|
103
|
+
defaultSelectedValues: u,
|
|
104
|
+
onSend: a,
|
|
105
|
+
beforeSend: j,
|
|
106
|
+
confirmButtonText: f
|
|
95
107
|
}
|
|
96
108
|
),
|
|
97
109
|
code: (e) => {
|
|
98
|
-
const { className: s, children:
|
|
110
|
+
const { className: s, children: h, ...A } = e;
|
|
99
111
|
if (/language-(\w+)/.exec(s || "")?.[1] === "mermaid") {
|
|
100
|
-
const
|
|
101
|
-
return /* @__PURE__ */ t.jsx(
|
|
112
|
+
const B = h?.toString().replace(/\n$/, "") || "", K = Z(r, B);
|
|
113
|
+
return /* @__PURE__ */ t.jsx(z, { chart: B, frozen: K });
|
|
102
114
|
}
|
|
103
|
-
return /* @__PURE__ */ t.jsx("code", { className: s, ...
|
|
115
|
+
return /* @__PURE__ */ t.jsx("code", { className: s, ...A, children: h });
|
|
104
116
|
},
|
|
105
117
|
table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
|
|
106
118
|
th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
|
|
107
119
|
td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
|
|
108
120
|
tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
|
|
109
121
|
li: ({ node: e, ...s }) => {
|
|
110
|
-
const
|
|
111
|
-
return typeof
|
|
122
|
+
const h = e?.properties?.className;
|
|
123
|
+
return typeof h == "string" && h.includes("task-list-item") || Array.isArray(h) && h.includes("task-list-item") ? /* @__PURE__ */ t.jsx("li", { className: "content-render-task-list-item", ...s }) : /* @__PURE__ */ t.jsx("li", { ...s });
|
|
112
124
|
},
|
|
113
125
|
ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
|
|
114
126
|
ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
|
|
@@ -123,45 +135,94 @@ const J = ({ svg: a }) => {
|
|
|
123
135
|
) : /* @__PURE__ */ t.jsx("input", { ...e }),
|
|
124
136
|
a: ({ children: e, ...s }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...s, children: e }),
|
|
125
137
|
pre: (e) => /* @__PURE__ */ t.jsx(
|
|
126
|
-
|
|
138
|
+
F,
|
|
127
139
|
{
|
|
128
140
|
...e,
|
|
129
|
-
copyButtonText:
|
|
130
|
-
copiedButtonText:
|
|
141
|
+
copyButtonText: x,
|
|
142
|
+
copiedButtonText: p
|
|
131
143
|
}
|
|
132
144
|
)
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
}, { displayContent: N, isComplete: v } = O({
|
|
146
|
+
// processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
|
|
147
|
+
// content: processMarkdownText(content),
|
|
148
|
+
content: k,
|
|
149
|
+
typingSpeed: i,
|
|
150
|
+
disabled: !c
|
|
151
|
+
}), S = C(
|
|
152
|
+
() => q(r),
|
|
153
|
+
[r]
|
|
154
|
+
), g = S.some(
|
|
155
|
+
(e) => e.type === "sandbox"
|
|
156
|
+
), G = C(
|
|
157
|
+
() => Y(N),
|
|
158
|
+
[N]
|
|
159
|
+
), w = W(!1);
|
|
160
|
+
return R(() => {
|
|
161
|
+
g || v && !w.current && (w.current = !0, l?.());
|
|
162
|
+
}, [g, v, l]), R(() => {
|
|
163
|
+
g || (w.current = !1);
|
|
164
|
+
}, [g, r]), g ? /* @__PURE__ */ t.jsx("div", { className: "content-render", children: S.map(
|
|
165
|
+
(e, s) => e.type === "sandbox" ? /* @__PURE__ */ t.jsx(
|
|
166
|
+
ee,
|
|
167
|
+
{
|
|
168
|
+
content: e.value,
|
|
169
|
+
className: "content-render-iframe"
|
|
170
|
+
},
|
|
171
|
+
`sandbox-${s}`
|
|
172
|
+
) : /* @__PURE__ */ t.jsx("div", { className: "markdown-body", children: /* @__PURE__ */ t.jsx(
|
|
173
|
+
H,
|
|
174
|
+
{
|
|
175
|
+
remarkPlugins: [
|
|
176
|
+
_,
|
|
177
|
+
E,
|
|
178
|
+
I,
|
|
179
|
+
[U, { omit: ["table", "code", "listItem"] }]
|
|
180
|
+
],
|
|
181
|
+
rehypePlugins: [
|
|
182
|
+
L,
|
|
183
|
+
T,
|
|
184
|
+
[
|
|
185
|
+
V,
|
|
186
|
+
{
|
|
187
|
+
detect: !0,
|
|
188
|
+
subset: P,
|
|
189
|
+
languages: M
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
],
|
|
193
|
+
components: b,
|
|
194
|
+
children: $(e.value)
|
|
195
|
+
}
|
|
196
|
+
) }, `md-${s}`)
|
|
197
|
+
) }) : /* @__PURE__ */ t.jsxs("div", { className: "content-render", children: [
|
|
198
|
+
G.map((e, s) => {
|
|
142
199
|
if (e.type === "text")
|
|
143
|
-
return /* @__PURE__ */ t.jsx(
|
|
144
|
-
|
|
200
|
+
return /* @__PURE__ */ t.jsx("div", { className: "markdown-body", children: /* @__PURE__ */ t.jsx(
|
|
201
|
+
H,
|
|
145
202
|
{
|
|
146
|
-
remarkPlugins: [
|
|
203
|
+
remarkPlugins: [
|
|
204
|
+
_,
|
|
205
|
+
E,
|
|
206
|
+
I,
|
|
207
|
+
U
|
|
208
|
+
],
|
|
147
209
|
rehypePlugins: [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
210
|
+
Q,
|
|
211
|
+
L,
|
|
212
|
+
X,
|
|
151
213
|
[
|
|
152
|
-
|
|
153
|
-
{ languages:
|
|
214
|
+
V,
|
|
215
|
+
{ languages: M, subset: P }
|
|
154
216
|
],
|
|
155
|
-
|
|
217
|
+
T
|
|
156
218
|
],
|
|
157
|
-
components:
|
|
219
|
+
components: b,
|
|
158
220
|
children: e.value
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
);
|
|
221
|
+
}
|
|
222
|
+
) }, s);
|
|
162
223
|
if (e.type === "mermaid")
|
|
163
224
|
return /* @__PURE__ */ t.jsx(
|
|
164
|
-
|
|
225
|
+
z,
|
|
165
226
|
{
|
|
166
227
|
chart: e.value,
|
|
167
228
|
frozen: !e.complete
|
|
@@ -169,16 +230,16 @@ const J = ({ svg: a }) => {
|
|
|
169
230
|
s
|
|
170
231
|
);
|
|
171
232
|
if (e.type === "svg")
|
|
172
|
-
return /* @__PURE__ */ t.jsx(
|
|
233
|
+
return /* @__PURE__ */ t.jsx(te, { svg: e.value }, s);
|
|
173
234
|
}),
|
|
174
|
-
|
|
175
|
-
content:
|
|
176
|
-
displayContent:
|
|
177
|
-
onSend:
|
|
235
|
+
m && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: D.createElement(m, {
|
|
236
|
+
content: r,
|
|
237
|
+
displayContent: N,
|
|
238
|
+
onSend: a
|
|
178
239
|
}) })
|
|
179
240
|
] });
|
|
180
241
|
};
|
|
181
242
|
export {
|
|
182
|
-
|
|
243
|
+
Se as default
|
|
183
244
|
};
|
|
184
245
|
//# sourceMappingURL=ContentRender.js.map
|