@eightshift/frontend-libs-tailwind 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/.gitattributes +37 -0
  2. package/.github/CODEOWNERS +1 -0
  3. package/.github/CONTRIBUTING.md +17 -0
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +10 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +10 -0
  6. package/.github/ISSUE_TEMPLATE/question.md +10 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  8. package/.github/workflows/ci.yml +31 -0
  9. package/.husky/pre-commit +1 -0
  10. package/.prettierrc +14 -0
  11. package/.stylelintrc +4 -0
  12. package/CHANGELOG.md +13 -0
  13. package/CODE_OF_CONDUCT.md +76 -0
  14. package/LICENSE +21 -0
  15. package/README.md +24 -0
  16. package/blocks/init/assets/application-admin.js +10 -0
  17. package/blocks/init/assets/application.js +13 -0
  18. package/blocks/init/assets/images/index.js +5 -0
  19. package/blocks/init/assets/scripts/application-admin.js +7 -0
  20. package/blocks/init/assets/scripts/application.js +3 -0
  21. package/blocks/init/assets/scripts/theme-colors.js +39 -0
  22. package/blocks/init/assets/styles/application-admin.css +6 -0
  23. package/blocks/init/assets/styles/application.css +3 -0
  24. package/blocks/init/src/Blocks/assets/application-blocks-editor.js +14 -0
  25. package/blocks/init/src/Blocks/assets/application-blocks-frontend.js +13 -0
  26. package/blocks/init/src/Blocks/assets/application-blocks.js +9 -0
  27. package/blocks/init/src/Blocks/assets/scripts/application-blocks-editor.js +65 -0
  28. package/blocks/init/src/Blocks/assets/scripts/application-blocks-frontend.js +24 -0
  29. package/blocks/init/src/Blocks/assets/scripts/link-section-editor.js +258 -0
  30. package/blocks/init/src/Blocks/assets/scripts/shared.js +25 -0
  31. package/blocks/init/src/Blocks/assets/styles/application-blocks-editor.css +15 -0
  32. package/blocks/init/src/Blocks/assets/styles/application-blocks-frontend.css +12 -0
  33. package/blocks/init/src/Blocks/assets/styles/application-blocks.css +0 -0
  34. package/blocks/init/src/Blocks/assets/styles/editor/editor-overrides.css +15 -0
  35. package/blocks/init/src/Blocks/assets/styles/tailwind.css +34 -0
  36. package/blocks/init/src/Blocks/components/admin-theme-options/admin-theme-options.php +20 -0
  37. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/index.js +36 -0
  38. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/pages/parts.js +55 -0
  39. package/blocks/init/src/Blocks/components/admin-theme-options/manifest.json +5 -0
  40. package/blocks/init/src/Blocks/components/button/assets/index.js +22 -0
  41. package/blocks/init/src/Blocks/components/button/button.php +77 -0
  42. package/blocks/init/src/Blocks/components/button/components/button-editor.js +40 -0
  43. package/blocks/init/src/Blocks/components/button/components/button-options.js +135 -0
  44. package/blocks/init/src/Blocks/components/button/manifest.json +299 -0
  45. package/blocks/init/src/Blocks/components/card/card.php +42 -0
  46. package/blocks/init/src/Blocks/components/card/components/card-editor.js +39 -0
  47. package/blocks/init/src/Blocks/components/card/components/card-options.js +56 -0
  48. package/blocks/init/src/Blocks/components/card/manifest.json +111 -0
  49. package/blocks/init/src/Blocks/components/head/head.php +52 -0
  50. package/blocks/init/src/Blocks/components/head/manifest.json +17 -0
  51. package/blocks/init/src/Blocks/components/heading/components/heading-editor.js +30 -0
  52. package/blocks/init/src/Blocks/components/heading/components/heading-options.js +62 -0
  53. package/blocks/init/src/Blocks/components/heading/heading.php +45 -0
  54. package/blocks/init/src/Blocks/components/heading/manifest.json +76 -0
  55. package/blocks/init/src/Blocks/components/hero/components/hero-editor.js +42 -0
  56. package/blocks/init/src/Blocks/components/hero/components/hero-options.js +100 -0
  57. package/blocks/init/src/Blocks/components/hero/hero.php +45 -0
  58. package/blocks/init/src/Blocks/components/hero/manifest.json +96 -0
  59. package/blocks/init/src/Blocks/components/icon/components/icon-editor.js +23 -0
  60. package/blocks/init/src/Blocks/components/icon/components/icon-options.js +65 -0
  61. package/blocks/init/src/Blocks/components/icon/icon.php +34 -0
  62. package/blocks/init/src/Blocks/components/icon/manifest.json +1234 -0
  63. package/blocks/init/src/Blocks/components/image/components/image-editor.js +65 -0
  64. package/blocks/init/src/Blocks/components/image/components/image-options.js +111 -0
  65. package/blocks/init/src/Blocks/components/image/image.php +62 -0
  66. package/blocks/init/src/Blocks/components/image/manifest.json +125 -0
  67. package/blocks/init/src/Blocks/components/list/components/list-editor.js +30 -0
  68. package/blocks/init/src/Blocks/components/list/components/list-options.js +62 -0
  69. package/blocks/init/src/Blocks/components/list/list.php +32 -0
  70. package/blocks/init/src/Blocks/components/list/manifest.json +127 -0
  71. package/blocks/init/src/Blocks/components/load-more/assets/index.js +19 -0
  72. package/blocks/init/src/Blocks/components/load-more/assets/load-more.js +147 -0
  73. package/blocks/init/src/Blocks/components/load-more/components/load-more-editor.js +14 -0
  74. package/blocks/init/src/Blocks/components/load-more/components/load-more-options.js +18 -0
  75. package/blocks/init/src/Blocks/components/load-more/load-more.php +47 -0
  76. package/blocks/init/src/Blocks/components/load-more/manifest.json +39 -0
  77. package/blocks/init/src/Blocks/components/modal/assets/index.js +27 -0
  78. package/blocks/init/src/Blocks/components/modal/manifest.json +48 -0
  79. package/blocks/init/src/Blocks/components/modal/modal.php +46 -0
  80. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-editor.js +40 -0
  81. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-options.js +48 -0
  82. package/blocks/init/src/Blocks/components/paragraph/manifest.json +83 -0
  83. package/blocks/init/src/Blocks/components/paragraph/paragraph.php +33 -0
  84. package/blocks/init/src/Blocks/components/post-header/manifest.json +5 -0
  85. package/blocks/init/src/Blocks/components/post-header/post-header.php +24 -0
  86. package/blocks/init/src/Blocks/components/quote/components/quote-editor.js +53 -0
  87. package/blocks/init/src/Blocks/components/quote/components/quote-options.js +29 -0
  88. package/blocks/init/src/Blocks/components/quote/manifest.json +47 -0
  89. package/blocks/init/src/Blocks/components/quote/quote.php +49 -0
  90. package/blocks/init/src/Blocks/components/share/assets/index.js +39 -0
  91. package/blocks/init/src/Blocks/components/share/components/share-editor.js +25 -0
  92. package/blocks/init/src/Blocks/components/share/components/share-options.js +112 -0
  93. package/blocks/init/src/Blocks/components/share/manifest.json +72 -0
  94. package/blocks/init/src/Blocks/components/share/share.php +66 -0
  95. package/blocks/init/src/Blocks/components/tracking-before-body-end/manifest.json +5 -0
  96. package/blocks/init/src/Blocks/components/tracking-before-body-end/tracking-before-body-end.php +9 -0
  97. package/blocks/init/src/Blocks/components/tracking-head/manifest.json +5 -0
  98. package/blocks/init/src/Blocks/components/tracking-head/tracking-head.php +9 -0
  99. package/blocks/init/src/Blocks/components/video/components/video-editor.js +74 -0
  100. package/blocks/init/src/Blocks/components/video/components/video-options.js +280 -0
  101. package/blocks/init/src/Blocks/components/video/manifest.json +116 -0
  102. package/blocks/init/src/Blocks/components/video/video.php +72 -0
  103. package/blocks/init/src/Blocks/custom/accordion/accordion-block.js +15 -0
  104. package/blocks/init/src/Blocks/custom/accordion/accordion.php +28 -0
  105. package/blocks/init/src/Blocks/custom/accordion/assets/index.js +37 -0
  106. package/blocks/init/src/Blocks/custom/accordion/components/accordion-editor.js +17 -0
  107. package/blocks/init/src/Blocks/custom/accordion/components/accordion-options.js +18 -0
  108. package/blocks/init/src/Blocks/custom/accordion/manifest.json +32 -0
  109. package/blocks/init/src/Blocks/custom/accordion-item/accordion-item-block.js +19 -0
  110. package/blocks/init/src/Blocks/custom/accordion-item/accordion-item.php +46 -0
  111. package/blocks/init/src/Blocks/custom/accordion-item/components/accordion-item-editor.js +60 -0
  112. package/blocks/init/src/Blocks/custom/accordion-item/manifest.json +69 -0
  113. package/blocks/init/src/Blocks/custom/button/button-block.js +13 -0
  114. package/blocks/init/src/Blocks/custom/button/button.php +11 -0
  115. package/blocks/init/src/Blocks/custom/button/components/button-editor.js +12 -0
  116. package/blocks/init/src/Blocks/custom/button/components/button-options.js +12 -0
  117. package/blocks/init/src/Blocks/custom/button/manifest.json +18 -0
  118. package/blocks/init/src/Blocks/custom/card/card-block.js +13 -0
  119. package/blocks/init/src/Blocks/custom/card/card.php +11 -0
  120. package/blocks/init/src/Blocks/custom/card/components/card-editor.js +12 -0
  121. package/blocks/init/src/Blocks/custom/card/components/card-options.js +15 -0
  122. package/blocks/init/src/Blocks/custom/card/manifest.json +18 -0
  123. package/blocks/init/src/Blocks/custom/carousel/assets/index.js +46 -0
  124. package/blocks/init/src/Blocks/custom/carousel/assets/navigation.js +31 -0
  125. package/blocks/init/src/Blocks/custom/carousel/assets/pagination.js +39 -0
  126. package/blocks/init/src/Blocks/custom/carousel/carousel-block.js +21 -0
  127. package/blocks/init/src/Blocks/custom/carousel/carousel.php +61 -0
  128. package/blocks/init/src/Blocks/custom/carousel/components/carousel-editor.js +25 -0
  129. package/blocks/init/src/Blocks/custom/carousel/components/carousel-options.js +47 -0
  130. package/blocks/init/src/Blocks/custom/carousel/manifest.json +130 -0
  131. package/blocks/init/src/Blocks/custom/column/column-block.js +21 -0
  132. package/blocks/init/src/Blocks/custom/column/column-hooks.js +32 -0
  133. package/blocks/init/src/Blocks/custom/column/column.php +21 -0
  134. package/blocks/init/src/Blocks/custom/column/components/column-editor.js +19 -0
  135. package/blocks/init/src/Blocks/custom/column/components/column-options.js +579 -0
  136. package/blocks/init/src/Blocks/custom/column/manifest.json +625 -0
  137. package/blocks/init/src/Blocks/custom/columns/columns-block.js +20 -0
  138. package/blocks/init/src/Blocks/custom/columns/columns.php +21 -0
  139. package/blocks/init/src/Blocks/custom/columns/components/columns-editor.js +81 -0
  140. package/blocks/init/src/Blocks/custom/columns/components/columns-options.js +104 -0
  141. package/blocks/init/src/Blocks/custom/columns/manifest.json +555 -0
  142. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-editor.js +28 -0
  143. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-options.js +239 -0
  144. package/blocks/init/src/Blocks/custom/featured-content/featured-content-block.js +13 -0
  145. package/blocks/init/src/Blocks/custom/featured-content/featured-content.php +139 -0
  146. package/blocks/init/src/Blocks/custom/featured-content/manifest.json +131 -0
  147. package/blocks/init/src/Blocks/custom/featured-content/partials/cards.php +39 -0
  148. package/blocks/init/src/Blocks/custom/group/components/group-editor.js +8 -0
  149. package/blocks/init/src/Blocks/custom/group/group-block.js +14 -0
  150. package/blocks/init/src/Blocks/custom/group/group.php +10 -0
  151. package/blocks/init/src/Blocks/custom/group/manifest.json +32 -0
  152. package/blocks/init/src/Blocks/custom/heading/components/heading-editor.js +15 -0
  153. package/blocks/init/src/Blocks/custom/heading/components/heading-options.js +38 -0
  154. package/blocks/init/src/Blocks/custom/heading/heading-block.js +13 -0
  155. package/blocks/init/src/Blocks/custom/heading/heading-transforms.js +25 -0
  156. package/blocks/init/src/Blocks/custom/heading/heading.php +15 -0
  157. package/blocks/init/src/Blocks/custom/heading/manifest.json +79 -0
  158. package/blocks/init/src/Blocks/custom/hero/components/hero-editor.js +12 -0
  159. package/blocks/init/src/Blocks/custom/hero/components/hero-options.js +14 -0
  160. package/blocks/init/src/Blocks/custom/hero/hero-block.js +13 -0
  161. package/blocks/init/src/Blocks/custom/hero/hero.php +11 -0
  162. package/blocks/init/src/Blocks/custom/hero/manifest.json +17 -0
  163. package/blocks/init/src/Blocks/custom/image/components/image-editor.js +12 -0
  164. package/blocks/init/src/Blocks/custom/image/components/image-options.js +14 -0
  165. package/blocks/init/src/Blocks/custom/image/image-block.js +13 -0
  166. package/blocks/init/src/Blocks/custom/image/image.php +11 -0
  167. package/blocks/init/src/Blocks/custom/image/manifest.json +105 -0
  168. package/blocks/init/src/Blocks/custom/list/components/list-editor.js +14 -0
  169. package/blocks/init/src/Blocks/custom/list/components/list-options.js +39 -0
  170. package/blocks/init/src/Blocks/custom/list/list-block.js +13 -0
  171. package/blocks/init/src/Blocks/custom/list/list.php +15 -0
  172. package/blocks/init/src/Blocks/custom/list/manifest.json +58 -0
  173. package/blocks/init/src/Blocks/custom/map/assets/index.js +20 -0
  174. package/blocks/init/src/Blocks/custom/map/assets/map-controller.js +42 -0
  175. package/blocks/init/src/Blocks/custom/map/assets/utils.js +161 -0
  176. package/blocks/init/src/Blocks/custom/map/components/map-components.js +403 -0
  177. package/blocks/init/src/Blocks/custom/map/components/map-editor.js +56 -0
  178. package/blocks/init/src/Blocks/custom/map/components/map-options.js +557 -0
  179. package/blocks/init/src/Blocks/custom/map/manifest.json +79 -0
  180. package/blocks/init/src/Blocks/custom/map/map-block.js +13 -0
  181. package/blocks/init/src/Blocks/custom/map/map.php +52 -0
  182. package/blocks/init/src/Blocks/custom/map/styles.css +2 -0
  183. package/blocks/init/src/Blocks/custom/modal/components/modal-editor.js +90 -0
  184. package/blocks/init/src/Blocks/custom/modal/manifest.json +51 -0
  185. package/blocks/init/src/Blocks/custom/modal/modal-block.js +14 -0
  186. package/blocks/init/src/Blocks/custom/modal/modal.php +20 -0
  187. package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-editor.js +41 -0
  188. package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-options.js +38 -0
  189. package/blocks/init/src/Blocks/custom/paragraph/manifest.json +79 -0
  190. package/blocks/init/src/Blocks/custom/paragraph/paragraph-block.js +13 -0
  191. package/blocks/init/src/Blocks/custom/paragraph/paragraph-transforms.js +45 -0
  192. package/blocks/init/src/Blocks/custom/paragraph/paragraph.php +15 -0
  193. package/blocks/init/src/Blocks/custom/quote/components/quote-editor.js +12 -0
  194. package/blocks/init/src/Blocks/custom/quote/components/quote-options.js +14 -0
  195. package/blocks/init/src/Blocks/custom/quote/manifest.json +17 -0
  196. package/blocks/init/src/Blocks/custom/quote/quote-block.js +13 -0
  197. package/blocks/init/src/Blocks/custom/quote/quote.php +13 -0
  198. package/blocks/init/src/Blocks/custom/share/components/share-editor.js +6 -0
  199. package/blocks/init/src/Blocks/custom/share/components/share-options.js +12 -0
  200. package/blocks/init/src/Blocks/custom/share/manifest.json +19 -0
  201. package/blocks/init/src/Blocks/custom/share/share-block.js +13 -0
  202. package/blocks/init/src/Blocks/custom/share/share.php +11 -0
  203. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-editor.js +57 -0
  204. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-options.js +106 -0
  205. package/blocks/init/src/Blocks/custom/site-footer/manifest.json +73 -0
  206. package/blocks/init/src/Blocks/custom/site-footer/site-footer-block.js +13 -0
  207. package/blocks/init/src/Blocks/custom/site-footer/site-footer.php +72 -0
  208. package/blocks/init/src/Blocks/custom/site-navigation/assets/index.js +9 -0
  209. package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-editor.js +42 -0
  210. package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-options.js +73 -0
  211. package/blocks/init/src/Blocks/custom/site-navigation/manifest.json +77 -0
  212. package/blocks/init/src/Blocks/custom/site-navigation/site-navigation-block.js +13 -0
  213. package/blocks/init/src/Blocks/custom/site-navigation/site-navigation.php +99 -0
  214. package/blocks/init/src/Blocks/custom/table-of-contents/assets/index.js +58 -0
  215. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-editor.js +38 -0
  216. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-options.js +32 -0
  217. package/blocks/init/src/Blocks/custom/table-of-contents/manifest.json +48 -0
  218. package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents-block.js +13 -0
  219. package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents.php +31 -0
  220. package/blocks/init/src/Blocks/custom/video/components/video-editor.js +6 -0
  221. package/blocks/init/src/Blocks/custom/video/components/video-options.js +12 -0
  222. package/blocks/init/src/Blocks/custom/video/manifest.json +105 -0
  223. package/blocks/init/src/Blocks/custom/video/video-block.js +13 -0
  224. package/blocks/init/src/Blocks/custom/video/video.php +22 -0
  225. package/blocks/init/src/Blocks/manifest.json +14 -0
  226. package/blocks/init/src/Blocks/variations/card-simple/manifest.json +17 -0
  227. package/blocks/init/src/Blocks/wrapper/components/wrapper-editor.js +12 -0
  228. package/blocks/init/src/Blocks/wrapper/components/wrapper-options.js +348 -0
  229. package/blocks/init/src/Blocks/wrapper/manifest.json +450 -0
  230. package/blocks/init/src/Blocks/wrapper/styles-editor.css +13 -0
  231. package/blocks/init/src/Blocks/wrapper/styles.css +19 -0
  232. package/blocks/init/src/Blocks/wrapper/wrapper.js +30 -0
  233. package/blocks/init/src/Blocks/wrapper/wrapper.php +34 -0
  234. package/eslint.config.mjs +3 -0
  235. package/linters/base.config.mjs +81 -0
  236. package/linters/eslint.config.mjs +4 -0
  237. package/linters/ignore-gitignored.mjs +9 -0
  238. package/linters/stylelint.config.js +146 -0
  239. package/package.json +93 -0
  240. package/readme/packages.md +74 -0
  241. package/schemas/block.json +302 -0
  242. package/schemas/component.json +240 -0
  243. package/schemas/globalManifest.json +73 -0
  244. package/schemas/variation.json +83 -0
  245. package/scripts/components/block-inserter.js +70 -0
  246. package/scripts/components/file-picker.js +243 -0
  247. package/scripts/components/index.js +6 -0
  248. package/scripts/components/link-section-editor.js +319 -0
  249. package/scripts/components/media-picker.js +86 -0
  250. package/scripts/components/server-side-render.js +37 -0
  251. package/scripts/components/settings/settings.js +48 -0
  252. package/scripts/components/settings/use-theme-options.js +52 -0
  253. package/scripts/editor/attributes.js +304 -0
  254. package/scripts/editor/colors.js +64 -0
  255. package/scripts/editor/editor.js +139 -0
  256. package/scripts/editor/fetch.js +102 -0
  257. package/scripts/editor/hooks.js +44 -0
  258. package/scripts/editor/index.js +11 -0
  259. package/scripts/editor/options.js +152 -0
  260. package/scripts/editor/registration.js +901 -0
  261. package/scripts/editor/store.js +213 -0
  262. package/scripts/editor/tailwindcss.js +224 -0
  263. package/scripts/editor/utility.js +47 -0
  264. package/scripts/helpers/breakpoints.js +48 -0
  265. package/scripts/helpers/cookies.js +65 -0
  266. package/scripts/helpers/dynamic-import.js +19 -0
  267. package/scripts/helpers/index.js +11 -0
  268. package/scripts/index.js +22 -0
  269. package/scripts/plugins/index.js +3 -0
  270. package/scripts/plugins/yoast-seo.js +70 -0
  271. package/webpack/base.mjs +138 -0
  272. package/webpack/helpers.mjs +67 -0
  273. package/webpack/index.mjs +52 -0
  274. package/webpack/production.mjs +60 -0
  275. package/webpack/project.mjs +55 -0
@@ -0,0 +1,557 @@
1
+ import { __ } from '@wordpress/i18n';
2
+ import { checkAttr, getAttrKey, FileSelector } from '@eightshift/frontend-libs-tailwind/scripts';
3
+ import {
4
+ Button,
5
+ Repeater,
6
+ RepeaterItem,
7
+ Notice,
8
+ InputField,
9
+ Menu,
10
+ MenuItem,
11
+ RichLabel,
12
+ MenuSeparator,
13
+ Spacer,
14
+ HStack,
15
+ NumberPicker,
16
+ Toggle,
17
+ Expandable,
18
+ } from '@eightshift/ui-components';
19
+ import { icons } from '@eightshift/ui-components/icons';
20
+ import { truncateMiddle } from '@eightshift/ui-components/utilities';
21
+ import manifest from '../manifest.json';
22
+
23
+ export const MapOptions = ({ attributes, setAttributes }) => {
24
+ const mapLayers = checkAttr('mapLayers', attributes, manifest);
25
+ const mapCenterLat = checkAttr('mapCenterLat', attributes, manifest);
26
+ const mapCenterLon = checkAttr('mapCenterLon', attributes, manifest);
27
+ const mapZoom = checkAttr('mapZoom', attributes, manifest);
28
+ const mapInteractions = checkAttr('mapInteractions', attributes, manifest);
29
+ const mapControls = checkAttr('mapControls', attributes, manifest);
30
+
31
+ const layerTypes = {
32
+ openStreetMap: {
33
+ icon: icons.mapLayer,
34
+ title: __('OpenStreetMap', '%g_textdomain%'),
35
+ hasSeparator: true,
36
+ },
37
+ vectorJson: {
38
+ icon: icons.mapLayerJson,
39
+ title: __('Vector map', '%g_textdomain%'),
40
+ subtitle: __('with JSON styles', '%g_textdomain%'),
41
+ hasSeparator: true,
42
+ },
43
+ mapBoxVector: {
44
+ icon: icons.mapLayerVector,
45
+ title: __('Mapbox map', '%g_textdomain%'),
46
+ subtitle: __('Vector tiles', '%g_textdomain%'),
47
+ },
48
+ mapBoxRaster: {
49
+ icon: icons.mapLayerRaster,
50
+ title: __('Mapbox map', '%g_textdomain%'),
51
+ subtitle: __('Raster tiles', '%g_textdomain%'),
52
+ hasSeparator: true,
53
+ },
54
+ mapTilerVector: {
55
+ icon: icons.mapLayerVector,
56
+ title: __('MapTiler tiles', '%g_textdomain%'),
57
+ subtitle: __('Vector - XYZ (PBF)', '%g_textdomain%'),
58
+ },
59
+ mapTilerRasterXyz: {
60
+ icon: icons.mapLayerRaster,
61
+ title: __('MapTiler map/tiles', '%g_textdomain%'),
62
+ subtitle: __('Raster - XYZ', '%g_textdomain%'),
63
+ },
64
+ mapTilerRasterJson: {
65
+ icon: icons.mapLayerRaster,
66
+ title: __('MapTiler map/tiles', '%g_textdomain%'),
67
+ subtitle: __('Raster - JSON', '%g_textdomain%'),
68
+ hasSeparator: true,
69
+ },
70
+ geoJson: { icon: icons.fileMetadata, title: __('GeoJSON', '%g_textdomain%') },
71
+ };
72
+
73
+ return (
74
+ <>
75
+ <Repeater
76
+ icon={icons.layers}
77
+ label={__('Layers', '%g_textdomain%')}
78
+ items={mapLayers}
79
+ onChange={(value) => setAttributes({ [getAttrKey('mapLayers', attributes, manifest)]: value })}
80
+ addButton={({ addItem, disabled }) => (
81
+ <Menu
82
+ triggerIcon={icons.add}
83
+ triggerProps={{ size: 'small', disabled: disabled }}
84
+ >
85
+ {Object.entries(layerTypes).map(([value, { icon, title, subtitle, hasSeparator }]) => {
86
+ return (
87
+ <>
88
+ <MenuItem
89
+ key={value}
90
+ icon={icon}
91
+ onClick={() => {
92
+ addItem({
93
+ type: value,
94
+ hidden: false,
95
+ });
96
+ }}
97
+ >
98
+ <RichLabel
99
+ label={title}
100
+ subtitle={subtitle}
101
+ />
102
+ </MenuItem>
103
+
104
+ {hasSeparator && <MenuSeparator />}
105
+ </>
106
+ );
107
+ })}
108
+ </Menu>
109
+ )}
110
+ >
111
+ {(layer) => {
112
+ const { type, apiKey, geoJsonUrl, geoJsonId, styleUrl, hidden, updateData } = layer;
113
+
114
+ const needsApiKey = [
115
+ 'mapBoxVector',
116
+ 'mapBoxRaster',
117
+ 'mapTilerVector',
118
+ 'vectorJson',
119
+ 'mapTilerRasterXyz',
120
+ 'mapTilerRasterJson',
121
+ ].includes(type);
122
+ // eslint-disable-next-line max-len
123
+ const hasMapStyleOptions = [
124
+ 'mapBoxVector',
125
+ 'mapBoxRaster',
126
+ 'mapTilerVector',
127
+ 'vectorJson',
128
+ 'mapTilerRasterXyz',
129
+ 'mapTilerRasterJson',
130
+ ].includes(type);
131
+
132
+ return (
133
+ <RepeaterItem
134
+ icon={layer?.type ? layerTypes?.[layer?.type]?.icon ?? icons.mapLayer : icons.layerOff}
135
+ label={layerTypes?.[type]?.title ?? __('New layer', '%g_textdomain%')}
136
+ subtitle={
137
+ type === 'geoJson'
138
+ ? truncateMiddle(geoJsonUrl?.slice(geoJsonUrl?.lastIndexOf('/') + 1) ?? '', 20)
139
+ : layerTypes?.[type]?.subtitle
140
+ }
141
+ actions={
142
+ layer?.type?.length < 1 ? (
143
+ icons.dummySpacer
144
+ ) : (
145
+ <Button
146
+ icon={hidden ? icons.dummySpacer : icons.visible}
147
+ onPress={() => updateData({ hidden: !hidden })}
148
+ tooltip={hidden ? __('Show', '%g_textdomain%') : __('Hide', '%g_textdomain%')}
149
+ size='small'
150
+ />
151
+ )
152
+ }
153
+ textValue={layerTypes?.[type]?.title ?? __('New layer', '%g_textdomain%')}
154
+ expandDisabled={type === 'openStreetMap'}
155
+ >
156
+ {!type && (
157
+ <Notice
158
+ type='error'
159
+ label={__('Error', '%g_textdomain%')}
160
+ subtitle={__('Layer type is missing, please remove the layer and add a new one.', '%g_textdomain%')}
161
+ />
162
+ )}
163
+
164
+ {needsApiKey && (
165
+ <InputField
166
+ icon={icons.key}
167
+ label={__('API key', '%g_textdomain%')}
168
+ value={apiKey}
169
+ onChange={(value) => updateData({ apiKey: value })}
170
+ />
171
+ )}
172
+
173
+ {hasMapStyleOptions && (
174
+ <InputField
175
+ icon={icons.color}
176
+ label={__('Map style', '%g_textdomain%')}
177
+ value={styleUrl}
178
+ onChange={(value) => updateData({ styleUrl: value })}
179
+ help={
180
+ <>
181
+ {!type?.startsWith('mapBox') &&
182
+ __(
183
+ 'Copy the full style URL from MapTiler. Keep the API key inside the URL.',
184
+ '%g_textdomain%',
185
+ )}
186
+ {type === 'mapBoxVector' && __('Copy the full style URL from Mapbox.', '%g_textdomain%')}
187
+ {type === 'mapBoxRaster' &&
188
+ // eslint-disable-next-line max-len
189
+ __(
190
+ 'Copy the full style URL from Mapbox or a Mapbox-compatible source. Keep the access token inside the URL.',
191
+ '%g_textdomain%',
192
+ )}
193
+ <br />
194
+ <br />
195
+ {['mapBoxRaster', 'mapTilerVector', 'mapTilerRasterXyz'].includes(type) && (
196
+ <>
197
+ <code className='es-bg-transparent es-p-0 es-text-3'>{'{z}/{x}/{y}'}</code>
198
+ {
199
+ // eslint-disable-next-line max-len
200
+ __(
201
+ "should be left as they are in the URL; they're needed for the map to work properly.",
202
+ '%g_textdomain%',
203
+ )
204
+ }
205
+ <br />
206
+ <br />
207
+ </>
208
+ )}
209
+ {__('Example', '%g_textdomain%')}:
210
+ <br />
211
+ <span className='es-word-break-all'>
212
+ {['mapTilerRasterJson', 'vectorJson'].includes(type) &&
213
+ 'https://api.maptiler.com/maps/{styleName}/tiles.json?key={apiKey}'}
214
+
215
+ {type === 'mapTilerVector' && 'https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key={apiKey}'}
216
+
217
+ {type === 'mapBoxVector' && (
218
+ <>
219
+ {'mapbox://styles/{styleName},'}
220
+ <br />
221
+ {'mapbox://styles/{userId}/{styleId}'}
222
+ </>
223
+ )}
224
+
225
+ {type === 'mapBoxRaster' &&
226
+ 'https://api.mapbox.com/v4/{tilesetId}/{z}/{x}/{y}[@2x].{imageFormat}?acess_token={apiKey}'}
227
+
228
+ {type === 'mapTilerRasterXyz' &&
229
+ 'https://api.maptiler.com/maps/{styleName}/{z}/{x}/{y}.png?key={apiKey}'}
230
+ </span>
231
+ </>
232
+ }
233
+ />
234
+ )}
235
+
236
+ {type === 'geoJson' && (
237
+ <FileSelector
238
+ onChange={({ id, url }) => updateData({ geoJsonUrl: url, geoJsonId: id })}
239
+ fileId={geoJsonId}
240
+ fileName={geoJsonUrl?.slice(geoJsonUrl?.lastIndexOf('/') + 1)}
241
+ allowedTypes={['application/geo+json', 'application/json']}
242
+ kind='geoJson'
243
+ />
244
+ )}
245
+ </RepeaterItem>
246
+ );
247
+ }}
248
+ </Repeater>
249
+ <Spacer />
250
+
251
+ <div>
252
+ <Expandable
253
+ label={__('Map display', '%g_textdomain%')}
254
+ icon={icons.browser}
255
+ >
256
+ <Toggle
257
+ icon={icons.tag}
258
+ label={__('Attribution', '%g_textdomain%')}
259
+ subtitle={__('Check map provider ToC', '%g_textdomain%')}
260
+ checked={mapControls.attribution}
261
+ onChange={(value) => {
262
+ const newValue = { ...mapControls };
263
+ newValue.attribution = value;
264
+
265
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
266
+ }}
267
+ />
268
+
269
+ <Spacer />
270
+
271
+ <Toggle
272
+ icon={icons.mapPin}
273
+ label={__('Minimap', '%g_textdomain%')}
274
+ checked={mapControls.overviewMap}
275
+ onChange={(value) => {
276
+ const newValue = { ...mapControls };
277
+ newValue.overviewMap = value;
278
+
279
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
280
+ }}
281
+ />
282
+
283
+ <Toggle
284
+ icon={icons.ruler}
285
+ label={__('Map scale', '%g_textdomain%')}
286
+ checked={mapControls.scaleLine}
287
+ onChange={(value) => {
288
+ const newValue = { ...mapControls };
289
+ newValue.scaleLine = value;
290
+
291
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
292
+ }}
293
+ />
294
+
295
+ <Spacer />
296
+
297
+ <Toggle
298
+ icon={icons.mouseCursor}
299
+ label={__('Pointer position', '%g_textdomain%')}
300
+ checked={mapControls.mousePosition}
301
+ onChange={(value) => {
302
+ const newValue = { ...mapControls };
303
+ newValue.mousePosition = value;
304
+
305
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
306
+ }}
307
+ />
308
+
309
+ <Spacer />
310
+
311
+ <Toggle
312
+ icon={icons.expandXl}
313
+ label={__('Full screen', '%g_textdomain%')}
314
+ checked={mapControls.fullScreen}
315
+ onChange={(value) => {
316
+ const newValue = { ...mapControls };
317
+ newValue.fullScreen = value;
318
+
319
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
320
+ }}
321
+ />
322
+
323
+ <Toggle
324
+ icon={icons.slider}
325
+ label={__('Zoom slider', '%g_textdomain%')}
326
+ checked={mapControls.zoomSlider}
327
+ onChange={(value) => {
328
+ const newValue = { ...mapControls };
329
+ newValue.zoomSlider = value;
330
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
331
+ }}
332
+ />
333
+
334
+ <Toggle
335
+ icon={icons.plusMinusButtonsV}
336
+ label={__('Zoom buttons', '%g_textdomain%')}
337
+ checked={mapControls.zoom}
338
+ onChange={(value) => {
339
+ const newValue = { ...mapControls };
340
+ newValue.zoom = value;
341
+
342
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
343
+ }}
344
+ />
345
+
346
+ <Toggle
347
+ icon={icons.roundedCorners}
348
+ label={__('Zoom to extent', '%g_textdomain%')}
349
+ checked={mapControls.zoomToExtent}
350
+ onChange={(value) => {
351
+ const newValue = { ...mapControls };
352
+ newValue.zoomToExtent = value;
353
+
354
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
355
+ }}
356
+ />
357
+
358
+ <Toggle
359
+ icon={icons.rotateLeft}
360
+ label={__('Reset rotation', '%g_textdomain%')}
361
+ checked={mapControls.rotate}
362
+ onChange={(value) => {
363
+ const newValue = { ...mapControls };
364
+ newValue.rotate = value;
365
+
366
+ setAttributes({ [getAttrKey('mapControls', attributes, manifest)]: newValue });
367
+ }}
368
+ />
369
+ </Expandable>
370
+
371
+ <Expandable
372
+ label={__('Map interactions', '%g_textdomain%')}
373
+ icon={icons.pointerHand}
374
+ >
375
+ <Toggle
376
+ icon={icons.focus}
377
+ label={__('Only when map is focused', '%g_textdomain%')}
378
+ checked={mapInteractions.onFocusOnly}
379
+ onChange={(value) => {
380
+ const newValue = { ...mapInteractions };
381
+ newValue.onFocusOnly = value;
382
+
383
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
384
+ }}
385
+ />
386
+
387
+ <Spacer />
388
+
389
+ <Toggle
390
+ icon={icons.keyboard}
391
+ label={__('Keyboard interactions', '%g_textdomain%')}
392
+ checked={mapInteractions.keyboard}
393
+ onChange={(value) => {
394
+ const newValue = { ...mapInteractions };
395
+ newValue.keyboard = value;
396
+
397
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
398
+ }}
399
+ />
400
+
401
+ <Toggle
402
+ icon={icons.cursorMove}
403
+ label={__('Drag to move map', '%g_textdomain%')}
404
+ checked={mapInteractions.dragPan}
405
+ onChange={(value) => {
406
+ const newValue = { ...mapInteractions };
407
+ newValue.dragPan = value;
408
+
409
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
410
+ }}
411
+ />
412
+
413
+ <Spacer />
414
+
415
+ <Spacer
416
+ icon={icons.rotateRight}
417
+ text={__('Rotation', '%g_textdomain%')}
418
+ border
419
+ />
420
+
421
+ <Toggle
422
+ label={__('Alt+Shift and drag to rotate', '%g_textdomain%')}
423
+ checked={mapInteractions.altShiftDragRotate}
424
+ onChange={(value) => {
425
+ const newValue = { ...mapInteractions };
426
+ newValue.altShiftDragRotate = value;
427
+
428
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
429
+ }}
430
+ />
431
+
432
+ <Toggle
433
+ label={__('Pinch to rotate', '%g_textdomain%')}
434
+ checked={mapInteractions.pinchRotate}
435
+ onChange={(value) => {
436
+ const newValue = { ...mapInteractions };
437
+ newValue.pinchRotate = value;
438
+
439
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
440
+ }}
441
+ />
442
+
443
+ <Spacer />
444
+ <Spacer
445
+ icon={icons.search}
446
+ text={__('Zoom', '%g_textdomain%')}
447
+ border
448
+ />
449
+
450
+ <Toggle
451
+ label={__('Double-click to zoom', '%g_textdomain%')}
452
+ checked={mapInteractions.doubleClickZoom}
453
+ onChange={(value) => {
454
+ const newValue = { ...mapInteractions };
455
+ newValue.doubleClickZoom = value;
456
+
457
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
458
+ }}
459
+ />
460
+
461
+ <Toggle
462
+ label={__('Zoom with mousewheel', '%g_textdomain%')}
463
+ checked={mapInteractions.mouseWheelZoom}
464
+ onChange={(value) => {
465
+ const newValue = { ...mapInteractions };
466
+ newValue.mouseWheelZoom = value;
467
+
468
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
469
+ }}
470
+ />
471
+
472
+ <Toggle
473
+ label={__('Shift and drag to zoom', '%g_textdomain%')}
474
+ checked={mapInteractions.shiftDragZoom}
475
+ onChange={(value) => {
476
+ const newValue = { ...mapInteractions };
477
+ newValue.shiftDragZoom = value;
478
+
479
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
480
+ }}
481
+ />
482
+
483
+ <Toggle
484
+ label={__('Pinch to zoom', '%g_textdomain%')}
485
+ checked={mapInteractions.pinchZoom}
486
+ onChange={(value) => {
487
+ const newValue = { ...mapInteractions };
488
+ newValue.pinchZoom = value;
489
+
490
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
491
+ }}
492
+ />
493
+
494
+ <NumberPicker
495
+ label={__('Transition duration', '%g_textdomain%')}
496
+ value={mapInteractions.zoomDuration}
497
+ onChange={(value) => {
498
+ const newValue = { ...mapInteractions };
499
+ newValue.zoomDuration = value;
500
+
501
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
502
+ }}
503
+ min={0}
504
+ max={10000}
505
+ suffix='ms'
506
+ inline
507
+ />
508
+
509
+ <NumberPicker
510
+ label={__('Zoom-in step', '%g_textdomain%')}
511
+ value={mapInteractions.zoomDelta}
512
+ onChange={(value) => {
513
+ const newValue = { ...mapInteractions };
514
+ newValue.zoomDelta = value;
515
+ setAttributes({ [getAttrKey('mapInteractions', attributes, manifest)]: newValue });
516
+ }}
517
+ min={1}
518
+ max={10}
519
+ inline
520
+ />
521
+ </Expandable>
522
+ </div>
523
+
524
+ <Spacer />
525
+ <Spacer
526
+ icon={icons.centerPoint}
527
+ text={__('Start point', '%g_textdomain%')}
528
+ border
529
+ />
530
+
531
+ <HStack noWrap>
532
+ <InputField
533
+ label={__('Lat', '%g_textdomain%')}
534
+ value={mapCenterLat}
535
+ onChange={(value) => setAttributes({ [getAttrKey('mapCenterLat', attributes, manifest)]: value })}
536
+ placeholder='46.314045'
537
+ />
538
+
539
+ <InputField
540
+ label={__('Lon', '%g_textdomain%')}
541
+ value={mapCenterLon}
542
+ onChange={(value) => setAttributes({ [getAttrKey('mapCenterLon', attributes, manifest)]: value })}
543
+ placeholder='16.352532'
544
+ />
545
+
546
+ <NumberPicker
547
+ label={__('Zoom', '%g_textdomain%')}
548
+ value={mapZoom}
549
+ onChange={(value) => setAttributes({ [getAttrKey('mapZoom', attributes, manifest)]: value })}
550
+ min={1}
551
+ max={30}
552
+ placeholder='14'
553
+ />
554
+ </HStack>
555
+ </>
556
+ );
557
+ };
@@ -0,0 +1,79 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
+ "blockName": "map",
4
+ "title": "Map",
5
+ "description": "Show locations on a map.",
6
+ "category": "eightshift",
7
+ "icon": {
8
+ "src": "es-map"
9
+ },
10
+ "keywords": [
11
+ "Example Keyword"
12
+ ],
13
+ "example": {
14
+ "attributes": {
15
+ "exampleContent": ""
16
+ }
17
+ },
18
+ "attributes": {
19
+ "mapLayers": {
20
+ "type": "array",
21
+ "default": [
22
+ {
23
+ "id": 1,
24
+ "type": "openStreetMap"
25
+ }
26
+ ]
27
+ },
28
+ "mapInteractions": {
29
+ "type": "object",
30
+ "default": {
31
+ "altShiftDragRotate": true,
32
+ "onFocusOnly": false,
33
+ "doubleClickZoom": true,
34
+ "keyboard": true,
35
+ "mouseWheelZoom": false,
36
+ "shiftDragZoom": true,
37
+ "dragPan": true,
38
+ "pinchRotate": true,
39
+ "pinchZoom": true
40
+ }
41
+ },
42
+ "mapControls": {
43
+ "type": "object",
44
+ "default": {
45
+ "attribution": true,
46
+ "fullScreen": false,
47
+ "mousePosition": false,
48
+ "overviewMap": false,
49
+ "rotate": true,
50
+ "scaleLine": false,
51
+ "zoomSlider": false,
52
+ "zoomToExtent": false,
53
+ "zoom": true
54
+ }
55
+ },
56
+ "mapCenterLat": {
57
+ "type": "string"
58
+ },
59
+ "mapCenterLon": {
60
+ "type": "string"
61
+ },
62
+ "mapZoom": {
63
+ "type": "number",
64
+ "default": 14
65
+ }
66
+ },
67
+ "nodeDependency": [
68
+ "ol@8",
69
+ "ol-mapbox-style@12"
70
+ ],
71
+ "resources": {
72
+ "markerIcon": "data:image/svg+xml,<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 7.35938C16 11.9873 11.8347 16.9857 10.1728 18.7958C9.80508 19.1964 9.19492 19.1964 8.82717 18.7958C7.16529 16.9857 3 11.9873 3 7.35938C3 3.84719 5.91015 1 9.5 1C13.0899 1 16 3.84719 16 7.35938Z\" fill=\"%233A66A8\" stroke=\"%232E5590\" stroke-linejoin=\"round\"/><path d=\"M9.5 9.25C10.4665 9.25 11.25 8.4665 11.25 7.5C11.25 6.5335 10.4665 5.75 9.5 5.75C8.5335 5.75 7.75 6.5335 7.75 7.5C7.75 8.4665 8.5335 9.25 9.5 9.25Z\" fill=\"white\"/></svg>"
73
+ },
74
+ "tailwind": {
75
+ "base": {
76
+ "twClasses": "w-full aspect-3/2 rounded-lg border border-gray-300 shadow-md overflow-hidden"
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,13 @@
1
+ import { MapEditor } from './components/map-editor';
2
+ import { MapOptions } from './components/map-options';
3
+ import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
4
+
5
+ export const Map = (props) => {
6
+ return (
7
+ <GutenbergBlock
8
+ {...props}
9
+ options={MapOptions}
10
+ editor={MapEditor}
11
+ />
12
+ );
13
+ };
@@ -0,0 +1,52 @@
1
+ <?php
2
+
3
+ /**
4
+ * Map block template.
5
+ *
6
+ * @package %g_namespace%
7
+ */
8
+
9
+ use %g_namespace_vendor_prefix%\EightshiftLibs\Helpers\Helpers;
10
+
11
+ $manifest = Helpers::getManifestByDir(__DIR__);
12
+
13
+ $blockClass = $attributes['blockClass'] ?? '';
14
+ $blockJsClass = $attributes['blockJsClass'] ?? '';
15
+
16
+ $mapLayers = Helpers::checkAttr('mapLayers', $attributes, $manifest);
17
+ $mapCenterLat = Helpers::checkAttr('mapCenterLat', $attributes, $manifest);
18
+ $mapCenterLon = Helpers::checkAttr('mapCenterLon', $attributes, $manifest);
19
+ $mapZoom = Helpers::checkAttr('mapZoom', $attributes, $manifest);
20
+ $mapInteractions = Helpers::checkAttr('mapInteractions', $attributes, $manifest);
21
+ $mapControls = Helpers::checkAttr('mapControls', $attributes, $manifest);
22
+
23
+ // Take only active map layers and clean them up a bit so the output JSON is smaller.
24
+ $activeLayers = array_filter($mapLayers, fn ($layer) => ($layer['hidden'] ?? false) === false);
25
+
26
+ $activeLayers = array_map(function ($layer) {
27
+ unset($layer['id']);
28
+
29
+ if (isset($layer['hidden'])) {
30
+ unset($layer['hidden']);
31
+ }
32
+
33
+ return $layer;
34
+ }, $activeLayers);
35
+
36
+ // Reverse array so the last element is on top, to match editor.
37
+ $activeLayers = array_reverse($activeLayers);
38
+
39
+ // Reset the keys.
40
+ $activeLayers = array_values($activeLayers);
41
+ ?>
42
+
43
+ <div
44
+ class="<?php echo esc_attr(Helpers::getTwClasses($attributes, $manifest, $blockJsClass)); ?>"
45
+ data-center-lat="<?php echo esc_attr($mapCenterLat); ?>"
46
+ data-center-lon="<?php echo esc_attr($mapCenterLon); ?>"
47
+ data-center-zoom="<?php echo esc_attr($mapZoom); ?>"
48
+ data-map-interactions="<?php echo esc_attr(wp_json_encode($mapInteractions)); ?>"
49
+ data-map-controls="<?php echo esc_attr(wp_json_encode($mapControls)); ?>"
50
+ data-map-layers="<?php echo esc_attr(wp_json_encode($activeLayers)); ?>"
51
+ >
52
+ </div>
@@ -0,0 +1,2 @@
1
+ /* OpenLayers */
2
+ @import '~ol/ol.css';