markdown-flow-ui 0.1.84 → 0.1.85
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.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
- package/dist/Documents/ai-shifu/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/Documents/ai-shifu/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/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.cjs.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.es.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.cjs.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.es.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.cjs.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.es.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.cjs.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.es.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.cjs.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.es.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.cjs.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.es.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.cjs.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.es.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.cjs.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.es.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.cjs.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.cjs.js.map +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.es.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.es.js +1 -1
- package/dist/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs11.js +1 -1
- package/dist/_virtual/index.cjs2.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs7.js +1 -1
- package/dist/_virtual/index.es10.js +2 -3
- package/dist/_virtual/index.es10.js.map +1 -1
- package/dist/_virtual/index.es11.js +3 -2
- package/dist/_virtual/index.es11.js.map +1 -1
- package/dist/_virtual/index.es2.js +2 -5
- package/dist/_virtual/index.es2.js.map +1 -1
- package/dist/_virtual/index.es3.js +4 -2
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +5 -4
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -2
- package/dist/_virtual/index.es5.js.map +1 -1
- package/dist/_virtual/index.es6.js +4 -4
- package/dist/_virtual/index.es7.js +2 -5
- package/dist/_virtual/index.es7.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 +15 -0
- package/dist/components/ContentRender/ContentRender.es.js +177 -117
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.stories.d.ts +2 -0
- package/dist/components/ContentRender/IframeSandbox.cjs.js +15 -0
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -0
- package/dist/components/ContentRender/IframeSandbox.d.ts +14 -0
- package/dist/components/ContentRender/IframeSandbox.es.js +147 -0
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -0
- package/dist/components/ContentRender/SandboxApp.cjs.js +8 -0
- package/dist/components/ContentRender/SandboxApp.cjs.js.map +1 -0
- package/dist/components/ContentRender/SandboxApp.d.ts +10 -0
- package/dist/components/ContentRender/SandboxApp.es.js +173 -0
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -0
- package/dist/components/ContentRender/index.cjs.js +1 -1
- package/dist/components/ContentRender/index.d.ts +5 -0
- package/dist/components/ContentRender/index.es.js +2 -1
- package/dist/components/ContentRender/index.es.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.cjs.js +4 -0
- package/dist/components/ContentRender/utils/split-content.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/split-content.d.ts +11 -0
- package/dist/components/ContentRender/utils/split-content.es.js +118 -0
- package/dist/components/ContentRender/utils/split-content.es.js.map +1 -0
- package/dist/components/ContentRender/utils/split-content.test.d.ts +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +4 -3
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.js +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +12 -8
- package/dist/index.es.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.d.ts +6 -2
- package/dist/renderer.es.js +11 -6
- package/dist/renderer.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.cjs.js");;/* empty css */;/* empty css */const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.cjs.js");;/* empty css */;/* empty css */const c=require("react"),W=require("../../_virtual/index.cjs.js");;/* empty css */;/* empty css */const F=require("./CodeBlock.cjs.js"),O=require("./plugins/CustomVariable.cjs.js"),T=require("./plugins/MermaidChart.cjs.js"),D=require("./useTypewriterStateMachine.cjs.js"),z=require("./utils/custom-variable-props.cjs.js"),B=require("./utils/highlight-languages.cjs.js"),P=require("./utils/mermaid-parse.cjs.js"),H=require("./utils/normalize-inline-html.cjs.js"),G=require("./IframeSandbox.cjs.js"),J=require("./utils/split-content.cjs.js"),K=require("../../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.cjs.js"),Q=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.cjs.js"),X=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.cjs.js"),Y=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.cjs.js"),Z=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.cjs.js"),ee=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.cjs.js"),te=require("../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.cjs.js"),se=({svg:n})=>{const r=c.useRef(null);return c.useEffect(()=>{const i=r.current;if(!i)return;const a=i.shadowRoot??i.attachShadow({mode:"open"}),f="content-render-svg-style";let u=a.getElementById(f);u||(u=document.createElement("style"),u.id=f,u.textContent=`
|
|
2
2
|
svg { height: auto; display: inline-block; }
|
|
3
3
|
svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
|
|
4
4
|
svg.content-render-svg-el--fixed { max-width: none; }
|
|
5
|
-
`,
|
|
5
|
+
`,a.appendChild(u)),Array.from(a.childNodes).filter(s=>s!==u).forEach(s=>a.removeChild(s));const j=document.createElement("template");j.innerHTML=n,a.append(j.content.cloneNode(!0));let g=!1,m=!1;a.querySelectorAll("svg").forEach(s=>{const v=s.getAttribute("viewBox");if(!v)return;const x=v.trim().split(/[\s,]+/).map(w=>Number(w));if(x.length!==4||x.some(Number.isNaN))return;const[,,p,d]=x,b=s.getAttribute("width"),y=s.getAttribute("height"),E=!!b&&b!=="0",N=!!y&&y!=="0";if(!E&&!N){g=!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&&d>0&&(s.style.aspectRatio=`${p} / ${d}`);return}m=!0,s.classList.add("content-render-svg-el--fixed"),s.classList.remove("content-render-svg-el--responsive"),!E&&p>0&&s.setAttribute("width",`${p}`),!N&&d>0&&s.setAttribute("height",`${d}`)});const R=g&&!m;i.classList.toggle("content-render-svg--responsive",R),i.classList.toggle("content-render-svg--fixed",!R)},[n]),t.jsxRuntimeExports.jsx("div",{className:"content-render-svg-scroll",children:t.jsxRuntimeExports.jsx("div",{className:"content-render-svg",ref:r})})},ne=[Z.default,ee.default,W.default,te.default],re=[z.preserveCustomVariableProperties,Q.default,z.restoreCustomVariableProperties,[X.default,{languages:B.highlightLanguages,subset:B.subsetLanguages}],Y.default],C=({content:n,components:r})=>t.jsxRuntimeExports.jsx("div",{className:"markdown-renderer",children:t.jsxRuntimeExports.jsx(K.Markdown,{remarkPlugins:ne,rehypePlugins:re,components:r,children:n})}),oe=n=>{if(n.length<=1)return n;const r=[];return n.forEach(i=>{if(i.type==="sandbox"){r.push(i);return}const a=r[r.length-1];if(a&&a.type!=="sandbox"){r[r.length-1]={type:"markdown",value:`${a.value}${i.value}`};return}r.push({type:"markdown",value:i.value})}),r},ie=({content:n,customRenderBar:r,onSend:i,typingSpeed:a=30,enableTypewriter:f=!1,defaultButtonText:u,defaultInputText:$,defaultSelectedValues:j,readonly:g=!1,onTypeFinished:m,confirmButtonText:R,copyButtonText:s,copiedButtonText:v,sandboxLoadingText:x,sandboxStyleLoadingText:p,sandboxScriptLoadingText:d,sandboxFullscreenButtonText:b,sandboxMode:y="content",onClickCustomButtonAfterContent:E,beforeSend:N})=>{const L=c.useMemo(()=>H.normalizeInlineHtml(n),[n]),w={"custom-button-after-content":({children:e})=>t.jsxRuntimeExports.jsx("button",{className:"content-render-custom-button-after-content",onClick:E,children:t.jsxRuntimeExports.jsx("span",{className:"content-render-custom-button-after-content-inner",children:e})}),"custom-variable":e=>t.jsxRuntimeExports.jsx(O.default,{...e,readonly:g,defaultButtonText:u,defaultInputText:$,defaultSelectedValues:j,onSend:i,beforeSend:N,confirmButtonText:R}),code:e=>{const{className:o,children:l,...A}=e;if(/language-(\w+)/.exec(o||"")?.[1]==="mermaid"){const I=l?.toString().replace(/\n$/,"")||"",U=P.mermaidBlockIsComplete(n,I);return t.jsxRuntimeExports.jsx(T.default,{chart:I,frozen:U})}return t.jsxRuntimeExports.jsx("code",{className:o,...A,children:l})},table:({...e})=>t.jsxRuntimeExports.jsx("div",{className:"content-render-table-container",children:t.jsxRuntimeExports.jsx("table",{className:"content-render-table",...e})}),th:({...e})=>t.jsxRuntimeExports.jsx("th",{className:"content-render-th",...e}),td:({...e})=>t.jsxRuntimeExports.jsx("td",{className:"content-render-td",...e}),tr:({...e})=>t.jsxRuntimeExports.jsx("tr",{className:"content-render-tr",...e}),li:({node:e,...o})=>{const l=e?.properties?.className;return typeof l=="string"&&l.includes("task-list-item")||Array.isArray(l)&&l.includes("task-list-item")?t.jsxRuntimeExports.jsx("li",{className:"content-render-task-list-item",...o}):t.jsxRuntimeExports.jsx("li",{...o})},ol:({...e})=>t.jsxRuntimeExports.jsx("ol",{className:"content-render-ol",...e}),ul:({...e})=>t.jsxRuntimeExports.jsx("ul",{className:"content-render-ul",...e}),input:({...e})=>e.type==="checkbox"?t.jsxRuntimeExports.jsx("input",{type:"checkbox",className:"content-render-checkbox",disabled:!0,...e}):t.jsxRuntimeExports.jsx("input",{...e}),a:({children:e,...o})=>t.jsxRuntimeExports.jsx("a",{target:"_blank",rel:"noopener noreferrer",...o,children:e}),pre:e=>t.jsxRuntimeExports.jsx(F.default,{...e,copyButtonText:s,copiedButtonText:v})},{displayContent:q,isComplete:M}=D.default({content:L,typingSpeed:a,disabled:!f}),k=c.useMemo(()=>J.splitContentSegments(n,!0),[n]),h=k.some(e=>e.type==="sandbox"),V=c.useMemo(()=>oe(k),[k]),_=c.useMemo(()=>P.parseMarkdownSegments(q),[q]),S=c.useRef(!1);return c.useEffect(()=>{h||M&&!S.current&&(S.current=!0,m?.())},[h,M,m]),c.useEffect(()=>{h||(S.current=!1)},[h,n]),h?t.jsxRuntimeExports.jsx("div",{className:"content-render markdown-body",children:V.map((e,o)=>e.type==="sandbox"?t.jsxRuntimeExports.jsx(G.default,{hideFullScreen:!0,content:e.value,className:"content-render-iframe",loadingText:x,styleLoadingText:p,scriptLoadingText:d,fullScreenButtonText:b,mode:y},`sandbox-${o}`):t.jsxRuntimeExports.jsx(C,{components:w,content:H.normalizeInlineHtml(e.value)},`md-${o}`))}):t.jsxRuntimeExports.jsxs("div",{className:"content-render markdown-body",children:[_.map((e,o)=>{if(e.type==="text")return t.jsxRuntimeExports.jsx(C,{components:w,content:e.value},o);if(e.type==="mermaid")return t.jsxRuntimeExports.jsx(T.default,{chart:e.value,frozen:!e.complete},o);if(e.type==="svg")return t.jsxRuntimeExports.jsx(se,{svg:e.value},o)}),r&&t.jsxRuntimeExports.jsx("div",{className:"content-render-custom-bar",children:c.createElement(r,{content:n,displayContent:q,onSend:i})})]})};exports.MarkdownRenderer=C;exports.default=ie;
|
|
6
6
|
//# sourceMappingURL=ContentRender.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentRender.cjs.js","sources":["../../../src/components/ContentRender/ContentRender.tsx"],"sourcesContent":["import \"highlight.js/styles/github.css\";\nimport \"katex/dist/katex.min.css\";\nimport React, { useEffect, useMemo, useRef } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeRaw from \"rehype-raw\";\nimport remarkBreaks from \"remark-breaks\";\nimport remarkFlow from \"remark-flow\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport { CustomRenderBarProps, OnSendContentParams } from \"../types\";\nimport \"./contentRender.css\";\nimport \"./github-markdown-light.css\";\nimport CodeBlock from \"./CodeBlock\";\nimport CustomButtonInputVariable, {\n ComponentsWithCustomVariable,\n} from \"./plugins/CustomVariable\";\nimport MermaidChart from \"./plugins/MermaidChart\";\nimport useTypewriterStateMachine from \"./useTypewriterStateMachine\";\nimport {\n preserveCustomVariableProperties,\n restoreCustomVariableProperties,\n} from \"./utils/custom-variable-props\";\nimport {\n highlightLanguages,\n subsetLanguages,\n} from \"./utils/highlight-languages\";\n// import { processMarkdownText } from \"./utils/process-markdown\";\nimport {\n parseMarkdownSegments,\n mermaidBlockIsComplete,\n} from \"./utils/mermaid-parse\";\nimport { normalizeInlineHtml } from \"./utils/normalize-inline-html\";\n// Define component Props type\nexport interface ContentRenderProps {\n content: string;\n /**\n+ * Callback invoked when the custom button after content is clicked.\n+ * This button is rendered via the `<custom-button-after-content>` tag in markdown content.\n+ * @example\n+ * ```tsx\n+ * <ContentRender\n+ * content=\"Hello <custom-button-after-content>Ask</custom-button-after-content>\"\n+ * onClickCustomButtonAfterContent={() => console.log('Button clicked')}\n+ * />\n+ * ```\n+ */\n customRenderBar?: CustomRenderBarProps;\n onClickCustomButtonAfterContent?: () => void;\n onSend?: (content: OnSendContentParams) => void;\n typingSpeed?: number;\n enableTypewriter?: boolean;\n defaultButtonText?: string;\n defaultInputText?: string; // Text input by user\n defaultSelectedValues?: string[]; // Default selected values for multi-select\n readonly?: boolean;\n onTypeFinished?: () => void;\n // Multi-select confirm button text (i18n support)\n confirmButtonText?: string;\n // Copy button text (i18n support)\n copyButtonText?: string;\n // Copied state text (i18n support)\n copiedButtonText?: string;\n // Dynamic interaction format for multi-select support\n dynamicInteractionFormat?: string;\n beforeSend?: (param: OnSendContentParams) => boolean;\n // tooltipMinLength?: number; // Control minimum character length for tooltip display, default 10\n}\n\n// Render svg string via Shadow DOM to avoid markdown wrapping\nconst SvgBlockInShadow: React.FC<{ svg: string }> = ({ svg }) => {\n const hostRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const host = hostRef.current;\n if (!host) return;\n const shadowRoot = host.shadowRoot ?? host.attachShadow({ mode: \"open\" });\n const styleId = \"content-render-svg-style\";\n let styleEl = shadowRoot.getElementById(styleId) as HTMLStyleElement | null;\n\n if (!styleEl) {\n styleEl = document.createElement(\"style\");\n styleEl.id = styleId;\n // Keep intrinsic SVG width so the wrapper can scroll horizontally when needed\n styleEl.textContent = `\n svg { height: auto; display: inline-block; }\n svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }\n svg.content-render-svg-el--fixed { max-width: none; }\n `;\n shadowRoot.appendChild(styleEl);\n }\n\n const nodesToRemove = Array.from(shadowRoot.childNodes).filter(\n (node) => node !== styleEl\n );\n nodesToRemove.forEach((node) => shadowRoot.removeChild(node));\n\n const template = document.createElement(\"template\");\n template.innerHTML = svg;\n shadowRoot.append(template.content.cloneNode(true));\n\n let hasResponsiveSvg = false;\n let hasFixedSvg = false;\n\n shadowRoot.querySelectorAll(\"svg\").forEach((svgEl) => {\n // Derive responsive sizing from viewBox so pure viewBox SVGs stay visible and fluid\n const viewBox = svgEl.getAttribute(\"viewBox\");\n if (!viewBox) return;\n\n const dimensions = viewBox\n .trim()\n .split(/[\\s,]+/)\n .map((value) => Number(value));\n\n if (dimensions.length !== 4 || dimensions.some(Number.isNaN)) return;\n\n const [, , viewBoxWidth, viewBoxHeight] = dimensions;\n const widthAttr = svgEl.getAttribute(\"width\");\n const heightAttr = svgEl.getAttribute(\"height\");\n const hasWidth = !!widthAttr && widthAttr !== \"0\";\n const hasHeight = !!heightAttr && heightAttr !== \"0\";\n const shouldUseResponsiveSize = !hasWidth && !hasHeight;\n\n if (shouldUseResponsiveSize) {\n hasResponsiveSvg = true;\n svgEl.classList.add(\"content-render-svg-el--responsive\");\n svgEl.classList.remove(\"content-render-svg-el--fixed\");\n svgEl.style.width = \"100%\";\n svgEl.style.height = \"auto\";\n if (!svgEl.style.aspectRatio && viewBoxHeight > 0) {\n svgEl.style.aspectRatio = `${viewBoxWidth} / ${viewBoxHeight}`;\n }\n return;\n }\n\n hasFixedSvg = true;\n svgEl.classList.add(\"content-render-svg-el--fixed\");\n svgEl.classList.remove(\"content-render-svg-el--responsive\");\n if (!hasWidth && viewBoxWidth > 0) {\n svgEl.setAttribute(\"width\", `${viewBoxWidth}`);\n }\n if (!hasHeight && viewBoxHeight > 0) {\n svgEl.setAttribute(\"height\", `${viewBoxHeight}`);\n }\n });\n\n const hostResponsive = hasResponsiveSvg && !hasFixedSvg;\n host.classList.toggle(\"content-render-svg--responsive\", hostResponsive);\n host.classList.toggle(\"content-render-svg--fixed\", !hostResponsive);\n }, [svg]);\n\n return (\n <div className=\"content-render-svg-scroll\">\n <div className=\"content-render-svg\" ref={hostRef} />\n </div>\n );\n};\n\n// Extended component interface\ntype CustomComponents = ComponentsWithCustomVariable & {\n \"custom-button-after-content\"?: React.ComponentType<{\n children: React.ReactNode;\n }>;\n};\n\nconst ContentRender: React.FC<ContentRenderProps> = ({\n content,\n customRenderBar,\n onSend,\n typingSpeed = 30,\n enableTypewriter = false,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n readonly = false,\n onTypeFinished,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n onClickCustomButtonAfterContent,\n beforeSend,\n // tooltipMinLength,\n}) => {\n const normalizedContent = useMemo(\n () => normalizeInlineHtml(content),\n [content]\n );\n\n // Use custom Hook to handle typewriter effect\n const { displayContent, isComplete } = useTypewriterStateMachine({\n // processMarkdownText will let code block printf(\"You win!\\n\") become printf(\"You win!<br/>\");\n // content: processMarkdownText(content),\n content: normalizedContent,\n typingSpeed,\n disabled: !enableTypewriter,\n });\n\n const components: CustomComponents = {\n \"custom-button-after-content\": ({\n children,\n }: {\n children: React.ReactNode;\n }) => {\n return (\n <button\n className=\"content-render-custom-button-after-content\"\n onClick={onClickCustomButtonAfterContent}\n >\n <span className=\"content-render-custom-button-after-content-inner\">\n {children}\n </span>\n </button>\n );\n },\n \"custom-variable\": (props) => (\n <CustomButtonInputVariable\n {...props}\n readonly={readonly}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n onSend={onSend}\n beforeSend={beforeSend}\n confirmButtonText={confirmButtonText}\n // tooltipMinLength={tooltipMinLength}\n />\n ),\n code: (props) => {\n const { className, children, ...rest } = props as {\n className?: string;\n children?: React.ReactNode;\n };\n const match = /language-(\\w+)/.exec(className || \"\");\n const language = match?.[1];\n if (language === \"mermaid\") {\n const chartContent = children?.toString().replace(/\\n$/, \"\") || \"\";\n const frozen = mermaidBlockIsComplete(content, chartContent);\n return <MermaidChart chart={chartContent} frozen={frozen} />;\n }\n\n return (\n <code className={className} {...rest}>\n {children}\n </code>\n );\n },\n table: ({ ...props }) => (\n <div className=\"content-render-table-container\">\n <table className=\"content-render-table\" {...props} />\n </div>\n ),\n th: ({ ...props }) => <th className=\"content-render-th\" {...props} />,\n td: ({ ...props }) => <td className=\"content-render-td\" {...props} />,\n tr: ({ ...props }) => <tr className=\"content-render-tr\" {...props} />,\n li: ({ node, ...props }) => {\n const className = node?.properties?.className;\n const hasTaskListItem =\n (typeof className === \"string\" &&\n className.includes(\"task-list-item\")) ||\n (Array.isArray(className) && className.includes(\"task-list-item\"));\n if (hasTaskListItem) {\n return <li className=\"content-render-task-list-item\" {...props} />;\n }\n return <li {...props} />;\n },\n ol: ({ ...props }) => <ol className=\"content-render-ol\" {...props} />,\n ul: ({ ...props }) => <ul className=\"content-render-ul\" {...props} />,\n input: ({ ...props }) => {\n if (props.type === \"checkbox\") {\n return (\n <input\n type=\"checkbox\"\n className=\"content-render-checkbox\"\n disabled\n {...props}\n />\n );\n }\n return <input {...props} />;\n },\n a: ({ children, ...props }) => (\n <a target=\"_blank\" rel=\"noopener noreferrer\" {...props}>\n {children}\n </a>\n ),\n pre: (props) => (\n <CodeBlock\n {...props}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n />\n ),\n };\n\n const hasCompleted = useRef(false);\n\n useEffect(() => {\n if (isComplete && !hasCompleted.current) {\n hasCompleted.current = true; // Mark as completed\n onTypeFinished?.(); // Call the passed callback\n }\n }, [isComplete, onTypeFinished]);\n useEffect(() => {\n hasCompleted.current = false; // Reset completion status when content changes\n }, [content]);\n\n const segments = parseMarkdownSegments(displayContent);\n\n return (\n <div className={`content-render markdown-body`}>\n {segments.map((seg, index) => {\n if (seg.type === \"text\") {\n return (\n <ReactMarkdown\n key={index}\n remarkPlugins={[remarkGfm, remarkMath, remarkFlow, remarkBreaks]}\n rehypePlugins={[\n preserveCustomVariableProperties,\n rehypeRaw,\n restoreCustomVariableProperties,\n [\n rehypeHighlight,\n { languages: highlightLanguages, subset: subsetLanguages },\n ],\n rehypeKatex,\n ]}\n components={components}\n >\n {seg.value}\n </ReactMarkdown>\n );\n }\n\n if (seg.type === \"mermaid\") {\n return (\n <MermaidChart\n key={index}\n chart={seg.value}\n frozen={!seg.complete}\n />\n );\n }\n\n if (seg.type === \"svg\") {\n return <SvgBlockInShadow key={index} svg={seg.value} />;\n }\n })}\n\n {customRenderBar && (\n <div className=\"content-render-custom-bar\">\n {React.createElement(customRenderBar, {\n content,\n displayContent,\n onSend,\n })}\n </div>\n )}\n </div>\n );\n};\n\nexport default ContentRender;\n"],"names":["SvgBlockInShadow","svg","hostRef","useRef","useEffect","host","shadowRoot","styleId","styleEl","node","template","hasResponsiveSvg","hasFixedSvg","svgEl","viewBox","dimensions","value","viewBoxWidth","viewBoxHeight","widthAttr","heightAttr","hasWidth","hasHeight","hostResponsive","jsx","ContentRender","content","customRenderBar","onSend","typingSpeed","enableTypewriter","defaultButtonText","defaultInputText","defaultSelectedValues","readonly","onTypeFinished","confirmButtonText","copyButtonText","copiedButtonText","onClickCustomButtonAfterContent","beforeSend","normalizedContent","useMemo","normalizeInlineHtml","displayContent","isComplete","useTypewriterStateMachine","components","children","props","CustomButtonInputVariable","className","rest","chartContent","frozen","mermaidBlockIsComplete","MermaidChart","CodeBlock","hasCompleted","segments","parseMarkdownSegments","jsxs","seg","index","ReactMarkdown","remarkGfm","remarkMath","remarkFlow","remarkBreaks","preserveCustomVariableProperties","rehypeRaw","restoreCustomVariableProperties","rehypeHighlight","highlightLanguages","subsetLanguages","rehypeKatex","React"],"mappings":"o5DAuEMA,EAA8C,CAAC,CAAE,IAAAC,KAAU,CAC/D,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EAE3CC,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAOH,EAAQ,QACrB,GAAI,CAACG,EAAM,OACX,MAAMC,EAAaD,EAAK,YAAcA,EAAK,aAAa,CAAE,KAAM,OAAQ,EAClEE,EAAU,2BAChB,IAAIC,EAAUF,EAAW,eAAeC,CAAO,EAE1CC,IACHA,EAAU,SAAS,cAAc,OAAO,EACxCA,EAAQ,GAAKD,EAEbC,EAAQ,YAAc;AAAA;AAAA;AAAA;AAAA,QAKtBF,EAAW,YAAYE,CAAO,GAGV,MAAM,KAAKF,EAAW,UAAU,EAAE,O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EC,SAAAe,EAAI,KAAA,EAdAC,CAAA,EAmBX,GAAID,EAAI,OAAS,UACf,OACEtC,EAAAA,kBAAAA,IAACgC,EAAAA,QAAA,CAEC,MAAOM,EAAI,MACX,OAAQ,CAACA,EAAI,QAAA,EAFRC,CAAA,EAOX,GAAID,EAAI,OAAS,MACf,OAAOtC,EAAAA,kBAAAA,IAACxB,EAAA,CAA6B,IAAK8D,EAAI,OAAhBC,CAAuB,CAEzD,CAAC,EAEApC,GACCH,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,4BACZ,SAAAoD,EAAM,cAAcjD,EAAiB,CACpC,QAAAD,EACA,eAAAkB,EACA,OAAAhB,CAAA,CACD,CAAA,CACH,CAAA,EAEJ,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ContentRender.cjs.js","sources":["../../../src/components/ContentRender/ContentRender.tsx"],"sourcesContent":["import \"highlight.js/styles/github.css\";\nimport \"katex/dist/katex.min.css\";\nimport React, { useEffect, useMemo, useRef } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeRaw from \"rehype-raw\";\nimport remarkBreaks from \"remark-breaks\";\nimport remarkFlow from \"remark-flow\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport { CustomRenderBarProps, OnSendContentParams } from \"../types\";\nimport \"./contentRender.css\";\nimport \"./github-markdown-light.css\";\nimport CodeBlock from \"./CodeBlock\";\nimport CustomButtonInputVariable, {\n ComponentsWithCustomVariable,\n} from \"./plugins/CustomVariable\";\nimport MermaidChart from \"./plugins/MermaidChart\";\nimport useTypewriterStateMachine from \"./useTypewriterStateMachine\";\nimport {\n preserveCustomVariableProperties,\n restoreCustomVariableProperties,\n} from \"./utils/custom-variable-props\";\nimport {\n highlightLanguages,\n subsetLanguages,\n} from \"./utils/highlight-languages\";\n// import { processMarkdownText } from \"./utils/process-markdown\";\nimport {\n parseMarkdownSegments,\n mermaidBlockIsComplete,\n} from \"./utils/mermaid-parse\";\nimport { normalizeInlineHtml } from \"./utils/normalize-inline-html\";\nimport IframeSandbox from \"./IframeSandbox\";\nimport {\n splitContentSegments,\n type RenderSegment,\n} from \"./utils/split-content\";\n// Define component Props type\nexport interface ContentRenderProps {\n content: string;\n /**\n+ * Callback invoked when the custom button after content is clicked.\n+ * This button is rendered via the `<custom-button-after-content>` tag in markdown content.\n+ * @example\n+ * ```tsx\n+ * <ContentRender\n+ * content=\"Hello <custom-button-after-content>Ask</custom-button-after-content>\"\n+ * onClickCustomButtonAfterContent={() => console.log('Button clicked')}\n+ * />\n+ * ```\n+ */\n customRenderBar?: CustomRenderBarProps;\n onClickCustomButtonAfterContent?: () => void;\n onSend?: (content: OnSendContentParams) => void;\n typingSpeed?: number;\n enableTypewriter?: boolean;\n defaultButtonText?: string;\n defaultInputText?: string; // Text input by user\n defaultSelectedValues?: string[]; // Default selected values for multi-select\n readonly?: boolean;\n onTypeFinished?: () => void;\n // Multi-select confirm button text (i18n support)\n confirmButtonText?: string;\n // Copy button text (i18n support)\n copyButtonText?: string;\n // Copied state text (i18n support)\n copiedButtonText?: string;\n // Dynamic interaction format for multi-select support\n dynamicInteractionFormat?: string;\n // Loading text before first HTML block renders inside iframe (i18n support)\n sandboxLoadingText?: string;\n // Loading text while styles are being generated inside iframe\n sandboxStyleLoadingText?: string;\n // Loading text while scripts are being cached/executed inside iframe\n sandboxScriptLoadingText?: string;\n // Fullscreen button text for iframe sandbox\n sandboxFullscreenButtonText?: string;\n // Sandbox render mode\n sandboxMode?: \"content\" | \"blackboard\";\n beforeSend?: (param: OnSendContentParams) => boolean;\n // tooltipMinLength?: number; // Control minimum character length for tooltip display, default 10\n}\n\n// Render svg string via Shadow DOM to avoid markdown wrapping\nconst SvgBlockInShadow: React.FC<{ svg: string }> = ({ svg }) => {\n const hostRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const host = hostRef.current;\n if (!host) return;\n const shadowRoot = host.shadowRoot ?? host.attachShadow({ mode: \"open\" });\n const styleId = \"content-render-svg-style\";\n let styleEl = shadowRoot.getElementById(styleId) as HTMLStyleElement | null;\n\n if (!styleEl) {\n styleEl = document.createElement(\"style\");\n styleEl.id = styleId;\n // Keep intrinsic SVG width so the wrapper can scroll horizontally when needed\n styleEl.textContent = `\n svg { height: auto; display: inline-block; }\n svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }\n svg.content-render-svg-el--fixed { max-width: none; }\n `;\n shadowRoot.appendChild(styleEl);\n }\n\n const nodesToRemove = Array.from(shadowRoot.childNodes).filter(\n (node) => node !== styleEl\n );\n nodesToRemove.forEach((node) => shadowRoot.removeChild(node));\n\n const template = document.createElement(\"template\");\n template.innerHTML = svg;\n shadowRoot.append(template.content.cloneNode(true));\n\n let hasResponsiveSvg = false;\n let hasFixedSvg = false;\n\n shadowRoot.querySelectorAll(\"svg\").forEach((svgEl) => {\n // Derive responsive sizing from viewBox so pure viewBox SVGs stay visible and fluid\n const viewBox = svgEl.getAttribute(\"viewBox\");\n if (!viewBox) return;\n\n const dimensions = viewBox\n .trim()\n .split(/[\\s,]+/)\n .map((value) => Number(value));\n\n if (dimensions.length !== 4 || dimensions.some(Number.isNaN)) return;\n\n const [, , viewBoxWidth, viewBoxHeight] = dimensions;\n const widthAttr = svgEl.getAttribute(\"width\");\n const heightAttr = svgEl.getAttribute(\"height\");\n const hasWidth = !!widthAttr && widthAttr !== \"0\";\n const hasHeight = !!heightAttr && heightAttr !== \"0\";\n const shouldUseResponsiveSize = !hasWidth && !hasHeight;\n\n if (shouldUseResponsiveSize) {\n hasResponsiveSvg = true;\n svgEl.classList.add(\"content-render-svg-el--responsive\");\n svgEl.classList.remove(\"content-render-svg-el--fixed\");\n svgEl.style.width = \"100%\";\n svgEl.style.height = \"auto\";\n if (!svgEl.style.aspectRatio && viewBoxHeight > 0) {\n svgEl.style.aspectRatio = `${viewBoxWidth} / ${viewBoxHeight}`;\n }\n return;\n }\n\n hasFixedSvg = true;\n svgEl.classList.add(\"content-render-svg-el--fixed\");\n svgEl.classList.remove(\"content-render-svg-el--responsive\");\n if (!hasWidth && viewBoxWidth > 0) {\n svgEl.setAttribute(\"width\", `${viewBoxWidth}`);\n }\n if (!hasHeight && viewBoxHeight > 0) {\n svgEl.setAttribute(\"height\", `${viewBoxHeight}`);\n }\n });\n\n const hostResponsive = hasResponsiveSvg && !hasFixedSvg;\n host.classList.toggle(\"content-render-svg--responsive\", hostResponsive);\n host.classList.toggle(\"content-render-svg--fixed\", !hostResponsive);\n }, [svg]);\n\n return (\n <div className=\"content-render-svg-scroll\">\n <div className=\"content-render-svg\" ref={hostRef} />\n </div>\n );\n};\n\n// Extended component interface\ntype CustomComponents = ComponentsWithCustomVariable & {\n \"custom-button-after-content\"?: React.ComponentType<{\n children: React.ReactNode;\n }>;\n};\n\nconst remarkPlugins = [remarkGfm, remarkMath, remarkFlow, remarkBreaks];\n\nconst rehypePlugins = [\n preserveCustomVariableProperties,\n rehypeRaw,\n restoreCustomVariableProperties,\n [rehypeHighlight, { languages: highlightLanguages, subset: subsetLanguages }],\n rehypeKatex,\n];\n\nexport const MarkdownRenderer: React.FC<{\n content: string;\n components: CustomComponents;\n}> = ({ content: markdownContent, components }) => (\n <div className=\"markdown-renderer\">\n <ReactMarkdown\n remarkPlugins={remarkPlugins}\n rehypePlugins={rehypePlugins}\n components={components}\n >\n {markdownContent}\n </ReactMarkdown>\n </div>\n);\n\nconst mergeNonSandboxSegments = (segments: RenderSegment[]) => {\n if (segments.length <= 1) return segments;\n const merged: RenderSegment[] = [];\n\n segments.forEach((segment) => {\n if (segment.type === \"sandbox\") {\n merged.push(segment);\n return;\n }\n\n const last = merged[merged.length - 1];\n if (last && last.type !== \"sandbox\") {\n merged[merged.length - 1] = {\n type: \"markdown\",\n value: `${last.value}${segment.value}`,\n };\n return;\n }\n\n merged.push({ type: \"markdown\", value: segment.value });\n });\n\n return merged;\n};\n\nconst ContentRender: React.FC<ContentRenderProps> = ({\n content,\n customRenderBar,\n onSend,\n typingSpeed = 30,\n enableTypewriter = false,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n readonly = false,\n onTypeFinished,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n sandboxLoadingText,\n sandboxStyleLoadingText,\n sandboxScriptLoadingText,\n sandboxFullscreenButtonText,\n sandboxMode = \"content\",\n onClickCustomButtonAfterContent,\n beforeSend,\n // tooltipMinLength,\n}) => {\n const normalizedContent = useMemo(\n () => normalizeInlineHtml(content),\n [content]\n );\n\n // Use custom Hook to handle typewriter effect\n const components: CustomComponents = {\n \"custom-button-after-content\": ({\n children,\n }: {\n children: React.ReactNode;\n }) => {\n return (\n <button\n className=\"content-render-custom-button-after-content\"\n onClick={onClickCustomButtonAfterContent}\n >\n <span className=\"content-render-custom-button-after-content-inner\">\n {children}\n </span>\n </button>\n );\n },\n \"custom-variable\": (props) => (\n <CustomButtonInputVariable\n {...props}\n readonly={readonly}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n onSend={onSend}\n beforeSend={beforeSend}\n confirmButtonText={confirmButtonText}\n // tooltipMinLength={tooltipMinLength}\n />\n ),\n code: (props) => {\n const { className, children, ...rest } = props as {\n className?: string;\n children?: React.ReactNode;\n };\n const match = /language-(\\w+)/.exec(className || \"\");\n const language = match?.[1];\n if (language === \"mermaid\") {\n const chartContent = children?.toString().replace(/\\n$/, \"\") || \"\";\n const frozen = mermaidBlockIsComplete(content, chartContent);\n return <MermaidChart chart={chartContent} frozen={frozen} />;\n }\n\n return (\n <code className={className} {...rest}>\n {children}\n </code>\n );\n },\n table: ({ ...props }) => (\n <div className=\"content-render-table-container\">\n <table className=\"content-render-table\" {...props} />\n </div>\n ),\n th: ({ ...props }) => <th className=\"content-render-th\" {...props} />,\n td: ({ ...props }) => <td className=\"content-render-td\" {...props} />,\n tr: ({ ...props }) => <tr className=\"content-render-tr\" {...props} />,\n li: ({ node, ...props }) => {\n const className = node?.properties?.className;\n const hasTaskListItem =\n (typeof className === \"string\" &&\n className.includes(\"task-list-item\")) ||\n (Array.isArray(className) && className.includes(\"task-list-item\"));\n if (hasTaskListItem) {\n return <li className=\"content-render-task-list-item\" {...props} />;\n }\n return <li {...props} />;\n },\n ol: ({ ...props }) => <ol className=\"content-render-ol\" {...props} />,\n ul: ({ ...props }) => <ul className=\"content-render-ul\" {...props} />,\n input: ({ ...props }) => {\n if (props.type === \"checkbox\") {\n return (\n <input\n type=\"checkbox\"\n className=\"content-render-checkbox\"\n disabled\n {...props}\n />\n );\n }\n return <input {...props} />;\n },\n a: ({ children, ...props }) => (\n <a target=\"_blank\" rel=\"noopener noreferrer\" {...props}>\n {children}\n </a>\n ),\n pre: (props) => (\n <CodeBlock\n {...props}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n />\n ),\n };\n\n const { displayContent, isComplete } = useTypewriterStateMachine({\n // processMarkdownText will let code block printf(\"You win!\\n\") become printf(\"You win!<br/>\");\n // content: processMarkdownText(content),\n content: normalizedContent,\n typingSpeed,\n disabled: !enableTypewriter,\n });\n\n const renderSegments = useMemo(\n () => splitContentSegments(content, true),\n [content]\n );\n\n const hasSandbox = renderSegments.some(\n (segment) => segment.type === \"sandbox\"\n );\n const mergedRenderSegments = useMemo(\n () => mergeNonSandboxSegments(renderSegments),\n [renderSegments]\n );\n\n const segments = useMemo(\n () => parseMarkdownSegments(displayContent),\n [displayContent]\n );\n\n const hasCompleted = useRef(false);\n\n useEffect(() => {\n if (hasSandbox) return;\n if (isComplete && !hasCompleted.current) {\n hasCompleted.current = true; // Mark as completed\n onTypeFinished?.(); // Call the passed callback\n }\n }, [hasSandbox, isComplete, onTypeFinished]);\n\n useEffect(() => {\n if (hasSandbox) return;\n hasCompleted.current = false; // Reset completion status when content changes\n }, [hasSandbox, content]);\n\n if (hasSandbox) {\n return (\n <div className=\"content-render markdown-body\">\n {mergedRenderSegments.map((segment, idx) =>\n segment.type === \"sandbox\" ? (\n <IframeSandbox\n key={`sandbox-${idx}`}\n hideFullScreen\n content={segment.value}\n className=\"content-render-iframe\"\n loadingText={sandboxLoadingText}\n styleLoadingText={sandboxStyleLoadingText}\n scriptLoadingText={sandboxScriptLoadingText}\n fullScreenButtonText={sandboxFullscreenButtonText}\n mode={sandboxMode}\n />\n ) : (\n <MarkdownRenderer\n key={`md-${idx}`}\n components={components}\n content={normalizeInlineHtml(segment.value)}\n />\n )\n )}\n </div>\n );\n }\n\n return (\n <div className=\"content-render markdown-body\">\n {segments.map((seg, index) => {\n if (seg.type === \"text\") {\n return (\n <MarkdownRenderer\n key={index}\n components={components}\n content={seg.value}\n />\n );\n }\n\n if (seg.type === \"mermaid\") {\n return (\n <MermaidChart\n key={index}\n chart={seg.value}\n frozen={!seg.complete}\n />\n );\n }\n\n if (seg.type === \"svg\") {\n return <SvgBlockInShadow key={index} svg={seg.value} />;\n }\n })}\n\n {customRenderBar && (\n <div className=\"content-render-custom-bar\">\n {React.createElement(customRenderBar, {\n content,\n displayContent,\n onSend,\n })}\n </div>\n )}\n </div>\n );\n};\n\nexport default ContentRender;\n"],"names":["SvgBlockInShadow","svg","hostRef","useRef","useEffect","host","shadowRoot","styleId","styleEl","node","template","hasResponsiveSvg","hasFixedSvg","svgEl","viewBox","dimensions","value","viewBoxWidth","viewBoxHeight","widthAttr","heightAttr","hasWidth","hasHeight","hostResponsive","jsx","remarkPlugins","remarkGfm","remarkMath","remarkFlow","remarkBreaks","rehypePlugins","preserveCustomVariableProperties","rehypeRaw","restoreCustomVariableProperties","rehypeHighlight","highlightLanguages","subsetLanguages","rehypeKatex","MarkdownRenderer","markdownContent","components","ReactMarkdown","mergeNonSandboxSegments","segments","merged","segment","last","ContentRender","content","customRenderBar","onSend","typingSpeed","enableTypewriter","defaultButtonText","defaultInputText","defaultSelectedValues","readonly","onTypeFinished","confirmButtonText","copyButtonText","copiedButtonText","sandboxLoadingText","sandboxStyleLoadingText","sandboxScriptLoadingText","sandboxFullscreenButtonText","sandboxMode","onClickCustomButtonAfterContent","beforeSend","normalizedContent","useMemo","normalizeInlineHtml","children","props","CustomButtonInputVariable","className","rest","chartContent","frozen","mermaidBlockIsComplete","MermaidChart","CodeBlock","displayContent","isComplete","useTypewriterStateMachine","renderSegments","splitContentSegments","hasSandbox","mergedRenderSegments","parseMarkdownSegments","hasCompleted","idx","IframeSandbox","jsxs","seg","index","React"],"mappings":"o+DAsFMA,GAA8C,CAAC,CAAE,IAAAC,KAAU,CAC/D,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EAE3CC,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAOH,EAAQ,QACrB,GAAI,CAACG,EAAM,OACX,MAAMC,EAAaD,EAAK,YAAcA,EAAK,aAAa,CAAE,KAAM,OAAQ,EAClEE,EAAU,2BAChB,IAAIC,EAAUF,EAAW,eAAeC,CAAO,EAE1CC,IACHA,EAAU,SAAS,cAAc,OAAO,EACxCA,EAAQ,GAAKD,EAEbC,EAAQ,YAAc;AAAA;AAAA;AAAA;AAAA,QAKtBF,EAAW,YAAYE,CAAO,GAGV,MAAM,KAAKF,EAAW,UAAU,EAAE,OACrDG,GAASA,IAASD,CAAA,EAEP,QAASC,GAASH,EAAW,YAAYG,CAAI,CAAC,EAE5D,MAAMC,EAAW,SAAS,cAAc,UAAU,EAClDA,EAAS,UAAYT,EACrBK,EAAW,OAAOI,EAAS,QAAQ,UAAU,EAAI,CAAC,EAElD,IAAIC,EAAmB,GACnBC,EAAc,GAElBN,EAAW,iBAAiB,KAAK,EAAE,QAASO,GAAU,CAEpD,MAAMC,EAAUD,EAAM,aAAa,SAAS,EAC5C,GAAI,CAACC,EAAS,OAEd,MAAMC,EAAaD,EAChB,KAAA,EACA,MAAM,QAAQ,EACd,IAAKE,GAAU,OAAOA,CAAK,CAAC,EAE/B,GAAID,EAAW,SAAW,GAAKA,EAAW,KAAK,OAAO,KAAK,EAAG,OAE9D,KAAM,CAAA,CAAA,CAAKE,EAAcC,CAA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A,CAA6B,IAAK6F,EAAI,OAAhBC,CAAuB,CAEzD,CAAC,EAEA7C,GACCzB,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,4BACZ,SAAAuE,EAAM,cAAc9C,EAAiB,CACpC,QAAAD,EACA,eAAAiC,EACA,OAAA/B,CAAA,CACD,CAAA,CACH,CAAA,EAEJ,CAEJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { CustomRenderBarProps, OnSendContentParams } from '../types';
|
|
3
|
+
import { ComponentsWithCustomVariable } from './plugins/CustomVariable';
|
|
3
4
|
export interface ContentRenderProps {
|
|
4
5
|
content: string;
|
|
5
6
|
/**
|
|
@@ -27,7 +28,21 @@ export interface ContentRenderProps {
|
|
|
27
28
|
copyButtonText?: string;
|
|
28
29
|
copiedButtonText?: string;
|
|
29
30
|
dynamicInteractionFormat?: string;
|
|
31
|
+
sandboxLoadingText?: string;
|
|
32
|
+
sandboxStyleLoadingText?: string;
|
|
33
|
+
sandboxScriptLoadingText?: string;
|
|
34
|
+
sandboxFullscreenButtonText?: string;
|
|
35
|
+
sandboxMode?: "content" | "blackboard";
|
|
30
36
|
beforeSend?: (param: OnSendContentParams) => boolean;
|
|
31
37
|
}
|
|
38
|
+
type CustomComponents = ComponentsWithCustomVariable & {
|
|
39
|
+
"custom-button-after-content"?: React.ComponentType<{
|
|
40
|
+
children: React.ReactNode;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
export declare const MarkdownRenderer: React.FC<{
|
|
44
|
+
content: string;
|
|
45
|
+
components: CustomComponents;
|
|
46
|
+
}>;
|
|
32
47
|
declare const ContentRender: React.FC<ContentRenderProps>;
|
|
33
48
|
export default ContentRender;
|
|
@@ -1,123 +1,156 @@
|
|
|
1
1
|
import { j as t } from "../../_virtual/jsx-runtime.es.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import W, { useMemo as S, useRef as V, useEffect as A } from "react";
|
|
5
|
+
import q from "../../_virtual/index.es.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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const a =
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
import G from "./CodeBlock.es.js";
|
|
9
|
+
import K from "./plugins/CustomVariable.es.js";
|
|
10
|
+
import z from "./plugins/MermaidChart.es.js";
|
|
11
|
+
import D from "./useTypewriterStateMachine.es.js";
|
|
12
|
+
import { preserveCustomVariableProperties as J, restoreCustomVariableProperties as O } from "./utils/custom-variable-props.es.js";
|
|
13
|
+
import { subsetLanguages as Q, highlightLanguages as X } from "./utils/highlight-languages.es.js";
|
|
14
|
+
import { parseMarkdownSegments as Y, mermaidBlockIsComplete as Z } from "./utils/mermaid-parse.es.js";
|
|
15
|
+
import { normalizeInlineHtml as H } from "./utils/normalize-inline-html.es.js";
|
|
16
|
+
import E from "./IframeSandbox.es.js";
|
|
17
|
+
import { splitContentSegments as ee } from "./utils/split-content.es.js";
|
|
18
|
+
import { Markdown as te } 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.es.js";
|
|
19
|
+
import re from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.es.js";
|
|
20
|
+
import ne from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.es.js";
|
|
21
|
+
import se from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.es.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.es.js";
|
|
23
|
+
import ae from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.es.js";
|
|
24
|
+
import ie from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.es.js";
|
|
25
|
+
const ce = ({ svg: n }) => {
|
|
26
|
+
const s = V(null);
|
|
27
|
+
return A(() => {
|
|
28
|
+
const a = s.current;
|
|
29
|
+
if (!a) return;
|
|
30
|
+
const i = a.shadowRoot ?? a.attachShadow({ mode: "open" }), f = "content-render-svg-style";
|
|
31
|
+
let c = i.getElementById(f);
|
|
32
|
+
c || (c = document.createElement("style"), c.id = f, c.textContent = `
|
|
31
33
|
svg { height: auto; display: inline-block; }
|
|
32
34
|
svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
|
|
33
35
|
svg.content-render-svg-el--fixed { max-width: none; }
|
|
34
|
-
`,
|
|
35
|
-
(r) => r !==
|
|
36
|
-
).forEach((r) =>
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const [, ,
|
|
46
|
-
if (!
|
|
47
|
-
|
|
36
|
+
`, i.appendChild(c)), Array.from(i.childNodes).filter(
|
|
37
|
+
(r) => r !== c
|
|
38
|
+
).forEach((r) => i.removeChild(r));
|
|
39
|
+
const x = document.createElement("template");
|
|
40
|
+
x.innerHTML = n, i.append(x.content.cloneNode(!0));
|
|
41
|
+
let g = !1, d = !1;
|
|
42
|
+
i.querySelectorAll("svg").forEach((r) => {
|
|
43
|
+
const b = r.getAttribute("viewBox");
|
|
44
|
+
if (!b) return;
|
|
45
|
+
const u = b.trim().split(/[\s,]+/).map((w) => Number(w));
|
|
46
|
+
if (u.length !== 4 || u.some(Number.isNaN)) return;
|
|
47
|
+
const [, , h, m] = u, y = r.getAttribute("width"), j = r.getAttribute("height"), k = !!y && y !== "0", N = !!j && j !== "0";
|
|
48
|
+
if (!k && !N) {
|
|
49
|
+
g = !0, r.classList.add("content-render-svg-el--responsive"), r.classList.remove("content-render-svg-el--fixed"), r.style.width = "100%", r.style.height = "auto", !r.style.aspectRatio && m > 0 && (r.style.aspectRatio = `${h} / ${m}`);
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
d = !0, r.classList.add("content-render-svg-el--fixed"), r.classList.remove("content-render-svg-el--responsive"), !k && h > 0 && r.setAttribute("width", `${h}`), !N && m > 0 && r.setAttribute("height", `${m}`);
|
|
51
53
|
});
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
}, [n]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref:
|
|
55
|
-
},
|
|
54
|
+
const v = g && !d;
|
|
55
|
+
a.classList.toggle("content-render-svg--responsive", v), a.classList.toggle("content-render-svg--fixed", !v);
|
|
56
|
+
}, [n]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: s }) });
|
|
57
|
+
}, le = [oe, ae, q, ie], me = [
|
|
58
|
+
J,
|
|
59
|
+
re,
|
|
60
|
+
O,
|
|
61
|
+
[ne, { languages: X, subset: Q }],
|
|
62
|
+
se
|
|
63
|
+
], P = ({ content: n, components: s }) => /* @__PURE__ */ t.jsx("div", { className: "markdown-renderer", children: /* @__PURE__ */ t.jsx(
|
|
64
|
+
te,
|
|
65
|
+
{
|
|
66
|
+
remarkPlugins: le,
|
|
67
|
+
rehypePlugins: me,
|
|
68
|
+
components: s,
|
|
69
|
+
children: n
|
|
70
|
+
}
|
|
71
|
+
) }), de = (n) => {
|
|
72
|
+
if (n.length <= 1) return n;
|
|
73
|
+
const s = [];
|
|
74
|
+
return n.forEach((a) => {
|
|
75
|
+
if (a.type === "sandbox") {
|
|
76
|
+
s.push(a);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const i = s[s.length - 1];
|
|
80
|
+
if (i && i.type !== "sandbox") {
|
|
81
|
+
s[s.length - 1] = {
|
|
82
|
+
type: "markdown",
|
|
83
|
+
value: `${i.value}${a.value}`
|
|
84
|
+
};
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
s.push({ type: "markdown", value: a.value });
|
|
88
|
+
}), s;
|
|
89
|
+
}, Ve = ({
|
|
56
90
|
content: n,
|
|
57
|
-
customRenderBar:
|
|
58
|
-
onSend:
|
|
59
|
-
typingSpeed:
|
|
60
|
-
enableTypewriter:
|
|
61
|
-
defaultButtonText:
|
|
62
|
-
defaultInputText:
|
|
63
|
-
defaultSelectedValues:
|
|
64
|
-
readonly:
|
|
65
|
-
onTypeFinished:
|
|
66
|
-
confirmButtonText:
|
|
91
|
+
customRenderBar: s,
|
|
92
|
+
onSend: a,
|
|
93
|
+
typingSpeed: i = 30,
|
|
94
|
+
enableTypewriter: f = !1,
|
|
95
|
+
defaultButtonText: c,
|
|
96
|
+
defaultInputText: B,
|
|
97
|
+
defaultSelectedValues: x,
|
|
98
|
+
readonly: g = !1,
|
|
99
|
+
onTypeFinished: d,
|
|
100
|
+
confirmButtonText: v,
|
|
67
101
|
copyButtonText: r,
|
|
68
|
-
copiedButtonText:
|
|
69
|
-
|
|
70
|
-
|
|
102
|
+
copiedButtonText: b,
|
|
103
|
+
sandboxLoadingText: u,
|
|
104
|
+
sandboxStyleLoadingText: h,
|
|
105
|
+
sandboxScriptLoadingText: m,
|
|
106
|
+
sandboxFullscreenButtonText: y,
|
|
107
|
+
sandboxMode: j = "content",
|
|
108
|
+
onClickCustomButtonAfterContent: k,
|
|
109
|
+
beforeSend: N
|
|
71
110
|
// tooltipMinLength,
|
|
72
111
|
}) => {
|
|
73
|
-
const
|
|
74
|
-
() =>
|
|
112
|
+
const I = S(
|
|
113
|
+
() => H(n),
|
|
75
114
|
[n]
|
|
76
|
-
),
|
|
77
|
-
// processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
|
|
78
|
-
// content: processMarkdownText(content),
|
|
79
|
-
content: l,
|
|
80
|
-
typingSpeed: a,
|
|
81
|
-
disabled: !g
|
|
82
|
-
}), N = {
|
|
115
|
+
), w = {
|
|
83
116
|
"custom-button-after-content": ({
|
|
84
117
|
children: e
|
|
85
118
|
}) => /* @__PURE__ */ t.jsx(
|
|
86
119
|
"button",
|
|
87
120
|
{
|
|
88
121
|
className: "content-render-custom-button-after-content",
|
|
89
|
-
onClick:
|
|
122
|
+
onClick: k,
|
|
90
123
|
children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
|
|
91
124
|
}
|
|
92
125
|
),
|
|
93
126
|
"custom-variable": (e) => /* @__PURE__ */ t.jsx(
|
|
94
|
-
|
|
127
|
+
K,
|
|
95
128
|
{
|
|
96
129
|
...e,
|
|
97
|
-
readonly:
|
|
98
|
-
defaultButtonText:
|
|
99
|
-
defaultInputText:
|
|
100
|
-
defaultSelectedValues:
|
|
101
|
-
onSend:
|
|
102
|
-
beforeSend:
|
|
103
|
-
confirmButtonText:
|
|
130
|
+
readonly: g,
|
|
131
|
+
defaultButtonText: c,
|
|
132
|
+
defaultInputText: B,
|
|
133
|
+
defaultSelectedValues: x,
|
|
134
|
+
onSend: a,
|
|
135
|
+
beforeSend: N,
|
|
136
|
+
confirmButtonText: v
|
|
104
137
|
}
|
|
105
138
|
),
|
|
106
139
|
code: (e) => {
|
|
107
|
-
const { className:
|
|
108
|
-
if (/language-(\w+)/.exec(
|
|
109
|
-
const
|
|
110
|
-
return /* @__PURE__ */ t.jsx(
|
|
140
|
+
const { className: o, children: l, ...$ } = e;
|
|
141
|
+
if (/language-(\w+)/.exec(o || "")?.[1] === "mermaid") {
|
|
142
|
+
const M = l?.toString().replace(/\n$/, "") || "", U = Z(n, M);
|
|
143
|
+
return /* @__PURE__ */ t.jsx(z, { chart: M, frozen: U });
|
|
111
144
|
}
|
|
112
|
-
return /* @__PURE__ */ t.jsx("code", { className:
|
|
145
|
+
return /* @__PURE__ */ t.jsx("code", { className: o, ...$, children: l });
|
|
113
146
|
},
|
|
114
147
|
table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
|
|
115
148
|
th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
|
|
116
149
|
td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
|
|
117
150
|
tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
|
|
118
|
-
li: ({ node: e, ...
|
|
119
|
-
const
|
|
120
|
-
return typeof
|
|
151
|
+
li: ({ node: e, ...o }) => {
|
|
152
|
+
const l = e?.properties?.className;
|
|
153
|
+
return typeof l == "string" && l.includes("task-list-item") || Array.isArray(l) && l.includes("task-list-item") ? /* @__PURE__ */ t.jsx("li", { className: "content-render-task-list-item", ...o }) : /* @__PURE__ */ t.jsx("li", { ...o });
|
|
121
154
|
},
|
|
122
155
|
ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
|
|
123
156
|
ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
|
|
@@ -130,64 +163,91 @@ const Y = ({ svg: n }) => {
|
|
|
130
163
|
...e
|
|
131
164
|
}
|
|
132
165
|
) : /* @__PURE__ */ t.jsx("input", { ...e }),
|
|
133
|
-
a: ({ children: e, ...
|
|
166
|
+
a: ({ children: e, ...o }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...o, children: e }),
|
|
134
167
|
pre: (e) => /* @__PURE__ */ t.jsx(
|
|
135
|
-
|
|
168
|
+
G,
|
|
136
169
|
{
|
|
137
170
|
...e,
|
|
138
171
|
copyButtonText: r,
|
|
139
|
-
copiedButtonText:
|
|
172
|
+
copiedButtonText: b
|
|
140
173
|
}
|
|
141
174
|
)
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
175
|
+
}, { displayContent: C, isComplete: T } = D({
|
|
176
|
+
// processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
|
|
177
|
+
// content: processMarkdownText(content),
|
|
178
|
+
content: I,
|
|
179
|
+
typingSpeed: i,
|
|
180
|
+
disabled: !f
|
|
181
|
+
}), R = S(
|
|
182
|
+
() => ee(n, !0),
|
|
183
|
+
[n]
|
|
184
|
+
), p = R.some(
|
|
185
|
+
(e) => e.type === "sandbox"
|
|
186
|
+
), _ = S(
|
|
187
|
+
() => de(R),
|
|
188
|
+
[R]
|
|
189
|
+
), F = S(
|
|
190
|
+
() => Y(C),
|
|
191
|
+
[C]
|
|
192
|
+
), L = V(!1);
|
|
193
|
+
return A(() => {
|
|
194
|
+
p || T && !L.current && (L.current = !0, d?.());
|
|
195
|
+
}, [p, T, d]), A(() => {
|
|
196
|
+
p || (L.current = !1);
|
|
197
|
+
}, [p, n]), p ? /* @__PURE__ */ t.jsx("div", { className: "content-render markdown-body", children: _.map(
|
|
198
|
+
(e, o) => e.type === "sandbox" ? /* @__PURE__ */ t.jsx(
|
|
199
|
+
E,
|
|
200
|
+
{
|
|
201
|
+
hideFullScreen: !0,
|
|
202
|
+
content: e.value,
|
|
203
|
+
className: "content-render-iframe",
|
|
204
|
+
loadingText: u,
|
|
205
|
+
styleLoadingText: h,
|
|
206
|
+
scriptLoadingText: m,
|
|
207
|
+
fullScreenButtonText: y,
|
|
208
|
+
mode: j
|
|
209
|
+
},
|
|
210
|
+
`sandbox-${o}`
|
|
211
|
+
) : /* @__PURE__ */ t.jsx(
|
|
212
|
+
P,
|
|
213
|
+
{
|
|
214
|
+
components: w,
|
|
215
|
+
content: H(e.value)
|
|
216
|
+
},
|
|
217
|
+
`md-${o}`
|
|
218
|
+
)
|
|
219
|
+
) }) : /* @__PURE__ */ t.jsxs("div", { className: "content-render markdown-body", children: [
|
|
220
|
+
F.map((e, o) => {
|
|
151
221
|
if (e.type === "text")
|
|
152
222
|
return /* @__PURE__ */ t.jsx(
|
|
153
|
-
|
|
223
|
+
P,
|
|
154
224
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
P,
|
|
158
|
-
K,
|
|
159
|
-
V,
|
|
160
|
-
[
|
|
161
|
-
D,
|
|
162
|
-
{ languages: U, subset: _ }
|
|
163
|
-
],
|
|
164
|
-
J
|
|
165
|
-
],
|
|
166
|
-
components: N,
|
|
167
|
-
children: e.value
|
|
225
|
+
components: w,
|
|
226
|
+
content: e.value
|
|
168
227
|
},
|
|
169
|
-
|
|
228
|
+
o
|
|
170
229
|
);
|
|
171
230
|
if (e.type === "mermaid")
|
|
172
231
|
return /* @__PURE__ */ t.jsx(
|
|
173
|
-
|
|
232
|
+
z,
|
|
174
233
|
{
|
|
175
234
|
chart: e.value,
|
|
176
235
|
frozen: !e.complete
|
|
177
236
|
},
|
|
178
|
-
|
|
237
|
+
o
|
|
179
238
|
);
|
|
180
239
|
if (e.type === "svg")
|
|
181
|
-
return /* @__PURE__ */ t.jsx(
|
|
240
|
+
return /* @__PURE__ */ t.jsx(ce, { svg: e.value }, o);
|
|
182
241
|
}),
|
|
183
|
-
|
|
242
|
+
s && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: W.createElement(s, {
|
|
184
243
|
content: n,
|
|
185
|
-
displayContent:
|
|
186
|
-
onSend:
|
|
244
|
+
displayContent: C,
|
|
245
|
+
onSend: a
|
|
187
246
|
}) })
|
|
188
247
|
] });
|
|
189
248
|
};
|
|
190
249
|
export {
|
|
191
|
-
|
|
250
|
+
P as MarkdownRenderer,
|
|
251
|
+
Ve as default
|
|
192
252
|
};
|
|
193
253
|
//# sourceMappingURL=ContentRender.es.js.map
|