@axdspub/axiom-ui-forms 0.2.8 → 0.2.9-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +329 -350
- 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
@@ -3,28 +3,39 @@ import { Button, TextArea } from '../../../../node_modules/@axdspub/axiom-ui-uti
|
|
3
3
|
import FieldLabel from '../FieldLabel.js';
|
4
4
|
import { EMapShape } from '../../../../node_modules/@axdspub/axiom-maps/library/index.js';
|
5
5
|
import { OpenLayersMap as OpenLayersMapComponent } from '../../../../node_modules/@axdspub/axiom-maps/library/openlayers/index.esm.js';
|
6
|
-
import React__default, { useState, useEffect } from 'react';
|
7
|
-
import {
|
6
|
+
import React__default, { useState, useEffect, useCallback } from 'react';
|
7
|
+
import { DrawingPinFilledIcon, BorderSolidIcon, SquareIcon, TrashIcon } from '../../../../node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
8
8
|
|
9
9
|
/*
|
10
10
|
List of coordinates for testing. Around Anchorage.
|
11
|
-
|
12
|
-
61.26059021199541, -150.7356022485971
|
13
|
-
61.05235501381105, -150.61435734866856
|
14
|
-
61.06014246374005, -149.9221328461051
|
15
|
-
61.441517540302925, -149.16102284579276
|
16
|
-
61.44480592425796, -150.3785489314675
|
11
|
+
...
|
17
12
|
*/
|
13
|
+
// --- calculateCenterFromGeoJSON remains the same (zoom ignored for initial load) ---
|
18
14
|
var calculateCenterFromGeoJSON = function (geo) {
|
19
|
-
|
15
|
+
var _a;
|
16
|
+
// ... (Implementation from previous correct version) ...
|
17
|
+
// If input is Geometry, wrap it temporarily for calculation
|
18
|
+
var featureCollection;
|
19
|
+
if (geo && geo.type !== 'FeatureCollection') {
|
20
|
+
if (geo.type === 'Feature') {
|
21
|
+
featureCollection = { type: 'FeatureCollection', features: [geo] };
|
22
|
+
}
|
23
|
+
else if (geo.type === 'Point' || geo.type === 'LineString' || geo.type === 'Polygon' /* add others as needed */) {
|
24
|
+
featureCollection = { type: 'FeatureCollection', features: [{ type: 'Feature', properties: {}, geometry: geo }] };
|
25
|
+
}
|
26
|
+
}
|
27
|
+
else if (geo && geo.type === 'FeatureCollection') {
|
28
|
+
featureCollection = geo;
|
29
|
+
}
|
30
|
+
if (!featureCollection || !('features' in featureCollection) || !Array.isArray(featureCollection.features) || featureCollection.features.length === 0) {
|
20
31
|
return { lat: 61.2181, lon: -149.9003, zoom: 8 }; // Default to Anchorage
|
21
32
|
}
|
22
|
-
var feature =
|
33
|
+
var feature = featureCollection.features[0];
|
23
34
|
if (!(feature === null || feature === void 0 ? void 0 : feature.geometry)) {
|
24
35
|
return { lat: 61.2181, lon: -149.9003, zoom: 8 };
|
25
36
|
}
|
26
37
|
var geometry = feature.geometry;
|
27
|
-
var coordinates = [];
|
38
|
+
var coordinates = []; // Adjusted type
|
28
39
|
switch (geometry.type) {
|
29
40
|
case 'Polygon':
|
30
41
|
coordinates = geometry.coordinates[0]; // Get first ring (ignore holes)
|
@@ -33,12 +44,22 @@ var calculateCenterFromGeoJSON = function (geo) {
|
|
33
44
|
coordinates = geometry.coordinates;
|
34
45
|
break;
|
35
46
|
case 'Point':
|
36
|
-
coordinates = [geometry.coordinates];
|
47
|
+
coordinates = [geometry.coordinates]; // Wrap single point for uniform handling
|
37
48
|
break;
|
38
49
|
default:
|
39
50
|
return { lat: 61.2181, lon: -149.9003, zoom: 8 };
|
40
51
|
}
|
41
|
-
|
52
|
+
// Flatten coordinates for bounds calculation if needed (e.g., MultiPoint, MultiLineString)
|
53
|
+
var flatCoordinates = (_a = []).concat.apply(_a, coordinates);
|
54
|
+
if (!Array.isArray(flatCoordinates) || flatCoordinates.length === 0 || !Array.isArray(flatCoordinates[0])) {
|
55
|
+
// Handle single point case where flatCoordinates might be just [lon, lat]
|
56
|
+
if (Array.isArray(flatCoordinates) && flatCoordinates.length === 2 && typeof flatCoordinates[0] === 'number') {
|
57
|
+
var _b = flatCoordinates, lon = _b[0], lat = _b[1];
|
58
|
+
// FIX #2: Return a default zoom even for a point here for centering logic,
|
59
|
+
// but we won't use this zoom for the initial MAP_CONFIG.
|
60
|
+
return { lat: lat, lon: lon, zoom: 8 }; // Default zoom
|
61
|
+
}
|
62
|
+
console.warn('Could not determine coordinates for centering.');
|
42
63
|
return { lat: 61.2181, lon: -149.9003, zoom: 8 };
|
43
64
|
}
|
44
65
|
// Calculate bounds
|
@@ -49,7 +70,9 @@ var calculateCenterFromGeoJSON = function (geo) {
|
|
49
70
|
var sumLat = 0;
|
50
71
|
var sumLon = 0;
|
51
72
|
var count = 0;
|
52
|
-
|
73
|
+
flatCoordinates.forEach(function (coord) {
|
74
|
+
if (!Array.isArray(coord) || coord.length < 2)
|
75
|
+
return;
|
53
76
|
var lon = coord[0], lat = coord[1];
|
54
77
|
minLat = Math.min(minLat, lat);
|
55
78
|
maxLat = Math.max(maxLat, lat);
|
@@ -59,72 +82,202 @@ var calculateCenterFromGeoJSON = function (geo) {
|
|
59
82
|
sumLon += lon;
|
60
83
|
count++;
|
61
84
|
});
|
62
|
-
|
85
|
+
if (count === 0) {
|
86
|
+
return { lat: 61.2181, lon: -149.9003, zoom: 8 };
|
87
|
+
}
|
63
88
|
var centerLat = sumLat / count;
|
64
89
|
var centerLon = sumLon / count;
|
65
|
-
// Calculate zoom level based on bounds
|
66
90
|
var latDiff = maxLat - minLat;
|
67
91
|
var lonDiff = maxLon - minLon;
|
68
92
|
var maxDiff = Math.max(latDiff, lonDiff);
|
69
|
-
// Adjust zoom based on the size of the shape
|
70
93
|
var zoom = 8; // default zoom
|
71
|
-
if (maxDiff
|
72
|
-
zoom = 12;
|
94
|
+
if (count === 1 || maxDiff === 0)
|
95
|
+
zoom = 12;
|
96
|
+
else if (maxDiff < 0.1)
|
97
|
+
zoom = 12;
|
73
98
|
else if (maxDiff < 0.5)
|
74
|
-
zoom = 10;
|
99
|
+
zoom = 10;
|
75
100
|
else if (maxDiff < 1)
|
76
|
-
zoom = 9;
|
101
|
+
zoom = 9;
|
77
102
|
else if (maxDiff < 2)
|
78
|
-
zoom = 8;
|
103
|
+
zoom = 8;
|
79
104
|
else if (maxDiff < 5)
|
80
|
-
zoom = 7;
|
105
|
+
zoom = 7;
|
81
106
|
else
|
82
|
-
zoom = 6;
|
83
|
-
return {
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
107
|
+
zoom = 6;
|
108
|
+
return { lat: centerLat, lon: centerLon, zoom: zoom };
|
109
|
+
};
|
110
|
+
// Update getInitialDrawType function signature
|
111
|
+
var getInitialDrawType = function (field) {
|
112
|
+
var _a;
|
113
|
+
var settings = (_a = field.settings) !== null && _a !== void 0 ? _a : {};
|
114
|
+
var drawEnabled = settings.drawEnabled !== false;
|
115
|
+
var drawPointEnabled = settings.drawPointEnable === true && drawEnabled;
|
116
|
+
var drawPathEnabled = settings.drawPathEnabled === true && drawEnabled;
|
117
|
+
var drawPolygonEnabled = settings.drawPolygonEnabled === true && drawEnabled;
|
118
|
+
if (drawPointEnabled)
|
119
|
+
return EMapShape.point;
|
120
|
+
if (drawPathEnabled)
|
121
|
+
return EMapShape.linestring;
|
122
|
+
if (drawPolygonEnabled)
|
123
|
+
return EMapShape.polygon;
|
124
|
+
return EMapShape.point; // Defaulting to Point if none specified
|
88
125
|
};
|
89
|
-
var
|
126
|
+
var GeometryInput = function (_a) {
|
90
127
|
var _b, _c, _d, _e, _f;
|
91
128
|
var field = _a.field, onChange = _a.onChange, value = _a.value;
|
92
|
-
|
93
|
-
var
|
94
|
-
var
|
95
|
-
|
96
|
-
var
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
129
|
+
var _g = useState(undefined), map = _g[0], setMapState = _g[1];
|
130
|
+
var _h = useState(undefined), error = _h[0], setError = _h[1];
|
131
|
+
var showGeoJSONInput = useState(false)[0];
|
132
|
+
// Initialize geojson state from value prop
|
133
|
+
var _j = useState(function () {
|
134
|
+
if (value && typeof value === 'object' && 'type' in value && value.type !== 'FeatureCollection' && value.type !== 'Feature') {
|
135
|
+
return { type: 'Feature', properties: {}, geometry: value };
|
136
|
+
}
|
137
|
+
if (value && typeof value === 'object' && 'type' in value && value.type === 'Feature') {
|
138
|
+
return value;
|
139
|
+
}
|
140
|
+
return undefined;
|
141
|
+
}), geojson = _j[0], setGeojson = _j[1];
|
142
|
+
// Initialize drawing state - only true if no initial shape and drawing is enabled
|
143
|
+
var _k = useState(false), isDrawing = _k[0], setIsDrawing = _k[1];
|
144
|
+
var _l = useState(function () { return getInitialDrawType(field); }), currentDrawType = _l[0], setCurrentDrawType = _l[1];
|
145
|
+
// Settings from field props
|
146
|
+
var drawEnabled = ((_b = field.settings) === null || _b === void 0 ? void 0 : _b.drawEnabled) !== false;
|
147
|
+
var drawPointEnabled = ((_c = field.settings) === null || _c === void 0 ? void 0 : _c.drawPointEnable) === true && drawEnabled;
|
148
|
+
var drawPathEnabled = ((_d = field.settings) === null || _d === void 0 ? void 0 : _d.drawPathEnabled) === true && drawEnabled;
|
149
|
+
var drawPolygonEnabled = ((_e = field.settings) === null || _e === void 0 ? void 0 : _e.drawPolygonEnabled) === true && drawEnabled;
|
150
|
+
var showCoordinateInput = ((_f = field.settings) === null || _f === void 0 ? void 0 : _f.showCoordinateInput) !== false;
|
151
|
+
// Effect to handle value prop updates
|
104
152
|
useEffect(function () {
|
105
|
-
|
106
|
-
|
153
|
+
var normalizedFeature;
|
154
|
+
if (value && typeof value === 'object' && 'type' in value) {
|
155
|
+
if (value.type !== 'FeatureCollection' && value.type !== 'Feature') {
|
156
|
+
normalizedFeature = { type: 'Feature', properties: {}, geometry: value };
|
157
|
+
}
|
158
|
+
else if (value.type === 'Feature') {
|
159
|
+
normalizedFeature = value;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
var currentJson = geojson ? JSON.stringify(geojson) : '';
|
163
|
+
var newJson = normalizedFeature ? JSON.stringify(normalizedFeature) : '';
|
164
|
+
if (currentJson !== newJson) {
|
165
|
+
setGeojson(normalizedFeature);
|
166
|
+
if (normalizedFeature === null || normalizedFeature === void 0 ? void 0 : normalizedFeature.geometry) {
|
167
|
+
setIsDrawing(false);
|
168
|
+
}
|
107
169
|
}
|
108
|
-
|
109
|
-
|
170
|
+
}, [value]);
|
171
|
+
// Effect to sync map state with geojson
|
172
|
+
useEffect(function () {
|
173
|
+
if (!map)
|
174
|
+
return;
|
175
|
+
// Always update map's visual state to match geojson
|
176
|
+
if (geojson === null || geojson === void 0 ? void 0 : geojson.geometry) {
|
177
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [geojson] });
|
178
|
+
map.disableDraw(currentDrawType);
|
110
179
|
}
|
111
|
-
else
|
112
|
-
|
180
|
+
else {
|
181
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
182
|
+
// Only enable/disable drawing based on isDrawing state
|
183
|
+
if (isDrawing && drawEnabled) {
|
184
|
+
map.enableDraw(currentDrawType);
|
185
|
+
}
|
186
|
+
else {
|
187
|
+
map.disableDraw(currentDrawType);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
}, [map, geojson, currentDrawType, isDrawing, drawEnabled]);
|
191
|
+
// Effect to handle map drawing events
|
192
|
+
useEffect(function () {
|
193
|
+
if (!map)
|
194
|
+
return;
|
195
|
+
var drawCompleteListener = function (e) {
|
196
|
+
var _a, _b, _c;
|
197
|
+
var f = (_c = (_b = (_a = e.data) === null || _a === void 0 ? void 0 : _a.geojson) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c[0];
|
198
|
+
if (f) {
|
199
|
+
setGeojson(f);
|
200
|
+
setIsDrawing(false);
|
201
|
+
map.disableDraw(currentDrawType);
|
202
|
+
}
|
203
|
+
};
|
204
|
+
var drawUpdateListener = function (e) {
|
205
|
+
var _a, _b, _c;
|
206
|
+
var f = (_c = (_b = (_a = e.data) === null || _a === void 0 ? void 0 : _a.geojson) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c[0];
|
207
|
+
if (f) {
|
208
|
+
setGeojson(f);
|
209
|
+
}
|
210
|
+
else {
|
211
|
+
// Handle deletion via map tools
|
212
|
+
setGeojson(undefined);
|
213
|
+
setIsDrawing(false); // Ensure drawing is disabled when user deletes shape
|
214
|
+
}
|
215
|
+
};
|
216
|
+
map.onDrawComplete(drawCompleteListener);
|
217
|
+
map.onDrawUpdate(drawUpdateListener);
|
218
|
+
// Return cleanup function that removes the event listeners
|
219
|
+
return function () {
|
220
|
+
// Remove event listeners by re-adding with empty functions
|
221
|
+
map.onDrawComplete(function () { });
|
222
|
+
map.onDrawUpdate(function () { });
|
223
|
+
};
|
224
|
+
}, [map, currentDrawType]);
|
225
|
+
// Effect to notify parent of changes
|
226
|
+
useEffect(function () {
|
227
|
+
var _a;
|
228
|
+
onChange((_a = geojson === null || geojson === void 0 ? void 0 : geojson.geometry) !== null && _a !== void 0 ? _a : undefined);
|
229
|
+
}, [geojson]);
|
230
|
+
var clearShape = function () {
|
231
|
+
setGeojson(undefined);
|
232
|
+
setCoordinates('');
|
233
|
+
setShowShapeTypeButtons(false);
|
234
|
+
if (map && drawEnabled) {
|
235
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
236
|
+
var iType = getInitialDrawType(field);
|
237
|
+
setCurrentDrawType(iType);
|
238
|
+
setIsDrawing(true); // Explicitly enable drawing when user clicks clear
|
239
|
+
map.enableDraw(iType);
|
113
240
|
}
|
114
|
-
}
|
241
|
+
};
|
242
|
+
var handleDrawTypeChange = function (shapeType) {
|
243
|
+
if (map && drawEnabled) {
|
244
|
+
var isAllowed = (shapeType === EMapShape.point && drawPointEnabled) ||
|
245
|
+
(shapeType === EMapShape.linestring && drawPathEnabled) ||
|
246
|
+
(shapeType === EMapShape.polygon && drawPolygonEnabled);
|
247
|
+
if (isAllowed && shapeType !== currentDrawType) {
|
248
|
+
setGeojson(undefined);
|
249
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
250
|
+
setCurrentDrawType(shapeType);
|
251
|
+
setIsDrawing(true);
|
252
|
+
map.enableDraw(shapeType);
|
253
|
+
}
|
254
|
+
}
|
255
|
+
};
|
256
|
+
var handleCoordinatesChange = function (e) {
|
257
|
+
var newCoords = e !== null && e !== void 0 ? e : '';
|
258
|
+
setCoordinates(newCoords);
|
259
|
+
if (!newCoords.trim()) {
|
260
|
+
setGeojson(undefined);
|
261
|
+
setError(undefined);
|
262
|
+
setIsDrawing(false);
|
263
|
+
return;
|
264
|
+
}
|
265
|
+
var newFeature = createGeoJSONFromCoordinates(newCoords);
|
266
|
+
if (newFeature) {
|
267
|
+
setGeojson(newFeature);
|
268
|
+
setError(undefined);
|
269
|
+
setIsDrawing(false);
|
270
|
+
}
|
271
|
+
};
|
272
|
+
var initialMapCenter = calculateCenterFromGeoJSON(geojson);
|
273
|
+
var INITIAL_DEFAULT_ZOOM = 8; // Fixed default zoom
|
115
274
|
var MAP_CONFIG = {
|
116
275
|
baseLayerKey: 'hybrid',
|
117
276
|
height: '500px',
|
118
277
|
width: '100%',
|
119
|
-
style: {
|
120
|
-
|
121
|
-
|
122
|
-
right: '0px',
|
123
|
-
bottom: '0px',
|
124
|
-
padding: '0'
|
125
|
-
},
|
126
|
-
center: { lat: initialMapConfig.lat, lon: initialMapConfig.lon },
|
127
|
-
zoom: initialMapConfig.zoom,
|
278
|
+
style: { /* ... styles ... */},
|
279
|
+
center: { lat: initialMapCenter.lat, lon: initialMapCenter.lon },
|
280
|
+
zoom: INITIAL_DEFAULT_ZOOM, // Use fixed zoom
|
128
281
|
tools: {
|
129
282
|
draw: {
|
130
283
|
shape: currentDrawType,
|
@@ -132,341 +285,167 @@ var GeoJSONInput = function (_a) {
|
|
132
285
|
}
|
133
286
|
}
|
134
287
|
};
|
135
|
-
|
136
|
-
var
|
137
|
-
|
138
|
-
if (!
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
288
|
+
// ---- Coordinate Handling ----
|
289
|
+
var updateCoordinatesFromFeature = useCallback(function (feature) {
|
290
|
+
var _a, _b, _c;
|
291
|
+
if (!(feature === null || feature === void 0 ? void 0 : feature.geometry)) {
|
292
|
+
setCoordinates('');
|
293
|
+
return;
|
294
|
+
}
|
295
|
+
var geometry = feature.geometry;
|
296
|
+
var newCoords = '';
|
297
|
+
try {
|
298
|
+
if (geometry.type === 'Polygon') {
|
299
|
+
newCoords = ((_a = geometry.coordinates[0]) !== null && _a !== void 0 ? _a : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
300
|
+
}
|
301
|
+
else if (geometry.type === 'LineString') {
|
302
|
+
newCoords = ((_b = geometry.coordinates) !== null && _b !== void 0 ? _b : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
303
|
+
}
|
304
|
+
else if (geometry.type === 'Point') {
|
305
|
+
var coords = (_c = geometry.coordinates) !== null && _c !== void 0 ? _c : [NaN, NaN];
|
306
|
+
if (!isNaN(coords[0]) && !isNaN(coords[1])) {
|
307
|
+
newCoords = "".concat(coords[1], ", ").concat(coords[0]);
|
308
|
+
}
|
309
|
+
else {
|
310
|
+
newCoords = '';
|
311
|
+
}
|
312
|
+
}
|
313
|
+
}
|
314
|
+
catch (e) {
|
315
|
+
console.error('Err format coords:', e);
|
316
|
+
newCoords = '';
|
317
|
+
}
|
318
|
+
setCoordinates(newCoords);
|
319
|
+
// setShowShapeTypeButtons(shouldShowShapeButtons(newCoords)); // Let coordinate effect handle this
|
320
|
+
}, []);
|
143
321
|
var _m = useState(function () {
|
144
|
-
|
322
|
+
var _a, _b, _c;
|
323
|
+
if (!(geojson === null || geojson === void 0 ? void 0 : geojson.geometry))
|
145
324
|
return '';
|
146
|
-
var
|
147
|
-
|
148
|
-
|
149
|
-
var geometry = feature === null || feature === void 0 ? void 0 : feature.geometry;
|
150
|
-
if (!geometry)
|
151
|
-
return '';
|
325
|
+
var initCoords = '';
|
326
|
+
var geometry = geojson.geometry;
|
327
|
+
try {
|
152
328
|
if (geometry.type === 'Polygon') {
|
153
|
-
|
154
|
-
return coords.map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
329
|
+
initCoords = ((_a = geometry.coordinates[0]) !== null && _a !== void 0 ? _a : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
155
330
|
}
|
156
331
|
else if (geometry.type === 'LineString') {
|
157
|
-
|
158
|
-
return coords.map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
332
|
+
initCoords = ((_b = geometry.coordinates) !== null && _b !== void 0 ? _b : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
159
333
|
}
|
160
334
|
else if (geometry.type === 'Point') {
|
161
|
-
var coords = geometry.coordinates;
|
162
|
-
|
335
|
+
var coords = (_c = geometry.coordinates) !== null && _c !== void 0 ? _c : [NaN, NaN];
|
336
|
+
if (!isNaN(coords[0]) && !isNaN(coords[1])) {
|
337
|
+
initCoords = "".concat(coords[1], ", ").concat(coords[0]);
|
338
|
+
}
|
163
339
|
}
|
164
340
|
}
|
165
|
-
|
341
|
+
catch (e) {
|
342
|
+
console.error('Err init coords:', e);
|
343
|
+
initCoords = '';
|
344
|
+
}
|
345
|
+
return initCoords;
|
166
346
|
}), coordinates = _m[0], setCoordinates = _m[1];
|
167
|
-
|
168
|
-
return geojson !== undefined && geojson !== null
|
169
|
-
? typeof geojson === 'object'
|
170
|
-
? JSON.stringify(geojson, null, 2)
|
171
|
-
: String(geojson)
|
172
|
-
: '';
|
173
|
-
};
|
347
|
+
useEffect(function () { updateCoordinatesFromFeature(geojson); }, [geojson, updateCoordinatesFromFeature]);
|
174
348
|
var createGeoJSONFromCoordinates = function (coordString, forceType) {
|
175
349
|
if (!coordString.trim()) {
|
176
350
|
setError(undefined);
|
177
351
|
return undefined;
|
178
352
|
}
|
179
353
|
try {
|
180
|
-
var points = coordString
|
181
|
-
.
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
}
|
189
|
-
return [lon, lat];
|
190
|
-
});
|
191
|
-
if (points.length === 0) {
|
192
|
-
throw new Error('No valid coordinates found');
|
193
|
-
}
|
194
|
-
// Single point
|
195
|
-
if (points.length === 1) {
|
196
|
-
return {
|
197
|
-
type: 'Feature',
|
198
|
-
properties: {},
|
199
|
-
geometry: {
|
200
|
-
type: 'Point',
|
201
|
-
coordinates: points[0]
|
202
|
-
}
|
203
|
-
};
|
204
|
-
}
|
205
|
-
// For polygon or line, based on forceType or number of points
|
206
|
-
if (forceType === EMapShape.polygon || (!forceType && points.length >= 3)) {
|
207
|
-
// Close the polygon by adding the first point at the end if not already closed
|
208
|
-
if (JSON.stringify(points[0]) !== JSON.stringify(points[points.length - 1])) {
|
354
|
+
var points = coordString.split('\n').map(function (l) { return l.trim(); }).filter(function (l) { return l; }).map(function (l) { var _a = l.split(',').map(function (c) { return parseFloat(c.trim()); }), lat = _a[0], lon = _a[1]; if (isNaN(lat) || isNaN(lon) || lat < -90 || lat > 90 || lon < -180 || lon > 180)
|
355
|
+
throw Error("Invalid: ".concat(lat, ", ").concat(lon)); return [lon, lat]; });
|
356
|
+
if (points.length === 0)
|
357
|
+
throw Error('No valid coords');
|
358
|
+
if (points.length === 1 && drawPointEnabled)
|
359
|
+
return { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: points[0] } };
|
360
|
+
if ((forceType === EMapShape.polygon || (!forceType && points.length >= 3)) && drawPolygonEnabled) {
|
361
|
+
if (points.length > 0 && JSON.stringify(points[0]) !== JSON.stringify(points[points.length - 1]))
|
209
362
|
points.push(points[0]);
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
properties: {},
|
214
|
-
geometry: {
|
215
|
-
type: 'Polygon',
|
216
|
-
coordinates: [points]
|
217
|
-
}
|
218
|
-
};
|
363
|
+
if (points.length < 4)
|
364
|
+
throw Error('Min 3 unique coords for polygon');
|
365
|
+
return { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [points] } };
|
219
366
|
}
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
properties: {},
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
}
|
228
|
-
};
|
367
|
+
if ((forceType === EMapShape.linestring || (!forceType && points.length >= 2)) && drawPathEnabled) {
|
368
|
+
if (points.length < 2)
|
369
|
+
throw Error('Min 2 coords for path');
|
370
|
+
return { type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: points } };
|
371
|
+
}
|
372
|
+
setError('Cannot create shape. Check tools/coords.');
|
373
|
+
return undefined;
|
229
374
|
}
|
230
375
|
catch (e) {
|
231
|
-
setError(
|
376
|
+
setError("Invalid coords/count: ".concat(e.message, ". Use \"lat, lon\""));
|
232
377
|
return undefined;
|
233
378
|
}
|
234
379
|
};
|
235
|
-
var _o = useState(function () {
|
236
|
-
// Show buttons if initial value has 2+ coordinates
|
237
|
-
if (!value)
|
238
|
-
return false;
|
239
|
-
var geoValue = value;
|
240
|
-
if ((geoValue === null || geoValue === void 0 ? void 0 : geoValue.type) === 'FeatureCollection' && Array.isArray(geoValue.features) && geoValue.features.length > 0) {
|
241
|
-
var feature = geoValue.features[0];
|
242
|
-
var geometry = feature === null || feature === void 0 ? void 0 : feature.geometry;
|
243
|
-
if (!geometry)
|
244
|
-
return false;
|
245
|
-
if (geometry.type === 'Polygon' || geometry.type === 'LineString') {
|
246
|
-
return geometry.coordinates.length >= 2;
|
247
|
-
}
|
248
|
-
}
|
249
|
-
return false;
|
250
|
-
}), showShapeTypeButtons = _o[0], setShowShapeTypeButtons = _o[1];
|
251
|
-
var updateCoordinatesFromGeoJSON = function (geo) {
|
252
|
-
var _a, _b;
|
253
|
-
if (!geo || geo.type !== 'FeatureCollection' || !((_b = (_a = geo.features) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.geometry))
|
254
|
-
return;
|
255
|
-
var feature = geo.features[0];
|
256
|
-
var geometry = feature.geometry;
|
257
|
-
var newCoords = '';
|
258
|
-
if (geometry.type === 'Polygon') {
|
259
|
-
var coords = geometry.coordinates[0];
|
260
|
-
newCoords = coords.map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
261
|
-
}
|
262
|
-
else if (geometry.type === 'LineString') {
|
263
|
-
var coords = geometry.coordinates;
|
264
|
-
newCoords = coords.map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
265
|
-
}
|
266
|
-
else if (geometry.type === 'Point') {
|
267
|
-
var coords = geometry.coordinates;
|
268
|
-
newCoords = "".concat(coords[1], ", ").concat(coords[0]);
|
269
|
-
}
|
270
|
-
setCoordinates(newCoords);
|
271
|
-
setShowShapeTypeButtons(shouldShowShapeButtons(newCoords));
|
272
|
-
};
|
273
|
-
// i think this has to stay - we're basically staying in sync with dom element outside of react
|
274
|
-
useEffect(function () {
|
275
|
-
if (map === undefined)
|
276
|
-
return;
|
277
|
-
map.onDrawComplete(function (e) {
|
278
|
-
var _a, _b, _c;
|
279
|
-
console.log('draw complete', e);
|
280
|
-
setGeojson((_b = (_a = e.data) === null || _a === void 0 ? void 0 : _a.geojson.features) === null || _b === void 0 ? void 0 : _b[0]);
|
281
|
-
updateCoordinatesFromGeoJSON((_c = e.data) === null || _c === void 0 ? void 0 : _c.geojson);
|
282
|
-
setIsDrawing(false);
|
283
|
-
// Disable drawing after shape is completed
|
284
|
-
map.disableDraw(currentDrawType);
|
285
|
-
});
|
286
|
-
// On modify drawing
|
287
|
-
map.onDrawUpdate(function (e) {
|
288
|
-
var _a, _b, _c, _d;
|
289
|
-
console.log('draw update', e);
|
290
|
-
setGeojson((_c = (_b = (_a = e.data) === null || _a === void 0 ? void 0 : _a.geojson) === null || _b === void 0 ? void 0 : _b.features) === null || _c === void 0 ? void 0 : _c[0]);
|
291
|
-
updateCoordinatesFromGeoJSON((_d = e.data) === null || _d === void 0 ? void 0 : _d.geojson);
|
292
|
-
});
|
293
|
-
}, [map]);
|
294
|
-
// can we get rid of this?
|
295
|
-
useEffect(function () {
|
296
|
-
if (geojson !== undefined) {
|
297
|
-
onChange(geojson.geometry);
|
298
|
-
}
|
299
|
-
}, [geojson]);
|
300
|
-
var hasValidShape = function (geo) {
|
301
|
-
return geo !== undefined &&
|
302
|
-
'features' in geo &&
|
303
|
-
Array.isArray(geo.features) &&
|
304
|
-
geo.features.length > 0;
|
305
|
-
};
|
306
|
-
var clearShape = function () {
|
307
|
-
setGeojson(undefined);
|
308
|
-
onChange(undefined);
|
309
|
-
setCoordinates('');
|
310
|
-
if (map) {
|
311
|
-
map.setDrawGeojson({
|
312
|
-
type: 'FeatureCollection',
|
313
|
-
features: []
|
314
|
-
});
|
315
|
-
map.enableDraw(currentDrawType); // Re-enable drawing when shape is cleared
|
316
|
-
setIsDrawing(true);
|
317
|
-
}
|
318
|
-
};
|
319
|
-
var handleDrawTypeChange = function (shapeType) {
|
320
|
-
if (map) {
|
321
|
-
// Clear existing shape if any
|
322
|
-
map.setDrawGeojson({
|
323
|
-
type: 'FeatureCollection',
|
324
|
-
features: []
|
325
|
-
});
|
326
|
-
setGeojson(undefined);
|
327
|
-
onChange(undefined);
|
328
|
-
setCoordinates('');
|
329
|
-
setShowShapeTypeButtons(false);
|
330
|
-
setCurrentDrawType(shapeType);
|
331
|
-
map.enableDraw(shapeType);
|
332
|
-
setIsDrawing(true);
|
333
|
-
}
|
334
|
-
};
|
335
380
|
var shouldShowShapeButtons = function (coords) {
|
336
|
-
var
|
337
|
-
|
338
|
-
.filter(function (line) { return line.length > 0; })
|
339
|
-
.filter(function (line) {
|
340
|
-
try {
|
341
|
-
var _a = line.split(',').map(function (coord) { return parseFloat(coord.trim()); }), lat = _a[0], lon = _a[1];
|
342
|
-
return !isNaN(lat) && !isNaN(lon);
|
343
|
-
}
|
344
|
-
catch (_b) {
|
345
|
-
return false;
|
346
|
-
}
|
347
|
-
});
|
348
|
-
return validLines.length >= 3;
|
381
|
+
var validLinesCount = coords.trim().split('\n').filter(function (l) { return l.trim(); }).length;
|
382
|
+
return (drawPolygonEnabled || drawPathEnabled) && validLinesCount >= 2;
|
349
383
|
};
|
350
|
-
var
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
try {
|
355
|
-
var newGeoJSON = createGeoJSONFromCoordinates(newCoords);
|
356
|
-
if (newGeoJSON) {
|
357
|
-
setGeojson(newGeoJSON);
|
358
|
-
setError(undefined);
|
359
|
-
if (map) {
|
360
|
-
map.setDrawGeojson({
|
361
|
-
type: 'FeatureCollection',
|
362
|
-
features: []
|
363
|
-
});
|
364
|
-
map.setDrawGeojson({ type: 'FeatureCollection', features: [newGeoJSON] });
|
365
|
-
map.disableDraw(currentDrawType); // Disable drawing when coordinates are entered
|
366
|
-
}
|
367
|
-
}
|
368
|
-
else {
|
369
|
-
setGeojson(undefined);
|
370
|
-
onChange(undefined);
|
371
|
-
if (map) {
|
372
|
-
map.setDrawGeojson({
|
373
|
-
type: 'FeatureCollection',
|
374
|
-
features: []
|
375
|
-
});
|
376
|
-
}
|
377
|
-
}
|
378
|
-
}
|
379
|
-
catch (e) {
|
380
|
-
setError('Invalid coordinate format');
|
381
|
-
}
|
382
|
-
};
|
383
|
-
// Reload shape on the map
|
384
|
-
useEffect(function () {
|
385
|
-
if (map === undefined)
|
386
|
-
return;
|
387
|
-
if (geojson !== undefined && 'features' in geojson) {
|
388
|
-
map.setDrawGeojson({
|
389
|
-
type: 'FeatureCollection',
|
390
|
-
features: [geojson]
|
391
|
-
});
|
392
|
-
map.disableDraw(currentDrawType); // Disable drawing when there's a shape
|
393
|
-
setIsDrawing(false);
|
394
|
-
// Update coordinates display and shape type buttons
|
395
|
-
updateCoordinatesFromGeoJSON(geojson);
|
396
|
-
setShowShapeTypeButtons(shouldShowShapeButtons(coordinates));
|
397
|
-
}
|
398
|
-
else {
|
399
|
-
map.enableDraw(currentDrawType);
|
400
|
-
setIsDrawing(true);
|
401
|
-
}
|
402
|
-
}, [map, currentDrawType]);
|
384
|
+
var _o = useState(function () { return shouldShowShapeButtons(coordinates); }), showShapeTypeButtons = _o[0], setShowShapeTypeButtons = _o[1];
|
385
|
+
useEffect(function () { setShowShapeTypeButtons(shouldShowShapeButtons(coordinates)); }, [coordinates, drawPolygonEnabled, drawPathEnabled]); // Added effect to update buttons
|
386
|
+
// ---- Helper Functions ----
|
387
|
+
var hasValidShape = function (feature) { return !!(feature === null || feature === void 0 ? void 0 : feature.geometry); };
|
403
388
|
var applyShapeType = function (shapeType) {
|
404
|
-
var
|
405
|
-
if (
|
406
|
-
setGeojson(
|
389
|
+
var newFeature = createGeoJSONFromCoordinates(coordinates, shapeType);
|
390
|
+
if (newFeature) {
|
391
|
+
setGeojson(newFeature);
|
407
392
|
setError(undefined);
|
408
|
-
if (map) {
|
409
|
-
map.setDrawGeojson({
|
410
|
-
type: 'FeatureCollection',
|
411
|
-
features: []
|
412
|
-
});
|
413
|
-
map.setDrawGeojson({ type: 'FeatureCollection', features: [newGeoJSON] });
|
414
|
-
}
|
415
393
|
}
|
416
|
-
|
417
|
-
|
394
|
+
else if (!error) {
|
395
|
+
setError("Could not create ".concat(shapeType === EMapShape.polygon ? 'poly' : 'path', "."));
|
396
|
+
}
|
418
397
|
};
|
419
|
-
|
398
|
+
// ---- JSX Return (Reverting Button ClassNames and removing disabled) ----
|
399
|
+
return (React__default.createElement("div", null,
|
420
400
|
React__default.createElement(FieldLabel, __assign({}, field)),
|
421
401
|
React__default.createElement("div", { className: "relative" },
|
422
402
|
drawEnabled && (drawPolygonEnabled || drawPathEnabled || drawPointEnabled) && (React__default.createElement("div", { className: "absolute z-20 top-12 right-4 flex flex-col gap-2" },
|
423
|
-
|
424
|
-
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.
|
403
|
+
drawPointEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
404
|
+
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.point); },
|
405
|
+
// Reverted className logic
|
406
|
+
className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.point && isDrawing
|
425
407
|
? 'bg-white hover:bg-gray-50 ring-2 ring-yellow-200 shadow-[0_0_10px_rgba(253,224,71,0.5)]'
|
426
|
-
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center") },
|
427
|
-
React__default.createElement(
|
428
|
-
React__default.createElement("span", { className: "tooltip absolute right-full mr-2 px-2 py-1 bg-gray-800 text-white text-sm rounded whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none" }, "Draw
|
408
|
+
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center"), "aria-label": "Draw Point" },
|
409
|
+
React__default.createElement(DrawingPinFilledIcon, { className: "w-5 h-5" }),
|
410
|
+
React__default.createElement("span", { className: "tooltip absolute right-full mr-2 px-2 py-1 bg-gray-800 text-white text-sm rounded whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none" }, "Draw Point")))),
|
429
411
|
drawPathEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
430
|
-
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.linestring); },
|
412
|
+
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.linestring); },
|
413
|
+
// Reverted className logic
|
414
|
+
className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.linestring && isDrawing
|
431
415
|
? 'bg-white hover:bg-gray-50 ring-2 ring-yellow-200 shadow-[0_0_10px_rgba(253,224,71,0.5)]'
|
432
|
-
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center") },
|
416
|
+
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center"), "aria-label": "Draw Path" },
|
433
417
|
React__default.createElement(BorderSolidIcon, { className: "w-5 h-5" }),
|
434
418
|
React__default.createElement("span", { className: "tooltip absolute right-full mr-2 px-2 py-1 bg-gray-800 text-white text-sm rounded whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none" }, "Draw Path")))),
|
435
|
-
|
436
|
-
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.
|
419
|
+
drawPolygonEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
420
|
+
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.polygon); },
|
421
|
+
// Reverted className logic
|
422
|
+
className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.polygon && isDrawing
|
437
423
|
? 'bg-white hover:bg-gray-50 ring-2 ring-yellow-200 shadow-[0_0_10px_rgba(253,224,71,0.5)]'
|
438
|
-
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center") },
|
439
|
-
React__default.createElement(
|
440
|
-
React__default.createElement("span", { className: "tooltip absolute right-full mr-2 px-2 py-1 bg-gray-800 text-white text-sm rounded whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none" }, "Draw
|
424
|
+
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center"), "aria-label": "Draw Polygon" },
|
425
|
+
React__default.createElement(SquareIcon, { className: "w-5 h-5 rotate-45" }),
|
426
|
+
React__default.createElement("span", { className: "tooltip absolute right-full mr-2 px-2 py-1 bg-gray-800 text-white text-sm rounded whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none" }, "Draw Polygon")))),
|
441
427
|
hasValidShape(geojson) && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
442
|
-
React__default.createElement(Button, { onClick: clearShape, className: "p-2 rounded-lg shadow-lg bg-red-500 hover:bg-red-600 text-white w-10 h-10 flex items-center justify-center" },
|
428
|
+
React__default.createElement(Button, { onClick: clearShape, className: "p-2 rounded-lg shadow-lg bg-red-500 hover:bg-red-600 text-white w-10 h-10 flex items-center justify-center", "aria-label": "Clear Shape" },
|
443
429
|
React__default.createElement(TrashIcon, { className: "w-5 h-5" }),
|
444
430
|
React__default.createElement("span", { className: "tooltip absolute right-full mr-2 px-2 py-1 bg-gray-800 text-white text-sm rounded whitespace-nowrap opacity-0 group-hover:opacity-100 pointer-events-none" }, "Clear Shape")))))),
|
445
431
|
React__default.createElement(OpenLayersMapComponent, __assign({}, MAP_CONFIG, { setState: setMapState })),
|
446
432
|
showCoordinateInput && (React__default.createElement("div", { className: "mt-4" },
|
447
|
-
React__default.createElement("div", { className: "flex justify-between items-center mb-2" },
|
448
|
-
React__default.createElement("span",
|
449
|
-
"
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
"
|
455
|
-
|
456
|
-
|
457
|
-
"
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
onChange(JSON.parse(e !== null && e !== void 0 ? e : ''));
|
463
|
-
setError(undefined);
|
464
|
-
}
|
465
|
-
catch (e) {
|
466
|
-
setError('Invalid JSON');
|
467
|
-
}
|
468
|
-
} })));
|
433
|
+
React__default.createElement("div", { className: "flex justify-between items-center mb-2 flex-wrap gap-y-2" },
|
434
|
+
React__default.createElement("span", { className: "text-sm" },
|
435
|
+
" ",
|
436
|
+
" "),
|
437
|
+
showShapeTypeButtons && (drawPathEnabled || drawPolygonEnabled) && (React__default.createElement("div", { className: "flex gap-2" },
|
438
|
+
" ",
|
439
|
+
drawPathEnabled && React__default.createElement(Button, { onClick: function () { applyShapeType(EMapShape.linestring); }, className: "px-3 py-1 bg-white hover:bg-gray-50 text-black rounded-lg shadow-sm border border-gray-200 text-xs flex items-center gap-1" },
|
440
|
+
React__default.createElement(BorderSolidIcon, { className: "w-3 h-3" }),
|
441
|
+
"Create Path"),
|
442
|
+
drawPolygonEnabled && React__default.createElement(Button, { onClick: function () { applyShapeType(EMapShape.polygon); }, className: "px-3 py-1 bg-white hover:bg-gray-50 text-black rounded-lg shadow-sm border border-gray-200 text-xs flex items-center gap-1" },
|
443
|
+
React__default.createElement(SquareIcon, { className: "w-3 h-3 rotate-45" }),
|
444
|
+
"Create Polygon")))),
|
445
|
+
React__default.createElement(TextArea, { error: error, className: 'min-h-[100px] bg-slate-50 rounded-lg shadow-inner font-mono text-sm', id: "".concat(field.id, "-coordinates"), testId: "".concat(field.id, "-coordinates"), value: coordinates, onChange: handleCoordinatesChange, placeholder: '...', "aria-label": "Coordinates Input" }),
|
446
|
+
error && React__default.createElement("p", { className: "text-red-600 text-xs mt-1" }, error))),
|
447
|
+
showGeoJSONInput && (React__default.createElement(TextArea, { error: error, className: '...', id: field.id + '-debug', testId: field.id + '-debug', label: React__default.createElement(FieldLabel, __assign({}, field, { label: "Debug GeoJSON Feature State" })), value: geojson ? JSON.stringify(geojson, null, 2) : '', disabled: true })))));
|
469
448
|
};
|
470
449
|
|
471
|
-
export {
|
450
|
+
export { GeometryInput, GeometryInput as default };
|
472
451
|
//# sourceMappingURL=Geometry.js.map
|