@axdspub/axiom-ui-forms 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/library/axiom-ui-forms.d.ts +36 -4
  2. package/library/esm/_virtual/index10.js +2 -2
  3. package/library/esm/_virtual/index11.js +2 -2
  4. package/library/esm/_virtual/index12.js +6 -2
  5. package/library/esm/_virtual/index12.js.map +1 -1
  6. package/library/esm/_virtual/index13.js +6 -2
  7. package/library/esm/_virtual/index13.js.map +1 -1
  8. package/library/esm/_virtual/index14.js +2 -2
  9. package/library/esm/_virtual/index15.js +4 -0
  10. package/library/esm/_virtual/index15.js.map +1 -0
  11. package/library/esm/_virtual/index16.js +4 -0
  12. package/library/esm/_virtual/index16.js.map +1 -0
  13. package/library/esm/_virtual/index17.js +4 -0
  14. package/library/esm/_virtual/index17.js.map +1 -0
  15. package/library/esm/_virtual/index6.js +2 -2
  16. package/library/esm/_virtual/index6.js.map +1 -1
  17. package/library/esm/_virtual/index7.js +2 -2
  18. package/library/esm/_virtual/index7.js.map +1 -1
  19. package/library/esm/_virtual/index8.js +2 -2
  20. package/library/esm/_virtual/index9.js +2 -2
  21. package/library/esm/_virtual/utilities.js +4 -0
  22. package/library/esm/_virtual/utilities.js.map +1 -0
  23. package/library/esm/node_modules/@axdspub/axiom-ui-utilities/library/index.js +241 -9
  24. package/library/esm/node_modules/@axdspub/axiom-ui-utilities/library/index.js.map +1 -1
  25. package/library/esm/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  26. package/library/esm/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
  27. package/library/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  28. package/library/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
  29. package/library/esm/node_modules/@codemirror/autocomplete/dist/index.js +1652 -0
  30. package/library/esm/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
  31. package/library/esm/node_modules/@codemirror/commands/dist/index.js +1444 -0
  32. package/library/esm/node_modules/@codemirror/commands/dist/index.js.map +1 -0
  33. package/library/esm/node_modules/@codemirror/lang-json/dist/index.js +33 -0
  34. package/library/esm/node_modules/@codemirror/lang-json/dist/index.js.map +1 -0
  35. package/library/esm/node_modules/@codemirror/lang-yaml/dist/index.js +59 -0
  36. package/library/esm/node_modules/@codemirror/lang-yaml/dist/index.js.map +1 -0
  37. package/library/esm/node_modules/@codemirror/language/dist/index.js +1821 -0
  38. package/library/esm/node_modules/@codemirror/language/dist/index.js.map +1 -0
  39. package/library/esm/node_modules/@codemirror/lint/dist/index.js +589 -0
  40. package/library/esm/node_modules/@codemirror/lint/dist/index.js.map +1 -0
  41. package/library/esm/node_modules/@codemirror/search/dist/index.js +1227 -0
  42. package/library/esm/node_modules/@codemirror/search/dist/index.js.map +1 -0
  43. package/library/esm/node_modules/@codemirror/state/dist/index.js +3882 -0
  44. package/library/esm/node_modules/@codemirror/state/dist/index.js.map +1 -0
  45. package/library/esm/node_modules/@codemirror/theme-one-dark/dist/index.js +114 -0
  46. package/library/esm/node_modules/@codemirror/theme-one-dark/dist/index.js.map +1 -0
  47. package/library/esm/node_modules/@codemirror/view/dist/index.js +11052 -0
  48. package/library/esm/node_modules/@codemirror/view/dist/index.js.map +1 -0
  49. package/library/esm/node_modules/@lezer/common/dist/index.js +1704 -0
  50. package/library/esm/node_modules/@lezer/common/dist/index.js.map +1 -0
  51. package/library/esm/node_modules/@lezer/highlight/dist/index.js +876 -0
  52. package/library/esm/node_modules/@lezer/highlight/dist/index.js.map +1 -0
  53. package/library/esm/node_modules/@lezer/json/dist/index.js +38 -0
  54. package/library/esm/node_modules/@lezer/json/dist/index.js.map +1 -0
  55. package/library/esm/node_modules/@lezer/lr/dist/index.js +1855 -0
  56. package/library/esm/node_modules/@lezer/lr/dist/index.js.map +1 -0
  57. package/library/esm/node_modules/@lezer/yaml/dist/index.js +392 -0
  58. package/library/esm/node_modules/@lezer/yaml/dist/index.js.map +1 -0
  59. package/library/esm/node_modules/@marijn/find-cluster-break/src/index.js +83 -0
  60. package/library/esm/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
  61. package/library/esm/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js +67 -1
  62. package/library/esm/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js.map +1 -1
  63. package/library/esm/node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js +100 -0
  64. package/library/esm/node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js.map +1 -0
  65. package/library/esm/node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js +58 -0
  66. package/library/esm/node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js.map +1 -0
  67. package/library/esm/node_modules/@uiw/react-codemirror/esm/index.js +89 -0
  68. package/library/esm/node_modules/@uiw/react-codemirror/esm/index.js.map +1 -0
  69. package/library/esm/node_modules/@uiw/react-codemirror/esm/theme/light.js +12 -0
  70. package/library/esm/node_modules/@uiw/react-codemirror/esm/theme/light.js.map +1 -0
  71. package/library/esm/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js +151 -0
  72. package/library/esm/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js.map +1 -0
  73. package/library/esm/node_modules/@uiw/react-codemirror/esm/utils.js +19 -0
  74. package/library/esm/node_modules/@uiw/react-codemirror/esm/utils.js.map +1 -0
  75. package/library/esm/node_modules/@ungap/structured-clone/esm/deserialize.js +77 -0
  76. package/library/esm/node_modules/@ungap/structured-clone/esm/deserialize.js.map +1 -0
  77. package/library/esm/node_modules/@ungap/structured-clone/esm/index.js +25 -0
  78. package/library/esm/node_modules/@ungap/structured-clone/esm/index.js.map +1 -0
  79. package/library/esm/node_modules/@ungap/structured-clone/esm/serialize.js +159 -0
  80. package/library/esm/node_modules/@ungap/structured-clone/esm/serialize.js.map +1 -0
  81. package/library/esm/node_modules/@ungap/structured-clone/esm/types.js +14 -0
  82. package/library/esm/node_modules/@ungap/structured-clone/esm/types.js.map +1 -0
  83. package/library/esm/node_modules/ajv/dist/compile/index.js +1 -1
  84. package/library/esm/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
  85. package/library/esm/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
  86. package/library/esm/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
  87. package/library/esm/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
  88. package/library/esm/node_modules/bail/index.js +15 -0
  89. package/library/esm/node_modules/bail/index.js.map +1 -0
  90. package/library/esm/node_modules/comma-separated-tokens/index.js +37 -0
  91. package/library/esm/node_modules/comma-separated-tokens/index.js.map +1 -0
  92. package/library/esm/node_modules/crelt/index.js +30 -0
  93. package/library/esm/node_modules/crelt/index.js.map +1 -0
  94. package/library/esm/node_modules/decode-named-character-reference/index.dom.js +39 -0
  95. package/library/esm/node_modules/decode-named-character-reference/index.dom.js.map +1 -0
  96. package/library/esm/node_modules/devlop/lib/default.js +6 -0
  97. package/library/esm/node_modules/devlop/lib/default.js.map +1 -0
  98. package/library/esm/node_modules/estree-util-is-identifier-name/lib/index.js +31 -0
  99. package/library/esm/node_modules/estree-util-is-identifier-name/lib/index.js.map +1 -0
  100. package/library/esm/node_modules/extend/index.js +127 -0
  101. package/library/esm/node_modules/extend/index.js.map +1 -0
  102. package/library/esm/node_modules/fast-uri/index.js +1 -1
  103. package/library/esm/node_modules/hast-util-to-jsx-runtime/lib/index.js +791 -0
  104. package/library/esm/node_modules/hast-util-to-jsx-runtime/lib/index.js.map +1 -0
  105. package/library/esm/node_modules/hast-util-whitespace/lib/index.js +37 -0
  106. package/library/esm/node_modules/hast-util-whitespace/lib/index.js.map +1 -0
  107. package/library/esm/node_modules/html-url-attributes/lib/index.js +34 -0
  108. package/library/esm/node_modules/html-url-attributes/lib/index.js.map +1 -0
  109. package/library/esm/node_modules/inline-style-parser/index.js +268 -0
  110. package/library/esm/node_modules/inline-style-parser/index.js.map +1 -0
  111. package/library/esm/node_modules/js-yaml/dist/js-yaml.js +3850 -0
  112. package/library/esm/node_modules/js-yaml/dist/js-yaml.js.map +1 -0
  113. package/library/esm/node_modules/json-schema-traverse/index.js +1 -1
  114. package/library/esm/node_modules/mdast-util-from-markdown/lib/index.js +1181 -0
  115. package/library/esm/node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
  116. package/library/esm/node_modules/mdast-util-to-hast/lib/footer.js +197 -0
  117. package/library/esm/node_modules/mdast-util-to-hast/lib/footer.js.map +1 -0
  118. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +31 -0
  119. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js.map +1 -0
  120. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/break.js +27 -0
  121. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/break.js.map +1 -0
  122. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/code.js +51 -0
  123. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/code.js.map +1 -0
  124. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/delete.js +31 -0
  125. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/delete.js.map +1 -0
  126. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +31 -0
  127. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js.map +1 -0
  128. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +74 -0
  129. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js.map +1 -0
  130. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/heading.js +31 -0
  131. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/heading.js.map +1 -0
  132. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/html.js +32 -0
  133. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/html.js.map +1 -0
  134. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +45 -0
  135. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js.map +1 -0
  136. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image.js +40 -0
  137. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/image.js.map +1 -0
  138. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/index.js +67 -0
  139. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/index.js.map +1 -0
  140. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +36 -0
  141. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js.map +1 -0
  142. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +50 -0
  143. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js.map +1 -0
  144. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link.js +41 -0
  145. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/link.js.map +1 -0
  146. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +126 -0
  147. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list-item.js.map +1 -0
  148. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list.js +57 -0
  149. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/list.js.map +1 -0
  150. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +31 -0
  151. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js.map +1 -0
  152. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/root.js +27 -0
  153. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/root.js.map +1 -0
  154. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/strong.js +31 -0
  155. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/strong.js.map +1 -0
  156. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +33 -0
  157. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js.map +1 -0
  158. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +70 -0
  159. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table-row.js.map +1 -0
  160. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table.js +65 -0
  161. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/table.js.map +1 -0
  162. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/text.js +29 -0
  163. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/text.js.map +1 -0
  164. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +31 -0
  165. package/library/esm/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js.map +1 -0
  166. package/library/esm/node_modules/mdast-util-to-hast/lib/index.js +105 -0
  167. package/library/esm/node_modules/mdast-util-to-hast/lib/index.js.map +1 -0
  168. package/library/esm/node_modules/mdast-util-to-hast/lib/revert.js +56 -0
  169. package/library/esm/node_modules/mdast-util-to-hast/lib/revert.js.map +1 -0
  170. package/library/esm/node_modules/mdast-util-to-hast/lib/state.js +322 -0
  171. package/library/esm/node_modules/mdast-util-to-hast/lib/state.js.map +1 -0
  172. package/library/esm/node_modules/mdast-util-to-string/lib/index.js +111 -0
  173. package/library/esm/node_modules/mdast-util-to-string/lib/index.js.map +1 -0
  174. package/library/esm/node_modules/micromark/lib/constructs.js +108 -0
  175. package/library/esm/node_modules/micromark/lib/constructs.js.map +1 -0
  176. package/library/esm/node_modules/micromark/lib/create-tokenizer.js +576 -0
  177. package/library/esm/node_modules/micromark/lib/create-tokenizer.js.map +1 -0
  178. package/library/esm/node_modules/micromark/lib/initialize/content.js +83 -0
  179. package/library/esm/node_modules/micromark/lib/initialize/content.js.map +1 -0
  180. package/library/esm/node_modules/micromark/lib/initialize/document.js +361 -0
  181. package/library/esm/node_modules/micromark/lib/initialize/document.js.map +1 -0
  182. package/library/esm/node_modules/micromark/lib/initialize/flow.js +62 -0
  183. package/library/esm/node_modules/micromark/lib/initialize/flow.js.map +1 -0
  184. package/library/esm/node_modules/micromark/lib/initialize/text.js +213 -0
  185. package/library/esm/node_modules/micromark/lib/initialize/text.js.map +1 -0
  186. package/library/esm/node_modules/micromark/lib/parse.js +60 -0
  187. package/library/esm/node_modules/micromark/lib/parse.js.map +1 -0
  188. package/library/esm/node_modules/micromark/lib/postprocess.js +22 -0
  189. package/library/esm/node_modules/micromark/lib/postprocess.js.map +1 -0
  190. package/library/esm/node_modules/micromark/lib/preprocess.js +118 -0
  191. package/library/esm/node_modules/micromark/lib/preprocess.js.map +1 -0
  192. package/library/esm/node_modules/micromark-core-commonmark/lib/attention.js +245 -0
  193. package/library/esm/node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
  194. package/library/esm/node_modules/micromark-core-commonmark/lib/autolink.js +237 -0
  195. package/library/esm/node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
  196. package/library/esm/node_modules/micromark-core-commonmark/lib/blank-line.js +65 -0
  197. package/library/esm/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
  198. package/library/esm/node_modules/micromark-core-commonmark/lib/block-quote.js +147 -0
  199. package/library/esm/node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
  200. package/library/esm/node_modules/micromark-core-commonmark/lib/character-escape.js +68 -0
  201. package/library/esm/node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
  202. package/library/esm/node_modules/micromark-core-commonmark/lib/character-reference.js +153 -0
  203. package/library/esm/node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
  204. package/library/esm/node_modules/micromark-core-commonmark/lib/code-fenced.js +464 -0
  205. package/library/esm/node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
  206. package/library/esm/node_modules/micromark-core-commonmark/lib/code-indented.js +181 -0
  207. package/library/esm/node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
  208. package/library/esm/node_modules/micromark-core-commonmark/lib/code-text.js +228 -0
  209. package/library/esm/node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
  210. package/library/esm/node_modules/micromark-core-commonmark/lib/content.js +167 -0
  211. package/library/esm/node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
  212. package/library/esm/node_modules/micromark-core-commonmark/lib/definition.js +258 -0
  213. package/library/esm/node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
  214. package/library/esm/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +64 -0
  215. package/library/esm/node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
  216. package/library/esm/node_modules/micromark-core-commonmark/lib/heading-atx.js +199 -0
  217. package/library/esm/node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
  218. package/library/esm/node_modules/micromark-core-commonmark/lib/html-flow.js +880 -0
  219. package/library/esm/node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
  220. package/library/esm/node_modules/micromark-core-commonmark/lib/html-text.js +682 -0
  221. package/library/esm/node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
  222. package/library/esm/node_modules/micromark-core-commonmark/lib/label-end.js +564 -0
  223. package/library/esm/node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
  224. package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-image.js +106 -0
  225. package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
  226. package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-link.js +59 -0
  227. package/library/esm/node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
  228. package/library/esm/node_modules/micromark-core-commonmark/lib/line-ending.js +36 -0
  229. package/library/esm/node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
  230. package/library/esm/node_modules/micromark-core-commonmark/lib/list.js +217 -0
  231. package/library/esm/node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
  232. package/library/esm/node_modules/micromark-core-commonmark/lib/setext-underline.js +189 -0
  233. package/library/esm/node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
  234. package/library/esm/node_modules/micromark-core-commonmark/lib/thematic-break.js +106 -0
  235. package/library/esm/node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
  236. package/library/esm/node_modules/micromark-factory-destination/index.js +210 -0
  237. package/library/esm/node_modules/micromark-factory-destination/index.js.map +1 -0
  238. package/library/esm/node_modules/micromark-factory-label/index.js +152 -0
  239. package/library/esm/node_modules/micromark-factory-label/index.js.map +1 -0
  240. package/library/esm/node_modules/micromark-factory-space/index.js +68 -0
  241. package/library/esm/node_modules/micromark-factory-space/index.js.map +1 -0
  242. package/library/esm/node_modules/micromark-factory-title/index.js +162 -0
  243. package/library/esm/node_modules/micromark-factory-title/index.js.map +1 -0
  244. package/library/esm/node_modules/micromark-factory-whitespace/index.js +48 -0
  245. package/library/esm/node_modules/micromark-factory-whitespace/index.js.map +1 -0
  246. package/library/esm/node_modules/micromark-util-character/index.js +249 -0
  247. package/library/esm/node_modules/micromark-util-character/index.js.map +1 -0
  248. package/library/esm/node_modules/micromark-util-chunked/index.js +84 -0
  249. package/library/esm/node_modules/micromark-util-chunked/index.js.map +1 -0
  250. package/library/esm/node_modules/micromark-util-classify-character/index.js +31 -0
  251. package/library/esm/node_modules/micromark-util-classify-character/index.js.map +1 -0
  252. package/library/esm/node_modules/micromark-util-combine-extensions/index.js +96 -0
  253. package/library/esm/node_modules/micromark-util-combine-extensions/index.js.map +1 -0
  254. package/library/esm/node_modules/micromark-util-decode-numeric-character-reference/index.js +35 -0
  255. package/library/esm/node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
  256. package/library/esm/node_modules/micromark-util-decode-string/index.js +49 -0
  257. package/library/esm/node_modules/micromark-util-decode-string/index.js.map +1 -0
  258. package/library/esm/node_modules/micromark-util-html-tag-name/index.js +96 -0
  259. package/library/esm/node_modules/micromark-util-html-tag-name/index.js.map +1 -0
  260. package/library/esm/node_modules/micromark-util-normalize-identifier/index.js +36 -0
  261. package/library/esm/node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
  262. package/library/esm/node_modules/micromark-util-resolve-all/index.js +35 -0
  263. package/library/esm/node_modules/micromark-util-resolve-all/index.js.map +1 -0
  264. package/library/esm/node_modules/micromark-util-sanitize-uri/index.js +67 -0
  265. package/library/esm/node_modules/micromark-util-sanitize-uri/index.js.map +1 -0
  266. package/library/esm/node_modules/micromark-util-subtokenize/index.js +227 -0
  267. package/library/esm/node_modules/micromark-util-subtokenize/index.js.map +1 -0
  268. package/library/esm/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +254 -0
  269. package/library/esm/node_modules/micromark-util-subtokenize/lib/splice-buffer.js.map +1 -0
  270. package/library/esm/node_modules/property-information/index.js +16 -0
  271. package/library/esm/node_modules/property-information/index.js.map +1 -0
  272. package/library/esm/node_modules/property-information/lib/aria.js +64 -0
  273. package/library/esm/node_modules/property-information/lib/aria.js.map +1 -0
  274. package/library/esm/node_modules/property-information/lib/find.js +101 -0
  275. package/library/esm/node_modules/property-information/lib/find.js.map +1 -0
  276. package/library/esm/node_modules/property-information/lib/hast-to-react.js +33 -0
  277. package/library/esm/node_modules/property-information/lib/hast-to-react.js.map +1 -0
  278. package/library/esm/node_modules/property-information/lib/html.js +318 -0
  279. package/library/esm/node_modules/property-information/lib/html.js.map +1 -0
  280. package/library/esm/node_modules/property-information/lib/normalize.js +15 -0
  281. package/library/esm/node_modules/property-information/lib/normalize.js.map +1 -0
  282. package/library/esm/node_modules/property-information/lib/svg.js +564 -0
  283. package/library/esm/node_modules/property-information/lib/svg.js.map +1 -0
  284. package/library/esm/node_modules/property-information/lib/util/case-insensitive-transform.js +16 -0
  285. package/library/esm/node_modules/property-information/lib/util/case-insensitive-transform.js.map +1 -0
  286. package/library/esm/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
  287. package/library/esm/node_modules/property-information/lib/util/case-sensitive-transform.js.map +1 -0
  288. package/library/esm/node_modules/property-information/lib/util/create.js +47 -0
  289. package/library/esm/node_modules/property-information/lib/util/create.js.map +1 -0
  290. package/library/esm/node_modules/property-information/lib/util/defined-info.js +64 -0
  291. package/library/esm/node_modules/property-information/lib/util/defined-info.js.map +1 -0
  292. package/library/esm/node_modules/property-information/lib/util/info.js +35 -0
  293. package/library/esm/node_modules/property-information/lib/util/info.js.map +1 -0
  294. package/library/esm/node_modules/property-information/lib/util/merge.js +31 -0
  295. package/library/esm/node_modules/property-information/lib/util/merge.js.map +1 -0
  296. package/library/esm/node_modules/property-information/lib/util/schema.js +32 -0
  297. package/library/esm/node_modules/property-information/lib/util/schema.js.map +1 -0
  298. package/library/esm/node_modules/property-information/lib/util/types.js +16 -0
  299. package/library/esm/node_modules/property-information/lib/util/types.js.map +1 -0
  300. package/library/esm/node_modules/property-information/lib/xlink.js +20 -0
  301. package/library/esm/node_modules/property-information/lib/xlink.js.map +1 -0
  302. package/library/esm/node_modules/property-information/lib/xml.js +12 -0
  303. package/library/esm/node_modules/property-information/lib/xml.js.map +1 -0
  304. package/library/esm/node_modules/property-information/lib/xmlns.js +12 -0
  305. package/library/esm/node_modules/property-information/lib/xmlns.js.map +1 -0
  306. package/library/esm/node_modules/react-markdown/lib/index.js +267 -0
  307. package/library/esm/node_modules/react-markdown/lib/index.js.map +1 -0
  308. package/library/esm/node_modules/react-router/dist/development/chunk-HA7DTUK3.js +1 -1
  309. package/library/esm/node_modules/react-router/node_modules/cookie/dist/index.js +1 -1
  310. package/library/esm/node_modules/remark-parse/lib/index.js +43 -0
  311. package/library/esm/node_modules/remark-parse/lib/index.js.map +1 -0
  312. package/library/esm/node_modules/remark-rehype/lib/index.js +132 -0
  313. package/library/esm/node_modules/remark-rehype/lib/index.js.map +1 -0
  314. package/library/esm/node_modules/space-separated-tokens/index.js +23 -0
  315. package/library/esm/node_modules/space-separated-tokens/index.js.map +1 -0
  316. package/library/esm/node_modules/style-mod/src/style-mod.js +175 -0
  317. package/library/esm/node_modules/style-mod/src/style-mod.js.map +1 -0
  318. package/library/esm/node_modules/style-to-js/cjs/index.js +38 -0
  319. package/library/esm/node_modules/style-to-js/cjs/index.js.map +1 -0
  320. package/library/esm/node_modules/style-to-js/cjs/utilities.js +58 -0
  321. package/library/esm/node_modules/style-to-js/cjs/utilities.js.map +1 -0
  322. package/library/esm/node_modules/style-to-object/cjs/index.js +56 -0
  323. package/library/esm/node_modules/style-to-object/cjs/index.js.map +1 -0
  324. package/library/esm/node_modules/trim-lines/index.js +72 -0
  325. package/library/esm/node_modules/trim-lines/index.js.map +1 -0
  326. package/library/esm/node_modules/trough/lib/index.js +209 -0
  327. package/library/esm/node_modules/trough/lib/index.js.map +1 -0
  328. package/library/esm/node_modules/unified/lib/callable-instance.js +47 -0
  329. package/library/esm/node_modules/unified/lib/callable-instance.js.map +1 -0
  330. package/library/esm/node_modules/unified/lib/index.js +979 -0
  331. package/library/esm/node_modules/unified/lib/index.js.map +1 -0
  332. package/library/esm/node_modules/unified/node_modules/is-plain-obj/index.js +11 -0
  333. package/library/esm/node_modules/unified/node_modules/is-plain-obj/index.js.map +1 -0
  334. package/library/esm/node_modules/unist-util-is/lib/index.js +179 -0
  335. package/library/esm/node_modules/unist-util-is/lib/index.js.map +1 -0
  336. package/library/esm/node_modules/unist-util-position/lib/index.js +98 -0
  337. package/library/esm/node_modules/unist-util-position/lib/index.js.map +1 -0
  338. package/library/esm/node_modules/unist-util-stringify-position/lib/index.js +87 -0
  339. package/library/esm/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
  340. package/library/esm/node_modules/unist-util-visit/lib/index.js +95 -0
  341. package/library/esm/node_modules/unist-util-visit/lib/index.js.map +1 -0
  342. package/library/esm/node_modules/unist-util-visit-parents/lib/color.js +10 -0
  343. package/library/esm/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
  344. package/library/esm/node_modules/unist-util-visit-parents/lib/index.js +188 -0
  345. package/library/esm/node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
  346. package/library/esm/node_modules/vfile/lib/index.js +644 -0
  347. package/library/esm/node_modules/vfile/lib/index.js.map +1 -0
  348. package/library/esm/node_modules/vfile/lib/minpath.browser.js +427 -0
  349. package/library/esm/node_modules/vfile/lib/minpath.browser.js.map +1 -0
  350. package/library/esm/node_modules/vfile/lib/minproc.browser.js +11 -0
  351. package/library/esm/node_modules/vfile/lib/minproc.browser.js.map +1 -0
  352. package/library/esm/node_modules/vfile/lib/minurl.browser.js +77 -0
  353. package/library/esm/node_modules/vfile/lib/minurl.browser.js.map +1 -0
  354. package/library/esm/node_modules/vfile/lib/minurl.shared.js +34 -0
  355. package/library/esm/node_modules/vfile/lib/minurl.shared.js.map +1 -0
  356. package/library/esm/node_modules/vfile-message/lib/index.js +305 -0
  357. package/library/esm/node_modules/vfile-message/lib/index.js.map +1 -0
  358. package/library/esm/node_modules/w3c-keyname/index.js +122 -0
  359. package/library/esm/node_modules/w3c-keyname/index.js.map +1 -0
  360. package/library/esm/src/Form/Components/FieldLabel.js +13 -3
  361. package/library/esm/src/Form/Components/FieldLabel.js.map +1 -1
  362. package/library/esm/src/Form/Components/InlineMarkdown.js +15 -0
  363. package/library/esm/src/Form/Components/InlineMarkdown.js.map +1 -0
  364. package/library/esm/src/Form/Components/Inputs/Boolean.js +5 -2
  365. package/library/esm/src/Form/Components/Inputs/Boolean.js.map +1 -1
  366. package/library/esm/src/Form/Components/Inputs/GeoJSONInputLoader.js +1 -1
  367. package/library/esm/src/Form/Components/Inputs/Geometry.js +290 -329
  368. package/library/esm/src/Form/Components/Inputs/Geometry.js.map +1 -1
  369. package/library/esm/src/Form/Components/Inputs/JSON.js +132 -0
  370. package/library/esm/src/Form/Components/Inputs/JSON.js.map +1 -0
  371. package/library/esm/src/Form/Components/Inputs/JSONInputLoader.js +19 -0
  372. package/library/esm/src/Form/Components/Inputs/JSONInputLoader.js.map +1 -0
  373. package/library/esm/src/Form/Components/Inputs/Number.js +78 -8
  374. package/library/esm/src/Form/Components/Inputs/Number.js.map +1 -1
  375. package/library/esm/src/Form/Components/Inputs/inputMap.js +2 -2
  376. package/library/esm/src/Form/Components/Inputs/inputMap.js.map +1 -1
  377. package/library/esm/src/Form/Creator/FormCreator.js +6 -2
  378. package/library/esm/src/Form/Creator/FormCreator.js.map +1 -1
  379. package/library/esm/src/Form/Creator/FormHeader.js +7 -5
  380. package/library/esm/src/Form/Creator/FormHeader.js.map +1 -1
  381. package/library/esm/src/Form/Creator/Page.js +4 -3
  382. package/library/esm/src/Form/Creator/Page.js.map +1 -1
  383. package/library/esm/src/Form/Manage/CopyableJSONOutput.js +41 -0
  384. package/library/esm/src/Form/Manage/CopyableJSONOutput.js.map +1 -0
  385. package/library/esm/src/Form/helpers.js +1 -1
  386. package/library/esm/src/Form/helpers.js.map +1 -1
  387. package/library/esm/src/Form/schemaToFormHelpers.js +87 -1
  388. package/library/esm/src/Form/schemaToFormHelpers.js.map +1 -1
  389. package/library/esm/src/library.js +1 -1
  390. package/package.json +7 -1
  391. package/library/esm/src/Form/Components/Inputs/JSONString.js +0 -34
  392. 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 { SquareIcon, BorderSolidIcon, DrawingPinFilledIcon, TrashIcon } from '../../../../node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
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
- 61.44480592425796, -150.3785489314675
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
- if (!geo || !('features' in geo) || !Array.isArray(geo.features) || geo.features.length === 0) {
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 = geo.features[0];
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
- if (!Array.isArray(coordinates) || coordinates.length === 0) {
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
- coordinates.forEach(function (coord) {
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
- // Calculate center
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 < 0.1)
72
- zoom = 12; // very small shape
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; // small shape
99
+ zoom = 10;
75
100
  else if (maxDiff < 1)
76
- zoom = 9; // medium shape
101
+ zoom = 9;
77
102
  else if (maxDiff < 2)
78
- zoom = 8; // large shape
103
+ zoom = 8;
79
104
  else if (maxDiff < 5)
80
- zoom = 7; // very large shape
105
+ zoom = 7;
81
106
  else
82
- zoom = 6; // huge shape
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
- var GeoJSONInput = function (_a) {
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
- console.log('INITIAL VALUE', value);
93
- var initialGeoJSON = value;
94
- var initialMapConfig = calculateCenterFromGeoJSON(initialGeoJSON);
95
- var _g = useState(EMapShape.polygon), currentDrawType = _g[0], setCurrentDrawType = _g[1];
96
- var _h = useState(false), isDrawing = _h[0], setIsDrawing = _h[1];
97
- // Draw settings
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
- else if (drawPathEnabled) {
109
- setCurrentDrawType(EMapShape.linestring);
136
+ if (value && typeof value === 'object' && 'type' in value && value.type === 'Feature') {
137
+ return value;
110
138
  }
111
- else if (drawPointEnabled) {
112
- setCurrentDrawType(EMapShape.point);
113
- }
114
- }, [drawPolygonEnabled, drawPathEnabled, drawPointEnabled]);
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
- left: '0px',
121
- top: '0px',
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
- var _j = useState(undefined), map = _j[0], setMapState = _j[1];
136
- var _k = useState(undefined), error = _k[0], setError = _k[1];
137
- var _l = useState(function () {
138
- if (!value)
139
- return undefined;
140
- return value;
141
- }), geojson = _l[0], setGeojson = _l[1];
142
- var showGeoJSONInput = useState(false)[0]; // For debugging purposes
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
- if (!value)
198
+ var _a, _b, _c;
199
+ if (!(geojson === null || geojson === void 0 ? void 0 : geojson.geometry))
145
200
  return '';
146
- var geoValue = value;
147
- if ((geoValue === null || geoValue === void 0 ? void 0 : geoValue.type) === 'FeatureCollection' && Array.isArray(geoValue.features) && geoValue.features.length > 0) {
148
- var feature = geoValue.features[0];
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
- var coords = geometry.coordinates[0];
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
- var coords = geometry.coordinates;
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
- return "".concat(coords[1], ", ").concat(coords[0]);
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
- return '';
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
- var getValue = function () {
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
- .split('\n')
182
- .map(function (line) { return line.trim(); })
183
- .filter(function (line) { return line.length > 0; })
184
- .map(function (line) {
185
- var _a = line.split(',').map(function (coord) { return parseFloat(coord.trim()); }), lat = _a[0], lon = _a[1];
186
- if (isNaN(lat) || isNaN(lon)) {
187
- throw new Error('Invalid coordinate format');
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
- return {
212
- type: 'Feature',
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
- // LineString
221
- return {
222
- type: 'Feature',
223
- properties: {},
224
- geometry: {
225
- type: 'LineString',
226
- coordinates: points
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('Invalid coordinate format. Use "lat, lon" format, one per line');
252
+ setError("Invalid coords/count: ".concat(e.message, ". Use \"lat, lon\""));
232
253
  return undefined;
233
254
  }
234
255
  };
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));
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
- // i think this has to stay - we're basically staying in sync with dom element outside of react
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 === undefined)
264
+ if (!map)
276
265
  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);
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
- // 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?
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
- if (geojson !== undefined) {
297
- onChange(geojson.geometry);
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
- var hasValidShape = function (geo) {
301
- return geo !== undefined &&
302
- 'features' in geo &&
303
- Array.isArray(geo.features) &&
304
- geo.features.length > 0;
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
- if (map) {
311
- map.setDrawGeojson({
312
- type: 'FeatureCollection',
313
- features: []
314
- });
315
- map.enableDraw(currentDrawType); // Re-enable drawing when shape is cleared
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
- // 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
- 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
- catch (_b) {
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
- setShowShapeTypeButtons(shouldShowShapeButtons(newCoords));
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
- }
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
- else {
353
+ // setShowShapeTypeButtons(shouldShowShapeButtons(newCoords)); // Let effect handle this
354
+ }
355
+ else {
356
+ if (!newCoords.trim()) {
369
357
  setGeojson(undefined);
370
- onChange(undefined);
371
- if (map) {
372
- map.setDrawGeojson({
373
- type: 'FeatureCollection',
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 newGeoJSON = createGeoJSONFromCoordinates(coordinates, shapeType);
405
- if (newGeoJSON) {
406
- setGeojson(newGeoJSON);
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
- // Don't hide the buttons anymore
417
- // setShowShapeTypeButtons(false)
376
+ else if (!error) {
377
+ setError("Could not create ".concat(shapeType === EMapShape.polygon ? 'poly' : 'path', "."));
378
+ }
418
379
  };
419
- return React__default.createElement("div", null,
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
- drawPolygonEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
424
- React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.polygon); }, className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.polygon && isDrawing
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(SquareIcon, { className: "w-5 h-5 rotate-45" }),
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 Polygon")))),
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); }, className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.linestring && isDrawing
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
- drawPointEnabled && (React__default.createElement("div", { className: "tooltip-container relative group" },
436
- React__default.createElement(Button, { onClick: function () { handleDrawTypeChange(EMapShape.point); }, className: "p-2 rounded-lg shadow-lg ".concat(currentDrawType === EMapShape.point && isDrawing
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(DrawingPinFilledIcon, { className: "w-5 h-5" }),
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 Point")))),
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", null,
449
- "Draw on map or enter coordinates ",
450
- React__default.createElement("pre", { className: "inline-block text-sm" }, "(latitude, longitude)")),
451
- drawEnabled && showShapeTypeButtons && (React__default.createElement("div", { className: "flex gap-2" },
452
- drawPathEnabled && (React__default.createElement(Button, { onClick: function () { applyShapeType(EMapShape.linestring); }, className: "px-4 py-1 bg-white hover:bg-gray-50 text-black rounded-lg shadow-sm border border-gray-200 text-sm flex items-center gap-2" },
453
- React__default.createElement(BorderSolidIcon, { className: "w-4 h-4" }),
454
- "Create Path")),
455
- drawPolygonEnabled && (React__default.createElement(Button, { onClick: function () { applyShapeType(EMapShape.polygon); }, className: "px-4 py-1 bg-white hover:bg-gray-50 text-black rounded-lg shadow-sm border border-gray-200 text-sm flex items-center gap-2" },
456
- React__default.createElement(SquareIcon, { className: "w-4 h-4 rotate-45" }),
457
- "Create Polygon"))))),
458
- React__default.createElement(TextArea, { error: error, className: 'min-h-[100px] bg-slate-50 rounded-lg shadow-inner', id: "".concat(field.id, "-coordinates"), testId: "".concat(field.id, "-coordinates"), value: coordinates, onChange: handleCoordinatesChange, placeholder: "61.2181, -149.9003\n61.2182, -149.9004\n61.2183, -149.9005" }))),
459
- showGeoJSONInput && React__default.createElement(TextArea, { error: error, className: 'min-h-[500px] bg-slate-50 rounded-lg shadow-inner', id: field.id, testId: field.id, label: React__default.createElement(FieldLabel, __assign({}, field)), value: getValue(), onChange: function (e) {
460
- try {
461
- JSON.parse(e !== null && e !== void 0 ? e : '');
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 { GeoJSONInput, GeoJSONInput as default };
432
+ export { GeometryInput, GeometryInput as default };
472
433
  //# sourceMappingURL=Geometry.js.map