markdown-flow-ui 0.3.5 → 0.3.7
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/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index8.es.js +2 -2
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/index9.es.js +2 -2
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +2 -0
- package/dist/components/ContentRender/ContentRender.es.js +513 -509
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.d.ts +2 -0
- package/dist/components/ContentRender/MarkdownFlowInput.es.js +40 -38
- package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.d.ts +2 -1
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +110 -90
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/components/ContentRender/utils/accept-placeholder.cjs +2 -0
- package/dist/components/ContentRender/utils/accept-placeholder.cjs.map +1 -0
- package/dist/components/ContentRender/utils/accept-placeholder.d.ts +3 -0
- package/dist/components/ContentRender/utils/accept-placeholder.es.js +10 -0
- package/dist/components/ContentRender/utils/accept-placeholder.es.js.map +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +2 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +23 -21
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +145 -143
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.d.ts +2 -0
- package/dist/components/Slide/Slide.es.js +348 -344
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/markdown-flow-ui.css +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +92 -89
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-popper → react-popper}/dist/index.es.js +5 -5
- package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +50 -47
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +9 -9
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +10 -7
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs.map +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.es.js +809 -900
- package/dist/node_modules/i18next/dist/esm/i18next.es.js.map +1 -1
- package/dist/node_modules/katex/dist/katex.cjs +14 -14
- package/dist/node_modules/katex/dist/katex.cjs.map +1 -1
- package/dist/node_modules/katex/dist/katex.es.js +1302 -1192
- package/dist/node_modules/katex/dist/katex.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js +52 -29
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/context.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/context.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/context.es.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/context.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js +13 -16
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +16 -10
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js +13 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js +8 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js +10 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js +12 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js +14 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js +11 -5
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +13 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js +22 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js +20 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +17 -11
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js +14 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js +11 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js +15 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js +25 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js +16 -10
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +19 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +19 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js +14 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js +19 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js +15 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js +13 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +19 -13
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js +13 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js +44 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/{defaultAttributes.es.js → shared/src/build/defaultAttributes.es.js} +4 -4
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js +5 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js +5 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js.map +1 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs +3 -3
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/create-tokenizer.es.js +78 -76
- package/dist/node_modules/micromark/lib/create-tokenizer.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.cjs +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.es.js +77 -75
- package/dist/node_modules/micromark/lib/initialize/document.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.cjs +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.es.js +67 -64
- package/dist/node_modules/micromark/lib/initialize/text.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/preprocess.cjs +1 -1
- package/dist/node_modules/micromark/lib/preprocess.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/preprocess.es.js +19 -14
- package/dist/node_modules/micromark/lib/preprocess.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js +36 -32
- package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js +49 -61
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js +21 -27
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js +18 -14
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js +59 -71
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js +87 -85
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js +11 -10
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js +12 -11
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js +18 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js +35 -33
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js +32 -28
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js +18 -14
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js.map +1 -1
- package/dist/node_modules/micromark-factory-space/index.cjs +1 -1
- package/dist/node_modules/micromark-factory-space/index.cjs.map +1 -1
- package/dist/node_modules/micromark-factory-space/index.es.js +24 -10
- package/dist/node_modules/micromark-factory-space/index.es.js.map +1 -1
- package/dist/node_modules/micromark-util-edit-map/index.cjs +2 -0
- package/dist/node_modules/micromark-util-edit-map/index.cjs.map +1 -0
- package/dist/node_modules/micromark-util-edit-map/index.es.js +83 -0
- package/dist/node_modules/micromark-util-edit-map/index.es.js.map +1 -0
- package/package.json +24 -17
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js +0 -50
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js +0 -82
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +0 -216
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +0 -105
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js +0 -18
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +0 -16
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +0 -70
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js +0 -19
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js.map +0 -1
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.cjs +0 -0
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.es.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.es.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/syntax.js"],"sourcesContent":["/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const type = self.events[index][1].type;\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") index--;else break;\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we’ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * @param {Readonly<TokenizeContext>} context\n * @param {Readonly<Range>} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly<EditMap>} map\n * @param {Readonly<TokenizeContext>} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array<Event>} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * @param {Readonly<Array<Event>>} events\n * @param {number} index\n * @returns {Readonly<Point>}\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}"],"names":["gfmTable","tokenizeTable","resolveTable","effects","ok","nok","self","size","sizeB","seen","start","code","index","type","tail","next","bodyRowStart","headRowBefore","headRowStart","headRowBreak","markdownLineEnding","headDelimiterStart","markdownSpace","factorySpace","headRowData","markdownLineEndingOrSpace","headRowEscape","headDelimiterBefore","headDelimiterValueBefore","headDelimiterCellBefore","headDelimiterNok","headDelimiterLeftAlignmentAfter","headDelimiterCellAfter","headDelimiterFiller","headDelimiterRightAlignmentAfter","bodyRowBreak","bodyRowData","bodyRowEscape","events","context","inFirstCellAwaitingPipe","rowKind","lastCell","cell","afterHeadAwaitingFirstBodyRow","lastTableEnd","currentTable","currentBody","currentCell","map","EditMap","event","token","flushTableEnd","flushCell","gfmTableAlign","range","rowEnd","previousCell","groupName","valueName","getPoint","now","relatedStart","relatedEnd","valueToken","end","a","b","table","tableBody","exits","related","side"],"mappings":";;;;AAwBO,SAASA,IAAW;AACzB,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,UAAUC;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AA,MAClB;AAAA,IACF;AACA,IAAAnB,EAAI,IAAIO,EAAM,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQS,GAAY1B,CAAO,CAAC,CAAC;AAAA,EAC1D;AASA,SAAIkB,MAAW,WACbC,EAAa,MAAM,OAAO,OAAO,CAAA,GAAIG,EAAStB,EAAQ,QAAQkB,CAAM,CAAC,GACrER,EAAI,IAAIQ,GAAQ,GAAG,CAAC,CAAC,QAAQC,GAAcnB,CAAO,CAAC,CAAC,GACpDmB,IAAe,SAEVA;AACT;AAYA,SAASL,EAAcJ,GAAKV,GAAS3B,GAAOyD,GAAOC,GAAW;AAE5D,QAAMC,IAAQ,CAAA,GACRC,IAAUX,EAAStB,EAAQ,QAAQ3B,CAAK;AAC9C,EAAI0D,MACFA,EAAU,MAAM,OAAO,OAAO,CAAA,GAAIE,CAAO,GACzCD,EAAM,KAAK,CAAC,QAAQD,GAAW/B,CAAO,CAAC,IAEzC8B,EAAM,MAAM,OAAO,OAAO,CAAA,GAAIG,CAAO,GACrCD,EAAM,KAAK,CAAC,QAAQF,GAAO9B,CAAO,CAAC,GACnCU,EAAI,IAAIrC,IAAQ,GAAG,GAAG2D,CAAK;AAC7B;AAOA,SAASV,EAASvB,GAAQ1B,GAAO;AAC/B,QAAMuC,IAAQb,EAAO1B,CAAK,GACpB6D,IAAOtB,EAAM,CAAC,MAAM,UAAU,UAAU;AAC9C,SAAOA,EAAM,CAAC,EAAEsB,CAAI;AACtB;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"syntax.es.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/syntax.js"],"sourcesContent":["/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * Tokenizer for GFM tables.\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const {\n type\n } = self.events[index][1];\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") {\n index--;\n } else {\n break;\n }\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we’ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * Edit map to apply to.\n * @param {Readonly<TokenizeContext>} context\n * Tokenize context.\n * @param {Readonly<Range>} range\n * Range of the cell within events.\n * @param {RowKind} rowKind\n * Type of row.\n * @param {number | undefined} rowEnd\n * Index of the end of the row, if known.\n * @param {Token | undefined} previousCell\n * Previous cell token, if any.\n * @returns {Token | undefined}\n * Current cell token after flushing, if any.\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly<EditMap>} map\n * Edit map to apply to.\n * @param {Readonly<TokenizeContext>} context\n * Tokenize context.\n * @param {number} index\n * Index within the events where the table end should be inserted.\n * @param {Token} table\n * Table token.\n * @param {Token | undefined} tableBody\n * Table body token, if any.\n * @returns {undefined}\n * Nothing.\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array<Event>} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * Get the point (start or end) for a given event in the list of events.\n *\n * @param {Readonly<Array<Event>>} events\n * List of events.\n * @param {number} index\n * Index of the event to get the point for.\n * @returns {Readonly<Point>}\n * Start point for enter and end point for exit.\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}"],"names":["gfmTable","tokenizeTable","resolveTable","effects","ok","nok","self","size","sizeB","seen","start","code","index","type","tail","next","bodyRowStart","headRowBefore","headRowStart","headRowBreak","markdownLineEnding","headDelimiterStart","markdownSpace","factorySpace","headRowData","markdownLineEndingOrSpace","headRowEscape","headDelimiterBefore","headDelimiterValueBefore","headDelimiterCellBefore","headDelimiterNok","headDelimiterLeftAlignmentAfter","headDelimiterCellAfter","headDelimiterFiller","headDelimiterRightAlignmentAfter","bodyRowBreak","bodyRowData","bodyRowEscape","events","context","inFirstCellAwaitingPipe","rowKind","lastCell","cell","afterHeadAwaitingFirstBodyRow","lastTableEnd","currentTable","currentBody","currentCell","map","EditMap","event","token","flushTableEnd","flushCell","gfmTableAlign","range","rowEnd","previousCell","groupName","valueName","getPoint","now","relatedStart","relatedEnd","valueToken","end","a","b","table","tableBody","exits","related","side"],"mappings":";;;;AAwBO,SAASA,IAAW;AACzB,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,UAAUC;AAAA,QACV,YAAYC;AAAA,MACpB;AAAA,IACA;AAAA,EACA;AACA;AAQA,SAASD,EAAcE,GAASC,GAAIC,GAAK;AACvC,QAAMC,IAAO;AACb,MAAIC,IAAO,GACPC,IAAQ,GAERC;AACJ,SAAOC;AAkBP,WAASA,EAAMC,GAAM;AACnB,QAAIC,IAAQN,EAAK,OAAO,SAAS;AACjC,WAAOM,IAAQ,MAAI;AACjB,YAAM;AAAA,QACJ,MAAAC;AAAA,MACR,IAAUP,EAAK,OAAOM,CAAK,EAAE,CAAC;AACxB,UAAIC,MAAS;AAAA,MAEbA,MAAS;AACP,QAAAD;AAAA;AAEA;AAAA,IAEJ;AACA,UAAME,IAAOF,IAAQ,KAAKN,EAAK,OAAOM,CAAK,EAAE,CAAC,EAAE,OAAO,MACjDG,IAAOD,MAAS,eAAeA,MAAS,aAAaE,IAAeC;AAG1E,WAAIF,MAASC,KAAgBV,EAAK,OAAO,KAAKA,EAAK,MAAM,IAAI,IACpDD,EAAIM,CAAI,IAEVI,EAAKJ,CAAI;AAAA,EAClB;AAcA,WAASM,EAAcN,GAAM;AAC3B,WAAAR,EAAQ,MAAM,WAAW,GACzBA,EAAQ,MAAM,UAAU,GACjBe,EAAaP,CAAI;AAAA,EAC1B;AAcA,WAASO,EAAaP,GAAM;AAC1B,WAAIA,MAAS,QAcbF,IAAO,IAEPD,KAAS,IACFW,EAAaR,CAA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AM,CAAC,MAAM,UAAU,UAAU;AAC9C,SAAOA,EAAM,CAAC,EAAEsB,CAAI;AACtB;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../micromark-util-character/index.cjs");function m(t,u,a,i){const f=i?i-1:1/0;let S=0;return e;function e(r){return c.markdownSpace(r)?(t.enter(a),o(r)):u(r)}function o(r){return c.markdownSpace(r)&&S++<f?(t.consume(r),o):(t.exit(a),u(r))}}function l(t,u,a,i,f,S){let e=0;return o;function o(n){return c.markdownSpace(n)?(t.enter(i),r(n)):p(n)}function r(n){return c.markdownSpace(n)&&e<S?(t.consume(n),e++,r):(t.exit(i),p(n))}function p(n){return e>=f?u(n):a(n)}}exports.factorySpace=m;exports.factorySpaceMinMax=l;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../node_modules/micromark-factory-space/index.js"],"sourcesContent":["/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}"],"names":["factorySpace","effects","ok","type","max","limit","size","start","code","markdownSpace","prefix"],"mappings":"yIAwCO,SAASA,EAAaC,EAASC,EAAIC,EAAMC,EAAK,CACnD,MAAMC,EAAQD,EAAMA,EAAM,EAAI,IAC9B,IAAIE,EAAO,EACX,OAAOC,EAGP,SAASA,EAAMC,EAAM,CACnB,OAAIC,EAAAA,cAAcD,CAAI,GACpBP,EAAQ,MAAME,CAAI,EACXO,EAAOF,CAAI,GAEbN,EAAGM,CAAI,CAChB,CAGA,SAASE,EAAOF,EAAM,CACpB,OAAIC,EAAAA,cAAcD,CAAI,GAAKF,IAASD,GAClCJ,EAAQ,QAAQO,CAAI,EACbE,IAETT,EAAQ,KAAKE,CAAI,EACVD,EAAGM,CAAI,EAChB,CACF","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../node_modules/micromark-factory-space/index.js"],"sourcesContent":["/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}"],"names":["factorySpace","effects","ok","type","max","limit","size","start","code","markdownSpace","prefix","factorySpaceMinMax","nok","min","after"],"mappings":"yIAwCO,SAASA,EAAaC,EAASC,EAAIC,EAAMC,EAAK,CACnD,MAAMC,EAAQD,EAAMA,EAAM,EAAI,IAC9B,IAAIE,EAAO,EACX,OAAOC,EAGP,SAASA,EAAMC,EAAM,CACnB,OAAIC,EAAAA,cAAcD,CAAI,GACpBP,EAAQ,MAAME,CAAI,EACXO,EAAOF,CAAI,GAEbN,EAAGM,CAAI,CAChB,CAGA,SAASE,EAAOF,EAAM,CACpB,OAAIC,EAAAA,cAAcD,CAAI,GAAKF,IAASD,GAClCJ,EAAQ,QAAQO,CAAI,EACbE,IAETT,EAAQ,KAAKE,CAAI,EACVD,EAAGM,CAAI,EAChB,CACF,CAwBO,SAASG,EAAmBV,EAASC,EAAIU,EAAKT,EAAMU,EAAKT,EAAK,CACnE,IAAIE,EAAO,EACX,OAAOC,EAGP,SAASA,EAAMC,EAAM,CACnB,OAAeC,EAAAA,cAAcD,CAAI,GAC/BP,EAAQ,MAAME,CAAI,EACXO,EAAOF,CAAI,GAEbM,EAAMN,CAAI,CACnB,CAGA,SAASE,EAAOF,EAAM,CACpB,OAAIC,gBAAcD,CAAI,GAAKF,EAAOF,GAChCH,EAAQ,QAAQO,CAAI,EACpBF,IACOI,IAETT,EAAQ,KAAKE,CAAI,EACVW,EAAMN,CAAI,EACnB,CAGA,SAASM,EAAMN,EAAM,CACnB,OAAOF,GAAQO,EAAMX,EAAGM,CAAI,EAAII,EAAIJ,CAAI,CAC1C,CACF","x_google_ignoreList":[0]}
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
import { markdownSpace as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
return
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
import { markdownSpace as o } from "../micromark-util-character/index.es.js";
|
|
2
|
+
function s(t, e, f, i) {
|
|
3
|
+
const m = i ? i - 1 : 1 / 0;
|
|
4
|
+
let p = 0;
|
|
5
|
+
return u;
|
|
6
|
+
function u(r) {
|
|
7
|
+
return o(r) ? (t.enter(f), a(r)) : e(r);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function a(r) {
|
|
10
|
+
return o(r) && p++ < m ? (t.consume(r), a) : (t.exit(f), e(r));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function S(t, e, f, i, m, p) {
|
|
14
|
+
let u = 0;
|
|
15
|
+
return a;
|
|
16
|
+
function a(n) {
|
|
17
|
+
return o(n) ? (t.enter(i), r(n)) : x(n);
|
|
18
|
+
}
|
|
19
|
+
function r(n) {
|
|
20
|
+
return o(n) && u < p ? (t.consume(n), u++, r) : (t.exit(i), x(n));
|
|
21
|
+
}
|
|
22
|
+
function x(n) {
|
|
23
|
+
return u >= m ? e(n) : f(n);
|
|
11
24
|
}
|
|
12
25
|
}
|
|
13
26
|
export {
|
|
14
|
-
|
|
27
|
+
s as factorySpace,
|
|
28
|
+
S as factorySpaceMinMax
|
|
15
29
|
};
|
|
16
30
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../node_modules/micromark-factory-space/index.js"],"sourcesContent":["/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}"],"names":["factorySpace","effects","ok","type","max","limit","size","start","code","markdownSpace","prefix"],"mappings":";AAwCO,SAASA,EAAaC,GAASC,GAAIC,GAAMC,GAAK;AACnD,QAAMC,IAAQD,IAAMA,IAAM,IAAI;AAC9B,MAAIE,IAAO;AACX,SAAOC;AAGP,WAASA,EAAMC,GAAM;AACnB,WAAIC,EAAcD,CAAI,KACpBP,EAAQ,MAAME,CAAI,GACXO,EAAOF,CAAI,KAEbN,EAAGM,CAAI;AAAA,EAChB;AAGA,WAASE,EAAOF,GAAM;AACpB,WAAIC,EAAcD,CAAI,KAAKF,MAASD,KAClCJ,EAAQ,QAAQO,CAAI,GACbE,MAETT,EAAQ,KAAKE,CAAI,GACVD,EAAGM,CAAI;AAAA,EAChB;AACF;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../node_modules/micromark-factory-space/index.js"],"sourcesContent":["/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTabWithOptions` (`connect`, `content`).\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Infinity;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}\n\n/**\n * Parse spaces and tabs, with a required minimum and maximum, matching\n * `markdown-rs`’s `space_or_tab_min_max`.\n *\n * Unlike `factorySpace`, this can fail: `nok` is used when fewer than\n * `min` spaces or tabs are found.\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole whitespace.\n * @param {number} min\n * Minimum allowed characters (inclusive).\n * @param {number} max\n * Maximum allowed characters (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpaceMinMax(effects, ok, nok, type, min, max) {\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (max > 0 && markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return after(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size < max) {\n effects.consume(code);\n size++;\n return prefix;\n }\n effects.exit(type);\n return after(code);\n }\n\n /** @type {State} */\n function after(code) {\n return size >= min ? ok(code) : nok(code);\n }\n}"],"names":["factorySpace","effects","ok","type","max","limit","size","start","code","markdownSpace","prefix","factorySpaceMinMax","nok","min","after"],"mappings":";AAwCO,SAASA,EAAaC,GAASC,GAAIC,GAAMC,GAAK;AACnD,QAAMC,IAAQD,IAAMA,IAAM,IAAI;AAC9B,MAAIE,IAAO;AACX,SAAOC;AAGP,WAASA,EAAMC,GAAM;AACnB,WAAIC,EAAcD,CAAI,KACpBP,EAAQ,MAAME,CAAI,GACXO,EAAOF,CAAI,KAEbN,EAAGM,CAAI;AAAA,EAChB;AAGA,WAASE,EAAOF,GAAM;AACpB,WAAIC,EAAcD,CAAI,KAAKF,MAASD,KAClCJ,EAAQ,QAAQO,CAAI,GACbE,MAETT,EAAQ,KAAKE,CAAI,GACVD,EAAGM,CAAI;AAAA,EAChB;AACF;AAwBO,SAASG,EAAmBV,GAASC,GAAIU,GAAKT,GAAMU,GAAKT,GAAK;AACnE,MAAIE,IAAO;AACX,SAAOC;AAGP,WAASA,EAAMC,GAAM;AACnB,WAAeC,EAAcD,CAAI,KAC/BP,EAAQ,MAAME,CAAI,GACXO,EAAOF,CAAI,KAEbM,EAAMN,CAAI;AAAA,EACnB;AAGA,WAASE,EAAOF,GAAM;AACpB,WAAIC,EAAcD,CAAI,KAAKF,IAAOF,KAChCH,EAAQ,QAAQO,CAAI,GACpBF,KACOI,MAETT,EAAQ,KAAKE,CAAI,GACVW,EAAMN,CAAI;AAAA,EACnB;AAGA,WAASM,EAAMN,GAAM;AACnB,WAAOF,KAAQO,IAAMX,EAAGM,CAAI,IAAII,EAAIJ,CAAI;AAAA,EAC1C;AACF;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class c{constructor(){this.index=new Map,this.map=[]}add(e,t,i){l(this,e,t,i,!1)}addBefore(e,t,i){l(this,e,t,i,!0)}consume(e){if(this.map.sort(function(s,p){return s[0]-p[0]}),this.map.length===0)return;let t=this.map.length;const i=[];for(;t>0;)t-=1,i.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];i.push(e.slice()),e.length=0;let n=i.pop();for(;n;){for(const s of n)e.push(s);n=i.pop()}this.map.length=0,this.index.clear()}}function l(h,e,t,i,n){if(t===0&&i.length===0)return;const s=h.index.get(e);if(s){s[1]+=t,n?(i.push(...s[2]),s[2]=i):s[2].push(...i);return}const p=[e,t,i];h.map.push(p),h.index.set(e,p)}exports.EditMap=c;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../node_modules/micromark-util-edit-map/index.js"],"sourcesContent":["/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n *\n * Port of `edit_map.rs` from `markdown-rs`:\n * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>.\n *\n * Deal with several changes in events, batching them together.\n *\n * Preferably, changes should be kept to a minimum.\n * Sometimes, it’s needed to change the list of events, because parsing can be\n * messy, and it helps to expose a cleaner interface of events to the compiler\n * and other users.\n * It can also help to merge many adjacent similar events.\n * And, in other cases, it’s needed to parse subcontent: pass some events\n * through another tokenizer and inject the result.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n *\n * @returns\n * New instance.\n */\n constructor() {\n /**\n * Changes by index, so `add` does not need to scan `map` (which is\n * quadratic for documents with many edits at different places).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add, false);\n }\n\n /**\n * Create an edit: but insert `add` before existing additions, instead of\n * after them.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n addBefore(index, remove, add) {\n addImplementation(this, index, remove, add, true);\n }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @param {boolean} before\n * Insert `add` before existing additions at `at`, instead of after them.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add, before) {\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n if (before) {\n add.push(...existing[2]);\n existing[2] = add;\n } else {\n existing[2].push(...add);\n }\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }"],"names":["EditMap","index","remove","add","addImplementation","events","a","b","vecs","slice","element","editMap","at","before","existing","change"],"mappings":"gFAyBO,MAAMA,CAAQ,CAOnB,aAAc,CAOZ,KAAK,MAAQ,IAAI,IAOjB,KAAK,IAAM,CAAA,CACb,CAcA,IAAIC,EAAOC,EAAQC,EAAK,CACtBC,EAAkB,KAAMH,EAAOC,EAAQC,EAAK,EAAK,CACnD,CAeA,UAAUF,EAAOC,EAAQC,EAAK,CAC5BC,EAAkB,KAAMH,EAAOC,EAAQC,EAAK,EAAI,CAClD,CAUA,QAAQE,EAAQ,CAId,GAHA,KAAK,IAAI,KAAK,SAAUC,EAAGC,EAAG,CAC5B,OAAOD,EAAE,CAAC,EAAIC,EAAE,CAAC,CACnB,CAAC,EACG,KAAK,IAAI,SAAW,EACtB,OAqBF,IAAIN,EAAQ,KAAK,IAAI,OAErB,MAAMO,EAAO,CAAA,EACb,KAAOP,EAAQ,GACbA,GAAS,EACTO,EAAK,KAAKH,EAAO,MAAM,KAAK,IAAIJ,CAAK,EAAE,CAAC,EAAI,KAAK,IAAIA,CAAK,EAAE,CAAC,CAAC,EAAG,KAAK,IAAIA,CAAK,EAAE,CAAC,CAAC,EAGnFI,EAAO,OAAS,KAAK,IAAIJ,CAAK,EAAE,CAAC,EAEnCO,EAAK,KAAKH,EAAO,OAAO,EACxBA,EAAO,OAAS,EAChB,IAAII,EAAQD,EAAK,IAAG,EACpB,KAAOC,GAAO,CACZ,UAAWC,KAAWD,EACpBJ,EAAO,KAAKK,CAAO,EAErBD,EAAQD,EAAK,IAAG,CAClB,CAGA,KAAK,IAAI,OAAS,EAClB,KAAK,MAAM,MAAK,CAClB,CACF,CAkBA,SAASJ,EAAkBO,EAASC,EAAIV,EAAQC,EAAKU,EAAQ,CAC3D,GAAIX,IAAW,GAAKC,EAAI,SAAW,EACjC,OAEF,MAAMW,EAAWH,EAAQ,MAAM,IAAIC,CAAE,EACrC,GAAIE,EAAU,CACZA,EAAS,CAAC,GAAKZ,EACXW,GACFV,EAAI,KAAK,GAAGW,EAAS,CAAC,CAAC,EACvBA,EAAS,CAAC,EAAIX,GAEdW,EAAS,CAAC,EAAE,KAAK,GAAGX,CAAG,EAEzB,MACF,CAGA,MAAMY,EAAS,CAACH,EAAIV,EAAQC,CAAG,EAC/BQ,EAAQ,IAAI,KAAKI,CAAM,EACvBJ,EAAQ,MAAM,IAAIC,EAAIG,CAAM,CAC9B","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
class c {
|
|
2
|
+
/**
|
|
3
|
+
* Create a new edit map.
|
|
4
|
+
*
|
|
5
|
+
* @returns
|
|
6
|
+
* New instance.
|
|
7
|
+
*/
|
|
8
|
+
constructor() {
|
|
9
|
+
this.index = /* @__PURE__ */ new Map(), this.map = [];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create an edit: a remove and/or add at a certain place.
|
|
13
|
+
*
|
|
14
|
+
* @param {number} index
|
|
15
|
+
* Index at which to apply the edit.
|
|
16
|
+
* @param {number} remove
|
|
17
|
+
* Count of items to remove at the index.
|
|
18
|
+
* @param {Array<Event>} add
|
|
19
|
+
* Items to add at the index.
|
|
20
|
+
* @returns {undefined}
|
|
21
|
+
* Nothing.
|
|
22
|
+
*/
|
|
23
|
+
add(i, t, s) {
|
|
24
|
+
l(this, i, t, s, !1);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create an edit: but insert `add` before existing additions, instead of
|
|
28
|
+
* after them.
|
|
29
|
+
*
|
|
30
|
+
* @param {number} index
|
|
31
|
+
* Index at which to apply the edit.
|
|
32
|
+
* @param {number} remove
|
|
33
|
+
* Count of items to remove at the index.
|
|
34
|
+
* @param {Array<Event>} add
|
|
35
|
+
* Items to add at the index.
|
|
36
|
+
* @returns {undefined}
|
|
37
|
+
* Nothing.
|
|
38
|
+
*/
|
|
39
|
+
addBefore(i, t, s) {
|
|
40
|
+
l(this, i, t, s, !0);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Done, change the events.
|
|
44
|
+
*
|
|
45
|
+
* @param {Array<Event>} events
|
|
46
|
+
* List of events to apply the edits to.
|
|
47
|
+
* @returns {undefined}
|
|
48
|
+
* Nothing.
|
|
49
|
+
*/
|
|
50
|
+
consume(i) {
|
|
51
|
+
if (this.map.sort(function(e, p) {
|
|
52
|
+
return e[0] - p[0];
|
|
53
|
+
}), this.map.length === 0)
|
|
54
|
+
return;
|
|
55
|
+
let t = this.map.length;
|
|
56
|
+
const s = [];
|
|
57
|
+
for (; t > 0; )
|
|
58
|
+
t -= 1, s.push(i.slice(this.map[t][0] + this.map[t][1]), this.map[t][2]), i.length = this.map[t][0];
|
|
59
|
+
s.push(i.slice()), i.length = 0;
|
|
60
|
+
let h = s.pop();
|
|
61
|
+
for (; h; ) {
|
|
62
|
+
for (const e of h)
|
|
63
|
+
i.push(e);
|
|
64
|
+
h = s.pop();
|
|
65
|
+
}
|
|
66
|
+
this.map.length = 0, this.index.clear();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function l(n, i, t, s, h) {
|
|
70
|
+
if (t === 0 && s.length === 0)
|
|
71
|
+
return;
|
|
72
|
+
const e = n.index.get(i);
|
|
73
|
+
if (e) {
|
|
74
|
+
e[1] += t, h ? (s.push(...e[2]), e[2] = s) : e[2].push(...s);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const p = [i, t, s];
|
|
78
|
+
n.map.push(p), n.index.set(i, p);
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
c as EditMap
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../node_modules/micromark-util-edit-map/index.js"],"sourcesContent":["/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n *\n * Port of `edit_map.rs` from `markdown-rs`:\n * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>.\n *\n * Deal with several changes in events, batching them together.\n *\n * Preferably, changes should be kept to a minimum.\n * Sometimes, it’s needed to change the list of events, because parsing can be\n * messy, and it helps to expose a cleaner interface of events to the compiler\n * and other users.\n * It can also help to merge many adjacent similar events.\n * And, in other cases, it’s needed to parse subcontent: pass some events\n * through another tokenizer and inject the result.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n *\n * @returns\n * New instance.\n */\n constructor() {\n /**\n * Changes by index, so `add` does not need to scan `map` (which is\n * quadratic for documents with many edits at different places).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add, false);\n }\n\n /**\n * Create an edit: but insert `add` before existing additions, instead of\n * after them.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n addBefore(index, remove, add) {\n addImplementation(this, index, remove, add, true);\n }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @param {boolean} before\n * Insert `add` before existing additions at `at`, instead of after them.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add, before) {\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n if (before) {\n add.push(...existing[2]);\n existing[2] = add;\n } else {\n existing[2].push(...add);\n }\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }"],"names":["EditMap","index","remove","add","addImplementation","events","a","b","vecs","slice","element","editMap","at","before","existing","change"],"mappings":"AAyBO,MAAMA,EAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnB,cAAc;AAOZ,SAAK,QAAQ,oBAAI,IAAG,GAOpB,KAAK,MAAM,CAAA;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAIC,GAAOC,GAAQC,GAAK;AACtB,IAAAC,EAAkB,MAAMH,GAAOC,GAAQC,GAAK,EAAK;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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EACF;AAGA,QAAMY,IAAS,CAACH,GAAIV,GAAQC,CAAG;AAC/B,EAAAQ,EAAQ,IAAI,KAAKI,CAAM,GACvBJ,EAAQ,MAAM,IAAIC,GAAIG,CAAM;AAC9B;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@codemirror/view": "^6.38.1",
|
|
18
18
|
"@fontsource/inter": "^5.2.8",
|
|
19
19
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
20
|
-
"@radix-ui/react-dialog": "1.
|
|
21
|
-
"@radix-ui/react-popover": "1.
|
|
22
|
-
"@radix-ui/react-slot": "1.
|
|
20
|
+
"@radix-ui/react-dialog": "1.3.1",
|
|
21
|
+
"@radix-ui/react-popover": "1.3.1",
|
|
22
|
+
"@radix-ui/react-slot": "1.5.0",
|
|
23
23
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
24
24
|
"@types/hast": "^3.0.4",
|
|
25
25
|
"@types/mdast": "^4.0.4",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"clsx": "^2.1.1",
|
|
30
30
|
"github-markdown-css": "^5.8.1",
|
|
31
31
|
"highlight.js": "^11.11.1",
|
|
32
|
-
"i18next": "^
|
|
32
|
+
"i18next": "^26.5.11",
|
|
33
33
|
"js-yaml": "4.3.2",
|
|
34
|
-
"katex": "0.
|
|
35
|
-
"lucide-react": "^
|
|
34
|
+
"katex": "0.19.1",
|
|
35
|
+
"lucide-react": "^1.61.0",
|
|
36
36
|
"mermaid": "11.16.1",
|
|
37
37
|
"micromark-util-decode-string": "^2.0.1",
|
|
38
38
|
"rc-textarea": "^1.10.2",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"description": "A React UI library for rendering markdown with interactive flow components, streaming support, and plugin extensibility",
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@chromatic-com/storybook": "^
|
|
58
|
+
"@chromatic-com/storybook": "^5.6.0",
|
|
59
59
|
"@eslint/eslintrc": "^3",
|
|
60
60
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
61
61
|
"@storybook/addon-a11y": "10.6.5",
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"gsap": "3.15.0",
|
|
82
82
|
"husky": "^9.1.7",
|
|
83
83
|
"jsdom": "26.1.0",
|
|
84
|
-
"lint-staged": "^
|
|
85
|
-
"markdownlint-cli": "^0.
|
|
84
|
+
"lint-staged": "^17.6.0",
|
|
85
|
+
"markdownlint-cli": "^0.50.0",
|
|
86
86
|
"next": "15.5.28",
|
|
87
87
|
"playwright": "^1.54.1",
|
|
88
|
-
"prettier": "3.9.
|
|
89
|
-
"react": "19.3.
|
|
90
|
-
"react-dom": "19.3.
|
|
88
|
+
"prettier": "3.9.10",
|
|
89
|
+
"react": "19.3.1",
|
|
90
|
+
"react-dom": "19.3.1",
|
|
91
91
|
"rollup": "^4.46.2",
|
|
92
92
|
"rollup-plugin-dts": "^6.2.1",
|
|
93
93
|
"standard-version": "^9.5.0",
|
|
@@ -137,15 +137,21 @@
|
|
|
137
137
|
"katex": "$katex",
|
|
138
138
|
"postcss": "8.5.23",
|
|
139
139
|
"sharp": "0.35.5",
|
|
140
|
-
"smol-toml": "1.9.1"
|
|
140
|
+
"smol-toml": "1.9.1",
|
|
141
|
+
"re2js": "2.8.7",
|
|
142
|
+
"glob@>=9": "14.0.2",
|
|
143
|
+
"minimatch@>=9": "11.0.3"
|
|
141
144
|
},
|
|
142
145
|
"pnpm": {
|
|
143
146
|
"overrides": {
|
|
144
147
|
"js-yaml": "4.3.2",
|
|
145
|
-
"katex": "0.
|
|
148
|
+
"katex": "0.19.1",
|
|
146
149
|
"postcss": "8.5.23",
|
|
147
150
|
"sharp": "0.35.5",
|
|
148
|
-
"smol-toml": "1.9.1"
|
|
151
|
+
"smol-toml": "1.9.1",
|
|
152
|
+
"re2js": "2.8.7",
|
|
153
|
+
"glob@>=9": "14.0.2",
|
|
154
|
+
"minimatch@>=9": "11.0.3"
|
|
149
155
|
}
|
|
150
156
|
},
|
|
151
157
|
"peerDependencies": {
|
|
@@ -159,7 +165,7 @@
|
|
|
159
165
|
"url": "git+https://github.com/ai-shifu/markdown-flow-ui.git"
|
|
160
166
|
},
|
|
161
167
|
"scripts": {
|
|
162
|
-
"audit:dependencies": "npm
|
|
168
|
+
"audit:dependencies": "npm run test:audit && node scripts/audit-dependencies.mjs",
|
|
163
169
|
"build:css": "pnpm exec tailwindcss --input src/styles/library.css --output dist/markdown-flow-ui-lib.css --config tailwind.build.config.ts --minify && node scripts/copy-katex-fonts.mjs",
|
|
164
170
|
"build:fonts": "node scripts/copy-fonts.mjs",
|
|
165
171
|
"build": "vite build && pnpm run build:css && node scripts/externalize-katex-fonts.mjs && node scripts/copy-legacy-css-entry.mjs",
|
|
@@ -177,6 +183,7 @@
|
|
|
177
183
|
"start": "next start",
|
|
178
184
|
"storybook": "storybook dev -p 6006",
|
|
179
185
|
"test": "vitest run --project unit",
|
|
186
|
+
"test:audit": "node --test tests/audit/*.test.mjs",
|
|
180
187
|
"test:package": "npm run build && node --test tests/package/*.test.mjs",
|
|
181
188
|
"test:storybook": "vitest run --project storybook",
|
|
182
189
|
"typecheck:exports": "pnpm exec tsc -p tsconfig.exports.json --pretty false"
|
|
@@ -200,7 +207,7 @@
|
|
|
200
207
|
]
|
|
201
208
|
}
|
|
202
209
|
},
|
|
203
|
-
"version": "0.3.
|
|
210
|
+
"version": "0.3.7",
|
|
204
211
|
"type": "module",
|
|
205
212
|
"exports": {
|
|
206
213
|
".": {
|
package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var w=Object.defineProperty,r=(e,o)=>w(e,"name",{value:o,configurable:!0}),u=!!(typeof window<"u"&&window.document&&window.document.createElement);function m(e,o,{checkForDefaultPrevented:n=!0}={}){return r(function(t){if(e?.(t),n===!1||!t||!t.defaultPrevented)return o?.(t)},"handleEvent")}r(m,"composeEventHandlers");function f(e){if(!u)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}r(f,"getOwnerWindow");function i(e){if(!u)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}r(i,"getOwnerDocument");function a(e,o=!1){const{activeElement:n}=i(e);if(!n?.nodeName)return null;if(d(n)&&n.contentDocument)return a(n.contentDocument.body,o);if(o){const c=n.getAttribute("aria-activedescendant");if(c){const t=i(n).getElementById(c);if(t)return t}}return n}r(a,"getActiveElement");function d(e){return e.tagName==="IFRAME"}r(d,"isFrame");exports.canUseDOM=u;exports.composeEventHandlers=m;exports.getActiveElement=a;exports.getOwnerDocument=i;exports.getOwnerWindow=f;exports.isFrame=d;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.mjs"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return /* @__PURE__ */ __name(function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n }, \"handleEvent\");\n}\n__name(composeEventHandlers, \"composeEventHandlers\");\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\n__name(getOwnerWindow, \"getOwnerWindow\");\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\n__name(getOwnerDocument, \"getOwnerDocument\");\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\n__name(getActiveElement, \"getActiveElement\");\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\n__name(isFrame, \"isFrame\");\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","canUseDOM","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","getOwnerWindow","element","getOwnerDocument","getActiveElement","node","activeDescendant","activeElement","isFrame","id"],"mappings":"gFAAA,IAAIA,EAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,EAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EAGnFC,EAAY,CAAC,EAAE,OAAO,OAAW,KAAe,OAAO,UAAY,OAAO,SAAS,eACvF,SAASC,EAAqBC,EAAsBC,EAAiB,CAAE,yBAAAC,EAA2B,EAAI,EAAK,GAAI,CAC7G,OAAuBP,EAAO,SAAqBQ,EAAO,CAExD,GADAH,IAAuBG,CAAK,EACxBD,IAA6B,IAAS,CAACC,GAAS,CAACA,EAAM,iBACzD,OAAOF,IAAkBE,CAAK,CAElC,EAAG,aAAa,CAClB,CACAR,EAAOI,EAAsB,sBAAsB,EACnD,SAASK,EAAeC,EAAS,CAC/B,GAAI,CAACP,EACH,MAAM,IAAI,MAAM,yCAAyC,EAE3D,OAAOO,GAAS,eAAe,aAAe,MAChD,CACAV,EAAOS,EAAgB,gBAAgB,EACvC,SAASE,EAAiBD,EAAS,CACjC,GAAI,CAACP,EACH,MAAM,IAAI,MAAM,2CAA2C,EAE7D,OAAOO,GAAS,eAAiB,QACnC,CACAV,EAAOW,EAAkB,kBAAkB,EAC3C,SAASC,EAAiBC,EAAMC,EAAmB,GAAO,CACxD,KAAM,CAAE,cAAAC,CAAa,EAAKJ,EAAiBE,CAAI,EAC/C,GAAI,CAACE,GAAe,SAClB,OAAO,KAET,GAAIC,EAAQD,CAAa,GAAKA,EAAc,gBAC1C,OAAOH,EAAiBG,EAAc,gBAAgB,KAAMD,CAAgB,EAE9E,GAAIA,EAAkB,CACpB,MAAMG,EAAKF,EAAc,aAAa,uBAAuB,EAC7D,GAAIE,EAAI,CACN,MAAMP,EAAUC,EAAiBI,CAAa,EAAE,eAAeE,CAAE,EACjE,GAAIP,EACF,OAAOA,CAEX,CACF,CACA,OAAOK,CACT,CACAf,EAAOY,EAAkB,kBAAkB,EAC3C,SAASI,EAAQN,EAAS,CACxB,OAAOA,EAAQ,UAAY,QAC7B,CACAV,EAAOgB,EAAS,SAAS","x_google_ignoreList":[0]}
|
package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var f = Object.defineProperty, r = (e, o) => f(e, "name", { value: o, configurable: !0 }), c = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
2
|
-
function m(e, o, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
3
|
-
return /* @__PURE__ */ r(function(t) {
|
|
4
|
-
if (e?.(t), n === !1 || !t || !t.defaultPrevented)
|
|
5
|
-
return o?.(t);
|
|
6
|
-
}, "handleEvent");
|
|
7
|
-
}
|
|
8
|
-
r(m, "composeEventHandlers");
|
|
9
|
-
function w(e) {
|
|
10
|
-
if (!c)
|
|
11
|
-
throw new Error("Cannot access window outside of the DOM");
|
|
12
|
-
return e?.ownerDocument?.defaultView ?? window;
|
|
13
|
-
}
|
|
14
|
-
r(w, "getOwnerWindow");
|
|
15
|
-
function u(e) {
|
|
16
|
-
if (!c)
|
|
17
|
-
throw new Error("Cannot access document outside of the DOM");
|
|
18
|
-
return e?.ownerDocument ?? document;
|
|
19
|
-
}
|
|
20
|
-
r(u, "getOwnerDocument");
|
|
21
|
-
function d(e, o = !1) {
|
|
22
|
-
const { activeElement: n } = u(e);
|
|
23
|
-
if (!n?.nodeName)
|
|
24
|
-
return null;
|
|
25
|
-
if (a(n) && n.contentDocument)
|
|
26
|
-
return d(n.contentDocument.body, o);
|
|
27
|
-
if (o) {
|
|
28
|
-
const i = n.getAttribute("aria-activedescendant");
|
|
29
|
-
if (i) {
|
|
30
|
-
const t = u(n).getElementById(i);
|
|
31
|
-
if (t)
|
|
32
|
-
return t;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return n;
|
|
36
|
-
}
|
|
37
|
-
r(d, "getActiveElement");
|
|
38
|
-
function a(e) {
|
|
39
|
-
return e.tagName === "IFRAME";
|
|
40
|
-
}
|
|
41
|
-
r(a, "isFrame");
|
|
42
|
-
export {
|
|
43
|
-
c as canUseDOM,
|
|
44
|
-
m as composeEventHandlers,
|
|
45
|
-
d as getActiveElement,
|
|
46
|
-
u as getOwnerDocument,
|
|
47
|
-
w as getOwnerWindow,
|
|
48
|
-
a as isFrame
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.mjs"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return /* @__PURE__ */ __name(function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n }, \"handleEvent\");\n}\n__name(composeEventHandlers, \"composeEventHandlers\");\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\n__name(getOwnerWindow, \"getOwnerWindow\");\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\n__name(getOwnerDocument, \"getOwnerDocument\");\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\n__name(getActiveElement, \"getActiveElement\");\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\n__name(isFrame, \"isFrame\");\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","canUseDOM","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","getOwnerWindow","element","getOwnerDocument","getActiveElement","node","activeDescendant","activeElement","isFrame","id"],"mappings":"AAAA,IAAIA,IAAY,OAAO,gBACnBC,IAAS,CAACC,GAAQC,MAAUH,EAAUE,GAAQ,QAAQ,EAAE,OAAAC,GAAO,cAAc,IAAM,GAGnFC,IAAY,CAAC,EAAE,OAAO,SAAW,OAAe,OAAO,YAAY,OAAO,SAAS;AACvF,SAASC,EAAqBC,GAAsBC,GAAiB,EAAE,0BAAAC,IAA2B,GAAI,IAAK,IAAI;AAC7G,SAAuB,gBAAAP,EAAO,SAAqBQ,GAAO;AAExD,QADAH,IAAuBG,CAAK,GACxBD,MAA6B,MAAS,CAACC,KAAS,CAACA,EAAM;AACzD,aAAOF,IAAkBE,CAAK;AAAA,EAElC,GAAG,aAAa;AAClB;AACAR,EAAOI,GAAsB,sBAAsB;AACnD,SAASK,EAAeC,GAAS;AAC/B,MAAI,CAACP;AACH,UAAM,IAAI,MAAM,yCAAyC;AAE3D,SAAOO,GAAS,eAAe,eAAe;AAChD;AACAV,EAAOS,GAAgB,gBAAgB;AACvC,SAASE,EAAiBD,GAAS;AACjC,MAAI,CAACP;AACH,UAAM,IAAI,MAAM,2CAA2C;AAE7D,SAAOO,GAAS,iBAAiB;AACnC;AACAV,EAAOW,GAAkB,kBAAkB;AAC3C,SAASC,EAAiBC,GAAMC,IAAmB,IAAO;AACxD,QAAM,EAAE,eAAAC,EAAa,IAAKJ,EAAiBE,CAAI;AAC/C,MAAI,CAACE,GAAe;AAClB,WAAO;AAET,MAAIC,EAAQD,CAAa,KAAKA,EAAc;AAC1C,WAAOH,EAAiBG,EAAc,gBAAgB,MAAMD,CAAgB;AAE9E,MAAIA,GAAkB;AACpB,UAAMG,IAAKF,EAAc,aAAa,uBAAuB;AAC7D,QAAIE,GAAI;AACN,YAAMP,IAAUC,EAAiBI,CAAa,EAAE,eAAeE,CAAE;AACjE,UAAIP;AACF,eAAOA;AAAA,IAEX;AAAA,EACF;AACA,SAAOK;AACT;AACAf,EAAOY,GAAkB,kBAAkB;AAC3C,SAASI,EAAQN,GAAS;AACxB,SAAOA,EAAQ,YAAY;AAC7B;AACAV,EAAOgB,GAAS,SAAS;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/arrow.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar Arrow = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function Arrow2(props, forwardedRef) {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.svg,\n {\n ...arrowProps,\n ref: forwardedRef,\n width,\n height,\n viewBox: \"0 0 30 10\",\n preserveAspectRatio: \"none\",\n children: props.asChild ? children : /* @__PURE__ */ jsx(\"polygon\", { points: \"0,0 30,0 15,10\" })\n }\n );\n }, \"Arrow\")\n);\nexport {\n Arrow,\n Arrow as Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","Arrow","React","props","forwardedRef","children","width","height","arrowProps","jsx","Primitive"],"mappings":"odACA,IAAIA,EAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,EAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EAMnFC,EAAwBC,EAAM,WAChBJ,EAAO,SAAgBK,EAAOC,EAAc,CAC1D,KAAM,CAAE,SAAAC,EAAU,MAAAC,EAAQ,GAAI,OAAAC,EAAS,EAAG,GAAGC,CAAU,EAAKL,EAC5D,OAAuBM,EAAAA,IACrBC,EAAAA,UAAU,IACV,CACE,GAAGF,EACH,IAAKJ,EACL,MAAAE,EACA,OAAAC,EACA,QAAS,YACT,oBAAqB,OACrB,SAAUJ,EAAM,QAAUE,EAA2BI,EAAAA,IAAI,UAAW,CAAE,OAAQ,gBAAgB,CAAE,CACxG,CACA,CACE,EAAG,OAAO,CACZ","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/arrow.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar Arrow = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function Arrow2(props, forwardedRef) {\n const { children, width = 10, height = 5, ...arrowProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.svg,\n {\n ...arrowProps,\n ref: forwardedRef,\n width,\n height,\n viewBox: \"0 0 30 10\",\n preserveAspectRatio: \"none\",\n children: props.asChild ? children : /* @__PURE__ */ jsx(\"polygon\", { points: \"0,0 30,0 15,10\" })\n }\n );\n }, \"Arrow\")\n);\nexport {\n Arrow,\n Arrow as Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","Arrow","React","props","forwardedRef","children","width","height","arrowProps","jsx","Primitive"],"mappings":";;;AACA,IAAIA,IAAY,OAAO,gBACnBC,IAAS,CAACC,GAAQC,MAAUH,EAAUE,GAAQ,QAAQ,EAAE,OAAAC,GAAO,cAAc,IAAM,GAMnFC,IAAwB,gBAAAC,EAAM;AAAA,EAChB,gBAAAJ,EAAO,SAAgBK,GAAOC,GAAc;AAC1D,UAAM,EAAE,UAAAC,GAAU,OAAAC,IAAQ,IAAI,QAAAC,IAAS,GAAG,GAAGC,EAAU,IAAKL;AAC5D,WAAuB,gBAAAM;AAAA,MACrBC,EAAU;AAAA,MACV;AAAA,QACE,GAAGF;AAAA,QACH,KAAKJ;AAAA,QACL,OAAAE;AAAA,QACA,QAAAC;AAAA,QACA,SAAS;AAAA,QACT,qBAAqB;AAAA,QACrB,UAAUJ,EAAM,UAAUE,IAA2B,gBAAAI,EAAI,WAAW,EAAE,QAAQ,iBAAgB,CAAE;AAAA,MACxG;AAAA,IACA;AAAA,EACE,GAAG,OAAO;AACZ;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),b=require("react/jsx-runtime");function y(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const p=y(g);var O=Object.defineProperty,s=(e,o)=>O(e,"name",{value:o,configurable:!0});function P(e,o){const t=p.createContext(o);t.displayName=e+"Context";const i=s(u=>{const{children:n,...r}=u,c=p.useMemo(()=>r,Object.values(r));return b.jsx(t.Provider,{value:c,children:n})},"Provider");i.displayName=e+"Provider";function a(u,n={}){const{optional:r=!1}=n,c=p.useContext(t);if(c)return c;if(o!==void 0)return o;if(!r)throw new Error(`\`${u}\` must be used within \`${e}\``)}return s(a,"useContext"),[i,a]}s(P,"createContext");function _(e,o=[]){let t=[];function i(u,n){const r=p.createContext(n);r.displayName=u+"Context";const c=t.length;t=[...t,n];const d=s(x=>{const{scope:C,children:S,...f}=x,m=C?.[e]?.[c]||r,l=p.useMemo(()=>f,Object.values(f));return b.jsx(m.Provider,{value:l,children:S})},"Provider");d.displayName=u+"Provider";function v(x,C,S={}){const{optional:f=!1}=S,m=C?.[e]?.[c]||r,l=p.useContext(m);if(l)return l;if(n!==void 0)return n;if(!f)throw new Error(`\`${x}\` must be used within \`${u}\``)}return s(v,"useContext"),[d,v]}s(i,"createContext");const a=s(()=>{const u=t.map(n=>p.createContext(n));return s(function(r){const c=r?.[e]||u;return p.useMemo(()=>({[`__scope${e}`]:{...r,[e]:c}}),[r,c])},"useScope")},"createScope");return a.scopeName=e,[i,j(a,...o)]}s(_,"createContextScope");function j(...e){const o=e[0];if(e.length===1)return o;const t=s(()=>{const i=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return s(function(u){const n=i.reduce((r,{useScope:c,scopeName:d})=>{const x=c(u)[`__scope${d}`];return{...r,...x}},{});return p.useMemo(()=>({[`__scope${o.scopeName}`]:n}),[n])},"useComposedScopes")},"createScope");return t.scopeName=o.scopeName,t}s(j,"composeContextScopes");exports.createContext=P;exports.createContextScope=_;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|