markdown-flow-ui 0.1.83-beta.0 → 0.1.83

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.
Files changed (41) hide show
  1. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.js +1 -1
  2. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +1 -1
  3. 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.js +1 -1
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
  10. package/dist/_virtual/index10.js +2 -2
  11. package/dist/_virtual/index5.js +3 -5
  12. package/dist/_virtual/index5.js.map +1 -1
  13. package/dist/_virtual/index6.js +4 -4
  14. package/dist/_virtual/index7.js +5 -3
  15. package/dist/_virtual/index7.js.map +1 -1
  16. package/dist/_virtual/index8.js +2 -2
  17. package/dist/components/ContentRender/ContentRender.d.ts +0 -15
  18. package/dist/components/ContentRender/ContentRender.js +109 -146
  19. package/dist/components/ContentRender/ContentRender.js.map +1 -1
  20. package/dist/components/ContentRender/ContentRender.stories.d.ts +0 -2
  21. package/dist/components/ContentRender/index.d.ts +0 -5
  22. package/dist/components/ContentRender/index.js +1 -2
  23. package/dist/components/ContentRender/index.js.map +1 -1
  24. package/dist/components/MarkdownFlow/MarkdownFlow.js +3 -4
  25. package/dist/components/MarkdownFlow/MarkdownFlow.js.map +1 -1
  26. package/dist/index.js +8 -12
  27. package/dist/index.js.map +1 -1
  28. package/dist/markdown-flow-ui-lib.css +1 -1
  29. package/dist/renderer.d.ts +2 -6
  30. package/dist/renderer.js +6 -11
  31. package/dist/renderer.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/components/ContentRender/IframeSandbox.d.ts +0 -13
  34. package/dist/components/ContentRender/IframeSandbox.js +0 -104
  35. package/dist/components/ContentRender/IframeSandbox.js.map +0 -1
  36. package/dist/components/ContentRender/SandboxApp.d.ts +0 -11
  37. package/dist/components/ContentRender/SandboxApp.js +0 -181
  38. package/dist/components/ContentRender/SandboxApp.js.map +0 -1
  39. package/dist/components/ContentRender/utils/split-content.d.ts +0 -8
  40. package/dist/components/ContentRender/utils/split-content.js +0 -35
  41. package/dist/components/ContentRender/utils/split-content.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { __exports as c } from "../../../../../../../../../../_virtual/index10.js";
1
+ import { __exports as c } from "../../../../../../../../../../_virtual/index8.js";
2
2
  import { __require as v } from "./constants.js";
3
3
  var m;
4
4
  function g() {
@@ -1,4 +1,4 @@
1
- import { __module as s } from "../../../../../../../../_virtual/index8.js";
1
+ import { __module as s } from "../../../../../../../../_virtual/index10.js";
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
@@ -2,7 +2,7 @@ import { stringify as w } from "../../../../comma-separated-tokens@2.0.3/node_mo
2
2
  import { ok as u } from "../../../../devlop@1.1.0/node_modules/devlop/lib/default.js";
3
3
  import { svg as m, html as C } from "../../../../property-information@7.1.0/node_modules/property-information/index.js";
4
4
  import { stringify as N } from "../../../../space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js";
5
- import S from "../../../../../../../../../_virtual/index5.js";
5
+ import S from "../../../../../../../../../_virtual/index6.js";
6
6
  import { whitespace as j } from "../../../../hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.js";
7
7
  import { name as x } from "../../../../estree-util-is-identifier-name@3.0.0/node_modules/estree-util-is-identifier-name/lib/index.js";
8
8
  import { VFileMessage as h } from "../../../../vfile-message@4.0.3/node_modules/vfile-message/lib/index.js";
@@ -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/index7.js";
7
+ import { d as je } from "../../../../../../../../../../../_virtual/index5.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/index7.js";
3
+ import { d as G } from "../../../../../../../../../../../_virtual/index5.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/index7.js";
3
+ import { d as l } from "../../../../../../../../../../../_virtual/index5.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/index7.js";
4
+ import { d as he } from "../../../../../../../../../../../_virtual/index5.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/index7.js";
9
+ import { d as ne } from "../../../../../../../../../../../_virtual/index5.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) {
@@ -1,5 +1,5 @@
1
1
  import { bail as P } from "../../../../bail@2.0.2/node_modules/bail/index.js";
2
- import y from "../../../../../../../../../_virtual/index6.js";
2
+ import y from "../../../../../../../../../_virtual/index7.js";
3
3
  import z from "../../../../is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js";
4
4
  import { CallableInstance as C } from "./callable-instance.js";
5
5
  import { trough as A } from "../../../../trough@2.2.0/node_modules/trough/lib/index.js";
@@ -1,5 +1,5 @@
1
- var r = {};
1
+ var s = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ s as __module
4
4
  };
5
5
  //# sourceMappingURL=index10.js.map
@@ -1,8 +1,6 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.js";
3
- var t = o();
4
- const a = /* @__PURE__ */ r(t);
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();
5
3
  export {
6
- a as default
4
+ i as d
7
5
  };
8
6
  //# sourceMappingURL=index5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,7 +1,7 @@
1
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
- import { __require as r } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js";
3
- var t = r();
4
- const a = /* @__PURE__ */ e(t);
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.js";
3
+ var t = o();
4
+ const a = /* @__PURE__ */ r(t);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,6 +1,8 @@
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();
1
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
+ import { __require as r } from "../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js";
3
+ var t = r();
4
+ const a = /* @__PURE__ */ e(t);
3
5
  export {
4
- i as d
6
+ a as default
5
7
  };
6
8
  //# 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":";;;;"}
@@ -1,5 +1,5 @@
1
- var s = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- s as __module
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index8.js.map
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { CustomRenderBarProps, OnSendContentParams } from '../types';
3
- import { ComponentsWithCustomVariable } from './plugins/CustomVariable';
4
3
  export interface ContentRenderProps {
5
4
  content: string;
6
5
  /**
@@ -28,21 +27,7 @@ export interface ContentRenderProps {
28
27
  copyButtonText?: string;
29
28
  copiedButtonText?: string;
30
29
  dynamicInteractionFormat?: string;
31
- sandboxLoadingText?: string;
32
- sandboxStyleLoadingText?: string;
33
- sandboxScriptLoadingText?: string;
34
- sandboxFullscreenButtonText?: string;
35
- sandboxMode?: "content" | "blackboard";
36
30
  beforeSend?: (param: OnSendContentParams) => boolean;
37
31
  }
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
- }>;
47
32
  declare const ContentRender: React.FC<ContentRenderProps>;
48
33
  export default ContentRender;
@@ -1,138 +1,123 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import U, { useMemo as S, useRef as P, useEffect as L } from "react";
5
- import W from "../../_virtual/index.js";
4
+ import I, { useMemo as M, useRef as S, useEffect as k } from "react";
5
+ import z from "../../_virtual/index.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
- import q from "./CodeBlock.js";
9
- import F from "./plugins/CustomVariable.js";
10
- import $ from "./plugins/MermaidChart.js";
11
- import G from "./useTypewriterStateMachine.js";
12
- import { preserveCustomVariableProperties as K, restoreCustomVariableProperties as D } 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 z } 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 E } 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 ee from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js";
20
- import te from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.js";
21
- import re from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.js";
22
- import ne 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 oe from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";
25
- const ae = ({ svg: s }) => {
26
- const c = P(null);
27
- return L(() => {
28
- const o = c.current;
8
+ import H from "./CodeBlock.js";
9
+ import T from "./plugins/CustomVariable.js";
10
+ import L from "./plugins/MermaidChart.js";
11
+ import $ from "./useTypewriterStateMachine.js";
12
+ import { preserveCustomVariableProperties as P, restoreCustomVariableProperties as V } from "./utils/custom-variable-props.js";
13
+ import { subsetLanguages as _, highlightLanguages as U } from "./utils/highlight-languages.js";
14
+ import { parseMarkdownSegments as W, mermaidBlockIsComplete as q } from "./utils/mermaid-parse.js";
15
+ import { normalizeInlineHtml as F } from "./utils/normalize-inline-html.js";
16
+ import { Markdown as G } 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";
17
+ import K from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js";
18
+ import D from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.js";
19
+ import J from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.js";
20
+ import O from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js";
21
+ import Q from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.js";
22
+ import X from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";
23
+ const Y = ({ svg: n }) => {
24
+ const d = S(null);
25
+ return k(() => {
26
+ const o = d.current;
29
27
  if (!o) return;
30
- const a = o.shadowRoot ?? o.attachShadow({ mode: "open" }), x = "content-render-svg-style";
31
- let i = a.getElementById(x);
32
- i || (i = document.createElement("style"), i.id = x, i.textContent = `
28
+ const a = o.shadowRoot ?? o.attachShadow({ mode: "open" }), g = "content-render-svg-style";
29
+ let i = a.getElementById(g);
30
+ i || (i = document.createElement("style"), i.id = g, i.textContent = `
33
31
  svg { height: auto; display: inline-block; }
34
32
  svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
35
33
  svg.content-render-svg-el--fixed { max-width: none; }
36
34
  `, a.appendChild(i)), Array.from(a.childNodes).filter(
37
35
  (r) => r !== i
38
36
  ).forEach((r) => a.removeChild(r));
39
- const g = document.createElement("template");
40
- g.innerHTML = s, a.append(g.content.cloneNode(!0));
41
- let v = !1, d = !1;
37
+ const v = document.createElement("template");
38
+ v.innerHTML = n, a.append(v.content.cloneNode(!0));
39
+ let b = !1, u = !1;
42
40
  a.querySelectorAll("svg").forEach((r) => {
43
- const j = r.getAttribute("viewBox");
44
- if (!j) return;
45
- const u = j.trim().split(/[\s,]+/).map((p) => Number(p));
46
- if (u.length !== 4 || u.some(Number.isNaN)) return;
47
- const [, , h, l] = u, y = r.getAttribute("width"), N = r.getAttribute("height"), k = !!y && y !== "0", w = !!N && N !== "0";
48
- if (!k && !w) {
49
- v = !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 && l > 0 && (r.style.aspectRatio = `${h} / ${l}`);
41
+ const y = r.getAttribute("viewBox");
42
+ if (!y) return;
43
+ const h = y.trim().split(/[\s,]+/).map((e) => Number(e));
44
+ if (h.length !== 4 || h.some(Number.isNaN)) return;
45
+ const [, , p, l] = h, f = r.getAttribute("width"), x = r.getAttribute("height"), N = !!f && f !== "0", m = !!x && x !== "0";
46
+ if (!N && !m) {
47
+ b = !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 && l > 0 && (r.style.aspectRatio = `${p} / ${l}`);
50
48
  return;
51
49
  }
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}`), !w && l > 0 && r.setAttribute("height", `${l}`);
50
+ u = !0, r.classList.add("content-render-svg-el--fixed"), r.classList.remove("content-render-svg-el--responsive"), !N && p > 0 && r.setAttribute("width", `${p}`), !m && l > 0 && r.setAttribute("height", `${l}`);
53
51
  });
54
- const b = v && !d;
55
- o.classList.toggle("content-render-svg--responsive", b), o.classList.toggle("content-render-svg--fixed", !b);
56
- }, [s]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: c }) });
57
- }, ie = [ne, se, W, oe], ce = [
58
- K,
59
- ee,
60
- D,
61
- [te, { languages: O, subset: J }],
62
- re
63
- ], H = ({ content: s, components: c }) => /* @__PURE__ */ t.jsx("div", { className: "markdown-renderer", children: /* @__PURE__ */ t.jsx(
64
- E,
65
- {
66
- remarkPlugins: ie,
67
- rehypePlugins: ce,
68
- components: c,
69
- children: s
70
- }
71
- ) }), ze = ({
72
- content: s,
73
- customRenderBar: c,
52
+ const j = b && !u;
53
+ o.classList.toggle("content-render-svg--responsive", j), o.classList.toggle("content-render-svg--fixed", !j);
54
+ }, [n]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: d }) });
55
+ }, Ne = ({
56
+ content: n,
57
+ customRenderBar: d,
74
58
  onSend: o,
75
59
  typingSpeed: a = 30,
76
- enableTypewriter: x = !1,
60
+ enableTypewriter: g = !1,
77
61
  defaultButtonText: i,
78
- defaultInputText: A,
79
- defaultSelectedValues: g,
80
- readonly: v = !1,
81
- onTypeFinished: d,
82
- confirmButtonText: b,
62
+ defaultInputText: w,
63
+ defaultSelectedValues: v,
64
+ readonly: b = !1,
65
+ onTypeFinished: u,
66
+ confirmButtonText: j,
83
67
  copyButtonText: r,
84
- copiedButtonText: j,
85
- sandboxLoadingText: u,
86
- sandboxStyleLoadingText: h,
87
- sandboxScriptLoadingText: l,
88
- // sandboxFullscreenButtonText,
89
- sandboxMode: y = "content",
90
- onClickCustomButtonAfterContent: N,
91
- beforeSend: k
68
+ copiedButtonText: y,
69
+ onClickCustomButtonAfterContent: h,
70
+ beforeSend: p
92
71
  // tooltipMinLength,
93
72
  }) => {
94
- const w = S(
95
- () => z(s),
96
- [s]
97
- ), C = {
73
+ const l = M(
74
+ () => F(n),
75
+ [n]
76
+ ), { displayContent: f, isComplete: x } = $({
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 = {
98
83
  "custom-button-after-content": ({
99
84
  children: e
100
85
  }) => /* @__PURE__ */ t.jsx(
101
86
  "button",
102
87
  {
103
88
  className: "content-render-custom-button-after-content",
104
- onClick: N,
89
+ onClick: h,
105
90
  children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
106
91
  }
107
92
  ),
108
93
  "custom-variable": (e) => /* @__PURE__ */ t.jsx(
109
- F,
94
+ T,
110
95
  {
111
96
  ...e,
112
- readonly: v,
97
+ readonly: b,
113
98
  defaultButtonText: i,
114
- defaultInputText: A,
115
- defaultSelectedValues: g,
99
+ defaultInputText: w,
100
+ defaultSelectedValues: v,
116
101
  onSend: o,
117
- beforeSend: k,
118
- confirmButtonText: b
102
+ beforeSend: p,
103
+ confirmButtonText: j
119
104
  }
120
105
  ),
121
106
  code: (e) => {
122
- const { className: n, children: m, ...M } = e;
123
- if (/language-(\w+)/.exec(n || "")?.[1] === "mermaid") {
124
- const T = m?.toString().replace(/\n$/, "") || "", _ = X(s, T);
125
- return /* @__PURE__ */ t.jsx($, { chart: T, frozen: _ });
107
+ const { className: s, children: c, ...R } = e;
108
+ if (/language-(\w+)/.exec(s || "")?.[1] === "mermaid") {
109
+ const A = c?.toString().replace(/\n$/, "") || "", B = q(n, A);
110
+ return /* @__PURE__ */ t.jsx(L, { chart: A, frozen: B });
126
111
  }
127
- return /* @__PURE__ */ t.jsx("code", { className: n, ...M, children: m });
112
+ return /* @__PURE__ */ t.jsx("code", { className: s, ...R, children: c });
128
113
  },
129
114
  table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
130
115
  th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
131
116
  td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
132
117
  tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
133
- li: ({ node: e, ...n }) => {
134
- const m = e?.properties?.className;
135
- return typeof m == "string" && m.includes("task-list-item") || Array.isArray(m) && m.includes("task-list-item") ? /* @__PURE__ */ t.jsx("li", { className: "content-render-task-list-item", ...n }) : /* @__PURE__ */ t.jsx("li", { ...n });
118
+ li: ({ node: e, ...s }) => {
119
+ const c = e?.properties?.className;
120
+ 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", ...s }) : /* @__PURE__ */ t.jsx("li", { ...s });
136
121
  },
137
122
  ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
138
123
  ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
@@ -145,86 +130,64 @@ const ae = ({ svg: s }) => {
145
130
  ...e
146
131
  }
147
132
  ) : /* @__PURE__ */ t.jsx("input", { ...e }),
148
- a: ({ children: e, ...n }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
133
+ a: ({ children: e, ...s }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...s, children: e }),
149
134
  pre: (e) => /* @__PURE__ */ t.jsx(
150
- q,
135
+ H,
151
136
  {
152
137
  ...e,
153
138
  copyButtonText: r,
154
- copiedButtonText: j
139
+ copiedButtonText: y
155
140
  }
156
141
  )
157
- }, { displayContent: p, isComplete: B } = G({
158
- // processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
159
- // content: processMarkdownText(content),
160
- content: w,
161
- typingSpeed: a,
162
- disabled: !x
163
- }), I = S(
164
- () => Z(s),
165
- [s]
166
- ), f = I.some(
167
- (e) => e.type === "sandbox"
168
- ), V = S(
169
- () => Q(p),
170
- [p]
171
- ), R = P(!1);
172
- return L(() => {
173
- f || B && !R.current && (R.current = !0, d?.());
174
- }, [f, B, d]), L(() => {
175
- f || (R.current = !1);
176
- }, [f, s]), f ? /* @__PURE__ */ t.jsx("div", { className: "content-render markdown-body", children: I.map(
177
- (e, n) => e.type === "sandbox" ? /* @__PURE__ */ t.jsx(
178
- Y,
179
- {
180
- content: e.value,
181
- className: "content-render-iframe",
182
- loadingText: u,
183
- styleLoadingText: h,
184
- scriptLoadingText: l,
185
- mode: y
186
- },
187
- `sandbox-${n}`
188
- ) : /* @__PURE__ */ t.jsx(
189
- H,
190
- {
191
- components: C,
192
- content: z(e.value)
193
- },
194
- `md-${n}`
195
- )
196
- ) }) : /* @__PURE__ */ t.jsxs("div", { className: "content-render markdown-body", children: [
197
- V.map((e, n) => {
142
+ }, m = S(!1);
143
+ k(() => {
144
+ x && !m.current && (m.current = !0, u?.());
145
+ }, [x, u]), k(() => {
146
+ m.current = !1;
147
+ }, [n]);
148
+ const C = W(f);
149
+ return /* @__PURE__ */ t.jsxs("div", { className: "content-render markdown-body", children: [
150
+ C.map((e, s) => {
198
151
  if (e.type === "text")
199
152
  return /* @__PURE__ */ t.jsx(
200
- H,
153
+ G,
201
154
  {
202
- components: C,
203
- content: e.value
155
+ remarkPlugins: [O, Q, z, X],
156
+ rehypePlugins: [
157
+ P,
158
+ K,
159
+ V,
160
+ [
161
+ D,
162
+ { languages: U, subset: _ }
163
+ ],
164
+ J
165
+ ],
166
+ components: N,
167
+ children: e.value
204
168
  },
205
- n
169
+ s
206
170
  );
207
171
  if (e.type === "mermaid")
208
172
  return /* @__PURE__ */ t.jsx(
209
- $,
173
+ L,
210
174
  {
211
175
  chart: e.value,
212
176
  frozen: !e.complete
213
177
  },
214
- n
178
+ s
215
179
  );
216
180
  if (e.type === "svg")
217
- return /* @__PURE__ */ t.jsx(ae, { svg: e.value }, n);
181
+ return /* @__PURE__ */ t.jsx(Y, { svg: e.value }, s);
218
182
  }),
219
- c && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: U.createElement(c, {
220
- content: s,
221
- displayContent: p,
183
+ d && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: I.createElement(d, {
184
+ content: n,
185
+ displayContent: f,
222
186
  onSend: o
223
187
  }) })
224
188
  ] });
225
189
  };
226
190
  export {
227
- H as MarkdownRenderer,
228
- ze as default
191
+ Ne as default
229
192
  };
230
193
  //# sourceMappingURL=ContentRender.js.map