markdown-flow-ui 0.1.69-beta.8 → 0.1.70-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.
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/hast-util-to-jsx-runtime@2.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/core.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/arduino.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/c.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/cpp.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/csharp.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/diff.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/graphql.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/ini.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/kotlin.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/latex.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/less.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/lua.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/makefile.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/objectivec.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/perl.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/php-template.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/php.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python-repl.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/r.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/ruby.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/scss.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/shell.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/swift.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/vbnet.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/vhdl.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/wasm.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js +8 -6
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js.map +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lowlight@3.3.0/node_modules/lowlight/lib/common.js +80 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lowlight@3.3.0/node_modules/lowlight/lib/common.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lowlight@3.3.0/node_modules}/lowlight/lib/index.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lowlight@3.3.0/node_modules/lowlight/lib/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/fullscreen.js +19 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/fullscreen.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/markdown-table@3.0.4/node_modules/markdown-table/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-find-and-replace@3.0.2/node_modules/mdast-util-find-and-replace/lib/index.js +11 -11
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-find-and-replace@3.0.2/node_modules/mdast-util-find-and-replace/lib/index.js.map +1 -1
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.1/node_modules}/mdast-util-gfm-autolink-literal/lib/index.js +4 -4
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.1/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules}/mdast-util-gfm-footnote/lib/index.js +2 -2
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules}/mdast-util-gfm-table/lib/index.js +3 -3
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules}/mdast-util-gfm-task-list-item/lib/index.js +2 -2
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules}/mdast-util-gfm-task-list-item/lib/index.js.map +1 -1
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules}/mdast-util-gfm/lib/index.js +5 -5
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules}/mdast-util-phrasing/lib/index.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/code.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/root.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-fence.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-quote.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-strong.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/encode-info.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +14 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules}/micromark-extension-gfm-autolink-literal/lib/syntax.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules}/micromark-extension-gfm-footnote/lib/syntax.js +4 -4
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules}/micromark-extension-gfm-strikethrough/lib/syntax.js +3 -3
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules}/micromark-extension-gfm-table/lib/edit-map.js.map +1 -1
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules}/micromark-extension-gfm-table/lib/infer.js.map +1 -1
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules}/micromark-extension-gfm-table/lib/syntax.js +2 -2
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules}/micromark-extension-gfm-table/lib/syntax.js.map +1 -1
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules}/micromark-extension-gfm-task-list-item/lib/syntax.js +2 -2
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.js +19 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.js.map +1 -0
- 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
- 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
- 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
- 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
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules}/rehype-highlight/lib/index.js +4 -4
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/rehype-highlight@7.0.2/node_modules/rehype-highlight/lib/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/index.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/{remark-flow@0.1.3-beta.0 → remark-flow@0.1.6}/node_modules/remark-flow/dist/interaction-parser.js +30 -51
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/interaction-parser.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/{remark-flow@0.1.3-beta.0 → remark-flow@0.1.6}/node_modules/remark-flow/dist/remark-custom-variable.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-custom-variable.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-flow.js.map +1 -0
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/{remark-flow@0.1.3-beta.0 → remark-flow@0.1.6}/node_modules/remark-flow/dist/remark-interaction.js +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.6/node_modules/remark-flow/dist/remark-interaction.js.map +1 -0
- package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules}/remark-gfm/lib/index.js +2 -2
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js.map +1 -0
- 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
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
- package/dist/_virtual/core.js +1 -1
- package/dist/_virtual/index.js +1 -1
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index3.js +4 -5
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index4.js +5 -4
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +5 -5
- package/dist/_virtual/index8.js +2 -2
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/ContentBlackboard.d.ts +9 -0
- package/dist/components/ContentRender/ContentBlackboard.js +126 -0
- package/dist/components/ContentRender/ContentBlackboard.js.map +1 -0
- package/dist/components/ContentRender/ContentHtml.d.ts +22 -0
- package/dist/components/ContentRender/ContentHtml.js +108 -0
- package/dist/components/ContentRender/ContentHtml.js.map +1 -0
- package/dist/components/ContentRender/ContentRender.d.ts +16 -10
- package/dist/components/ContentRender/ContentRender.js +126 -103
- package/dist/components/ContentRender/ContentRender.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.stories.d.ts +12 -1
- package/dist/components/ContentRender/index.d.ts +1 -0
- package/dist/components/ContentRender/utils/content-html-stream.d.ts +8 -0
- package/dist/components/ContentRender/utils/content-html-stream.js +18 -0
- package/dist/components/ContentRender/utils/content-html-stream.js.map +1 -0
- package/dist/components/ContentRender/utils/highlight-languages.js +22 -22
- package/dist/components/ContentRender/utils/mermaid-parse.d.ts +4 -0
- package/dist/components/ContentRender/utils/mermaid-parse.js +112 -65
- package/dist/components/ContentRender/utils/mermaid-parse.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +7 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.js +28 -21
- package/dist/components/MarkdownFlow/MarkdownFlow.js.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.stories.d.ts +3 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.js +1 -1
- package/dist/components/ui/inputGroup/textarea.js +1 -1
- package/dist/components/ui/tooltip.js +2 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/package.json +1 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.3-beta.0/node_modules/remark-flow/dist/index.js.map +0 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.3-beta.0/node_modules/remark-flow/dist/interaction-parser.js.map +0 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.3-beta.0/node_modules/remark-flow/dist/remark-custom-variable.js.map +0 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.3-beta.0/node_modules/remark-flow/dist/remark-flow.js.map +0 -1
- package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/remark-flow@0.1.3-beta.0/node_modules/remark-flow/dist/remark-interaction.js.map +0 -1
- package/dist/node_modules/ccount/index.js.map +0 -1
- package/dist/node_modules/devlop/lib/default.js +0 -6
- package/dist/node_modules/devlop/lib/default.js.map +0 -1
- package/dist/node_modules/escape-string-regexp/index.js +0 -9
- package/dist/node_modules/escape-string-regexp/index.js.map +0 -1
- package/dist/node_modules/hast-util-is-element/lib/index.js +0 -66
- package/dist/node_modules/hast-util-is-element/lib/index.js.map +0 -1
- package/dist/node_modules/hast-util-to-text/lib/index.js +0 -227
- package/dist/node_modules/hast-util-to-text/lib/index.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/arduino.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/bash.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/c.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/cpp.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/csharp.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/css.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/diff.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/go.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/graphql.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/ini.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/java.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/javascript.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/json.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/kotlin.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/latex.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/less.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/lua.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/makefile.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/markdown.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/objectivec.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/perl.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/php-template.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/php.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/plaintext.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/python-repl.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/python.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/r.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/ruby.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/rust.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/scss.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/shell.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/sql.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/swift.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/typescript.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/vbnet.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/vhdl.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/wasm.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/xml.js.map +0 -1
- package/dist/node_modules/highlight.js/es/languages/yaml.js.map +0 -1
- package/dist/node_modules/highlight.js/lib/core.js.map +0 -1
- package/dist/node_modules/longest-streak/index.js +0 -13
- package/dist/node_modules/longest-streak/index.js.map +0 -1
- package/dist/node_modules/lowlight/lib/common.js +0 -80
- package/dist/node_modules/lowlight/lib/common.js.map +0 -1
- package/dist/node_modules/lowlight/lib/index.js.map +0 -1
- package/dist/node_modules/markdown-table/index.js.map +0 -1
- package/dist/node_modules/mdast-util-find-and-replace/lib/index.js +0 -71
- package/dist/node_modules/mdast-util-find-and-replace/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-gfm/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-gfm-table/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-phrasing/lib/index.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/break.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/code.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/definition.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/heading.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/html.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/image.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/index.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/link.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/list.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/root.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/strong.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/text.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-fence.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-quote.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/check-strong.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-info.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +0 -14
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js.map +0 -1
- package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +0 -1
- package/dist/node_modules/mdast-util-to-string/lib/index.js +0 -30
- package/dist/node_modules/mdast-util-to-string/lib/index.js.map +0 -1
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +0 -19
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js.map +0 -1
- package/dist/node_modules/micromark-extension-gfm/index.js +0 -19
- package/dist/node_modules/micromark-extension-gfm/index.js.map +0 -1
- package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +0 -1
- package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +0 -1
- package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +0 -1
- package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +0 -1
- package/dist/node_modules/micromark-factory-space/index.js +0 -16
- package/dist/node_modules/micromark-factory-space/index.js.map +0 -1
- package/dist/node_modules/micromark-util-character/index.js +0 -35
- package/dist/node_modules/micromark-util-character/index.js.map +0 -1
- package/dist/node_modules/micromark-util-chunked/index.js +0 -13
- package/dist/node_modules/micromark-util-chunked/index.js.map +0 -1
- package/dist/node_modules/micromark-util-classify-character/index.js +0 -11
- package/dist/node_modules/micromark-util-classify-character/index.js.map +0 -1
- package/dist/node_modules/micromark-util-combine-extensions/index.js +0 -37
- package/dist/node_modules/micromark-util-combine-extensions/index.js.map +0 -1
- package/dist/node_modules/micromark-util-normalize-identifier/index.js +0 -7
- package/dist/node_modules/micromark-util-normalize-identifier/index.js.map +0 -1
- package/dist/node_modules/micromark-util-resolve-all/index.js +0 -13
- package/dist/node_modules/micromark-util-resolve-all/index.js.map +0 -1
- package/dist/node_modules/rehype-highlight/lib/index.js.map +0 -1
- package/dist/node_modules/remark-gfm/lib/index.js.map +0 -1
- package/dist/node_modules/unist-util-find-after/lib/index.js +0 -33
- package/dist/node_modules/unist-util-find-after/lib/index.js.map +0 -1
- package/dist/node_modules/unist-util-is/lib/index.js +0 -85
- package/dist/node_modules/unist-util-is/lib/index.js.map +0 -1
- package/dist/node_modules/unist-util-visit/lib/index.js +0 -17
- package/dist/node_modules/unist-util-visit/lib/index.js.map +0 -1
- package/dist/node_modules/unist-util-visit-parents/lib/color.js +0 -7
- package/dist/node_modules/unist-util-visit-parents/lib/color.js.map +0 -1
- package/dist/node_modules/unist-util-visit-parents/lib/index.js +0 -57
- package/dist/node_modules/unist-util-visit-parents/lib/index.js.map +0 -1
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/ccount@2.0.1/node_modules}/ccount/index.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/core.js.map +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/arduino.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/bash.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/c.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/cpp.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/csharp.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/css.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/diff.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/go.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/graphql.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/ini.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/java.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/javascript.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/json.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/kotlin.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/latex.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/less.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/lua.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/makefile.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/markdown.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/objectivec.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/perl.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/php-template.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/php.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/plaintext.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/python-repl.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/python.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/r.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/ruby.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/rust.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/scss.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/shell.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/sql.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/swift.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/typescript.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/vbnet.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/vhdl.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/wasm.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/xml.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/es/languages/yaml.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules}/highlight.js/lib/core.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/markdown-table@3.0.4/node_modules}/markdown-table/index.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0/node_modules}/mdast-util-gfm-strikethrough/lib/index.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/blockquote.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/break.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/definition.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/emphasis.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/heading.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/html.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/image-reference.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/image.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/index.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/inline-code.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/link-reference.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/link.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/list-item.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/list.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/paragraph.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/strong.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/text.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/handle/thematic-break.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-bullet-other.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-bullet.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-emphasis.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-fence.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-list-item-indent.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-quote.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-rule-repetition.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-rule.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/check-strong.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/encode-character-reference.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/format-code-as-indented.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules}/mdast-util-to-markdown/lib/util/pattern-in-scope.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules}/micromark-extension-gfm-table/lib/edit-map.js +0 -0
- /package/dist/{node_modules → Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules}/micromark-extension-gfm-table/lib/infer.js +0 -0
- /package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/{remark-flow@0.1.3-beta.0 → remark-flow@0.1.6}/node_modules/remark-flow/dist/index.js +0 -0
- /package/dist/Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/{remark-flow@0.1.3-beta.0 → remark-flow@0.1.6}/node_modules/remark-flow/dist/remark-flow.js +0 -0
- /package/dist/{Documents/ai-shifu/markdown-flow-ui/node_modules → node_modules}/@codemirror/state/dist/index.js +0 -0
- /package/dist/{Documents/ai-shifu/markdown-flow-ui/node_modules → node_modules}/@codemirror/state/dist/index.js.map +0 -0
- /package/dist/{Documents/ai-shifu/markdown-flow-ui/node_modules → node_modules}/@marijn/find-cluster-break/src/index.js +0 -0
- /package/dist/{Documents/ai-shifu/markdown-flow-ui/node_modules → node_modules}/@marijn/find-cluster-break/src/index.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentRender.js","sources":["../../../src/components/ContentRender/ContentRender.tsx"],"sourcesContent":["import \"highlight.js/styles/github.css\";\nimport \"katex/dist/katex.min.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeRaw from \"rehype-raw\";\nimport remarkBreaks from \"remark-breaks\";\nimport remarkFlow from \"remark-flow\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport { CustomRenderBarProps, OnSendContentParams } from \"../types\";\nimport \"./contentRender.css\";\nimport \"./github-markdown-light.css\";\nimport CodeBlock from \"./CodeBlock\";\nimport CustomButtonInputVariable, {\n ComponentsWithCustomVariable,\n} from \"./plugins/CustomVariable\";\nimport MermaidChart from \"./plugins/MermaidChart\";\nimport useTypewriterStateMachine from \"./useTypewriterStateMachine\";\nimport {\n preserveCustomVariableProperties,\n restoreCustomVariableProperties,\n} from \"./utils/custom-variable-props\";\nimport {\n highlightLanguages,\n subsetLanguages,\n} from \"./utils/highlight-languages\";\n// import { processMarkdownText } from \"./utils/process-markdown\";\nimport {\n parseMarkdownSegments,\n mermaidBlockIsComplete,\n} from \"./utils/mermaid-parse\";\n// Define component Props type\nexport interface ContentRenderProps {\n content: string;\n /**\n+ * Callback invoked when the custom button after content is clicked.\n+ * This button is rendered via the `<custom-button-after-content>` tag in markdown content.\n+ * @example\n+ * ```tsx\n+ * <ContentRender\n+ * content=\"Hello <custom-button-after-content>Ask</custom-button-after-content>\"\n+ * onClickCustomButtonAfterContent={() => console.log('Button clicked')}\n+ * />\n+ * ```\n+ */\n customRenderBar?: CustomRenderBarProps;\n onClickCustomButtonAfterContent?: () => void;\n onSend?: (content: OnSendContentParams) => void;\n typingSpeed?: number;\n enableTypewriter?: boolean;\n defaultButtonText?: string;\n defaultInputText?: string; // Text input by user\n defaultSelectedValues?: string[]; // Default selected values for multi-select\n readonly?: boolean;\n onTypeFinished?: () => void;\n // Multi-select confirm button text (i18n support)\n confirmButtonText?: string;\n // Copy button text (i18n support)\n copyButtonText?: string;\n // Copied state text (i18n support)\n copiedButtonText?: string;\n // Dynamic interaction format for multi-select support\n dynamicInteractionFormat?: string;\n beforeSend?: (param: OnSendContentParams) => boolean;\n // tooltipMinLength?: number; // Control minimum character length for tooltip display, default 10\n}\n\n// Render svg string via Shadow DOM to avoid markdown wrapping\nconst SvgBlockInShadow: React.FC<{ svg: string }> = ({ svg }) => {\n const hostRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const host = hostRef.current;\n if (!host) return;\n const shadowRoot = host.shadowRoot ?? host.attachShadow({ mode: \"open\" });\n shadowRoot.innerHTML = svg;\n }, [svg]);\n\n return <div className=\"content-render-svg\" ref={hostRef} />;\n};\n\n// Extended component interface\ntype CustomComponents = ComponentsWithCustomVariable & {\n \"custom-button-after-content\"?: React.ComponentType<{\n children: React.ReactNode;\n }>;\n};\n\nconst ContentRender: React.FC<ContentRenderProps> = ({\n content,\n customRenderBar,\n onSend,\n typingSpeed = 30,\n enableTypewriter = false,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n readonly = false,\n onTypeFinished,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n onClickCustomButtonAfterContent,\n beforeSend,\n // tooltipMinLength,\n}) => {\n // Use custom Hook to handle typewriter effect\n const { displayContent, isComplete } = useTypewriterStateMachine({\n // processMarkdownText will let code block printf(\"You win!\\n\") become printf(\"You win!<br/>\");\n // content: processMarkdownText(content),\n content: content,\n typingSpeed,\n disabled: !enableTypewriter,\n });\n\n const components: CustomComponents = {\n \"custom-button-after-content\": ({\n children,\n }: {\n children: React.ReactNode;\n }) => {\n return (\n <button\n className=\"content-render-custom-button-after-content\"\n onClick={onClickCustomButtonAfterContent}\n >\n {children}\n </button>\n );\n },\n \"custom-variable\": (props) => (\n <CustomButtonInputVariable\n {...props}\n readonly={readonly}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n onSend={onSend}\n beforeSend={beforeSend}\n confirmButtonText={confirmButtonText}\n // tooltipMinLength={tooltipMinLength}\n />\n ),\n code: (props) => {\n const { className, children, ...rest } = props as {\n className?: string;\n children?: React.ReactNode;\n };\n const match = /language-(\\w+)/.exec(className || \"\");\n const language = match?.[1];\n if (language === \"mermaid\") {\n const chartContent = children?.toString().replace(/\\n$/, \"\") || \"\";\n const frozen = mermaidBlockIsComplete(content, chartContent);\n return <MermaidChart chart={chartContent} frozen={frozen} />;\n }\n\n return (\n <code className={className} {...rest}>\n {children}\n </code>\n );\n },\n table: ({ ...props }) => (\n <div className=\"content-render-table-container\">\n <table className=\"content-render-table\" {...props} />\n </div>\n ),\n th: ({ ...props }) => <th className=\"content-render-th\" {...props} />,\n td: ({ ...props }) => <td className=\"content-render-td\" {...props} />,\n tr: ({ ...props }) => <tr className=\"content-render-tr\" {...props} />,\n li: ({ node, ...props }) => {\n const className = node?.properties?.className;\n const hasTaskListItem =\n (typeof className === \"string\" &&\n className.includes(\"task-list-item\")) ||\n (Array.isArray(className) && className.includes(\"task-list-item\"));\n if (hasTaskListItem) {\n return <li className=\"content-render-task-list-item\" {...props} />;\n }\n return <li {...props} />;\n },\n ol: ({ ...props }) => <ol className=\"content-render-ol\" {...props} />,\n ul: ({ ...props }) => <ul className=\"content-render-ul\" {...props} />,\n input: ({ ...props }) => {\n if (props.type === \"checkbox\") {\n return (\n <input\n type=\"checkbox\"\n className=\"content-render-checkbox\"\n disabled\n {...props}\n />\n );\n }\n return <input {...props} />;\n },\n a: ({ children, ...props }) => (\n <a target=\"_blank\" rel=\"noopener noreferrer\" {...props}>\n {children}\n </a>\n ),\n pre: (props) => (\n <CodeBlock\n {...props}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n />\n ),\n };\n\n const hasCompleted = useRef(false);\n\n useEffect(() => {\n if (isComplete && !hasCompleted.current) {\n hasCompleted.current = true; // Mark as completed\n onTypeFinished?.(); // Call the passed callback\n }\n }, [isComplete, onTypeFinished]);\n useEffect(() => {\n hasCompleted.current = false; // Reset completion status when content changes\n }, [content]);\n\n const segments = parseMarkdownSegments(displayContent);\n\n return (\n <div className={`content-render markdown-body`}>\n {segments.map((seg, index) => {\n if (seg.type === \"text\") {\n return (\n <ReactMarkdown\n key={index}\n remarkPlugins={[remarkGfm, remarkMath, remarkFlow, remarkBreaks]}\n rehypePlugins={[\n preserveCustomVariableProperties,\n rehypeRaw,\n restoreCustomVariableProperties,\n [\n rehypeHighlight,\n { languages: highlightLanguages, subset: subsetLanguages },\n ],\n rehypeKatex,\n ]}\n components={components}\n >\n {seg.value}\n </ReactMarkdown>\n );\n }\n\n if (seg.type === \"mermaid\") {\n return (\n <MermaidChart\n key={index}\n chart={seg.value}\n frozen={!seg.complete}\n />\n );\n }\n\n if (seg.type === \"svg\") {\n return <SvgBlockInShadow key={index} svg={seg.value} />;\n }\n })}\n\n {customRenderBar &&\n React.createElement(customRenderBar, {\n content,\n displayContent,\n onSend,\n })}\n </div>\n );\n};\n\nexport default ContentRender;\n"],"names":["SvgBlockInShadow","svg","hostRef","useRef","useEffect","host","shadowRoot","jsx","ContentRender","content","customRenderBar","onSend","typingSpeed","enableTypewriter","defaultButtonText","defaultInputText","defaultSelectedValues","readonly","onTypeFinished","confirmButtonText","copyButtonText","copiedButtonText","onClickCustomButtonAfterContent","beforeSend","displayContent","isComplete","useTypewriterStateMachine","components","children","props","CustomButtonInputVariable","className","rest","chartContent","frozen","mermaidBlockIsComplete","MermaidChart","node","CodeBlock","hasCompleted","segments","parseMarkdownSegments","jsxs","seg","index","ReactMarkdown","remarkGfm","remarkMath","remarkFlow","remarkBreaks","preserveCustomVariableProperties","rehypeRaw","restoreCustomVariableProperties","rehypeHighlight","highlightLanguages","subsetLanguages","rehypeKatex","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsEA,MAAMA,IAA8C,CAAC,EAAE,KAAAC,QAAU;AAC/D,QAAMC,IAAUC,EAAuB,IAAI;AAE3C,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAOH,EAAQ;AACrB,QAAI,CAACG,EAAM;AACX,UAAMC,IAAaD,EAAK,cAAcA,EAAK,aAAa,EAAE,MAAM,QAAQ;AACxE,IAAAC,EAAW,YAAYL;AAAA,EACzB,GAAG,CAACA,CAAG,CAAC,GAEDM,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,sBAAqB,KAAKL,GAAS;AAC3D,GASMM,KAA8C,CAAC;AAAA,EACnD,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,kBAAAC,IAAmB;AAAA,EACnB,mBAAAC;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AS;AACf,eACEpC,gBAAAA,EAAAA;AAAAA,UAAC6B;AAAA,UAAA;AAAA,YAEC,OAAOO,EAAI;AAAA,YACX,QAAQ,CAACA,EAAI;AAAA,UAAA;AAAA,UAFRC;AAAA,QAAA;AAOX,UAAID,EAAI,SAAS;AACf,eAAOpC,gBAAAA,EAAAA,IAACP,GAAA,EAA6B,KAAK2C,EAAI,SAAhBC,CAAuB;AAAA,IAEzD,CAAC;AAAA,IAEAlC,KACC+C,EAAM,cAAc/C,GAAiB;AAAA,MACnC,SAAAD;AAAA,MACA,gBAAAe;AAAA,MACA,QAAAb;AAAA,IAAA,CACD;AAAA,EAAA,GACL;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ContentRender.js","sources":["../../../src/components/ContentRender/ContentRender.tsx"],"sourcesContent":["import \"highlight.js/styles/github.css\";\nimport \"katex/dist/katex.min.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeRaw from \"rehype-raw\";\nimport remarkBreaks from \"remark-breaks\";\nimport remarkFlow from \"remark-flow\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport { CustomRenderBarProps, OnSendContentParams } from \"../types\";\nimport ContentBlackboard from \"./ContentBlackboard\";\nimport \"./contentRender.css\";\nimport \"./github-markdown-light.css\";\nimport CodeBlock from \"./CodeBlock\";\nimport CustomButtonInputVariable, {\n ComponentsWithCustomVariable,\n} from \"./plugins/CustomVariable\";\nimport MermaidChart from \"./plugins/MermaidChart\";\nimport ContentHtml from \"./ContentHtml\";\nimport useTypewriterStateMachine from \"./useTypewriterStateMachine\";\nimport {\n preserveCustomVariableProperties,\n restoreCustomVariableProperties,\n} from \"./utils/custom-variable-props\";\nimport {\n highlightLanguages,\n subsetLanguages,\n} from \"./utils/highlight-languages\";\n// import { processMarkdownText } from \"./utils/process-markdown\";\nimport {\n parseMarkdownSegments,\n mermaidBlockIsComplete,\n} from \"./utils/mermaid-parse\";\n// Define component Props type\nexport interface ContentRenderProps {\n content: string;\n /**\n * Callback invoked when the custom button after content is clicked.\n * This button is rendered via the `<custom-button-after-content>` tag in markdown content.\n * @example\n * ```tsx\n * <ContentRender\n * content=\"Hello <custom-button-after-content>Ask</custom-button-after-content>\"\n * onClickCustomButtonAfterContent={() => console.log('Button clicked')}\n * />\n * ```\n */\n customRenderBar?: CustomRenderBarProps;\n onClickCustomButtonAfterContent?: () => void;\n onSend?: (content: OnSendContentParams) => void;\n typingSpeed?: number;\n enableTypewriter?: boolean;\n defaultButtonText?: string;\n defaultInputText?: string; // Text input by user\n defaultSelectedValues?: string[]; // Default selected values for multi-select\n readonly?: boolean;\n onTypeFinished?: () => void;\n // Multi-select confirm button text (i18n support)\n confirmButtonText?: string;\n // Copy button text (i18n support)\n copyButtonText?: string;\n // Copied state text (i18n support)\n copiedButtonText?: string;\n // Dynamic interaction format for multi-select support\n dynamicInteractionFormat?: string;\n // Fullscreen button text for iframe rendering\n fullscreenButtonText?: string;\n beforeSend?: (param: OnSendContentParams) => boolean;\n // Raw payload for content_html stream messages\n contentHtmlPayload?: string;\n // Content render type, blackboard will use ContentBlackboard for streaming chunks\n contentType?: \"default\" | \"blackboard\";\n // Render narration as caption overlay for blackboard streaming mode\n renderNarrationAsCaption?: boolean;\n // Maximum visible step number when using blackboard streaming mode (manual stepping)\n maxVisibleStepNumber?: number;\n // Visible step number for single-step display (non-accumulated)\n visibleStepNumber?: number;\n // tooltipMinLength?: number; // Control minimum character length for tooltip display, default 10\n}\n\n// Render svg string via Shadow DOM to avoid markdown wrapping\nconst SvgBlockInShadow: React.FC<{ svg: string }> = ({ svg }) => {\n const hostRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const host = hostRef.current;\n if (!host) return;\n const shadowRoot = host.shadowRoot ?? host.attachShadow({ mode: \"open\" });\n shadowRoot.innerHTML = svg;\n }, [svg]);\n\n return <div className=\"content-render-svg\" ref={hostRef} />;\n};\n\n// Extended component interface\ntype CustomComponents = ComponentsWithCustomVariable & {\n \"custom-button-after-content\"?: React.ComponentType<{\n children: React.ReactNode;\n }>;\n};\n\nconst ContentRender: React.FC<ContentRenderProps> = ({\n content,\n customRenderBar,\n onSend,\n typingSpeed = 30,\n enableTypewriter = false,\n defaultButtonText,\n defaultInputText,\n defaultSelectedValues,\n readonly = false,\n onTypeFinished,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n fullscreenButtonText,\n onClickCustomButtonAfterContent,\n beforeSend,\n contentHtmlPayload,\n contentType = \"default\",\n renderNarrationAsCaption = false,\n maxVisibleStepNumber,\n visibleStepNumber,\n // tooltipMinLength,\n}) => {\n // Use custom Hook to handle typewriter effect\n const { displayContent, isComplete } = useTypewriterStateMachine({\n // processMarkdownText will let code block printf(\"You win!\\n\") become printf(\"You win!<br/>\");\n // content: processMarkdownText(content),\n content: content,\n typingSpeed,\n disabled: !enableTypewriter,\n });\n const components: CustomComponents = {\n \"custom-button-after-content\": ({\n children,\n }: {\n children: React.ReactNode;\n }) => {\n return (\n <button\n className=\"content-render-custom-button-after-content\"\n onClick={onClickCustomButtonAfterContent}\n >\n {children}\n </button>\n );\n },\n \"custom-variable\": (props) => (\n <CustomButtonInputVariable\n {...props}\n readonly={readonly}\n defaultButtonText={defaultButtonText}\n defaultInputText={defaultInputText}\n defaultSelectedValues={defaultSelectedValues}\n onSend={onSend}\n beforeSend={beforeSend}\n confirmButtonText={confirmButtonText}\n // tooltipMinLength={tooltipMinLength}\n />\n ),\n code: (props) => {\n const { className, children, ...rest } = props as {\n className?: string;\n children?: React.ReactNode;\n };\n const match = /language-(\\w+)/.exec(className || \"\");\n const language = match?.[1];\n if (language === \"mermaid\") {\n const chartContent = children?.toString().replace(/\\n$/, \"\") || \"\";\n const frozen = mermaidBlockIsComplete(content, chartContent);\n return <MermaidChart chart={chartContent} frozen={frozen} />;\n }\n\n return (\n <code className={className} {...rest}>\n {children}\n </code>\n );\n },\n table: ({ ...props }) => (\n <div className=\"content-render-table-container\">\n <table className=\"content-render-table\" {...props} />\n </div>\n ),\n th: ({ ...props }) => <th className=\"content-render-th\" {...props} />,\n td: ({ ...props }) => <td className=\"content-render-td\" {...props} />,\n tr: ({ ...props }) => <tr className=\"content-render-tr\" {...props} />,\n li: ({ node, ...props }) => {\n const className = node?.properties?.className;\n const hasTaskListItem =\n (typeof className === \"string\" &&\n className.includes(\"task-list-item\")) ||\n (Array.isArray(className) && className.includes(\"task-list-item\"));\n if (hasTaskListItem) {\n return <li className=\"content-render-task-list-item\" {...props} />;\n }\n return <li {...props} />;\n },\n ol: ({ ...props }) => <ol className=\"content-render-ol\" {...props} />,\n ul: ({ ...props }) => <ul className=\"content-render-ul\" {...props} />,\n input: ({ ...props }) => {\n if (props.type === \"checkbox\") {\n return (\n <input\n type=\"checkbox\"\n className=\"content-render-checkbox\"\n disabled\n {...props}\n />\n );\n }\n return <input {...props} />;\n },\n a: ({ children, ...props }) => (\n <a target=\"_blank\" rel=\"noopener noreferrer\" {...props}>\n {children}\n </a>\n ),\n pre: (props) => (\n <CodeBlock\n {...props}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n />\n ),\n };\n\n const hasCompleted = useRef(false);\n\n useEffect(() => {\n if (isComplete && !hasCompleted.current) {\n hasCompleted.current = true; // Mark as completed\n onTypeFinished?.(); // Call the passed callback\n }\n }, [isComplete, onTypeFinished]);\n useEffect(() => {\n hasCompleted.current = false; // Reset completion status when content changes\n }, [content]);\n\n const segments = parseMarkdownSegments(displayContent);\n\n return (\n <div className={`content-render markdown-body`}>\n {segments.map((seg, index) => {\n if (seg.type === \"text\") {\n return (\n <ReactMarkdown\n key={index}\n remarkPlugins={[remarkGfm, remarkMath, remarkFlow, remarkBreaks]}\n rehypePlugins={[\n preserveCustomVariableProperties,\n rehypeRaw,\n restoreCustomVariableProperties,\n [\n rehypeHighlight,\n { languages: highlightLanguages, subset: subsetLanguages },\n ],\n rehypeKatex,\n ]}\n components={components}\n >\n {seg.value}\n </ReactMarkdown>\n );\n }\n\n if (seg.type === \"mermaid\") {\n return (\n <MermaidChart\n key={index}\n chart={seg.value}\n frozen={!seg.complete}\n />\n );\n }\n\n if (seg.type === \"svg\") {\n return <SvgBlockInShadow key={index} svg={seg.value} />;\n }\n\n if (seg.type === \"html\") {\n return (\n <ContentHtml\n key={index}\n html={seg.value}\n fullscreenButtonText={fullscreenButtonText}\n />\n );\n }\n\n return null;\n })}\n\n {contentHtmlPayload &&\n (contentType === \"blackboard\" ? (\n <ContentBlackboard\n payload={contentHtmlPayload}\n renderNarrationAsCaption={renderNarrationAsCaption}\n maxVisibleStepNumber={maxVisibleStepNumber}\n visibleStepNumber={visibleStepNumber}\n />\n ) : (\n <ContentHtml\n payload={contentHtmlPayload}\n fullscreenButtonText={fullscreenButtonText}\n />\n ))}\n\n {customRenderBar &&\n React.createElement(customRenderBar, {\n content,\n displayContent,\n onSend,\n })}\n </div>\n );\n};\n\nexport default ContentRender;\n"],"names":["SvgBlockInShadow","svg","hostRef","useRef","useEffect","host","shadowRoot","jsx","ContentRender","content","customRenderBar","onSend","typingSpeed","enableTypewriter","defaultButtonText","defaultInputText","defaultSelectedValues","readonly","onTypeFinished","confirmButtonText","copyButtonText","copiedButtonText","fullscreenButtonText","onClickCustomButtonAfterContent","beforeSend","contentHtmlPayload","contentType","renderNarrationAsCaption","maxVisibleStepNumber","visibleStepNumber","displayContent","isComplete","useTypewriterStateMachine","components","children","props","CustomButtonInputVariable","className","rest","chartContent","frozen","mermaidBlockIsComplete","MermaidChart","node","CodeBlock","hasCompleted","segments","parseMarkdownSegments","jsxs","seg","index","ReactMarkdown","remarkGfm","remarkMath","remarkFlow","remarkBreaks","preserveCustomVariableProperties","rehypeRaw","restoreCustomVariableProperties","rehypeHighlight","highlightLanguages","subsetLanguages","rehypeKatex","ContentHtml","ContentBlackboard","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoFA,MAAMA,KAA8C,CA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A,QACC,SAAStC;AAAA,QACT,sBAAAH;AAAA,MAAA;AAAA,IAAA;AAAA,IAILZ,KACCuD,EAAM,cAAcvD,GAAiB;AAAA,MACnC,SAAAD;AAAA,MACA,gBAAAqB;AAAA,MACA,QAAAnB;AAAA,IAAA,CACD;AAAA,EAAA,GACL;AAEJ;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
declare const meta: {
|
|
3
4
|
title: string;
|
|
4
|
-
component:
|
|
5
|
+
component: React.FC<import('./ContentRender').ContentRenderProps>;
|
|
5
6
|
parameters: {
|
|
6
7
|
layout: string;
|
|
7
8
|
};
|
|
@@ -11,6 +12,10 @@ declare const meta: {
|
|
|
11
12
|
control: "text";
|
|
12
13
|
description: string;
|
|
13
14
|
};
|
|
15
|
+
fullscreenButtonText: {
|
|
16
|
+
control: "text";
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
14
19
|
};
|
|
15
20
|
args: {
|
|
16
21
|
content: string;
|
|
@@ -31,5 +36,11 @@ export declare const InteractiveMultiSelectDemo: Story;
|
|
|
31
36
|
export declare const ChineseMultiSelectDemo: Story;
|
|
32
37
|
export declare const NativeHtmlElements: Story;
|
|
33
38
|
export declare const CodeBlockShowcase: Story;
|
|
39
|
+
export declare const HtmlCodeBlockAsCode: Story;
|
|
34
40
|
export declare const EnglishChineseTypographyPreview: Story;
|
|
35
41
|
export declare const SVGDemo: Story;
|
|
42
|
+
export declare const HtmlIframeDemo: Story;
|
|
43
|
+
export declare const HtmlIframeWithLoading: Story;
|
|
44
|
+
export declare const HtmlChunkStreaming: Story;
|
|
45
|
+
export declare const HtmlChunkStreamingWithCaption: Story;
|
|
46
|
+
export declare const HtmlChunkStreamingManual: Story;
|
|
@@ -4,4 +4,5 @@ export { default as ContentRender } from './ContentRender';
|
|
|
4
4
|
export { default as MarkdownFlowInput } from './MarkdownFlowInput';
|
|
5
5
|
export { default as useTypewriter } from './useTypewriter';
|
|
6
6
|
export { default as useTypewriterStateMachine } from './useTypewriterStateMachine';
|
|
7
|
+
export { default as ContentBlackboard } from './ContentBlackboard';
|
|
7
8
|
export type { MarkdownFlowInputProps } from './MarkdownFlowInput';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const p = (c) => {
|
|
2
|
+
try {
|
|
3
|
+
const n = JSON.parse(c), e = typeof n == "object" && n !== null ? n : null, t = typeof e?.data == "object" && e?.data !== null ? e.data : e, r = t?.html, o = t?.narration, a = t?.step_number ?? t?.stepNumber, s = t?.is_complete ?? t?.isComplete, l = t?.block_index ?? t?.blockIndex ?? 0;
|
|
4
|
+
return typeof r != "string" || typeof a != "number" || typeof s != "boolean" || typeof l != "number" ? null : {
|
|
5
|
+
html: r,
|
|
6
|
+
narration: typeof o == "string" && o.trim() ? o : void 0,
|
|
7
|
+
stepNumber: a,
|
|
8
|
+
isComplete: s,
|
|
9
|
+
blockIndex: l
|
|
10
|
+
};
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
p as parseContentHtmlStreamChunk
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=content-html-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-html-stream.js","sources":["../../../../src/components/ContentRender/utils/content-html-stream.ts"],"sourcesContent":["export type ContentHtmlStreamChunk = {\n html: string;\n narration?: string;\n stepNumber: number;\n isComplete: boolean;\n blockIndex: number;\n};\n\nexport const parseContentHtmlStreamChunk = (\n payload: string\n): ContentHtmlStreamChunk | null => {\n try {\n const parsed = JSON.parse(payload);\n const source =\n typeof parsed === \"object\" && parsed !== null ? parsed : null;\n const maybeData =\n typeof source?.data === \"object\" && source?.data !== null\n ? source.data\n : source;\n\n const html = maybeData?.html;\n const narration = maybeData?.narration;\n const stepNumber = maybeData?.step_number ?? maybeData?.stepNumber;\n const isComplete = maybeData?.is_complete ?? maybeData?.isComplete;\n const blockIndex = maybeData?.block_index ?? maybeData?.blockIndex ?? 0;\n\n if (\n typeof html !== \"string\" ||\n typeof stepNumber !== \"number\" ||\n typeof isComplete !== \"boolean\" ||\n typeof blockIndex !== \"number\"\n ) {\n return null;\n }\n\n return {\n html,\n narration:\n typeof narration === \"string\" && narration.trim()\n ? narration\n : undefined,\n stepNumber,\n isComplete,\n blockIndex,\n };\n } catch {\n return null;\n }\n};\n"],"names":["parseContentHtmlStreamChunk","payload","parsed","source","maybeData","html","narration","stepNumber","isComplete","blockIndex"],"mappings":"AAQO,MAAMA,IAA8B,CACzCC,MACkC;AAClC,MAAI;AACF,UAAMC,IAAS,KAAK,MAAMD,CAAO,GAC3BE,IACJ,OAAOD,KAAW,YAAYA,MAAW,OAAOA,IAAS,MACrDE,IACJ,OAAOD,GAAQ,QAAS,YAAYA,GAAQ,SAAS,OACjDA,EAAO,OACPA,GAEAE,IAAOD,GAAW,MAClBE,IAAYF,GAAW,WACvBG,IAAaH,GAAW,eAAeA,GAAW,YAClDI,IAAaJ,GAAW,eAAeA,GAAW,YAClDK,IAAaL,GAAW,eAAeA,GAAW,cAAc;AAEtE,WACE,OAAOC,KAAS,YAChB,OAAOE,KAAe,YACtB,OAAOC,KAAe,aACtB,OAAOC,KAAe,WAEf,OAGF;AAAA,MACL,MAAAJ;AAAA,MACA,WACE,OAAOC,KAAc,YAAYA,EAAU,KAAA,IACvCA,IACA;AAAA,MACN,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,IAAA;AAAA,EAEJ,QAAQ;AACN,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import o from "../../../node_modules/highlight.js/es/languages/javascript.js";
|
|
2
|
-
import m from "../../../node_modules/highlight.js/es/languages/typescript.js";
|
|
3
|
-
import r from "../../../node_modules/highlight.js/es/languages/python.js";
|
|
4
|
-
import i from "../../../node_modules/highlight.js/es/languages/java.js";
|
|
5
|
-
import t from "../../../node_modules/highlight.js/es/languages/xml.js";
|
|
6
|
-
import a from "../../../node_modules/highlight.js/es/languages/css.js";
|
|
7
|
-
import f from "../../../node_modules/highlight.js/es/languages/json.js";
|
|
8
|
-
import p from "../../../node_modules/highlight.js/es/languages/bash.js";
|
|
9
|
-
import l from "../../../node_modules/highlight.js/es/languages/sql.js";
|
|
10
|
-
import s from "../../../node_modules/highlight.js/es/languages/markdown.js";
|
|
11
|
-
import h from "../../../node_modules/highlight.js/es/languages/c.js";
|
|
12
|
-
import c from "../../../node_modules/highlight.js/es/languages/cpp.js";
|
|
13
|
-
import e from "../../../node_modules/highlight.js/es/languages/go.js";
|
|
14
|
-
import n from "../../../node_modules/highlight.js/es/languages/plaintext.js";
|
|
15
|
-
import g from "../../../node_modules/highlight.js/es/languages/rust.js";
|
|
16
|
-
import j from "../../../node_modules/highlight.js/es/languages/shell.js";
|
|
17
|
-
import u from "../../../node_modules/highlight.js/es/languages/scss.js";
|
|
18
|
-
import x from "../../../node_modules/highlight.js/es/languages/yaml.js";
|
|
19
|
-
import y from "../../../node_modules/highlight.js/es/languages/vhdl.js";
|
|
20
|
-
import v from "../../../node_modules/highlight.js/es/languages/latex.js";
|
|
21
|
-
import d from "../../../node_modules/highlight.js/es/languages/lua.js";
|
|
22
|
-
import b from "../../../node_modules/highlight.js/es/languages/php.js";
|
|
1
|
+
import o from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js";
|
|
2
|
+
import m from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js";
|
|
3
|
+
import r from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js";
|
|
4
|
+
import i from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js";
|
|
5
|
+
import t from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js";
|
|
6
|
+
import a from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js";
|
|
7
|
+
import f from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js";
|
|
8
|
+
import p from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js";
|
|
9
|
+
import l from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js";
|
|
10
|
+
import s from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js";
|
|
11
|
+
import h from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/c.js";
|
|
12
|
+
import c from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/cpp.js";
|
|
13
|
+
import e from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js";
|
|
14
|
+
import n from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js";
|
|
15
|
+
import g from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js";
|
|
16
|
+
import j from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/shell.js";
|
|
17
|
+
import u from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/scss.js";
|
|
18
|
+
import x from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js";
|
|
19
|
+
import y from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/vhdl.js";
|
|
20
|
+
import v from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/latex.js";
|
|
21
|
+
import d from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/lua.js";
|
|
22
|
+
import b from "../../../Documents/ai-shifu/markdown-flow-ui/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/php.js";
|
|
23
23
|
const S = {
|
|
24
24
|
javascript: o,
|
|
25
25
|
js: o,
|
|
@@ -9,6 +9,10 @@ export declare function parseMarkdownSegments(markdown: string): ({
|
|
|
9
9
|
type: "svg";
|
|
10
10
|
value: string;
|
|
11
11
|
complete: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
type: "html";
|
|
14
|
+
value: string;
|
|
15
|
+
complete: boolean;
|
|
12
16
|
})[];
|
|
13
17
|
export declare function parseMermaidBlocks(fullMarkdown: string): {
|
|
14
18
|
code: string;
|
|
@@ -1,96 +1,143 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
function B(s) {
|
|
2
|
+
const e = [], u = (c) => {
|
|
3
|
+
const r = /```/g;
|
|
4
|
+
let l, n = !1;
|
|
5
|
+
for (; (l = r.exec(s)) !== null && l.index < c; )
|
|
6
|
+
n = !n;
|
|
7
|
+
return n;
|
|
8
|
+
}, o = /```[\s\S]*?```|<!DOCTYPE html[\s\S]*?<\/html>|<html[\s\S]*?<\/html>|<svg[\s\S]*?<\/svg>/gi;
|
|
9
|
+
let t = 0, i;
|
|
10
|
+
for (; (i = o.exec(s)) !== null; ) {
|
|
11
|
+
const c = i.index, r = o.lastIndex, l = i[0];
|
|
12
|
+
if (c > t && e.push({
|
|
7
13
|
type: "text",
|
|
8
|
-
value:
|
|
9
|
-
}),
|
|
10
|
-
const
|
|
11
|
-
|
|
14
|
+
value: s.slice(t, c)
|
|
15
|
+
}), l.startsWith("```mermaid")) {
|
|
16
|
+
const n = l.replace(/^```mermaid/, "").replace(/```$/, "").trim();
|
|
17
|
+
e.push({
|
|
12
18
|
type: "mermaid",
|
|
13
|
-
value:
|
|
19
|
+
value: n,
|
|
14
20
|
complete: !0
|
|
15
21
|
});
|
|
16
|
-
} else
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
} else if (l.startsWith("```"))
|
|
23
|
+
e.push({
|
|
24
|
+
type: "text",
|
|
25
|
+
value: l
|
|
26
|
+
});
|
|
27
|
+
else if (/^<svg/i.test(l)) {
|
|
28
|
+
if (u(c)) {
|
|
29
|
+
e.push({
|
|
30
|
+
type: "text",
|
|
31
|
+
value: l
|
|
32
|
+
}), t = r;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
e.push({
|
|
36
|
+
type: "svg",
|
|
37
|
+
value: l,
|
|
38
|
+
complete: !0
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
if (u(c)) {
|
|
42
|
+
e.push({
|
|
43
|
+
type: "text",
|
|
44
|
+
value: l
|
|
45
|
+
}), t = r;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
e.push({
|
|
49
|
+
type: "html",
|
|
50
|
+
value: l,
|
|
51
|
+
complete: !0
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
t = r;
|
|
25
55
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
56
|
+
const p = s.indexOf("```", t), a = s.toLowerCase(), d = (c, r, l) => {
|
|
57
|
+
let n = a.lastIndexOf(c);
|
|
58
|
+
const f = a.lastIndexOf(r);
|
|
59
|
+
if (n === -1 || f !== -1 && f > n) {
|
|
60
|
+
const v = l.find(
|
|
61
|
+
(I) => a.endsWith(I)
|
|
62
|
+
);
|
|
63
|
+
v && (n = s.length - v.length);
|
|
64
|
+
}
|
|
65
|
+
return !(p !== -1 && p < n) && n !== -1 && (f === -1 || f < n) && n >= t ? n : -1;
|
|
66
|
+
}, x = d("<html", "</html>", [
|
|
67
|
+
"<htm",
|
|
68
|
+
"<ht"
|
|
69
|
+
]), g = d("<svg", "</svg>", [
|
|
70
|
+
"<sv",
|
|
71
|
+
"<s"
|
|
72
|
+
]), h = Math.max(x, g);
|
|
73
|
+
if (h !== -1)
|
|
74
|
+
return h > t && e.push({
|
|
32
75
|
type: "text",
|
|
33
|
-
value:
|
|
34
|
-
}),
|
|
76
|
+
value: s.slice(t, h)
|
|
77
|
+
}), h === x ? e.push({
|
|
78
|
+
type: "html",
|
|
79
|
+
value: s.slice(h),
|
|
80
|
+
complete: !1
|
|
81
|
+
}) : e.push({
|
|
35
82
|
type: "svg",
|
|
36
|
-
value:
|
|
83
|
+
value: s.slice(h),
|
|
37
84
|
complete: !1
|
|
38
|
-
}),
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
85
|
+
}), e;
|
|
86
|
+
const m = s.lastIndexOf("```mermaid");
|
|
87
|
+
if (m !== -1 && m >= t && // Ensure this mermaid block isn't inside another code block (unlikely but safe to check)
|
|
41
88
|
// Actually, incompleteCodeBlockStart would capture this "```mermaid" as just "```"
|
|
42
89
|
// so we need to be careful.
|
|
43
90
|
// If incompleteCodeBlockStart points to THIS mermaid block, we process it as mermaid.
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
return
|
|
91
|
+
m === p) {
|
|
92
|
+
const c = s.slice(m + 10);
|
|
93
|
+
return e.push({
|
|
47
94
|
type: "mermaid",
|
|
48
|
-
value:
|
|
95
|
+
value: c.trim(),
|
|
49
96
|
complete: !1
|
|
50
|
-
}),
|
|
97
|
+
}), m > t && e.push({
|
|
51
98
|
type: "text",
|
|
52
|
-
value:
|
|
53
|
-
}),
|
|
99
|
+
value: s.slice(t, m)
|
|
100
|
+
}), e;
|
|
54
101
|
}
|
|
55
|
-
return
|
|
102
|
+
return t < s.length && e.push({
|
|
56
103
|
type: "text",
|
|
57
|
-
value:
|
|
58
|
-
}),
|
|
104
|
+
value: s.slice(t)
|
|
105
|
+
}), e;
|
|
59
106
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
return
|
|
64
|
-
if (!
|
|
65
|
-
|
|
107
|
+
function y(s) {
|
|
108
|
+
const e = [], u = s.split(/\r?\n/);
|
|
109
|
+
let o = !1, t = [], i = 0;
|
|
110
|
+
return u.forEach((p, a) => {
|
|
111
|
+
if (!o) {
|
|
112
|
+
p.trim().startsWith("```mermaid") && (o = !0, i = a, t = []);
|
|
66
113
|
return;
|
|
67
114
|
}
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
code:
|
|
115
|
+
if (p.trim() === "```") {
|
|
116
|
+
e.push({
|
|
117
|
+
code: t.join(`
|
|
71
118
|
`).trim(),
|
|
72
|
-
startLine:
|
|
73
|
-
endLine:
|
|
119
|
+
startLine: i,
|
|
120
|
+
endLine: a,
|
|
74
121
|
complete: !0
|
|
75
|
-
}),
|
|
122
|
+
}), o = !1;
|
|
76
123
|
return;
|
|
77
124
|
}
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
code:
|
|
125
|
+
t.push(p);
|
|
126
|
+
}), o && e.push({
|
|
127
|
+
code: t.join(`
|
|
81
128
|
`).trim(),
|
|
82
|
-
startLine:
|
|
129
|
+
startLine: i,
|
|
83
130
|
endLine: null,
|
|
84
131
|
complete: !1
|
|
85
|
-
}),
|
|
132
|
+
}), e;
|
|
86
133
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
return
|
|
134
|
+
function M(s, e) {
|
|
135
|
+
const u = e.trim(), t = y(s).find((i) => i.code === u);
|
|
136
|
+
return t ? t.complete : !1;
|
|
90
137
|
}
|
|
91
138
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
139
|
+
M as mermaidBlockIsComplete,
|
|
140
|
+
B as parseMarkdownSegments,
|
|
141
|
+
y as parseMermaidBlocks
|
|
95
142
|
};
|
|
96
143
|
//# sourceMappingURL=mermaid-parse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid-parse.js","sources":["../../../../src/components/ContentRender/utils/mermaid-parse.ts"],"sourcesContent":["export function parseMarkdownSegments(markdown: string) {\n const segments: Array<\n | { type: \"text\"; value: string }\n | { type: \"mermaid\"; value: string; complete: boolean }\n | { type: \"svg\"; value: string; complete: boolean }\n > = [];\n\n // Match:\n // 1. Generic code blocks (including mermaid): ``` ... ```\n // 2. SVG blocks: <svg ... </svg>\n const regex = /```[\\s\\S]*?```|<svg[\\s\\S]*?<\\/svg>/g;\n\n let lastIndex = 0;\n let match;\n\n while ((match = regex.exec(markdown)) !== null) {\n const start = match.index;\n const end = regex.lastIndex;\n const rawMatch = match[0];\n\n // Preceding plain text\n if (start > lastIndex) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex, start),\n });\n }\n\n // Complete mermaid block, generic code block, or svg block\n if (rawMatch.startsWith(\"```mermaid\")) {\n const code = rawMatch\n .replace(/^```mermaid/, \"\")\n .replace(/```$/, \"\")\n .trim();\n segments.push({\n type: \"mermaid\",\n value: code,\n complete: true,\n });\n } else if (rawMatch.startsWith(\"```\")) {\n // Generic code block - treat as text so ReactMarkdown renders it\n segments.push({\n type: \"text\",\n value: rawMatch,\n });\n } else {\n // SVG block\n segments.push({\n type: \"svg\",\n value: rawMatch,\n complete: true,\n });\n }\n\n lastIndex = end;\n }\n\n // Handle unfinished svg block to avoid leaking raw tags while streaming\n let incompleteSvgStart = markdown.lastIndexOf(\"<svg\");\n const lastSvgClose = markdown.lastIndexOf(\"</svg>\");\n\n // If we haven't found an open <svg tag (or the last one is closed),\n // check if the string ends with a partial <svg tag (<s, <sv).\n if (\n incompleteSvgStart === -1 ||\n (lastSvgClose !== -1 && lastSvgClose > incompleteSvgStart)\n ) {\n if (markdown.endsWith(\"<sv\")) {\n incompleteSvgStart = markdown.length - 3;\n } else if (markdown.endsWith(\"<s\")) {\n incompleteSvgStart = markdown.length - 2;\n }\n }\n\n // Check if we are inside an unclosed code block\n // If an unclosed code block starts AFTER the last complete segment (lastIndex),\n // and BEFORE the potential SVG start, then the SVG is inside the code block.\n const incompleteCodeBlockStart = markdown.indexOf(\"```\", lastIndex);\n const isInsideCodeBlock =\n incompleteCodeBlockStart !== -1 &&\n incompleteCodeBlockStart < incompleteSvgStart;\n\n const hasIncompleteSvg =\n !isInsideCodeBlock &&\n incompleteSvgStart !== -1 &&\n (lastSvgClose === -1 || lastSvgClose < incompleteSvgStart) &&\n incompleteSvgStart >= lastIndex;\n\n if (hasIncompleteSvg) {\n if (incompleteSvgStart > lastIndex) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex, incompleteSvgStart),\n });\n }\n\n segments.push({\n type: \"svg\",\n value: markdown.slice(incompleteSvgStart),\n complete: false,\n });\n return segments;\n }\n\n // Check whether there is an unfinished mermaid block\n // Only if we are NOT inside a generic incomplete code block that started earlier\n // Actually, standard mermaid block starts with ```mermaid, so it IS a code block start.\n // We just need to check if it's specifically mermaid.\n const incompleteStart = markdown.lastIndexOf(\"```mermaid\");\n if (\n incompleteStart !== -1 &&\n incompleteStart >= lastIndex &&\n // Ensure this mermaid block isn't inside another code block (unlikely but safe to check)\n // Actually, incompleteCodeBlockStart would capture this \"```mermaid\" as just \"```\"\n // so we need to be careful.\n // If incompleteCodeBlockStart points to THIS mermaid block, we process it as mermaid.\n incompleteStart === incompleteCodeBlockStart\n ) {\n const code = markdown.slice(incompleteStart + 10);\n segments.push({\n type: \"mermaid\",\n value: code.trim(),\n complete: false,\n });\n\n if (incompleteStart > lastIndex) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex, incompleteStart),\n });\n }\n\n return segments;\n }\n\n // Remaining text\n if (lastIndex < markdown.length) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex),\n });\n }\n\n return segments;\n}\n\nexport function parseMermaidBlocks(fullMarkdown: string) {\n const blocks = [];\n const lines: string[] = fullMarkdown.split(/\\r?\\n/);\n\n let inside = false;\n let current: string[] = [];\n let startLine = 0;\n\n lines.forEach((line, index) => {\n if (!inside) {\n if (line.trim().startsWith(\"```mermaid\")) {\n inside = true;\n startLine = index;\n current = [];\n }\n return;\n }\n\n // inside mermaid mode\n if (line.trim() === \"```\") {\n // block complete\n blocks.push({\n code: current.join(\"\\n\").trim(),\n startLine,\n endLine: index,\n complete: true,\n });\n inside = false;\n return;\n }\n\n current.push(line);\n });\n\n // if still inside → incomplete block\n if (inside) {\n blocks.push({\n code: current.join(\"\\n\").trim(),\n startLine,\n endLine: null,\n complete: false,\n });\n }\n\n return blocks;\n}\n\n/**\n * Determine whether the mermaid block for the given codeString is fully closed.\n * @param fullMarkdown Full markdown text (grows over time in streaming scenarios)\n * @param codeString Mermaid block code passed to the renderer (children)\n */\nexport function mermaidBlockIsComplete(\n fullMarkdown: string,\n codeString: string\n) {\n const cleaned = codeString.trim();\n const blocks = parseMermaidBlocks(fullMarkdown);\n // Locate the block that matches the current codeString\n const block = blocks.find((b) => b.code === cleaned);\n\n if (!block) return false;\n\n // Block is complete when the closing fence already exists\n return block.complete;\n}\n"],"names":["parseMarkdownSegments","markdown","segments","regex","lastIndex","match","start","end","rawMatch","code","incompleteSvgStart","lastSvgClose","incompleteCodeBlockStart","incompleteStart","parseMermaidBlocks","fullMarkdown","blocks","lines","inside","current","startLine","line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SAASE;AAAA,QACT,UAAU;AAAA,MAAA,CACX,GACDJ,IAAS;AACT;AAAA,IACF;AAEA,IAAAC,EAAQ,KAAKE,CAAI;AAAA,EACnB,CAAC,GAGGH,KACFF,EAAO,KAAK;AAAA,IACV,MAAMG,EAAQ,KAAK;AAAA,CAAI,EAAE,KAAA;AAAA,IACzB,WAAAC;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,EAAA,CACX,GAGIJ;AACT;AAOO,SAASO,EACdR,GACAS,GACA;AACA,QAAMC,IAAUD,EAAW,KAAA,GAGrBE,IAFSZ,EAAmBC,CAAY,EAEzB,KAAK,CAACY,MAAMA,EAAE,SAASF,CAAO;AAEnD,SAAKC,IAGEA,EAAM,WAHM;AAIrB;"}
|
|
1
|
+
{"version":3,"file":"mermaid-parse.js","sources":["../../../../src/components/ContentRender/utils/mermaid-parse.ts"],"sourcesContent":["export function parseMarkdownSegments(markdown: string) {\n const segments: Array<\n | { type: \"text\"; value: string }\n | { type: \"mermaid\"; value: string; complete: boolean }\n | { type: \"svg\"; value: string; complete: boolean }\n | { type: \"html\"; value: string; complete: boolean }\n > = [];\n\n const isInsideCodeFence = (position: number) => {\n const fenceRegex = /```/g;\n let matchFence;\n let inside = false;\n while (\n (matchFence = fenceRegex.exec(markdown)) !== null &&\n matchFence.index < position\n ) {\n inside = !inside;\n }\n return inside;\n };\n\n // Match:\n // 1. Generic code blocks (including mermaid): ``` ... ```\n // 2. SVG blocks: <svg ... </svg>\n // 3. Full HTML documents: <!DOCTYPE html> ... </html> or <html ... </html>\n const regex =\n /```[\\s\\S]*?```|<!DOCTYPE html[\\s\\S]*?<\\/html>|<html[\\s\\S]*?<\\/html>|<svg[\\s\\S]*?<\\/svg>/gi;\n\n let lastIndex = 0;\n let match;\n\n while ((match = regex.exec(markdown)) !== null) {\n const start = match.index;\n const end = regex.lastIndex;\n const rawMatch = match[0];\n\n // Preceding plain text\n if (start > lastIndex) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex, start),\n });\n }\n\n // Complete mermaid block, generic code block, or svg block\n if (rawMatch.startsWith(\"```mermaid\")) {\n const code = rawMatch\n .replace(/^```mermaid/, \"\")\n .replace(/```$/, \"\")\n .trim();\n segments.push({\n type: \"mermaid\",\n value: code,\n complete: true,\n });\n } else if (rawMatch.startsWith(\"```\")) {\n // Generic code block - treat as text so ReactMarkdown renders it\n segments.push({\n type: \"text\",\n value: rawMatch,\n });\n } else if (/^<svg/i.test(rawMatch)) {\n if (isInsideCodeFence(start)) {\n segments.push({\n type: \"text\",\n value: rawMatch,\n });\n lastIndex = end;\n continue;\n }\n // SVG block\n segments.push({\n type: \"svg\",\n value: rawMatch,\n complete: true,\n });\n } else {\n if (isInsideCodeFence(start)) {\n segments.push({\n type: \"text\",\n value: rawMatch,\n });\n lastIndex = end;\n continue;\n }\n // HTML block\n segments.push({\n type: \"html\",\n value: rawMatch,\n complete: true,\n });\n }\n\n lastIndex = end;\n }\n\n // Check if we are inside an unclosed code block\n // If an unclosed code block starts AFTER the last complete segment (lastIndex),\n // and BEFORE the potential SVG start, then the SVG is inside the code block.\n const incompleteCodeBlockStart = markdown.indexOf(\"```\", lastIndex);\n const lowerMarkdown = markdown.toLowerCase();\n\n const findIncompleteBlockStart = (\n openTag: string,\n closeTag: string,\n partialEndings: string[]\n ) => {\n let openIndex = lowerMarkdown.lastIndexOf(openTag);\n const closeIndex = lowerMarkdown.lastIndexOf(closeTag);\n\n if (openIndex === -1 || (closeIndex !== -1 && closeIndex > openIndex)) {\n const partial = partialEndings.find((ending) =>\n lowerMarkdown.endsWith(ending)\n );\n if (partial) {\n openIndex = markdown.length - partial.length;\n }\n }\n\n const isInsideCodeBlock =\n incompleteCodeBlockStart !== -1 && incompleteCodeBlockStart < openIndex;\n\n const hasIncomplete =\n !isInsideCodeBlock &&\n openIndex !== -1 &&\n (closeIndex === -1 || closeIndex < openIndex) &&\n openIndex >= lastIndex;\n\n return hasIncomplete ? openIndex : -1;\n };\n\n const incompleteHtmlStart = findIncompleteBlockStart(\"<html\", \"</html>\", [\n \"<htm\",\n \"<ht\",\n ]);\n const incompleteSvgStart = findIncompleteBlockStart(\"<svg\", \"</svg>\", [\n \"<sv\",\n \"<s\",\n ]);\n\n const nextIncompleteStart = Math.max(incompleteHtmlStart, incompleteSvgStart);\n\n if (nextIncompleteStart !== -1) {\n if (nextIncompleteStart > lastIndex) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex, nextIncompleteStart),\n });\n }\n\n if (nextIncompleteStart === incompleteHtmlStart) {\n segments.push({\n type: \"html\",\n value: markdown.slice(nextIncompleteStart),\n complete: false,\n });\n } else {\n segments.push({\n type: \"svg\",\n value: markdown.slice(nextIncompleteStart),\n complete: false,\n });\n }\n return segments;\n }\n\n // Check whether there is an unfinished mermaid block\n // Only if we are NOT inside a generic incomplete code block that started earlier\n // Actually, standard mermaid block starts with ```mermaid, so it IS a code block start.\n // We just need to check if it's specifically mermaid.\n const incompleteStart = markdown.lastIndexOf(\"```mermaid\");\n if (\n incompleteStart !== -1 &&\n incompleteStart >= lastIndex &&\n // Ensure this mermaid block isn't inside another code block (unlikely but safe to check)\n // Actually, incompleteCodeBlockStart would capture this \"```mermaid\" as just \"```\"\n // so we need to be careful.\n // If incompleteCodeBlockStart points to THIS mermaid block, we process it as mermaid.\n incompleteStart === incompleteCodeBlockStart\n ) {\n const code = markdown.slice(incompleteStart + 10);\n segments.push({\n type: \"mermaid\",\n value: code.trim(),\n complete: false,\n });\n\n if (incompleteStart > lastIndex) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex, incompleteStart),\n });\n }\n\n return segments;\n }\n\n // Remaining text\n if (lastIndex < markdown.length) {\n segments.push({\n type: \"text\",\n value: markdown.slice(lastIndex),\n });\n }\n\n return segments;\n}\n\nexport function parseMermaidBlocks(fullMarkdown: string) {\n const blocks = [];\n const lines: string[] = fullMarkdown.split(/\\r?\\n/);\n\n let inside = false;\n let current: string[] = [];\n let startLine = 0;\n\n lines.forEach((line, index) => {\n if (!inside) {\n if (line.trim().startsWith(\"```mermaid\")) {\n inside = true;\n startLine = index;\n current = [];\n }\n return;\n }\n\n // inside mermaid mode\n if (line.trim() === \"```\") {\n // block complete\n blocks.push({\n code: current.join(\"\\n\").trim(),\n startLine,\n endLine: index,\n complete: true,\n });\n inside = false;\n return;\n }\n\n current.push(line);\n });\n\n // if still inside → incomplete block\n if (inside) {\n blocks.push({\n code: current.join(\"\\n\").trim(),\n startLine,\n endLine: null,\n complete: false,\n });\n }\n\n return blocks;\n}\n\n/**\n * Determine whether the mermaid block for the given codeString is fully closed.\n * @param fullMarkdown Full markdown text (grows over time in streaming scenarios)\n * @param codeString Mermaid block code passed to the renderer (children)\n */\nexport function mermaidBlockIsComplete(\n fullMarkdown: string,\n codeString: string\n) {\n const cleaned = codeString.trim();\n const blocks = parseMermaidBlocks(fullMarkdown);\n // Locate the block that matches the current codeString\n const block = blocks.find((b) => b.code === cleaned);\n\n if (!block) return false;\n\n // Block is complete when the closing fence already exists\n return block.complete;\n}\n"],"names":["parseMarkdownSegments","markdown","segments","isInsideCodeFence","position","fenceRegex","matchFence","inside","regex","lastIndex","match","start","end","rawMatch","code","incompleteCodeBlockStart","lowerMarkdown","findIncompleteBlockStart","openTag","closeTag","partialEndings","openIndex","closeIndex","partial","ending","incompleteHtmlStart","incompleteSvgStart","nextIncompleteStart","incompleteStart","parseMermaidBlocks","fullMarkdown","blocks","lines","current","startLine","line","index","mermaidBlockIsComplete","codeString","cleaned","block","b"],"mappings":"AAAO,SAASA,EAAsBC,GAAkB;AACtD,QAAMC,IAKF,CAAA,GAEEC,IAAoB,CAACC,MAAqB;AAC9C,UAAMC,IAAa;AACnB,QAAIC,GACAC,IAAS;AACb,YACGD,IAAaD,EAAW,KAAKJ,CAAQ,OAAO,QAC7CK,EAAW,QAAQF;AAEnB,MAAAG,IAAS,CAACA;AAEZ,WAAOA;AAAA,EACT,GAMMC,IACJ;AAEF,MAAIC,IAAY,GACZC;AAEJ,UAAQA,I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AAEnD,SAAKC,IAGEA,EAAM,WAHM;AAIrB;"}
|
|
@@ -11,6 +11,12 @@ export interface MarkdownFlowProps {
|
|
|
11
11
|
customRenderBar?: CustomRenderBarProps;
|
|
12
12
|
onClickCustomButtonAfterContent?: () => void;
|
|
13
13
|
dynamicInteractionFormat?: string;
|
|
14
|
+
fullscreenButtonText?: string;
|
|
15
|
+
contentHtmlPayload?: string;
|
|
16
|
+
contentType?: "default" | "blackboard";
|
|
17
|
+
renderNarrationAsCaption?: boolean;
|
|
18
|
+
maxVisibleStepNumber?: number;
|
|
19
|
+
visibleStepNumber?: number;
|
|
14
20
|
}[];
|
|
15
21
|
customRenderBar?: CustomRenderBarProps;
|
|
16
22
|
onSend?: (content: OnSendContentParams) => void;
|
|
@@ -21,6 +27,7 @@ export interface MarkdownFlowProps {
|
|
|
21
27
|
copyButtonText?: string;
|
|
22
28
|
copiedButtonText?: string;
|
|
23
29
|
beforeSend?: (content: OnSendContentParams) => boolean;
|
|
30
|
+
fullscreenButtonText?: string;
|
|
24
31
|
}
|
|
25
32
|
declare const MarkdownFlow: React.FC<MarkdownFlowProps>;
|
|
26
33
|
export default MarkdownFlow;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as a } from "../../_virtual/jsx-runtime.js";
|
|
2
2
|
import B from "../ContentRender/ContentRender.js";
|
|
3
3
|
import "../ui/inputGroup/input-group.js";
|
|
4
4
|
import "react";
|
|
5
5
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
initialContentList:
|
|
8
|
-
customRenderBar:
|
|
9
|
-
onSend:
|
|
10
|
-
typingSpeed:
|
|
11
|
-
enableTypewriter:
|
|
12
|
-
onBlockComplete:
|
|
13
|
-
confirmButtonText:
|
|
6
|
+
const v = ({
|
|
7
|
+
initialContentList: i = [],
|
|
8
|
+
customRenderBar: l,
|
|
9
|
+
onSend: s,
|
|
10
|
+
typingSpeed: d,
|
|
11
|
+
enableTypewriter: o = !1,
|
|
12
|
+
onBlockComplete: u,
|
|
13
|
+
confirmButtonText: n,
|
|
14
14
|
copyButtonText: m,
|
|
15
15
|
copiedButtonText: p,
|
|
16
|
-
beforeSend: c
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
beforeSend: c,
|
|
17
|
+
fullscreenButtonText: y
|
|
18
|
+
}) => /* @__PURE__ */ a.jsx("div", { className: "markdown-flow", children: i.map((e, r) => {
|
|
19
|
+
const t = e.isFinished ?? !1, b = !t && o, x = t ? void 0 : s, S = t ? void 0 : d, T = c ?? (() => !0);
|
|
20
|
+
return /* @__PURE__ */ a.jsx(
|
|
20
21
|
B,
|
|
21
22
|
{
|
|
22
23
|
content: e.content,
|
|
@@ -24,24 +25,30 @@ const b = ({
|
|
|
24
25
|
defaultButtonText: e.defaultButtonText,
|
|
25
26
|
defaultSelectedValues: e.defaultSelectedValues,
|
|
26
27
|
readonly: e.readonly,
|
|
27
|
-
enableTypewriter:
|
|
28
|
-
customRenderBar: e.customRenderBar ||
|
|
29
|
-
onSend:
|
|
30
|
-
beforeSend:
|
|
28
|
+
enableTypewriter: b,
|
|
29
|
+
customRenderBar: e.customRenderBar || l,
|
|
30
|
+
onSend: x,
|
|
31
|
+
beforeSend: T,
|
|
31
32
|
onClickCustomButtonAfterContent: e.onClickCustomButtonAfterContent,
|
|
32
|
-
typingSpeed:
|
|
33
|
-
confirmButtonText:
|
|
33
|
+
typingSpeed: S,
|
|
34
|
+
confirmButtonText: n,
|
|
34
35
|
copyButtonText: m,
|
|
35
36
|
copiedButtonText: p,
|
|
36
37
|
dynamicInteractionFormat: e.dynamicInteractionFormat,
|
|
38
|
+
fullscreenButtonText: e.fullscreenButtonText || y,
|
|
39
|
+
contentHtmlPayload: e.contentHtmlPayload,
|
|
40
|
+
contentType: e.contentType,
|
|
41
|
+
renderNarrationAsCaption: e.renderNarrationAsCaption,
|
|
42
|
+
maxVisibleStepNumber: e.maxVisibleStepNumber,
|
|
43
|
+
visibleStepNumber: e.visibleStepNumber,
|
|
37
44
|
onTypeFinished: () => {
|
|
38
|
-
|
|
45
|
+
u?.(r);
|
|
39
46
|
}
|
|
40
47
|
},
|
|
41
48
|
r
|
|
42
49
|
);
|
|
43
50
|
}) });
|
|
44
51
|
export {
|
|
45
|
-
|
|
52
|
+
v as default
|
|
46
53
|
};
|
|
47
54
|
//# sourceMappingURL=MarkdownFlow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownFlow.js","sources":["../../../src/components/MarkdownFlow/MarkdownFlow.tsx"],"sourcesContent":["import React from \"react\";\nimport ContentRender from \"../ContentRender\";\nimport { CustomRenderBarProps, OnSendContentParams } from \"../types\";\nimport \"./markdownFlow.css\";\n\nexport interface MarkdownFlowProps {\n initialContentList?: {\n content: string;\n isFinished?: boolean;\n defaultInputText?: string;\n defaultButtonText?: string;\n defaultSelectedValues?: string[];\n readonly?: boolean;\n customRenderBar?: CustomRenderBarProps;\n onClickCustomButtonAfterContent?: () => void;\n dynamicInteractionFormat?: string;\n }[];\n customRenderBar?: CustomRenderBarProps;\n onSend?: (content: OnSendContentParams) => void;\n typingSpeed?: number;\n enableTypewriter?: boolean;\n onBlockComplete?: (blockIndex: number) => void;\n // Multi-select confirm button text (i18n support)\n confirmButtonText?: string;\n // Copy button text for code blocks\n copyButtonText?: string;\n // Copied state text for code blocks\n copiedButtonText?: string;\n beforeSend?: (content: OnSendContentParams) => boolean;\n}\n\nconst MarkdownFlow: React.FC<MarkdownFlowProps> = ({\n initialContentList = [],\n customRenderBar,\n onSend: onSendProp,\n typingSpeed: typingSpeedProp,\n enableTypewriter = false,\n onBlockComplete,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n beforeSend: beforeSendProp,\n}) => {\n return (\n <div className=\"markdown-flow\">\n {initialContentList.map((contentInfo, index) => {\n const isFinished = contentInfo.isFinished ?? false;\n const enableTypewriterForBlock = !isFinished && enableTypewriter;\n const onSend = isFinished ? undefined : onSendProp;\n const typingSpeed = isFinished ? undefined : typingSpeedProp;\n const beforeSend = beforeSendProp ?? (() => true);\n return (\n <ContentRender\n key={index}\n content={contentInfo.content}\n defaultInputText={contentInfo.defaultInputText}\n defaultButtonText={contentInfo.defaultButtonText}\n defaultSelectedValues={contentInfo.defaultSelectedValues}\n readonly={contentInfo.readonly}\n enableTypewriter={enableTypewriterForBlock}\n customRenderBar={contentInfo.customRenderBar || customRenderBar}\n onSend={onSend}\n beforeSend={beforeSend}\n onClickCustomButtonAfterContent={\n contentInfo.onClickCustomButtonAfterContent\n }\n typingSpeed={typingSpeed}\n confirmButtonText={confirmButtonText}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n dynamicInteractionFormat={contentInfo.dynamicInteractionFormat}\n onTypeFinished={() => {\n onBlockComplete?.(index);\n }}\n />\n );\n })}\n </div>\n );\n};\n\nexport default MarkdownFlow;\n"],"names":["MarkdownFlow","initialContentList","customRenderBar","onSendProp","typingSpeedProp","enableTypewriter","onBlockComplete","confirmButtonText","copyButtonText","copiedButtonText","beforeSendProp","jsx","contentInfo","index","isFinished","enableTypewriterForBlock","onSend","typingSpeed","beforeSend","ContentRender"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"MarkdownFlow.js","sources":["../../../src/components/MarkdownFlow/MarkdownFlow.tsx"],"sourcesContent":["import React from \"react\";\nimport ContentRender from \"../ContentRender\";\nimport { CustomRenderBarProps, OnSendContentParams } from \"../types\";\nimport \"./markdownFlow.css\";\n\nexport interface MarkdownFlowProps {\n initialContentList?: {\n content: string;\n isFinished?: boolean;\n defaultInputText?: string;\n defaultButtonText?: string;\n defaultSelectedValues?: string[];\n readonly?: boolean;\n customRenderBar?: CustomRenderBarProps;\n onClickCustomButtonAfterContent?: () => void;\n dynamicInteractionFormat?: string;\n fullscreenButtonText?: string;\n contentHtmlPayload?: string;\n contentType?: \"default\" | \"blackboard\";\n renderNarrationAsCaption?: boolean;\n maxVisibleStepNumber?: number;\n visibleStepNumber?: number;\n }[];\n customRenderBar?: CustomRenderBarProps;\n onSend?: (content: OnSendContentParams) => void;\n typingSpeed?: number;\n enableTypewriter?: boolean;\n onBlockComplete?: (blockIndex: number) => void;\n // Multi-select confirm button text (i18n support)\n confirmButtonText?: string;\n // Copy button text for code blocks\n copyButtonText?: string;\n // Copied state text for code blocks\n copiedButtonText?: string;\n beforeSend?: (content: OnSendContentParams) => boolean;\n // Fullscreen button text for iframe rendering\n fullscreenButtonText?: string;\n}\n\nconst MarkdownFlow: React.FC<MarkdownFlowProps> = ({\n initialContentList = [],\n customRenderBar,\n onSend: onSendProp,\n typingSpeed: typingSpeedProp,\n enableTypewriter = false,\n onBlockComplete,\n confirmButtonText,\n copyButtonText,\n copiedButtonText,\n beforeSend: beforeSendProp,\n fullscreenButtonText,\n}) => {\n return (\n <div className=\"markdown-flow\">\n {initialContentList.map((contentInfo, index) => {\n const isFinished = contentInfo.isFinished ?? false;\n const enableTypewriterForBlock = !isFinished && enableTypewriter;\n const onSend = isFinished ? undefined : onSendProp;\n const typingSpeed = isFinished ? undefined : typingSpeedProp;\n const beforeSend = beforeSendProp ?? (() => true);\n return (\n <ContentRender\n key={index}\n content={contentInfo.content}\n defaultInputText={contentInfo.defaultInputText}\n defaultButtonText={contentInfo.defaultButtonText}\n defaultSelectedValues={contentInfo.defaultSelectedValues}\n readonly={contentInfo.readonly}\n enableTypewriter={enableTypewriterForBlock}\n customRenderBar={contentInfo.customRenderBar || customRenderBar}\n onSend={onSend}\n beforeSend={beforeSend}\n onClickCustomButtonAfterContent={\n contentInfo.onClickCustomButtonAfterContent\n }\n typingSpeed={typingSpeed}\n confirmButtonText={confirmButtonText}\n copyButtonText={copyButtonText}\n copiedButtonText={copiedButtonText}\n dynamicInteractionFormat={contentInfo.dynamicInteractionFormat}\n fullscreenButtonText={\n contentInfo.fullscreenButtonText || fullscreenButtonText\n }\n contentHtmlPayload={contentInfo.contentHtmlPayload}\n contentType={contentInfo.contentType}\n renderNarrationAsCaption={contentInfo.renderNarrationAsCaption}\n maxVisibleStepNumber={contentInfo.maxVisibleStepNumber}\n visibleStepNumber={contentInfo.visibleStepNumber}\n onTypeFinished={() => {\n onBlockComplete?.(index);\n }}\n />\n );\n })}\n </div>\n );\n};\n\nexport default MarkdownFlow;\n"],"names":["MarkdownFlow","initialContentList","customRenderBar","onSendProp","typingSpeedProp","enableTypewriter","onBlockComplete","confirmButtonText","copyButtonText","copiedButtonText","beforeSendProp","fullscreenButtonText","jsx","contentInfo","index","isFinished","enableTypewriterForBlock","onSend","typingSpeed","beforeSend","ContentRender"],"mappings":";;;;;AAuCA,MAAMA,IAA4C,CAAC;AAAA,EACjD,oBAAAC,IAAqB,CAAA;AAAA,EACrB,iBAAAC;AAAA,EACA,QAAQC;AAAA,EACR,aAAaC;AAAA,EACb,kBAAAC,IAAmB;AAAA,EACnB,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,YAAYC;AAAA,EACZ,sBAAAC;AACF,MAEIC,gBAAAA,MAAC,SAAI,WAAU,iBACZ,YAAmB,IAAI,CAACC,GAAaC,MAAU;AAC9C,QAAMC,IAAaF,EAAY,cAAc,IACvCG,IAA2B,CAACD,KAAcV,GAC1CY,IAASF,IAAa,SAAYZ,GAClCe,IAAcH,IAAa,SAAYX,GACvCe,IAAaT,MAAmB,MAAM;AAC5C,SACEE,gBAAAA,EAAAA;AAAAA,IAACQ;AAAA,IAAA;AAAA,MAEC,SAASP,EAAY;AAAA,MACrB,kBAAkBA,EAAY;AAAA,MAC9B,mBAAmBA,EAAY;AAAA,MAC/B,uBAAuBA,EAAY;AAAA,MACnC,UAAUA,EAAY;AAAA,MACtB,kBAAkBG;AAAA,MAClB,iBAAiBH,EAAY,mBAAmBX;AAAA,MAChD,QAAAe;AAAA,MACA,YAAAE;AAAA,MACA,iCACEN,EAAY;AAAA,MAEd,aAAAK;AAAA,MACA,mBAAAX;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA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