markdown-flow-ui 0.3.6 → 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/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/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,58 +1,60 @@
|
|
|
1
|
-
import { factorySpace as
|
|
2
|
-
import { markdownSpace as g, markdownLineEnding as
|
|
3
|
-
|
|
1
|
+
import { factorySpace as f } from "../../micromark-factory-space/index.es.js";
|
|
2
|
+
import { markdownSpace as g, markdownLineEnding as m } from "../../micromark-util-character/index.es.js";
|
|
3
|
+
import { EditMap as y } from "../../micromark-util-edit-map/index.es.js";
|
|
4
|
+
const H = {
|
|
4
5
|
name: "setextUnderline",
|
|
5
6
|
resolveTo: h,
|
|
6
|
-
tokenize:
|
|
7
|
+
tokenize: s
|
|
7
8
|
};
|
|
8
|
-
function h(e,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
function h(e, p) {
|
|
10
|
+
const i = new y();
|
|
11
|
+
let t = e.length, r, d, a;
|
|
12
|
+
for (; t--; )
|
|
13
|
+
if (e[t][0] === "enter") {
|
|
14
|
+
if (e[t][1].type === "content") {
|
|
15
|
+
r = t;
|
|
14
16
|
break;
|
|
15
17
|
}
|
|
16
|
-
e[
|
|
18
|
+
e[t][1].type === "paragraph" && (d = t);
|
|
17
19
|
} else
|
|
18
|
-
e[
|
|
19
|
-
const
|
|
20
|
+
e[t][1].type === "content" && i.add(t, 1, []), !a && e[t][1].type === "definition" && (a = t);
|
|
21
|
+
const l = {
|
|
20
22
|
type: "setextHeading",
|
|
21
23
|
start: {
|
|
22
|
-
...e[
|
|
24
|
+
...e[r][1].start
|
|
23
25
|
},
|
|
24
26
|
end: {
|
|
25
27
|
...e[e.length - 1][1].end
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
|
-
return e[
|
|
29
|
-
...e[
|
|
30
|
-
}) : e[
|
|
30
|
+
return e[d][1].type = "setextHeadingText", a ? (i.add(d, 0, [["enter", l, p]]), i.add(a + 1, 0, [["exit", e[r][1], p]]), e[r][1].end = {
|
|
31
|
+
...e[a][1].end
|
|
32
|
+
}) : e[r][1] = l, i.add(e.length, 0, [["exit", l, p]]), i.consume(e), e;
|
|
31
33
|
}
|
|
32
|
-
function
|
|
34
|
+
function s(e, p, i) {
|
|
33
35
|
const t = this;
|
|
34
|
-
let
|
|
35
|
-
return
|
|
36
|
-
function
|
|
37
|
-
let
|
|
38
|
-
for (;
|
|
39
|
-
if (t.events[
|
|
40
|
-
|
|
36
|
+
let r;
|
|
37
|
+
return d;
|
|
38
|
+
function d(n) {
|
|
39
|
+
let o = t.events.length, x;
|
|
40
|
+
for (; o--; )
|
|
41
|
+
if (t.events[o][1].type !== "lineEnding" && t.events[o][1].type !== "linePrefix" && t.events[o][1].type !== "content") {
|
|
42
|
+
x = t.events[o][1].type === "paragraph";
|
|
41
43
|
break;
|
|
42
44
|
}
|
|
43
|
-
return !t.parser.lazy[t.now().line] && (t.interrupt ||
|
|
45
|
+
return !t.parser.lazy[t.now().line] && (t.interrupt || x) ? (e.enter("setextHeadingLine"), r = n, a(n)) : i(n);
|
|
44
46
|
}
|
|
45
|
-
function
|
|
46
|
-
return e.enter("setextHeadingLineSequence"),
|
|
47
|
+
function a(n) {
|
|
48
|
+
return e.enter("setextHeadingLineSequence"), l(n);
|
|
47
49
|
}
|
|
48
|
-
function
|
|
49
|
-
return n ===
|
|
50
|
+
function l(n) {
|
|
51
|
+
return n === r ? (e.consume(n), l) : (e.exit("setextHeadingLineSequence"), g(n) ? f(e, u, "lineSuffix")(n) : u(n));
|
|
50
52
|
}
|
|
51
|
-
function
|
|
52
|
-
return n === null ||
|
|
53
|
+
function u(n) {
|
|
54
|
+
return n === null || m(n) ? (e.exit("setextHeadingLine"), p(n)) : i(n);
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
H as setextUnderline
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=setext-underline.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setext-underline.es.js","sources":["../../../../node_modules/micromark-core-commonmark/lib/setext-underline.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n
|
|
1
|
+
{"version":3,"file":"setext-underline.es.js","sources":["../../../../node_modules/micromark-core-commonmark/lib/setext-underline.js"],"sourcesContent":["/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n const editMap = new EditMap();\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n editMap.add(index, 1, []);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n editMap.add(text, 0, [['enter', heading, context]]);\n editMap.add(definition + 1, 0, [['exit', events[content][1], context]]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n editMap.add(events.length, 0, [['exit', heading, context]]);\n editMap.consume(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}"],"names":["setextUnderline","resolveToSetextUnderline","tokenizeSetextUnderline","events","context","editMap","EditMap","index","content","text","definition","heading","effects","ok","nok","self","marker","start","code","paragraph","before","inside","markdownSpace","factorySpace","after","markdownLineEnding"],"mappings":";;;AAeY,MAACA,IAAkB;AAAA,EAC7B,MA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1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class l{constructor(){this.map=[],this.index=new Map}add(i,t,s){c(this,i,t,s)}consume(i){if(this.map.sort(function(e,p){return e[0]-p[0]}),this.map.length===0)return;let t=this.map.length;const s=[];for(;t>0;)t-=1,s.push(i.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),i.length=this.map[t][0];s.push(i.slice()),i.length=0;let n=s.pop();for(;n;){for(const e of n)i.push(e);n=s.pop()}this.map.length=0,this.index.clear()}}function c(h,i,t,s){if(t===0&&s.length===0)return;const n=h.index.get(i);if(n){n[1]+=t,n[2].push(...s);return}const e=[i,t,s];h.map.push(e),h.index.set(i,e)}exports.EditMap=l;
|
|
2
2
|
//# sourceMappingURL=edit-map.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-map.cjs","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js"],"sourcesContent":["/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\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\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\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 * @param {number} remove\n * @param {Array<Event>} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {undefined}\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 * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\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 }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array<Event>} add\n * @returns {undefined}\n */\nfunction addImplementation(editMap, at, remove, add) {\n
|
|
1
|
+
{"version":3,"file":"edit-map.cjs","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js"],"sourcesContent":["/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\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\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n\n /**\n * Changes by index, so `add` does not scan `map` (quadratic on\n * table-heavy documents).\n *\n * @type {Map<number, Change>}\n */\n this.index = new 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);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {undefined}\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\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\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 * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add) {\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\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\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...existing[2])\n // existing[2] = add\n // } else {\n existing[2].push(...add);\n // }\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","existing","change"],"mappings":"gFAyBO,MAAMA,CAAQ,CAInB,aAAc,CAMZ,KAAK,IAAM,CAAA,EAQX,KAAK,MAAQ,IAAI,GACnB,CAcA,IAAIC,EAAOC,EAAQC,EAAK,CACtBC,EAAkB,KAAMH,EAAOC,EAAQC,CAAG,CAC5C,CAuBA,QAAQE,EAAQ,CAMd,GALA,KAAK,IAAI,KAAK,SAAUC,EAAGC,EAAG,CAC5B,OAAOD,EAAE,CAAC,EAAIC,EAAE,CAAC,CACnB,CAAC,EAGG,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,CAgBA,SAASJ,EAAkBO,EAASC,EAAIV,EAAQC,EAAK,CAEnD,GAAID,IAAW,GAAKC,EAAI,SAAW,EACjC,OAEF,MAAMU,EAAWF,EAAQ,MAAM,IAAIC,CAAE,EACrC,GAAIC,EAAU,CACZA,EAAS,CAAC,GAAKX,EAOfW,EAAS,CAAC,EAAE,KAAK,GAAGV,CAAG,EAGvB,MACF,CAGA,MAAMW,EAAS,CAACF,EAAIV,EAAQC,CAAG,EAC/BQ,EAAQ,IAAI,KAAKG,CAAM,EACvBH,EAAQ,MAAM,IAAIC,EAAIE,CAAM,CAC9B","x_google_ignoreList":[0]}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
class
|
|
1
|
+
class c {
|
|
2
2
|
/**
|
|
3
3
|
* Create a new edit map.
|
|
4
4
|
*/
|
|
5
5
|
constructor() {
|
|
6
|
-
this.map = [];
|
|
6
|
+
this.map = [], this.index = /* @__PURE__ */ new Map();
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Create an edit: a remove and/or add at a certain place.
|
|
10
10
|
*
|
|
11
11
|
* @param {number} index
|
|
12
|
+
* Index at which to apply the edit.
|
|
12
13
|
* @param {number} remove
|
|
14
|
+
* Count of items to remove at the index.
|
|
13
15
|
* @param {Array<Event>} add
|
|
16
|
+
* Items to add at the index.
|
|
14
17
|
* @returns {undefined}
|
|
18
|
+
* Nothing.
|
|
15
19
|
*/
|
|
16
|
-
add(
|
|
17
|
-
|
|
20
|
+
add(i, t, s) {
|
|
21
|
+
l(this, i, t, s);
|
|
18
22
|
}
|
|
19
23
|
// To do: add this when moving to `micromark`.
|
|
20
24
|
// /**
|
|
@@ -32,41 +36,41 @@ class e {
|
|
|
32
36
|
* Done, change the events.
|
|
33
37
|
*
|
|
34
38
|
* @param {Array<Event>} events
|
|
39
|
+
* List of events to apply the edits to.
|
|
35
40
|
* @returns {undefined}
|
|
41
|
+
* Nothing.
|
|
36
42
|
*/
|
|
37
|
-
consume(
|
|
38
|
-
if (this.map.sort(function(
|
|
39
|
-
return
|
|
43
|
+
consume(i) {
|
|
44
|
+
if (this.map.sort(function(h, p) {
|
|
45
|
+
return h[0] - p[0];
|
|
40
46
|
}), this.map.length === 0)
|
|
41
47
|
return;
|
|
42
48
|
let t = this.map.length;
|
|
43
|
-
const
|
|
49
|
+
const s = [];
|
|
44
50
|
for (; t > 0; )
|
|
45
|
-
t -= 1,
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
for (;
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
t -= 1, s.push(i.slice(this.map[t][0] + this.map[t][1]), this.map[t][2]), i.length = this.map[t][0];
|
|
52
|
+
s.push(i.slice()), i.length = 0;
|
|
53
|
+
let n = s.pop();
|
|
54
|
+
for (; n; ) {
|
|
55
|
+
for (const h of n)
|
|
56
|
+
i.push(h);
|
|
57
|
+
n = s.pop();
|
|
52
58
|
}
|
|
53
|
-
this.map.length = 0;
|
|
59
|
+
this.map.length = 0, this.index.clear();
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
s += 1;
|
|
65
|
-
}
|
|
66
|
-
i.map.push([h, t, p]);
|
|
62
|
+
function l(e, i, t, s) {
|
|
63
|
+
if (t === 0 && s.length === 0)
|
|
64
|
+
return;
|
|
65
|
+
const n = e.index.get(i);
|
|
66
|
+
if (n) {
|
|
67
|
+
n[1] += t, n[2].push(...s);
|
|
68
|
+
return;
|
|
67
69
|
}
|
|
70
|
+
const h = [i, t, s];
|
|
71
|
+
e.map.push(h), e.index.set(i, h);
|
|
68
72
|
}
|
|
69
73
|
export {
|
|
70
|
-
|
|
74
|
+
c as EditMap
|
|
71
75
|
};
|
|
72
76
|
//# sourceMappingURL=edit-map.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-map.es.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js"],"sourcesContent":["/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\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\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\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 * @param {number} remove\n * @param {Array<Event>} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {undefined}\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 * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\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 }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array<Event>} add\n * @returns {undefined}\n */\nfunction addImplementation(editMap, at, remove, add) {\n
|
|
1
|
+
{"version":3,"file":"edit-map.es.js","sources":["../../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js"],"sourcesContent":["/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\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\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n\n /**\n * Changes by index, so `add` does not scan `map` (quadratic on\n * table-heavy documents).\n *\n * @type {Map<number, Change>}\n */\n this.index = new 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);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {undefined}\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\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\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 * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add) {\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\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\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...existing[2])\n // existing[2] = add\n // } else {\n existing[2].push(...add);\n // }\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","existing","change"],"mappings":"AAyBO,MAAMA,EAAQ;AAAA;AAAA;AAAA;AAAA,EAInB,cAAc;AAMZ,SAAK,MAAM,CAAA,GAQX,KAAK,QAAQ,oBAAI,IAAG;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAIC,GAAOC,GAAQC,GAAK;AACtB,IAAAC,EAAkB,MAAMH,GAAOC,GAAQC,CAAG;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../micromark-factory-space/index.cjs"),p=require("../../micromark-util-character/index.cjs"),P=require("./edit-map.cjs"),q=require("./infer.cjs");function x(){return{flow:{null:{name:"table",tokenize:N,resolveAll:I}}}}function N(t,i,n){const a=this;let s=0,r=0,l;return f;function f(e){let g=a.events.length-1;for(;g>-1;){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../micromark-factory-space/index.cjs"),p=require("../../micromark-util-character/index.cjs"),P=require("./edit-map.cjs"),q=require("./infer.cjs");function x(){return{flow:{null:{name:"table",tokenize:N,resolveAll:I}}}}function N(t,i,n){const a=this;let s=0,r=0,l;return f;function f(e){let g=a.events.length-1;for(;g>-1;){const{type:H}=a.events[g][1];if(H==="lineEnding"||H==="linePrefix")g--;else break}const F=g>-1?a.events[g][1].type:null,C=F==="tableHead"||F==="tableRow"?B:w;return C===B&&a.parser.lazy[a.now().line]?n(e):C(e)}function w(e){return t.enter("tableHead"),t.enter("tableRow"),D(e)}function D(e){return e===124||(l=!0,r+=1),m(e)}function m(e){return e===null?n(e):p.markdownLineEnding(e)?r>1?(r=0,a.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(e),t.exit("lineEnding"),y):n(e):p.markdownSpace(e)?R.factorySpace(t,m,"whitespace")(e):(r+=1,l&&(l=!1,s+=1),e===124?(t.enter("tableCellDivider"),t.consume(e),t.exit("tableCellDivider"),l=!0,m):(t.enter("data"),b(e)))}function b(e){return e===null||e===124||p.markdownLineEndingOrSpace(e)?(t.exit("data"),m(e)):(t.consume(e),e===92?d:b)}function d(e){return e===92||e===124?(t.consume(e),b):b(e)}function y(e){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(e):(t.enter("tableDelimiterRow"),l=!1,p.markdownSpace(e)?R.factorySpace(t,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(e):u(e))}function u(e){return e===45||e===58?j(e):e===124?(l=!0,t.enter("tableCellDivider"),t.consume(e),t.exit("tableCellDivider"),O):o(e)}function O(e){return p.markdownSpace(e)?R.factorySpace(t,j,"whitespace")(e):j(e)}function j(e){return e===58?(r+=1,l=!0,t.enter("tableDelimiterMarker"),t.consume(e),t.exit("tableDelimiterMarker"),T):e===45?(r+=1,T(e)):e===null||p.markdownLineEnding(e)?E(e):o(e)}function T(e){return e===45?(t.enter("tableDelimiterFiller"),A(e)):o(e)}function A(e){return e===45?(t.consume(e),A):e===58?(l=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(e),t.exit("tableDelimiterMarker"),M):(t.exit("tableDelimiterFiller"),M(e))}function M(e){return p.markdownSpace(e)?R.factorySpace(t,E,"whitespace")(e):E(e)}function E(e){return e===124?u(e):e===null||p.markdownLineEnding(e)?!l||s!==r?o(e):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(e)):o(e)}function o(e){return n(e)}function B(e){return t.enter("tableRow"),k(e)}function k(e){return e===124?(t.enter("tableCellDivider"),t.consume(e),t.exit("tableCellDivider"),k):e===null||p.markdownLineEnding(e)?(t.exit("tableRow"),i(e)):p.markdownSpace(e)?R.factorySpace(t,k,"whitespace")(e):(t.enter("data"),v(e))}function v(e){return e===null||e===124||p.markdownLineEndingOrSpace(e)?(t.exit("data"),k(e)):(t.consume(e),e===92?z:v)}function z(e){return e===92||e===124?(t.consume(e),v):v(e)}}function I(t,i){let n=-1,a=!0,s=0,r=[0,0,0,0],l=[0,0,0,0],f=!1,w=0,D,m,b;const d=new P.EditMap;for(;++n<t.length;){const y=t[n],u=y[1];y[0]==="enter"?u.type==="tableHead"?(f=!1,w!==0&&(L(d,i,w,D,m),m=void 0,w=0),D={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},d.add(n,0,[["enter",D,i]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(a=!0,b=void 0,r=[0,0,0,0],l=[0,n+1,0,0],f&&(f=!1,m={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},d.add(n,0,[["enter",m,i]])),s=u.type==="tableDelimiterRow"?2:m?3:1):s&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(a=!1,l[2]===0&&(r[1]!==0&&(l[0]=l[1],b=S(d,i,r,s,void 0,b),r=[0,0,0,0]),l[2]=n)):u.type==="tableCellDivider"&&(a?a=!1:(r[1]!==0&&(l[0]=l[1],b=S(d,i,r,s,void 0,b)),r=l,l=[r[1],n,0,0])):u.type==="tableHead"?(f=!0,w=n):u.type==="tableRow"||u.type==="tableDelimiterRow"?(w=n,r[1]!==0?(l[0]=l[1],b=S(d,i,r,s,n,b)):l[1]!==0&&(b=S(d,i,l,s,n,b)),s=0):s&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(l[3]=n)}for(w!==0&&L(d,i,w,D,m),d.consume(i.events),n=-1;++n<i.events.length;){const y=i.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=q.gfmTableAlign(i.events,n))}return t}function S(t,i,n,a,s,r){const l=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(r.end=Object.assign({},h(i.events,n[0])),t.add(n[0],0,[["exit",r,i]]));const w=h(i.events,n[1]);if(r={type:l,start:Object.assign({},w),end:Object.assign({},w)},t.add(n[1],0,[["enter",r,i]]),n[2]!==0){const D=h(i.events,n[2]),m=h(i.events,n[3]),b={type:f,start:Object.assign({},D),end:Object.assign({},m)};if(t.add(n[2],0,[["enter",b,i]]),a!==2){const d=i.events[n[2]],y=i.events[n[3]];if(d[1].end=Object.assign({},y[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const u=n[2]+1,O=n[3]-n[2]-1;t.add(u,O,[])}}t.add(n[3]+1,0,[["exit",b,i]])}return s!==void 0&&(r.end=Object.assign({},h(i.events,s)),t.add(s,0,[["exit",r,i]]),r=void 0),r}function L(t,i,n,a,s){const r=[],l=h(i.events,n);s&&(s.end=Object.assign({},l),r.push(["exit",s,i])),a.end=Object.assign({},l),r.push(["exit",a,i]),t.add(n+1,0,r)}function h(t,i){const n=t[i],a=n[0]==="enter"?"start":"end";return n[1][a]}exports.gfmTable=x;
|
|
2
2
|
//# sourceMappingURL=syntax.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntax.cjs","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":"sPAwBO,SAASA,GAAW,CACzB,MAAO,CACL,KAAM,CACJ,KAAM,CACJ,KAAM,QACN,SAAUC,EACV,WAAYC,CACpB,CACA,CACA,CACA,CAMA,SAASD,EAAcE,EAASC,EAAIC,EAAK,CACvC,MAAMC,EAAO,KACb,IAAIC,EAAO,EACPC,EAAQ,EAERC,EACJ,OAAOC,EAkBP,SAASA,EAAMC,EAAM,CACnB,IAAIC,EAAQN,EAAK,OAAO,OAAS,EACjC,KAAOM,EAAQ,IAAI,CACjB,MAAMC,EAAOP,EAAK,OAAOM,CAAK,EAAE,CAAC,EAAE,KACnC,GAAIC,IAAS,cAEbA,IAAS,aAAcD,QAAa,MACtC,CACA,MAAME,EAAOF,EAAQ,GAAKN,EAAK,OAAOM,CAAK,EAAE,CAAC,EAAE,KAAO,KACjDG,EAAOD,IAAS,aAAeA,IAAS,WAAaE,EAAeC,EAG1E,OAAIF,IAASC,GAAgBV,EAAK,OAAO,KAAKA,EAAK,MAAM,IAAI,EACpDD,EAAIM,CAAI,EAEVI,EAAKJ,CAAI,CAClB,CAcA,SAASM,EAAcN,EAAM,CAC3B,OAAAR,EAAQ,MAAM,WAAW,E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,QAAU,MAC9C,OAAOA,EAAM,CAAC,EAAEsB,CAAI,CACtB","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"syntax.cjs","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":"sPAwBO,SAASA,GAAW,CACzB,MAAO,CACL,KAAM,CACJ,KAAM,CACJ,KAAM,QACN,SAAUC,EACV,WAAYC,CACpB,CACA,CACA,CACA,CAQA,SAASD,EAAcE,EAASC,EAAIC,EAAK,CACvC,MAAMC,EAAO,KACb,IAAIC,EAAO,EACPC,EAAQ,EAERC,EACJ,OAAOC,EAkBP,SAASA,EAAMC,EAAM,CACnB,IAAIC,EAAQN,EAAK,OAAO,OAAS,EACjC,KAAOM,EAAQ,IAAI,CACjB,KAAM,CACJ,KAAAC,CACR,EAAUP,EAAK,OAAOM,CAAK,EAAE,CAAC,EACxB,GAAIC,IAAS,cAEbA,IAAS,aACPD,QAEA,MAEJ,CACA,MAAME,EAAOF,EAAQ,GAAKN,EAAK,OAAOM,CAAK,EAAE,CAAC,EAAE,KAAO,KACjDG,EAAOD,IAAS,aAAeA,IAAS,WAAaE,EAAeC,EAG1E,OAAIF,IAASC,GAAgBV,EAAK,OAAO,KAA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AAG2D,CAAK,CAC7B,CAYA,SAASV,EAASvB,EAAQ1B,EAAO,CAC/B,MAAMuC,EAAQb,EAAO1B,CAAK,EACpB6D,EAAOtB,EAAM,CAAC,IAAM,QAAU,QAAU,MAC9C,OAAOA,EAAM,CAAC,EAAEsB,CAAI,CACtB","x_google_ignoreList":[0]}
|
|
@@ -20,10 +20,14 @@ function V(t, i, n) {
|
|
|
20
20
|
function D(e) {
|
|
21
21
|
let R = a.events.length - 1;
|
|
22
22
|
for (; R > -1; ) {
|
|
23
|
-
const
|
|
23
|
+
const {
|
|
24
|
+
type: z
|
|
25
|
+
} = a.events[R][1];
|
|
24
26
|
if (z === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
|
|
25
|
-
z === "linePrefix")
|
|
26
|
-
|
|
27
|
+
z === "linePrefix")
|
|
28
|
+
R--;
|
|
29
|
+
else
|
|
30
|
+
break;
|
|
27
31
|
}
|
|
28
32
|
const M = R > -1 ? a.events[R][1].type : null, S = M === "tableHead" || M === "tableRow" ? H : p;
|
|
29
33
|
return S === H && a.parser.lazy[a.now().line] ? n(e) : S(e);
|
|
@@ -47,16 +51,16 @@ function V(t, i, n) {
|
|
|
47
51
|
return a.interrupt = !1, a.parser.lazy[a.now().line] ? n(e) : (t.enter("tableDelimiterRow"), l = !1, g(e) ? v(t, u, "linePrefix", a.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(e) : u(e));
|
|
48
52
|
}
|
|
49
53
|
function u(e) {
|
|
50
|
-
return e === 45 || e === 58 ? A(e) : e === 124 ? (l = !0, t.enter("tableCellDivider"), t.consume(e), t.exit("tableCellDivider"), T) :
|
|
54
|
+
return e === 45 || e === 58 ? A(e) : e === 124 ? (l = !0, t.enter("tableCellDivider"), t.consume(e), t.exit("tableCellDivider"), T) : y(e);
|
|
51
55
|
}
|
|
52
56
|
function T(e) {
|
|
53
57
|
return g(e) ? v(t, A, "whitespace")(e) : A(e);
|
|
54
58
|
}
|
|
55
59
|
function A(e) {
|
|
56
|
-
return e === 58 ? (r += 1, l = !0, t.enter("tableDelimiterMarker"), t.consume(e), t.exit("tableDelimiterMarker"), B) : e === 45 ? (r += 1, B(e)) : e === null || j(e) ? E(e) :
|
|
60
|
+
return e === 58 ? (r += 1, l = !0, t.enter("tableDelimiterMarker"), t.consume(e), t.exit("tableDelimiterMarker"), B) : e === 45 ? (r += 1, B(e)) : e === null || j(e) ? E(e) : y(e);
|
|
57
61
|
}
|
|
58
62
|
function B(e) {
|
|
59
|
-
return e === 45 ? (t.enter("tableDelimiterFiller"), F(e)) :
|
|
63
|
+
return e === 45 ? (t.enter("tableDelimiterFiller"), F(e)) : y(e);
|
|
60
64
|
}
|
|
61
65
|
function F(e) {
|
|
62
66
|
return e === 45 ? (t.consume(e), F) : e === 58 ? (l = !0, t.exit("tableDelimiterFiller"), t.enter("tableDelimiterMarker"), t.consume(e), t.exit("tableDelimiterMarker"), C) : (t.exit("tableDelimiterFiller"), C(e));
|
|
@@ -65,9 +69,9 @@ function V(t, i, n) {
|
|
|
65
69
|
return g(e) ? v(t, E, "whitespace")(e) : E(e);
|
|
66
70
|
}
|
|
67
71
|
function E(e) {
|
|
68
|
-
return e === 124 ? u(e) : e === null || j(e) ? !l || s !== r ?
|
|
72
|
+
return e === 124 ? u(e) : e === null || j(e) ? !l || s !== r ? y(e) : (t.exit("tableDelimiterRow"), t.exit("tableHead"), i(e)) : y(e);
|
|
69
73
|
}
|
|
70
|
-
function
|
|
74
|
+
function y(e) {
|
|
71
75
|
return n(e);
|
|
72
76
|
}
|
|
73
77
|
function H(e) {
|
|
@@ -108,15 +112,15 @@ function _(t, i) {
|
|
|
108
112
|
}
|
|
109
113
|
function k(t, i, n, a, s, r) {
|
|
110
114
|
const l = a === 1 ? "tableHeader" : a === 2 ? "tableDelimiter" : "tableData", D = "tableContent";
|
|
111
|
-
n[0] !== 0 && (r.end = Object.assign({},
|
|
112
|
-
const p =
|
|
115
|
+
n[0] !== 0 && (r.end = Object.assign({}, h(i.events, n[0])), t.add(n[0], 0, [["exit", r, i]]));
|
|
116
|
+
const p = h(i.events, n[1]);
|
|
113
117
|
if (r = {
|
|
114
118
|
type: l,
|
|
115
119
|
start: Object.assign({}, p),
|
|
116
120
|
// Note: correct end is set later.
|
|
117
121
|
end: Object.assign({}, p)
|
|
118
122
|
}, t.add(n[1], 0, [["enter", r, i]]), n[2] !== 0) {
|
|
119
|
-
const f =
|
|
123
|
+
const f = h(i.events, n[2]), d = h(i.events, n[3]), b = {
|
|
120
124
|
type: D,
|
|
121
125
|
start: Object.assign({}, f),
|
|
122
126
|
end: Object.assign({}, d)
|
|
@@ -130,13 +134,13 @@ function k(t, i, n, a, s, r) {
|
|
|
130
134
|
}
|
|
131
135
|
t.add(n[3] + 1, 0, [["exit", b, i]]);
|
|
132
136
|
}
|
|
133
|
-
return s !== void 0 && (r.end = Object.assign({},
|
|
137
|
+
return s !== void 0 && (r.end = Object.assign({}, h(i.events, s)), t.add(s, 0, [["exit", r, i]]), r = void 0), r;
|
|
134
138
|
}
|
|
135
139
|
function x(t, i, n, a, s) {
|
|
136
|
-
const r = [], l =
|
|
140
|
+
const r = [], l = h(i.events, n);
|
|
137
141
|
s && (s.end = Object.assign({}, l), r.push(["exit", s, i])), a.end = Object.assign({}, l), r.push(["exit", a, i]), t.add(n + 1, 0, r);
|
|
138
142
|
}
|
|
139
|
-
function
|
|
143
|
+
function h(t, i) {
|
|
140
144
|
const n = t[i], a = n[0] === "enter" ? "start" : "end";
|
|
141
145
|
return n[1][a];
|
|
142
146
|
}
|