markdown-flow-ui 0.1.81-beta.16 → 0.1.81-beta.18
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/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.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/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/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index7.js +3 -2
- package/dist/_virtual/index7.js.map +1 -1
- package/dist/_virtual/index9.js +2 -3
- package/dist/_virtual/index9.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +5 -0
- package/dist/components/ContentRender/ContentRender.js +139 -141
- 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 +5 -0
- package/dist/components/ContentRender/IframeSandbox.js +71 -32
- package/dist/components/ContentRender/IframeSandbox.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.d.ts +5 -0
- package/dist/components/ContentRender/SandboxApp.js +194 -16
- package/dist/components/ContentRender/SandboxApp.js.map +1 -1
- package/dist/components/ContentRender/index.d.ts +5 -0
- package/dist/components/ContentRender/index.js +2 -1
- package/dist/components/ContentRender/index.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.d.ts +8 -0
- package/dist/components/ContentRender/utils/split-content.js +18 -0
- package/dist/components/ContentRender/utils/split-content.js.map +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.js +4 -3
- package/dist/components/MarkdownFlow/MarkdownFlow.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.js +1 -1
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/renderer.js +5 -4
- package/dist/renderer.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { setAccDescription as Be, getAccDescription as Ie, getAccTitle as Me, se
|
|
|
4
4
|
import { __name as g, log as fe } from "./chunk-AGHRB4JF.js";
|
|
5
5
|
import "../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js";
|
|
6
6
|
import "../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js";
|
|
7
|
-
import { d as je } from "../../../../../../../../../../../_virtual/
|
|
7
|
+
import { d as je } from "../../../../../../../../../../../_virtual/index7.js";
|
|
8
8
|
import jt from "../../../../../../d3-selection@3.0.0/node_modules/d3-selection/src/select.js";
|
|
9
9
|
var Ft = (function() {
|
|
10
10
|
var e = /* @__PURE__ */ g(function(_t, x, m, v) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { common_default as b, assignWithDepth_default as E, directiveRegex as $, sanitizeDirective as X, detectType as Y } from "./chunk-ABZYJK2D.js";
|
|
2
2
|
import { __name as s, log as g } from "./chunk-AGHRB4JF.js";
|
|
3
|
-
import { d as G } from "../../../../../../../../../../../_virtual/
|
|
3
|
+
import { d as G } from "../../../../../../../../../../../_virtual/index7.js";
|
|
4
4
|
import "../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js";
|
|
5
5
|
import "../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js";
|
|
6
6
|
import w from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/memoize.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { lineBreakRegex as o } from "./chunk-ABZYJK2D.js";
|
|
2
2
|
import { __name as n } from "./chunk-AGHRB4JF.js";
|
|
3
|
-
import { d as l } from "../../../../../../../../../../../_virtual/
|
|
3
|
+
import { d as l } from "../../../../../../../../../../../_virtual/index7.js";
|
|
4
4
|
var x = /* @__PURE__ */ n((s, t) => {
|
|
5
5
|
const r = s.append("rect");
|
|
6
6
|
if (r.attr("x", t.x), r.attr("y", t.y), r.attr("fill", t.fill), r.attr("stroke", t.stroke), r.attr("width", t.width), r.attr("height", t.height), t.name && r.attr("name", t.name), t.rx && r.attr("rx", t.rx), t.ry && r.attr("ry", t.ry), t.attrs !== void 0)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { utils_default as ie } from "./chunk-S3R3BYOJ.js";
|
|
2
2
|
import { getAccDescription as se, setAccDescription as ne, getDiagramTitle as ae, setDiagramTitle as oe, getAccTitle as ce, setAccTitle as le, getConfig2 as K, configureSvgSize as ue, common_default as de, clear as fe } from "./chunk-ABZYJK2D.js";
|
|
3
3
|
import { __name as c, log as mt } from "./chunk-AGHRB4JF.js";
|
|
4
|
-
import { d as he } from "../../../../../../../../../../../_virtual/
|
|
4
|
+
import { d as he } from "../../../../../../../../../../../_virtual/index7.js";
|
|
5
5
|
import L from "../../../../../../../../../../../_virtual/dayjs.min.js";
|
|
6
6
|
import me from "../../../../../../../../../../../_virtual/isoWeek.js";
|
|
7
7
|
import ke from "../../../../../../../../../../../_virtual/customParseFormat.js";
|
|
@@ -6,7 +6,7 @@ import { setConfig2 as ke, getConfig2 as st, configureSvgSize as Pe, assignWithD
|
|
|
6
6
|
import { __name as f, log as Q } from "./chunk-AGHRB4JF.js";
|
|
7
7
|
import "../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js";
|
|
8
8
|
import "../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js";
|
|
9
|
-
import { d as ne } from "../../../../../../../../../../../_virtual/
|
|
9
|
+
import { d as ne } from "../../../../../../../../../../../_virtual/index7.js";
|
|
10
10
|
import Mt from "../../../../../../d3-selection@3.0.0/node_modules/d3-selection/src/select.js";
|
|
11
11
|
var Ut = (function() {
|
|
12
12
|
var e = /* @__PURE__ */ f(function(pt, v, A, L) {
|
|
@@ -2,7 +2,7 @@ import $ from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/hel
|
|
|
2
2
|
import oe from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.js";
|
|
3
3
|
import r from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/defineProperty.js";
|
|
4
4
|
import te from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.js";
|
|
5
|
-
import d from "../../../../../../../../../_virtual/
|
|
5
|
+
import d from "../../../../../../../../../_virtual/index3.js";
|
|
6
6
|
import l, { useRef as q, cloneElement as ie } from "react";
|
|
7
7
|
import { hasPrefixSuffix as re, hasAddon as de } from "./utils/commonUtils.js";
|
|
8
8
|
var xe = /* @__PURE__ */ l.forwardRef(function(e, z) {
|
|
@@ -4,7 +4,7 @@ import w from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/hel
|
|
|
4
4
|
import J from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.js";
|
|
5
5
|
import s from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.js";
|
|
6
6
|
import K from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js";
|
|
7
|
-
import Q from "../../../../../../../../../_virtual/
|
|
7
|
+
import Q from "../../../../../../../../../_virtual/index3.js";
|
|
8
8
|
import ee from "../../../../rc-resize-observer@1.4.3_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-resize-observer/es/index.js";
|
|
9
9
|
import M from "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useLayoutEffect.js";
|
|
10
10
|
import te from "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useMergedState.js";
|
|
@@ -4,7 +4,7 @@ import d from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/hel
|
|
|
4
4
|
import Ae from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js";
|
|
5
5
|
import x from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/slicedToArray.js";
|
|
6
6
|
import Fe from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js";
|
|
7
|
-
import h from "../../../../../../../../../_virtual/
|
|
7
|
+
import h from "../../../../../../../../../_virtual/index3.js";
|
|
8
8
|
import Ne from "../../../../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";
|
|
9
9
|
import Te from "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useMergedState.js";
|
|
10
10
|
import o, { useRef as Y, useImperativeHandle as $e, useEffect as Ie } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import t from "./TextArea.js";
|
|
2
|
-
import "../../../../../../../../../_virtual/
|
|
2
|
+
import "../../../../../../../../../_virtual/index3.js";
|
|
3
3
|
import "../../../../rc-resize-observer@1.4.3_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-resize-observer/es/index.js";
|
|
4
4
|
import "../../../../rc-util@5.44.4_react-dom@19.0.1_react@19.0.1__react@19.0.1/node_modules/rc-util/es/hooks/useLayoutEffect.js";
|
|
5
5
|
import "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as e } from "../../../../../../../../../_virtual/
|
|
1
|
+
import { __exports as e } from "../../../../../../../../../_virtual/index2.js";
|
|
2
2
|
import { __require as _ } from "./remark-custom-variable.js";
|
|
3
3
|
import { __require as m } from "./remark-flow.js";
|
|
4
4
|
import { __require as f } from "./remark-interaction.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as r } from "../../../../../../../../../_virtual/
|
|
1
|
+
import { __exports as r } from "../../../../../../../../../_virtual/index9.js";
|
|
2
2
|
import { __require as p } from "../../../../inline-style-parser@0.2.4/node_modules/inline-style-parser/index.js";
|
|
3
3
|
var f;
|
|
4
4
|
function q() {
|
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,8 @@
|
|
|
1
|
-
|
|
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);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
t as default
|
|
4
7
|
};
|
|
5
8
|
//# 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/index7.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { __require as r } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.js";
|
|
2
|
+
var i = r();
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
i as d
|
|
4
5
|
};
|
|
5
6
|
//# sourceMappingURL=index7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index7.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/_virtual/index9.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var i = r();
|
|
1
|
+
var r = {};
|
|
3
2
|
export {
|
|
4
|
-
|
|
3
|
+
r as __exports
|
|
5
4
|
};
|
|
6
5
|
//# sourceMappingURL=index9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index9.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index9.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -27,6 +27,11 @@ export interface ContentRenderProps {
|
|
|
27
27
|
copyButtonText?: string;
|
|
28
28
|
copiedButtonText?: string;
|
|
29
29
|
dynamicInteractionFormat?: string;
|
|
30
|
+
sandboxLoadingText?: string;
|
|
31
|
+
sandboxStyleLoadingText?: string;
|
|
32
|
+
sandboxScriptLoadingText?: string;
|
|
33
|
+
sandboxFullscreenButtonText?: string;
|
|
34
|
+
sandboxMode?: "content" | "blackboard";
|
|
30
35
|
beforeSend?: (param: OnSendContentParams) => boolean;
|
|
31
36
|
}
|
|
32
37
|
declare const ContentRender: React.FC<ContentRenderProps>;
|
|
@@ -1,140 +1,133 @@
|
|
|
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 W, { useMemo as v, useRef as H, useEffect as C } from "react";
|
|
5
|
+
import q 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 { subsetLanguages as
|
|
14
|
-
import { parseMarkdownSegments as
|
|
15
|
-
import { normalizeInlineHtml as
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
const d = [], u = r.slice(0, a), n = r.slice(a, l), m = r.slice(l);
|
|
36
|
-
return u.trim() && d.push({ type: "markdown", value: u }), d.push({ type: "sandbox", value: n }), m.trim() && d.push(...H(m)), d;
|
|
37
|
-
}, re = ({ svg: r }) => {
|
|
38
|
-
const c = $(null);
|
|
39
|
-
return R(() => {
|
|
40
|
-
const a = c.current;
|
|
41
|
-
if (!a) return;
|
|
42
|
-
const i = a.shadowRoot ?? a.attachShadow({ mode: "open" }), l = "content-render-svg-style";
|
|
43
|
-
let o = i.getElementById(l);
|
|
44
|
-
o || (o = document.createElement("style"), o.id = l, o.textContent = `
|
|
8
|
+
import E from "./CodeBlock.js";
|
|
9
|
+
import G from "./plugins/CustomVariable.js";
|
|
10
|
+
import L from "./plugins/MermaidChart.js";
|
|
11
|
+
import K from "./useTypewriterStateMachine.js";
|
|
12
|
+
import { preserveCustomVariableProperties as D, restoreCustomVariableProperties as F } from "./utils/custom-variable-props.js";
|
|
13
|
+
import { subsetLanguages as J, highlightLanguages as O } from "./utils/highlight-languages.js";
|
|
14
|
+
import { parseMarkdownSegments as Q, mermaidBlockIsComplete as X } from "./utils/mermaid-parse.js";
|
|
15
|
+
import { normalizeInlineHtml as $ } from "./utils/normalize-inline-html.js";
|
|
16
|
+
import Y from "./IframeSandbox.js";
|
|
17
|
+
import { splitContentSegments as Z } from "./utils/split-content.js";
|
|
18
|
+
import { Markdown as ee } 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";
|
|
19
|
+
import te from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js";
|
|
20
|
+
import re from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.js";
|
|
21
|
+
import ne from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.js";
|
|
22
|
+
import oe from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js";
|
|
23
|
+
import se from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.js";
|
|
24
|
+
import ae from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";
|
|
25
|
+
const ie = ({ svg: o }) => {
|
|
26
|
+
const i = H(null);
|
|
27
|
+
return C(() => {
|
|
28
|
+
const m = i.current;
|
|
29
|
+
if (!m) return;
|
|
30
|
+
const s = m.shadowRoot ?? m.attachShadow({ mode: "open" }), f = "content-render-svg-style";
|
|
31
|
+
let a = s.getElementById(f);
|
|
32
|
+
a || (a = document.createElement("style"), a.id = f, a.textContent = `
|
|
45
33
|
:host { display: block; width: 100%; max-width: 100%; text-align: center; }
|
|
46
34
|
svg { max-width: 100%; height: auto; display: inline-block; }
|
|
47
|
-
`,
|
|
48
|
-
(
|
|
49
|
-
).forEach((
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const [, ,
|
|
57
|
-
if (!
|
|
58
|
-
|
|
35
|
+
`, s.appendChild(a)), Array.from(s.childNodes).filter(
|
|
36
|
+
(r) => r !== a
|
|
37
|
+
).forEach((r) => s.removeChild(r));
|
|
38
|
+
const x = document.createElement("template");
|
|
39
|
+
x.innerHTML = o, s.append(x.content.cloneNode(!0)), s.querySelectorAll("svg").forEach((r) => {
|
|
40
|
+
const d = r.getAttribute("viewBox");
|
|
41
|
+
if (!d) return;
|
|
42
|
+
const u = d.trim().split(/[\s,]+/).map((N) => Number(N));
|
|
43
|
+
if (u.length !== 4 || u.some(Number.isNaN)) return;
|
|
44
|
+
const [, , h, l] = u, b = r.getAttribute("width"), g = r.getAttribute("height"), j = !!b && b !== "0", y = !!g && g !== "0";
|
|
45
|
+
if (!j && !y) {
|
|
46
|
+
r.style.width = "100%", r.style.height = "auto", !r.style.aspectRatio && l > 0 && (r.style.aspectRatio = `${h} / ${l}`);
|
|
59
47
|
return;
|
|
60
48
|
}
|
|
61
|
-
!
|
|
49
|
+
!j && h > 0 && r.setAttribute("width", `${h}`), !y && l > 0 && r.setAttribute("height", `${l}`);
|
|
62
50
|
});
|
|
63
|
-
}, [
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[
|
|
69
|
-
|
|
70
|
-
], z = ({ content:
|
|
71
|
-
|
|
51
|
+
}, [o]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: i }) });
|
|
52
|
+
}, ce = [oe, se, q, ae], me = [
|
|
53
|
+
D,
|
|
54
|
+
te,
|
|
55
|
+
F,
|
|
56
|
+
[re, { languages: O, subset: J }],
|
|
57
|
+
ne
|
|
58
|
+
], z = ({ content: o, components: i }) => /* @__PURE__ */ t.jsx("div", { className: "markdown-body", children: /* @__PURE__ */ t.jsx(
|
|
59
|
+
ee,
|
|
72
60
|
{
|
|
73
|
-
remarkPlugins:
|
|
74
|
-
rehypePlugins:
|
|
75
|
-
components:
|
|
76
|
-
children:
|
|
61
|
+
remarkPlugins: ce,
|
|
62
|
+
rehypePlugins: me,
|
|
63
|
+
components: i,
|
|
64
|
+
children: o
|
|
77
65
|
}
|
|
78
|
-
) }),
|
|
79
|
-
content:
|
|
80
|
-
customRenderBar:
|
|
81
|
-
onSend:
|
|
82
|
-
typingSpeed:
|
|
83
|
-
enableTypewriter:
|
|
84
|
-
defaultButtonText:
|
|
85
|
-
defaultInputText:
|
|
86
|
-
defaultSelectedValues:
|
|
87
|
-
readonly:
|
|
88
|
-
onTypeFinished:
|
|
89
|
-
confirmButtonText:
|
|
90
|
-
copyButtonText:
|
|
91
|
-
copiedButtonText:
|
|
92
|
-
|
|
93
|
-
|
|
66
|
+
) }), He = ({
|
|
67
|
+
content: o,
|
|
68
|
+
customRenderBar: i,
|
|
69
|
+
onSend: m,
|
|
70
|
+
typingSpeed: s = 30,
|
|
71
|
+
enableTypewriter: f = !1,
|
|
72
|
+
defaultButtonText: a,
|
|
73
|
+
defaultInputText: R,
|
|
74
|
+
defaultSelectedValues: x,
|
|
75
|
+
readonly: r = !1,
|
|
76
|
+
onTypeFinished: d,
|
|
77
|
+
confirmButtonText: u,
|
|
78
|
+
copyButtonText: h,
|
|
79
|
+
copiedButtonText: l,
|
|
80
|
+
sandboxLoadingText: b,
|
|
81
|
+
sandboxStyleLoadingText: g,
|
|
82
|
+
sandboxScriptLoadingText: j,
|
|
83
|
+
sandboxFullscreenButtonText: y,
|
|
84
|
+
sandboxMode: S = "content",
|
|
85
|
+
onClickCustomButtonAfterContent: N,
|
|
86
|
+
beforeSend: P
|
|
94
87
|
// tooltipMinLength,
|
|
95
88
|
}) => {
|
|
96
|
-
const
|
|
97
|
-
() =>
|
|
98
|
-
[
|
|
99
|
-
),
|
|
89
|
+
const V = v(
|
|
90
|
+
() => $(o),
|
|
91
|
+
[o]
|
|
92
|
+
), A = {
|
|
100
93
|
"custom-button-after-content": ({
|
|
101
94
|
children: e
|
|
102
95
|
}) => /* @__PURE__ */ t.jsx(
|
|
103
96
|
"button",
|
|
104
97
|
{
|
|
105
98
|
className: "content-render-custom-button-after-content",
|
|
106
|
-
onClick:
|
|
99
|
+
onClick: N,
|
|
107
100
|
children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
|
|
108
101
|
}
|
|
109
102
|
),
|
|
110
103
|
"custom-variable": (e) => /* @__PURE__ */ t.jsx(
|
|
111
|
-
|
|
104
|
+
G,
|
|
112
105
|
{
|
|
113
106
|
...e,
|
|
114
|
-
readonly:
|
|
115
|
-
defaultButtonText:
|
|
116
|
-
defaultInputText:
|
|
117
|
-
defaultSelectedValues:
|
|
118
|
-
onSend:
|
|
119
|
-
beforeSend:
|
|
120
|
-
confirmButtonText:
|
|
107
|
+
readonly: r,
|
|
108
|
+
defaultButtonText: a,
|
|
109
|
+
defaultInputText: R,
|
|
110
|
+
defaultSelectedValues: x,
|
|
111
|
+
onSend: m,
|
|
112
|
+
beforeSend: P,
|
|
113
|
+
confirmButtonText: u
|
|
121
114
|
}
|
|
122
115
|
),
|
|
123
116
|
code: (e) => {
|
|
124
|
-
const { className:
|
|
125
|
-
if (/language-(\w+)/.exec(
|
|
126
|
-
const
|
|
127
|
-
return /* @__PURE__ */ t.jsx(
|
|
117
|
+
const { className: n, children: c, ...T } = e;
|
|
118
|
+
if (/language-(\w+)/.exec(n || "")?.[1] === "mermaid") {
|
|
119
|
+
const M = c?.toString().replace(/\n$/, "") || "", U = X(o, M);
|
|
120
|
+
return /* @__PURE__ */ t.jsx(L, { chart: M, frozen: U });
|
|
128
121
|
}
|
|
129
|
-
return /* @__PURE__ */ t.jsx("code", { className:
|
|
122
|
+
return /* @__PURE__ */ t.jsx("code", { className: n, ...T, children: c });
|
|
130
123
|
},
|
|
131
124
|
table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
|
|
132
125
|
th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
|
|
133
126
|
td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
|
|
134
127
|
tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
|
|
135
|
-
li: ({ node: e, ...
|
|
136
|
-
const
|
|
137
|
-
return typeof
|
|
128
|
+
li: ({ node: e, ...n }) => {
|
|
129
|
+
const c = e?.properties?.className;
|
|
130
|
+
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 });
|
|
138
131
|
},
|
|
139
132
|
ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
|
|
140
133
|
ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
|
|
@@ -147,81 +140,86 @@ const H = (r) => {
|
|
|
147
140
|
...e
|
|
148
141
|
}
|
|
149
142
|
) : /* @__PURE__ */ t.jsx("input", { ...e }),
|
|
150
|
-
a: ({ children: e, ...
|
|
143
|
+
a: ({ children: e, ...n }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
|
|
151
144
|
pre: (e) => /* @__PURE__ */ t.jsx(
|
|
152
|
-
|
|
145
|
+
E,
|
|
153
146
|
{
|
|
154
147
|
...e,
|
|
155
|
-
copyButtonText:
|
|
156
|
-
copiedButtonText:
|
|
148
|
+
copyButtonText: h,
|
|
149
|
+
copiedButtonText: l
|
|
157
150
|
}
|
|
158
151
|
)
|
|
159
|
-
}, { displayContent:
|
|
152
|
+
}, { displayContent: k, isComplete: B } = K({
|
|
160
153
|
// processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
|
|
161
154
|
// content: processMarkdownText(content),
|
|
162
|
-
content:
|
|
163
|
-
typingSpeed:
|
|
164
|
-
disabled: !
|
|
165
|
-
}),
|
|
166
|
-
() =>
|
|
167
|
-
[
|
|
168
|
-
),
|
|
155
|
+
content: V,
|
|
156
|
+
typingSpeed: s,
|
|
157
|
+
disabled: !f
|
|
158
|
+
}), I = v(
|
|
159
|
+
() => Z(o),
|
|
160
|
+
[o]
|
|
161
|
+
), p = I.some(
|
|
169
162
|
(e) => e.type === "sandbox"
|
|
170
|
-
),
|
|
171
|
-
() =>
|
|
172
|
-
[
|
|
173
|
-
), w =
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
}, [
|
|
177
|
-
|
|
178
|
-
}, [
|
|
179
|
-
(e,
|
|
180
|
-
|
|
163
|
+
), _ = v(
|
|
164
|
+
() => Q(k),
|
|
165
|
+
[k]
|
|
166
|
+
), w = H(!1);
|
|
167
|
+
return C(() => {
|
|
168
|
+
p || B && !w.current && (w.current = !0, d?.());
|
|
169
|
+
}, [p, B, d]), C(() => {
|
|
170
|
+
p || (w.current = !1);
|
|
171
|
+
}, [p, o]), p ? /* @__PURE__ */ t.jsx("div", { className: "content-render", children: I.map(
|
|
172
|
+
(e, n) => e.type === "sandbox" ? /* @__PURE__ */ t.jsx(
|
|
173
|
+
Y,
|
|
181
174
|
{
|
|
182
175
|
content: e.value,
|
|
183
|
-
className: "content-render-iframe"
|
|
176
|
+
className: "content-render-iframe",
|
|
177
|
+
loadingText: b,
|
|
178
|
+
styleLoadingText: g,
|
|
179
|
+
scriptLoadingText: j,
|
|
180
|
+
fullScreenButtonText: y,
|
|
181
|
+
mode: S
|
|
184
182
|
},
|
|
185
|
-
`sandbox-${
|
|
183
|
+
`sandbox-${n}`
|
|
186
184
|
) : /* @__PURE__ */ t.jsx(
|
|
187
185
|
z,
|
|
188
186
|
{
|
|
189
|
-
components:
|
|
190
|
-
content:
|
|
187
|
+
components: A,
|
|
188
|
+
content: $(e.value)
|
|
191
189
|
},
|
|
192
|
-
`md-${
|
|
190
|
+
`md-${n}`
|
|
193
191
|
)
|
|
194
192
|
) }) : /* @__PURE__ */ t.jsxs("div", { className: "content-render", children: [
|
|
195
|
-
|
|
193
|
+
_.map((e, n) => {
|
|
196
194
|
if (e.type === "text")
|
|
197
195
|
return /* @__PURE__ */ t.jsx(
|
|
198
196
|
z,
|
|
199
197
|
{
|
|
200
|
-
components:
|
|
198
|
+
components: A,
|
|
201
199
|
content: e.value
|
|
202
200
|
},
|
|
203
|
-
|
|
201
|
+
n
|
|
204
202
|
);
|
|
205
203
|
if (e.type === "mermaid")
|
|
206
204
|
return /* @__PURE__ */ t.jsx(
|
|
207
|
-
|
|
205
|
+
L,
|
|
208
206
|
{
|
|
209
207
|
chart: e.value,
|
|
210
208
|
frozen: !e.complete
|
|
211
209
|
},
|
|
212
|
-
|
|
210
|
+
n
|
|
213
211
|
);
|
|
214
212
|
if (e.type === "svg")
|
|
215
|
-
return /* @__PURE__ */ t.jsx(
|
|
213
|
+
return /* @__PURE__ */ t.jsx(ie, { svg: e.value }, n);
|
|
216
214
|
}),
|
|
217
|
-
|
|
218
|
-
content:
|
|
219
|
-
displayContent:
|
|
220
|
-
onSend:
|
|
215
|
+
i && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: W.createElement(i, {
|
|
216
|
+
content: o,
|
|
217
|
+
displayContent: k,
|
|
218
|
+
onSend: m
|
|
221
219
|
}) })
|
|
222
220
|
] });
|
|
223
221
|
};
|
|
224
222
|
export {
|
|
225
|
-
|
|
223
|
+
He as default
|
|
226
224
|
};
|
|
227
225
|
//# sourceMappingURL=ContentRender.js.map
|