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

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 (60) 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/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
  10. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/index.js +1 -1
  11. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js +1 -1
  12. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
  13. package/dist/_virtual/index10.js +2 -2
  14. package/dist/_virtual/index11.js +3 -2
  15. package/dist/_virtual/index11.js.map +1 -1
  16. package/dist/_virtual/index12.js +2 -3
  17. package/dist/_virtual/index12.js.map +1 -1
  18. package/dist/_virtual/index5.js +3 -5
  19. package/dist/_virtual/index5.js.map +1 -1
  20. package/dist/_virtual/index6.js +4 -4
  21. package/dist/_virtual/index7.js +5 -3
  22. package/dist/_virtual/index7.js.map +1 -1
  23. package/dist/_virtual/index8.js +2 -2
  24. package/dist/components/ContentRender/ContentRender.js +116 -173
  25. package/dist/components/ContentRender/ContentRender.js.map +1 -1
  26. package/dist/components/ContentRender/ContentRender.stories.d.ts +0 -1
  27. package/dist/markdown-flow-ui-lib.css +1 -1
  28. package/package.json +1 -1
  29. 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 +0 -15111
  30. 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 +0 -1
  31. 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 +0 -9262
  32. 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 +0 -1
  33. 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 +0 -24
  34. 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 +0 -1
  35. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.development.js +0 -244
  36. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.development.js.map +0 -1
  37. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.production.js +0 -241
  38. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/cjs/scheduler.production.js.map +0 -1
  39. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/index.js +0 -11
  40. package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/scheduler@0.25.0/node_modules/scheduler/index.js.map +0 -1
  41. package/dist/_virtual/client.js +0 -6
  42. package/dist/_virtual/client.js.map +0 -1
  43. package/dist/_virtual/client2.js +0 -5
  44. package/dist/_virtual/client2.js.map +0 -1
  45. package/dist/_virtual/index13.js +0 -5
  46. package/dist/_virtual/index13.js.map +0 -1
  47. package/dist/_virtual/react-dom-client.development.js +0 -5
  48. package/dist/_virtual/react-dom-client.development.js.map +0 -1
  49. package/dist/_virtual/react-dom-client.production.js +0 -5
  50. package/dist/_virtual/react-dom-client.production.js.map +0 -1
  51. package/dist/_virtual/scheduler.development.js +0 -5
  52. package/dist/_virtual/scheduler.development.js.map +0 -1
  53. package/dist/_virtual/scheduler.production.js +0 -5
  54. package/dist/_virtual/scheduler.production.js.map +0 -1
  55. package/dist/components/ContentRender/IframeSandbox.d.ts +0 -7
  56. package/dist/components/ContentRender/IframeSandbox.js +0 -60
  57. package/dist/components/ContentRender/IframeSandbox.js.map +0 -1
  58. package/dist/components/ContentRender/SandboxApp.d.ts +0 -6
  59. package/dist/components/ContentRender/SandboxApp.js +0 -21
  60. package/dist/components/ContentRender/SandboxApp.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { __exports as c } from "../../../../../../../../../../_virtual/index9.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/index11.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,6 +1,6 @@
1
1
  import s from "../../../../@babel_runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/typeof.js";
2
2
  import { version as c, isValidElement as l } from "react";
3
- import { r as n } from "../../../../../../../../../_virtual/index12.js";
3
+ import { r as n } from "../../../../../../../../../_virtual/index11.js";
4
4
  import m from "./hooks/useMemo.js";
5
5
  import v from "./React/isFragment.js";
6
6
  var R = Number(c.split(".")[0]), y = function(r, t) {
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../../../../../_virtual/index13.js";
1
+ import { __module as e } from "../../../../../../../../_virtual/index12.js";
2
2
  import { __require as o } from "./cjs/react-is.production.min.js";
3
3
  import { __require as t } from "./cjs/react-is.development.js";
4
4
  var r;
@@ -1,4 +1,4 @@
1
- import { __exports as r } from "../../../../../../../../../_virtual/index10.js";
1
+ import { __exports as r } from "../../../../../../../../../_virtual/index9.js";
2
2
  import { __require as p } from "../../../../inline-style-parser@0.2.4/node_modules/inline-style-parser/index.js";
3
3
  var f;
4
4
  function q() {
@@ -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,5 +1,6 @@
1
- var s = { 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
- s as __module
4
+ a as r
4
5
  };
5
6
  //# 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,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 e = { exports: {} };
3
2
  export {
4
- a as r
3
+ e as __module
5
4
  };
6
5
  //# 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":";"}
@@ -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 e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index8.js.map
@@ -1,126 +1,118 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import D, { useMemo as C, useRef as W, useEffect as R } from "react";
5
- import I from "../../_virtual/index.js";
4
+ import M, { useMemo as z, useRef as B, useEffect as w } from "react";
5
+ import H from "../../_virtual/index.js";
6
6
  /* empty css */
7
7
  /* empty css */
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 = `
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 = `
45
31
  :host { display: block; width: 100%; max-width: 100%; text-align: center; }
46
32
  svg { max-width: 100%; height: auto; display: inline-block; }
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}`);
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}`);
59
45
  return;
60
46
  }
61
- !k && x > 0 && n.setAttribute("width", `${x}`), !b && p > 0 && n.setAttribute("height", `${p}`);
47
+ !j && h > 0 && r.setAttribute("width", `${h}`), !p && m > 0 && r.setAttribute("height", `${m}`);
62
48
  });
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
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
80
66
  // tooltipMinLength,
81
67
  }) => {
82
- const k = C(
83
- () => $(r),
84
- [r]
85
- ), b = {
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 = {
86
78
  "custom-button-after-content": ({
87
79
  children: e
88
80
  }) => /* @__PURE__ */ t.jsx(
89
81
  "button",
90
82
  {
91
83
  className: "content-render-custom-button-after-content",
92
- onClick: y,
84
+ onClick: b,
93
85
  children: /* @__PURE__ */ t.jsx("span", { className: "content-render-custom-button-after-content-inner", children: e })
94
86
  }
95
87
  ),
96
88
  "custom-variable": (e) => /* @__PURE__ */ t.jsx(
97
- J,
89
+ T,
98
90
  {
99
91
  ...e,
100
- readonly: n,
101
- defaultButtonText: o,
102
- defaultInputText: d,
103
- defaultSelectedValues: u,
104
- onSend: a,
105
- beforeSend: j,
106
- confirmButtonText: f
92
+ readonly: r,
93
+ defaultButtonText: a,
94
+ defaultInputText: v,
95
+ defaultSelectedValues: x,
96
+ onSend: c,
97
+ beforeSend: g,
98
+ confirmButtonText: u
107
99
  }
108
100
  ),
109
101
  code: (e) => {
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 });
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 });
114
106
  }
115
- return /* @__PURE__ */ t.jsx("code", { className: s, ...A, children: h });
107
+ return /* @__PURE__ */ t.jsx("code", { className: o, ...C, children: i });
116
108
  },
117
109
  table: ({ ...e }) => /* @__PURE__ */ t.jsx("div", { className: "content-render-table-container", children: /* @__PURE__ */ t.jsx("table", { className: "content-render-table", ...e }) }),
118
110
  th: ({ ...e }) => /* @__PURE__ */ t.jsx("th", { className: "content-render-th", ...e }),
119
111
  td: ({ ...e }) => /* @__PURE__ */ t.jsx("td", { className: "content-render-td", ...e }),
120
112
  tr: ({ ...e }) => /* @__PURE__ */ t.jsx("tr", { className: "content-render-tr", ...e }),
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 });
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 });
124
116
  },
125
117
  ol: ({ ...e }) => /* @__PURE__ */ t.jsx("ol", { className: "content-render-ol", ...e }),
126
118
  ul: ({ ...e }) => /* @__PURE__ */ t.jsx("ul", { className: "content-render-ul", ...e }),
@@ -133,113 +125,64 @@ const q = (r) => {
133
125
  ...e
134
126
  }
135
127
  ) : /* @__PURE__ */ t.jsx("input", { ...e }),
136
- a: ({ children: e, ...s }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...s, children: e }),
128
+ a: ({ children: e, ...o }) => /* @__PURE__ */ t.jsx("a", { target: "_blank", rel: "noopener noreferrer", ...o, children: e }),
137
129
  pre: (e) => /* @__PURE__ */ t.jsx(
138
- F,
130
+ L,
139
131
  {
140
132
  ...e,
141
- copyButtonText: x,
142
- copiedButtonText: p
133
+ copyButtonText: h,
134
+ copiedButtonText: m
143
135
  }
144
136
  )
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) => {
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) => {
199
146
  if (e.type === "text")
200
- return /* @__PURE__ */ t.jsx("div", { className: "markdown-body", children: /* @__PURE__ */ t.jsx(
201
- H,
147
+ return /* @__PURE__ */ t.jsx(
148
+ G,
202
149
  {
203
- remarkPlugins: [
204
- _,
205
- E,
206
- I,
207
- U
208
- ],
150
+ remarkPlugins: [J, O, H, Q],
209
151
  rehypePlugins: [
210
- Q,
211
- L,
212
- X,
152
+ P,
153
+ K,
154
+ V,
213
155
  [
214
- V,
215
- { languages: M, subset: P }
156
+ D,
157
+ { languages: U, subset: _ }
216
158
  ],
217
- T
159
+ F
218
160
  ],
219
- components: b,
161
+ components: k,
220
162
  children: e.value
221
- }
222
- ) }, s);
163
+ },
164
+ o
165
+ );
223
166
  if (e.type === "mermaid")
224
167
  return /* @__PURE__ */ t.jsx(
225
- z,
168
+ A,
226
169
  {
227
170
  chart: e.value,
228
171
  frozen: !e.complete
229
172
  },
230
- s
173
+ o
231
174
  );
232
175
  if (e.type === "svg")
233
- return /* @__PURE__ */ t.jsx(te, { svg: e.value }, s);
176
+ return /* @__PURE__ */ t.jsx(X, { svg: e.value }, o);
234
177
  }),
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
+ l && /* @__PURE__ */ t.jsx("div", { className: "content-render-custom-bar", children: M.createElement(l, {
179
+ content: n,
180
+ displayContent: p,
181
+ onSend: c
239
182
  }) })
240
183
  ] });
241
184
  };
242
185
  export {
243
- Se as default
186
+ Ne as default
244
187
  };
245
188
  //# sourceMappingURL=ContentRender.js.map