@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,791 @@
|
|
1
|
+
import { stringify } from '../../comma-separated-tokens/index.js';
|
2
|
+
import { ok } from '../../devlop/lib/default.js';
|
3
|
+
import { svg, html } from '../../property-information/index.js';
|
4
|
+
import { stringify as stringify$1 } from '../../space-separated-tokens/index.js';
|
5
|
+
import styleToJs from '../../../_virtual/index12.js';
|
6
|
+
import { whitespace } from '../../hast-util-whitespace/lib/index.js';
|
7
|
+
import { name } from '../../estree-util-is-identifier-name/lib/index.js';
|
8
|
+
import { VFileMessage } from '../../vfile-message/lib/index.js';
|
9
|
+
import { find } from '../../property-information/lib/find.js';
|
10
|
+
import { hastToReact } from '../../property-information/lib/hast-to-react.js';
|
11
|
+
import { pointStart } from '../../unist-util-position/lib/index.js';
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @import {Identifier, Literal, MemberExpression} from 'estree'
|
15
|
+
* @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'
|
16
|
+
* @import {Element, Nodes, Parents, Root, Text} from 'hast'
|
17
|
+
* @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'
|
18
|
+
* @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'
|
19
|
+
* @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'
|
20
|
+
* @import {Position} from 'unist'
|
21
|
+
* @import {Child, Create, Field, JsxElement, State, Style} from './types.js'
|
22
|
+
*/
|
23
|
+
|
24
|
+
|
25
|
+
// To do: next major: `Object.hasOwn`.
|
26
|
+
const own = {}.hasOwnProperty;
|
27
|
+
|
28
|
+
/** @type {Map<string, number>} */
|
29
|
+
const emptyMap = new Map();
|
30
|
+
|
31
|
+
const cap = /[A-Z]/g;
|
32
|
+
|
33
|
+
// `react-dom` triggers a warning for *any* white space in tables.
|
34
|
+
// To follow GFM, `mdast-util-to-hast` injects line endings between elements.
|
35
|
+
// Other tools might do so too, but they don’t do here, so we remove all of
|
36
|
+
// that.
|
37
|
+
|
38
|
+
// See: <https://github.com/facebook/react/pull/7081>.
|
39
|
+
// See: <https://github.com/facebook/react/pull/7515>.
|
40
|
+
// See: <https://github.com/remarkjs/remark-react/issues/64>.
|
41
|
+
// See: <https://github.com/rehypejs/rehype-react/pull/29>.
|
42
|
+
// See: <https://github.com/rehypejs/rehype-react/pull/32>.
|
43
|
+
// See: <https://github.com/rehypejs/rehype-react/pull/45>.
|
44
|
+
const tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr']);
|
45
|
+
|
46
|
+
const tableCellElement = new Set(['td', 'th']);
|
47
|
+
|
48
|
+
const docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime';
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Transform a hast tree to preact, react, solid, svelte, vue, etc.,
|
52
|
+
* with an automatic JSX runtime.
|
53
|
+
*
|
54
|
+
* @param {Nodes} tree
|
55
|
+
* Tree to transform.
|
56
|
+
* @param {Options} options
|
57
|
+
* Configuration (required).
|
58
|
+
* @returns {JsxElement}
|
59
|
+
* JSX element.
|
60
|
+
*/
|
61
|
+
|
62
|
+
function toJsxRuntime(tree, options) {
|
63
|
+
if (!options || options.Fragment === undefined) {
|
64
|
+
throw new TypeError('Expected `Fragment` in options')
|
65
|
+
}
|
66
|
+
|
67
|
+
const filePath = options.filePath || undefined;
|
68
|
+
/** @type {Create} */
|
69
|
+
let create;
|
70
|
+
|
71
|
+
if (options.development) {
|
72
|
+
if (typeof options.jsxDEV !== 'function') {
|
73
|
+
throw new TypeError(
|
74
|
+
'Expected `jsxDEV` in options when `development: true`'
|
75
|
+
)
|
76
|
+
}
|
77
|
+
|
78
|
+
create = developmentCreate(filePath, options.jsxDEV);
|
79
|
+
} else {
|
80
|
+
if (typeof options.jsx !== 'function') {
|
81
|
+
throw new TypeError('Expected `jsx` in production options')
|
82
|
+
}
|
83
|
+
|
84
|
+
if (typeof options.jsxs !== 'function') {
|
85
|
+
throw new TypeError('Expected `jsxs` in production options')
|
86
|
+
}
|
87
|
+
|
88
|
+
create = productionCreate(filePath, options.jsx, options.jsxs);
|
89
|
+
}
|
90
|
+
|
91
|
+
/** @type {State} */
|
92
|
+
const state = {
|
93
|
+
Fragment: options.Fragment,
|
94
|
+
ancestors: [],
|
95
|
+
components: options.components || {},
|
96
|
+
create,
|
97
|
+
elementAttributeNameCase: options.elementAttributeNameCase || 'react',
|
98
|
+
evaluater: options.createEvaluater ? options.createEvaluater() : undefined,
|
99
|
+
filePath,
|
100
|
+
ignoreInvalidStyle: options.ignoreInvalidStyle || false,
|
101
|
+
passKeys: options.passKeys !== false,
|
102
|
+
passNode: options.passNode || false,
|
103
|
+
schema: options.space === 'svg' ? svg : html,
|
104
|
+
stylePropertyNameCase: options.stylePropertyNameCase || 'dom',
|
105
|
+
tableCellAlignToStyle: options.tableCellAlignToStyle !== false
|
106
|
+
};
|
107
|
+
|
108
|
+
const result = one(state, tree, undefined);
|
109
|
+
|
110
|
+
// JSX element.
|
111
|
+
if (result && typeof result !== 'string') {
|
112
|
+
return result
|
113
|
+
}
|
114
|
+
|
115
|
+
// Text node or something that turned into nothing.
|
116
|
+
return state.create(
|
117
|
+
tree,
|
118
|
+
state.Fragment,
|
119
|
+
{children: result || undefined},
|
120
|
+
undefined
|
121
|
+
)
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Transform a node.
|
126
|
+
*
|
127
|
+
* @param {State} state
|
128
|
+
* Info passed around.
|
129
|
+
* @param {Nodes} node
|
130
|
+
* Current node.
|
131
|
+
* @param {string | undefined} key
|
132
|
+
* Key.
|
133
|
+
* @returns {Child | undefined}
|
134
|
+
* Child, optional.
|
135
|
+
*/
|
136
|
+
function one(state, node, key) {
|
137
|
+
if (node.type === 'element') {
|
138
|
+
return element(state, node, key)
|
139
|
+
}
|
140
|
+
|
141
|
+
if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {
|
142
|
+
return mdxExpression(state, node)
|
143
|
+
}
|
144
|
+
|
145
|
+
if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {
|
146
|
+
return mdxJsxElement(state, node, key)
|
147
|
+
}
|
148
|
+
|
149
|
+
if (node.type === 'mdxjsEsm') {
|
150
|
+
return mdxEsm(state, node)
|
151
|
+
}
|
152
|
+
|
153
|
+
if (node.type === 'root') {
|
154
|
+
return root(state, node, key)
|
155
|
+
}
|
156
|
+
|
157
|
+
if (node.type === 'text') {
|
158
|
+
return text(state, node)
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Handle element.
|
164
|
+
*
|
165
|
+
* @param {State} state
|
166
|
+
* Info passed around.
|
167
|
+
* @param {Element} node
|
168
|
+
* Current node.
|
169
|
+
* @param {string | undefined} key
|
170
|
+
* Key.
|
171
|
+
* @returns {Child | undefined}
|
172
|
+
* Child, optional.
|
173
|
+
*/
|
174
|
+
function element(state, node, key) {
|
175
|
+
const parentSchema = state.schema;
|
176
|
+
let schema = parentSchema;
|
177
|
+
|
178
|
+
if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {
|
179
|
+
schema = svg;
|
180
|
+
state.schema = schema;
|
181
|
+
}
|
182
|
+
|
183
|
+
state.ancestors.push(node);
|
184
|
+
|
185
|
+
const type = findComponentFromName(state, node.tagName, false);
|
186
|
+
const props = createElementProps(state, node);
|
187
|
+
let children = createChildren(state, node);
|
188
|
+
|
189
|
+
if (tableElements.has(node.tagName)) {
|
190
|
+
children = children.filter(function (child) {
|
191
|
+
return typeof child === 'string' ? !whitespace(child) : true
|
192
|
+
});
|
193
|
+
}
|
194
|
+
|
195
|
+
addNode(state, props, type, node);
|
196
|
+
addChildren(props, children);
|
197
|
+
|
198
|
+
// Restore.
|
199
|
+
state.ancestors.pop();
|
200
|
+
state.schema = parentSchema;
|
201
|
+
|
202
|
+
return state.create(node, type, props, key)
|
203
|
+
}
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Handle MDX expression.
|
207
|
+
*
|
208
|
+
* @param {State} state
|
209
|
+
* Info passed around.
|
210
|
+
* @param {MdxFlowExpressionHast | MdxTextExpressionHast} node
|
211
|
+
* Current node.
|
212
|
+
* @returns {Child | undefined}
|
213
|
+
* Child, optional.
|
214
|
+
*/
|
215
|
+
function mdxExpression(state, node) {
|
216
|
+
if (node.data && node.data.estree && state.evaluater) {
|
217
|
+
const program = node.data.estree;
|
218
|
+
const expression = program.body[0];
|
219
|
+
ok(expression.type === 'ExpressionStatement');
|
220
|
+
|
221
|
+
// Assume result is a child.
|
222
|
+
return /** @type {Child | undefined} */ (
|
223
|
+
state.evaluater.evaluateExpression(expression.expression)
|
224
|
+
)
|
225
|
+
}
|
226
|
+
|
227
|
+
crashEstree(state, node.position);
|
228
|
+
}
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Handle MDX ESM.
|
232
|
+
*
|
233
|
+
* @param {State} state
|
234
|
+
* Info passed around.
|
235
|
+
* @param {MdxjsEsmHast} node
|
236
|
+
* Current node.
|
237
|
+
* @returns {Child | undefined}
|
238
|
+
* Child, optional.
|
239
|
+
*/
|
240
|
+
function mdxEsm(state, node) {
|
241
|
+
if (node.data && node.data.estree && state.evaluater) {
|
242
|
+
// Assume result is a child.
|
243
|
+
return /** @type {Child | undefined} */ (
|
244
|
+
state.evaluater.evaluateProgram(node.data.estree)
|
245
|
+
)
|
246
|
+
}
|
247
|
+
|
248
|
+
crashEstree(state, node.position);
|
249
|
+
}
|
250
|
+
|
251
|
+
/**
|
252
|
+
* Handle MDX JSX.
|
253
|
+
*
|
254
|
+
* @param {State} state
|
255
|
+
* Info passed around.
|
256
|
+
* @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node
|
257
|
+
* Current node.
|
258
|
+
* @param {string | undefined} key
|
259
|
+
* Key.
|
260
|
+
* @returns {Child | undefined}
|
261
|
+
* Child, optional.
|
262
|
+
*/
|
263
|
+
function mdxJsxElement(state, node, key) {
|
264
|
+
const parentSchema = state.schema;
|
265
|
+
let schema = parentSchema;
|
266
|
+
|
267
|
+
if (node.name === 'svg' && parentSchema.space === 'html') {
|
268
|
+
schema = svg;
|
269
|
+
state.schema = schema;
|
270
|
+
}
|
271
|
+
|
272
|
+
state.ancestors.push(node);
|
273
|
+
|
274
|
+
const type =
|
275
|
+
node.name === null
|
276
|
+
? state.Fragment
|
277
|
+
: findComponentFromName(state, node.name, true);
|
278
|
+
const props = createJsxElementProps(state, node);
|
279
|
+
const children = createChildren(state, node);
|
280
|
+
|
281
|
+
addNode(state, props, type, node);
|
282
|
+
addChildren(props, children);
|
283
|
+
|
284
|
+
// Restore.
|
285
|
+
state.ancestors.pop();
|
286
|
+
state.schema = parentSchema;
|
287
|
+
|
288
|
+
return state.create(node, type, props, key)
|
289
|
+
}
|
290
|
+
|
291
|
+
/**
|
292
|
+
* Handle root.
|
293
|
+
*
|
294
|
+
* @param {State} state
|
295
|
+
* Info passed around.
|
296
|
+
* @param {Root} node
|
297
|
+
* Current node.
|
298
|
+
* @param {string | undefined} key
|
299
|
+
* Key.
|
300
|
+
* @returns {Child | undefined}
|
301
|
+
* Child, optional.
|
302
|
+
*/
|
303
|
+
function root(state, node, key) {
|
304
|
+
/** @type {Props} */
|
305
|
+
const props = {};
|
306
|
+
|
307
|
+
addChildren(props, createChildren(state, node));
|
308
|
+
|
309
|
+
return state.create(node, state.Fragment, props, key)
|
310
|
+
}
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Handle text.
|
314
|
+
*
|
315
|
+
* @param {State} _
|
316
|
+
* Info passed around.
|
317
|
+
* @param {Text} node
|
318
|
+
* Current node.
|
319
|
+
* @returns {Child | undefined}
|
320
|
+
* Child, optional.
|
321
|
+
*/
|
322
|
+
function text(_, node) {
|
323
|
+
return node.value
|
324
|
+
}
|
325
|
+
|
326
|
+
/**
|
327
|
+
* Add `node` to props.
|
328
|
+
*
|
329
|
+
* @param {State} state
|
330
|
+
* Info passed around.
|
331
|
+
* @param {Props} props
|
332
|
+
* Props.
|
333
|
+
* @param {unknown} type
|
334
|
+
* Type.
|
335
|
+
* @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node
|
336
|
+
* Node.
|
337
|
+
* @returns {undefined}
|
338
|
+
* Nothing.
|
339
|
+
*/
|
340
|
+
function addNode(state, props, type, node) {
|
341
|
+
// If this is swapped out for a component:
|
342
|
+
if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {
|
343
|
+
props.node = node;
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
/**
|
348
|
+
* Add children to props.
|
349
|
+
*
|
350
|
+
* @param {Props} props
|
351
|
+
* Props.
|
352
|
+
* @param {Array<Child>} children
|
353
|
+
* Children.
|
354
|
+
* @returns {undefined}
|
355
|
+
* Nothing.
|
356
|
+
*/
|
357
|
+
function addChildren(props, children) {
|
358
|
+
if (children.length > 0) {
|
359
|
+
const value = children.length > 1 ? children : children[0];
|
360
|
+
|
361
|
+
if (value) {
|
362
|
+
props.children = value;
|
363
|
+
}
|
364
|
+
}
|
365
|
+
}
|
366
|
+
|
367
|
+
/**
|
368
|
+
* @param {string | undefined} _
|
369
|
+
* Path to file.
|
370
|
+
* @param {Jsx} jsx
|
371
|
+
* Dynamic.
|
372
|
+
* @param {Jsx} jsxs
|
373
|
+
* Static.
|
374
|
+
* @returns {Create}
|
375
|
+
* Create a production element.
|
376
|
+
*/
|
377
|
+
function productionCreate(_, jsx, jsxs) {
|
378
|
+
return create
|
379
|
+
/** @type {Create} */
|
380
|
+
function create(_, type, props, key) {
|
381
|
+
// Only an array when there are 2 or more children.
|
382
|
+
const isStaticChildren = Array.isArray(props.children);
|
383
|
+
const fn = isStaticChildren ? jsxs : jsx;
|
384
|
+
return key ? fn(type, props, key) : fn(type, props)
|
385
|
+
}
|
386
|
+
}
|
387
|
+
|
388
|
+
/**
|
389
|
+
* @param {string | undefined} filePath
|
390
|
+
* Path to file.
|
391
|
+
* @param {JsxDev} jsxDEV
|
392
|
+
* Development.
|
393
|
+
* @returns {Create}
|
394
|
+
* Create a development element.
|
395
|
+
*/
|
396
|
+
function developmentCreate(filePath, jsxDEV) {
|
397
|
+
return create
|
398
|
+
/** @type {Create} */
|
399
|
+
function create(node, type, props, key) {
|
400
|
+
// Only an array when there are 2 or more children.
|
401
|
+
const isStaticChildren = Array.isArray(props.children);
|
402
|
+
const point = pointStart(node);
|
403
|
+
return jsxDEV(
|
404
|
+
type,
|
405
|
+
props,
|
406
|
+
key,
|
407
|
+
isStaticChildren,
|
408
|
+
{
|
409
|
+
columnNumber: point ? point.column - 1 : undefined,
|
410
|
+
fileName: filePath,
|
411
|
+
lineNumber: point ? point.line : undefined
|
412
|
+
},
|
413
|
+
undefined
|
414
|
+
)
|
415
|
+
}
|
416
|
+
}
|
417
|
+
|
418
|
+
/**
|
419
|
+
* Create props from an element.
|
420
|
+
*
|
421
|
+
* @param {State} state
|
422
|
+
* Info passed around.
|
423
|
+
* @param {Element} node
|
424
|
+
* Current element.
|
425
|
+
* @returns {Props}
|
426
|
+
* Props.
|
427
|
+
*/
|
428
|
+
function createElementProps(state, node) {
|
429
|
+
/** @type {Props} */
|
430
|
+
const props = {};
|
431
|
+
/** @type {string | undefined} */
|
432
|
+
let alignValue;
|
433
|
+
/** @type {string} */
|
434
|
+
let prop;
|
435
|
+
|
436
|
+
for (prop in node.properties) {
|
437
|
+
if (prop !== 'children' && own.call(node.properties, prop)) {
|
438
|
+
const result = createProperty(state, prop, node.properties[prop]);
|
439
|
+
|
440
|
+
if (result) {
|
441
|
+
const [key, value] = result;
|
442
|
+
|
443
|
+
if (
|
444
|
+
state.tableCellAlignToStyle &&
|
445
|
+
key === 'align' &&
|
446
|
+
typeof value === 'string' &&
|
447
|
+
tableCellElement.has(node.tagName)
|
448
|
+
) {
|
449
|
+
alignValue = value;
|
450
|
+
} else {
|
451
|
+
props[key] = value;
|
452
|
+
}
|
453
|
+
}
|
454
|
+
}
|
455
|
+
}
|
456
|
+
|
457
|
+
if (alignValue) {
|
458
|
+
// Assume style is an object.
|
459
|
+
const style = /** @type {Style} */ (props.style || (props.style = {}));
|
460
|
+
style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =
|
461
|
+
alignValue;
|
462
|
+
}
|
463
|
+
|
464
|
+
return props
|
465
|
+
}
|
466
|
+
|
467
|
+
/**
|
468
|
+
* Create props from a JSX element.
|
469
|
+
*
|
470
|
+
* @param {State} state
|
471
|
+
* Info passed around.
|
472
|
+
* @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node
|
473
|
+
* Current JSX element.
|
474
|
+
* @returns {Props}
|
475
|
+
* Props.
|
476
|
+
*/
|
477
|
+
function createJsxElementProps(state, node) {
|
478
|
+
/** @type {Props} */
|
479
|
+
const props = {};
|
480
|
+
|
481
|
+
for (const attribute of node.attributes) {
|
482
|
+
if (attribute.type === 'mdxJsxExpressionAttribute') {
|
483
|
+
if (attribute.data && attribute.data.estree && state.evaluater) {
|
484
|
+
const program = attribute.data.estree;
|
485
|
+
const expression = program.body[0];
|
486
|
+
ok(expression.type === 'ExpressionStatement');
|
487
|
+
const objectExpression = expression.expression;
|
488
|
+
ok(objectExpression.type === 'ObjectExpression');
|
489
|
+
const property = objectExpression.properties[0];
|
490
|
+
ok(property.type === 'SpreadElement');
|
491
|
+
|
492
|
+
Object.assign(
|
493
|
+
props,
|
494
|
+
state.evaluater.evaluateExpression(property.argument)
|
495
|
+
);
|
496
|
+
} else {
|
497
|
+
crashEstree(state, node.position);
|
498
|
+
}
|
499
|
+
} else {
|
500
|
+
// For JSX, the author is responsible of passing in the correct values.
|
501
|
+
const name = attribute.name;
|
502
|
+
/** @type {unknown} */
|
503
|
+
let value;
|
504
|
+
|
505
|
+
if (attribute.value && typeof attribute.value === 'object') {
|
506
|
+
if (
|
507
|
+
attribute.value.data &&
|
508
|
+
attribute.value.data.estree &&
|
509
|
+
state.evaluater
|
510
|
+
) {
|
511
|
+
const program = attribute.value.data.estree;
|
512
|
+
const expression = program.body[0];
|
513
|
+
ok(expression.type === 'ExpressionStatement');
|
514
|
+
value = state.evaluater.evaluateExpression(expression.expression);
|
515
|
+
} else {
|
516
|
+
crashEstree(state, node.position);
|
517
|
+
}
|
518
|
+
} else {
|
519
|
+
value = attribute.value === null ? true : attribute.value;
|
520
|
+
}
|
521
|
+
|
522
|
+
// Assume a prop.
|
523
|
+
props[name] = /** @type {Props[keyof Props]} */ (value);
|
524
|
+
}
|
525
|
+
}
|
526
|
+
|
527
|
+
return props
|
528
|
+
}
|
529
|
+
|
530
|
+
/**
|
531
|
+
* Create children.
|
532
|
+
*
|
533
|
+
* @param {State} state
|
534
|
+
* Info passed around.
|
535
|
+
* @param {Parents} node
|
536
|
+
* Current element.
|
537
|
+
* @returns {Array<Child>}
|
538
|
+
* Children.
|
539
|
+
*/
|
540
|
+
function createChildren(state, node) {
|
541
|
+
/** @type {Array<Child>} */
|
542
|
+
const children = [];
|
543
|
+
let index = -1;
|
544
|
+
/** @type {Map<string, number>} */
|
545
|
+
// Note: test this when Solid doesn’t want to merge my upcoming PR.
|
546
|
+
/* c8 ignore next */
|
547
|
+
const countsByName = state.passKeys ? new Map() : emptyMap;
|
548
|
+
|
549
|
+
while (++index < node.children.length) {
|
550
|
+
const child = node.children[index];
|
551
|
+
/** @type {string | undefined} */
|
552
|
+
let key;
|
553
|
+
|
554
|
+
if (state.passKeys) {
|
555
|
+
const name =
|
556
|
+
child.type === 'element'
|
557
|
+
? child.tagName
|
558
|
+
: child.type === 'mdxJsxFlowElement' ||
|
559
|
+
child.type === 'mdxJsxTextElement'
|
560
|
+
? child.name
|
561
|
+
: undefined;
|
562
|
+
|
563
|
+
if (name) {
|
564
|
+
const count = countsByName.get(name) || 0;
|
565
|
+
key = name + '-' + count;
|
566
|
+
countsByName.set(name, count + 1);
|
567
|
+
}
|
568
|
+
}
|
569
|
+
|
570
|
+
const result = one(state, child, key);
|
571
|
+
if (result !== undefined) children.push(result);
|
572
|
+
}
|
573
|
+
|
574
|
+
return children
|
575
|
+
}
|
576
|
+
|
577
|
+
/**
|
578
|
+
* Handle a property.
|
579
|
+
*
|
580
|
+
* @param {State} state
|
581
|
+
* Info passed around.
|
582
|
+
* @param {string} prop
|
583
|
+
* Key.
|
584
|
+
* @param {Array<number | string> | boolean | number | string | null | undefined} value
|
585
|
+
* hast property value.
|
586
|
+
* @returns {Field | undefined}
|
587
|
+
* Field for runtime, optional.
|
588
|
+
*/
|
589
|
+
function createProperty(state, prop, value) {
|
590
|
+
const info = find(state.schema, prop);
|
591
|
+
|
592
|
+
// Ignore nullish and `NaN` values.
|
593
|
+
if (
|
594
|
+
value === null ||
|
595
|
+
value === undefined ||
|
596
|
+
(typeof value === 'number' && Number.isNaN(value))
|
597
|
+
) {
|
598
|
+
return
|
599
|
+
}
|
600
|
+
|
601
|
+
if (Array.isArray(value)) {
|
602
|
+
// Accept `array`.
|
603
|
+
// Most props are space-separated.
|
604
|
+
value = info.commaSeparated ? stringify(value) : stringify$1(value);
|
605
|
+
}
|
606
|
+
|
607
|
+
// React only accepts `style` as object.
|
608
|
+
if (info.property === 'style') {
|
609
|
+
let styleObject =
|
610
|
+
typeof value === 'object' ? value : parseStyle(state, String(value));
|
611
|
+
|
612
|
+
if (state.stylePropertyNameCase === 'css') {
|
613
|
+
styleObject = transformStylesToCssCasing(styleObject);
|
614
|
+
}
|
615
|
+
|
616
|
+
return ['style', styleObject]
|
617
|
+
}
|
618
|
+
|
619
|
+
return [
|
620
|
+
state.elementAttributeNameCase === 'react' && info.space
|
621
|
+
? hastToReact[info.property] || info.property
|
622
|
+
: info.attribute,
|
623
|
+
value
|
624
|
+
]
|
625
|
+
}
|
626
|
+
|
627
|
+
/**
|
628
|
+
* Parse a CSS declaration to an object.
|
629
|
+
*
|
630
|
+
* @param {State} state
|
631
|
+
* Info passed around.
|
632
|
+
* @param {string} value
|
633
|
+
* CSS declarations.
|
634
|
+
* @returns {Style}
|
635
|
+
* Properties.
|
636
|
+
* @throws
|
637
|
+
* Throws `VFileMessage` when CSS cannot be parsed.
|
638
|
+
*/
|
639
|
+
function parseStyle(state, value) {
|
640
|
+
try {
|
641
|
+
return styleToJs(value, {reactCompat: true})
|
642
|
+
} catch (error) {
|
643
|
+
if (state.ignoreInvalidStyle) {
|
644
|
+
return {}
|
645
|
+
}
|
646
|
+
|
647
|
+
const cause = /** @type {Error} */ (error);
|
648
|
+
const message = new VFileMessage('Cannot parse `style` attribute', {
|
649
|
+
ancestors: state.ancestors,
|
650
|
+
cause,
|
651
|
+
ruleId: 'style',
|
652
|
+
source: 'hast-util-to-jsx-runtime'
|
653
|
+
});
|
654
|
+
message.file = state.filePath || undefined;
|
655
|
+
message.url = docs + '#cannot-parse-style-attribute';
|
656
|
+
|
657
|
+
throw message
|
658
|
+
}
|
659
|
+
}
|
660
|
+
|
661
|
+
/**
|
662
|
+
* Create a JSX name from a string.
|
663
|
+
*
|
664
|
+
* @param {State} state
|
665
|
+
* To do.
|
666
|
+
* @param {string} name
|
667
|
+
* Name.
|
668
|
+
* @param {boolean} allowExpression
|
669
|
+
* Allow member expressions and identifiers.
|
670
|
+
* @returns {unknown}
|
671
|
+
* To do.
|
672
|
+
*/
|
673
|
+
function findComponentFromName(state, name$1, allowExpression) {
|
674
|
+
/** @type {Identifier | Literal | MemberExpression} */
|
675
|
+
let result;
|
676
|
+
|
677
|
+
if (!allowExpression) {
|
678
|
+
result = {type: 'Literal', value: name$1};
|
679
|
+
} else if (name$1.includes('.')) {
|
680
|
+
const identifiers = name$1.split('.');
|
681
|
+
let index = -1;
|
682
|
+
/** @type {Identifier | Literal | MemberExpression | undefined} */
|
683
|
+
let node;
|
684
|
+
|
685
|
+
while (++index < identifiers.length) {
|
686
|
+
/** @type {Identifier | Literal} */
|
687
|
+
const prop = name(identifiers[index])
|
688
|
+
? {type: 'Identifier', name: identifiers[index]}
|
689
|
+
: {type: 'Literal', value: identifiers[index]};
|
690
|
+
node = node
|
691
|
+
? {
|
692
|
+
type: 'MemberExpression',
|
693
|
+
object: node,
|
694
|
+
property: prop,
|
695
|
+
computed: Boolean(index && prop.type === 'Literal'),
|
696
|
+
optional: false
|
697
|
+
}
|
698
|
+
: prop;
|
699
|
+
}
|
700
|
+
result = node;
|
701
|
+
} else {
|
702
|
+
result =
|
703
|
+
name(name$1) && !/^[a-z]/.test(name$1)
|
704
|
+
? {type: 'Identifier', name: name$1}
|
705
|
+
: {type: 'Literal', value: name$1};
|
706
|
+
}
|
707
|
+
|
708
|
+
// Only literals can be passed in `components` currently.
|
709
|
+
// No identifiers / member expressions.
|
710
|
+
if (result.type === 'Literal') {
|
711
|
+
const name = /** @type {string | number} */ (result.value);
|
712
|
+
return own.call(state.components, name) ? state.components[name] : name
|
713
|
+
}
|
714
|
+
|
715
|
+
// Assume component.
|
716
|
+
if (state.evaluater) {
|
717
|
+
return state.evaluater.evaluateExpression(result)
|
718
|
+
}
|
719
|
+
|
720
|
+
crashEstree(state);
|
721
|
+
}
|
722
|
+
|
723
|
+
/**
|
724
|
+
* @param {State} state
|
725
|
+
* @param {Position | undefined} [place]
|
726
|
+
* @returns {never}
|
727
|
+
*/
|
728
|
+
function crashEstree(state, place) {
|
729
|
+
const message = new VFileMessage(
|
730
|
+
'Cannot handle MDX estrees without `createEvaluater`',
|
731
|
+
{
|
732
|
+
ancestors: state.ancestors,
|
733
|
+
place,
|
734
|
+
ruleId: 'mdx-estree',
|
735
|
+
source: 'hast-util-to-jsx-runtime'
|
736
|
+
}
|
737
|
+
);
|
738
|
+
message.file = state.filePath || undefined;
|
739
|
+
message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater';
|
740
|
+
|
741
|
+
throw message
|
742
|
+
}
|
743
|
+
|
744
|
+
/**
|
745
|
+
* Transform a DOM casing style object to a CSS casing style object.
|
746
|
+
*
|
747
|
+
* @param {Style} domCasing
|
748
|
+
* @returns {Style}
|
749
|
+
*/
|
750
|
+
function transformStylesToCssCasing(domCasing) {
|
751
|
+
/** @type {Style} */
|
752
|
+
const cssCasing = {};
|
753
|
+
/** @type {string} */
|
754
|
+
let from;
|
755
|
+
|
756
|
+
for (from in domCasing) {
|
757
|
+
if (own.call(domCasing, from)) {
|
758
|
+
cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
|
759
|
+
}
|
760
|
+
}
|
761
|
+
|
762
|
+
return cssCasing
|
763
|
+
}
|
764
|
+
|
765
|
+
/**
|
766
|
+
* Transform a DOM casing style field to a CSS casing style field.
|
767
|
+
*
|
768
|
+
* @param {string} from
|
769
|
+
* @returns {string}
|
770
|
+
*/
|
771
|
+
function transformStyleToCssCasing(from) {
|
772
|
+
let to = from.replace(cap, toDash);
|
773
|
+
// Handle `ms-xxx` -> `-ms-xxx`.
|
774
|
+
if (to.slice(0, 3) === 'ms-') to = '-' + to;
|
775
|
+
return to
|
776
|
+
}
|
777
|
+
|
778
|
+
/**
|
779
|
+
* Make `$0` dash cased.
|
780
|
+
*
|
781
|
+
* @param {string} $0
|
782
|
+
* Capitalized ASCII leter.
|
783
|
+
* @returns {string}
|
784
|
+
* Dash and lower letter.
|
785
|
+
*/
|
786
|
+
function toDash($0) {
|
787
|
+
return '-' + $0.toLowerCase()
|
788
|
+
}
|
789
|
+
|
790
|
+
export { toJsxRuntime };
|
791
|
+
//# sourceMappingURL=index.js.map
|