markdown-flow-ui 0.1.80 → 0.1.81-beta.0

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