markdown-flow-ui 0.1.80-beta.0 → 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 (73) 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 +5 -2
  49. package/dist/_virtual/index6.js.map +1 -1
  50. package/dist/_virtual/index7.js +3 -5
  51. package/dist/_virtual/index7.js.map +1 -1
  52. package/dist/_virtual/index8.js +2 -5
  53. package/dist/_virtual/index8.js.map +1 -1
  54. package/dist/_virtual/react-dom-client.development.js +5 -0
  55. package/dist/_virtual/react-dom-client.development.js.map +1 -0
  56. package/dist/_virtual/react-dom-client.production.js +5 -0
  57. package/dist/_virtual/react-dom-client.production.js.map +1 -0
  58. package/dist/_virtual/scheduler.development.js +5 -0
  59. package/dist/_virtual/scheduler.development.js.map +1 -0
  60. package/dist/_virtual/scheduler.production.js +5 -0
  61. package/dist/_virtual/scheduler.production.js.map +1 -0
  62. package/dist/components/ContentRender/ContentRender.js +173 -116
  63. package/dist/components/ContentRender/ContentRender.js.map +1 -1
  64. package/dist/components/ContentRender/ContentRender.stories.d.ts +1 -0
  65. package/dist/components/ContentRender/IframeSandbox.d.ts +7 -0
  66. package/dist/components/ContentRender/IframeSandbox.js +60 -0
  67. package/dist/components/ContentRender/IframeSandbox.js.map +1 -0
  68. package/dist/components/ContentRender/SandboxApp.d.ts +6 -0
  69. package/dist/components/ContentRender/SandboxApp.js +21 -0
  70. package/dist/components/ContentRender/SandboxApp.js.map +1 -0
  71. package/dist/components/ui/inputGroup/textarea.js +1 -1
  72. package/dist/markdown-flow-ui-lib.css +1 -1
  73. 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,5 +1,8 @@
1
- var s = { exports: {} };
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);
2
5
  export {
3
- s as __module
6
+ a as default
4
7
  };
5
8
  //# sourceMappingURL=index6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -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=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,8 +1,5 @@
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
+ var e = { exports: {} };
5
2
  export {
6
- a as default
3
+ e as __module
7
4
  };
8
5
  //# sourceMappingURL=index8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index8.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index8.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -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,118 +1,126 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import M, { useMemo as z, useRef as B, useEffect as w } from "react";
5
- import H 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 A 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 E } 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 F from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-katex@7.0.1/node_modules/rehype-katex/lib/index.js";
20
- import J from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js";
21
- import O from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-math@6.0.0/node_modules/remark-math/lib/index.js";
22
- import Q from "../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";
23
- const X = ({ svg: n }) => {
24
- const l = B(null);
25
- return w(() => {
26
- const c = l.current;
27
- if (!c) return;
28
- const s = c.shadowRoot ?? c.attachShadow({ mode: "open" }), f = "content-render-svg-style";
29
- let a = s.getElementById(f);
30
- a || (a = document.createElement("style"), a.id = f, a.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 = `
31
45
  :host { display: block; width: 100%; max-width: 100%; text-align: center; }
32
46
  svg { max-width: 100%; height: auto; display: inline-block; }
33
- `, s.appendChild(a)), Array.from(s.childNodes).filter(
34
- (r) => r !== a
35
- ).forEach((r) => s.removeChild(r));
36
- const x = document.createElement("template");
37
- x.innerHTML = n, s.append(x.content.cloneNode(!0)), s.querySelectorAll("svg").forEach((r) => {
38
- const d = r.getAttribute("viewBox");
39
- if (!d) return;
40
- const u = d.trim().split(/[\s,]+/).map((k) => Number(k));
41
- if (u.length !== 4 || u.some(Number.isNaN)) return;
42
- const [, , h, m] = u, b = r.getAttribute("width"), g = r.getAttribute("height"), j = !!b && b !== "0", p = !!g && g !== "0";
43
- if (!j && !p) {
44
- 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}`);
45
59
  return;
46
60
  }
47
- !j && h > 0 && r.setAttribute("width", `${h}`), !p && m > 0 && r.setAttribute("height", `${m}`);
61
+ !k && x > 0 && n.setAttribute("width", `${x}`), !b && p > 0 && n.setAttribute("height", `${p}`);
48
62
  });
49
- }, [n]), /* @__PURE__ */ t.jsx("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ t.jsx("div", { className: "content-render-svg", ref: l }) });
50
- }, Ne = ({
51
- content: n,
52
- customRenderBar: l,
53
- onSend: c,
54
- typingSpeed: s = 30,
55
- enableTypewriter: f = !1,
56
- defaultButtonText: a,
57
- defaultInputText: v,
58
- defaultSelectedValues: x,
59
- readonly: r = !1,
60
- onTypeFinished: d,
61
- confirmButtonText: u,
62
- copyButtonText: h,
63
- copiedButtonText: m,
64
- onClickCustomButtonAfterContent: b,
65
- beforeSend: g
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
66
80
  // tooltipMinLength,
67
81
  }) => {
68
- const j = z(
69
- () => E(n),
70
- [n]
71
- ), { displayContent: p, isComplete: y } = $({
72
- // processMarkdownText will let code block printf("You win!\n") become printf("You win!<br/>");
73
- // content: processMarkdownText(content),
74
- content: j,
75
- typingSpeed: s,
76
- disabled: !f
77
- }), k = {
82
+ const k = C(
83
+ () => $(r),
84
+ [r]
85
+ ), b = {
78
86
  "custom-button-after-content": ({
79
87
  children: e
80
88
  }) => /* @__PURE__ */ t.jsx(
81
89
  "button",
82
90
  {
83
91
  className: "content-render-custom-button-after-content",
84
- onClick: b,
92
+ onClick: y,
85
93
  children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
86
94
  }
87
95
  ),
88
96
  "custom-variable": (e) => /* @__PURE__ */ t.jsx(
89
- T,
97
+ J,
90
98
  {
91
99
  ...e,
92
- readonly: r,
93
- defaultButtonText: a,
94
- defaultInputText: v,
95
- defaultSelectedValues: x,
96
- onSend: c,
97
- beforeSend: g,
98
- confirmButtonText: u
100
+ readonly: n,
101
+ defaultButtonText: o,
102
+ defaultInputText: d,
103
+ defaultSelectedValues: u,
104
+ onSend: a,
105
+ beforeSend: j,
106
+ confirmButtonText: f
99
107
  }
100
108
  ),
101
109
  code: (e) => {
102
- const { className: o, children: i, ...C } = e;
103
- if (/language-(\w+)/.exec(o || "")?.[1] === "mermaid") {
104
- const R = i?.toString().replace(/\n$/, "") || "", S = q(n, R);
105
- return /* @__PURE__ */ t.jsx(A, { chart: R, frozen: S });
110
+ const { className: s, children: h, ...A } = e;
111
+ if (/language-(\w+)/.exec(s || "")?.[1] === "mermaid") {
112
+ const B = h?.toString().replace(/\n$/, "") || "", K = Z(r, B);
113
+ return /* @__PURE__ */ t.jsx(z, { chart: B, frozen: K });
106
114
  }
107
- return /* @__PURE__ */ t.jsx("code", { className: o, ...C, children: i });
115
+ return /* @__PURE__ */ t.jsx("code", { className: s, ...A, children: h });
108
116
  },
109
117
  table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
110
118
  th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
111
119
  td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
112
120
  tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
113
- li: ({ node: e, ...o }) => {
114
- const i = e?.properties?.className;
115
- 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", ...o }) : /* @__PURE__ */ t.jsx("li", { ...o });
121
+ li: ({ node: e, ...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 });
116
124
  },
117
125
  ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
118
126
  ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
@@ -125,64 +133,113 @@ const X = ({ svg: n }) => {
125
133
  ...e
126
134
  }
127
135
  ) : /* @__PURE__ */ t.jsx("input", { ...e }),
128
- a: ({ children: e, ...o }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...o, children: e }),
136
+ a: ({ children: e, ...s }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...s, children: e }),
129
137
  pre: (e) => /* @__PURE__ */ t.jsx(
130
- L,
138
+ F,
131
139
  {
132
140
  ...e,
133
- copyButtonText: h,
134
- copiedButtonText: m
141
+ copyButtonText: x,
142
+ copiedButtonText: p
135
143
  }
136
144
  )
137
- }, N = B(!1);
138
- w(() => {
139
- y && !N.current && (N.current = !0, d?.());
140
- }, [y, d]), w(() => {
141
- N.current = !1;
142
- }, [n]);
143
- const I = W(p);
144
- return /* @__PURE__ */ t.jsxs("div", { className: "content-render markdown-body", children: [
145
- I.map((e, o) => {
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) => {
146
199
  if (e.type === "text")
147
- return /* @__PURE__ */ t.jsx(
148
- G,
200
+ return /* @__PURE__ */ t.jsx("div", { className: "markdown-body", children: /* @__PURE__ */ t.jsx(
201
+ H,
149
202
  {
150
- remarkPlugins: [J, O, H, Q],
203
+ remarkPlugins: [
204
+ _,
205
+ E,
206
+ I,
207
+ U
208
+ ],
151
209
  rehypePlugins: [
152
- P,
153
- K,
154
- V,
210
+ Q,
211
+ L,
212
+ X,
155
213
  [
156
- D,
157
- { languages: U, subset: _ }
214
+ V,
215
+ { languages: M, subset: P }
158
216
  ],
159
- F
217
+ T
160
218
  ],
161
- components: k,
219
+ components: b,
162
220
  children: e.value
163
- },
164
- o
165
- );
221
+ }
222
+ ) }, s);
166
223
  if (e.type === "mermaid")
167
224
  return /* @__PURE__ */ t.jsx(
168
- A,
225
+ z,
169
226
  {
170
227
  chart: e.value,
171
228
  frozen: !e.complete
172
229
  },
173
- o
230
+ s
174
231
  );
175
232
  if (e.type === "svg")
176
- return /* @__PURE__ */ t.jsx(X, { svg: e.value }, o);
233
+ return /* @__PURE__ */ t.jsx(te, { svg: e.value }, s);
177
234
  }),
178
- l && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: M.createElement(l, {
179
- content: n,
180
- displayContent: p,
181
- 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
182
239
  }) })
183
240
  ] });
184
241
  };
185
242
  export {
186
- Ne as default
243
+ Se as default
187
244
  };
188
245
  //# sourceMappingURL=ContentRender.js.map