katecms 0.0.0-stage → 1.0.0-beta.1

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 (552) hide show
  1. package/README.md +5 -3
  2. package/dist/module.d.mts +93 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +579 -0
  5. package/dist/runtime/assets/img/katecms-logo.svg +17 -0
  6. package/dist/runtime/composables/getCollection.d.ts +62 -0
  7. package/dist/runtime/composables/getCollection.js +167 -0
  8. package/dist/runtime/composables/getOptions.d.ts +22 -0
  9. package/dist/runtime/composables/getOptions.js +22 -0
  10. package/dist/runtime/composables/getQueryCollection.d.ts +95 -0
  11. package/dist/runtime/composables/getQueryCollection.js +199 -0
  12. package/dist/runtime/composables/getTerms.d.ts +79 -0
  13. package/dist/runtime/composables/getTerms.js +148 -0
  14. package/dist/runtime/composables/useAuth.d.ts +14 -0
  15. package/dist/runtime/composables/useAuth.js +33 -0
  16. package/dist/runtime/composables/useAuthCooldown.d.ts +6 -0
  17. package/dist/runtime/composables/useAuthCooldown.js +44 -0
  18. package/dist/runtime/composables/useCmsPaths.d.ts +15 -0
  19. package/dist/runtime/composables/useCmsPaths.js +21 -0
  20. package/dist/runtime/composables/useKateCmsExtensions.d.ts +49 -0
  21. package/dist/runtime/composables/useKateCmsExtensions.js +29 -0
  22. package/dist/runtime/composables/useMediaLibrary.d.ts +84 -0
  23. package/dist/runtime/composables/useMediaLibrary.js +140 -0
  24. package/dist/runtime/composables/useMenuAccess.d.ts +8 -0
  25. package/dist/runtime/composables/useMenuAccess.js +16 -0
  26. package/dist/runtime/internal/admin/AdminHeader.d.vue.ts +24 -0
  27. package/dist/runtime/internal/admin/AdminHeader.vue +91 -0
  28. package/dist/runtime/internal/admin/AdminHeader.vue.d.ts +24 -0
  29. package/dist/runtime/internal/admin/AppMenu.d.vue.ts +3 -0
  30. package/dist/runtime/internal/admin/AppMenu.vue +244 -0
  31. package/dist/runtime/internal/admin/AppMenu.vue.d.ts +3 -0
  32. package/dist/runtime/internal/admin/AppUser.d.vue.ts +3 -0
  33. package/dist/runtime/internal/admin/AppUser.vue +227 -0
  34. package/dist/runtime/internal/admin/AppUser.vue.d.ts +3 -0
  35. package/dist/runtime/internal/admin/CollectionEntryForm.d.vue.ts +41 -0
  36. package/dist/runtime/internal/admin/CollectionEntryForm.vue +916 -0
  37. package/dist/runtime/internal/admin/CollectionEntryForm.vue.d.ts +41 -0
  38. package/dist/runtime/internal/admin/ConfirmDialog.d.vue.ts +28 -0
  39. package/dist/runtime/internal/admin/ConfirmDialog.vue +136 -0
  40. package/dist/runtime/internal/admin/ConfirmDialog.vue.d.ts +28 -0
  41. package/dist/runtime/internal/admin/DictionaryTermForm.d.vue.ts +33 -0
  42. package/dist/runtime/internal/admin/DictionaryTermForm.vue +328 -0
  43. package/dist/runtime/internal/admin/DictionaryTermForm.vue.d.ts +33 -0
  44. package/dist/runtime/internal/admin/EntryRevisions.d.vue.ts +15 -0
  45. package/dist/runtime/internal/admin/EntryRevisions.vue +125 -0
  46. package/dist/runtime/internal/admin/EntryRevisions.vue.d.ts +15 -0
  47. package/dist/runtime/internal/admin/MediaLibraryFilters.d.vue.ts +16 -0
  48. package/dist/runtime/internal/admin/MediaLibraryFilters.vue +153 -0
  49. package/dist/runtime/internal/admin/MediaLibraryFilters.vue.d.ts +16 -0
  50. package/dist/runtime/internal/admin/MediaLibraryModal.d.vue.ts +65 -0
  51. package/dist/runtime/internal/admin/MediaLibraryModal.vue +451 -0
  52. package/dist/runtime/internal/admin/MediaLibraryModal.vue.d.ts +65 -0
  53. package/dist/runtime/internal/admin/OptionPageForm.d.vue.ts +26 -0
  54. package/dist/runtime/internal/admin/OptionPageForm.vue +222 -0
  55. package/dist/runtime/internal/admin/OptionPageForm.vue.d.ts +26 -0
  56. package/dist/runtime/internal/admin/UserAvatarField.d.vue.ts +12 -0
  57. package/dist/runtime/internal/admin/UserAvatarField.vue +305 -0
  58. package/dist/runtime/internal/admin/UserAvatarField.vue.d.ts +12 -0
  59. package/dist/runtime/internal/fields/AccordionField.d.vue.ts +0 -0
  60. package/dist/runtime/internal/fields/AccordionField.vue +220 -0
  61. package/dist/runtime/internal/fields/AccordionField.vue.d.ts +0 -0
  62. package/dist/runtime/internal/fields/ButtonGroupField.d.vue.ts +0 -0
  63. package/dist/runtime/internal/fields/ButtonGroupField.vue +109 -0
  64. package/dist/runtime/internal/fields/ButtonGroupField.vue.d.ts +0 -0
  65. package/dist/runtime/internal/fields/CheckboxField.d.vue.ts +0 -0
  66. package/dist/runtime/internal/fields/CheckboxField.vue +190 -0
  67. package/dist/runtime/internal/fields/CheckboxField.vue.d.ts +0 -0
  68. package/dist/runtime/internal/fields/ColorPickerField.d.vue.ts +0 -0
  69. package/dist/runtime/internal/fields/ColorPickerField.vue +791 -0
  70. package/dist/runtime/internal/fields/ColorPickerField.vue.d.ts +0 -0
  71. package/dist/runtime/internal/fields/DatePickerField.d.vue.ts +0 -0
  72. package/dist/runtime/internal/fields/DatePickerField.vue +26 -0
  73. package/dist/runtime/internal/fields/DatePickerField.vue.d.ts +0 -0
  74. package/dist/runtime/internal/fields/DateTimePickerField.d.vue.ts +0 -0
  75. package/dist/runtime/internal/fields/DateTimePickerField.vue +26 -0
  76. package/dist/runtime/internal/fields/DateTimePickerField.vue.d.ts +0 -0
  77. package/dist/runtime/internal/fields/DictionaryField.d.vue.ts +0 -0
  78. package/dist/runtime/internal/fields/DictionaryField.vue +345 -0
  79. package/dist/runtime/internal/fields/DictionaryField.vue.d.ts +0 -0
  80. package/dist/runtime/internal/fields/EmailField.d.vue.ts +0 -0
  81. package/dist/runtime/internal/fields/EmailField.vue +21 -0
  82. package/dist/runtime/internal/fields/EmailField.vue.d.ts +0 -0
  83. package/dist/runtime/internal/fields/FileField.d.vue.ts +0 -0
  84. package/dist/runtime/internal/fields/FileField.vue +408 -0
  85. package/dist/runtime/internal/fields/FileField.vue.d.ts +0 -0
  86. package/dist/runtime/internal/fields/FlexibleContentField.d.vue.ts +0 -0
  87. package/dist/runtime/internal/fields/FlexibleContentField.vue +1114 -0
  88. package/dist/runtime/internal/fields/FlexibleContentField.vue.d.ts +0 -0
  89. package/dist/runtime/internal/fields/GalleryField.d.vue.ts +0 -0
  90. package/dist/runtime/internal/fields/GalleryField.vue +584 -0
  91. package/dist/runtime/internal/fields/GalleryField.vue.d.ts +0 -0
  92. package/dist/runtime/internal/fields/GroupField.d.vue.ts +0 -0
  93. package/dist/runtime/internal/fields/GroupField.vue +111 -0
  94. package/dist/runtime/internal/fields/GroupField.vue.d.ts +0 -0
  95. package/dist/runtime/internal/fields/ImageField.d.vue.ts +0 -0
  96. package/dist/runtime/internal/fields/ImageField.vue +638 -0
  97. package/dist/runtime/internal/fields/ImageField.vue.d.ts +0 -0
  98. package/dist/runtime/internal/fields/ImageSelectField.d.vue.ts +0 -0
  99. package/dist/runtime/internal/fields/ImageSelectField.vue +179 -0
  100. package/dist/runtime/internal/fields/ImageSelectField.vue.d.ts +0 -0
  101. package/dist/runtime/internal/fields/LinkField.d.vue.ts +0 -0
  102. package/dist/runtime/internal/fields/LinkField.vue +303 -0
  103. package/dist/runtime/internal/fields/LinkField.vue.d.ts +0 -0
  104. package/dist/runtime/internal/fields/NumberField.d.vue.ts +0 -0
  105. package/dist/runtime/internal/fields/NumberField.vue +25 -0
  106. package/dist/runtime/internal/fields/NumberField.vue.d.ts +0 -0
  107. package/dist/runtime/internal/fields/OembedField.d.vue.ts +0 -0
  108. package/dist/runtime/internal/fields/OembedField.vue +161 -0
  109. package/dist/runtime/internal/fields/OembedField.vue.d.ts +0 -0
  110. package/dist/runtime/internal/fields/OpenStreetMapField.d.vue.ts +0 -0
  111. package/dist/runtime/internal/fields/OpenStreetMapField.vue +1502 -0
  112. package/dist/runtime/internal/fields/OpenStreetMapField.vue.d.ts +0 -0
  113. package/dist/runtime/internal/fields/PageLinkField.d.vue.ts +0 -0
  114. package/dist/runtime/internal/fields/PageLinkField.vue +153 -0
  115. package/dist/runtime/internal/fields/PageLinkField.vue.d.ts +0 -0
  116. package/dist/runtime/internal/fields/PasswordField.d.vue.ts +0 -0
  117. package/dist/runtime/internal/fields/PasswordField.vue +108 -0
  118. package/dist/runtime/internal/fields/PasswordField.vue.d.ts +0 -0
  119. package/dist/runtime/internal/fields/PostObjectField.d.vue.ts +0 -0
  120. package/dist/runtime/internal/fields/PostObjectField.vue +151 -0
  121. package/dist/runtime/internal/fields/PostObjectField.vue.d.ts +0 -0
  122. package/dist/runtime/internal/fields/RadioField.d.vue.ts +0 -0
  123. package/dist/runtime/internal/fields/RadioField.vue +163 -0
  124. package/dist/runtime/internal/fields/RadioField.vue.d.ts +0 -0
  125. package/dist/runtime/internal/fields/RangeField.d.vue.ts +0 -0
  126. package/dist/runtime/internal/fields/RangeField.vue +48 -0
  127. package/dist/runtime/internal/fields/RangeField.vue.d.ts +0 -0
  128. package/dist/runtime/internal/fields/RelationshipField.d.vue.ts +0 -0
  129. package/dist/runtime/internal/fields/RelationshipField.vue +525 -0
  130. package/dist/runtime/internal/fields/RelationshipField.vue.d.ts +0 -0
  131. package/dist/runtime/internal/fields/RepeaterField.d.vue.ts +0 -0
  132. package/dist/runtime/internal/fields/RepeaterField.vue +856 -0
  133. package/dist/runtime/internal/fields/RepeaterField.vue.d.ts +0 -0
  134. package/dist/runtime/internal/fields/SelectField.d.vue.ts +21 -0
  135. package/dist/runtime/internal/fields/SelectField.vue +101 -0
  136. package/dist/runtime/internal/fields/SelectField.vue.d.ts +21 -0
  137. package/dist/runtime/internal/fields/SeparatorField.d.vue.ts +0 -0
  138. package/dist/runtime/internal/fields/SeparatorField.vue +63 -0
  139. package/dist/runtime/internal/fields/SeparatorField.vue.d.ts +0 -0
  140. package/dist/runtime/internal/fields/TabField.d.vue.ts +0 -0
  141. package/dist/runtime/internal/fields/TabField.vue +210 -0
  142. package/dist/runtime/internal/fields/TabField.vue.d.ts +0 -0
  143. package/dist/runtime/internal/fields/TextField.d.vue.ts +0 -0
  144. package/dist/runtime/internal/fields/TextField.vue +22 -0
  145. package/dist/runtime/internal/fields/TextField.vue.d.ts +0 -0
  146. package/dist/runtime/internal/fields/TextareaField.d.vue.ts +0 -0
  147. package/dist/runtime/internal/fields/TextareaField.vue +62 -0
  148. package/dist/runtime/internal/fields/TextareaField.vue.d.ts +0 -0
  149. package/dist/runtime/internal/fields/TimePickerField.d.vue.ts +0 -0
  150. package/dist/runtime/internal/fields/TimePickerField.vue +24 -0
  151. package/dist/runtime/internal/fields/TimePickerField.vue.d.ts +0 -0
  152. package/dist/runtime/internal/fields/TrueFalseField.d.vue.ts +0 -0
  153. package/dist/runtime/internal/fields/TrueFalseField.vue +151 -0
  154. package/dist/runtime/internal/fields/TrueFalseField.vue.d.ts +0 -0
  155. package/dist/runtime/internal/fields/UrlField.d.vue.ts +0 -0
  156. package/dist/runtime/internal/fields/UrlField.vue +21 -0
  157. package/dist/runtime/internal/fields/UrlField.vue.d.ts +0 -0
  158. package/dist/runtime/internal/fields/UserField.d.vue.ts +0 -0
  159. package/dist/runtime/internal/fields/UserField.vue +164 -0
  160. package/dist/runtime/internal/fields/UserField.vue.d.ts +0 -0
  161. package/dist/runtime/internal/fields/WysiwygField.d.vue.ts +0 -0
  162. package/dist/runtime/internal/fields/WysiwygField.vue +971 -0
  163. package/dist/runtime/internal/fields/WysiwygField.vue.d.ts +0 -0
  164. package/dist/runtime/internal/parts/DateTimeControl.d.vue.ts +90 -0
  165. package/dist/runtime/internal/parts/DateTimeControl.vue +568 -0
  166. package/dist/runtime/internal/parts/DateTimeControl.vue.d.ts +90 -0
  167. package/dist/runtime/internal/parts/FieldAddon.d.vue.ts +0 -0
  168. package/dist/runtime/internal/parts/FieldAddon.vue +43 -0
  169. package/dist/runtime/internal/parts/FieldAddon.vue.d.ts +0 -0
  170. package/dist/runtime/internal/parts/FieldInstructions.d.vue.ts +0 -0
  171. package/dist/runtime/internal/parts/FieldInstructions.vue +24 -0
  172. package/dist/runtime/internal/parts/FieldInstructions.vue.d.ts +0 -0
  173. package/dist/runtime/internal/parts/FieldLabel.d.vue.ts +0 -0
  174. package/dist/runtime/internal/parts/FieldLabel.vue +40 -0
  175. package/dist/runtime/internal/parts/FieldLabel.vue.d.ts +0 -0
  176. package/dist/runtime/internal/parts/FieldWrapper.d.vue.ts +0 -0
  177. package/dist/runtime/internal/parts/FieldWrapper.vue +47 -0
  178. package/dist/runtime/internal/parts/FieldWrapper.vue.d.ts +0 -0
  179. package/dist/runtime/internal/parts/ImageCropper.d.vue.ts +17 -0
  180. package/dist/runtime/internal/parts/ImageCropper.vue +363 -0
  181. package/dist/runtime/internal/parts/ImageCropper.vue.d.ts +17 -0
  182. package/dist/runtime/internal/parts/InputControl.d.vue.ts +0 -0
  183. package/dist/runtime/internal/parts/InputControl.vue +163 -0
  184. package/dist/runtime/internal/parts/InputControl.vue.d.ts +0 -0
  185. package/dist/runtime/internal/ui/UiButton.d.vue.ts +35 -0
  186. package/dist/runtime/internal/ui/UiButton.vue +204 -0
  187. package/dist/runtime/internal/ui/UiButton.vue.d.ts +35 -0
  188. package/dist/runtime/internal/ui/UiNotice.d.vue.ts +40 -0
  189. package/dist/runtime/internal/ui/UiNotice.vue +253 -0
  190. package/dist/runtime/internal/ui/UiNotice.vue.d.ts +40 -0
  191. package/dist/runtime/internal/ui/UiSelect.d.vue.ts +61 -0
  192. package/dist/runtime/internal/ui/UiSelect.vue +1212 -0
  193. package/dist/runtime/internal/ui/UiSelect.vue.d.ts +61 -0
  194. package/dist/runtime/middleware/auth-guard.d.ts +9 -0
  195. package/dist/runtime/middleware/auth-guard.js +37 -0
  196. package/dist/runtime/pages/admin/collections/[id].d.vue.ts +3 -0
  197. package/dist/runtime/pages/admin/collections/[id].vue +423 -0
  198. package/dist/runtime/pages/admin/collections/[id].vue.d.ts +3 -0
  199. package/dist/runtime/pages/admin/collections/create.d.vue.ts +3 -0
  200. package/dist/runtime/pages/admin/collections/create.vue +179 -0
  201. package/dist/runtime/pages/admin/collections/create.vue.d.ts +3 -0
  202. package/dist/runtime/pages/admin/collections/index.d.vue.ts +3 -0
  203. package/dist/runtime/pages/admin/collections/index.vue +828 -0
  204. package/dist/runtime/pages/admin/collections/index.vue.d.ts +3 -0
  205. package/dist/runtime/pages/admin/demo-fields.d.vue.ts +3 -0
  206. package/dist/runtime/pages/admin/demo-fields.vue +1327 -0
  207. package/dist/runtime/pages/admin/demo-fields.vue.d.ts +3 -0
  208. package/dist/runtime/pages/admin/dictionaries/[id].d.vue.ts +3 -0
  209. package/dist/runtime/pages/admin/dictionaries/[id].vue +213 -0
  210. package/dist/runtime/pages/admin/dictionaries/[id].vue.d.ts +3 -0
  211. package/dist/runtime/pages/admin/dictionaries/index.d.vue.ts +3 -0
  212. package/dist/runtime/pages/admin/dictionaries/index.vue +387 -0
  213. package/dist/runtime/pages/admin/dictionaries/index.vue.d.ts +3 -0
  214. package/dist/runtime/pages/admin/index.d.vue.ts +3 -0
  215. package/dist/runtime/pages/admin/index.vue +138 -0
  216. package/dist/runtime/pages/admin/index.vue.d.ts +3 -0
  217. package/dist/runtime/pages/admin/login.d.vue.ts +3 -0
  218. package/dist/runtime/pages/admin/login.vue +373 -0
  219. package/dist/runtime/pages/admin/login.vue.d.ts +3 -0
  220. package/dist/runtime/pages/admin/media.d.vue.ts +3 -0
  221. package/dist/runtime/pages/admin/media.vue +1054 -0
  222. package/dist/runtime/pages/admin/media.vue.d.ts +3 -0
  223. package/dist/runtime/pages/admin/options/[page].d.vue.ts +3 -0
  224. package/dist/runtime/pages/admin/options/[page].vue +151 -0
  225. package/dist/runtime/pages/admin/options/[page].vue.d.ts +3 -0
  226. package/dist/runtime/pages/admin/register.d.vue.ts +3 -0
  227. package/dist/runtime/pages/admin/register.vue +391 -0
  228. package/dist/runtime/pages/admin/register.vue.d.ts +3 -0
  229. package/dist/runtime/pages/admin/users/[id].d.vue.ts +3 -0
  230. package/dist/runtime/pages/admin/users/[id].vue +337 -0
  231. package/dist/runtime/pages/admin/users/[id].vue.d.ts +3 -0
  232. package/dist/runtime/pages/admin/users/create.d.vue.ts +3 -0
  233. package/dist/runtime/pages/admin/users/create.vue +201 -0
  234. package/dist/runtime/pages/admin/users/create.vue.d.ts +3 -0
  235. package/dist/runtime/pages/admin/users/index.d.vue.ts +3 -0
  236. package/dist/runtime/pages/admin/users/index.vue +329 -0
  237. package/dist/runtime/pages/admin/users/index.vue.d.ts +3 -0
  238. package/dist/runtime/pages/index.d.vue.ts +3 -0
  239. package/dist/runtime/pages/index.vue +399 -0
  240. package/dist/runtime/pages/index.vue.d.ts +3 -0
  241. package/dist/runtime/server/api/_katecms/auth/login.post.d.ts +5 -0
  242. package/dist/runtime/server/api/_katecms/auth/login.post.js +44 -0
  243. package/dist/runtime/server/api/_katecms/auth/logout.post.d.ts +4 -0
  244. package/dist/runtime/server/api/_katecms/auth/logout.post.js +6 -0
  245. package/dist/runtime/server/api/_katecms/auth/register.post.d.ts +19 -0
  246. package/dist/runtime/server/api/_katecms/auth/register.post.js +83 -0
  247. package/dist/runtime/server/api/_katecms/auth/state.get.d.ts +9 -0
  248. package/dist/runtime/server/api/_katecms/auth/state.get.js +12 -0
  249. package/dist/runtime/server/api/_katecms/collections/[collection]/[id].delete.d.ts +15 -0
  250. package/dist/runtime/server/api/_katecms/collections/[collection]/[id].delete.js +59 -0
  251. package/dist/runtime/server/api/_katecms/collections/[collection]/[id].get.d.ts +4 -0
  252. package/dist/runtime/server/api/_katecms/collections/[collection]/[id].get.js +50 -0
  253. package/dist/runtime/server/api/_katecms/collections/[collection]/[id].patch.d.ts +4 -0
  254. package/dist/runtime/server/api/_katecms/collections/[collection]/[id].patch.js +130 -0
  255. package/dist/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.d.ts +4 -0
  256. package/dist/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.js +123 -0
  257. package/dist/runtime/server/api/_katecms/collections/[collection]/revisions.get.d.ts +6 -0
  258. package/dist/runtime/server/api/_katecms/collections/[collection]/revisions.get.js +31 -0
  259. package/dist/runtime/server/api/_katecms/collections/[collection].get.d.ts +8 -0
  260. package/dist/runtime/server/api/_katecms/collections/[collection].get.js +135 -0
  261. package/dist/runtime/server/api/_katecms/collections/[collection].post.d.ts +4 -0
  262. package/dist/runtime/server/api/_katecms/collections/[collection].post.js +91 -0
  263. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.d.ts +7 -0
  264. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.js +31 -0
  265. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.d.ts +4 -0
  266. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.js +45 -0
  267. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.d.ts +4 -0
  268. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.js +83 -0
  269. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].get.d.ts +4 -0
  270. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].get.js +38 -0
  271. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].post.d.ts +4 -0
  272. package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].post.js +64 -0
  273. package/dist/runtime/server/api/_katecms/media/[id]/regenerate.post.d.ts +8 -0
  274. package/dist/runtime/server/api/_katecms/media/[id]/regenerate.post.js +30 -0
  275. package/dist/runtime/server/api/_katecms/media/[id].delete.d.ts +7 -0
  276. package/dist/runtime/server/api/_katecms/media/[id].delete.js +22 -0
  277. package/dist/runtime/server/api/_katecms/media/[id].get.d.ts +9 -0
  278. package/dist/runtime/server/api/_katecms/media/[id].get.js +17 -0
  279. package/dist/runtime/server/api/_katecms/media/[id].patch.d.ts +6 -0
  280. package/dist/runtime/server/api/_katecms/media/[id].patch.js +48 -0
  281. package/dist/runtime/server/api/_katecms/media/index.get.d.ts +5 -0
  282. package/dist/runtime/server/api/_katecms/media/index.get.js +75 -0
  283. package/dist/runtime/server/api/_katecms/media/index.post.d.ts +9 -0
  284. package/dist/runtime/server/api/_katecms/media/index.post.js +84 -0
  285. package/dist/runtime/server/api/_katecms/media/regenerate.post.d.ts +7 -0
  286. package/dist/runtime/server/api/_katecms/media/regenerate.post.js +30 -0
  287. package/dist/runtime/server/api/_katecms/menu.get.d.ts +8 -0
  288. package/dist/runtime/server/api/_katecms/menu.get.js +14 -0
  289. package/dist/runtime/server/api/_katecms/oembed.get.d.ts +2 -0
  290. package/dist/runtime/server/api/_katecms/oembed.get.js +53 -0
  291. package/dist/runtime/server/api/_katecms/options/[page].get.d.ts +7 -0
  292. package/dist/runtime/server/api/_katecms/options/[page].get.js +28 -0
  293. package/dist/runtime/server/api/_katecms/options/[page].patch.d.ts +4 -0
  294. package/dist/runtime/server/api/_katecms/options/[page].patch.js +36 -0
  295. package/dist/runtime/server/api/_katecms/query.get.d.ts +24 -0
  296. package/dist/runtime/server/api/_katecms/query.get.js +270 -0
  297. package/dist/runtime/server/api/_katecms/relation/entries.get.d.ts +17 -0
  298. package/dist/runtime/server/api/_katecms/relation/entries.get.js +74 -0
  299. package/dist/runtime/server/api/_katecms/relation/terms.get.d.ts +17 -0
  300. package/dist/runtime/server/api/_katecms/relation/terms.get.js +51 -0
  301. package/dist/runtime/server/api/_katecms/resolve.get.d.ts +17 -0
  302. package/dist/runtime/server/api/_katecms/resolve.get.js +116 -0
  303. package/dist/runtime/server/api/_katecms/terms.get.d.ts +20 -0
  304. package/dist/runtime/server/api/_katecms/terms.get.js +201 -0
  305. package/dist/runtime/server/api/_katecms/users/[id].delete.d.ts +11 -0
  306. package/dist/runtime/server/api/_katecms/users/[id].delete.js +45 -0
  307. package/dist/runtime/server/api/_katecms/users/[id].patch.d.ts +19 -0
  308. package/dist/runtime/server/api/_katecms/users/[id].patch.js +129 -0
  309. package/dist/runtime/server/api/_katecms/users.get.d.ts +10 -0
  310. package/dist/runtime/server/api/_katecms/users.get.js +34 -0
  311. package/dist/runtime/server/api/_katecms/users.post.d.ts +10 -0
  312. package/dist/runtime/server/api/_katecms/users.post.js +62 -0
  313. package/dist/runtime/server/api/uploads/[...key].get.d.ts +3 -0
  314. package/dist/runtime/server/api/uploads/[...key].get.js +28 -0
  315. package/dist/runtime/server/kit.d.ts +5 -0
  316. package/dist/runtime/server/kit.js +5 -0
  317. package/dist/runtime/server/middleware/admin-headers.d.ts +3 -0
  318. package/dist/runtime/server/middleware/admin-headers.js +12 -0
  319. package/dist/runtime/server/plugins/auto-migrate.d.ts +2 -0
  320. package/dist/runtime/server/plugins/auto-migrate.js +45 -0
  321. package/dist/runtime/server/tsconfig.json +3 -0
  322. package/dist/runtime/server/utils/auth-attempts.d.ts +22 -0
  323. package/dist/runtime/server/utils/auth-attempts.js +42 -0
  324. package/dist/runtime/server/utils/auth-rate-limit.d.ts +11 -0
  325. package/dist/runtime/server/utils/auth-rate-limit.js +36 -0
  326. package/dist/runtime/server/utils/client-address.d.ts +16 -0
  327. package/dist/runtime/server/utils/client-address.js +23 -0
  328. package/dist/runtime/server/utils/collections.d.ts +42 -0
  329. package/dist/runtime/server/utils/collections.js +300 -0
  330. package/dist/runtime/server/utils/db.d.ts +3 -0
  331. package/dist/runtime/server/utils/db.js +25 -0
  332. package/dist/runtime/server/utils/dictionaries.d.ts +53 -0
  333. package/dist/runtime/server/utils/dictionaries.js +301 -0
  334. package/dist/runtime/server/utils/media-list.d.ts +18 -0
  335. package/dist/runtime/server/utils/media-list.js +84 -0
  336. package/dist/runtime/server/utils/media.d.ts +12 -0
  337. package/dist/runtime/server/utils/media.js +77 -0
  338. package/dist/runtime/server/utils/oembed-fetch.d.ts +4 -0
  339. package/dist/runtime/server/utils/oembed-fetch.js +142 -0
  340. package/dist/runtime/server/utils/options.d.ts +17 -0
  341. package/dist/runtime/server/utils/options.js +66 -0
  342. package/dist/runtime/server/utils/permissions.d.ts +13 -0
  343. package/dist/runtime/server/utils/permissions.js +20 -0
  344. package/dist/runtime/server/utils/public-fields-query.d.ts +6 -0
  345. package/dist/runtime/server/utils/public-fields-query.js +8 -0
  346. package/dist/runtime/server/utils/public-term.d.ts +8 -0
  347. package/dist/runtime/server/utils/public-term.js +80 -0
  348. package/dist/runtime/server/utils/regenerate.d.ts +12 -0
  349. package/dist/runtime/server/utils/regenerate.js +40 -0
  350. package/dist/runtime/server/utils/relation.d.ts +18 -0
  351. package/dist/runtime/server/utils/relation.js +77 -0
  352. package/dist/runtime/server/utils/request-address.d.ts +6 -0
  353. package/dist/runtime/server/utils/request-address.js +10 -0
  354. package/dist/runtime/server/utils/revisions.d.ts +20 -0
  355. package/dist/runtime/server/utils/revisions.js +172 -0
  356. package/dist/runtime/server/utils/session.d.ts +18 -0
  357. package/dist/runtime/server/utils/session.js +71 -0
  358. package/dist/runtime/server/utils/upload-headers.d.ts +2 -0
  359. package/dist/runtime/server/utils/upload-headers.js +30 -0
  360. package/dist/runtime/server/utils/users.d.ts +13 -0
  361. package/dist/runtime/server/utils/users.js +47 -0
  362. package/dist/runtime/utils/admin-users.d.ts +20 -0
  363. package/dist/runtime/utils/admin-users.js +19 -0
  364. package/dist/runtime/utils/auth-error.d.ts +6 -0
  365. package/dist/runtime/utils/auth-error.js +11 -0
  366. package/dist/runtime/utils/cms-paths.d.ts +5 -0
  367. package/dist/runtime/utils/cms-paths.js +13 -0
  368. package/dist/runtime/utils/collections.d.ts +176 -0
  369. package/dist/runtime/utils/collections.js +30 -0
  370. package/dist/runtime/utils/dictionaries.d.ts +65 -0
  371. package/dist/runtime/utils/dictionaries.js +14 -0
  372. package/dist/runtime/utils/field-errors.d.ts +4 -0
  373. package/dist/runtime/utils/field-errors.js +9 -0
  374. package/dist/runtime/utils/field-values.d.ts +19 -0
  375. package/dist/runtime/utils/field-values.js +82 -0
  376. package/dist/runtime/utils/helpers.d.ts +4 -0
  377. package/dist/runtime/utils/helpers.js +20 -0
  378. package/dist/runtime/utils/media-library-query.d.ts +54 -0
  379. package/dist/runtime/utils/media-library-query.js +190 -0
  380. package/dist/runtime/utils/options.d.ts +19 -0
  381. package/dist/runtime/utils/options.js +3 -0
  382. package/dist/runtime/utils/preview.d.ts +22 -0
  383. package/dist/runtime/utils/preview.js +33 -0
  384. package/dist/runtime/utils/relation.d.ts +33 -0
  385. package/dist/runtime/utils/relation.js +23 -0
  386. package/dist/runtime/utils/slugify.d.ts +2 -0
  387. package/dist/runtime/utils/slugify.js +4 -0
  388. package/dist/types.d.mts +7 -0
  389. package/package.json +84 -3
  390. package/src/admin-components.ts +124 -0
  391. package/src/module.ts +592 -0
  392. package/src/runtime/assets/img/katecms-logo.svg +17 -0
  393. package/src/runtime/assets/styles/_functions.scss +70 -0
  394. package/src/runtime/assets/styles/_index.scss +3 -0
  395. package/src/runtime/assets/styles/_mixins.scss +256 -0
  396. package/src/runtime/assets/styles/_variables.scss +35 -0
  397. package/src/runtime/composables/getCollection.ts +253 -0
  398. package/src/runtime/composables/getOptions.ts +42 -0
  399. package/src/runtime/composables/getQueryCollection.ts +325 -0
  400. package/src/runtime/composables/getTerms.ts +231 -0
  401. package/src/runtime/composables/useAuth.ts +43 -0
  402. package/src/runtime/composables/useAuthCooldown.ts +52 -0
  403. package/src/runtime/composables/useCmsPaths.ts +24 -0
  404. package/src/runtime/composables/useKateCmsExtensions.ts +81 -0
  405. package/src/runtime/composables/useMediaLibrary.ts +168 -0
  406. package/src/runtime/composables/useMenuAccess.ts +25 -0
  407. package/src/runtime/internal/admin/AdminHeader.vue +106 -0
  408. package/src/runtime/internal/admin/AppMenu.vue +290 -0
  409. package/src/runtime/internal/admin/AppUser.vue +260 -0
  410. package/src/runtime/internal/admin/CollectionEntryForm.vue +1044 -0
  411. package/src/runtime/internal/admin/ConfirmDialog.vue +164 -0
  412. package/src/runtime/internal/admin/DictionaryTermForm.vue +400 -0
  413. package/src/runtime/internal/admin/EntryRevisions.vue +145 -0
  414. package/src/runtime/internal/admin/MediaLibraryFilters.vue +186 -0
  415. package/src/runtime/internal/admin/MediaLibraryModal.vue +526 -0
  416. package/src/runtime/internal/admin/OptionPageForm.vue +277 -0
  417. package/src/runtime/internal/admin/UserAvatarField.vue +337 -0
  418. package/src/runtime/internal/fields/AccordionField.vue +258 -0
  419. package/src/runtime/internal/fields/ButtonGroupField.vue +144 -0
  420. package/src/runtime/internal/fields/CheckboxField.vue +228 -0
  421. package/src/runtime/internal/fields/ColorPickerField.vue +926 -0
  422. package/src/runtime/internal/fields/DatePickerField.vue +33 -0
  423. package/src/runtime/internal/fields/DateTimePickerField.vue +33 -0
  424. package/src/runtime/internal/fields/DictionaryField.vue +403 -0
  425. package/src/runtime/internal/fields/EmailField.vue +28 -0
  426. package/src/runtime/internal/fields/FileField.vue +480 -0
  427. package/src/runtime/internal/fields/FlexibleContentField.vue +1296 -0
  428. package/src/runtime/internal/fields/GalleryField.vue +677 -0
  429. package/src/runtime/internal/fields/GroupField.vue +136 -0
  430. package/src/runtime/internal/fields/ImageField.vue +730 -0
  431. package/src/runtime/internal/fields/ImageSelectField.vue +213 -0
  432. package/src/runtime/internal/fields/LinkField.vue +338 -0
  433. package/src/runtime/internal/fields/NumberField.vue +32 -0
  434. package/src/runtime/internal/fields/OembedField.vue +187 -0
  435. package/src/runtime/internal/fields/OpenStreetMapField.vue +1716 -0
  436. package/src/runtime/internal/fields/PageLinkField.vue +186 -0
  437. package/src/runtime/internal/fields/PasswordField.vue +127 -0
  438. package/src/runtime/internal/fields/PostObjectField.vue +187 -0
  439. package/src/runtime/internal/fields/RadioField.vue +195 -0
  440. package/src/runtime/internal/fields/RangeField.vue +62 -0
  441. package/src/runtime/internal/fields/RelationshipField.vue +604 -0
  442. package/src/runtime/internal/fields/RepeaterField.vue +999 -0
  443. package/src/runtime/internal/fields/SelectField.vue +118 -0
  444. package/src/runtime/internal/fields/SeparatorField.vue +77 -0
  445. package/src/runtime/internal/fields/TabField.vue +249 -0
  446. package/src/runtime/internal/fields/TextField.vue +29 -0
  447. package/src/runtime/internal/fields/TextareaField.vue +61 -0
  448. package/src/runtime/internal/fields/TimePickerField.vue +31 -0
  449. package/src/runtime/internal/fields/TrueFalseField.vue +181 -0
  450. package/src/runtime/internal/fields/UrlField.vue +28 -0
  451. package/src/runtime/internal/fields/UserField.vue +203 -0
  452. package/src/runtime/internal/fields/WysiwygField.vue +1061 -0
  453. package/src/runtime/internal/parts/DateTimeControl.vue +657 -0
  454. package/src/runtime/internal/parts/FieldAddon.vue +60 -0
  455. package/src/runtime/internal/parts/FieldInstructions.vue +38 -0
  456. package/src/runtime/internal/parts/FieldLabel.vue +56 -0
  457. package/src/runtime/internal/parts/FieldWrapper.vue +63 -0
  458. package/src/runtime/internal/parts/ImageCropper.vue +415 -0
  459. package/src/runtime/internal/parts/InputControl.vue +189 -0
  460. package/src/runtime/internal/ui/UiButton.vue +274 -0
  461. package/src/runtime/internal/ui/UiNotice.vue +302 -0
  462. package/src/runtime/internal/ui/UiSelect.vue +1420 -0
  463. package/src/runtime/middleware/auth-guard.ts +52 -0
  464. package/src/runtime/pages/admin/collections/[id].vue +486 -0
  465. package/src/runtime/pages/admin/collections/create.vue +208 -0
  466. package/src/runtime/pages/admin/collections/index.vue +955 -0
  467. package/src/runtime/pages/admin/demo-fields.vue +1354 -0
  468. package/src/runtime/pages/admin/dictionaries/[id].vue +246 -0
  469. package/src/runtime/pages/admin/dictionaries/index.vue +438 -0
  470. package/src/runtime/pages/admin/index.vue +155 -0
  471. package/src/runtime/pages/admin/login.vue +159 -0
  472. package/src/runtime/pages/admin/media.vue +1176 -0
  473. package/src/runtime/pages/admin/options/[page].vue +174 -0
  474. package/src/runtime/pages/admin/register.vue +179 -0
  475. package/src/runtime/pages/admin/users/[id].vue +382 -0
  476. package/src/runtime/pages/admin/users/create.vue +232 -0
  477. package/src/runtime/pages/admin/users/index.vue +374 -0
  478. package/src/runtime/pages/index.vue +265 -0
  479. package/src/runtime/server/api/_katecms/auth/login.post.ts +62 -0
  480. package/src/runtime/server/api/_katecms/auth/logout.post.ts +7 -0
  481. package/src/runtime/server/api/_katecms/auth/register.post.ts +112 -0
  482. package/src/runtime/server/api/_katecms/auth/state.get.ts +19 -0
  483. package/src/runtime/server/api/_katecms/collections/[collection]/[id].delete.ts +77 -0
  484. package/src/runtime/server/api/_katecms/collections/[collection]/[id].get.ts +57 -0
  485. package/src/runtime/server/api/_katecms/collections/[collection]/[id].patch.ts +157 -0
  486. package/src/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.ts +133 -0
  487. package/src/runtime/server/api/_katecms/collections/[collection]/revisions.get.ts +35 -0
  488. package/src/runtime/server/api/_katecms/collections/[collection].get.ts +177 -0
  489. package/src/runtime/server/api/_katecms/collections/[collection].post.ts +111 -0
  490. package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.ts +37 -0
  491. package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.ts +51 -0
  492. package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.ts +101 -0
  493. package/src/runtime/server/api/_katecms/dictionaries/[dictionary].get.ts +43 -0
  494. package/src/runtime/server/api/_katecms/dictionaries/[dictionary].post.ts +78 -0
  495. package/src/runtime/server/api/_katecms/media/[id]/regenerate.post.ts +39 -0
  496. package/src/runtime/server/api/_katecms/media/[id].delete.ts +28 -0
  497. package/src/runtime/server/api/_katecms/media/[id].get.ts +25 -0
  498. package/src/runtime/server/api/_katecms/media/[id].patch.ts +60 -0
  499. package/src/runtime/server/api/_katecms/media/index.get.ts +96 -0
  500. package/src/runtime/server/api/_katecms/media/index.post.ts +104 -0
  501. package/src/runtime/server/api/_katecms/media/regenerate.post.ts +38 -0
  502. package/src/runtime/server/api/_katecms/menu.get.ts +19 -0
  503. package/src/runtime/server/api/_katecms/oembed.get.ts +62 -0
  504. package/src/runtime/server/api/_katecms/options/[page].get.ts +35 -0
  505. package/src/runtime/server/api/_katecms/options/[page].patch.ts +46 -0
  506. package/src/runtime/server/api/_katecms/query.get.ts +332 -0
  507. package/src/runtime/server/api/_katecms/relation/entries.get.ts +98 -0
  508. package/src/runtime/server/api/_katecms/relation/terms.get.ts +61 -0
  509. package/src/runtime/server/api/_katecms/resolve.get.ts +148 -0
  510. package/src/runtime/server/api/_katecms/terms.get.ts +258 -0
  511. package/src/runtime/server/api/_katecms/users/[id].delete.ts +57 -0
  512. package/src/runtime/server/api/_katecms/users/[id].patch.ts +177 -0
  513. package/src/runtime/server/api/_katecms/users.get.ts +48 -0
  514. package/src/runtime/server/api/_katecms/users.post.ts +85 -0
  515. package/src/runtime/server/api/uploads/[...key].get.ts +33 -0
  516. package/src/runtime/server/kit.ts +5 -0
  517. package/src/runtime/server/middleware/admin-headers.ts +14 -0
  518. package/src/runtime/server/plugins/auto-migrate.ts +53 -0
  519. package/src/runtime/server/tsconfig.json +3 -0
  520. package/src/runtime/server/utils/auth-attempts.ts +71 -0
  521. package/src/runtime/server/utils/auth-rate-limit.ts +48 -0
  522. package/src/runtime/server/utils/client-address.ts +41 -0
  523. package/src/runtime/server/utils/collections.ts +381 -0
  524. package/src/runtime/server/utils/db.ts +36 -0
  525. package/src/runtime/server/utils/dictionaries.ts +397 -0
  526. package/src/runtime/server/utils/media-list.ts +131 -0
  527. package/src/runtime/server/utils/media.ts +94 -0
  528. package/src/runtime/server/utils/oembed-fetch.ts +157 -0
  529. package/src/runtime/server/utils/options.ts +86 -0
  530. package/src/runtime/server/utils/permissions.ts +44 -0
  531. package/src/runtime/server/utils/public-fields-query.ts +14 -0
  532. package/src/runtime/server/utils/public-term.ts +98 -0
  533. package/src/runtime/server/utils/regenerate.ts +56 -0
  534. package/src/runtime/server/utils/relation.ts +96 -0
  535. package/src/runtime/server/utils/request-address.ts +16 -0
  536. package/src/runtime/server/utils/revisions.ts +256 -0
  537. package/src/runtime/server/utils/session.ts +112 -0
  538. package/src/runtime/server/utils/upload-headers.ts +35 -0
  539. package/src/runtime/server/utils/users.ts +67 -0
  540. package/src/runtime/utils/admin-users.ts +43 -0
  541. package/src/runtime/utils/auth-error.ts +22 -0
  542. package/src/runtime/utils/cms-paths.ts +17 -0
  543. package/src/runtime/utils/collections.ts +228 -0
  544. package/src/runtime/utils/dictionaries.ts +89 -0
  545. package/src/runtime/utils/field-errors.ts +12 -0
  546. package/src/runtime/utils/field-values.ts +101 -0
  547. package/src/runtime/utils/helpers.ts +33 -0
  548. package/src/runtime/utils/media-library-query.ts +263 -0
  549. package/src/runtime/utils/options.ts +25 -0
  550. package/src/runtime/utils/preview.ts +56 -0
  551. package/src/runtime/utils/relation.ts +60 -0
  552. package/src/runtime/utils/slugify.ts +10 -0
@@ -0,0 +1,1716 @@
1
+ <script setup lang="ts">
2
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
3
+ import type { Field, OsmMarker, OsmMarkerValue } from '@katecms/core'
4
+ import {
5
+ emptyOsmAddress,
6
+ isOsmMarker,
7
+ osmAddressFromNominatim,
8
+ } from '@katecms/core'
9
+ import type {
10
+ Control as LeafletControl,
11
+ DivIcon as LeafletDivIcon,
12
+ LatLngLiteral,
13
+ LeafletMouseEvent,
14
+ LocationEvent,
15
+ Map as LeafletMap,
16
+ Marker as LeafletMarker,
17
+ } from 'leaflet'
18
+
19
+ type OpenStreetMapFieldConfig = Extract<Field, { type: 'open_street_map' }>
20
+
21
+ type GeocodingResult = {
22
+ name: string
23
+ html?: string
24
+ center: { lat: number, lng: number }
25
+ properties?: {
26
+ place_id?: number | string
27
+ address?: Record<string, string | undefined>
28
+ display_name?: string
29
+ }
30
+ }
31
+
32
+ type LeafletModule = typeof import('leaflet')
33
+
34
+ const props = withDefaults(defineProps<{
35
+ fieldKey: string
36
+ field?: OpenStreetMapFieldConfig
37
+ }>(), {
38
+ field: () => ({ type: 'open_street_map', label: '' }),
39
+ })
40
+
41
+ const model = defineModel<OsmMarkerValue>()
42
+
43
+ const rootClass = 'katecms-open-street-map-field'
44
+ const markerClass = 'katecms-osm-marker'
45
+ const mapEl = ref<HTMLElement | null>(null)
46
+ const searchEl = ref<HTMLElement | null>(null)
47
+ const selectedIndex = ref(0)
48
+
49
+ const DEFAULT_LAT = 53.55064
50
+ const DEFAULT_LNG = 10.00065
51
+ const DEFAULT_ZOOM = 12
52
+
53
+ const ADDRESS_FORMAT = {
54
+ street: '{building} {road} {house_number}',
55
+ city: '{postcode} {city} {town} {village} {hamlet}',
56
+ country: '{state} {country}',
57
+ }
58
+
59
+ let L: LeafletModule | null = null
60
+ let map: LeafletMap | null = null
61
+ let markerIcon: LeafletDivIcon | null = null
62
+ let selectedMarkerIcon: LeafletDivIcon | null = null
63
+ let markers: LeafletMarker[] = []
64
+ let locateControl: LeafletControl | null = null
65
+ let fitBoundsControl: LeafletControl | null = null
66
+ let geocoderControl: LeafletControl | null = null
67
+ let nominatimGeocoder: {
68
+ reverse: (location: LatLngLiteral, scale: number) => Promise<GeocodingResult[]>
69
+ } | null = null
70
+ let syncingFromModel = false
71
+ let onMarkGeocodeHandler: ((event: { geocode: GeocodingResult }) => void) | null = null
72
+
73
+ const isMultiple = computed(() => !!props.field?.multiple)
74
+ const mapHeight = computed(() => props.field?.height ?? 400)
75
+
76
+ const centerLat = computed(() => {
77
+ const raw = props.field?.centerLat
78
+ const n = raw != null && raw !== '' ? Number(raw) : Number.NaN
79
+ return Number.isFinite(n) ? n : DEFAULT_LAT
80
+ })
81
+
82
+ const centerLng = computed(() => {
83
+ const raw = props.field?.centerLng
84
+ const n = raw != null && raw !== '' ? Number(raw) : Number.NaN
85
+ return Number.isFinite(n) ? n : DEFAULT_LNG
86
+ })
87
+
88
+ const initialZoom = computed(() => {
89
+ const z = props.field?.zoom
90
+ return typeof z === 'number' && Number.isFinite(z) ? z : DEFAULT_ZOOM
91
+ })
92
+
93
+ const markersList = computed<OsmMarker[]>(() => {
94
+ const value = model.value
95
+ if (isMultiple.value) {
96
+ return Array.isArray(value) ? value : []
97
+ }
98
+ if (Array.isArray(value)) {
99
+ return value[0] && isOsmMarker(value[0]) ? [value[0]] : []
100
+ }
101
+ if (value && isOsmMarker(value)) {
102
+ return [value]
103
+ }
104
+ return []
105
+ })
106
+
107
+ const hasMarker = computed(() => markersList.value.length > 0)
108
+
109
+ function addressFromResult(result?: GeocodingResult) {
110
+ return osmAddressFromNominatim(result?.properties?.address)
111
+ }
112
+
113
+ function interpolate(template: string, data: Record<string, string>): string {
114
+ return template.replace(/\{(.+?)\}/g, (_, key: string) => data[key] ?? '')
115
+ }
116
+
117
+ function formatNominatimAddress(result: { address?: Record<string, string | undefined> }): string {
118
+ const addr = {
119
+ ...emptyOsmAddress(),
120
+ ...Object.fromEntries(
121
+ Object.entries(result.address ?? {}).filter(([, value]) => typeof value === 'string'),
122
+ ),
123
+ }
124
+
125
+ return [
126
+ interpolate(ADDRESS_FORMAT.street, addr),
127
+ interpolate(ADDRESS_FORMAT.city, addr),
128
+ interpolate(ADDRESS_FORMAT.country, addr),
129
+ ]
130
+ .map(part => part.replace(/\s+/g, ' ').trim())
131
+ .filter(Boolean)
132
+ .join(', ')
133
+ }
134
+
135
+ function parseGeocodeResult(results: GeocodingResult[], latlng: LatLngLiteral): string {
136
+ if (!results.length) {
137
+ return `${latlng.lat}, ${latlng.lng}`
138
+ }
139
+ const last = results[results.length - 1]!
140
+ const html = (last.html || last.name || '').trim()
141
+ return html || `${latlng.lat}, ${latlng.lng}`
142
+ }
143
+
144
+ function placeIdFromResult(result?: GeocodingResult): string {
145
+ const id = result?.properties?.place_id
146
+ return id != null ? String(id) : ''
147
+ }
148
+
149
+ function withLabelFromDefault(marker: OsmMarker): OsmMarker {
150
+ if (marker.label || !marker.default_label) {
151
+ return marker
152
+ }
153
+ return { ...marker, label: marker.default_label }
154
+ }
155
+
156
+ function createMarkerData(lat: number, lng: number, zoom: number, partial?: Partial<OsmMarker>): OsmMarker {
157
+ return withLabelFromDefault({
158
+ label: partial?.label ?? '',
159
+ default_label: partial?.default_label ?? '',
160
+ lat,
161
+ lng,
162
+ zoom,
163
+ address: partial?.address ?? emptyOsmAddress(),
164
+ place_id: partial?.place_id ?? '',
165
+ })
166
+ }
167
+
168
+ function currentZoom(): number {
169
+ return map?.getZoom() ?? initialZoom.value
170
+ }
171
+
172
+ function writeModel(list: OsmMarker[], activeIdx = selectedIndex.value) {
173
+ syncingFromModel = true
174
+ if (isMultiple.value) {
175
+ model.value = list
176
+ selectedIndex.value = list.length ? Math.min(Math.max(activeIdx, 0), list.length - 1) : 0
177
+ }
178
+ else {
179
+ model.value = list[0] ?? null
180
+ selectedIndex.value = 0
181
+ }
182
+ nextTick(() => {
183
+ syncingFromModel = false
184
+ })
185
+ }
186
+
187
+ function clearLeafletMarkers() {
188
+ for (const marker of markers) {
189
+ marker.off()
190
+ if (map?.hasLayer(marker)) {
191
+ map.removeLayer(marker)
192
+ }
193
+ else {
194
+ marker.remove()
195
+ }
196
+ }
197
+ markers = []
198
+ }
199
+
200
+ function selectMarker(index: number) {
201
+ selectedIndex.value = index
202
+ applyMarkerSelection()
203
+ const list = markersList.value.map(m => ({ ...m }))
204
+ const current = list[index]
205
+ if (!current) {
206
+ return
207
+ }
208
+ const filled = withLabelFromDefault(current)
209
+ if (filled.label !== current.label) {
210
+ list[index] = filled
211
+ writeModel(list, index)
212
+ }
213
+ }
214
+
215
+ function applyMarkerSelection() {
216
+ markers.forEach((marker, index) => {
217
+ const selected = index === selectedIndex.value
218
+ const icon = selected
219
+ ? (selectedMarkerIcon ?? markerIcon)
220
+ : markerIcon
221
+ if (icon) {
222
+ marker.setIcon(icon)
223
+ }
224
+ marker.setZIndexOffset(selected ? 1000 : 0)
225
+ const el = marker.getElement()
226
+ el?.classList.toggle(`${markerClass}--selected`, selected)
227
+ })
228
+ }
229
+
230
+ function bindMarkerEvents(marker: LeafletMarker, index: number) {
231
+ marker.on('click', (event) => {
232
+ L?.DomEvent.stopPropagation(event)
233
+ selectMarker(index)
234
+ })
235
+ marker.on('dragend', () => {
236
+ const pos = marker.getLatLng()
237
+ const list = markersList.value.map(m => ({ ...m }))
238
+ const current = list[index]
239
+ if (!current) {
240
+ return
241
+ }
242
+ list[index] = {
243
+ ...current,
244
+ lat: Number(pos.lat.toFixed(6)),
245
+ lng: Number(pos.lng.toFixed(6)),
246
+ zoom: currentZoom(),
247
+ }
248
+ writeModel(list, index)
249
+ void reverseGeocodeMarker(index, list[index]!)
250
+ })
251
+ }
252
+
253
+ function syncMarkersToMap(panToActive = false, listOverride?: OsmMarker[]) {
254
+ if (!map || !L) {
255
+ return
256
+ }
257
+
258
+ const list = listOverride ?? markersList.value
259
+ clearLeafletMarkers()
260
+ list.forEach((item, index) => {
261
+ const selected = index === selectedIndex.value
262
+ const marker = L!.marker([item.lat, item.lng], {
263
+ draggable: true,
264
+ icon: (selected ? selectedMarkerIcon : markerIcon) ?? undefined,
265
+ title: item.label || item.default_label || undefined,
266
+ zIndexOffset: selected ? 1000 : 0,
267
+ })
268
+ marker.addTo(map!)
269
+ bindMarkerEvents(marker, index)
270
+ markers.push(marker)
271
+ })
272
+
273
+ if (list.length) {
274
+ const idx = Math.min(Math.max(selectedIndex.value, 0), list.length - 1)
275
+ selectedIndex.value = idx
276
+ applyMarkerSelection()
277
+ if (panToActive) {
278
+ const active = list[idx]!
279
+ map.setView([active.lat, active.lng], active.zoom || currentZoom())
280
+ }
281
+ }
282
+
283
+ updateFitBoundsDisabled()
284
+ }
285
+
286
+ async function reverseGeocodeMarker(index: number, snapshot?: OsmMarker) {
287
+ if (!nominatimGeocoder || !map) {
288
+ return
289
+ }
290
+ const current = snapshot ?? markersList.value[index]
291
+ if (!current) {
292
+ return
293
+ }
294
+
295
+ const previousDefault = current.default_label
296
+ const latlng = { lat: current.lat, lng: current.lng }
297
+
298
+ try {
299
+ const results = await nominatimGeocoder.reverse(
300
+ latlng,
301
+ map.options.crs?.scale(18) ?? 18,
302
+ )
303
+ const latest = markersList.value.map(m => ({ ...m }))
304
+ const idx = latest.findIndex(m => m.lat === current.lat && m.lng === current.lng)
305
+ if (idx < 0) {
306
+ return
307
+ }
308
+
309
+ const marker = latest[idx]!
310
+ const label = parseGeocodeResult(results, latlng)
311
+ const next: OsmMarker = {
312
+ ...marker,
313
+ default_label: label,
314
+ address: addressFromResult(results[0]),
315
+ place_id: placeIdFromResult(results[0]),
316
+ }
317
+ if (!marker.label || marker.label === previousDefault) {
318
+ next.label = label
319
+ }
320
+ latest[idx] = next
321
+ writeModel(latest, idx)
322
+ }
323
+ catch {
324
+ // Nominatim can fail (rate limit / network) — keep coordinates.
325
+ }
326
+ }
327
+
328
+ function placeMarkerAt(lat: number, lng: number, partial?: Partial<OsmMarker>) {
329
+ if (!map) {
330
+ return
331
+ }
332
+ const zoom = partial?.zoom ?? currentZoom()
333
+ const next = createMarkerData(lat, lng, zoom, partial)
334
+
335
+ if (isMultiple.value) {
336
+ const list = [...markersList.value, next]
337
+ const idx = list.length - 1
338
+ writeModel(list, idx)
339
+ syncMarkersToMap(false, list)
340
+ if (!partial?.default_label) {
341
+ void reverseGeocodeMarker(idx, list[idx])
342
+ }
343
+ }
344
+ else {
345
+ const list = [next]
346
+ writeModel(list, 0)
347
+ syncMarkersToMap(false, list)
348
+ if (!partial?.default_label) {
349
+ void reverseGeocodeMarker(0, list[0])
350
+ }
351
+ }
352
+ }
353
+
354
+ function onMapDblClick(event: LeafletMouseEvent) {
355
+ const lat = Number(event.latlng.lat.toFixed(6))
356
+ const lng = Number(event.latlng.lng.toFixed(6))
357
+ placeMarkerAt(lat, lng)
358
+ }
359
+
360
+ function onZoomEnd() {
361
+ if (!map || !hasMarker.value) {
362
+ return
363
+ }
364
+ const list = markersList.value.map(m => ({ ...m }))
365
+ const idx = Math.min(Math.max(selectedIndex.value, 0), list.length - 1)
366
+ const current = list[idx]
367
+ if (!current) {
368
+ return
369
+ }
370
+ const zoom = currentZoom()
371
+ if (current.zoom === zoom) {
372
+ return
373
+ }
374
+ list[idx] = { ...current, zoom }
375
+ writeModel(list, idx)
376
+ }
377
+
378
+ function updateLabel(index: number, value: string) {
379
+ const list = markersList.value.map(m => ({ ...m }))
380
+ const current = list[index]
381
+ if (!current) {
382
+ return
383
+ }
384
+ const label = value.trim() === '' ? current.default_label : value
385
+ if (current.label === label) {
386
+ return
387
+ }
388
+ list[index] = { ...current, label }
389
+ writeModel(list, index)
390
+ }
391
+
392
+ function removeMarker(index: number) {
393
+ const list = markersList.value.map(m => ({ ...m }))
394
+ if (!list.length) {
395
+ return
396
+ }
397
+ list.splice(index, 1)
398
+ writeModel(list, Math.min(index, Math.max(list.length - 1, 0)))
399
+ syncMarkersToMap(false, list)
400
+ if (!list.length && map) {
401
+ map.setView([centerLat.value, centerLng.value], initialZoom.value)
402
+ }
403
+ }
404
+
405
+ function focusMarkerOnMap(index: number) {
406
+ selectMarker(index)
407
+ const item = markersList.value[index]
408
+ if (!item || !map) {
409
+ return
410
+ }
411
+ map.setView([item.lat, item.lng], item.zoom || currentZoom())
412
+ }
413
+
414
+ function fitAllMarkers() {
415
+ if (!map || !L || markers.length === 0) {
416
+ return
417
+ }
418
+ if (markers.length === 1) {
419
+ const pos = markers[0]!.getLatLng()
420
+ map.setView(pos, Math.max(currentZoom(), 15))
421
+ return
422
+ }
423
+ const group = L.featureGroup(markers)
424
+ map.fitBounds(group.getBounds().pad(0.15))
425
+ }
426
+
427
+ function updateFitBoundsDisabled() {
428
+ const el = mapEl.value?.querySelector('.leaflet-control-fit-bounds a')
429
+ if (!el) {
430
+ return
431
+ }
432
+ if (markers.length === 0) {
433
+ el.classList.add('is-disabled')
434
+ el.setAttribute('aria-disabled', 'true')
435
+ }
436
+ else {
437
+ el.classList.remove('is-disabled')
438
+ el.removeAttribute('aria-disabled')
439
+ }
440
+ }
441
+
442
+ function createFitBoundsControl(leaflet: LeafletModule): LeafletControl {
443
+ const FitBounds = leaflet.Control.extend({
444
+ options: { position: 'bottomright' },
445
+ onAdd() {
446
+ const container = leaflet.DomUtil.create('div', 'leaflet-bar leaflet-control leaflet-control-fit-bounds')
447
+ const link = leaflet.DomUtil.create('a', '', container) as HTMLAnchorElement
448
+ link.href = '#'
449
+ link.title = 'Show all markers'
450
+ link.setAttribute('role', 'button')
451
+ link.setAttribute('aria-label', 'Show all markers')
452
+ link.innerHTML = '<span class="leaflet-control-fit-bounds__icon" aria-hidden="true"></span>'
453
+
454
+ leaflet.DomEvent.disableClickPropagation(container)
455
+ leaflet.DomEvent.on(link, 'click', (event) => {
456
+ leaflet.DomEvent.preventDefault(event)
457
+ if (link.classList.contains('is-disabled')) {
458
+ return
459
+ }
460
+ fitAllMarkers()
461
+ })
462
+
463
+ return container
464
+ },
465
+ })
466
+ return new FitBounds()
467
+ }
468
+
469
+ function onMarkGeocode(event: { geocode: GeocodingResult }) {
470
+ const { geocode } = event
471
+ const lat = Number(geocode.center.lat.toFixed(6))
472
+ const lng = Number(geocode.center.lng.toFixed(6))
473
+ const label = parseGeocodeResult([geocode], { lat, lng })
474
+ const zoom = currentZoom()
475
+
476
+ placeMarkerAt(lat, lng, {
477
+ label,
478
+ default_label: label,
479
+ address: addressFromResult(geocode),
480
+ place_id: placeIdFromResult(geocode),
481
+ zoom,
482
+ })
483
+ map?.setView([lat, lng], zoom)
484
+
485
+ const control = geocoderControl as LeafletControl & {
486
+ _clearResults?: () => void
487
+ _input?: HTMLInputElement
488
+ }
489
+ control._clearResults?.()
490
+ if (control._input) {
491
+ control._input.value = ''
492
+ }
493
+ }
494
+
495
+ async function initGeocoder() {
496
+ if (!map || !L) {
497
+ return
498
+ }
499
+
500
+ const { geocoder, geocoders } = await import('leaflet-control-geocoder')
501
+
502
+ const language = typeof navigator !== 'undefined' ? (navigator.language || 'en') : 'en'
503
+
504
+ const nominatim = geocoders.nominatim({
505
+ geocodingQueryParams: { 'accept-language': language },
506
+ reverseQueryParams: { 'accept-language': language },
507
+ htmlTemplate: formatNominatimAddress as never,
508
+ })
509
+
510
+ const geocoderApi = {
511
+ geocode: (query: string) => nominatim.geocode(query),
512
+ reverse: (location: LatLngLiteral, scale: number) => nominatim.reverse(location, scale),
513
+ suggest: async () => [] as GeocodingResult[],
514
+ }
515
+ nominatimGeocoder = {
516
+ reverse: (location, scale) => geocoderApi.reverse(location, scale) as unknown as Promise<GeocodingResult[]>,
517
+ }
518
+
519
+ onMarkGeocodeHandler = onMarkGeocode
520
+ const control = geocoder({
521
+ collapsed: false,
522
+ position: 'topleft',
523
+ placeholder: 'Search…',
524
+ errorMessage: 'Nothing found…',
525
+ showResultIcons: true,
526
+ queryMinLength: 3,
527
+ suggestMinLength: 1000,
528
+ defaultMarkGeocode: false,
529
+ geocoder: geocoderApi as never,
530
+ }) as LeafletControl & {
531
+ on: (type: string, fn: (event: { geocode: GeocodingResult }) => void) => void
532
+ off: (type: string, fn: (event: { geocode: GeocodingResult }) => void) => void
533
+ getContainer: () => HTMLElement
534
+ }
535
+ control.on('markgeocode', onMarkGeocodeHandler)
536
+ control.addTo(map)
537
+
538
+ const container = control.getContainer?.()
539
+ if (searchEl.value && container) {
540
+ searchEl.value.appendChild(container)
541
+ }
542
+
543
+ geocoderControl = control
544
+ }
545
+
546
+ async function initMap() {
547
+ if (!mapEl.value || map) {
548
+ return
549
+ }
550
+
551
+ const leafletMod = await import('leaflet')
552
+ L = typeof leafletMod.map === 'function'
553
+ ? leafletMod
554
+ : (leafletMod as { default: LeafletModule }).default
555
+ if (!L?.map) {
556
+ return
557
+ }
558
+
559
+ const locateMod = await import('leaflet.locatecontrol')
560
+ const LocateControl = locateMod.LocateControl
561
+ ?? (locateMod as { default?: typeof locateMod.LocateControl }).default
562
+ if (!LocateControl) {
563
+ return
564
+ }
565
+
566
+ const markerHtml = [
567
+ `<span class="${markerClass}__pin" aria-hidden="true"></span>`,
568
+ `<span class="${markerClass}__pulse" aria-hidden="true"></span>`,
569
+ ].join('')
570
+
571
+ markerIcon = L.divIcon({
572
+ className: markerClass,
573
+ html: markerHtml,
574
+ iconSize: [28, 42],
575
+ iconAnchor: [14, 42],
576
+ popupAnchor: [0, -36],
577
+ })
578
+
579
+ selectedMarkerIcon = L.divIcon({
580
+ className: `${markerClass} ${markerClass}--selected`,
581
+ html: markerHtml,
582
+ iconSize: [28, 42],
583
+ iconAnchor: [14, 42],
584
+ popupAnchor: [0, -36],
585
+ })
586
+
587
+ const startLat = markersList.value[0]?.lat ?? centerLat.value
588
+ const startLng = markersList.value[0]?.lng ?? centerLng.value
589
+ const startZoom = markersList.value[0]?.zoom ?? initialZoom.value
590
+
591
+ map = L.map(mapEl.value, {
592
+ zoomControl: true,
593
+ scrollWheelZoom: false,
594
+ doubleClickZoom: false,
595
+ boxZoom: false,
596
+ touchZoom: false,
597
+ }).setView([startLat, startLng], startZoom)
598
+
599
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
600
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
601
+ maxZoom: 19,
602
+ }).addTo(map)
603
+
604
+ await initGeocoder()
605
+
606
+ locateControl = new LocateControl({
607
+ position: 'bottomleft',
608
+ setView: 'once',
609
+ showPopup: false,
610
+ drawCircle: true,
611
+ drawMarker: true,
612
+ showCompass: false,
613
+ initialZoomLevel: 16,
614
+ strings: {
615
+ title: 'My location',
616
+ },
617
+ locateOptions: {
618
+ enableHighAccuracy: true,
619
+ maxZoom: 16,
620
+ watch: false,
621
+ },
622
+ })
623
+ locateControl.addTo(map)
624
+
625
+ fitBoundsControl = createFitBoundsControl(L)
626
+ fitBoundsControl.addTo(map)
627
+
628
+ map.on('dblclick', onMapDblClick)
629
+ map.on('zoomend', onZoomEnd)
630
+ map.on('locationfound', onLocationFound)
631
+
632
+ syncMarkersToMap(false)
633
+
634
+ requestAnimationFrame(() => {
635
+ map?.invalidateSize()
636
+ updateFitBoundsDisabled()
637
+ })
638
+ }
639
+
640
+ function onLocationFound(event: LocationEvent) {
641
+ if (isMultiple.value) {
642
+ return
643
+ }
644
+ const lat = Number(event.latlng.lat.toFixed(6))
645
+ const lng = Number(event.latlng.lng.toFixed(6))
646
+ placeMarkerAt(lat, lng)
647
+ }
648
+
649
+ watch(
650
+ () => model.value,
651
+ () => {
652
+ if (syncingFromModel) {
653
+ return
654
+ }
655
+ if (isMultiple.value && !Array.isArray(model.value) && model.value != null) {
656
+ syncingFromModel = true
657
+ model.value = isOsmMarker(model.value) ? [model.value] : []
658
+ nextTick(() => {
659
+ syncingFromModel = false
660
+ syncMarkersToMap(true)
661
+ })
662
+ return
663
+ }
664
+ syncMarkersToMap(true)
665
+ },
666
+ { deep: true },
667
+ )
668
+
669
+ onMounted(() => {
670
+ void initMap()
671
+ })
672
+
673
+ onBeforeUnmount(() => {
674
+ if (map) {
675
+ map.off('dblclick', onMapDblClick)
676
+ map.off('zoomend', onZoomEnd)
677
+ map.off('locationfound', onLocationFound)
678
+ }
679
+ if (onMarkGeocodeHandler && geocoderControl) {
680
+ ;(geocoderControl as LeafletControl & {
681
+ off: (type: string, fn: (event: { geocode: GeocodingResult }) => void) => void
682
+ }).off('markgeocode', onMarkGeocodeHandler)
683
+ }
684
+ geocoderControl?.remove()
685
+ locateControl?.remove()
686
+ fitBoundsControl?.remove()
687
+ clearLeafletMarkers()
688
+ map?.remove()
689
+ map = null
690
+ geocoderControl = null
691
+ onMarkGeocodeHandler = null
692
+ nominatimGeocoder = null
693
+ locateControl = null
694
+ fitBoundsControl = null
695
+ markerIcon = null
696
+ selectedMarkerIcon = null
697
+ L = null
698
+ })
699
+ </script>
700
+
701
+ <template>
702
+ <KateCmsFieldWrapper
703
+ :field-key="fieldKey"
704
+ :field="field"
705
+ label-tag="div"
706
+ >
707
+ <div :class="rootClass">
708
+ <div
709
+ ref="searchEl"
710
+ :class="`${rootClass}__search`"
711
+ />
712
+ <div
713
+ ref="mapEl"
714
+ :class="`${rootClass}__map`"
715
+ :style="{ height: `${mapHeight}px` }"
716
+ />
717
+
718
+ <div
719
+ v-if="hasMarker"
720
+ :class="`${rootClass}__markers`"
721
+ >
722
+ <div
723
+ v-for="(marker, index) in markersList"
724
+ :key="`${marker.lat}-${marker.lng}-${index}`"
725
+ :class="[
726
+ `${rootClass}__marker-row`,
727
+ { 'is-selected': selectedIndex === index },
728
+ ]"
729
+ >
730
+ <KateCmsUiButton
731
+ tag="button"
732
+ :variant="['secondary', 'icon']"
733
+ title="Show on map"
734
+ aria-label="Show on map"
735
+ @click="focusMarkerOnMap(index)"
736
+ >
737
+ <svg
738
+ xmlns="http://www.w3.org/2000/svg"
739
+ viewBox="0 0 24 24"
740
+ fill="currentColor"
741
+ aria-hidden="true"
742
+ >
743
+ <path
744
+ d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6a2.5 2.5 0 0 1 0 5.5z"
745
+ />
746
+ </svg>
747
+ </KateCmsUiButton>
748
+
749
+ <label :class="`${rootClass}__field`">
750
+ <span :class="`${rootClass}__field-label`">
751
+ Label{{ isMultiple ? ` #${index + 1}` : '' }}
752
+ </span>
753
+ <input
754
+ type="text"
755
+ :class="`${rootClass}__input`"
756
+ :name="`${fieldKey}_label_${index}`"
757
+ :value="marker.label"
758
+ :placeholder="marker.default_label || 'Marker name'"
759
+ @focus="selectMarker(index)"
760
+ @input="updateLabel(index, ($event.target as HTMLInputElement).value)"
761
+ >
762
+ </label>
763
+
764
+ <KateCmsUiButton
765
+ tag="button"
766
+ :variant="['red', 'icon']"
767
+ title="Remove marker"
768
+ aria-label="Remove marker"
769
+ @click="removeMarker(index)"
770
+ >
771
+ <svg
772
+ xmlns="http://www.w3.org/2000/svg"
773
+ viewBox="0 0 640 640"
774
+ fill="currentColor"
775
+ aria-hidden="true"
776
+ >
777
+ <path
778
+ d="M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z"
779
+ />
780
+ </svg>
781
+ </KateCmsUiButton>
782
+ </div>
783
+ </div>
784
+ </div>
785
+ </KateCmsFieldWrapper>
786
+ </template>
787
+
788
+ <style scoped lang="scss">
789
+ @use "../../assets/styles" as *;
790
+
791
+ $root: '.katecms-open-street-map-field';
792
+ $marker: '.katecms-osm-marker';
793
+
794
+ #{$root} {
795
+ display: flex;
796
+ flex-direction: column;
797
+ gap: math-rem(10);
798
+
799
+ &__search {
800
+ position: relative;
801
+ z-index: 2;
802
+ width: 100%;
803
+ }
804
+
805
+ &__map {
806
+ width: 100%;
807
+ border: 1px solid $color-border;
808
+ border-radius: $border-radius-inter;
809
+ overflow: hidden;
810
+ background: $color-bg;
811
+ z-index: 0;
812
+ position: relative;
813
+ }
814
+
815
+ :deep(#{$marker}) {
816
+ background: transparent !important;
817
+ border: 0 !important;
818
+
819
+ #{$marker}__pin {
820
+ position: absolute;
821
+ left: 50%;
822
+ bottom: 0;
823
+ width: 22px;
824
+ height: 22px;
825
+ margin-left: -11px;
826
+ background: $color-accent;
827
+ border: 3px solid #fff;
828
+ border-radius: 50% 50% 50% 0;
829
+ box-shadow: $shadow-sm;
830
+ transform: rotate(-45deg);
831
+ }
832
+
833
+ #{$marker}__pulse {
834
+ display: none;
835
+ }
836
+
837
+ &#{$marker}--selected {
838
+ #{$marker}__pin {
839
+ background: $color-accent-hover;
840
+ box-shadow: 0 2px 8px rgba(47, 111, 237, 0.45);
841
+ }
842
+
843
+ #{$marker}__pulse {
844
+ display: block;
845
+ position: absolute;
846
+ left: 50%;
847
+ bottom: 4px;
848
+ width: 18px;
849
+ height: 18px;
850
+ margin-left: -9px;
851
+ border-radius: 50%;
852
+ background: color-alpha($color-accent, 0.35);
853
+ animation: katecms-osm-marker-pulse 1.4s ease-out infinite;
854
+ }
855
+ }
856
+ }
857
+
858
+ @keyframes katecms-osm-marker-pulse {
859
+ 0% {
860
+ transform: scale(0.6);
861
+ opacity: 0.9;
862
+ }
863
+ 100% {
864
+ transform: scale(2.4);
865
+ opacity: 0;
866
+ }
867
+ }
868
+
869
+ &__markers {
870
+ display: flex;
871
+ flex-direction: column;
872
+ gap: math-rem(8);
873
+ }
874
+
875
+ &__marker {
876
+ &-row {
877
+ display: flex;
878
+ align-items: flex-end;
879
+ gap: math-rem(8);
880
+ padding: math-rem(8);
881
+ border: 1px solid $color-border;
882
+ border-radius: $border-radius-inter;
883
+ background: $color-surface;
884
+
885
+ &.is-selected {
886
+ border-color: $color-accent;
887
+ background: $color-bg;
888
+ }
889
+
890
+ :deep(.katecms-btn) {
891
+ flex: 0 0 auto;
892
+ }
893
+ }
894
+ }
895
+
896
+ &__field {
897
+ display: flex;
898
+ flex: 1 1 auto;
899
+ flex-direction: column;
900
+ gap: math-rem(4);
901
+ min-width: 0;
902
+
903
+ &-label {
904
+ font-size: math-rem(12);
905
+ color: $color-muted;
906
+ }
907
+ }
908
+
909
+ &__input {
910
+ width: 100%;
911
+ height: math-rem(40);
912
+ padding: 0 math-rem(10);
913
+ border: 1px solid $color-border;
914
+ border-radius: $border-radius-inter;
915
+ background: $color-surface;
916
+ color: $color-ink;
917
+ font-size: math-rem(14);
918
+ box-sizing: border-box;
919
+
920
+ &:focus {
921
+ outline: none;
922
+ border-color: $color-accent;
923
+ }
924
+ }
925
+
926
+ :deep(.leaflet-pane),
927
+ :deep(.leaflet-tile),
928
+ :deep(.leaflet-marker-icon),
929
+ :deep(.leaflet-marker-shadow),
930
+ :deep(.leaflet-tile-container),
931
+ :deep(.leaflet-pane) > svg,
932
+ :deep(.leaflet-pane) > canvas,
933
+ :deep(.leaflet-zoom-box),
934
+ :deep(.leaflet-image-layer),
935
+ :deep(.leaflet-layer) {
936
+ position: absolute;
937
+ left: 0;
938
+ top: 0;
939
+ }
940
+
941
+ :deep(.leaflet-container) {
942
+ overflow: hidden;
943
+ -webkit-tap-highlight-color: transparent;
944
+ background: $color-bg;
945
+ outline-offset: 1px;
946
+ font-family: system-ui, sans-serif;
947
+ font-size: 12px;
948
+ line-height: 1.5;
949
+
950
+ a {
951
+ -webkit-tap-highlight-color: color-alpha($color-accent, 0.4);
952
+ color: $color-accent;
953
+ }
954
+
955
+ .leaflet-overlay-pane svg {
956
+ max-width: none !important;
957
+ max-height: none !important;
958
+ }
959
+
960
+ .leaflet-marker-pane img,
961
+ .leaflet-shadow-pane img,
962
+ .leaflet-tile-pane img,
963
+ img.leaflet-image-layer,
964
+ .leaflet-tile {
965
+ max-width: none !important;
966
+ max-height: none !important;
967
+ width: auto;
968
+ padding: 0;
969
+ }
970
+
971
+ img.leaflet-tile {
972
+ mix-blend-mode: plus-lighter;
973
+ }
974
+
975
+ &.leaflet-touch-zoom {
976
+ touch-action: pan-x pan-y;
977
+ }
978
+
979
+ &.leaflet-touch-drag {
980
+ touch-action: pinch-zoom;
981
+ }
982
+
983
+ &.leaflet-touch-drag.leaflet-touch-zoom {
984
+ touch-action: none;
985
+ }
986
+
987
+ .leaflet-control-attribution {
988
+ background: color-alpha($color-surface, 0.8);
989
+ margin: 0;
990
+ }
991
+
992
+ a.leaflet-popup-close-button {
993
+ position: absolute;
994
+ top: 0;
995
+ right: 0;
996
+ border: none;
997
+ text-align: center;
998
+ width: 24px;
999
+ height: 24px;
1000
+ font: 16px/24px Tahoma, Verdana, sans-serif;
1001
+ color: $color-muted;
1002
+ text-decoration: none;
1003
+ background: transparent;
1004
+
1005
+ &:hover,
1006
+ &:focus {
1007
+ color: $color-ink;
1008
+ }
1009
+ }
1010
+ }
1011
+
1012
+ :deep(.leaflet-tile),
1013
+ :deep(.leaflet-marker-icon),
1014
+ :deep(.leaflet-marker-shadow) {
1015
+ user-select: none;
1016
+ -webkit-user-drag: none;
1017
+ }
1018
+
1019
+ :deep(.leaflet-tile) {
1020
+ filter: inherit;
1021
+ visibility: hidden;
1022
+
1023
+ &::selection {
1024
+ background: transparent;
1025
+ }
1026
+
1027
+ &.leaflet-tile-loaded {
1028
+ visibility: inherit;
1029
+ }
1030
+ }
1031
+
1032
+ :deep(.leaflet-safari) {
1033
+ .leaflet-tile {
1034
+ image-rendering: -webkit-optimize-contrast;
1035
+ }
1036
+
1037
+ .leaflet-tile-container {
1038
+ width: 1600px;
1039
+ height: 1600px;
1040
+ -webkit-transform-origin: 0 0;
1041
+ }
1042
+ }
1043
+
1044
+ :deep(.leaflet-marker-icon),
1045
+ :deep(.leaflet-marker-shadow) {
1046
+ display: block;
1047
+ }
1048
+
1049
+ :deep(.leaflet-zoom-box) {
1050
+ width: 0;
1051
+ height: 0;
1052
+ box-sizing: border-box;
1053
+ z-index: 800;
1054
+ border: 2px dotted $color-accent;
1055
+ background: color-alpha($color-surface, 0.5);
1056
+ }
1057
+
1058
+ :deep(.leaflet-overlay-pane) svg {
1059
+ user-select: none;
1060
+ }
1061
+
1062
+ :deep(.leaflet-pane) { z-index: 400; }
1063
+ :deep(.leaflet-tile-pane) { z-index: 200; }
1064
+ :deep(.leaflet-overlay-pane) { z-index: 400; }
1065
+ :deep(.leaflet-shadow-pane) { z-index: 500; }
1066
+ :deep(.leaflet-marker-pane) { z-index: 600; }
1067
+ :deep(.leaflet-tooltip-pane) { z-index: 650; }
1068
+ :deep(.leaflet-popup-pane) { z-index: 700; }
1069
+
1070
+ :deep(.leaflet-map-pane) {
1071
+ canvas { z-index: 100; }
1072
+ svg { z-index: 200; }
1073
+ }
1074
+
1075
+ :deep(.leaflet-control) {
1076
+ position: relative;
1077
+ z-index: 800;
1078
+ pointer-events: auto;
1079
+ float: left;
1080
+ clear: both;
1081
+ cursor: auto;
1082
+ }
1083
+
1084
+ :deep(.leaflet-top),
1085
+ :deep(.leaflet-bottom) {
1086
+ position: absolute;
1087
+ z-index: 1000;
1088
+ pointer-events: none;
1089
+ }
1090
+
1091
+ :deep(.leaflet-top) { top: 0; }
1092
+ :deep(.leaflet-right) { right: 0; }
1093
+ :deep(.leaflet-bottom) { bottom: 0; }
1094
+ :deep(.leaflet-left) { left: 0; }
1095
+
1096
+ :deep(.leaflet-right) .leaflet-control { float: right; }
1097
+ :deep(.leaflet-top) .leaflet-control { margin-top: 10px; }
1098
+ :deep(.leaflet-bottom) .leaflet-control { margin-bottom: 10px; }
1099
+ :deep(.leaflet-left) .leaflet-control { margin-left: 10px; }
1100
+ :deep(.leaflet-right) .leaflet-control { margin-right: 10px; }
1101
+
1102
+ :deep(.leaflet-fade-anim) {
1103
+ .leaflet-popup { opacity: 0; transition: opacity 0.2s linear; }
1104
+ .leaflet-map-pane .leaflet-popup { opacity: 1; }
1105
+ }
1106
+
1107
+ :deep(.leaflet-zoom-animated) {
1108
+ transform-origin: 0 0;
1109
+ }
1110
+
1111
+ :deep(svg.leaflet-zoom-animated) {
1112
+ will-change: transform;
1113
+ }
1114
+
1115
+ :deep(.leaflet-zoom-anim) {
1116
+ .leaflet-zoom-animated {
1117
+ transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1);
1118
+ }
1119
+
1120
+ .leaflet-tile { transition: none; }
1121
+ .leaflet-zoom-hide { visibility: hidden; }
1122
+ }
1123
+
1124
+ :deep(.leaflet-pan-anim) .leaflet-tile {
1125
+ transition: none;
1126
+ }
1127
+
1128
+ :deep(.leaflet-interactive) { cursor: pointer; }
1129
+
1130
+ :deep(.leaflet-grab) {
1131
+ cursor: grab;
1132
+ }
1133
+
1134
+ :deep(.leaflet-crosshair),
1135
+ :deep(.leaflet-crosshair) .leaflet-interactive {
1136
+ cursor: crosshair;
1137
+ }
1138
+
1139
+ :deep(.leaflet-popup-pane) { cursor: auto; }
1140
+
1141
+ :deep(.leaflet-dragging) {
1142
+ .leaflet-grab,
1143
+ .leaflet-grab .leaflet-interactive,
1144
+ .leaflet-marker-draggable {
1145
+ cursor: grabbing;
1146
+ }
1147
+ }
1148
+
1149
+ :deep(.leaflet-marker-icon),
1150
+ :deep(.leaflet-marker-shadow),
1151
+ :deep(.leaflet-image-layer),
1152
+ :deep(.leaflet-pane) > svg path,
1153
+ :deep(.leaflet-tile-container) {
1154
+ pointer-events: none;
1155
+ }
1156
+
1157
+ :deep(.leaflet-marker-icon.leaflet-interactive),
1158
+ :deep(.leaflet-image-layer.leaflet-interactive),
1159
+ :deep(.leaflet-pane) > svg path.leaflet-interactive,
1160
+ :deep(svg.leaflet-image-layer.leaflet-interactive) path {
1161
+ pointer-events: auto;
1162
+ }
1163
+
1164
+ :deep(.leaflet-bar) {
1165
+ box-shadow: $shadow-sm;
1166
+ border-radius: $border-radius-inter;
1167
+
1168
+ a {
1169
+ background-color: $color-surface;
1170
+ background-position: 50% 50%;
1171
+ background-repeat: no-repeat;
1172
+ border-bottom: 1px solid $color-border;
1173
+ width: 26px;
1174
+ height: 26px;
1175
+ line-height: 26px;
1176
+ display: block;
1177
+ text-align: center;
1178
+ text-decoration: none;
1179
+ color: $color-ink;
1180
+
1181
+ &:hover,
1182
+ &:focus {
1183
+ background-color: $color-bg;
1184
+ }
1185
+
1186
+ &:first-child {
1187
+ border-top-left-radius: $border-radius-inter;
1188
+ border-top-right-radius: $border-radius-inter;
1189
+ }
1190
+
1191
+ &:last-child {
1192
+ border-bottom-left-radius: $border-radius-inter;
1193
+ border-bottom-right-radius: $border-radius-inter;
1194
+ border-bottom: none;
1195
+ }
1196
+
1197
+ &.leaflet-disabled {
1198
+ cursor: default;
1199
+ background-color: $color-bg;
1200
+ color: $color-muted;
1201
+ }
1202
+ }
1203
+ }
1204
+
1205
+ :deep(.leaflet-touch) {
1206
+ .leaflet-bar {
1207
+ box-shadow: none;
1208
+ border: 2px solid color-alpha($color-ink, 0.12);
1209
+ background-clip: padding-box;
1210
+
1211
+ a {
1212
+ width: 30px;
1213
+ height: 30px;
1214
+ line-height: 30px;
1215
+
1216
+ &:first-child {
1217
+ border-top-left-radius: 2px;
1218
+ border-top-right-radius: 2px;
1219
+ }
1220
+
1221
+ &:last-child {
1222
+ border-bottom-left-radius: 2px;
1223
+ border-bottom-right-radius: 2px;
1224
+ }
1225
+ }
1226
+ }
1227
+
1228
+ .leaflet-control-attribution {
1229
+ box-shadow: none;
1230
+ }
1231
+
1232
+ .leaflet-control-zoom-in,
1233
+ .leaflet-control-zoom-out {
1234
+ font-size: 22px;
1235
+ }
1236
+ }
1237
+
1238
+ :deep(.leaflet-control-zoom-in),
1239
+ :deep(.leaflet-control-zoom-out) {
1240
+ font: bold 18px 'Lucida Console', Monaco, monospace;
1241
+ text-indent: 1px;
1242
+ }
1243
+
1244
+ :deep(.leaflet-control-attribution),
1245
+ :deep(.leaflet-control-scale-line) {
1246
+ padding: 0 5px;
1247
+ color: $color-ink;
1248
+ line-height: 1.4;
1249
+ }
1250
+
1251
+ :deep(.leaflet-control-attribution) a {
1252
+ text-decoration: none;
1253
+
1254
+ &:hover,
1255
+ &:focus {
1256
+ text-decoration: underline;
1257
+ }
1258
+ }
1259
+
1260
+ :deep(.leaflet-attribution-flag) {
1261
+ display: inline !important;
1262
+ vertical-align: baseline !important;
1263
+ width: 1em;
1264
+ height: 0.6669em;
1265
+ }
1266
+
1267
+ :deep(.leaflet-left) .leaflet-control-scale { margin-left: 5px; }
1268
+ :deep(.leaflet-bottom) .leaflet-control-scale { margin-bottom: 5px; }
1269
+
1270
+ :deep(.leaflet-control-scale-line) {
1271
+ border: 2px solid $color-muted;
1272
+ border-top: none;
1273
+ line-height: 1.1;
1274
+ padding: 2px 5px 1px;
1275
+ white-space: nowrap;
1276
+ box-sizing: border-box;
1277
+ background: color-alpha($color-surface, 0.8);
1278
+ text-shadow: 1px 1px $color-surface;
1279
+
1280
+ &:not(:first-child) {
1281
+ border-top: 2px solid $color-muted;
1282
+ border-bottom: none;
1283
+ margin-top: -2px;
1284
+ }
1285
+
1286
+ &:not(:first-child):not(:last-child) {
1287
+ border-bottom: 2px solid $color-muted;
1288
+ }
1289
+ }
1290
+
1291
+ :deep(.leaflet-popup) {
1292
+ position: absolute;
1293
+ text-align: center;
1294
+ margin-bottom: 20px;
1295
+ }
1296
+
1297
+ :deep(.leaflet-popup-content-wrapper) {
1298
+ padding: 1px;
1299
+ text-align: left;
1300
+ border-radius: 12px;
1301
+ }
1302
+
1303
+ :deep(.leaflet-popup-content) {
1304
+ margin: 13px 24px 13px 20px;
1305
+ line-height: 1.3;
1306
+ font-size: 13px;
1307
+ min-height: 1px;
1308
+
1309
+ p { margin: 1.3em 0; }
1310
+ }
1311
+
1312
+ :deep(.leaflet-popup-tip-container) {
1313
+ width: 40px;
1314
+ height: 20px;
1315
+ position: absolute;
1316
+ left: 50%;
1317
+ margin-top: -1px;
1318
+ margin-left: -20px;
1319
+ overflow: hidden;
1320
+ pointer-events: none;
1321
+ }
1322
+
1323
+ :deep(.leaflet-popup-tip) {
1324
+ width: 17px;
1325
+ height: 17px;
1326
+ padding: 1px;
1327
+ margin: -10px auto 0;
1328
+ pointer-events: auto;
1329
+ transform: rotate(45deg);
1330
+ }
1331
+
1332
+ :deep(.leaflet-popup-content-wrapper),
1333
+ :deep(.leaflet-popup-tip) {
1334
+ background: $color-surface;
1335
+ color: $color-ink;
1336
+ box-shadow: $shadow-md;
1337
+ }
1338
+
1339
+ :deep(.leaflet-popup-scrolled) { overflow: auto; }
1340
+
1341
+ :deep(.leaflet-div-icon) {
1342
+ background: $color-surface;
1343
+ border: 1px solid $color-muted;
1344
+ }
1345
+
1346
+ :deep(.leaflet-tooltip) {
1347
+ position: absolute;
1348
+ padding: 6px;
1349
+ background-color: $color-surface;
1350
+ border: 1px solid $color-surface;
1351
+ border-radius: 3px;
1352
+ color: $color-ink;
1353
+ white-space: nowrap;
1354
+ user-select: none;
1355
+ pointer-events: none;
1356
+ box-shadow: $shadow-sm;
1357
+
1358
+ &.leaflet-interactive {
1359
+ cursor: pointer;
1360
+ pointer-events: auto;
1361
+ }
1362
+ }
1363
+
1364
+ :deep(.leaflet-tooltip-top:before),
1365
+ :deep(.leaflet-tooltip-bottom:before),
1366
+ :deep(.leaflet-tooltip-left:before),
1367
+ :deep(.leaflet-tooltip-right:before) {
1368
+ position: absolute;
1369
+ pointer-events: none;
1370
+ border: 6px solid transparent;
1371
+ background: transparent;
1372
+ content: '';
1373
+ }
1374
+
1375
+ :deep(.leaflet-tooltip-bottom) { margin-top: 6px; }
1376
+ :deep(.leaflet-tooltip-top) { margin-top: -6px; }
1377
+
1378
+ :deep(.leaflet-tooltip-bottom:before),
1379
+ :deep(.leaflet-tooltip-top:before) {
1380
+ left: 50%;
1381
+ margin-left: -6px;
1382
+ }
1383
+
1384
+ :deep(.leaflet-tooltip-top:before) {
1385
+ bottom: 0;
1386
+ margin-bottom: -12px;
1387
+ border-top-color: $color-surface;
1388
+ }
1389
+
1390
+ :deep(.leaflet-tooltip-bottom:before) {
1391
+ top: 0;
1392
+ margin-top: -12px;
1393
+ margin-left: -6px;
1394
+ border-bottom-color: $color-surface;
1395
+ }
1396
+
1397
+ :deep(.leaflet-tooltip-left) { margin-left: -6px; }
1398
+ :deep(.leaflet-tooltip-right) { margin-left: 6px; }
1399
+
1400
+ :deep(.leaflet-tooltip-left:before),
1401
+ :deep(.leaflet-tooltip-right:before) {
1402
+ top: 50%;
1403
+ margin-top: -6px;
1404
+ }
1405
+
1406
+ :deep(.leaflet-tooltip-left:before) {
1407
+ right: 0;
1408
+ margin-right: -12px;
1409
+ border-left-color: $color-surface;
1410
+ }
1411
+
1412
+ :deep(.leaflet-tooltip-right:before) {
1413
+ left: 0;
1414
+ margin-left: -12px;
1415
+ border-right-color: $color-surface;
1416
+ }
1417
+
1418
+ :deep(.leaflet-control-locate) {
1419
+ --locate-control-icon-color: #{$color-ink};
1420
+ --locate-control-active-color: #{$color-accent};
1421
+ --locate-control-following-color: #{$color-warning};
1422
+
1423
+ a {
1424
+ display: flex;
1425
+ align-items: center;
1426
+ justify-content: center;
1427
+
1428
+ .leaflet-control-locate-location-arrow,
1429
+ .leaflet-control-locate-spinner {
1430
+ background-color: var(--locate-control-icon-color);
1431
+ width: 16px;
1432
+ height: 16px;
1433
+ margin: 7px;
1434
+ display: inline-block;
1435
+ mask-position: center;
1436
+ mask-repeat: no-repeat;
1437
+ -webkit-mask-position: center;
1438
+ -webkit-mask-repeat: no-repeat;
1439
+ }
1440
+
1441
+ .leaflet-locate-icon {
1442
+ color: var(--locate-control-icon-color);
1443
+ }
1444
+
1445
+ .leaflet-control-locate-location-arrow {
1446
+ -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M445 4 29 195c-48 23-32 93 19 93h176v176c0 51 70 67 93 19L508 67c16-38-25-79-63-63z"/></svg>');
1447
+ mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M445 4 29 195c-48 23-32 93 19 93h176v176c0 51 70 67 93 19L508 67c16-38-25-79-63-63z"/></svg>');
1448
+ }
1449
+
1450
+ .leaflet-control-locate-spinner {
1451
+ animation: 2s linear infinite leaflet-control-locate-spin;
1452
+ -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M304 48a48 48 0 1 1-96 0 48 48 0 0 1 96 0zm-48 368a48 48 0 1 0 0 96 48 48 0 0 0 0-96zm208-208a48 48 0 1 0 0 96 48 48 0 0 0 0-96zM96 256a48 48 0 1 0-96 0 48 48 0 0 0 96 0zm13 99a48 48 0 1 0 0 96 48 48 0 0 0 0-96zm294 0a48 48 0 1 0 0 96 48 48 0 0 0 0-96zM109 61a48 48 0 1 0 0 96 48 48 0 0 0 0-96z"/></svg>');
1453
+ mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M304 48a48 48 0 1 1-96 0 48 48 0 0 1 96 0zm-48 368a48 48 0 1 0 0 96 48 48 0 0 0 0-96zm208-208a48 48 0 1 0 0 96 48 48 0 0 0 0-96zM96 256a48 48 0 1 0-96 0 48 48 0 0 0 96 0zm13 99a48 48 0 1 0 0 96 48 48 0 0 0 0-96zm294 0a48 48 0 1 0 0 96 48 48 0 0 0 0-96zM109 61a48 48 0 1 0 0 96 48 48 0 0 0 0-96z"/></svg>');
1454
+ }
1455
+ }
1456
+
1457
+ &.active a {
1458
+ .leaflet-control-locate-location-arrow {
1459
+ background-color: var(--locate-control-active-color);
1460
+ }
1461
+
1462
+ .leaflet-locate-icon {
1463
+ color: var(--locate-control-active-color);
1464
+ }
1465
+ }
1466
+
1467
+ &.following a {
1468
+ .leaflet-control-locate-location-arrow {
1469
+ background-color: var(--locate-control-following-color);
1470
+ }
1471
+
1472
+ .leaflet-locate-icon {
1473
+ color: var(--locate-control-following-color);
1474
+ }
1475
+ }
1476
+
1477
+ &.locate-timeout a .leaflet-control-locate-spinner {
1478
+ background-color: $color-warning;
1479
+ }
1480
+ }
1481
+
1482
+ :deep(.leaflet-bar) .leaflet-locate-text-active {
1483
+ text-overflow: ellipsis;
1484
+ white-space: nowrap;
1485
+ align-items: center;
1486
+ width: auto;
1487
+ max-width: 200px;
1488
+ padding: 0 10px;
1489
+ display: flex;
1490
+ overflow: hidden;
1491
+
1492
+ .leaflet-locate-icon {
1493
+ padding: 0 5px 0 0;
1494
+ }
1495
+ }
1496
+
1497
+ :deep(.leaflet-touch) .leaflet-bar .leaflet-locate-text-active {
1498
+ width: 100%;
1499
+ }
1500
+
1501
+ :deep(.leaflet-control-locate-location) circle {
1502
+ animation: 4s infinite leaflet-control-locate-throb;
1503
+ }
1504
+
1505
+ :deep(.leaflet-control-geocoder) {
1506
+ position: relative;
1507
+ float: none;
1508
+ width: 100%;
1509
+ max-width: 100%;
1510
+ margin: 0 !important;
1511
+ box-shadow: $shadow-sm;
1512
+ border-radius: $border-radius-inter;
1513
+ background: $color-surface;
1514
+ display: flex;
1515
+ flex-wrap: wrap;
1516
+ align-items: stretch;
1517
+ flex-direction: row-reverse;
1518
+ min-width: 26px;
1519
+ min-height: 26px;
1520
+
1521
+ &.leaflet-control {
1522
+ clear: none;
1523
+ }
1524
+
1525
+ a,
1526
+ .leaflet-control-geocoder-icon {
1527
+ border-bottom: none;
1528
+ display: inline-block;
1529
+ }
1530
+
1531
+ .leaflet-control-geocoder-alternatives a {
1532
+ width: inherit;
1533
+ height: inherit;
1534
+ line-height: inherit;
1535
+ }
1536
+
1537
+ a:hover,
1538
+ .leaflet-control-geocoder-icon:hover {
1539
+ border-bottom: none;
1540
+ display: inline-block;
1541
+ }
1542
+ }
1543
+
1544
+ :deep(.leaflet-touch) .leaflet-control-geocoder {
1545
+ min-width: 30px;
1546
+ min-height: 30px;
1547
+ }
1548
+
1549
+ :deep(.leaflet-control-geocoder-form) {
1550
+ vertical-align: middle;
1551
+ display: block !important;
1552
+ flex: 1 1 auto;
1553
+ min-width: 0;
1554
+
1555
+ input {
1556
+ width: 100%;
1557
+ min-width: 0;
1558
+ height: math-rem(38);
1559
+ padding: 0 math-rem(12);
1560
+ border: 1px solid $color-border;
1561
+ border-right: 0;
1562
+ border-radius: $border-radius-inter 0 0 $border-radius-inter;
1563
+ font-size: math-rem(14);
1564
+ box-sizing: border-box;
1565
+ background: $color-surface;
1566
+ color: $color-ink;
1567
+
1568
+ &:focus {
1569
+ outline: none;
1570
+ border-color: $color-accent;
1571
+ }
1572
+ }
1573
+
1574
+ button {
1575
+ display: none;
1576
+ }
1577
+ }
1578
+
1579
+ :deep(.leaflet-control-geocoder-icon) {
1580
+ cursor: pointer;
1581
+ flex: 0 0 40px;
1582
+ width: 40px !important;
1583
+ height: 38px !important;
1584
+ border: 1px solid $color-border !important;
1585
+ border-radius: 0 $border-radius-inter $border-radius-inter 0 !important;
1586
+ background-color: $color-bg !important;
1587
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.2 13l3.4 6.6c.6 1.1 2.5-.4 2-1.2l-4-6.2z'/%3E%3Ccircle cx='10.8' cy='8.9' r='3.9' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
1588
+ background-position: 50%;
1589
+ background-repeat: no-repeat;
1590
+ }
1591
+
1592
+ :deep(.leaflet-control-geocoder-throbber) .leaflet-control-geocoder-icon {
1593
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke='%23000' stroke-linecap='round' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cdefs/%3E%3Cg%3E%3Cpath stroke-opacity='.1' d='M14 8.4l3-5'/%3E%3Cpath stroke-opacity='.2' d='M15.6 10l5-3'/%3E%3Cpath stroke-opacity='.3' d='M16.2 12H22'/%3E%3Cpath stroke-opacity='.4' d='M15.6 14l5 3m-6.5-1.4l2.9 5'/%3E%3Cpath stroke-opacity='.5' d='M12 16.2V22m-2-6.4l-3 5'/%3E%3Cpath stroke-opacity='.6' d='M8.4 14l-5 3'/%3E%3Cpath stroke-opacity='.7' d='M7.8 12H2'/%3E%3Cpath stroke-opacity='.8' d='M8.4 10l-5-3'/%3E%3Cpath stroke-opacity='.9' d='M10 8.4l-3-5'/%3E%3Cpath d='M12 7.8V2'/%3E%3CanimateTransform attributeName='transform' calcMode='discrete' dur='1s' repeatCount='indefinite' type='rotate' values='0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12'/%3E%3C/g%3E%3C/svg%3E");
1594
+ }
1595
+
1596
+ :deep(.leaflet-control-geocoder-form-no-error) { display: none; }
1597
+
1598
+ :deep(.leaflet-control-geocoder-error) {
1599
+ position: absolute;
1600
+ left: 0;
1601
+ right: 0;
1602
+ top: 100%;
1603
+ z-index: 10;
1604
+ margin: 4px 0 0;
1605
+ padding: 8px 12px;
1606
+ background: $color-surface;
1607
+ border: 1px solid $color-border;
1608
+ border-radius: $border-radius-inter;
1609
+ color: $color-danger;
1610
+ display: block;
1611
+ }
1612
+
1613
+ :deep(.leaflet-control-geocoder-alternatives) {
1614
+ position: absolute;
1615
+ left: 0;
1616
+ right: 0;
1617
+ top: 100%;
1618
+ z-index: 10;
1619
+ margin: 4px 0 0;
1620
+ width: 100%;
1621
+ max-height: 250px;
1622
+ overflow: auto;
1623
+ padding: 0;
1624
+ list-style: none;
1625
+ display: block;
1626
+ background: $color-surface;
1627
+ border: 1px solid $color-border;
1628
+ border-radius: $border-radius-inter;
1629
+ box-shadow: $shadow-md;
1630
+
1631
+ li {
1632
+ white-space: nowrap;
1633
+ text-overflow: ellipsis;
1634
+ cursor: pointer;
1635
+ border-bottom: 1px solid $color-border;
1636
+ padding: 5px 8px;
1637
+ display: block;
1638
+ overflow: hidden;
1639
+
1640
+ a,
1641
+ a:hover {
1642
+ width: inherit;
1643
+ height: inherit;
1644
+ line-height: inherit;
1645
+ background: inherit;
1646
+ border-radius: inherit;
1647
+ text-align: left;
1648
+ }
1649
+
1650
+ &:last-child { border-bottom: none; }
1651
+ &:hover { background-color: $color-bg; }
1652
+ }
1653
+ }
1654
+
1655
+ :deep(.leaflet-control-geocoder-alternatives-minimized) {
1656
+ height: 0;
1657
+ display: none;
1658
+ }
1659
+
1660
+ :deep(.leaflet-control-geocoder-selected) {
1661
+ background-color: $color-bg;
1662
+ }
1663
+
1664
+ :deep(.leaflet-control-geocoder-address-context) {
1665
+ color: $color-muted;
1666
+ }
1667
+
1668
+ :deep(.leaflet-control-fit-bounds) a {
1669
+ display: flex;
1670
+ align-items: center;
1671
+ justify-content: center;
1672
+ width: 30px;
1673
+ height: 30px;
1674
+ line-height: 1;
1675
+ background: $color-surface;
1676
+ color: $color-ink;
1677
+
1678
+ &.is-disabled {
1679
+ opacity: 0.4;
1680
+ cursor: default;
1681
+ pointer-events: none;
1682
+ }
1683
+ }
1684
+
1685
+ :deep(.leaflet-control-fit-bounds__icon) {
1686
+ display: block;
1687
+ width: 14px;
1688
+ height: 14px;
1689
+ border: 2px solid currentColor;
1690
+ border-radius: 2px;
1691
+ box-sizing: border-box;
1692
+ position: relative;
1693
+
1694
+ &::after {
1695
+ content: '';
1696
+ position: absolute;
1697
+ inset: 2px;
1698
+ border: 1px dashed currentColor;
1699
+ }
1700
+ }
1701
+ }
1702
+
1703
+ @keyframes leaflet-control-locate-throb {
1704
+ 0% { stroke-width: 1px; }
1705
+ 50% {
1706
+ stroke-width: 3px;
1707
+ transform: scale(0.8);
1708
+ }
1709
+ 100% { stroke-width: 1px; }
1710
+ }
1711
+
1712
+ @keyframes leaflet-control-locate-spin {
1713
+ 0% { transform: rotate(0); }
1714
+ 100% { transform: rotate(360deg); }
1715
+ }
1716
+ </style>