@axdspub/axiom-ui-forms 0.2.7 → 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 +55 -6
- package/library/esm/_virtual/formats.js +4 -0
- package/library/esm/_virtual/formats.js.map +1 -0
- package/library/esm/_virtual/index.js +6 -2
- package/library/esm/_virtual/index.js.map +1 -1
- 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 +8 -0
- package/library/esm/_virtual/index13.js.map +1 -0
- package/library/esm/_virtual/index14.js +4 -0
- package/library/esm/_virtual/index14.js.map +1 -0
- 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/index2.js +2 -2
- package/library/esm/_virtual/index4.js +2 -2
- package/library/esm/_virtual/index4.js.map +1 -1
- package/library/esm/_virtual/index5.js +2 -2
- 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/index8.js +2 -2
- package/library/esm/_virtual/limit.js +4 -0
- package/library/esm/_virtual/limit.js.map +1 -0
- 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/codegen/index.js +1 -1
- 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/discriminator/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/library/esm/node_modules/ajv-formats/dist/formats.js +221 -0
- package/library/esm/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/library/esm/node_modules/ajv-formats/dist/index.js +53 -0
- package/library/esm/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/library/esm/node_modules/ajv-formats/dist/limit.js +84 -0
- package/library/esm/node_modules/ajv-formats/dist/limit.js.map +1 -0
- 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/FieldCreator.js +0 -1
- package/library/esm/src/Form/Components/FieldCreator.js.map +1 -1
- 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/Constant.js +18 -0
- package/library/esm/src/Form/Components/Inputs/Constant.js.map +1 -0
- 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/OneOfInput.js +9 -0
- package/library/esm/src/Form/Components/Inputs/OneOfInput.js.map +1 -0
- package/library/esm/src/Form/Components/Inputs/String.js +9 -3
- package/library/esm/src/Form/Components/Inputs/String.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/inputMap.js +7 -3
- package/library/esm/src/Form/Components/Inputs/inputMap.js.map +1 -1
- package/library/esm/src/Form/Creator/FormCreator.js +42 -49
- 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 +12 -2
- package/library/esm/src/Form/helpers.js.map +1 -1
- package/library/esm/src/Form/schemaToFormHelpers.js +209 -18
- package/library/esm/src/Form/schemaToFormHelpers.js.map +1 -1
- package/library/esm/src/library.js +2 -2
- package/package.json +8 -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, useCallback, useEffect } 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,78 @@ 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
|
-
lat: centerLat,
|
85
|
-
lon: centerLon,
|
86
|
-
zoom: zoom
|
87
|
-
};
|
107
|
+
zoom = 6;
|
108
|
+
return { lat: centerLat, lon: centerLon, zoom: zoom };
|
88
109
|
};
|
89
|
-
|
110
|
+
// Helper function to determine initial draw type based on settings
|
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
|
125
|
+
};
|
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
|
-
var
|
96
|
-
|
97
|
-
|
98
|
-
var drawEnabled = ((_b = field.settings) === null || _b === void 0 ? void 0 : _b.drawEnabled) !== false; // Default to true if not specified
|
99
|
-
var drawPolygonEnabled = ((_c = field.settings) === null || _c === void 0 ? void 0 : _c.drawPolygonEnabled) !== false && drawEnabled; // Default to true if drawEnabled and not specified
|
100
|
-
var drawPathEnabled = ((_d = field.settings) === null || _d === void 0 ? void 0 : _d.drawPathEnabled) !== false && drawEnabled; // Default to true if drawEnabled and not specified
|
101
|
-
var drawPointEnabled = ((_e = field.settings) === null || _e === void 0 ? void 0 : _e.drawPointEnabled) !== false && drawEnabled; // Default to true if drawEnabled and not specified
|
102
|
-
var showCoordinateInput = ((_f = field.settings) === null || _f === void 0 ? void 0 : _f.showCoordinateInput) !== false; // Default to true if not specified
|
103
|
-
// Set initial draw type based on enabled tools
|
104
|
-
useEffect(function () {
|
105
|
-
if (drawPolygonEnabled) {
|
106
|
-
setCurrentDrawType(EMapShape.polygon);
|
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
|
+
var _j = useState(function () {
|
133
|
+
if (value && typeof value === 'object' && 'type' in value && value.type !== 'FeatureCollection' && value.type !== 'Feature') {
|
134
|
+
return { type: 'Feature', properties: {}, geometry: value };
|
107
135
|
}
|
108
|
-
|
109
|
-
|
136
|
+
if (value && typeof value === 'object' && 'type' in value && value.type === 'Feature') {
|
137
|
+
return value;
|
110
138
|
}
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
139
|
+
return undefined;
|
140
|
+
}), geojson = _j[0], setGeojson = _j[1];
|
141
|
+
var drawEnabled = ((_b = field.settings) === null || _b === void 0 ? void 0 : _b.drawEnabled) !== false;
|
142
|
+
var drawPointEnabled = ((_c = field.settings) === null || _c === void 0 ? void 0 : _c.drawPointEnable) === true && drawEnabled;
|
143
|
+
var drawPathEnabled = ((_d = field.settings) === null || _d === void 0 ? void 0 : _d.drawPathEnabled) === true && drawEnabled;
|
144
|
+
var drawPolygonEnabled = ((_e = field.settings) === null || _e === void 0 ? void 0 : _e.drawPolygonEnabled) === true && drawEnabled;
|
145
|
+
var showCoordinateInput = ((_f = field.settings) === null || _f === void 0 ? void 0 : _f.showCoordinateInput) !== false;
|
146
|
+
var _k = useState(function () { return getInitialDrawType(field); }), currentDrawType = _k[0], setCurrentDrawType = _k[1];
|
147
|
+
var _l = useState(!geojson && drawEnabled), isDrawing = _l[0], setIsDrawing = _l[1];
|
148
|
+
var initialMapCenter = calculateCenterFromGeoJSON(geojson);
|
149
|
+
var INITIAL_DEFAULT_ZOOM = 8; // Fixed default zoom
|
115
150
|
var MAP_CONFIG = {
|
116
151
|
baseLayerKey: 'hybrid',
|
117
152
|
height: '500px',
|
118
153
|
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,
|
154
|
+
style: { /* ... styles ... */},
|
155
|
+
center: { lat: initialMapCenter.lat, lon: initialMapCenter.lon },
|
156
|
+
zoom: INITIAL_DEFAULT_ZOOM, // Use fixed zoom
|
128
157
|
tools: {
|
129
158
|
draw: {
|
130
159
|
shape: currentDrawType,
|
@@ -132,341 +161,273 @@ var GeoJSONInput = function (_a) {
|
|
132
161
|
}
|
133
162
|
}
|
134
163
|
};
|
135
|
-
|
136
|
-
var
|
137
|
-
|
138
|
-
if (!
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
164
|
+
// ---- Coordinate Handling ----
|
165
|
+
var updateCoordinatesFromFeature = useCallback(function (feature) {
|
166
|
+
var _a, _b, _c;
|
167
|
+
if (!(feature === null || feature === void 0 ? void 0 : feature.geometry)) {
|
168
|
+
setCoordinates('');
|
169
|
+
return;
|
170
|
+
}
|
171
|
+
var geometry = feature.geometry;
|
172
|
+
var newCoords = '';
|
173
|
+
try {
|
174
|
+
if (geometry.type === 'Polygon') {
|
175
|
+
newCoords = ((_a = geometry.coordinates[0]) !== null && _a !== void 0 ? _a : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
176
|
+
}
|
177
|
+
else if (geometry.type === 'LineString') {
|
178
|
+
newCoords = ((_b = geometry.coordinates) !== null && _b !== void 0 ? _b : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
179
|
+
}
|
180
|
+
else if (geometry.type === 'Point') {
|
181
|
+
var coords = (_c = geometry.coordinates) !== null && _c !== void 0 ? _c : [NaN, NaN];
|
182
|
+
if (!isNaN(coords[0]) && !isNaN(coords[1])) {
|
183
|
+
newCoords = "".concat(coords[1], ", ").concat(coords[0]);
|
184
|
+
}
|
185
|
+
else {
|
186
|
+
newCoords = '';
|
187
|
+
}
|
188
|
+
}
|
189
|
+
}
|
190
|
+
catch (e) {
|
191
|
+
console.error('Err format coords:', e);
|
192
|
+
newCoords = '';
|
193
|
+
}
|
194
|
+
setCoordinates(newCoords);
|
195
|
+
// setShowShapeTypeButtons(shouldShowShapeButtons(newCoords)); // Let coordinate effect handle this
|
196
|
+
}, []);
|
143
197
|
var _m = useState(function () {
|
144
|
-
|
198
|
+
var _a, _b, _c;
|
199
|
+
if (!(geojson === null || geojson === void 0 ? void 0 : geojson.geometry))
|
145
200
|
return '';
|
146
|
-
var
|
147
|
-
|
148
|
-
|
149
|
-
var geometry = feature === null || feature === void 0 ? void 0 : feature.geometry;
|
150
|
-
if (!geometry)
|
151
|
-
return '';
|
201
|
+
var initCoords = '';
|
202
|
+
var geometry = geojson.geometry;
|
203
|
+
try {
|
152
204
|
if (geometry.type === 'Polygon') {
|
153
|
-
|
154
|
-
return coords.map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
205
|
+
initCoords = ((_a = geometry.coordinates[0]) !== null && _a !== void 0 ? _a : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
155
206
|
}
|
156
207
|
else if (geometry.type === 'LineString') {
|
157
|
-
|
158
|
-
return coords.map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
208
|
+
initCoords = ((_b = geometry.coordinates) !== null && _b !== void 0 ? _b : []).map(function (pos) { return "".concat(pos[1], ", ").concat(pos[0]); }).join('\n');
|
159
209
|
}
|
160
210
|
else if (geometry.type === 'Point') {
|
161
|
-
var coords = geometry.coordinates;
|
162
|
-
|
211
|
+
var coords = (_c = geometry.coordinates) !== null && _c !== void 0 ? _c : [NaN, NaN];
|
212
|
+
if (!isNaN(coords[0]) && !isNaN(coords[1])) {
|
213
|
+
initCoords = "".concat(coords[1], ", ").concat(coords[0]);
|
214
|
+
}
|
163
215
|
}
|
164
216
|
}
|
165
|
-
|
217
|
+
catch (e) {
|
218
|
+
console.error('Err init coords:', e);
|
219
|
+
initCoords = '';
|
220
|
+
}
|
221
|
+
return initCoords;
|
166
222
|
}), 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
|
-
};
|
223
|
+
useEffect(function () { updateCoordinatesFromFeature(geojson); }, [geojson, updateCoordinatesFromFeature]);
|
174
224
|
var createGeoJSONFromCoordinates = function (coordString, forceType) {
|
175
225
|
if (!coordString.trim()) {
|
176
226
|
setError(undefined);
|
177
227
|
return undefined;
|
178
228
|
}
|
179
229
|
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])) {
|
230
|
+
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)
|
231
|
+
throw Error("Invalid: ".concat(lat, ", ").concat(lon)); return [lon, lat]; });
|
232
|
+
if (points.length === 0)
|
233
|
+
throw Error('No valid coords');
|
234
|
+
if (points.length === 1 && drawPointEnabled)
|
235
|
+
return { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: points[0] } };
|
236
|
+
if ((forceType === EMapShape.polygon || (!forceType && points.length >= 3)) && drawPolygonEnabled) {
|
237
|
+
if (points.length > 0 && JSON.stringify(points[0]) !== JSON.stringify(points[points.length - 1]))
|
209
238
|
points.push(points[0]);
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
properties: {},
|
214
|
-
geometry: {
|
215
|
-
type: 'Polygon',
|
216
|
-
coordinates: [points]
|
217
|
-
}
|
218
|
-
};
|
239
|
+
if (points.length < 4)
|
240
|
+
throw Error('Min 3 unique coords for polygon');
|
241
|
+
return { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [points] } };
|
219
242
|
}
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
properties: {},
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
}
|
228
|
-
};
|
243
|
+
if ((forceType === EMapShape.linestring || (!forceType && points.length >= 2)) && drawPathEnabled) {
|
244
|
+
if (points.length < 2)
|
245
|
+
throw Error('Min 2 coords for path');
|
246
|
+
return { type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: points } };
|
247
|
+
}
|
248
|
+
setError('Cannot create shape. Check tools/coords.');
|
249
|
+
return undefined;
|
229
250
|
}
|
230
251
|
catch (e) {
|
231
|
-
setError(
|
252
|
+
setError("Invalid coords/count: ".concat(e.message, ". Use \"lat, lon\""));
|
232
253
|
return undefined;
|
233
254
|
}
|
234
255
|
};
|
235
|
-
var
|
236
|
-
|
237
|
-
|
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));
|
256
|
+
var shouldShowShapeButtons = function (coords) {
|
257
|
+
var validLinesCount = coords.trim().split('\n').filter(function (l) { return l.trim(); }).length;
|
258
|
+
return (drawPolygonEnabled || drawPathEnabled) && validLinesCount >= 2;
|
272
259
|
};
|
273
|
-
|
260
|
+
var _o = useState(function () { return shouldShowShapeButtons(coordinates); }), showShapeTypeButtons = _o[0], setShowShapeTypeButtons = _o[1];
|
261
|
+
useEffect(function () { setShowShapeTypeButtons(shouldShowShapeButtons(coordinates)); }, [coordinates, drawPolygonEnabled, drawPathEnabled]); // Added effect to update buttons
|
262
|
+
// ---- Map Event Handlers & State Updates ----
|
274
263
|
useEffect(function () {
|
275
|
-
if (map
|
264
|
+
if (!map)
|
276
265
|
return;
|
277
|
-
|
278
|
-
|
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);
|
266
|
+
var drawCompleteListener = function (e) { var _a, _b, _c; /* ... same ... */ 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]; if (f) {
|
267
|
+
setGeojson(f);
|
282
268
|
setIsDrawing(false);
|
283
|
-
// Disable drawing after shape is completed
|
284
269
|
map.disableDraw(currentDrawType);
|
285
|
-
}
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
}, [map]);
|
294
|
-
// can we get rid of this?
|
270
|
+
} };
|
271
|
+
var drawUpdateListener = function (e) { var _a, _b, _c; /* ... same ... */ 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]; if (f) {
|
272
|
+
setGeojson(f);
|
273
|
+
} };
|
274
|
+
map.onDrawComplete(drawCompleteListener);
|
275
|
+
map.onDrawUpdate(drawUpdateListener);
|
276
|
+
// Cleanup omitted
|
277
|
+
}, [map, currentDrawType]);
|
295
278
|
useEffect(function () {
|
296
|
-
|
297
|
-
|
298
|
-
|
279
|
+
var _a;
|
280
|
+
onChange((_a = geojson === null || geojson === void 0 ? void 0 : geojson.geometry) !== null && _a !== void 0 ? _a : undefined);
|
281
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
299
282
|
}, [geojson]);
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
283
|
+
useEffect(function () {
|
284
|
+
if (!map)
|
285
|
+
return;
|
286
|
+
var correctDrawType = getInitialDrawType(field);
|
287
|
+
if (currentDrawType !== correctDrawType) {
|
288
|
+
setCurrentDrawType(correctDrawType);
|
289
|
+
}
|
290
|
+
if (geojson === null || geojson === void 0 ? void 0 : geojson.geometry) {
|
291
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [geojson] });
|
292
|
+
map.disableDraw(correctDrawType); // Ensure correct tool is disabled
|
293
|
+
setIsDrawing(false);
|
294
|
+
}
|
295
|
+
else {
|
296
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
297
|
+
if (drawEnabled && (drawPointEnabled || drawPathEnabled || drawPolygonEnabled)) {
|
298
|
+
map.enableDraw(correctDrawType); // Enable the correct initial tool
|
299
|
+
setIsDrawing(true);
|
300
|
+
}
|
301
|
+
else {
|
302
|
+
map.disableDraw(correctDrawType); // Ensure drawing is off if not enabled
|
303
|
+
setIsDrawing(false);
|
304
|
+
}
|
305
|
+
}
|
306
|
+
}, [map, geojson, drawEnabled, drawPointEnabled, drawPathEnabled, drawPolygonEnabled, currentDrawType, field]);
|
307
|
+
// ---- Helper Functions ----
|
308
|
+
var hasValidShape = function (feature) { return !!(feature === null || feature === void 0 ? void 0 : feature.geometry); };
|
306
309
|
var clearShape = function () {
|
307
310
|
setGeojson(undefined);
|
308
|
-
onChange(undefined);
|
309
311
|
setCoordinates('');
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
map.enableDraw(
|
312
|
+
setShowShapeTypeButtons(false);
|
313
|
+
if (map && drawEnabled) {
|
314
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
315
|
+
var iType = getInitialDrawType(field);
|
316
|
+
setCurrentDrawType(iType);
|
317
|
+
map.enableDraw(iType);
|
316
318
|
setIsDrawing(true);
|
317
319
|
}
|
318
320
|
};
|
319
321
|
var handleDrawTypeChange = function (shapeType) {
|
320
|
-
if (map) {
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
onChange(undefined);
|
328
|
-
setCoordinates('');
|
329
|
-
setShowShapeTypeButtons(false);
|
330
|
-
setCurrentDrawType(shapeType);
|
331
|
-
map.enableDraw(shapeType);
|
332
|
-
setIsDrawing(true);
|
333
|
-
}
|
334
|
-
};
|
335
|
-
var shouldShowShapeButtons = function (coords) {
|
336
|
-
var validLines = coords.trim().split('\n')
|
337
|
-
.map(function (line) { return line.trim(); })
|
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);
|
322
|
+
if (map && drawEnabled) {
|
323
|
+
var isAllowed = (shapeType === EMapShape.point && drawPointEnabled) || (shapeType === EMapShape.linestring && drawPathEnabled) || (shapeType === EMapShape.polygon && drawPolygonEnabled);
|
324
|
+
if (isAllowed && shapeType !== currentDrawType) {
|
325
|
+
map.disableDraw(currentDrawType);
|
326
|
+
setCurrentDrawType(shapeType);
|
327
|
+
map.enableDraw(shapeType);
|
328
|
+
setIsDrawing(true);
|
343
329
|
}
|
344
|
-
|
345
|
-
return false;
|
346
|
-
}
|
347
|
-
});
|
348
|
-
return validLines.length >= 3;
|
330
|
+
}
|
349
331
|
};
|
350
332
|
var handleCoordinatesChange = function (e) {
|
351
333
|
var newCoords = e !== null && e !== void 0 ? e : '';
|
352
334
|
setCoordinates(newCoords);
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
}
|
335
|
+
var pointsCount = newCoords.trim().split('\n').filter(function (l) { return l.trim(); }).length;
|
336
|
+
var intendedType;
|
337
|
+
if (pointsCount === 1 && drawPointEnabled)
|
338
|
+
intendedType = EMapShape.point;
|
339
|
+
else if (pointsCount >= 3 && drawPolygonEnabled)
|
340
|
+
intendedType = EMapShape.polygon;
|
341
|
+
else if (pointsCount >= 2 && drawPathEnabled)
|
342
|
+
intendedType = EMapShape.linestring;
|
343
|
+
var newFeature = createGeoJSONFromCoordinates(newCoords, intendedType);
|
344
|
+
if (newFeature) {
|
345
|
+
setGeojson(newFeature);
|
346
|
+
setError(undefined);
|
347
|
+
if (map) {
|
348
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
349
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [newFeature] });
|
350
|
+
map.disableDraw(currentDrawType);
|
351
|
+
setIsDrawing(false);
|
367
352
|
}
|
368
|
-
|
353
|
+
// setShowShapeTypeButtons(shouldShowShapeButtons(newCoords)); // Let effect handle this
|
354
|
+
}
|
355
|
+
else {
|
356
|
+
if (!newCoords.trim()) {
|
369
357
|
setGeojson(undefined);
|
370
|
-
|
371
|
-
|
372
|
-
map.
|
373
|
-
|
374
|
-
features: []
|
375
|
-
});
|
358
|
+
if (map && drawEnabled) {
|
359
|
+
map.setDrawGeojson({ type: 'FeatureCollection', features: [] });
|
360
|
+
map.enableDraw(currentDrawType);
|
361
|
+
setIsDrawing(true);
|
376
362
|
}
|
363
|
+
setShowShapeTypeButtons(false);
|
364
|
+
}
|
365
|
+
else if (!error) {
|
366
|
+
setError('Cannot form valid shape with coords/tools.');
|
377
367
|
}
|
378
|
-
}
|
379
|
-
catch (e) {
|
380
|
-
setError('Invalid coordinate format');
|
381
368
|
}
|
382
369
|
};
|
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]);
|
403
370
|
var applyShapeType = function (shapeType) {
|
404
|
-
var
|
405
|
-
if (
|
406
|
-
setGeojson(
|
371
|
+
var newFeature = createGeoJSONFromCoordinates(coordinates, shapeType);
|
372
|
+
if (newFeature) {
|
373
|
+
setGeojson(newFeature);
|
407
374
|
setError(undefined);
|
408
|
-
if (map) {
|
409
|
-
map.setDrawGeojson({
|
410
|
-
type: 'FeatureCollection',
|
411
|
-
features: []
|
412
|
-
});
|
413
|
-
map.setDrawGeojson({ type: 'FeatureCollection', features: [newGeoJSON] });
|
414
|
-
}
|
415
375
|
}
|
416
|
-
|
417
|
-
|
376
|
+
else if (!error) {
|
377
|
+
setError("Could not create ".concat(shapeType === EMapShape.polygon ? 'poly' : 'path', "."));
|
378
|
+
}
|
418
379
|
};
|
419
|
-
|
380
|
+
// ---- JSX Return (Reverting Button ClassNames and removing disabled) ----
|
381
|
+
return (React__default.createElement("div", null,
|
420
382
|
React__default.createElement(FieldLabel, __assign({}, field)),
|
421
383
|
React__default.createElement("div", { className: "relative" },
|
422
384
|
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.
|
385
|
+
drawPointEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
386
|
+
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.point); },
|
387
|
+
// Reverted className logic
|
388
|
+
className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.point && isDrawing
|
425
389
|
? '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
|
390
|
+
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center"), "aria-label": "Draw Point" },
|
391
|
+
React__default.createElement(DrawingPinFilledIcon, { className: "w-5 h-5" }),
|
392
|
+
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
393
|
drawPathEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
430
|
-
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.linestring); },
|
394
|
+
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.linestring); },
|
395
|
+
// Reverted className logic
|
396
|
+
className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.linestring && isDrawing
|
431
397
|
? '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") },
|
398
|
+
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center"), "aria-label": "Draw Path" },
|
433
399
|
React__default.createElement(BorderSolidIcon, { className: "w-5 h-5" }),
|
434
400
|
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.
|
401
|
+
drawPolygonEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
|
402
|
+
React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.polygon); },
|
403
|
+
// Reverted className logic
|
404
|
+
className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.polygon && isDrawing
|
437
405
|
? '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
|
406
|
+
: 'bg-gray-100 hover:bg-gray-50', " text-black w-10 h-10 flex items-center justify-center"), "aria-label": "Draw Polygon" },
|
407
|
+
React__default.createElement(SquareIcon, { className: "w-5 h-5 rotate-45" }),
|
408
|
+
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
409
|
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" },
|
410
|
+
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
411
|
React__default.createElement(TrashIcon, { className: "w-5 h-5" }),
|
444
412
|
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
413
|
React__default.createElement(OpenLayersMapComponent, __assign({}, MAP_CONFIG, { setState: setMapState })),
|
446
414
|
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
|
-
} })));
|
415
|
+
React__default.createElement("div", { className: "flex justify-between items-center mb-2 flex-wrap gap-y-2" },
|
416
|
+
React__default.createElement("span", { className: "text-sm" },
|
417
|
+
" ",
|
418
|
+
" "),
|
419
|
+
showShapeTypeButtons && (drawPathEnabled || drawPolygonEnabled) && (React__default.createElement("div", { className: "flex gap-2" },
|
420
|
+
" ",
|
421
|
+
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" },
|
422
|
+
React__default.createElement(BorderSolidIcon, { className: "w-3 h-3" }),
|
423
|
+
"Create Path"),
|
424
|
+
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" },
|
425
|
+
React__default.createElement(SquareIcon, { className: "w-3 h-3 rotate-45" }),
|
426
|
+
"Create Polygon")))),
|
427
|
+
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" }),
|
428
|
+
error && React__default.createElement("p", { className: "text-red-600 text-xs mt-1" }, error))),
|
429
|
+
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: getValue(), readOnly: true }))));
|
469
430
|
};
|
470
431
|
|
471
|
-
export {
|
432
|
+
export { GeometryInput, GeometryInput as default };
|
472
433
|
//# sourceMappingURL=Geometry.js.map
|