@axdspub/axiom-ui-forms 0.2.8 → 0.2.9
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/library/axiom-ui-forms.d.ts +36 -4
- package/library/esm/_virtual/index10.js +2 -2
- package/library/esm/_virtual/index11.js +2 -2
- package/library/esm/_virtual/index12.js +6 -2
- package/library/esm/_virtual/index12.js.map +1 -1
- package/library/esm/_virtual/index13.js +6 -2
- package/library/esm/_virtual/index13.js.map +1 -1
- package/library/esm/_virtual/index14.js +2 -2
- package/library/esm/_virtual/index15.js +4 -0
- package/library/esm/_virtual/index15.js.map +1 -0
- package/library/esm/_virtual/index16.js +4 -0
- package/library/esm/_virtual/index16.js.map +1 -0
- package/library/esm/_virtual/index17.js +4 -0
- package/library/esm/_virtual/index17.js.map +1 -0
- package/library/esm/_virtual/index6.js +2 -2
- package/library/esm/_virtual/index6.js.map +1 -1
- package/library/esm/_virtual/index7.js +2 -2
- package/library/esm/_virtual/index7.js.map +1 -1
- package/library/esm/_virtual/index8.js +2 -2
- package/library/esm/_virtual/index9.js +2 -2
- package/library/esm/_virtual/utilities.js +4 -0
- package/library/esm/_virtual/utilities.js.map +1 -0
- package/library/esm/node_modules/@axdspub/axiom-ui-utilities/library/index.js +241 -9
- package/library/esm/node_modules/@axdspub/axiom-ui-utilities/library/index.js.map +1 -1
- package/library/esm/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
- package/library/esm/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/library/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/library/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
- package/library/esm/node_modules/@codemirror/autocomplete/dist/index.js +1652 -0
- package/library/esm/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/commands/dist/index.js +1444 -0
- package/library/esm/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/lang-json/dist/index.js +33 -0
- package/library/esm/node_modules/@codemirror/lang-json/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/lang-yaml/dist/index.js +59 -0
- package/library/esm/node_modules/@codemirror/lang-yaml/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/language/dist/index.js +1821 -0
- package/library/esm/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/lint/dist/index.js +589 -0
- package/library/esm/node_modules/@codemirror/lint/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/search/dist/index.js +1227 -0
- package/library/esm/node_modules/@codemirror/search/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/state/dist/index.js +3882 -0
- package/library/esm/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/theme-one-dark/dist/index.js +114 -0
- package/library/esm/node_modules/@codemirror/theme-one-dark/dist/index.js.map +1 -0
- package/library/esm/node_modules/@codemirror/view/dist/index.js +11052 -0
- package/library/esm/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/library/esm/node_modules/@lezer/common/dist/index.js +1704 -0
- package/library/esm/node_modules/@lezer/common/dist/index.js.map +1 -0
- package/library/esm/node_modules/@lezer/highlight/dist/index.js +876 -0
- package/library/esm/node_modules/@lezer/highlight/dist/index.js.map +1 -0
- package/library/esm/node_modules/@lezer/json/dist/index.js +38 -0
- package/library/esm/node_modules/@lezer/json/dist/index.js.map +1 -0
- package/library/esm/node_modules/@lezer/lr/dist/index.js +1855 -0
- package/library/esm/node_modules/@lezer/lr/dist/index.js.map +1 -0
- package/library/esm/node_modules/@lezer/yaml/dist/index.js +392 -0
- package/library/esm/node_modules/@lezer/yaml/dist/index.js.map +1 -0
- package/library/esm/node_modules/@marijn/find-cluster-break/src/index.js +83 -0
- package/library/esm/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
- package/library/esm/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js +67 -1
- package/library/esm/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js.map +1 -1
- package/library/esm/node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js +100 -0
- package/library/esm/node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js.map +1 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js +58 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js.map +1 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/index.js +89 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/index.js.map +1 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/theme/light.js +12 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/theme/light.js.map +1 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js +151 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js.map +1 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/utils.js +19 -0
- package/library/esm/node_modules/@uiw/react-codemirror/esm/utils.js.map +1 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/deserialize.js +77 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/deserialize.js.map +1 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/index.js +25 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/index.js.map +1 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/serialize.js +159 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/serialize.js.map +1 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/types.js +14 -0
- package/library/esm/node_modules/@ungap/structured-clone/esm/types.js.map +1 -0
- package/library/esm/node_modules/ajv/dist/compile/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/library/esm/node_modules/bail/index.js +15 -0
- package/library/esm/node_modules/bail/index.js.map +1 -0
- package/library/esm/node_modules/comma-separated-tokens/index.js +37 -0
- package/library/esm/node_modules/comma-separated-tokens/index.js.map +1 -0
- package/library/esm/node_modules/crelt/index.js +30 -0
- package/library/esm/node_modules/crelt/index.js.map +1 -0
- package/library/esm/node_modules/decode-named-character-reference/index.dom.js +39 -0
- package/library/esm/node_modules/decode-named-character-reference/index.dom.js.map +1 -0
- package/library/esm/node_modules/devlop/lib/default.js +6 -0
- package/library/esm/node_modules/devlop/lib/default.js.map +1 -0
- package/library/esm/node_modules/estree-util-is-identifier-name/lib/index.js +31 -0
- package/library/esm/node_modules/estree-util-is-identifier-name/lib/index.js.map +1 -0
- package/library/esm/node_modules/extend/index.js +127 -0
- package/library/esm/node_modules/extend/index.js.map +1 -0
- package/library/esm/node_modules/fast-uri/index.js +1 -1
- package/library/esm/node_modules/hast-util-to-jsx-runtime/lib/index.js +791 -0
- package/library/esm/node_modules/hast-util-to-jsx-runtime/lib/index.js.map +1 -0
- package/library/esm/node_modules/hast-util-whitespace/lib/index.js +37 -0
- package/library/esm/node_modules/hast-util-whitespace/lib/index.js.map +1 -0
- package/library/esm/node_modules/html-url-attributes/lib/index.js +34 -0
- package/library/esm/node_modules/html-url-attributes/lib/index.js.map +1 -0
- package/library/esm/node_modules/inline-style-parser/index.js +268 -0
- package/library/esm/node_modules/inline-style-parser/index.js.map +1 -0
- package/library/esm/node_modules/js-yaml/dist/js-yaml.js +3850 -0
- package/library/esm/node_modules/js-yaml/dist/js-yaml.js.map +1 -0
- package/library/esm/node_modules/json-schema-traverse/index.js +1 -1
- package/library/esm/node_modules/mdast-util-from-markdown/lib/index.js +1181 -0
- package/library/esm/node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/footer.js +197 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/footer.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/break.js +27 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/break.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/code.js +51 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/code.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/delete.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/delete.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +74 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/heading.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/heading.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/html.js +32 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/html.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +45 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image.js +40 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/index.js +67 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/index.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +36 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +50 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link.js +41 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +126 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list-item.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list.js +57 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/root.js +27 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/root.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/strong.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/strong.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +33 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +70 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-row.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table.js +65 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/text.js +29 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/text.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +31 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/index.js +105 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/index.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/revert.js +56 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/revert.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/state.js +322 -0
- package/library/esm/node_modules/mdast-util-to-hast/lib/state.js.map +1 -0
- package/library/esm/node_modules/mdast-util-to-string/lib/index.js +111 -0
- package/library/esm/node_modules/mdast-util-to-string/lib/index.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/constructs.js +108 -0
- package/library/esm/node_modules/micromark/lib/constructs.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/create-tokenizer.js +576 -0
- package/library/esm/node_modules/micromark/lib/create-tokenizer.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/initialize/content.js +83 -0
- package/library/esm/node_modules/micromark/lib/initialize/content.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/initialize/document.js +361 -0
- package/library/esm/node_modules/micromark/lib/initialize/document.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/initialize/flow.js +62 -0
- package/library/esm/node_modules/micromark/lib/initialize/flow.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/initialize/text.js +213 -0
- package/library/esm/node_modules/micromark/lib/initialize/text.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/parse.js +60 -0
- package/library/esm/node_modules/micromark/lib/parse.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/postprocess.js +22 -0
- package/library/esm/node_modules/micromark/lib/postprocess.js.map +1 -0
- package/library/esm/node_modules/micromark/lib/preprocess.js +118 -0
- package/library/esm/node_modules/micromark/lib/preprocess.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/attention.js +245 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/autolink.js +237 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/blank-line.js +65 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/block-quote.js +147 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/character-escape.js +68 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/character-reference.js +153 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/code-fenced.js +464 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/code-indented.js +181 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/code-text.js +228 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/content.js +167 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/definition.js +258 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +64 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/heading-atx.js +199 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/html-flow.js +880 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/html-text.js +682 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/label-end.js +564 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-image.js +106 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-link.js +59 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/line-ending.js +36 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/list.js +217 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/setext-underline.js +189 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/thematic-break.js +106 -0
- package/library/esm/node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
- package/library/esm/node_modules/micromark-factory-destination/index.js +210 -0
- package/library/esm/node_modules/micromark-factory-destination/index.js.map +1 -0
- package/library/esm/node_modules/micromark-factory-label/index.js +152 -0
- package/library/esm/node_modules/micromark-factory-label/index.js.map +1 -0
- package/library/esm/node_modules/micromark-factory-space/index.js +68 -0
- package/library/esm/node_modules/micromark-factory-space/index.js.map +1 -0
- package/library/esm/node_modules/micromark-factory-title/index.js +162 -0
- package/library/esm/node_modules/micromark-factory-title/index.js.map +1 -0
- package/library/esm/node_modules/micromark-factory-whitespace/index.js +48 -0
- package/library/esm/node_modules/micromark-factory-whitespace/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-character/index.js +249 -0
- package/library/esm/node_modules/micromark-util-character/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-chunked/index.js +84 -0
- package/library/esm/node_modules/micromark-util-chunked/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-classify-character/index.js +31 -0
- package/library/esm/node_modules/micromark-util-classify-character/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-combine-extensions/index.js +96 -0
- package/library/esm/node_modules/micromark-util-combine-extensions/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-decode-numeric-character-reference/index.js +35 -0
- package/library/esm/node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-decode-string/index.js +49 -0
- package/library/esm/node_modules/micromark-util-decode-string/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-html-tag-name/index.js +96 -0
- package/library/esm/node_modules/micromark-util-html-tag-name/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-normalize-identifier/index.js +36 -0
- package/library/esm/node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-resolve-all/index.js +35 -0
- package/library/esm/node_modules/micromark-util-resolve-all/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-sanitize-uri/index.js +67 -0
- package/library/esm/node_modules/micromark-util-sanitize-uri/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-subtokenize/index.js +227 -0
- package/library/esm/node_modules/micromark-util-subtokenize/index.js.map +1 -0
- package/library/esm/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +254 -0
- package/library/esm/node_modules/micromark-util-subtokenize/lib/splice-buffer.js.map +1 -0
- package/library/esm/node_modules/property-information/index.js +16 -0
- package/library/esm/node_modules/property-information/index.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/aria.js +64 -0
- package/library/esm/node_modules/property-information/lib/aria.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/find.js +101 -0
- package/library/esm/node_modules/property-information/lib/find.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/hast-to-react.js +33 -0
- package/library/esm/node_modules/property-information/lib/hast-to-react.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/html.js +318 -0
- package/library/esm/node_modules/property-information/lib/html.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/normalize.js +15 -0
- package/library/esm/node_modules/property-information/lib/normalize.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/svg.js +564 -0
- package/library/esm/node_modules/property-information/lib/svg.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/case-insensitive-transform.js +16 -0
- package/library/esm/node_modules/property-information/lib/util/case-insensitive-transform.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
- package/library/esm/node_modules/property-information/lib/util/case-sensitive-transform.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/create.js +47 -0
- package/library/esm/node_modules/property-information/lib/util/create.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/defined-info.js +64 -0
- package/library/esm/node_modules/property-information/lib/util/defined-info.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/info.js +35 -0
- package/library/esm/node_modules/property-information/lib/util/info.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/merge.js +31 -0
- package/library/esm/node_modules/property-information/lib/util/merge.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/schema.js +32 -0
- package/library/esm/node_modules/property-information/lib/util/schema.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/util/types.js +16 -0
- package/library/esm/node_modules/property-information/lib/util/types.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/xlink.js +20 -0
- package/library/esm/node_modules/property-information/lib/xlink.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/xml.js +12 -0
- package/library/esm/node_modules/property-information/lib/xml.js.map +1 -0
- package/library/esm/node_modules/property-information/lib/xmlns.js +12 -0
- package/library/esm/node_modules/property-information/lib/xmlns.js.map +1 -0
- package/library/esm/node_modules/react-markdown/lib/index.js +267 -0
- package/library/esm/node_modules/react-markdown/lib/index.js.map +1 -0
- package/library/esm/node_modules/react-router/dist/development/chunk-HA7DTUK3.js +1 -1
- package/library/esm/node_modules/react-router/node_modules/cookie/dist/index.js +1 -1
- package/library/esm/node_modules/remark-parse/lib/index.js +43 -0
- package/library/esm/node_modules/remark-parse/lib/index.js.map +1 -0
- package/library/esm/node_modules/remark-rehype/lib/index.js +132 -0
- package/library/esm/node_modules/remark-rehype/lib/index.js.map +1 -0
- package/library/esm/node_modules/space-separated-tokens/index.js +23 -0
- package/library/esm/node_modules/space-separated-tokens/index.js.map +1 -0
- package/library/esm/node_modules/style-mod/src/style-mod.js +175 -0
- package/library/esm/node_modules/style-mod/src/style-mod.js.map +1 -0
- package/library/esm/node_modules/style-to-js/cjs/index.js +38 -0
- package/library/esm/node_modules/style-to-js/cjs/index.js.map +1 -0
- package/library/esm/node_modules/style-to-js/cjs/utilities.js +58 -0
- package/library/esm/node_modules/style-to-js/cjs/utilities.js.map +1 -0
- package/library/esm/node_modules/style-to-object/cjs/index.js +56 -0
- package/library/esm/node_modules/style-to-object/cjs/index.js.map +1 -0
- package/library/esm/node_modules/trim-lines/index.js +72 -0
- package/library/esm/node_modules/trim-lines/index.js.map +1 -0
- package/library/esm/node_modules/trough/lib/index.js +209 -0
- package/library/esm/node_modules/trough/lib/index.js.map +1 -0
- package/library/esm/node_modules/unified/lib/callable-instance.js +47 -0
- package/library/esm/node_modules/unified/lib/callable-instance.js.map +1 -0
- package/library/esm/node_modules/unified/lib/index.js +979 -0
- package/library/esm/node_modules/unified/lib/index.js.map +1 -0
- package/library/esm/node_modules/unified/node_modules/is-plain-obj/index.js +11 -0
- package/library/esm/node_modules/unified/node_modules/is-plain-obj/index.js.map +1 -0
- package/library/esm/node_modules/unist-util-is/lib/index.js +179 -0
- package/library/esm/node_modules/unist-util-is/lib/index.js.map +1 -0
- package/library/esm/node_modules/unist-util-position/lib/index.js +98 -0
- package/library/esm/node_modules/unist-util-position/lib/index.js.map +1 -0
- package/library/esm/node_modules/unist-util-stringify-position/lib/index.js +87 -0
- package/library/esm/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
- package/library/esm/node_modules/unist-util-visit/lib/index.js +95 -0
- package/library/esm/node_modules/unist-util-visit/lib/index.js.map +1 -0
- package/library/esm/node_modules/unist-util-visit-parents/lib/color.js +10 -0
- package/library/esm/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/library/esm/node_modules/unist-util-visit-parents/lib/index.js +188 -0
- package/library/esm/node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
- package/library/esm/node_modules/vfile/lib/index.js +644 -0
- package/library/esm/node_modules/vfile/lib/index.js.map +1 -0
- package/library/esm/node_modules/vfile/lib/minpath.browser.js +427 -0
- package/library/esm/node_modules/vfile/lib/minpath.browser.js.map +1 -0
- package/library/esm/node_modules/vfile/lib/minproc.browser.js +11 -0
- package/library/esm/node_modules/vfile/lib/minproc.browser.js.map +1 -0
- package/library/esm/node_modules/vfile/lib/minurl.browser.js +77 -0
- package/library/esm/node_modules/vfile/lib/minurl.browser.js.map +1 -0
- package/library/esm/node_modules/vfile/lib/minurl.shared.js +34 -0
- package/library/esm/node_modules/vfile/lib/minurl.shared.js.map +1 -0
- package/library/esm/node_modules/vfile-message/lib/index.js +305 -0
- package/library/esm/node_modules/vfile-message/lib/index.js.map +1 -0
- package/library/esm/node_modules/w3c-keyname/index.js +122 -0
- package/library/esm/node_modules/w3c-keyname/index.js.map +1 -0
- package/library/esm/src/Form/Components/FieldLabel.js +13 -3
- package/library/esm/src/Form/Components/FieldLabel.js.map +1 -1
- package/library/esm/src/Form/Components/InlineMarkdown.js +15 -0
- package/library/esm/src/Form/Components/InlineMarkdown.js.map +1 -0
- package/library/esm/src/Form/Components/Inputs/Boolean.js +5 -2
- package/library/esm/src/Form/Components/Inputs/Boolean.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/GeoJSONInputLoader.js +1 -1
- package/library/esm/src/Form/Components/Inputs/Geometry.js +290 -329
- package/library/esm/src/Form/Components/Inputs/Geometry.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/JSON.js +132 -0
- package/library/esm/src/Form/Components/Inputs/JSON.js.map +1 -0
- package/library/esm/src/Form/Components/Inputs/JSONInputLoader.js +19 -0
- package/library/esm/src/Form/Components/Inputs/JSONInputLoader.js.map +1 -0
- package/library/esm/src/Form/Components/Inputs/Number.js +78 -8
- package/library/esm/src/Form/Components/Inputs/Number.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/inputMap.js +2 -2
- package/library/esm/src/Form/Components/Inputs/inputMap.js.map +1 -1
- package/library/esm/src/Form/Creator/FormCreator.js +6 -2
- package/library/esm/src/Form/Creator/FormCreator.js.map +1 -1
- package/library/esm/src/Form/Creator/FormHeader.js +7 -5
- package/library/esm/src/Form/Creator/FormHeader.js.map +1 -1
- package/library/esm/src/Form/Creator/Page.js +4 -3
- package/library/esm/src/Form/Creator/Page.js.map +1 -1
- package/library/esm/src/Form/Manage/CopyableJSONOutput.js +41 -0
- package/library/esm/src/Form/Manage/CopyableJSONOutput.js.map +1 -0
- package/library/esm/src/Form/helpers.js +1 -1
- package/library/esm/src/Form/helpers.js.map +1 -1
- package/library/esm/src/Form/schemaToFormHelpers.js +87 -1
- package/library/esm/src/Form/schemaToFormHelpers.js.map +1 -1
- package/library/esm/src/library.js +1 -1
- package/package.json +7 -1
- package/library/esm/src/Form/Components/Inputs/JSONString.js +0 -34
- package/library/esm/src/Form/Components/Inputs/JSONString.js.map +0 -1
@@ -0,0 +1,1181 @@
|
|
1
|
+
import { decodeNumericCharacterReference } from '../../micromark-util-decode-numeric-character-reference/index.js';
|
2
|
+
import { decodeString } from '../../micromark-util-decode-string/index.js';
|
3
|
+
import { normalizeIdentifier } from '../../micromark-util-normalize-identifier/index.js';
|
4
|
+
import { decodeNamedCharacterReference } from '../../decode-named-character-reference/index.dom.js';
|
5
|
+
import { postprocess } from '../../micromark/lib/postprocess.js';
|
6
|
+
import { parse } from '../../micromark/lib/parse.js';
|
7
|
+
import { preprocess } from '../../micromark/lib/preprocess.js';
|
8
|
+
import { stringifyPosition } from '../../unist-util-stringify-position/lib/index.js';
|
9
|
+
import { toString } from '../../mdast-util-to-string/lib/index.js';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @import {
|
13
|
+
* Break,
|
14
|
+
* Blockquote,
|
15
|
+
* Code,
|
16
|
+
* Definition,
|
17
|
+
* Emphasis,
|
18
|
+
* Heading,
|
19
|
+
* Html,
|
20
|
+
* Image,
|
21
|
+
* InlineCode,
|
22
|
+
* Link,
|
23
|
+
* ListItem,
|
24
|
+
* List,
|
25
|
+
* Nodes,
|
26
|
+
* Paragraph,
|
27
|
+
* PhrasingContent,
|
28
|
+
* ReferenceType,
|
29
|
+
* Root,
|
30
|
+
* Strong,
|
31
|
+
* Text,
|
32
|
+
* ThematicBreak
|
33
|
+
* } from 'mdast'
|
34
|
+
* @import {
|
35
|
+
* Encoding,
|
36
|
+
* Event,
|
37
|
+
* Token,
|
38
|
+
* Value
|
39
|
+
* } from 'micromark-util-types'
|
40
|
+
* @import {Point} from 'unist'
|
41
|
+
* @import {
|
42
|
+
* CompileContext,
|
43
|
+
* CompileData,
|
44
|
+
* Config,
|
45
|
+
* Extension,
|
46
|
+
* Handle,
|
47
|
+
* OnEnterError,
|
48
|
+
* Options
|
49
|
+
* } from './types.js'
|
50
|
+
*/
|
51
|
+
|
52
|
+
const own = {}.hasOwnProperty;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Turn markdown into a syntax tree.
|
56
|
+
*
|
57
|
+
* @overload
|
58
|
+
* @param {Value} value
|
59
|
+
* @param {Encoding | null | undefined} [encoding]
|
60
|
+
* @param {Options | null | undefined} [options]
|
61
|
+
* @returns {Root}
|
62
|
+
*
|
63
|
+
* @overload
|
64
|
+
* @param {Value} value
|
65
|
+
* @param {Options | null | undefined} [options]
|
66
|
+
* @returns {Root}
|
67
|
+
*
|
68
|
+
* @param {Value} value
|
69
|
+
* Markdown to parse.
|
70
|
+
* @param {Encoding | Options | null | undefined} [encoding]
|
71
|
+
* Character encoding for when `value` is `Buffer`.
|
72
|
+
* @param {Options | null | undefined} [options]
|
73
|
+
* Configuration.
|
74
|
+
* @returns {Root}
|
75
|
+
* mdast tree.
|
76
|
+
*/
|
77
|
+
function fromMarkdown(value, encoding, options) {
|
78
|
+
if (typeof encoding !== 'string') {
|
79
|
+
options = encoding;
|
80
|
+
encoding = undefined;
|
81
|
+
}
|
82
|
+
return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));
|
83
|
+
}
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Note this compiler only understand complete buffering, not streaming.
|
87
|
+
*
|
88
|
+
* @param {Options | null | undefined} [options]
|
89
|
+
*/
|
90
|
+
function compiler(options) {
|
91
|
+
/** @type {Config} */
|
92
|
+
const config = {
|
93
|
+
transforms: [],
|
94
|
+
canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],
|
95
|
+
enter: {
|
96
|
+
autolink: opener(link),
|
97
|
+
autolinkProtocol: onenterdata,
|
98
|
+
autolinkEmail: onenterdata,
|
99
|
+
atxHeading: opener(heading),
|
100
|
+
blockQuote: opener(blockQuote),
|
101
|
+
characterEscape: onenterdata,
|
102
|
+
characterReference: onenterdata,
|
103
|
+
codeFenced: opener(codeFlow),
|
104
|
+
codeFencedFenceInfo: buffer,
|
105
|
+
codeFencedFenceMeta: buffer,
|
106
|
+
codeIndented: opener(codeFlow, buffer),
|
107
|
+
codeText: opener(codeText, buffer),
|
108
|
+
codeTextData: onenterdata,
|
109
|
+
data: onenterdata,
|
110
|
+
codeFlowValue: onenterdata,
|
111
|
+
definition: opener(definition),
|
112
|
+
definitionDestinationString: buffer,
|
113
|
+
definitionLabelString: buffer,
|
114
|
+
definitionTitleString: buffer,
|
115
|
+
emphasis: opener(emphasis),
|
116
|
+
hardBreakEscape: opener(hardBreak),
|
117
|
+
hardBreakTrailing: opener(hardBreak),
|
118
|
+
htmlFlow: opener(html, buffer),
|
119
|
+
htmlFlowData: onenterdata,
|
120
|
+
htmlText: opener(html, buffer),
|
121
|
+
htmlTextData: onenterdata,
|
122
|
+
image: opener(image),
|
123
|
+
label: buffer,
|
124
|
+
link: opener(link),
|
125
|
+
listItem: opener(listItem),
|
126
|
+
listItemValue: onenterlistitemvalue,
|
127
|
+
listOrdered: opener(list, onenterlistordered),
|
128
|
+
listUnordered: opener(list),
|
129
|
+
paragraph: opener(paragraph),
|
130
|
+
reference: onenterreference,
|
131
|
+
referenceString: buffer,
|
132
|
+
resourceDestinationString: buffer,
|
133
|
+
resourceTitleString: buffer,
|
134
|
+
setextHeading: opener(heading),
|
135
|
+
strong: opener(strong),
|
136
|
+
thematicBreak: opener(thematicBreak)
|
137
|
+
},
|
138
|
+
exit: {
|
139
|
+
atxHeading: closer(),
|
140
|
+
atxHeadingSequence: onexitatxheadingsequence,
|
141
|
+
autolink: closer(),
|
142
|
+
autolinkEmail: onexitautolinkemail,
|
143
|
+
autolinkProtocol: onexitautolinkprotocol,
|
144
|
+
blockQuote: closer(),
|
145
|
+
characterEscapeValue: onexitdata,
|
146
|
+
characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
|
147
|
+
characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
|
148
|
+
characterReferenceValue: onexitcharacterreferencevalue,
|
149
|
+
characterReference: onexitcharacterreference,
|
150
|
+
codeFenced: closer(onexitcodefenced),
|
151
|
+
codeFencedFence: onexitcodefencedfence,
|
152
|
+
codeFencedFenceInfo: onexitcodefencedfenceinfo,
|
153
|
+
codeFencedFenceMeta: onexitcodefencedfencemeta,
|
154
|
+
codeFlowValue: onexitdata,
|
155
|
+
codeIndented: closer(onexitcodeindented),
|
156
|
+
codeText: closer(onexitcodetext),
|
157
|
+
codeTextData: onexitdata,
|
158
|
+
data: onexitdata,
|
159
|
+
definition: closer(),
|
160
|
+
definitionDestinationString: onexitdefinitiondestinationstring,
|
161
|
+
definitionLabelString: onexitdefinitionlabelstring,
|
162
|
+
definitionTitleString: onexitdefinitiontitlestring,
|
163
|
+
emphasis: closer(),
|
164
|
+
hardBreakEscape: closer(onexithardbreak),
|
165
|
+
hardBreakTrailing: closer(onexithardbreak),
|
166
|
+
htmlFlow: closer(onexithtmlflow),
|
167
|
+
htmlFlowData: onexitdata,
|
168
|
+
htmlText: closer(onexithtmltext),
|
169
|
+
htmlTextData: onexitdata,
|
170
|
+
image: closer(onexitimage),
|
171
|
+
label: onexitlabel,
|
172
|
+
labelText: onexitlabeltext,
|
173
|
+
lineEnding: onexitlineending,
|
174
|
+
link: closer(onexitlink),
|
175
|
+
listItem: closer(),
|
176
|
+
listOrdered: closer(),
|
177
|
+
listUnordered: closer(),
|
178
|
+
paragraph: closer(),
|
179
|
+
referenceString: onexitreferencestring,
|
180
|
+
resourceDestinationString: onexitresourcedestinationstring,
|
181
|
+
resourceTitleString: onexitresourcetitlestring,
|
182
|
+
resource: onexitresource,
|
183
|
+
setextHeading: closer(onexitsetextheading),
|
184
|
+
setextHeadingLineSequence: onexitsetextheadinglinesequence,
|
185
|
+
setextHeadingText: onexitsetextheadingtext,
|
186
|
+
strong: closer(),
|
187
|
+
thematicBreak: closer()
|
188
|
+
}
|
189
|
+
};
|
190
|
+
configure(config, (options || {}).mdastExtensions || []);
|
191
|
+
|
192
|
+
/** @type {CompileData} */
|
193
|
+
const data = {};
|
194
|
+
return compile;
|
195
|
+
|
196
|
+
/**
|
197
|
+
* Turn micromark events into an mdast tree.
|
198
|
+
*
|
199
|
+
* @param {Array<Event>} events
|
200
|
+
* Events.
|
201
|
+
* @returns {Root}
|
202
|
+
* mdast tree.
|
203
|
+
*/
|
204
|
+
function compile(events) {
|
205
|
+
/** @type {Root} */
|
206
|
+
let tree = {
|
207
|
+
type: 'root',
|
208
|
+
children: []
|
209
|
+
};
|
210
|
+
/** @type {Omit<CompileContext, 'sliceSerialize'>} */
|
211
|
+
const context = {
|
212
|
+
stack: [tree],
|
213
|
+
tokenStack: [],
|
214
|
+
config,
|
215
|
+
enter,
|
216
|
+
exit,
|
217
|
+
buffer,
|
218
|
+
resume,
|
219
|
+
data
|
220
|
+
};
|
221
|
+
/** @type {Array<number>} */
|
222
|
+
const listStack = [];
|
223
|
+
let index = -1;
|
224
|
+
while (++index < events.length) {
|
225
|
+
// We preprocess lists to add `listItem` tokens, and to infer whether
|
226
|
+
// items the list itself are spread out.
|
227
|
+
if (events[index][1].type === "listOrdered" || events[index][1].type === "listUnordered") {
|
228
|
+
if (events[index][0] === 'enter') {
|
229
|
+
listStack.push(index);
|
230
|
+
} else {
|
231
|
+
const tail = listStack.pop();
|
232
|
+
index = prepareList(events, tail, index);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
index = -1;
|
237
|
+
while (++index < events.length) {
|
238
|
+
const handler = config[events[index][0]];
|
239
|
+
if (own.call(handler, events[index][1].type)) {
|
240
|
+
handler[events[index][1].type].call(Object.assign({
|
241
|
+
sliceSerialize: events[index][2].sliceSerialize
|
242
|
+
}, context), events[index][1]);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
// Handle tokens still being open.
|
247
|
+
if (context.tokenStack.length > 0) {
|
248
|
+
const tail = context.tokenStack[context.tokenStack.length - 1];
|
249
|
+
const handler = tail[1] || defaultOnError;
|
250
|
+
handler.call(context, undefined, tail[0]);
|
251
|
+
}
|
252
|
+
|
253
|
+
// Figure out `root` position.
|
254
|
+
tree.position = {
|
255
|
+
start: point(events.length > 0 ? events[0][1].start : {
|
256
|
+
line: 1,
|
257
|
+
column: 1,
|
258
|
+
offset: 0
|
259
|
+
}),
|
260
|
+
end: point(events.length > 0 ? events[events.length - 2][1].end : {
|
261
|
+
line: 1,
|
262
|
+
column: 1,
|
263
|
+
offset: 0
|
264
|
+
})
|
265
|
+
};
|
266
|
+
|
267
|
+
// Call transforms.
|
268
|
+
index = -1;
|
269
|
+
while (++index < config.transforms.length) {
|
270
|
+
tree = config.transforms[index](tree) || tree;
|
271
|
+
}
|
272
|
+
return tree;
|
273
|
+
}
|
274
|
+
|
275
|
+
/**
|
276
|
+
* @param {Array<Event>} events
|
277
|
+
* @param {number} start
|
278
|
+
* @param {number} length
|
279
|
+
* @returns {number}
|
280
|
+
*/
|
281
|
+
function prepareList(events, start, length) {
|
282
|
+
let index = start - 1;
|
283
|
+
let containerBalance = -1;
|
284
|
+
let listSpread = false;
|
285
|
+
/** @type {Token | undefined} */
|
286
|
+
let listItem;
|
287
|
+
/** @type {number | undefined} */
|
288
|
+
let lineIndex;
|
289
|
+
/** @type {number | undefined} */
|
290
|
+
let firstBlankLineIndex;
|
291
|
+
/** @type {boolean | undefined} */
|
292
|
+
let atMarker;
|
293
|
+
while (++index <= length) {
|
294
|
+
const event = events[index];
|
295
|
+
switch (event[1].type) {
|
296
|
+
case "listUnordered":
|
297
|
+
case "listOrdered":
|
298
|
+
case "blockQuote":
|
299
|
+
{
|
300
|
+
if (event[0] === 'enter') {
|
301
|
+
containerBalance++;
|
302
|
+
} else {
|
303
|
+
containerBalance--;
|
304
|
+
}
|
305
|
+
atMarker = undefined;
|
306
|
+
break;
|
307
|
+
}
|
308
|
+
case "lineEndingBlank":
|
309
|
+
{
|
310
|
+
if (event[0] === 'enter') {
|
311
|
+
if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {
|
312
|
+
firstBlankLineIndex = index;
|
313
|
+
}
|
314
|
+
atMarker = undefined;
|
315
|
+
}
|
316
|
+
break;
|
317
|
+
}
|
318
|
+
case "linePrefix":
|
319
|
+
case "listItemValue":
|
320
|
+
case "listItemMarker":
|
321
|
+
case "listItemPrefix":
|
322
|
+
case "listItemPrefixWhitespace":
|
323
|
+
{
|
324
|
+
// Empty.
|
325
|
+
|
326
|
+
break;
|
327
|
+
}
|
328
|
+
default:
|
329
|
+
{
|
330
|
+
atMarker = undefined;
|
331
|
+
}
|
332
|
+
}
|
333
|
+
if (!containerBalance && event[0] === 'enter' && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) {
|
334
|
+
if (listItem) {
|
335
|
+
let tailIndex = index;
|
336
|
+
lineIndex = undefined;
|
337
|
+
while (tailIndex--) {
|
338
|
+
const tailEvent = events[tailIndex];
|
339
|
+
if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") {
|
340
|
+
if (tailEvent[0] === 'exit') continue;
|
341
|
+
if (lineIndex) {
|
342
|
+
events[lineIndex][1].type = "lineEndingBlank";
|
343
|
+
listSpread = true;
|
344
|
+
}
|
345
|
+
tailEvent[1].type = "lineEnding";
|
346
|
+
lineIndex = tailIndex;
|
347
|
+
} else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") ; else {
|
348
|
+
break;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {
|
352
|
+
listItem._spread = true;
|
353
|
+
}
|
354
|
+
|
355
|
+
// Fix position.
|
356
|
+
listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);
|
357
|
+
events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]);
|
358
|
+
index++;
|
359
|
+
length++;
|
360
|
+
}
|
361
|
+
|
362
|
+
// Create a new list item.
|
363
|
+
if (event[1].type === "listItemPrefix") {
|
364
|
+
/** @type {Token} */
|
365
|
+
const item = {
|
366
|
+
type: 'listItem',
|
367
|
+
_spread: false,
|
368
|
+
start: Object.assign({}, event[1].start),
|
369
|
+
// @ts-expect-error: we’ll add `end` in a second.
|
370
|
+
end: undefined
|
371
|
+
};
|
372
|
+
listItem = item;
|
373
|
+
events.splice(index, 0, ['enter', item, event[2]]);
|
374
|
+
index++;
|
375
|
+
length++;
|
376
|
+
firstBlankLineIndex = undefined;
|
377
|
+
atMarker = true;
|
378
|
+
}
|
379
|
+
}
|
380
|
+
}
|
381
|
+
events[start][1]._spread = listSpread;
|
382
|
+
return length;
|
383
|
+
}
|
384
|
+
|
385
|
+
/**
|
386
|
+
* Create an opener handle.
|
387
|
+
*
|
388
|
+
* @param {(token: Token) => Nodes} create
|
389
|
+
* Create a node.
|
390
|
+
* @param {Handle | undefined} [and]
|
391
|
+
* Optional function to also run.
|
392
|
+
* @returns {Handle}
|
393
|
+
* Handle.
|
394
|
+
*/
|
395
|
+
function opener(create, and) {
|
396
|
+
return open;
|
397
|
+
|
398
|
+
/**
|
399
|
+
* @this {CompileContext}
|
400
|
+
* @param {Token} token
|
401
|
+
* @returns {undefined}
|
402
|
+
*/
|
403
|
+
function open(token) {
|
404
|
+
enter.call(this, create(token), token);
|
405
|
+
if (and) and.call(this, token);
|
406
|
+
}
|
407
|
+
}
|
408
|
+
|
409
|
+
/**
|
410
|
+
* @type {CompileContext['buffer']}
|
411
|
+
*/
|
412
|
+
function buffer() {
|
413
|
+
this.stack.push({
|
414
|
+
type: 'fragment',
|
415
|
+
children: []
|
416
|
+
});
|
417
|
+
}
|
418
|
+
|
419
|
+
/**
|
420
|
+
* @type {CompileContext['enter']}
|
421
|
+
*/
|
422
|
+
function enter(node, token, errorHandler) {
|
423
|
+
const parent = this.stack[this.stack.length - 1];
|
424
|
+
/** @type {Array<Nodes>} */
|
425
|
+
const siblings = parent.children;
|
426
|
+
siblings.push(node);
|
427
|
+
this.stack.push(node);
|
428
|
+
this.tokenStack.push([token, errorHandler || undefined]);
|
429
|
+
node.position = {
|
430
|
+
start: point(token.start),
|
431
|
+
// @ts-expect-error: `end` will be patched later.
|
432
|
+
end: undefined
|
433
|
+
};
|
434
|
+
}
|
435
|
+
|
436
|
+
/**
|
437
|
+
* Create a closer handle.
|
438
|
+
*
|
439
|
+
* @param {Handle | undefined} [and]
|
440
|
+
* Optional function to also run.
|
441
|
+
* @returns {Handle}
|
442
|
+
* Handle.
|
443
|
+
*/
|
444
|
+
function closer(and) {
|
445
|
+
return close;
|
446
|
+
|
447
|
+
/**
|
448
|
+
* @this {CompileContext}
|
449
|
+
* @param {Token} token
|
450
|
+
* @returns {undefined}
|
451
|
+
*/
|
452
|
+
function close(token) {
|
453
|
+
if (and) and.call(this, token);
|
454
|
+
exit.call(this, token);
|
455
|
+
}
|
456
|
+
}
|
457
|
+
|
458
|
+
/**
|
459
|
+
* @type {CompileContext['exit']}
|
460
|
+
*/
|
461
|
+
function exit(token, onExitError) {
|
462
|
+
const node = this.stack.pop();
|
463
|
+
const open = this.tokenStack.pop();
|
464
|
+
if (!open) {
|
465
|
+
throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({
|
466
|
+
start: token.start,
|
467
|
+
end: token.end
|
468
|
+
}) + '): it’s not open');
|
469
|
+
} else if (open[0].type !== token.type) {
|
470
|
+
if (onExitError) {
|
471
|
+
onExitError.call(this, token, open[0]);
|
472
|
+
} else {
|
473
|
+
const handler = open[1] || defaultOnError;
|
474
|
+
handler.call(this, token, open[0]);
|
475
|
+
}
|
476
|
+
}
|
477
|
+
node.position.end = point(token.end);
|
478
|
+
}
|
479
|
+
|
480
|
+
/**
|
481
|
+
* @type {CompileContext['resume']}
|
482
|
+
*/
|
483
|
+
function resume() {
|
484
|
+
return toString(this.stack.pop());
|
485
|
+
}
|
486
|
+
|
487
|
+
//
|
488
|
+
// Handlers.
|
489
|
+
//
|
490
|
+
|
491
|
+
/**
|
492
|
+
* @this {CompileContext}
|
493
|
+
* @type {Handle}
|
494
|
+
*/
|
495
|
+
function onenterlistordered() {
|
496
|
+
this.data.expectingFirstListItemValue = true;
|
497
|
+
}
|
498
|
+
|
499
|
+
/**
|
500
|
+
* @this {CompileContext}
|
501
|
+
* @type {Handle}
|
502
|
+
*/
|
503
|
+
function onenterlistitemvalue(token) {
|
504
|
+
if (this.data.expectingFirstListItemValue) {
|
505
|
+
const ancestor = this.stack[this.stack.length - 2];
|
506
|
+
ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);
|
507
|
+
this.data.expectingFirstListItemValue = undefined;
|
508
|
+
}
|
509
|
+
}
|
510
|
+
|
511
|
+
/**
|
512
|
+
* @this {CompileContext}
|
513
|
+
* @type {Handle}
|
514
|
+
*/
|
515
|
+
function onexitcodefencedfenceinfo() {
|
516
|
+
const data = this.resume();
|
517
|
+
const node = this.stack[this.stack.length - 1];
|
518
|
+
node.lang = data;
|
519
|
+
}
|
520
|
+
|
521
|
+
/**
|
522
|
+
* @this {CompileContext}
|
523
|
+
* @type {Handle}
|
524
|
+
*/
|
525
|
+
function onexitcodefencedfencemeta() {
|
526
|
+
const data = this.resume();
|
527
|
+
const node = this.stack[this.stack.length - 1];
|
528
|
+
node.meta = data;
|
529
|
+
}
|
530
|
+
|
531
|
+
/**
|
532
|
+
* @this {CompileContext}
|
533
|
+
* @type {Handle}
|
534
|
+
*/
|
535
|
+
function onexitcodefencedfence() {
|
536
|
+
// Exit if this is the closing fence.
|
537
|
+
if (this.data.flowCodeInside) return;
|
538
|
+
this.buffer();
|
539
|
+
this.data.flowCodeInside = true;
|
540
|
+
}
|
541
|
+
|
542
|
+
/**
|
543
|
+
* @this {CompileContext}
|
544
|
+
* @type {Handle}
|
545
|
+
*/
|
546
|
+
function onexitcodefenced() {
|
547
|
+
const data = this.resume();
|
548
|
+
const node = this.stack[this.stack.length - 1];
|
549
|
+
node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '');
|
550
|
+
this.data.flowCodeInside = undefined;
|
551
|
+
}
|
552
|
+
|
553
|
+
/**
|
554
|
+
* @this {CompileContext}
|
555
|
+
* @type {Handle}
|
556
|
+
*/
|
557
|
+
function onexitcodeindented() {
|
558
|
+
const data = this.resume();
|
559
|
+
const node = this.stack[this.stack.length - 1];
|
560
|
+
node.value = data.replace(/(\r?\n|\r)$/g, '');
|
561
|
+
}
|
562
|
+
|
563
|
+
/**
|
564
|
+
* @this {CompileContext}
|
565
|
+
* @type {Handle}
|
566
|
+
*/
|
567
|
+
function onexitdefinitionlabelstring(token) {
|
568
|
+
const label = this.resume();
|
569
|
+
const node = this.stack[this.stack.length - 1];
|
570
|
+
node.label = label;
|
571
|
+
node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
|
572
|
+
}
|
573
|
+
|
574
|
+
/**
|
575
|
+
* @this {CompileContext}
|
576
|
+
* @type {Handle}
|
577
|
+
*/
|
578
|
+
function onexitdefinitiontitlestring() {
|
579
|
+
const data = this.resume();
|
580
|
+
const node = this.stack[this.stack.length - 1];
|
581
|
+
node.title = data;
|
582
|
+
}
|
583
|
+
|
584
|
+
/**
|
585
|
+
* @this {CompileContext}
|
586
|
+
* @type {Handle}
|
587
|
+
*/
|
588
|
+
function onexitdefinitiondestinationstring() {
|
589
|
+
const data = this.resume();
|
590
|
+
const node = this.stack[this.stack.length - 1];
|
591
|
+
node.url = data;
|
592
|
+
}
|
593
|
+
|
594
|
+
/**
|
595
|
+
* @this {CompileContext}
|
596
|
+
* @type {Handle}
|
597
|
+
*/
|
598
|
+
function onexitatxheadingsequence(token) {
|
599
|
+
const node = this.stack[this.stack.length - 1];
|
600
|
+
if (!node.depth) {
|
601
|
+
const depth = this.sliceSerialize(token).length;
|
602
|
+
node.depth = depth;
|
603
|
+
}
|
604
|
+
}
|
605
|
+
|
606
|
+
/**
|
607
|
+
* @this {CompileContext}
|
608
|
+
* @type {Handle}
|
609
|
+
*/
|
610
|
+
function onexitsetextheadingtext() {
|
611
|
+
this.data.setextHeadingSlurpLineEnding = true;
|
612
|
+
}
|
613
|
+
|
614
|
+
/**
|
615
|
+
* @this {CompileContext}
|
616
|
+
* @type {Handle}
|
617
|
+
*/
|
618
|
+
function onexitsetextheadinglinesequence(token) {
|
619
|
+
const node = this.stack[this.stack.length - 1];
|
620
|
+
node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;
|
621
|
+
}
|
622
|
+
|
623
|
+
/**
|
624
|
+
* @this {CompileContext}
|
625
|
+
* @type {Handle}
|
626
|
+
*/
|
627
|
+
function onexitsetextheading() {
|
628
|
+
this.data.setextHeadingSlurpLineEnding = undefined;
|
629
|
+
}
|
630
|
+
|
631
|
+
/**
|
632
|
+
* @this {CompileContext}
|
633
|
+
* @type {Handle}
|
634
|
+
*/
|
635
|
+
|
636
|
+
function onenterdata(token) {
|
637
|
+
const node = this.stack[this.stack.length - 1];
|
638
|
+
/** @type {Array<Nodes>} */
|
639
|
+
const siblings = node.children;
|
640
|
+
let tail = siblings[siblings.length - 1];
|
641
|
+
if (!tail || tail.type !== 'text') {
|
642
|
+
// Add a new text node.
|
643
|
+
tail = text();
|
644
|
+
tail.position = {
|
645
|
+
start: point(token.start),
|
646
|
+
// @ts-expect-error: we’ll add `end` later.
|
647
|
+
end: undefined
|
648
|
+
};
|
649
|
+
siblings.push(tail);
|
650
|
+
}
|
651
|
+
this.stack.push(tail);
|
652
|
+
}
|
653
|
+
|
654
|
+
/**
|
655
|
+
* @this {CompileContext}
|
656
|
+
* @type {Handle}
|
657
|
+
*/
|
658
|
+
|
659
|
+
function onexitdata(token) {
|
660
|
+
const tail = this.stack.pop();
|
661
|
+
tail.value += this.sliceSerialize(token);
|
662
|
+
tail.position.end = point(token.end);
|
663
|
+
}
|
664
|
+
|
665
|
+
/**
|
666
|
+
* @this {CompileContext}
|
667
|
+
* @type {Handle}
|
668
|
+
*/
|
669
|
+
|
670
|
+
function onexitlineending(token) {
|
671
|
+
const context = this.stack[this.stack.length - 1];
|
672
|
+
// If we’re at a hard break, include the line ending in there.
|
673
|
+
if (this.data.atHardBreak) {
|
674
|
+
const tail = context.children[context.children.length - 1];
|
675
|
+
tail.position.end = point(token.end);
|
676
|
+
this.data.atHardBreak = undefined;
|
677
|
+
return;
|
678
|
+
}
|
679
|
+
if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {
|
680
|
+
onenterdata.call(this, token);
|
681
|
+
onexitdata.call(this, token);
|
682
|
+
}
|
683
|
+
}
|
684
|
+
|
685
|
+
/**
|
686
|
+
* @this {CompileContext}
|
687
|
+
* @type {Handle}
|
688
|
+
*/
|
689
|
+
|
690
|
+
function onexithardbreak() {
|
691
|
+
this.data.atHardBreak = true;
|
692
|
+
}
|
693
|
+
|
694
|
+
/**
|
695
|
+
* @this {CompileContext}
|
696
|
+
* @type {Handle}
|
697
|
+
*/
|
698
|
+
|
699
|
+
function onexithtmlflow() {
|
700
|
+
const data = this.resume();
|
701
|
+
const node = this.stack[this.stack.length - 1];
|
702
|
+
node.value = data;
|
703
|
+
}
|
704
|
+
|
705
|
+
/**
|
706
|
+
* @this {CompileContext}
|
707
|
+
* @type {Handle}
|
708
|
+
*/
|
709
|
+
|
710
|
+
function onexithtmltext() {
|
711
|
+
const data = this.resume();
|
712
|
+
const node = this.stack[this.stack.length - 1];
|
713
|
+
node.value = data;
|
714
|
+
}
|
715
|
+
|
716
|
+
/**
|
717
|
+
* @this {CompileContext}
|
718
|
+
* @type {Handle}
|
719
|
+
*/
|
720
|
+
|
721
|
+
function onexitcodetext() {
|
722
|
+
const data = this.resume();
|
723
|
+
const node = this.stack[this.stack.length - 1];
|
724
|
+
node.value = data;
|
725
|
+
}
|
726
|
+
|
727
|
+
/**
|
728
|
+
* @this {CompileContext}
|
729
|
+
* @type {Handle}
|
730
|
+
*/
|
731
|
+
|
732
|
+
function onexitlink() {
|
733
|
+
const node = this.stack[this.stack.length - 1];
|
734
|
+
// Note: there are also `identifier` and `label` fields on this link node!
|
735
|
+
// These are used / cleaned here.
|
736
|
+
|
737
|
+
// To do: clean.
|
738
|
+
if (this.data.inReference) {
|
739
|
+
/** @type {ReferenceType} */
|
740
|
+
const referenceType = this.data.referenceType || 'shortcut';
|
741
|
+
node.type += 'Reference';
|
742
|
+
// @ts-expect-error: mutate.
|
743
|
+
node.referenceType = referenceType;
|
744
|
+
// @ts-expect-error: mutate.
|
745
|
+
delete node.url;
|
746
|
+
delete node.title;
|
747
|
+
} else {
|
748
|
+
// @ts-expect-error: mutate.
|
749
|
+
delete node.identifier;
|
750
|
+
// @ts-expect-error: mutate.
|
751
|
+
delete node.label;
|
752
|
+
}
|
753
|
+
this.data.referenceType = undefined;
|
754
|
+
}
|
755
|
+
|
756
|
+
/**
|
757
|
+
* @this {CompileContext}
|
758
|
+
* @type {Handle}
|
759
|
+
*/
|
760
|
+
|
761
|
+
function onexitimage() {
|
762
|
+
const node = this.stack[this.stack.length - 1];
|
763
|
+
// Note: there are also `identifier` and `label` fields on this link node!
|
764
|
+
// These are used / cleaned here.
|
765
|
+
|
766
|
+
// To do: clean.
|
767
|
+
if (this.data.inReference) {
|
768
|
+
/** @type {ReferenceType} */
|
769
|
+
const referenceType = this.data.referenceType || 'shortcut';
|
770
|
+
node.type += 'Reference';
|
771
|
+
// @ts-expect-error: mutate.
|
772
|
+
node.referenceType = referenceType;
|
773
|
+
// @ts-expect-error: mutate.
|
774
|
+
delete node.url;
|
775
|
+
delete node.title;
|
776
|
+
} else {
|
777
|
+
// @ts-expect-error: mutate.
|
778
|
+
delete node.identifier;
|
779
|
+
// @ts-expect-error: mutate.
|
780
|
+
delete node.label;
|
781
|
+
}
|
782
|
+
this.data.referenceType = undefined;
|
783
|
+
}
|
784
|
+
|
785
|
+
/**
|
786
|
+
* @this {CompileContext}
|
787
|
+
* @type {Handle}
|
788
|
+
*/
|
789
|
+
|
790
|
+
function onexitlabeltext(token) {
|
791
|
+
const string = this.sliceSerialize(token);
|
792
|
+
const ancestor = this.stack[this.stack.length - 2];
|
793
|
+
// @ts-expect-error: stash this on the node, as it might become a reference
|
794
|
+
// later.
|
795
|
+
ancestor.label = decodeString(string);
|
796
|
+
// @ts-expect-error: same as above.
|
797
|
+
ancestor.identifier = normalizeIdentifier(string).toLowerCase();
|
798
|
+
}
|
799
|
+
|
800
|
+
/**
|
801
|
+
* @this {CompileContext}
|
802
|
+
* @type {Handle}
|
803
|
+
*/
|
804
|
+
|
805
|
+
function onexitlabel() {
|
806
|
+
const fragment = this.stack[this.stack.length - 1];
|
807
|
+
const value = this.resume();
|
808
|
+
const node = this.stack[this.stack.length - 1];
|
809
|
+
// Assume a reference.
|
810
|
+
this.data.inReference = true;
|
811
|
+
if (node.type === 'link') {
|
812
|
+
/** @type {Array<PhrasingContent>} */
|
813
|
+
const children = fragment.children;
|
814
|
+
node.children = children;
|
815
|
+
} else {
|
816
|
+
node.alt = value;
|
817
|
+
}
|
818
|
+
}
|
819
|
+
|
820
|
+
/**
|
821
|
+
* @this {CompileContext}
|
822
|
+
* @type {Handle}
|
823
|
+
*/
|
824
|
+
|
825
|
+
function onexitresourcedestinationstring() {
|
826
|
+
const data = this.resume();
|
827
|
+
const node = this.stack[this.stack.length - 1];
|
828
|
+
node.url = data;
|
829
|
+
}
|
830
|
+
|
831
|
+
/**
|
832
|
+
* @this {CompileContext}
|
833
|
+
* @type {Handle}
|
834
|
+
*/
|
835
|
+
|
836
|
+
function onexitresourcetitlestring() {
|
837
|
+
const data = this.resume();
|
838
|
+
const node = this.stack[this.stack.length - 1];
|
839
|
+
node.title = data;
|
840
|
+
}
|
841
|
+
|
842
|
+
/**
|
843
|
+
* @this {CompileContext}
|
844
|
+
* @type {Handle}
|
845
|
+
*/
|
846
|
+
|
847
|
+
function onexitresource() {
|
848
|
+
this.data.inReference = undefined;
|
849
|
+
}
|
850
|
+
|
851
|
+
/**
|
852
|
+
* @this {CompileContext}
|
853
|
+
* @type {Handle}
|
854
|
+
*/
|
855
|
+
|
856
|
+
function onenterreference() {
|
857
|
+
this.data.referenceType = 'collapsed';
|
858
|
+
}
|
859
|
+
|
860
|
+
/**
|
861
|
+
* @this {CompileContext}
|
862
|
+
* @type {Handle}
|
863
|
+
*/
|
864
|
+
|
865
|
+
function onexitreferencestring(token) {
|
866
|
+
const label = this.resume();
|
867
|
+
const node = this.stack[this.stack.length - 1];
|
868
|
+
// @ts-expect-error: stash this on the node, as it might become a reference
|
869
|
+
// later.
|
870
|
+
node.label = label;
|
871
|
+
// @ts-expect-error: same as above.
|
872
|
+
node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
|
873
|
+
this.data.referenceType = 'full';
|
874
|
+
}
|
875
|
+
|
876
|
+
/**
|
877
|
+
* @this {CompileContext}
|
878
|
+
* @type {Handle}
|
879
|
+
*/
|
880
|
+
|
881
|
+
function onexitcharacterreferencemarker(token) {
|
882
|
+
this.data.characterReferenceType = token.type;
|
883
|
+
}
|
884
|
+
|
885
|
+
/**
|
886
|
+
* @this {CompileContext}
|
887
|
+
* @type {Handle}
|
888
|
+
*/
|
889
|
+
function onexitcharacterreferencevalue(token) {
|
890
|
+
const data = this.sliceSerialize(token);
|
891
|
+
const type = this.data.characterReferenceType;
|
892
|
+
/** @type {string} */
|
893
|
+
let value;
|
894
|
+
if (type) {
|
895
|
+
value = decodeNumericCharacterReference(data, type === "characterReferenceMarkerNumeric" ? 10 : 16);
|
896
|
+
this.data.characterReferenceType = undefined;
|
897
|
+
} else {
|
898
|
+
const result = decodeNamedCharacterReference(data);
|
899
|
+
value = result;
|
900
|
+
}
|
901
|
+
const tail = this.stack[this.stack.length - 1];
|
902
|
+
tail.value += value;
|
903
|
+
}
|
904
|
+
|
905
|
+
/**
|
906
|
+
* @this {CompileContext}
|
907
|
+
* @type {Handle}
|
908
|
+
*/
|
909
|
+
function onexitcharacterreference(token) {
|
910
|
+
const tail = this.stack.pop();
|
911
|
+
tail.position.end = point(token.end);
|
912
|
+
}
|
913
|
+
|
914
|
+
/**
|
915
|
+
* @this {CompileContext}
|
916
|
+
* @type {Handle}
|
917
|
+
*/
|
918
|
+
function onexitautolinkprotocol(token) {
|
919
|
+
onexitdata.call(this, token);
|
920
|
+
const node = this.stack[this.stack.length - 1];
|
921
|
+
node.url = this.sliceSerialize(token);
|
922
|
+
}
|
923
|
+
|
924
|
+
/**
|
925
|
+
* @this {CompileContext}
|
926
|
+
* @type {Handle}
|
927
|
+
*/
|
928
|
+
function onexitautolinkemail(token) {
|
929
|
+
onexitdata.call(this, token);
|
930
|
+
const node = this.stack[this.stack.length - 1];
|
931
|
+
node.url = 'mailto:' + this.sliceSerialize(token);
|
932
|
+
}
|
933
|
+
|
934
|
+
//
|
935
|
+
// Creaters.
|
936
|
+
//
|
937
|
+
|
938
|
+
/** @returns {Blockquote} */
|
939
|
+
function blockQuote() {
|
940
|
+
return {
|
941
|
+
type: 'blockquote',
|
942
|
+
children: []
|
943
|
+
};
|
944
|
+
}
|
945
|
+
|
946
|
+
/** @returns {Code} */
|
947
|
+
function codeFlow() {
|
948
|
+
return {
|
949
|
+
type: 'code',
|
950
|
+
lang: null,
|
951
|
+
meta: null,
|
952
|
+
value: ''
|
953
|
+
};
|
954
|
+
}
|
955
|
+
|
956
|
+
/** @returns {InlineCode} */
|
957
|
+
function codeText() {
|
958
|
+
return {
|
959
|
+
type: 'inlineCode',
|
960
|
+
value: ''
|
961
|
+
};
|
962
|
+
}
|
963
|
+
|
964
|
+
/** @returns {Definition} */
|
965
|
+
function definition() {
|
966
|
+
return {
|
967
|
+
type: 'definition',
|
968
|
+
identifier: '',
|
969
|
+
label: null,
|
970
|
+
title: null,
|
971
|
+
url: ''
|
972
|
+
};
|
973
|
+
}
|
974
|
+
|
975
|
+
/** @returns {Emphasis} */
|
976
|
+
function emphasis() {
|
977
|
+
return {
|
978
|
+
type: 'emphasis',
|
979
|
+
children: []
|
980
|
+
};
|
981
|
+
}
|
982
|
+
|
983
|
+
/** @returns {Heading} */
|
984
|
+
function heading() {
|
985
|
+
return {
|
986
|
+
type: 'heading',
|
987
|
+
// @ts-expect-error `depth` will be set later.
|
988
|
+
depth: 0,
|
989
|
+
children: []
|
990
|
+
};
|
991
|
+
}
|
992
|
+
|
993
|
+
/** @returns {Break} */
|
994
|
+
function hardBreak() {
|
995
|
+
return {
|
996
|
+
type: 'break'
|
997
|
+
};
|
998
|
+
}
|
999
|
+
|
1000
|
+
/** @returns {Html} */
|
1001
|
+
function html() {
|
1002
|
+
return {
|
1003
|
+
type: 'html',
|
1004
|
+
value: ''
|
1005
|
+
};
|
1006
|
+
}
|
1007
|
+
|
1008
|
+
/** @returns {Image} */
|
1009
|
+
function image() {
|
1010
|
+
return {
|
1011
|
+
type: 'image',
|
1012
|
+
title: null,
|
1013
|
+
url: '',
|
1014
|
+
alt: null
|
1015
|
+
};
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
/** @returns {Link} */
|
1019
|
+
function link() {
|
1020
|
+
return {
|
1021
|
+
type: 'link',
|
1022
|
+
title: null,
|
1023
|
+
url: '',
|
1024
|
+
children: []
|
1025
|
+
};
|
1026
|
+
}
|
1027
|
+
|
1028
|
+
/**
|
1029
|
+
* @param {Token} token
|
1030
|
+
* @returns {List}
|
1031
|
+
*/
|
1032
|
+
function list(token) {
|
1033
|
+
return {
|
1034
|
+
type: 'list',
|
1035
|
+
ordered: token.type === 'listOrdered',
|
1036
|
+
start: null,
|
1037
|
+
spread: token._spread,
|
1038
|
+
children: []
|
1039
|
+
};
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
/**
|
1043
|
+
* @param {Token} token
|
1044
|
+
* @returns {ListItem}
|
1045
|
+
*/
|
1046
|
+
function listItem(token) {
|
1047
|
+
return {
|
1048
|
+
type: 'listItem',
|
1049
|
+
spread: token._spread,
|
1050
|
+
checked: null,
|
1051
|
+
children: []
|
1052
|
+
};
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
/** @returns {Paragraph} */
|
1056
|
+
function paragraph() {
|
1057
|
+
return {
|
1058
|
+
type: 'paragraph',
|
1059
|
+
children: []
|
1060
|
+
};
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
/** @returns {Strong} */
|
1064
|
+
function strong() {
|
1065
|
+
return {
|
1066
|
+
type: 'strong',
|
1067
|
+
children: []
|
1068
|
+
};
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
/** @returns {Text} */
|
1072
|
+
function text() {
|
1073
|
+
return {
|
1074
|
+
type: 'text',
|
1075
|
+
value: ''
|
1076
|
+
};
|
1077
|
+
}
|
1078
|
+
|
1079
|
+
/** @returns {ThematicBreak} */
|
1080
|
+
function thematicBreak() {
|
1081
|
+
return {
|
1082
|
+
type: 'thematicBreak'
|
1083
|
+
};
|
1084
|
+
}
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
/**
|
1088
|
+
* Copy a point-like value.
|
1089
|
+
*
|
1090
|
+
* @param {Point} d
|
1091
|
+
* Point-like value.
|
1092
|
+
* @returns {Point}
|
1093
|
+
* unist point.
|
1094
|
+
*/
|
1095
|
+
function point(d) {
|
1096
|
+
return {
|
1097
|
+
line: d.line,
|
1098
|
+
column: d.column,
|
1099
|
+
offset: d.offset
|
1100
|
+
};
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
/**
|
1104
|
+
* @param {Config} combined
|
1105
|
+
* @param {Array<Array<Extension> | Extension>} extensions
|
1106
|
+
* @returns {undefined}
|
1107
|
+
*/
|
1108
|
+
function configure(combined, extensions) {
|
1109
|
+
let index = -1;
|
1110
|
+
while (++index < extensions.length) {
|
1111
|
+
const value = extensions[index];
|
1112
|
+
if (Array.isArray(value)) {
|
1113
|
+
configure(combined, value);
|
1114
|
+
} else {
|
1115
|
+
extension(combined, value);
|
1116
|
+
}
|
1117
|
+
}
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
/**
|
1121
|
+
* @param {Config} combined
|
1122
|
+
* @param {Extension} extension
|
1123
|
+
* @returns {undefined}
|
1124
|
+
*/
|
1125
|
+
function extension(combined, extension) {
|
1126
|
+
/** @type {keyof Extension} */
|
1127
|
+
let key;
|
1128
|
+
for (key in extension) {
|
1129
|
+
if (own.call(extension, key)) {
|
1130
|
+
switch (key) {
|
1131
|
+
case 'canContainEols':
|
1132
|
+
{
|
1133
|
+
const right = extension[key];
|
1134
|
+
if (right) {
|
1135
|
+
combined[key].push(...right);
|
1136
|
+
}
|
1137
|
+
break;
|
1138
|
+
}
|
1139
|
+
case 'transforms':
|
1140
|
+
{
|
1141
|
+
const right = extension[key];
|
1142
|
+
if (right) {
|
1143
|
+
combined[key].push(...right);
|
1144
|
+
}
|
1145
|
+
break;
|
1146
|
+
}
|
1147
|
+
case 'enter':
|
1148
|
+
case 'exit':
|
1149
|
+
{
|
1150
|
+
const right = extension[key];
|
1151
|
+
if (right) {
|
1152
|
+
Object.assign(combined[key], right);
|
1153
|
+
}
|
1154
|
+
break;
|
1155
|
+
}
|
1156
|
+
// No default
|
1157
|
+
}
|
1158
|
+
}
|
1159
|
+
}
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
/** @type {OnEnterError} */
|
1163
|
+
function defaultOnError(left, right) {
|
1164
|
+
if (left) {
|
1165
|
+
throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({
|
1166
|
+
start: left.start,
|
1167
|
+
end: left.end
|
1168
|
+
}) + '): a different token (`' + right.type + '`, ' + stringifyPosition({
|
1169
|
+
start: right.start,
|
1170
|
+
end: right.end
|
1171
|
+
}) + ') is open');
|
1172
|
+
} else {
|
1173
|
+
throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({
|
1174
|
+
start: right.start,
|
1175
|
+
end: right.end
|
1176
|
+
}) + ') is still open');
|
1177
|
+
}
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
export { fromMarkdown };
|
1181
|
+
//# sourceMappingURL=index.js.map
|